Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21397e931a | ||
|
|
6def6dbb13 | ||
|
|
4bd07ff2a8 | ||
|
|
9af802b19a | ||
|
|
6c61862192 | ||
|
|
8de6ebd120 | ||
|
|
0e90d1abc4 | ||
|
|
029f26f52b | ||
|
|
fd697a78a1 | ||
|
|
782a40f709 | ||
|
|
e20700b880 | ||
|
|
4edd166532 | ||
|
|
a0daaacf6d | ||
|
|
868202cc90 | ||
|
|
a036ebc7fa | ||
|
|
d4d64568c4 | ||
|
|
6c7c3a464b | ||
|
|
37dc3f3f9a | ||
|
|
506078ceec | ||
|
|
5305deddb4 | ||
|
|
ce0831ac07 | ||
|
|
4d9aeafe84 | ||
|
|
b832e272de | ||
|
|
3c356c438e | ||
|
|
6147d667f1 | ||
|
|
9e6782f08d | ||
|
|
e9bf23509a | ||
|
|
be2a93f8b3 | ||
|
|
1a98943b7b | ||
|
|
499e54afc2 | ||
|
|
9ee77a4e1d | ||
|
|
a34a56760f | ||
|
|
fa31ed23d4 | ||
|
|
196b7aeb57 | ||
|
|
ed157739e4 | ||
|
|
b53615f711 | ||
|
|
9f00f57f9b | ||
|
|
1dd630c767 | ||
|
|
5b3407dac4 | ||
|
|
58211b7d40 | ||
|
|
bec354837c | ||
|
|
fdb76cca90 | ||
|
|
a9fa3ee3a7 | ||
|
|
992d7ba767 | ||
|
|
8dcef19700 | ||
|
|
ebb00aec78 | ||
|
|
42b1cc902b | ||
|
|
1910dad049 | ||
|
|
87d3ef70eb | ||
|
|
a38283a21a | ||
|
|
0b195c831b | ||
|
|
236a41fbc4 | ||
|
|
182c239e96 | ||
|
|
c2366cad99 | ||
|
|
a2cf968b7d | ||
|
|
a3605523e5 | ||
|
|
7dcdc98732 | ||
|
|
adcc477c33 | ||
|
|
6df964528a | ||
|
|
dca45015a4 | ||
|
|
069095f200 | ||
|
|
1a874980c9 | ||
|
|
94fb357b3e | ||
|
|
41ab84eba8 | ||
|
|
ff8c9f219c | ||
|
|
8d0f1903c7 | ||
|
|
69e7f5cc91 | ||
|
|
5971dfdcb0 | ||
|
|
82625a734e | ||
|
|
622da7ae82 | ||
|
|
2b57217034 | ||
|
|
d65d4a3d6b | ||
|
|
ddb789ed0d | ||
|
|
a8f50230a0 | ||
|
|
5d7913cf42 | ||
|
|
ae91ca61c9 | ||
|
|
3b19df2828 | ||
|
|
650d6bfcb6 | ||
|
|
996fff2c7a | ||
|
|
216f4ce5c0 | ||
|
|
506d1a51b8 | ||
|
|
9a8759023c | ||
|
|
57ea2280a0 | ||
|
|
67edc4337f | ||
|
|
994c9dbd98 | ||
|
|
505b939073 | ||
|
|
99ed991ace | ||
|
|
c7a6d5e006 | ||
|
|
1576384e02 | ||
|
|
f77ac33155 | ||
|
|
8439ece721 | ||
|
|
b60242dde9 | ||
|
|
10247f9b65 | ||
|
|
32258dc105 | ||
|
|
0162eb0566 | ||
|
|
796a3b0acf | ||
|
|
b590fcae83 | ||
|
|
b21c08de2f | ||
|
|
ad1a13d393 | ||
|
|
76277b4c08 | ||
|
|
90e29193cb | ||
|
|
06259daa58 | ||
|
|
b7d091858e | ||
|
|
a880d8cf53 | ||
|
|
f5a6e77bb1 | ||
|
|
c34f5ec6c7 | ||
|
|
23fde85228 | ||
|
|
8c127918e2 | ||
|
|
57fc5159d1 | ||
|
|
cd52789b01 | ||
|
|
6c2d2ee368 | ||
|
|
3d471a28a1 | ||
|
|
88072763d3 | ||
|
|
13f981d893 | ||
|
|
ceed58fb61 | ||
|
|
7ce7f94c36 | ||
|
|
e37ccd0330 | ||
|
|
922192904e | ||
|
|
63e834c092 | ||
|
|
b7fee7d282 | ||
|
|
ce7cf99887 | ||
|
|
1533105a64 | ||
|
|
540f6c5418 | ||
|
|
01b1d9144a | ||
|
|
f1a942e3ad | ||
|
|
abb05cb97c | ||
|
|
b7bad88837 | ||
|
|
685c40dbda | ||
|
|
432f4a0cd7 | ||
|
|
39bf208aa1 | ||
|
|
22241eabc8 | ||
|
|
0c1d649f30 | ||
|
|
cc92a9aed0 | ||
|
|
47d47a75f4 | ||
|
|
87c19d0bf9 | ||
|
|
03da31a022 | ||
|
|
5e4cd6c4ee | ||
|
|
727bc7517c | ||
|
|
2b0f9b0929 | ||
|
|
6639691985 | ||
|
|
48a205e99b | ||
|
|
7f49ed9fa4 | ||
|
|
878ef04e92 | ||
|
|
e8b1446c03 | ||
|
|
69f3cc0d41 | ||
|
|
7ce235d1c5 | ||
|
|
4111a62f3d | ||
|
|
2de7773a24 | ||
|
|
2d2623f6dd | ||
|
|
f819874002 | ||
|
|
59b049f461 | ||
|
|
90486fde89 | ||
|
|
b4095e087a | ||
|
|
52717de04d | ||
|
|
1bcb6ca125 | ||
|
|
7847515fff | ||
|
|
8520a538a7 | ||
|
|
4f10d11318 | ||
|
|
f6a6bca87b | ||
|
|
e3930c39c2 | ||
|
|
c76b9c6567 | ||
|
|
e40a7f8a61 | ||
|
|
692764d073 | ||
|
|
73886eac62 | ||
|
|
7b8130f61e | ||
|
|
3ac3be9b5e | ||
|
|
48a2d6c5f4 | ||
|
|
5c0e3ffed7 | ||
|
|
8066120fa3 | ||
|
|
fc6eeab58b | ||
|
|
47d0d4f9f8 | ||
|
|
c91167ff8d | ||
|
|
d6621afae1 | ||
|
|
c02e6e6cdf | ||
|
|
0a7d6c8799 | ||
|
|
a5c0da6fda | ||
|
|
6fb06e9614 | ||
|
|
33135920da | ||
|
|
86ea470189 | ||
|
|
b4fe978836 | ||
|
|
85e9e55ddc | ||
|
|
870e6277c0 | ||
|
|
117e80daff | ||
|
|
f645da9e44 | ||
|
|
7e0c8e2ef3 | ||
|
|
3a7e27df6a | ||
|
|
e9cfbf1749 | ||
|
|
3373b44270 | ||
|
|
86225ca1ed | ||
|
|
fa0b570677 | ||
|
|
4f01288ceb | ||
|
|
d86e096dc0 | ||
|
|
7e2ee59147 | ||
|
|
72547ac4c3 | ||
|
|
6005259c20 | ||
|
|
b9ec284ba4 | ||
|
|
14250fa45e | ||
|
|
35e9170312 | ||
|
|
bd83693292 | ||
|
|
b1c8a498fe | ||
|
|
ca40180ce9 | ||
|
|
1243c3a8a3 | ||
|
|
68e2652402 | ||
|
|
a4f6c4cf7b | ||
|
|
2450c334cf | ||
|
|
b2741b8d4e | ||
|
|
6696caee49 | ||
|
|
4af2a2e018 | ||
|
|
1dc2fe7cf7 | ||
|
|
7c906e6a15 | ||
|
|
bab0abb2bf | ||
|
|
6d614aee45 | ||
|
|
b96c17030f | ||
|
|
3b901cf774 | ||
|
|
c46d636377 | ||
|
|
0b2a41b2af | ||
|
|
260fea5b66 | ||
|
|
a5e7515a34 | ||
|
|
2c4fff8752 | ||
|
|
83af2e261d | ||
|
|
c3ecb0d482 | ||
|
|
685105abc9 | ||
|
|
5b6a7442e0 | ||
|
|
4774aeba9f | ||
|
|
288479a5e1 | ||
|
|
8b9c14c8b7 | ||
|
|
820e23fb3d | ||
|
|
510a513535 | ||
|
|
3444be04d8 | ||
|
|
e14d909347 | ||
|
|
cabdae7c37 | ||
|
|
bd6faa1227 | ||
|
|
785af3a5b2 | ||
|
|
7700be360a | ||
|
|
fb59381932 | ||
|
|
ffc4e30278 | ||
|
|
8a4476d697 | ||
|
|
1bf35985be | ||
|
|
43dbb5e70b | ||
|
|
f7b74aa489 | ||
|
|
33d0efa1fa | ||
|
|
64b257fbeb | ||
|
|
016ba130b2 | ||
|
|
bd10a43371 | ||
|
|
a426d7f98b | ||
|
|
19bcbb3055 | ||
|
|
ee5a65e4c1 | ||
|
|
aaa6072b7a | ||
|
|
2fe296b6b9 | ||
|
|
5b51895953 | ||
|
|
6b613c2171 | ||
|
|
08f9970bcb | ||
|
|
fb5839d5eb | ||
|
|
3129f5e2c2 | ||
|
|
76add6b7dc | ||
|
|
5a4f720d39 | ||
|
|
01d2217a21 | ||
|
|
90baa52b27 | ||
|
|
5a25a4d9ea | ||
|
|
3787e8e9af | ||
|
|
a5e03a6664 | ||
|
|
ba293ac0dc | ||
|
|
e6c854cc9c | ||
|
|
54ee34f629 | ||
|
|
77822a7efb | ||
|
|
ad34a777bb | ||
|
|
ed23baeb48 | ||
|
|
3884e3d733 | ||
|
|
9b61de8734 | ||
|
|
cb9ff4ac99 | ||
|
|
6e457009b4 | ||
|
|
ce42e0c0ea | ||
|
|
229aa9a115 | ||
|
|
07d13a350b | ||
|
|
858e85b59b | ||
|
|
72e4a6e1eb | ||
|
|
63d816332b | ||
|
|
b9a07b2cea | ||
|
|
3a5f052e8c | ||
|
|
2251acbca8 | ||
|
|
e5771ef891 | ||
|
|
71ec2c54b0 | ||
|
|
46701c75ed | ||
|
|
df446ba6f7 | ||
|
|
5efb5dd7d4 | ||
|
|
e093c89001 | ||
|
|
2a91a60d3e | ||
|
|
c5c35b06a4 | ||
|
|
413c2c7645 | ||
|
|
4997dcab23 | ||
|
|
40c93af283 | ||
|
|
07102294d0 | ||
|
|
73df91cb28 | ||
|
|
e3414b5d6b | ||
|
|
a1e07fa54b | ||
|
|
1953e3d415 | ||
|
|
bb68ef38b1 | ||
|
|
b4ca5cb0bd | ||
|
|
674ab0adbd | ||
|
|
5745c4f970 | ||
|
|
ded81bf625 | ||
|
|
b2075a3562 | ||
|
|
d9876e2da3 | ||
|
|
38eeb63d4b | ||
|
|
a0ad5d29e8 | ||
|
|
ad010db02d | ||
|
|
b3f5b62956 | ||
|
|
ce1a039537 | ||
|
|
54302084f1 | ||
|
|
e3e5a45562 | ||
|
|
1e87d1b0df | ||
|
|
4af239c785 | ||
|
|
a89f8a3150 | ||
|
|
0ef43d4eae | ||
|
|
e3b4bf00c9 | ||
|
|
45ddc3909b | ||
|
|
b2975f635a | ||
|
|
1aef9679ae | ||
|
|
b5a8dc1ebf | ||
|
|
aaac339b89 | ||
|
|
f4cd704284 | ||
|
|
feb98f1fb1 | ||
|
|
4e0e82b3c1 | ||
|
|
20551a44a3 | ||
|
|
e751833928 | ||
|
|
c332245d48 | ||
|
|
777304be3f | ||
|
|
fbecba6643 | ||
|
|
6f38083e18 | ||
|
|
02334e85ab | ||
|
|
aa0b4b6b59 | ||
|
|
33124cc5d6 | ||
|
|
167f96019a | ||
|
|
bfdcef797e | ||
|
|
c6b6838e1e | ||
|
|
bdbc25e3ca | ||
|
|
6c53bb33b5 | ||
|
|
a55c7672af | ||
|
|
6c2412b39d | ||
|
|
ff09829f7d | ||
|
|
fb90e00324 | ||
|
|
9e1fa7d614 | ||
|
|
262fde89ce | ||
|
|
302fc11efa | ||
|
|
973ede4ad1 | ||
|
|
e64e4be007 | ||
|
|
ca839f9480 | ||
|
|
d70bd10285 | ||
|
|
9fcce580ab | ||
|
|
21e0153b28 | ||
|
|
cb7f579590 | ||
|
|
cef459eab9 | ||
|
|
80c163754a | ||
|
|
51b8c9b04f | ||
|
|
d56cae904d | ||
|
|
f350bf9a1b | ||
|
|
eb1e6fc0b7 | ||
|
|
026b290582 | ||
|
|
b11ab2588e | ||
|
|
c8417ba29f | ||
|
|
e94630c2b6 | ||
|
|
634c5b2a52 | ||
|
|
95ab44c7af | ||
|
|
674481d28d | ||
|
|
0292b9612f | ||
|
|
78a9c7eb85 | ||
|
|
0fde359db6 | ||
|
|
300460a3ae | ||
|
|
d9922db41c | ||
|
|
788775f849 | ||
|
|
126c1afb4d | ||
|
|
cc06b37ef7 | ||
|
|
30b18d8e15 | ||
|
|
5f22cda333 | ||
|
|
902961d756 | ||
|
|
8340b1da10 | ||
|
|
02abc71790 | ||
|
|
344da255ba | ||
|
|
cf2a2adc87 | ||
|
|
47c948a929 | ||
|
|
f9c06b613d | ||
|
|
c3f43a2f14 | ||
|
|
6be731cca7 | ||
|
|
b201775f4e | ||
|
|
42ffe7b18a | ||
|
|
76992d379b | ||
|
|
95090b016d | ||
|
|
d4dd2dd63b | ||
|
|
aecf9624db | ||
|
|
b42ba1aef6 | ||
|
|
b93b06ed88 | ||
|
|
fd0b637eef | ||
|
|
92111e3b07 | ||
|
|
a5fe3a57f6 | ||
|
|
e9a29a5f61 | ||
|
|
bd63e0463a | ||
|
|
b41c9f3236 | ||
|
|
d5ff0c04f4 | ||
|
|
a17ef28063 | ||
|
|
7b83448cea | ||
|
|
73ef7f3ea1 | ||
|
|
06936970d1 | ||
|
|
491c46b6c1 | ||
|
|
fdaf4ada21 | ||
|
|
d446f0e453 | ||
|
|
2e2fa340ef | ||
|
|
f545de305f | ||
|
|
916169fd14 | ||
|
|
461860fbe3 | ||
|
|
997f047926 | ||
|
|
a8848ed4f6 | ||
|
|
c6060f0d79 | ||
|
|
caef723507 | ||
|
|
bf42b995a2 | ||
|
|
9a1f7c4242 | ||
|
|
204fafbf4a | ||
|
|
578556604a | ||
|
|
f444a7dba6 | ||
|
|
200c855c3e | ||
|
|
36e72671b0 | ||
|
|
a3d4ff7371 | ||
|
|
bc9eead93b | ||
|
|
b886ead295 | ||
|
|
525889600f | ||
|
|
66cded0cd7 | ||
|
|
bbd0f8c531 | ||
|
|
b2a36c11b8 | ||
|
|
85f8338501 | ||
|
|
ed5a1533d9 | ||
|
|
58395a30a4 | ||
|
|
d360de85cc | ||
|
|
221c8a3ec3 | ||
|
|
9ed77fd7d6 | ||
|
|
6b238924ee | ||
|
|
71f1163b2a | ||
|
|
93f7b0aef6 | ||
|
|
8b8c74af26 | ||
|
|
75887279ac | ||
|
|
7e3c9d2064 | ||
|
|
8a3b173910 | ||
|
|
6ebce2bf0c | ||
|
|
ad47e646ee | ||
|
|
32049708d5 | ||
|
|
8839e61ea5 | ||
|
|
565b2f70a9 | ||
|
|
a505fac5d3 | ||
|
|
f97d8aa345 | ||
|
|
eaf47e2099 | ||
|
|
75706ea313 | ||
|
|
7a9188d76e | ||
|
|
7c1c9c5620 | ||
|
|
47e3933004 | ||
|
|
d2d29d3401 | ||
|
|
8f01561842 | ||
|
|
62455cbd5a | ||
|
|
57634d6021 | ||
|
|
be7404a961 | ||
|
|
d804ba7400 | ||
|
|
986d04a2c9 | ||
|
|
23485dc259 | ||
|
|
a865bcdedd | ||
|
|
3a9a367259 | ||
|
|
ea53b99aa1 | ||
|
|
631072f5d6 | ||
|
|
6d9c47e8e6 | ||
|
|
d65477e14a | ||
|
|
5b28504837 | ||
|
|
90635707e9 | ||
|
|
5daca63561 | ||
|
|
9b30907ddd | ||
|
|
576f8eb7d0 | ||
|
|
bfd783f62a | ||
|
|
21c6b87914 | ||
|
|
6717730428 | ||
|
|
46985eced7 | ||
|
|
d0e9d700f1 | ||
|
|
bc58f108fc | ||
|
|
5da292bc15 | ||
|
|
34bc3555dc | ||
|
|
74767e397a | ||
|
|
67dc28859d | ||
|
|
c65e5bbda4 | ||
|
|
ce75c13b20 | ||
|
|
a6df80f815 | ||
|
|
15e75eeb88 | ||
|
|
5dd2efd498 | ||
|
|
28c2972673 | ||
|
|
6dbdeec051 | ||
|
|
90a40e41a8 | ||
|
|
f241d0183c | ||
|
|
5479f2e978 | ||
|
|
bec74e52f4 | ||
|
|
d1e398ce3a | ||
|
|
225e19cf99 | ||
|
|
ae1fec5f3e | ||
|
|
96671ab221 | ||
|
|
166c05b5c5 | ||
|
|
f513eb76ec | ||
|
|
2de59b6a0c | ||
|
|
4eff892d17 | ||
|
|
a634e3ac81 | ||
|
|
84a9001629 | ||
|
|
265ab75e24 | ||
|
|
f82057aabf | ||
|
|
ab94462f0a | ||
|
|
08874f25ee | ||
|
|
ae8ad945c1 | ||
|
|
47f4e2f650 | ||
|
|
c1ecd4c36a | ||
|
|
398a3aa344 | ||
|
|
95e1be4eb2 | ||
|
|
f210af1b51 | ||
|
|
c63223848d | ||
|
|
d9ebf3fd67 | ||
|
|
e9f00816c3 | ||
|
|
9fd6b12319 | ||
|
|
a7e311242a | ||
|
|
746bf414a2 | ||
|
|
4c4dd71824 | ||
|
|
08f4eacdff | ||
|
|
a52d7ffd83 | ||
|
|
6f3ded493a | ||
|
|
b6ed0c18db | ||
|
|
3be92ec2b6 | ||
|
|
dd87f6cf0a | ||
|
|
65bd5c1df9 | ||
|
|
45df4acfe5 | ||
|
|
c8825825e4 | ||
|
|
15f047e484 | ||
|
|
0170036187 | ||
|
|
fe93fa8497 | ||
|
|
88030934c7 | ||
|
|
2140ce4f53 | ||
|
|
0132b51132 | ||
|
|
41f3eb6400 | ||
|
|
154ff73784 | ||
|
|
6981d4ee4c | ||
|
|
3c9c050df0 | ||
|
|
119088d986 | ||
|
|
d12c186bbc | ||
|
|
95dca6a146 | ||
|
|
3c510a3a8e | ||
|
|
7f15412ae0 | ||
|
|
406bedb7a2 | ||
|
|
c696b6f939 | ||
|
|
97ad845a27 | ||
|
|
a6ca6a5cee | ||
|
|
7c25daa521 | ||
|
|
f5275180b4 | ||
|
|
e7d8daac10 | ||
|
|
7c6ba84acd | ||
|
|
8d85bfa7d0 | ||
|
|
152903d847 | ||
|
|
4fad3bf5bc | ||
|
|
1cc0dfb1ff | ||
|
|
0d00af6e73 | ||
|
|
b902ec74ad | ||
|
|
e9ba098f8e | ||
|
|
410fc50a21 | ||
|
|
24320da307 | ||
|
|
8d85b59eac | ||
|
|
00411eb209 | ||
|
|
a56884e75e | ||
|
|
1f363eba23 | ||
|
|
6f5d36bc5c | ||
|
|
a500255598 | ||
|
|
af8378b675 | ||
|
|
3c916480b2 | ||
|
|
dbf32840c6 | ||
|
|
4b8e47060b | ||
|
|
43bf98a956 | ||
|
|
b94b80e096 | ||
|
|
52202a3ffb | ||
|
|
4e5c7c36a1 | ||
|
|
d1fb4d4974 | ||
|
|
edaf4c0f17 | ||
|
|
4a9cbe673d | ||
|
|
6340bb4398 | ||
|
|
ba0e1dc920 | ||
|
|
c8e8919714 | ||
|
|
4902cfb5d5 | ||
|
|
bc3ef3746a | ||
|
|
c941fcf137 | ||
|
|
86f3e97b6b | ||
|
|
f62bd97771 | ||
|
|
11ec80bed4 | ||
|
|
b52188adfa | ||
|
|
290ac541a5 | ||
|
|
a237a5ce1b | ||
|
|
764cf585dd | ||
|
|
bbaf497fc7 | ||
|
|
2a03789061 | ||
|
|
c2ab0f4667 | ||
|
|
b692f721a3 | ||
|
|
28e950d9be | ||
|
|
6a9e562dde | ||
|
|
158d782db4 | ||
|
|
8d494540e2 | ||
|
|
74cb09ea83 | ||
|
|
3f19511574 | ||
|
|
e866631846 | ||
|
|
00c28793f4 | ||
|
|
932d5c680f | ||
|
|
aa408e6d21 | ||
|
|
5330cb879f | ||
|
|
d86fcd1c5f | ||
|
|
ec98e6e11c | ||
|
|
528c999cbb | ||
|
|
65c5722a09 | ||
|
|
35f447cf0c | ||
|
|
a5b818c8ab | ||
|
|
21ef4d1c37 | ||
|
|
b05d50bcad | ||
|
|
07985cf503 | ||
|
|
323864669b | ||
|
|
50b0961a8d | ||
|
|
8eb36db315 | ||
|
|
a2efd643de | ||
|
|
c611bc0855 | ||
|
|
028c1567bd | ||
|
|
bd0b93cb3e | ||
|
|
84d6403e06 | ||
|
|
73b524f627 | ||
|
|
232dd7f970 | ||
|
|
ca366d39b9 | ||
|
|
5cf852d97d | ||
|
|
f2977bac96 | ||
|
|
a162d5820e | ||
|
|
95c717eb59 | ||
|
|
873c245f6e | ||
|
|
56fa92cbff | ||
|
|
acc8cbb1e9 | ||
|
|
c4bce0f449 | ||
|
|
cf3313d156 | ||
|
|
a6ffa85a0e | ||
|
|
e940ac0998 | ||
|
|
d1069ed023 | ||
|
|
3a9775c5c0 | ||
|
|
d1c1ce61ff | ||
|
|
525243125d | ||
|
|
c15c433631 | ||
|
|
e7e7afdc2d | ||
|
|
a600d36a56 | ||
|
|
e012e0aa9f | ||
|
|
a320e83fa1 | ||
|
|
5d3367398f | ||
|
|
a34b285160 | ||
|
|
a672f8d057 | ||
|
|
503e4b8f27 | ||
|
|
b615a77f51 | ||
|
|
7f6cc79541 | ||
|
|
2951298a6b | ||
|
|
d5b09217ef | ||
|
|
28d274b712 | ||
|
|
c800e61cc3 | ||
|
|
d66be65985 | ||
|
|
30b0e61732 | ||
|
|
a7c33014b6 | ||
|
|
abfa65cd17 | ||
|
|
fedd7572d7 | ||
|
|
d5dede3dfa | ||
|
|
a75b452332 | ||
|
|
d22dbd7b38 | ||
|
|
79eae0ab09 | ||
|
|
532c9c5c8b | ||
|
|
f5278822bb | ||
|
|
a8d215db86 | ||
|
|
2e921bffd8 | ||
|
|
fb225cf638 | ||
|
|
9c88a30ac3 | ||
|
|
0c9047e26d | ||
|
|
0d37a542ff | ||
|
|
34b616ba9f | ||
|
|
2e6d2a5c75 | ||
|
|
f963a09239 | ||
|
|
fcbca7eb8c | ||
|
|
65c50e3ec9 | ||
|
|
6cf627f9d4 | ||
|
|
0f2a48662d | ||
|
|
ac44ac738f | ||
|
|
02fad5a01f | ||
|
|
b1c0e45b66 | ||
|
|
1397b5e86a | ||
|
|
171c2f224a | ||
|
|
628ddf9b60 | ||
|
|
8c3fcd08de | ||
|
|
375ac9bf8b | ||
|
|
e1b9f9d68a | ||
|
|
7f7fc80c7a | ||
|
|
aa96e7ce43 | ||
|
|
5c9d69ebcc | ||
|
|
7469dbed21 | ||
|
|
bc1f0b79f5 | ||
|
|
4c2225259f | ||
|
|
2ba0013cc6 | ||
|
|
b92ce6a3a2 | ||
|
|
de80f36496 | ||
|
|
ae8dce366b | ||
|
|
750cafb50c | ||
|
|
5cd90e8326 | ||
|
|
664cd20825 | ||
|
|
aeb31bb4c5 | ||
|
|
87eb08c088 | ||
|
|
e64cbbd005 | ||
|
|
4829eef707 | ||
|
|
32978e4658 | ||
|
|
f109246e47 | ||
|
|
b1bc96bbd9 | ||
|
|
e3176b1868 | ||
|
|
22dae5bff8 | ||
|
|
f21bb8a1d4 | ||
|
|
3624b67e98 | ||
|
|
eb4cbebe2a | ||
|
|
3de200030f | ||
|
|
b35c5b2f0d | ||
|
|
3cf1a58964 | ||
|
|
ef1fa37452 | ||
|
|
7cb31f2c7a | ||
|
|
252be1a850 | ||
|
|
4cef551b01 | ||
|
|
dbc43b5c36 | ||
|
|
92aba62fdf | ||
|
|
d8db805929 | ||
|
|
9ea0219fce | ||
|
|
776d4f859e | ||
|
|
7b7a1a4c75 | ||
|
|
ac218f929b | ||
|
|
efe90584df | ||
|
|
1917072116 | ||
|
|
980053e78f | ||
|
|
ffa2849e2f | ||
|
|
0e797ac643 | ||
|
|
fc14caf48a | ||
|
|
494b396f9e | ||
|
|
f007778846 | ||
|
|
b37f2f7b85 | ||
|
|
10661f0b36 | ||
|
|
ff372ffe53 | ||
|
|
c33f289a21 | ||
|
|
d9a4d2dc88 | ||
|
|
6e86d3db21 | ||
|
|
b11d180a37 | ||
|
|
032d2ef9f2 | ||
|
|
1951b38c64 | ||
|
|
41c5c0f0cf | ||
|
|
d0bab4a8da | ||
|
|
ef0cca39ce | ||
|
|
d94f36a0f7 | ||
|
|
3b1875efed | ||
|
|
acba336f2e | ||
|
|
61b6f9ee1d | ||
|
|
210a14d7ed | ||
|
|
91cc88eb37 | ||
|
|
4fc10e560b | ||
|
|
01ecc5d52f | ||
|
|
7edcab0232 | ||
|
|
b4ada5bd99 | ||
|
|
cfa7aca62a | ||
|
|
9eca1ff0b3 | ||
|
|
aac51e0a5a | ||
|
|
ea53ed1889 | ||
|
|
780bb60137 | ||
|
|
0fd859a0a6 | ||
|
|
03645239a9 | ||
|
|
ec5be6c048 | ||
|
|
67651fbd75 | ||
|
|
6b758bfe0c | ||
|
|
49ae827092 | ||
|
|
01ad976b53 | ||
|
|
38a672a1ca | ||
|
|
a723e0e77d | ||
|
|
3abb1ad2a3 | ||
|
|
d7e8ac9d86 | ||
|
|
284c419d01 | ||
|
|
2dca759091 | ||
|
|
11cebfadc5 | ||
|
|
e4e56ed69c | ||
|
|
7dcc27cb5e | ||
|
|
8b494263c3 | ||
|
|
4029e8843d | ||
|
|
85a9737c16 | ||
|
|
247247a8ae | ||
|
|
4bfb168982 | ||
|
|
1652ef39b1 | ||
|
|
190ee08724 | ||
|
|
367a2521a0 | ||
|
|
6b1cbc612a | ||
|
|
d0f89298b8 | ||
|
|
9adbcaf262 | ||
|
|
ef067cd35d | ||
|
|
e08ef39d4e | ||
|
|
33f1df4d26 | ||
|
|
29e6c35657 | ||
|
|
148f920a06 | ||
|
|
c5e38e8077 | ||
|
|
94a0637fb1 | ||
|
|
db00f3e4f4 | ||
|
|
e664528479 | ||
|
|
83a16596e6 | ||
|
|
7c6a4374f5 | ||
|
|
5b2034ff45 | ||
|
|
6807e7b388 | ||
|
|
71b5dc1b0b | ||
|
|
2bda9e45f6 | ||
|
|
530626fd21 | ||
|
|
4e8b70cb64 | ||
|
|
f4b6592dbc | ||
|
|
0d6534d9eb | ||
|
|
b869bb5b7b | ||
|
|
a6603ca827 | ||
|
|
881b4199f4 | ||
|
|
8f418f10d5 | ||
|
|
7a436cad38 | ||
|
|
ba521c5412 | ||
|
|
23623ffc1f | ||
|
|
ca0a121f19 | ||
|
|
65554f30c6 | ||
|
|
4f1fa500e3 | ||
|
|
00ad417ff8 | ||
|
|
af04dfea67 | ||
|
|
b26461b55f | ||
|
|
39f5761729 | ||
|
|
10cc8c8310 | ||
|
|
4c844ba92d | ||
|
|
d855bc2f8f | ||
|
|
bffc981dca | ||
|
|
fc970af553 | ||
|
|
fb79f25139 | ||
|
|
3f68ef470d | ||
|
|
ce004bc49a | ||
|
|
a99533f633 | ||
|
|
a300522aed | ||
|
|
1da96f0fca | ||
|
|
11994a352c | ||
|
|
4e39f7c900 | ||
|
|
eca32f09e9 | ||
|
|
a452a9356e | ||
|
|
0645ccf03a | ||
|
|
b81a196c71 | ||
|
|
8589334b98 | ||
|
|
df91ed0407 | ||
|
|
250ae9ffad | ||
|
|
cd354c6786 | ||
|
|
6d337a4945 | ||
|
|
2f1e3c26e1 | ||
|
|
be7e413b7a | ||
|
|
83e140c4f6 | ||
|
|
f8d7135ac8 | ||
|
|
4676d9b2ec | ||
|
|
256fe0ec37 | ||
|
|
415a0ea9e5 | ||
|
|
f5e5472dd4 | ||
|
|
b1b989dac9 | ||
|
|
1d039eb656 | ||
|
|
905432882c | ||
|
|
61ee5cb055 | ||
|
|
33f6df6958 | ||
|
|
82e9d2d28e | ||
|
|
2c679f5ff7 | ||
|
|
36827a2b1e | ||
|
|
d1ca11e008 | ||
|
|
18377261b0 | ||
|
|
a772e67318 | ||
|
|
02dfbb43dc | ||
|
|
e9a7ef7933 | ||
|
|
b8d531f546 | ||
|
|
5268ec2716 | ||
|
|
2a7bde2570 | ||
|
|
c94b463e4f | ||
|
|
a5367f7345 | ||
|
|
90c88fdce4 | ||
|
|
169509d3a9 | ||
|
|
1345e65a98 | ||
|
|
1a56155bee | ||
|
|
d425b41589 |
@@ -1,2 +0,0 @@
|
||||
*.zip binary
|
||||
*.pdf binary
|
||||
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: csagan5
|
||||
custom: https://www.bromite.org/#donate
|
||||
@@ -0,0 +1,213 @@
|
||||
name: Bug report
|
||||
description: Create a Bromite bug report
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Welcome! Thanks for taking the time to submit a bug report.
|
||||
|
||||
If this is not a bug about the Bromite browser, or you are looking for a place to ask a question to the community,
|
||||
then please use the [GitHub Discussions](https://github.com/bromite/bromite/discussions) instead.
|
||||
|
||||
Make sure you have acknowledged and completed this template before submitting your issue.
|
||||
|
||||
Please read it carefully: incorrect issues will be automatically closed and ignored.
|
||||
|
||||
- type: checkboxes
|
||||
id: preliminary_checklist
|
||||
attributes:
|
||||
label: Preliminary checklist
|
||||
options:
|
||||
- label: "I have read the [README](https://github.com/bromite/bromite/blob/master/README.md)."
|
||||
required: true
|
||||
- label: "I have searched the existing issues for my problem. This is a new ticket, NOT a duplicate or related to another open issue."
|
||||
required: true
|
||||
- label: "I have read the [FAQs](https://github.com/bromite/bromite/blob/master/FAQ.md)."
|
||||
required: true
|
||||
- label: "I have updated Bromite to the latest version. The bug is reproducible on this latest version."
|
||||
required: true
|
||||
- label: "This is a bug report about the Bromite browser (not about the website, building Bromite, F-Droid or anything else)."
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_chromium
|
||||
attributes:
|
||||
label: Can the bug be reproduced with corresponding Chromium version?
|
||||
description: |
|
||||
Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
|
||||
If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and
|
||||
do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
|
||||
|
||||
If the bug is related to functionality that does not exist in Chromium then answer "No".
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: bromite_version
|
||||
attributes:
|
||||
label: Bromite version
|
||||
description: What version of Bromite are you using? Please specify a single version e.g. `96.0.4664.1` not `latest`. If this is not the latest version then please update and retry before submitting this bug report.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: device_architecture
|
||||
attributes:
|
||||
label: Device architecture
|
||||
multiple: false
|
||||
options:
|
||||
- arm
|
||||
- arm64
|
||||
- arm64-v8a
|
||||
- armeabi-v7a
|
||||
- x86
|
||||
- x64
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: android_version
|
||||
attributes:
|
||||
label: Android version
|
||||
multiple: false
|
||||
description: What version of Android are you running?
|
||||
options:
|
||||
- 13
|
||||
- 12.1
|
||||
- 12.0
|
||||
- 11
|
||||
- 10
|
||||
- 9
|
||||
- 8.1
|
||||
- 8.0
|
||||
- 7.1
|
||||
- 7.0
|
||||
- 6
|
||||
- 5.1
|
||||
- 5.0
|
||||
- 4.4
|
||||
- 4.3
|
||||
- 4.2
|
||||
- 4.1
|
||||
- 4.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: device_model
|
||||
attributes:
|
||||
label: Device model
|
||||
description: What is your device model? This can usually be found in your device's settings in the "About" section.
|
||||
placeholder: (e.g. `OnePlus 8 (IN2010)`, or `SM-G960UZKABST`, etc.)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: changed_flags
|
||||
attributes:
|
||||
label: Changed flags
|
||||
description: |
|
||||
These are the flags changed under `chrome://flags`.
|
||||
Report all the flags with non-default configuration (they will be blue-highlighted).
|
||||
|
||||
If no flags are changed then write 'no flags changed'.
|
||||
placeholder: show-overdraw-feedback, enable-parallel-downloading
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_system_webview
|
||||
attributes:
|
||||
label: Is this bug about the SystemWebView?
|
||||
description: Please note that no support for System WebView installation is provided.
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_incognito
|
||||
attributes:
|
||||
label: Is this bug happening in an incognito tab?
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: adblock
|
||||
attributes:
|
||||
label: Is this bug caused by the adblocker?
|
||||
description: You can test this by temporarily allowing ads for the site.
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_crash
|
||||
attributes:
|
||||
label: Is this bug a crash?
|
||||
description: |
|
||||
1. No.
|
||||
2. Yes, I have attached the crash report dump that I downloaded from `chrome://crashes`
|
||||
3. Yes, I have copy/pasted the crash dump
|
||||
placeholder: |
|
||||
Drag the crash report dump here to attach it or paste the logcat dump individuated with `adb logcat | grep -E '( cr_|bromite|chromium)'`.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: Write a clear and concise description of the bug.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_steps
|
||||
attributes:
|
||||
label: Steps to reproduce the bug
|
||||
description: |
|
||||
Explain how to cause the bug as clearly as possible. Bugs that are not reproducible cannot be investigated.
|
||||
|
||||
Also, do not write "any website": please specify which URLs can be used to reproduce the issue.
|
||||
placeholder: |
|
||||
Steps to reproduce the bug (e.g.):
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: |
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
Otherwise, ignore this section.
|
||||
placeholder: |
|
||||
Drag the screenshot files here to attach them.
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,68 @@
|
||||
name: Feature request
|
||||
description: Create a Bromite feature request
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Welcome! Thanks for taking time to submit a feature request.
|
||||
|
||||
If this is not a feature request about the Bromite browser, or you are looking for a place
|
||||
to ask a question to the community then please use the [GitHub Discussions](https://github.com/bromite/bromite/discussions) instead.
|
||||
|
||||
Make sure you have acknowledged and completed this template before submitting your issue.
|
||||
|
||||
Please read it carefully: incorrect issues will be automatically closed and ignored.
|
||||
|
||||
Note:
|
||||
- Features unrelated to privacy will not be considered.
|
||||
- Do not ask "I would like feature X which is available in browser Y."
|
||||
|
||||
- type: checkboxes
|
||||
id: preliminary_checklist
|
||||
attributes:
|
||||
label: Preliminary checklist
|
||||
options:
|
||||
- label: "I have read the [README](https://github.com/bromite/bromite/blob/master/README.md)"
|
||||
required: true
|
||||
- label: "I have read the [FAQs](https://github.com/bromite/bromite/blob/master/FAQ.md)."
|
||||
required: true
|
||||
- label: "I have searched [existing issues](https://github.com/bromite/bromite/issues) for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue."
|
||||
required: true
|
||||
- label: "This is a feature request for the Bromite browser; not the website nor F-Droid nor anything else."
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_privacy_related
|
||||
attributes:
|
||||
label: Is your feature request related to privacy?
|
||||
description: Features that are not related to privacy are not considered.
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: is_patch_available
|
||||
attributes:
|
||||
label: Is there a patch available for this feature somewhere?
|
||||
description: If yes please provide URL and related license information.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: solution_description
|
||||
attributes:
|
||||
label: Describe the solution you would like
|
||||
description: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives_considered
|
||||
attributes:
|
||||
label: Describe alternatives you have considered
|
||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,15 @@
|
||||
## Description
|
||||
|
||||
*Please explain here what feature or bugfix these changes are addressing and why they should be included*
|
||||
|
||||
## All submissions
|
||||
|
||||
* [ ] there are no other open [Pull Requests](../../../pulls) for the same update/change
|
||||
* [ ] Bromite can be built with these changes
|
||||
* [ ] I have tested that the new change works as intended (AVD or physical device will do)
|
||||
|
||||
### Format
|
||||
|
||||
* [ ] patch subject and filename match (e.g. `Subject: Alternative cache (NIK-based)` -> `Alternative-cache-NIK-based.patch`)
|
||||
* [ ] patch description contains explanation of changes
|
||||
* [ ] no unnecessary whitespace or unrelated changes
|
||||
@@ -1,5 +0,0 @@
|
||||
################################################################################
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
/.vs
|
||||
+1200
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
## Does Google Sync/Translate/Data saver work?
|
||||
No.
|
||||
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
|
||||
|
||||
Additionally, these features would not be privacy-friendly.
|
||||
|
||||
## Does Bromite require root?
|
||||
No.
|
||||
|
||||
## Is Bromite de-googled?
|
||||
|
||||
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
|
||||
Bromite uses [ungoogled-chromium's python script](https://github.com/Eloston/ungoogled-chromium/blob/master/utils/domain_substitution.py) to disable URLs in the codebase since version `78.0.3904.93`.
|
||||
|
||||
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
|
||||
|
||||
## Does Bromite support DRM media?
|
||||
|
||||
Yes, in order to play protected/encrypted media content the browser will use Android's DRM media framework to automatically negotiate access (same as Chromium).
|
||||
This means for example that requests to Android license servers will be performed (`www.googleapis.com`), see https://w3c.github.io/encrypted-media/#direct-individualization
|
||||
To disable this functionality you should disable protected content playback from Site settings -> Protected Content.
|
||||
|
||||
## What is the SystemWebView?
|
||||
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
|
||||
|
||||
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
|
||||
|
||||
Ad-blocking was present and always enabled in the SystemWebView from version `72.0.3626.120` till version `77.0.3865.104`, when it stopped working due to [upstream NetworkService changes](https://docs.google.com/document/d/1TZEuPvr2KAbP4_TZpuuwtEEArQsyAkc2HDu68l66YwU/edit?ts=598244df#heading=h.ougoi5i6508y).
|
||||
|
||||
## How to enable DNS-over-HTTPS?
|
||||
|
||||
See [this page](https://www.bromite.org/doh).
|
||||
|
||||
## Can you add HTTPS everywhere?
|
||||
No.
|
||||
We cannot add add-ons to Bromite (merely some features).
|
||||
|
||||
## Is Bromite on Play Store?
|
||||
No, and this is not going to change. Many limitations apply for submissions there, including which ads are allowed to be blocked.
|
||||
|
||||
Bromite favors user freedom in software choice: the device is yours so you get to choose which software to run on it, end of the story.
|
||||
|
||||
## Is Bromite on F-Droid?
|
||||
It is not on the official F-Droid repository and there are no (more) plans to submit it.
|
||||
|
||||
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
## Does Bromite support WebRTC?
|
||||
Partially, see https://github.com/bromite/bromite/wiki/WebRTC
|
||||
|
||||
## Using Bromite will favour the monopoly of the Chromium/Blink engine, why do you develop and maintain Bromite?
|
||||
In short, to show what a Chromium-based engine could do **for the user** if the user experience and needs were the main focus of modern browser design.
|
||||
|
||||
For an Android browser using an alternative engine see [Fennec F-Droid](https://f-droid.org/en/packages/org.mozilla.fennec_fdroid/).
|
||||
|
||||
## Does Bromite support extensions?
|
||||
No; Bromite will support extensions only if upstream (Chromium) does, or similarly another project maintains the patch and functionality.
|
||||
|
||||
## Why do push notifications not work on this website?
|
||||
|
||||
The [Chromium Blink engine](https://www.chromium.org/blink) uses [GCM](https://en.wikipedia.org/wiki/Google_Cloud_Messaging) to deliver messages
|
||||
when websites use the [Push API](https://w3c.github.io/push-api/); this will not work in Bromite because cloud integrations are disabled (GCM in this case).
|
||||
|
||||
[ServiceWorker notifications](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification) do work instead since they use
|
||||
[android.app.Notification](https://developer.android.com/guide/topics/ui/notifiers/notifications).
|
||||
|
||||
## Can PWAs be installed?
|
||||
|
||||
PWAs are only supported as home shortcuts; WebAPKs will not work because they are generated server-side on googleapis.com (which is not allowed in Bromite).
|
||||
|
||||
## Does Bromite support the Android autofill framework?
|
||||
|
||||
Yes, since version 94.0.4606.109 the native Android autofill can be used; this does not require accessibility services as a workaround.
|
||||
|
||||
## Does Bromite support casting media content?
|
||||
|
||||
No, this would require Play Store binary blobs.
|
||||
|
||||
## Can you add this search engine as default?
|
||||
No.
|
||||
Bromite does not make any choice related to default search engines, the Chromium default is used.
|
||||
Various Android browsers get some fee to ship their apps with a specific default search engine, Bromite does not get any fee from anyone.
|
||||
Changing the default search engine would lead to an endless series of requests to change it based on personal preferences, thus no change is made to the default.
|
||||
See also: https://github.com/bromite/bromite/wiki/SearchEngines
|
||||
|
||||
## Some websites show ads, how can I fix this?
|
||||
You can compare the blocked URLs with a desktop browser and Bromite (using [remote debugging](https://developer.chrome.com/docs/devtools/remote-debugging/)) and figure out some new filter rules to be added.
|
||||
If the ads are blocked via cosmetic filtering then blocking them is not possible with Bromite's engine and you might need something like an [user script](https://github.com/bromite/bromite/wiki/UserScripts) instead.
|
||||
See also: https://github.com/bromite/bromite/wiki/AdBlocking
|
||||
|
||||
## This JavaScript/WebGL website is not performing well with Bromite, how can I fix this?
|
||||
Bromite comes with [JavaScript JIT](https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/) disabled by default; if you trust the website you can enable it.
|
||||
For more information about this, search "javascript jit vulnerabilities" on your favorite search engine.
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,261 @@
|
||||
[](https://stand-with-ukraine.pp.ua/)
|
||||
|
||||
# Bromite - Take back your browser
|
||||
<a href="https://github.com/bromite/bromite/releases/latest">
|
||||
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> </a>
|
||||
<a href="https://github.com/bromite/bromite/blob/master/LICENSE">
|
||||
<img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
|
||||
</a> <br>
|
||||
<a href="https://www.bromite.org">
|
||||
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
|
||||
</a>
|
||||
|
||||
Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
|
||||
|
||||
Bromite is only available for Android Marshmallow (v6.0, API level 23) and above.
|
||||
|
||||
<img src="https://fdroid.bromite.org/fdroid/bromite_bromite_gh_downloads.svg" alt="Downloads on Github" title="Downloads on Github" />
|
||||
|
||||
For the Frequently Asked Questions see [F.A.Q.](./FAQ.md).
|
||||
|
||||
For documentation see the [wiki](https://github.com/bromite/bromite/wiki).
|
||||
|
||||
# Goals
|
||||
|
||||
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
|
||||
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
|
||||
|
||||
# Donate
|
||||
|
||||
Please donate to support development of Bromite and the costs for the build system.
|
||||
|
||||
## → Support development with a donation
|
||||
|
||||
Patreon: https://www.patreon.com/csagan5
|
||||
|
||||
<a href="bitcoin:bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw">BTC donations address</a>: `bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw`
|
||||
|
||||
ETH donations address: `0x5d392F8FBf3465afe05B1Adc575e248D33B891F6`
|
||||
|
||||
# Features
|
||||
|
||||
* customizable adblock filters via user-provided URL (see https://www.bromite.org/custom-filters)
|
||||
* automatically updated adblock filters
|
||||
* remove click-tracking and AMP from search results
|
||||
* DNS-over-HTTPS support with any valid IETF DoH endpoint
|
||||
* always-incognito mode
|
||||
* disable all field trials permanently
|
||||
* disable smart search by default, allow web search from incognito mode
|
||||
* always-visible cookies, javascript and ads site settings from address bar popup
|
||||
* remove Play integration binary blobs
|
||||
* use [CFI](https://en.wikipedia.org/wiki/Control-flow_integrity) on all architectures except x86
|
||||
* enable trivial auto var init
|
||||
* disable media router and remoting by default
|
||||
* disable dynamic module loading
|
||||
* show warnings for TLSv1.0/TLSv1.1 pages
|
||||
* enable site-per-process isolation for all devices with memory > 1GB
|
||||
* completely remove safe browsing and other privacy-unfriendly features
|
||||
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
|
||||
* settings to disable custom intents and clear session on exit
|
||||
* flags to toggle anti-fingerprinting mitigations for canvas, audio, client rects, webGL and sensor APIs (see full list below for all the new flags)
|
||||
* use frozen User-Agent to conceal real model and browser version
|
||||
* privacy enhancement patches from [Iridium](https://iridiumbrowser.de/), [Inox patchset](https://github.com/gcarq/inox-patchset), [Brave](https://brave.com/) and [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) projects
|
||||
* security enhancement patches from [GrapheneOS](https://github.com/GrapheneOS) project
|
||||
* disable scroll-to-text-fragment
|
||||
* reduced referer granularity
|
||||
* block gateway attacks via websockets (partial fix, see [this upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=590714))
|
||||
* use 64-bit ABI for webview processes
|
||||
* make all favicon requests on-demand ([supercookie](https://supercookie.me/) mitigation)
|
||||
* enable all network isolation features (`PartitionConnectionsByNetworkIsolationKey`, `PartitionHttpServerPropertiesByNetworkIsolationKey`, `SplitHostCacheByNetworkIsolationKey`, `AppendFrameOriginToNetworkIsolationKey`, `SplitCacheByNetworkIsolationKey`, `UseRegistrableDomainInNetworkIsolationKey`, `PartitionSSLSessionsByNetworkIsolationKey`, `PartitionExpectCTStateByNetworkIsolationKey`, `PartitionDomainReliabilityByNetworkIsolationKey`)
|
||||
* ignore enterprise policies that disallow secure DNS
|
||||
* ask permission to play protected media
|
||||
* disable the DIAL repeating discovery
|
||||
* disable RTCGetCurrentBrowsingContextMedia by default
|
||||
* disable FLoC and privacy sandbox by default
|
||||
* disable feeds
|
||||
* disable reporting of certificate errors
|
||||
* use pre-defined phone model for client hints and Javascript
|
||||
* allow forcing external links to open in incognito
|
||||
* disable AGSA by default
|
||||
* flag to enable Certificate Transparency
|
||||
* allow adding search engines from incognito mode
|
||||
* disable predictors
|
||||
* disable supervised users
|
||||
* disable safety check
|
||||
* disable capability to block `view-source:` URLs
|
||||
* disable `SegmentationPlatformFeature`, `OptimizationHints`, client hint headers
|
||||
* disable `AsyncDNS` by default
|
||||
* customize history expiration threshold
|
||||
* disable idle detection
|
||||
* HTTPS-only mode enabled by default
|
||||
* disable TLS resumption by default
|
||||
* partition DoH requests by top-frame NIK
|
||||
* strict site isolation and strict origin isolation
|
||||
|
||||
## Features not related to privacy
|
||||
* browser automatic updates, enabled by default
|
||||
* native Android autofill support
|
||||
* import/export bookmarks
|
||||
* bookmark all tabs from tabs regroup menu
|
||||
* allow playing videos in background tabs and disable pause on switching tabs
|
||||
* all codecs included (proprietary, open H.264 etc.)
|
||||
* [AV1 codec support](https://github.com/bromite/bromite/wiki/AV1-support)
|
||||
* [dav1d](https://code.videolan.org/videolan/dav1d) decoder enabled by default
|
||||
* built with official speed optimizations
|
||||
* increase number of autocomplete matches from 5 to 10
|
||||
* allow changing default download storage location
|
||||
* do not ignore save prompt for users without SD cards
|
||||
* disable articles and increase number of icons on new tab page
|
||||
* adding an URL as bookmark will clear its blocked status for the NTP tiles
|
||||
* history support in incognito mode
|
||||
* view source of pages
|
||||
* sticky desktop mode setting
|
||||
* mobile/desktop user agent customization
|
||||
* accessibility preference to force tablet UI
|
||||
* use Alt+D to focus address bar
|
||||
* allow sharing to Bromite
|
||||
* UI for crash information collection
|
||||
* allow OpenSearch search engine detection in incognito
|
||||
* allow OpenSearch search engine detection with paths
|
||||
* keyboard dictionary hints in address bar
|
||||
* always allow `view-source:` URLs
|
||||
* allow moving navigation bar to bottom
|
||||
* add option to use home page as NTP
|
||||
|
||||
You can inspect all functionality/privacy changes by reading the [patches](https://github.com/bromite/bromite/tree/master/build/patches) and/or the [CHANGELOG](./CHANGELOG.md).
|
||||
|
||||
### Flags
|
||||
|
||||
Flags which have been retired from upstream Chromium but are still available in Bromite.
|
||||
|
||||
* `#pull-to-refresh`
|
||||
* `#enable-search-ready-omnibox`
|
||||
* `#darken-websites-checkbox-in-themes-setting`
|
||||
* `#simplified-ntp`, enabled by default
|
||||
* `#enable-text-fragment-anchor`, disabled by default
|
||||
* `#num-raster-threads`
|
||||
* `#enable-image-reader`, enabled by default
|
||||
* `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
|
||||
* `#offline-indicator-v2`
|
||||
|
||||
New flags:
|
||||
|
||||
* `#fingerprinting-canvas-image-data-noise`, `#fingerprinting-client-rects-noise` and `#fingerprinting-canvas-measuretext-noise`, enabled by default
|
||||
* `#incognito-screenshot`, disabled by default
|
||||
* `#max-connections-per-host`
|
||||
* `#resume-background-video`
|
||||
* `#ipv6-probing`
|
||||
* `#enable-device-motion` and `#enable-device-orientation`
|
||||
* `#show-legacy-tls-warnings`
|
||||
* `#save-data-header`, disabled by default
|
||||
* `#export-bookmarks-use-saf`, disabled by default
|
||||
* `#allow-user-certificates`, disabled by default
|
||||
* `#cleartext-permitted`, enabled by default, can be used to disable all cleartext-HTTP traffic
|
||||
* `#omnibox-autocomplete-filtering`, can be used to restrict omnibox autocomplete results
|
||||
* `#disable-external-intent-requests`, can be used to disable opening any external app for any URL
|
||||
* `#enable-userscripts-log`, see https://github.com/bromite/bromite/wiki/UserScripts#flags
|
||||
* `#certificate-transparency-enabled`, enabled by default; see https://chromium.googlesource.com/chromium/src/+/master/net/docs/certificate-transparency.md
|
||||
* `#move-top-toolbar-to-bottom`, disabled by default
|
||||
* `#site-engagement`, enabled by default
|
||||
* `#offline-pages-auto-save`, disabled by default, allows auto-saving of pages when device goes offline
|
||||
* `#adaptive-button-in-top-toolbar-customization`, disabled by default, allows having a new tab or share button on the address bar
|
||||
|
||||
### Site settings
|
||||
|
||||
* webGL, disabled by default
|
||||
* images, enabled by default
|
||||
* Javascript JIT, disabled by default
|
||||
* timezone customization override
|
||||
* autoplay, disabled by default
|
||||
* webRTC, disabled by default
|
||||
|
||||
# Privacy limitations
|
||||
|
||||
Bromite's privacy features, including anti-fingerprinting mitigations (which are not comprehensive), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://www.torproject.org/download/) in such cases.
|
||||
|
||||
# Releases
|
||||
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically highlight the one apt for your device (or none otherwise).
|
||||
|
||||
Each tag corresponds to a Chromium Stable release tag.
|
||||
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK version 23+; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK23+).
|
||||
For every Bromite build you can always find a matching [vanilla Chromium](https://www.bromite.org/chromium) build which is used for example to verify which issues are specific to Bromite or not.
|
||||
|
||||
You will automatically receive notifications about new updates (and be able to install them) via the auto updater functionality (enabled by default), see [related wiki page](https://github.com/bromite/bromite/wiki/AutomaticUpdates).
|
||||
|
||||
All official releases are also available through the [official third-party F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
## Integrity and authenticity
|
||||
|
||||
You can verify the integrity of a downloaded APK file from this project with any `sha256sum`-compatible tool by downloading the corresponding `brm_X.Y.Z.sha256.txt` or `chr_X.Y.Z.sha256.txt` file, where X.Y.Z is the release version number. Example:
|
||||
```
|
||||
$ sha256sum --check brm_68.0.3440.54.sha256.txt
|
||||
arm64_SystemWebView.apk: OK
|
||||
arm64_ChromePublic.apk: OK
|
||||
arm64_ChromeModernPublic.apk: OK
|
||||
```
|
||||
|
||||
You can verify authenticity, e.g. that the author ([csagan5](https://github.com/csagan5)) released the file, by using gpg2:
|
||||
```
|
||||
$ gpg2 --quiet --verify brm_68.0.3440.54.sha256.txt.asc
|
||||
gpg: assuming signed data in 'brm_68.0.3440.54.sha256.txt'
|
||||
gpg: Signature made Sun 08 Jul 2018 04:22:52 PM CEST using RSA key ID D85DC0C5
|
||||
gpg: Good signature from "csagan5 <32685696+csagan5@users.noreply.github.com>"
|
||||
```
|
||||
|
||||
You can download csagan5's public GnuPG key from here: [csagan5.asc](./csagan5.asc).
|
||||
|
||||
# How to build
|
||||
|
||||
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
|
||||
|
||||
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
|
||||
|
||||
The Chromium version tag used as base for the patches is available here: [RELEASE](./build/RELEASE); this is always corresponding to the git tag for every release.
|
||||
The GN args used to build Bromite are available here: [bromite.gn_args](./build/bromite.gn_args).
|
||||
The patches are to be applied second the order specified in the `bromite_patches_list.txt` file (you can use `git am`).
|
||||
|
||||
NOTE: no official support is provided for builds.
|
||||
|
||||
## How to build the filters
|
||||
|
||||
See upstream documentation: https://github.com/chromium/chromium/blob/master/components/subresource_filter/FILTER_LIST_GENERATION.md
|
||||
|
||||
Bromite uses an unindexed filter file, which is periodically published at https://github.com/bromite/filters
|
||||
|
||||
# Contributing
|
||||
|
||||
Please submit issues following the issue template; beware that GitHub does not display the templates from mobile.
|
||||
|
||||
Patches are welcome and accepted if they match the project goals.
|
||||
|
||||
For any usage or development discussion please use GitHub Discussions: https://github.com/bromite/bromite/discussions
|
||||
|
||||
# Credits
|
||||
|
||||
* [Chromium project](https://www.chromium.org/Home) and developers
|
||||
* [Iridium project](https://github.com/iridium-browser) for some patches
|
||||
* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches
|
||||
* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches
|
||||
* [GrapheneOS](https://github.com/GrapheneOS) for some security patches
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/brave-core) for some patches
|
||||
* [Vadim Pleshkov](http://vadimpleshkov.me/) for Bromite's logo
|
||||
|
||||
# Filters credits
|
||||
* [EasyList](https://easylist.to/#easylist)
|
||||
* [EasyPrivacy](https://easylist.to/#easyprivacy)
|
||||
* [uBlock Origin](https://github.com/uBlockOrigin)
|
||||
* [Peter Lowe's Ad and tracking server list](https://pgl.yoyo.org/adservers/)
|
||||
|
||||
The URLs of the lists used are available at: https://github.com/bromite/filters/blob/master/lists.txt
|
||||
|
||||
# License
|
||||
|
||||
The patches published as part of the Bromite project are released under [GNU GPL v3](./LICENSE).
|
||||
|
||||
[version-image]: https://img.shields.io/github/release/bromite/bromite.svg?style=flat-square
|
||||
[version-url]: https://github.com/bromite/bromite/releases/latest
|
||||
[license-image]: https://img.shields.io/github/license/bromite/bromite.svg
|
||||
[license-url]: https://github.com/bromite/bromite/blob/master/LICENSE
|
||||
@@ -0,0 +1,64 @@
|
||||
<svg viewBox="0 0 1040 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
@namespace svg url(http://www.w3.org/2000/svg);
|
||||
|
||||
svg {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
text-rendering: geometricPrecision;
|
||||
}
|
||||
svg|a:link, svg|a:visited {
|
||||
cursor: pointer;
|
||||
}
|
||||
.flag-blue {
|
||||
fill: #0057b7;
|
||||
}
|
||||
.flag-yellow {
|
||||
fill: #ffd700;
|
||||
}
|
||||
.message {
|
||||
fill: white;
|
||||
font-size: 20px;
|
||||
}
|
||||
.call {
|
||||
fill: black;
|
||||
font-size: 32px;
|
||||
}
|
||||
.mobile-only {
|
||||
display: none;
|
||||
}
|
||||
.arrow {
|
||||
font-size: 24px;
|
||||
}
|
||||
@media (max-width: 770px) {
|
||||
.message {
|
||||
display: none;
|
||||
font-size: 29px;
|
||||
}
|
||||
.mobile-only {
|
||||
display: inherit;
|
||||
}
|
||||
.call {
|
||||
font-size: 36px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<a href="https://stand-with-ukraine.pp.ua">
|
||||
<rect x="0" y="0" width="100%" height="100%" class="flag-yellow"/>
|
||||
<rect x="0" y="0" width="100%" height="110px" class="flag-blue"/>
|
||||
|
||||
<text x="0" y="25" class="message">
|
||||
<tspan x="25" dy="1.15em">Russia has invaded Ukraine and already killed tens of thousands of civilians, with many more raped or tortured.</tspan>
|
||||
<tspan x="25" dy="1.35em">The death toll keeps climbing. It's a <tspan font-weight="bold">genocide</tspan>. We need your help. Let's fight back against the Russian regime.</tspan>
|
||||
</text>
|
||||
<text x="0" y="25" class="message mobile-only">
|
||||
<tspan x="25" dy=".7em">Russia has invaded Ukraine and already killed tens of thousands of civilians,</tspan>
|
||||
<tspan x="25" dy="1.2em">with many more raped or tortured. It's a <tspan font-weight="bold">genocide</tspan>. We need your help.</tspan>
|
||||
</text>
|
||||
|
||||
<text x="50%" y="78.5%" dominant-baseline="middle" text-anchor="middle" class="call">
|
||||
Help Ukraine Now <tspan dominant-baseline="middle" class="arrow">➔</tspan>
|
||||
</text>
|
||||
</a>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
56775bdf8d12f9d3e1a99fcf1dde6a7417522963-
|
||||
@@ -0,0 +1 @@
|
||||
109.0.5414.61
|
||||
@@ -0,0 +1 @@
|
||||
1b133d62395a6ad11c65997a1c24acffb3f73d9e
|
||||
@@ -0,0 +1,48 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
build_contextual_search=false
|
||||
build_with_tflite_lib=false
|
||||
chrome_pgo_phase=0
|
||||
dcheck_always_on=false
|
||||
debuggable_apks=false
|
||||
dfmify_dev_ui=false
|
||||
disable_android_lint=true
|
||||
disable_autofill_assistant_dfm=true
|
||||
disable_fieldtrial_testing_config=true
|
||||
disable_tab_ui_dfm=true
|
||||
enable_av1_decoder=true
|
||||
enable_dav1d_decoder=true
|
||||
enable_gvr_services=false
|
||||
enable_hangout_services_extension=false
|
||||
enable_iterator_debugging=false
|
||||
enable_mdns=false
|
||||
enable_mse_mpeg2ts_stream_parser=true
|
||||
enable_nacl=false
|
||||
enable_platform_dolby_vision=true
|
||||
enable_platform_hevc=true
|
||||
enable_remoting=false
|
||||
enable_reporting=false
|
||||
enable_vr=false
|
||||
exclude_unwind_tables=false
|
||||
ffmpeg_branding="Chrome"
|
||||
icu_use_data_file=true
|
||||
is_cfi=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
proprietary_codecs=true
|
||||
rtc_build_examples=false
|
||||
safe_browsing_mode=0
|
||||
symbol_level=1
|
||||
system_webview_package_name="org.bromite.webview"
|
||||
target_os="android"
|
||||
treat_warnings_as_errors=true
|
||||
use_cfi_cast=true
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_gnome_keyring=false
|
||||
use_official_google_api_keys=false
|
||||
use_rtti=false
|
||||
use_stable_package_name_for_trichrome=false
|
||||
use_sysroot=false
|
||||
webview_includes_weblayer=false
|
||||
@@ -0,0 +1,204 @@
|
||||
Remove-EV-certificates.patch
|
||||
do-not-hide-.orig-files.patch
|
||||
Do-not-link-with-libatomic.patch
|
||||
do-not-add-suffix-to-package-name.patch
|
||||
exit-on-failure-of-inclusion.patch
|
||||
Disable-safe-browsing.patch
|
||||
Remove-signin-and-sync-integrations.patch
|
||||
Move-some-account-settings-back-to-privacy-settings.patch
|
||||
Remove-contextual-search-manager.patch
|
||||
kill-Vision.patch
|
||||
kill-Location-fall-back-to-system.patch
|
||||
kill-Auth.patch
|
||||
Remove-binary-blob-integrations.patch
|
||||
Remove-SMS-integration.patch
|
||||
Remove-price-shopping-commerce-integrations.patch
|
||||
Remove-voice-recognition-integration.patch
|
||||
Do-not-compile-QR-code-sharing.patch
|
||||
Timezone-customization.patch
|
||||
Revert-the-removal-of-an-option-to-block-autoplay.patch
|
||||
Add-support-for-ISupportHelpAndFeedback.patch
|
||||
JIT-site-settings.patch
|
||||
Site-setting-for-images.patch
|
||||
Content-settings-infrastructure.patch
|
||||
Add-webGL-site-setting.patch
|
||||
Add-webRTC-site-settings.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
Bromite-package-name.patch
|
||||
Restore-classic-new-tab-page.patch
|
||||
Always-use-new-tab-page-for-default-home-page.patch
|
||||
disable-battery-status-updater.patch
|
||||
Battery-API-return-nothing.patch
|
||||
updater-disable-updater-pings.patch
|
||||
Disable-omission-of-URL-elements-in-Omnibox.patch
|
||||
Modify-default-preferences.patch
|
||||
Do-not-hide-component-extensions.patch
|
||||
Do-not-store-passwords-by-default.patch
|
||||
Disable-NTP-remote-suggestions-by-default.patch
|
||||
Disable-references-to-fonts.googleapis.com.patch
|
||||
webRTC-do-not-expose-local-IP-addresses.patch
|
||||
Never-fetch-popular-sites.patch
|
||||
ungoogled-chromium-Disable-webRTC-log-uploader.patch
|
||||
ungoogled-chromium-Disable-untraceable-URLs.patch
|
||||
ungoogled-chromium-Disable-translate-integration.patch
|
||||
ungoogled-chromium-Disable-profile-avatar.patch
|
||||
ungoogled-chromium-Disable-intranet-detector.patch
|
||||
ungoogled-chromium-no-special-hosts-domains.patch
|
||||
ungoogled-chromium-Disable-Gaia.patch
|
||||
ungoogled-chromium-Disable-Network-Time-Tracker.patch
|
||||
Disable-all-promo-dialogs.patch
|
||||
Disable-update-scheduler.patch
|
||||
Add-English-only-search-engine.patch
|
||||
Add-DuckDuckGo-Lite-search-engine.patch
|
||||
openH264-enable-ARM-ARM64-optimizations.patch
|
||||
build-remove-calling-untrusted-hooks.patch
|
||||
Inject-scripts-for-AMP-tracking-ads-and-video.patch
|
||||
Allow-playing-audio-in-background.patch
|
||||
Add-flag-to-control-video-playback-resume-feature.patch
|
||||
Add-exit-menu-item.patch
|
||||
Remove-help-menu-item.patch
|
||||
AudioBuffer-AnalyserNode-fp-mitigations.patch
|
||||
Multiple-fingerprinting-mitigations.patch
|
||||
Add-flag-to-configure-maximum-connections-per-host.patch
|
||||
Do-not-ignore-download-location-prompt-setting.patch
|
||||
Add-support-for-writing-URIs.patch
|
||||
Add-bookmark-import-export-actions.patch
|
||||
Bookmarks-select-all-menu-entry.patch
|
||||
Add-an-always-incognito-mode.patch
|
||||
Keep-flag-to-allow-screenshots-in-Incognito-mode.patch
|
||||
Add-option-to-not-persist-tabs-across-sessions.patch
|
||||
Add-a-proxy-configuration-page.patch
|
||||
Add-custom-tab-intents-privacy-option.patch
|
||||
Disable-FLoC-and-privacy-sandbox.patch
|
||||
History-number-of-days-privacy-setting.patch
|
||||
Disable-fetching-of-all-field-trials.patch
|
||||
Disable-plugins-enumeration.patch
|
||||
net-cert-increase-default-key-length.patch
|
||||
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
|
||||
Add-flag-to-disable-IPv6-probes.patch
|
||||
profile-resetter-disable-send-settings.patch
|
||||
Do-not-build-API-keys-infobar.patch
|
||||
autofill-miscellaneous.patch
|
||||
Enable-native-Android-autofill.patch
|
||||
first_run-deactivate-autoupdate-globally.patch
|
||||
translate-disable-fetching-of-languages-from-server.patch
|
||||
Offer-builtin-autocomplete-for-chrome-flags.patch
|
||||
Use-4-tile-rows-never-show-logo.patch
|
||||
Disable-various-metrics.patch
|
||||
Enable-SPPI-for-devices-with-enough-memory.patch
|
||||
Enable-StrictOriginIsolation-and-SitePerProcess.patch
|
||||
Use-64-bit-WebView-processes.patch
|
||||
prefs-always-prompt-for-download-directory.patch
|
||||
Disable-offline-pages-in-CCT.patch
|
||||
Disable-media-router-and-remoting-by-default.patch
|
||||
Restore-Search-Ready-Omnibox-flag.patch
|
||||
disable-AdsBlockedInfoBar.patch
|
||||
Bromite-subresource-adblocker.patch
|
||||
Bromite-auto-updater.patch
|
||||
Replace-DoH-probe-domain-with-RIPE-domain.patch
|
||||
Increase-number-of-autocomplete-matches-to-10.patch
|
||||
Disable-requests-for-single-word-Omnibar-searches.patch
|
||||
Disable-some-signed-exchange-features.patch
|
||||
DoH-improvements.patch
|
||||
Reduce-HTTP-headers-in-DoH-requests-to-bare-minimum.patch
|
||||
Revert-flags-remove-disable-pull-to-refresh-effect.patch
|
||||
Use-dummy-DFM-installer.patch
|
||||
Disable-feeds-support-by-default.patch
|
||||
Show-site-settings-for-cookies-javascript-and-ads.patch
|
||||
Disable-DRM-media-origin-IDs-preprovisioning.patch
|
||||
Disable-smart-selection-by-default.patch
|
||||
Guard-for-user-agent-reduction.patch
|
||||
AImageReader-CFI-crash-mitigations.patch
|
||||
Add-menu-item-to-view-source.patch
|
||||
Revert-removal-of-execution-context-address-space.patch
|
||||
Block-gateway-attacks-via-websockets.patch
|
||||
Enable-prefetch-privacy-changes-by-default.patch
|
||||
Disable-support-for-RAR-files-inspection.patch
|
||||
Enable-darken-websites-checkbox-in-themes.patch
|
||||
Remove-blocklisted-URLs-upon-bookmark-creation.patch
|
||||
Disable-the-DIAL-repeating-discovery.patch
|
||||
Block-qjz9zk-or-trk-requests.patch
|
||||
Hardening-against-incognito-mode-detection.patch
|
||||
Remove-weblayer-dependency-on-Play-Services.patch
|
||||
Restore-Simplified-NTP-launch.patch
|
||||
Add-option-to-use-home-page-as-NTP.patch
|
||||
Disable-text-fragments-by-default.patch
|
||||
disable-WebView-variations-support.patch
|
||||
Enable-network-isolation-features.patch
|
||||
Revert-flags-remove-num-raster-threads.patch
|
||||
webview-Hard-no-to-persistent-histograms.patch
|
||||
Ignore-enterprise-policies-for-secure-DNS.patch
|
||||
Add-menu-item-to-bookmark-all-tabs.patch
|
||||
Re-introduce-modal-dialog-flag-to-close-all-tabs.patch
|
||||
Add-option-to-force-tablet-UI.patch
|
||||
Add-Alt-D-hotkey-to-focus-address-bar.patch
|
||||
User-agent-customization.patch
|
||||
Add-AllowUserCertificates-flag.patch
|
||||
Add-IsCleartextPermitted-flag.patch
|
||||
Unexpire-tab-groups-flags.patch
|
||||
Add-flag-for-omnibox-autocomplete-filtering.patch
|
||||
Revert-Delete-block-external-form-redirects.patch
|
||||
Add-flag-to-disable-external-intent-requests.patch
|
||||
Enable-share-intent.patch
|
||||
Logcat-crash-reports-UI.patch
|
||||
Add-flag-to-disable-vibration.patch
|
||||
mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
|
||||
Client-hints-overrides.patch
|
||||
Disable-AGSA-by-default.patch
|
||||
Allow-building-without-enable_reporting.patch
|
||||
Disable-lock-icon-in-address-bar-by-default.patch
|
||||
Experimental-user-scripts-support.patch
|
||||
Keep-empty-tabs-between-sessions.patch
|
||||
Disable-third-party-origin-trials.patch
|
||||
Never-use-HTTP-probes-for-connection-detection.patch
|
||||
Disable-Accessibility-service-by-default.patch
|
||||
Disable-conversion-measurement-api.patch
|
||||
Restore-offline-indicator-v2-flag.patch
|
||||
Re-introduce-override_build_timestamp.patch
|
||||
enable-ftrivial-auto-var-init-zero.patch
|
||||
disable-appending-variations-header.patch
|
||||
Disable-idle-detection.patch
|
||||
Allow-building-without-supervised-users.patch
|
||||
Disable-minidump-upload-scheduling.patch
|
||||
Revert-Permit-blocking-of-view-source.patch
|
||||
Disable-safety-check.patch
|
||||
Disable-all-predictors-code.patch
|
||||
OpenSearch-miscellaneous.patch
|
||||
Update-i18n-zh_CN-support.patch
|
||||
Add-flag-for-save-data-header.patch
|
||||
Disable-UA-full-version.patch
|
||||
Dictionary-suggestions-for-the-Omnibox.patch
|
||||
Disable-AsyncDNS-by-default.patch
|
||||
Add-lifetime-options-for-permissions.patch
|
||||
Disable-crash-reporting.patch
|
||||
Samsung-Note-9-SDK27-crazylinker-workaround.patch
|
||||
Disable-TLS-resumption.patch
|
||||
Remove-mremap-from-seccomp-baseline-policy.patch
|
||||
Move-navigation-bar-to-bottom.patch
|
||||
Welcome-screen.patch
|
||||
Add-site-engagement-flag.patch
|
||||
Enable-Certificate-Transparency.patch
|
||||
Invalidate-components-public-key.patch
|
||||
Improve-plain-text-rendering-on-mobile.patch
|
||||
Remove-segmentation-platform.patch
|
||||
Follow-only-system-dark-mode.patch
|
||||
Remove-window-name-on-cross-origin-navigation.patch
|
||||
Remove-preload-of-com.google.android.gms.fonts.patch
|
||||
Partition-Blink-memory-cache.patch
|
||||
Remove-navigator.connection-info.patch
|
||||
Disable-PrivacyGuide.patch
|
||||
sharing-hub-always-use-visible-URL.patch
|
||||
Re-introduce-kWebAuthCable.patch
|
||||
Enable-HEVC-by-default.patch
|
||||
Partition-blobs-by-top-frame-URL.patch
|
||||
Override-Navigator-Language.patch
|
||||
Disable-add-to-home-screen-prompt.patch
|
||||
Remove-HTTP-referrals-in-cross-origin-navigation.patch
|
||||
Enable-ECH-by-default.patch
|
||||
Disable-StartSurface-feature.patch
|
||||
Clamp-time-resolution-in-requestAnimationFrame.patch
|
||||
Enable-PermuteTLSExtensions-by-default.patch
|
||||
Enable-third-party-storage-partitioning.patch
|
||||
Restore-adaptive-button-in-top-toolbar-customization.patch
|
||||
Automated-domain-substitution.patch
|
||||
@@ -0,0 +1,48 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
build_contextual_search=false
|
||||
build_with_tflite_lib=false
|
||||
chrome_pgo_phase=0
|
||||
dcheck_always_on=false
|
||||
debuggable_apks=false
|
||||
dfmify_dev_ui=false
|
||||
disable_android_lint=true
|
||||
disable_autofill_assistant_dfm=true
|
||||
disable_fieldtrial_testing_config=true
|
||||
disable_tab_ui_dfm=true
|
||||
enable_av1_decoder=true
|
||||
enable_dav1d_decoder=true
|
||||
enable_gvr_services=false
|
||||
enable_hangout_services_extension=false
|
||||
enable_iterator_debugging=false
|
||||
enable_mdns=false
|
||||
enable_mse_mpeg2ts_stream_parser=true
|
||||
enable_nacl=false
|
||||
enable_platform_dolby_vision=true
|
||||
enable_platform_hevc=true
|
||||
enable_remoting=false
|
||||
enable_reporting=true
|
||||
enable_vr=false
|
||||
exclude_unwind_tables=false
|
||||
ffmpeg_branding="Chrome"
|
||||
icu_use_data_file=true
|
||||
is_cfi=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
proprietary_codecs=true
|
||||
rtc_build_examples=false
|
||||
safe_browsing_mode=2
|
||||
symbol_level=1
|
||||
system_webview_package_name="com.android.webview"
|
||||
target_os="android"
|
||||
treat_warnings_as_errors=true
|
||||
use_cfi_cast=true
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_gnome_keyring=false
|
||||
use_official_google_api_keys=false
|
||||
use_rtti=false
|
||||
use_stable_package_name_for_trichrome=false
|
||||
use_sysroot=false
|
||||
webview_includes_weblayer=false
|
||||
@@ -0,0 +1,10 @@
|
||||
exit-on-failure-of-inclusion.patch
|
||||
Reintroduce-override_build_timestamp.patch
|
||||
do-not-hide-.orig-files.patch
|
||||
Do-not-link-with-libatomic.patch
|
||||
do-not-add-suffix-to-package-name.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
enable-ftrivial-auto-var-init-zero.patch
|
||||
Disable-feeds-support-by-default.patch
|
||||
Chromium-package-name.patch
|
||||
@@ -0,0 +1,650 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 08:14:13 +0000
|
||||
Subject: 109 Move navigation bar to bottom fixup
|
||||
|
||||
---
|
||||
.../features/start_surface/StartSurfaceMediator.java | 2 +-
|
||||
.../tasks/tab_management/TabGroupUiToolbarView.java | 2 +-
|
||||
.../browser/tasks/tab_management/TabListCoordinator.java | 2 +-
|
||||
.../browser/tasks/tab_management/TabListRecyclerView.java | 6 +++---
|
||||
.../browser/tasks/tab_management/TabSwitcherMediator.java | 8 ++++----
|
||||
.../settings/ChromeAccessibilitySettingsDelegate.java | 2 +-
|
||||
.../org/chromium/chrome/browser/app/ChromeActivity.java | 2 +-
|
||||
.../chrome/browser/compositor/CompositorViewHolder.java | 2 +-
|
||||
.../browser/compositor/layouts/LayoutManagerChrome.java | 2 +-
|
||||
.../browser/compositor/layouts/ToolbarSwipeLayout.java | 4 ++--
|
||||
.../overlays/strip/StripLayoutHelperManager.java | 2 +-
|
||||
.../compositor/scene_layer/StaticTabSceneLayer.java | 2 +-
|
||||
.../browser/compositor/scene_layer/TabListSceneLayer.java | 4 ++--
|
||||
.../compositor/scene_layer/TabStripSceneLayer.java | 2 +-
|
||||
.../chrome/browser/findinpage/FindToolbarTablet.java | 2 +-
|
||||
.../chrome/browser/fullscreen/BrowserControlsManager.java | 4 ++--
|
||||
.../browser/messages/MessageContainerCoordinator.java | 4 ++--
|
||||
.../src/org/chromium/chrome/browser/ntp/NewTabPage.java | 2 +-
|
||||
.../org/chromium/chrome/browser/ntp/RecentTabsPage.java | 6 +++---
|
||||
.../chrome/browser/searchwidget/SearchActivity.java | 2 +-
|
||||
.../status_indicator/StatusIndicatorCoordinator.java | 2 +-
|
||||
.../status_indicator/StatusIndicatorSceneLayer.java | 2 +-
|
||||
.../chromium/chrome/browser/toolbar/ToolbarManager.java | 4 ++--
|
||||
.../org/chromium/chrome/browser/ui/BottomContainer.java | 6 +++---
|
||||
.../browser/ui/system/StatusBarColorController.java | 2 +-
|
||||
.../browser_controls/BrowserControlsMarginSupplier.java | 2 +-
|
||||
.../org/chromium/chrome/browser/ui/appmenu/AppMenu.java | 8 ++++----
|
||||
.../chrome/browser/ui/appmenu/AppMenuHandlerImpl.java | 2 +-
|
||||
.../chrome/browser/omnibox/UrlBarCoordinator.java | 2 +-
|
||||
.../omnibox/suggestions/AutocompleteCoordinator.java | 2 +-
|
||||
.../browser/omnibox/suggestions/AutocompleteMediator.java | 2 +-
|
||||
.../omnibox/suggestions/OmniboxSuggestionsDropdown.java | 4 ++--
|
||||
.../browser/toolbar/LocationBarFocusScrimHandler.java | 2 +-
|
||||
.../browser/toolbar/bottom/BottomControlsMediator.java | 2 +-
|
||||
.../toolbar/bottom/ScrollingBottomViewSceneLayer.java | 2 +-
|
||||
.../browser/toolbar/top/ToolbarControlContainer.java | 2 +-
|
||||
.../chrome/browser/toolbar/top/TopToolbarSceneLayer.java | 2 +-
|
||||
37 files changed, 55 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java
|
||||
--- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java
|
||||
+++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java
|
||||
@@ -1134,7 +1134,7 @@ class StartSurfaceMediator implements TabSwitcher.TabSwitcherViewObserver, View.
|
||||
}
|
||||
|
||||
private void setTopMargin(int topMargin) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
topMargin = 0;
|
||||
mPropertyModel.set(TOP_MARGIN, topMargin);
|
||||
}
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiToolbarView.java
|
||||
@@ -177,7 +177,7 @@ public class TabGroupUiToolbarView extends FrameLayout {
|
||||
}
|
||||
|
||||
void setPrimaryColorAndApplyTint(int color) {
|
||||
- if (!CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (!ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
return;
|
||||
|
||||
// change the background color of the bottom bar if the top toolbar is below
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListCoordinator.java
|
||||
@@ -324,7 +324,7 @@ public class TabListCoordinator
|
||||
if (mMode == TabListMode.GRID) {
|
||||
GridLayoutManager gridLayoutManager =
|
||||
new GridLayoutManager(context, GRID_LAYOUT_SPAN_COUNT_COMPACT);
|
||||
- if (titleProvider != null && CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (titleProvider != null && ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
gridLayoutManager =
|
||||
new GridLayoutManagerDockBottom(context, GRID_LAYOUT_SPAN_COUNT_COMPACT);
|
||||
((GridLayoutManagerDockBottom)gridLayoutManager)
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListRecyclerView.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListRecyclerView.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListRecyclerView.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListRecyclerView.java
|
||||
@@ -232,7 +232,7 @@ class TabListRecyclerView
|
||||
}
|
||||
|
||||
void setShadowVisibility(boolean shouldShowShadow) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()
|
||||
&& mIsVisible) {
|
||||
// always show shadow
|
||||
shouldShowShadow = true;
|
||||
@@ -250,7 +250,7 @@ class TabListRecyclerView
|
||||
// Add shadow for grid tab switcher.
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||
LayoutParams.MATCH_PARENT, shadowHeight,
|
||||
- (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM) ?
|
||||
+ (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled() ?
|
||||
Gravity.BOTTOM :
|
||||
Gravity.TOP));
|
||||
mShadowImageView.setLayoutParams(params);
|
||||
@@ -279,7 +279,7 @@ class TabListRecyclerView
|
||||
|
||||
void setShadowTopOffset(int shadowTopOffset) {
|
||||
mShadowTopOffset = shadowTopOffset;
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// invert the offset since Gravity is set to BOTTOM
|
||||
mShadowTopOffset = -mShadowTopOffset;
|
||||
}
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java
|
||||
@@ -461,7 +461,7 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
|
||||
updateTopControlsProperties();
|
||||
mContainerViewModel.set(
|
||||
BOTTOM_CONTROLS_HEIGHT, browserControlsStateProvider.getBottomControlsHeight());
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
mContainerViewModel.set(
|
||||
BOTTOM_CONTROLS_HEIGHT, mContainerViewModel.get(BOTTOM_CONTROLS_HEIGHT) +
|
||||
mBrowserControlsStateProvider.getContentOffset());
|
||||
@@ -471,7 +471,7 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
|
||||
if (mMode == TabListMode.GRID) {
|
||||
mContainerViewModel.set(BOTTOM_PADDING,
|
||||
(int) context.getResources().getDimension(R.dimen.tab_grid_bottom_padding));
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// adjust the bottom margin so as not to cover the top toolbar at the bottom
|
||||
mContainerViewModel.set(
|
||||
BOTTOM_PADDING, mContainerViewModel.get(BOTTOM_PADDING) +
|
||||
@@ -604,7 +604,7 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
|
||||
final int contentOffset = mBrowserControlsStateProvider.getContentOffset();
|
||||
|
||||
mContainerViewModel.set(TOP_MARGIN, contentOffset);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// move the view up since the toolbar is at the bottom
|
||||
mContainerViewModel.set(TOP_MARGIN, 0);
|
||||
}
|
||||
@@ -764,7 +764,7 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
|
||||
private void setInitialScrollIndexOffset() {
|
||||
int offset = mMode == TabListMode.CAROUSEL ? INITIAL_SCROLL_INDEX_OFFSET_CAROUSEL
|
||||
: INITIAL_SCROLL_INDEX_OFFSET_GTS;
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
offset = 0;
|
||||
}
|
||||
int initialPosition = Math.max(
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
@@ -104,7 +104,7 @@ public class ChromeAccessibilitySettingsDelegate implements AccessibilitySetting
|
||||
private static class MoveTopToolbarToBottomDelegate implements BooleanPreferenceDelegate {
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
- return CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM);
|
||||
+ return ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -764,7 +764,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
ImageView shadowImage = findViewById(R.id.toolbar_hairline);
|
||||
if (shadowImage != null) {
|
||||
// Invert the shadown if the top toolbar is at the bottom
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
ViewGroup.MarginLayoutParams marginParams = (ViewGroup.MarginLayoutParams)shadowImage.getLayoutParams();
|
||||
marginParams.setMargins(marginParams.leftMargin, 0,
|
||||
marginParams.rightMargin, marginParams.bottomMargin);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
|
||||
@@ -319,7 +319,7 @@ public class CompositorViewHolder extends FrameLayout
|
||||
WebContents webContents = mTabVisible.getWebContents();
|
||||
if (webContents == null) return;
|
||||
EventForwarder forwarder = webContents.getEventForwarder();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// no need to adjust the touch offsets, since the content view is never moved
|
||||
top = 0;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java
|
||||
@@ -213,7 +213,7 @@ public class LayoutManagerChrome
|
||||
@Override
|
||||
public SwipeHandler createToolbarSwipeHandler(boolean supportSwipeDown) {
|
||||
boolean move_top_toolbar =
|
||||
- CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM);
|
||||
+ ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled();
|
||||
return new ToolbarSwipeHandler(supportSwipeDown && !move_top_toolbar,
|
||||
supportSwipeDown && move_top_toolbar);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java
|
||||
@@ -411,7 +411,7 @@ public class ToolbarSwipeLayout extends Layout {
|
||||
mLeftToolbarOverlay.setXOffset(leftX * dpToPx);
|
||||
}
|
||||
mLeftTab.setX(leftX);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
mLeftTab.setY(0);
|
||||
} else {
|
||||
mLeftTab.setY(mBrowserControlsStateProvider.getContentOffset() / dpToPx);
|
||||
@@ -428,7 +428,7 @@ public class ToolbarSwipeLayout extends Layout {
|
||||
mRightToolbarOverlay.setXOffset(rightX * dpToPx);
|
||||
}
|
||||
mRightTab.setX(rightX);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
mRightTab.setY(0);
|
||||
} else {
|
||||
mRightTab.setY(mBrowserControlsStateProvider.getContentOffset() / dpToPx);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
@@ -421,7 +421,7 @@ public class StripLayoutHelperManager implements SceneOverlay, PauseResumeWithNa
|
||||
mWidth, mHeight, orientationChanged, LayoutManagerImpl.time());
|
||||
|
||||
float top = 0;
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM) &&
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled() &&
|
||||
mBrowserControlsManagerSupplier.get() != null) {
|
||||
// move the rectangle to grab the touch events as the tab list (in tablet mode)
|
||||
// is down and is following the toolbar offset as it moves.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/StaticTabSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/StaticTabSceneLayer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/StaticTabSceneLayer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/StaticTabSceneLayer.java
|
||||
@@ -48,7 +48,7 @@ public class StaticTabSceneLayer extends SceneLayer {
|
||||
float x = model.get(LayoutTab.RENDER_X) * LayoutTab.sDpToPx;
|
||||
float y = model.get(LayoutTab.CONTENT_OFFSET)
|
||||
+ model.get(LayoutTab.RENDER_Y) * LayoutTab.sDpToPx;
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// the page content window never moves, it is fixed at the top
|
||||
y = 0;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
|
||||
@@ -86,7 +86,7 @@ public class TabListSceneLayer extends SceneLayer {
|
||||
|
||||
TabListSceneLayerJni.get().beginBuildingFrame(mNativePtr, TabListSceneLayer.this);
|
||||
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// the tabs list content window is fixed at the top, where the top toolbar used to be
|
||||
viewport.top = 0;
|
||||
backgroundTopOffset = 0;
|
||||
@@ -126,7 +126,7 @@ public class TabListSceneLayer extends SceneLayer {
|
||||
contentOffset = browserControls.getContentOffset();
|
||||
}
|
||||
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
toolbarYOffset = 0;
|
||||
contentOffset = 0;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
@@ -84,7 +84,7 @@ public class TabStripSceneLayer extends SceneOverlayLayer {
|
||||
if (mNativePtr == 0) return;
|
||||
|
||||
boolean visible = yOffset > -layoutHelper.getHeight();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// the list of open tabs (in tablet mode) is moved down, above the top
|
||||
// toolbar which is also below.
|
||||
// values are in pixel.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/findinpage/FindToolbarTablet.java b/chrome/android/java/src/org/chromium/chrome/browser/findinpage/FindToolbarTablet.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/findinpage/FindToolbarTablet.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/findinpage/FindToolbarTablet.java
|
||||
@@ -169,7 +169,7 @@ public class FindToolbarTablet extends FindToolbar {
|
||||
|
||||
if (show && getVisibility() != View.VISIBLE && mCurrentAnimation != mAnimationEnter) {
|
||||
View anchorView = getRootView().findViewById(R.id.toolbar);
|
||||
- if (!CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (!ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
|
||||
lp.topMargin = anchorView.getBottom() - mYInsetPx;
|
||||
setLayoutParams(lp);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java
|
||||
@@ -400,7 +400,7 @@ public class BrowserControlsManager
|
||||
|
||||
@Override
|
||||
public int getTopControlsHeightRealOffset() {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
return 0;
|
||||
else
|
||||
return mTopControlContainerHeight;
|
||||
@@ -472,7 +472,7 @@ public class BrowserControlsManager
|
||||
|
||||
@Override
|
||||
public float getTopVisibleContentOffset() {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
return 0;
|
||||
return getTopControlsHeight() + getTopControlOffset();
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/messages/MessageContainerCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/messages/MessageContainerCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/messages/MessageContainerCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/messages/MessageContainerCoordinator.java
|
||||
@@ -64,7 +64,7 @@ public class MessageContainerCoordinator implements BrowserControlsStateProvider
|
||||
}
|
||||
CoordinatorLayout.LayoutParams params =
|
||||
(CoordinatorLayout.LayoutParams) mContainer.getLayoutParams();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
params.gravity = Gravity.START | Gravity.BOTTOM;
|
||||
params.bottomMargin = getContainerTopOffset();
|
||||
} else {
|
||||
@@ -129,7 +129,7 @@ public class MessageContainerCoordinator implements BrowserControlsStateProvider
|
||||
|
||||
/** @return Offset of the message container from the top of the screen. */
|
||||
private int getContainerTopOffset() {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
return mControlsManager.getContentOffset()
|
||||
+ (mControlsManager.getBottomControlsHeight() - mControlsManager.getBottomControlOffset())
|
||||
+ mContainer.getMessageShadowTopMargin();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
|
||||
@@ -565,7 +565,7 @@ public class NewTabPage implements NativePage, InvalidationAwareThumbnailProvide
|
||||
|
||||
int bottomMargin = mBrowserControlsStateProvider.getBottomControlsHeight()
|
||||
- mBrowserControlsStateProvider.getBottomControlOffset();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// move the margin of the new tab page up if the top toolbar is at the bottom
|
||||
bottomMargin += mBrowserControlsStateProvider.getTopControlsHeight();
|
||||
topMargin = -mBrowserControlsStateProvider.getTopControlsHeight();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java
|
||||
@@ -91,7 +91,7 @@ public class RecentTabsPage
|
||||
mView.addOnAttachStateChangeListener(this);
|
||||
|
||||
if (!DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity) ||
|
||||
- CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
mBrowserControlsStateProvider = browserControlsStateProvider;
|
||||
mBrowserControlsStateProvider.addObserver(this);
|
||||
onBottomControlsHeightChanged(mBrowserControlsStateProvider.getBottomControlsHeight(),
|
||||
@@ -289,7 +289,7 @@ public class RecentTabsPage
|
||||
|
||||
// If the content offset is different from the margin, we use translationY to position the
|
||||
// view in line with the content offset.
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
topMargin = 0;
|
||||
recentTabsRoot.setTranslationY(0);
|
||||
} else {
|
||||
@@ -297,7 +297,7 @@ public class RecentTabsPage
|
||||
}
|
||||
|
||||
int bottomMargin = mBrowserControlsStateProvider.getBottomControlsHeight();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
bottomMargin += mBrowserControlsStateProvider.getTopControlsHeight();
|
||||
}
|
||||
if (topMargin != layoutParams.topMargin || bottomMargin != layoutParams.bottomMargin) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
||||
@@ -194,7 +194,7 @@ public class SearchActivity extends AsyncInitializationActivity
|
||||
mSearchBox = (SearchActivityLocationBarLayout) mContentView.findViewById(
|
||||
R.id.search_location_bar);
|
||||
mAnchorView = mContentView.findViewById(R.id.toolbar);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams)
|
||||
mAnchorView.getLayoutParams();
|
||||
layoutParams.gravity = Gravity.START | Gravity.BOTTOM;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorCoordinator.java
|
||||
@@ -179,7 +179,7 @@ public class StatusIndicatorCoordinator {
|
||||
private void initialize() {
|
||||
final ViewStub stub = mActivity.findViewById(R.id.status_indicator_stub);
|
||||
final ViewResourceFrameLayout root = (ViewResourceFrameLayout) stub.inflate();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// status messages (such as the offline indicator) are docked at the bottom
|
||||
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams)root.getLayoutParams();
|
||||
layoutParams.gravity = Gravity.START | Gravity.BOTTOM;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java
|
||||
@@ -80,7 +80,7 @@ class StatusIndicatorSceneLayer extends SceneOverlayLayer implements SceneOverla
|
||||
public SceneOverlayLayer getUpdatedSceneOverlayTree(
|
||||
RectF viewport, RectF visibleViewport, ResourceManager resourceManager, float yOffset) {
|
||||
int offset = mBrowserControlsStateProvider.getTopControlsMinHeightOffset();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
offset = (int)viewport.bottom - offset;
|
||||
}
|
||||
StatusIndicatorSceneLayerJni.get().updateStatusIndicatorLayer(
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
|
||||
@@ -1318,7 +1318,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
|
||||
|
||||
private void MoveBottomBarOverTopBar() {
|
||||
if (bottomRoot != null &&
|
||||
- CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// move up the container view of the ui
|
||||
// below there is the toolbar
|
||||
bottomRoot.setTranslationY(-mBrowserControlsSizer.getTopControlsHeight());
|
||||
@@ -2123,7 +2123,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
|
||||
private void setControlContainerTopMargin(int margin) {
|
||||
final ViewGroup.MarginLayoutParams layoutParams =
|
||||
((ViewGroup.MarginLayoutParams) mControlContainer.getLayoutParams());
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
if (layoutParams.bottomMargin == margin) {
|
||||
return;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomContainer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomContainer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/BottomContainer.java
|
||||
@@ -66,13 +66,13 @@ public class BottomContainer
|
||||
|
||||
@Override
|
||||
public void onTopControlsHeightChanged(int topControlsHeight, int topControlsMinHeight) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
setTranslationY(mBaseYOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAndroidVisibilityChanged(int visibility) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
setTranslationY(mBaseYOffset);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class BottomContainer
|
||||
public void setTranslationY(float y) {
|
||||
mBaseYOffset = y;
|
||||
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// the snackbar container is moved up because there is the top toolbar at the bottom
|
||||
mBaseYOffset = -(mBrowserControlsStateProvider.getTopControlsHeight()
|
||||
+ mBrowserControlsStateProvider.getTopControlOffset());
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
|
||||
@@ -428,7 +428,7 @@ public class StatusBarColorController
|
||||
boolean needsDarkStatusBarIcons = !ColorUtils.shouldUseLightForegroundOnBackground(color);
|
||||
ApiCompatibilityUtils.setStatusBarIconColor(root, needsDarkStatusBarIcons);
|
||||
ApiCompatibilityUtils.setStatusBarColor(mWindow, color);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM) &&
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled() &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
UiUtils.setNavigationBarIconColor(mWindow.getDecorView().getRootView(),
|
||||
needsDarkStatusBarIcons);
|
||||
diff --git a/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java b/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java
|
||||
--- a/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java
|
||||
+++ b/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserControlsMarginSupplier.java
|
||||
@@ -54,7 +54,7 @@ public class BrowserControlsMarginSupplier extends ObservableSupplierImpl<Rect>
|
||||
+ mBrowserControlsStateProvider.getTopControlOffset();
|
||||
int bottomMargin = mBrowserControlsStateProvider.getBottomControlsHeight()
|
||||
- mBrowserControlsStateProvider.getBottomControlOffset();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
bottomMargin += topMargin;
|
||||
topMargin = 0;
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenu.java b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenu.java
|
||||
--- a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenu.java
|
||||
+++ b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenu.java
|
||||
@@ -265,7 +265,7 @@ class AppMenu implements OnItemClickListener, OnKeyListener, AppMenuClickHandler
|
||||
}
|
||||
|
||||
mListView = (ListView) contentView.findViewById(R.id.app_menu_list);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// always scroll to the bottom to show new items
|
||||
mListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
|
||||
// fill content starting from the bottom of the view
|
||||
@@ -310,7 +310,7 @@ class AppMenu implements OnItemClickListener, OnKeyListener, AppMenuClickHandler
|
||||
if (popupHeight + popupPosition[1] > visibleDisplayFrame.bottom) {
|
||||
mPopup.setHeight(visibleDisplayFrame.height());
|
||||
}
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// due to some unknown behaviour, the popup must be resized to
|
||||
// allow selection without leaving touch
|
||||
mPopup.setHeight(popupHeight-1);
|
||||
@@ -362,7 +362,7 @@ class AppMenu implements OnItemClickListener, OnKeyListener, AppMenuClickHandler
|
||||
int anchorViewX = tempLocation[0];
|
||||
int anchorViewY = tempLocation[1];
|
||||
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// moves the view offset up by the height of the popup
|
||||
anchorViewY -= popupHeight;
|
||||
// fix it if it goes offscreen
|
||||
@@ -560,7 +560,7 @@ class AppMenu implements OnItemClickListener, OnKeyListener, AppMenuClickHandler
|
||||
}
|
||||
int availableScreenSpace = Math.max(
|
||||
anchorViewY, appDimensions.height() - anchorViewY - anchorViewImpactHeight);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// use all available space
|
||||
availableScreenSpace = appDimensions.height() - anchorViewImpactHeight;
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
|
||||
diff --git a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuHandlerImpl.java b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuHandlerImpl.java
|
||||
--- a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuHandlerImpl.java
|
||||
+++ b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuHandlerImpl.java
|
||||
@@ -184,7 +184,7 @@ class AppMenuHandlerImpl
|
||||
}),
|
||||
this);
|
||||
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// reverses the order of items in the menu
|
||||
ModelList modelListReversed = new ModelList();
|
||||
for (int i = 0; i < modelList.size(); i++) {
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarCoordinator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarCoordinator.java
|
||||
@@ -239,7 +239,7 @@ public class UrlBarCoordinator implements UrlBarEditingTextStateProvider, UrlFoc
|
||||
// to show or hide keyboard anyway. This may happen when we schedule keyboard hide, and
|
||||
// receive a second request to hide the keyboard instantly.
|
||||
if (showKeyboard) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// probably due to an android bug, fix the size rather than pan the view.
|
||||
// with the pan the bar may not always follow the focus if not at the first input by the user
|
||||
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE, /* delay */ false);
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteCoordinator.java
|
||||
@@ -236,7 +236,7 @@ public class AutocompleteCoordinator implements UrlFocusChangeListener, UrlTextC
|
||||
ViewGroup container = (ViewGroup) ((ViewStub) mParent.getRootView().findViewById(
|
||||
R.id.omnibox_results_container_stub))
|
||||
.inflate();
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// make margins works
|
||||
dropdown.getViewGroup().setClipToPadding(true);
|
||||
container.bringToFront();
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
|
||||
@@ -1013,7 +1013,7 @@ class AutocompleteMediator implements OnSuggestionsReceivedListener,
|
||||
@Override
|
||||
public void onSuggestionDropdownScroll() {
|
||||
mSuggestionsListScrolled = true;
|
||||
- if (!CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (!ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
mDelegate.setKeyboardVisibility(false, false);
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java
|
||||
@@ -266,7 +266,7 @@ public class OmniboxSuggestionsDropdown extends RecyclerView {
|
||||
final Resources resources = context.getResources();
|
||||
int paddingBottom =
|
||||
resources.getDimensionPixelOffset(R.dimen.omnibox_suggestion_list_padding_bottom);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// reverse the layout so that the items are at the bottom (in reverse order)
|
||||
// and anchored to the bottom edge
|
||||
mLayoutScrollListener.setReverseLayout(true);
|
||||
@@ -496,7 +496,7 @@ public class OmniboxSuggestionsDropdown extends RecyclerView {
|
||||
}
|
||||
|
||||
private int calculateAnchorBottomRelativeToContent() {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM))
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled())
|
||||
return 0;
|
||||
View contentView =
|
||||
mEmbedder.getAnchorView().getRootView().findViewById(android.R.id.content);
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarFocusScrimHandler.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarFocusScrimHandler.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarFocusScrimHandler.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarFocusScrimHandler.java
|
||||
@@ -58,7 +58,7 @@ public class LocationBarFocusScrimHandler implements UrlFocusChangeListener {
|
||||
|
||||
Resources resources = context.getResources();
|
||||
int topMargin = resources.getDimensionPixelSize(R.dimen.tab_strip_height);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// since the top bar is at the bottom, we need to cover the whole page
|
||||
topMargin = 0;
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsMediator.java
|
||||
@@ -105,7 +105,7 @@ class BottomControlsMediator implements BrowserControlsStateProvider.Observer,
|
||||
void setBottomControlsVisible(boolean visible) {
|
||||
if (visible == true
|
||||
&& mIsBottomControlsVisible == false
|
||||
- && CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ && ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// always show the toolbar if the bottom controls are visible, so as not to leave the hole below.
|
||||
mBrowserControlsSizer.getBrowserVisibilityDelegate().showControlsTransient();
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/ScrollingBottomViewSceneLayer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/ScrollingBottomViewSceneLayer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/ScrollingBottomViewSceneLayer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/bottom/ScrollingBottomViewSceneLayer.java
|
||||
@@ -127,7 +127,7 @@ public class ScrollingBottomViewSceneLayer extends SceneOverlayLayer implements
|
||||
boolean isShadowVisible = mBottomView.getVisibility() != View.VISIBLE;
|
||||
|
||||
float offsetPy = viewport.height() + mCurrentYOffsetPx;
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// fix the offset of the fake bottom controls, used only for animations
|
||||
offsetPy -= (mBottomView.getHeight() - mCurrentYOffsetPx + mTopControlsMinHeightOffset);
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
@@ -109,7 +109,7 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
|
||||
@Override
|
||||
public void initWithToolbar(int toolbarLayoutId) {
|
||||
try (TraceEvent te = TraceEvent.scoped("ToolbarControlContainer.initWithToolbar")) {
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// the top toolbar is docked at the bottom
|
||||
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams)getLayoutParams();
|
||||
layoutParams.gravity = Gravity.START | Gravity.BOTTOM;
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarSceneLayer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarSceneLayer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarSceneLayer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarSceneLayer.java
|
||||
@@ -41,7 +41,7 @@ class TopToolbarSceneLayer extends SceneOverlayLayer {
|
||||
private void pushProperties(PropertyModel model) {
|
||||
if (mResourceManagerSupplier.get() == null) return;
|
||||
float offsetY = model.get(TopToolbarOverlayProperties.Y_OFFSET);
|
||||
- if (CachedFeatureFlags.isEnabled(ChromeFeatureList.MOVE_TOP_TOOLBAR_TO_BOTTOM)) {
|
||||
+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) {
|
||||
// fix the offset of the fake top controls, used only for animations
|
||||
offsetY = model.get(TopToolbarOverlayProperties.VIEWPORT_HEIGHT) -
|
||||
model.get(TopToolbarOverlayProperties.TOOLBAR_HEIGHT) -
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,53 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:48:07 +0000
|
||||
Subject: Add a proxy configuration page (add fixup)
|
||||
|
||||
---
|
||||
chrome/browser/resources/proxy_config.js | 13 ++++++++++++-
|
||||
chrome/browser/ui/webui/proxy_config_ui.cc | 2 +-
|
||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/resources/proxy_config.js b/chrome/browser/resources/proxy_config.js
|
||||
--- a/chrome/browser/resources/proxy_config.js
|
||||
+++ b/chrome/browser/resources/proxy_config.js
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import {$} from 'chrome://resources/js/util.js';
|
||||
-import {addSingletonGetter} from 'chrome://resources/js/cr.m.js';
|
||||
|
||||
/**
|
||||
* Main entry point called once the page has loaded.
|
||||
@@ -60,6 +59,18 @@ var ProxyConfigView = (function() {
|
||||
var kIdFtpProxies = 'ftp-proxies';
|
||||
var kIdFallbackProxies = 'fallback-proxies';
|
||||
|
||||
+ /**
|
||||
+ * Adds a {@code getInstance} static method that always return the same
|
||||
+ * instance object.
|
||||
+ * @param {!Function} ctor The constructor for the class to add the static
|
||||
+ * method to.
|
||||
+ */
|
||||
+ function addSingletonGetter(ctor) {
|
||||
+ ctor.getInstance = function() {
|
||||
+ return ctor.instance_ || (ctor.instance_ = new ctor());
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webui/proxy_config_ui.cc
|
||||
--- a/chrome/browser/ui/webui/proxy_config_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/proxy_config_ui.cc
|
||||
@@ -164,7 +164,7 @@ void ProxyConfigMessageHandler::OnProxyConfigChanged(
|
||||
|
||||
// call Javascript function
|
||||
web_ui()->CallJavascriptFunctionUnsafe("ProxyConfigView.getInstance().onProxyConfigChanged",
|
||||
- *state.CreateDeepCopy());
|
||||
+ state.Clone());
|
||||
}
|
||||
|
||||
const std::string omitDirect(const std::string pacString) {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,26 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:37:12 +0000
|
||||
Subject: Add webGL site setting (add fixup)
|
||||
|
||||
---
|
||||
.../core/browser/content_settings_registry.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -636,9 +636,9 @@ void ContentSettingsRegistry::Init() {
|
||||
|
||||
Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_BLOCK,
|
||||
WebsiteSettingsInfo::SYNCABLE,
|
||||
- AllowlistedSchemes(),
|
||||
- ValidSettings(CONTENT_SETTING_ALLOW,
|
||||
- CONTENT_SETTING_BLOCK),
|
||||
+ /*allowlisted_schemes=*/{},
|
||||
+ /*valid_settings=*/{CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK},
|
||||
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,26 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:37:41 +0000
|
||||
Subject: Add webRTC site settings (add fixup)
|
||||
|
||||
---
|
||||
.../core/browser/content_settings_registry.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -650,9 +650,9 @@ void ContentSettingsRegistry::Init() {
|
||||
|
||||
Register(ContentSettingsType::WEBRTC, "webrtc", CONTENT_SETTING_BLOCK,
|
||||
WebsiteSettingsInfo::SYNCABLE,
|
||||
- AllowlistedSchemes(),
|
||||
- ValidSettings(CONTENT_SETTING_ALLOW,
|
||||
- CONTENT_SETTING_BLOCK),
|
||||
+ /*allowlisted_schemes=*/{},
|
||||
+ /*valid_settings=*/{CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK},
|
||||
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,24 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Sun, 18 Dec 2022 16:38:48 +0000
|
||||
Subject: Client hints overrides (add fixup)
|
||||
|
||||
---
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -2832,8 +2832,8 @@
|
||||
public: true,
|
||||
},
|
||||
{
|
||||
- name: "UserAgentClientHint",
|
||||
- status: "stable",
|
||||
+ name: "UserAgentClientHint", // always disabled
|
||||
+ status: "experimental", // in bromite
|
||||
base_feature: "UserAgentClientHint",
|
||||
},
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,29 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:35:28 +0000
|
||||
Subject: Disable all predictors code (add fixup)
|
||||
|
||||
---
|
||||
components/optimization_guide/core/BUILD.gn | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/optimization_guide/core/BUILD.gn b/components/optimization_guide/core/BUILD.gn
|
||||
--- a/components/optimization_guide/core/BUILD.gn
|
||||
+++ b/components/optimization_guide/core/BUILD.gn
|
||||
@@ -77,12 +77,14 @@ static_library("model_executor") {
|
||||
}
|
||||
deps = [
|
||||
":features",
|
||||
- ":machine_learning",
|
||||
"//base",
|
||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||
"//net",
|
||||
"//url",
|
||||
]
|
||||
+ if (build_with_tflite_lib) {
|
||||
+ deps += [ ":machine_learning", ]
|
||||
+ }
|
||||
}
|
||||
|
||||
mojom("interfaces") {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,48 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:33:47 +0000
|
||||
Subject: Disable conversion measurement api (add fixup)
|
||||
|
||||
---
|
||||
.../attribution_report_network_sender.cc | 8 ++++++--
|
||||
content/renderer/render_thread_impl.cc | 2 +-
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/content/browser/attribution_reporting/attribution_report_network_sender.cc b/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
--- a/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
+++ b/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
@@ -76,6 +76,9 @@ void AttributionReportNetworkSender::SendReport(AttributionDebugReport report) {
|
||||
void AttributionReportNetworkSender::SendReport(GURL url,
|
||||
base::ValueView report_body,
|
||||
UrlLoaderCallback callback) {
|
||||
+ // this is never called on Bromite but nothing would be sent if it were
|
||||
+ if ((true)) return;
|
||||
+
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = std::move(url);
|
||||
resource_request->method = net::HttpRequestHeaders::kPostMethod;
|
||||
@@ -132,8 +135,9 @@ void AttributionReportNetworkSender::SendReport(GURL url,
|
||||
network::SimpleURLLoader::RETRY_ON_NAME_NOT_RESOLVED;
|
||||
simple_url_loader_ptr->SetRetryOptions(/*max_retries=*/1, retry_mode);
|
||||
|
||||
- // this is never called on Bromite but nothing would be sent if it were
|
||||
- OnReportSent(std::move(it), report, is_debug_report, std::move(sent_callback), nullptr);
|
||||
+ simple_url_loader_ptr->DownloadHeadersOnly(
|
||||
+ url_loader_factory_.get(),
|
||||
+ base::BindOnce(std::move(callback), std::move(it)));
|
||||
}
|
||||
|
||||
void AttributionReportNetworkSender::OnReportSent(
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1823,7 +1823,7 @@ RenderThreadImpl::GetOsSupportForAttributionReporting() {
|
||||
|
||||
void RenderThreadImpl::SetOsSupportForAttributionReporting(
|
||||
blink::mojom::AttributionOsSupport attribution_os_support) {
|
||||
- attribution_os_support_ = attribution_os_support;
|
||||
+ attribution_os_support_ = blink::mojom::AttributionOsSupport::kDisabled;
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,74 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:34:41 +0000
|
||||
Subject: Disable safe browsing (add fixup)
|
||||
|
||||
---
|
||||
.../chrome_file_system_access_permission_context.cc | 4 +++-
|
||||
chrome/browser/ui/android/strings/android_chrome_strings.grd | 3 +++
|
||||
chrome/browser/ui/webui/interstitials/interstitial_ui.cc | 4 ----
|
||||
3 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
|
||||
@@ -115,6 +115,7 @@ const char kPathKey[] = "path";
|
||||
const char kPathTypeKey[] = "path-type";
|
||||
const char kTimestampKey[] = "timestamp";
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
void ShowFileSystemAccessRestrictedDirectoryDialogOnUIThread(
|
||||
content::GlobalRenderFrameHostId frame_id,
|
||||
const url::Origin& origin,
|
||||
@@ -144,7 +145,6 @@ void ShowFileSystemAccessRestrictedDirectoryDialogOnUIThread(
|
||||
origin, handle_type, std::move(callback), web_contents);
|
||||
}
|
||||
|
||||
-#if defined(FULL_SAFE_BROWSING)
|
||||
void ShowFileSystemAccessDangerousFileDialogOnUIThread(
|
||||
content::GlobalRenderFrameHostId frame_id,
|
||||
const url::Origin& origin,
|
||||
@@ -431,6 +431,7 @@ base::StringPiece GetGrantKeyFromGrantType(GrantType type) {
|
||||
: kPermissionReadableKey;
|
||||
}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
bool FileHasDangerousExtension(const url::Origin& origin,
|
||||
const base::FilePath& path,
|
||||
Profile* profile) {
|
||||
@@ -442,6 +443,7 @@ bool FileHasDangerousExtension(const url::Origin& origin,
|
||||
return danger_level == safe_browsing::DownloadFileType::DANGEROUS ||
|
||||
danger_level == safe_browsing::DownloadFileType::ALLOW_ON_USER_GESTURE;
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -467,6 +467,9 @@ CHAR_LIMIT guidelines:
|
||||
<message name="IDS_PRELOAD_PAGES_EXTENDED_PRELOADING_BULLET_FOUR" desc="Fourth bullet point under the Preload Pages extended preloading mode. Informs the user about what the extended preloading setting does.">
|
||||
Because the preloaded pages are encrypted, Google will not learn anything about the preloaded page content. Google servers will learn which sites are privately preloaded. This information is only used to preload the pages, and is not linked to other information from your Google Account.
|
||||
</message>
|
||||
+ <message name="IDS_USAGE_AND_CRASH_REPORTS_TITLE" desc="Title for a preference that enables sending usage statistics and crash reports.">
|
||||
+ Help improve Chrome\u2019s features and performance
|
||||
+ </message>
|
||||
|
||||
<!-- Metrics settings -->
|
||||
<message name="IDS_PREFS_METRICS_SETTINGS" desc="Title for the page that allows the user to control how much usage data Chrome uploads. [CHAR_LIMIT=32]">
|
||||
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
||||
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
|
||||
@@ -518,10 +518,6 @@ void InterstitialHTMLSource::StartDataRequest(
|
||||
interstitial_delegate = CreateMITMSoftwareBlockingPage(web_contents);
|
||||
} else if (path_without_query == "/blocked-interception") {
|
||||
interstitial_delegate = CreateBlockedInterceptionBlockingPage(web_contents);
|
||||
- } else if (path_without_query == "/enterprise-block") {
|
||||
- interstitial_delegate = CreateEnterpriseBlockPage(web_contents);
|
||||
- } else if (path_without_query == "/enterprise-warn") {
|
||||
- interstitial_delegate = CreateEnterpriseWarnPage(web_contents);
|
||||
} else if (path_without_query == "/clock") {
|
||||
interstitial_delegate = CreateBadClockBlockingPage(web_contents);
|
||||
} else if (path_without_query == "/lookalike") {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,53 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:26:25 +0000
|
||||
Subject: Remove binary blob integrations (add fixup)
|
||||
|
||||
---
|
||||
chrome/android/java/AndroidManifest.xml | 2 ++
|
||||
chrome/browser/privacy/BUILD.gn | 1 +
|
||||
.../browser/ui/signin/fre/SigninFirstRunMediator.java | 8 ++------
|
||||
3 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
|
||||
--- a/chrome/android/java/AndroidManifest.xml
|
||||
+++ b/chrome/android/java/AndroidManifest.xml
|
||||
@@ -751,6 +751,8 @@ by a child template that "extends" this file.
|
||||
android:theme="@style/Theme.BrowserUI.Translucent.NoTitleBar"
|
||||
android:excludeFromRecents="true"
|
||||
android:process=":browser_restart_process">
|
||||
+ </activity>
|
||||
+
|
||||
<activity
|
||||
android:name="org.chromium.chrome.browser.sharing.shared_intent.SharedIntentShareActivity"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
diff --git a/chrome/browser/privacy/BUILD.gn b/chrome/browser/privacy/BUILD.gn
|
||||
--- a/chrome/browser/privacy/BUILD.gn
|
||||
+++ b/chrome/browser/privacy/BUILD.gn
|
||||
@@ -11,6 +11,7 @@ if (is_android) {
|
||||
"//chrome/android:*",
|
||||
"//chrome/browser/feed/android:*",
|
||||
"//chrome/browser/ui/android/omnibox:*",
|
||||
+ "//chrome/browser/ui/android/signin:*",
|
||||
]
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/privacy/secure_dns/SecureDnsBridge.java",
|
||||
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
|
||||
--- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
|
||||
+++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
|
||||
@@ -186,12 +186,8 @@ public class SigninFirstRunMediator
|
||||
boolean isSigninDisabledByPolicy = false;
|
||||
boolean isMetricsReportingDisabledByPolicy = false;
|
||||
if (hasPolicies) {
|
||||
- isSigninDisabledByPolicy =
|
||||
- IdentityServicesProvider.get()
|
||||
- .getSigninManager(Profile.getLastUsedRegularProfile())
|
||||
- .isSigninDisabledByPolicy();
|
||||
- isMetricsReportingDisabledByPolicy =
|
||||
- !mPrivacyPreferencesManager.isUsageAndCrashReportingPermittedByPolicy();
|
||||
+ isSigninDisabledByPolicy = true;
|
||||
+ isMetricsReportingDisabledByPolicy = true;
|
||||
|
||||
final FrePolicy frePolicy = new FrePolicy();
|
||||
frePolicy.metricsReportingDisabledByPolicy = isMetricsReportingDisabledByPolicy;
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,105 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:29:23 +0000
|
||||
Subject: Remove price/shopping/commerce integra (add fixup)
|
||||
|
||||
---
|
||||
.../chrome/browser/app/ChromeActivity.java | 4 ----
|
||||
.../bookmarks/BookmarkItemsAdapter.java | 2 --
|
||||
.../bookmarks/BookmarkSaveFlowMediator.java | 21 -------------------
|
||||
.../commerce/core/commerce_feature_list.cc | 4 ++--
|
||||
4 files changed, 2 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -2395,10 +2395,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
}
|
||||
|
||||
if (id == R.id.disable_price_tracking_menu_id) {
|
||||
- PowerBookmarkUtils.setPriceTrackingEnabledWithSnackbars(mBookmarkModelSupplier.get(),
|
||||
- mBookmarkModelSupplier.get().getUserBookmarkIdForTab(currentTab),
|
||||
- /*enabled=*/false, mSnackbarManager, getResources(), (success) -> {});
|
||||
- RecordUserAction.record("MobileMenuDisablePriceTracking");
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
@@ -25,7 +25,6 @@ import org.chromium.chrome.browser.bookmarks.BookmarkRow.Location;
|
||||
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
-import org.chromium.chrome.browser.subscriptions.CommerceSubscriptionsServiceFactory;
|
||||
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
import org.chromium.components.bookmarks.BookmarkItem;
|
||||
@@ -226,7 +225,6 @@ public class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkLis
|
||||
return createViewHolderHelper(parent, R.layout.bookmark_folder_row);
|
||||
case ViewType.BOOKMARK:
|
||||
return createViewHolderHelper(parent, R.layout.bookmark_item_row);
|
||||
- .init(mImageFetcher, mDelegate.getModel(), mSnackbarManager);
|
||||
case ViewType.DIVIDER:
|
||||
return new ViewHolder(
|
||||
LayoutInflater.from(parent.getContext())
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java
|
||||
@@ -17,7 +17,6 @@ import org.chromium.base.metrics.RecordUserAction;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.commerce.PriceTrackingUtils;
|
||||
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
|
||||
-import org.chromium.chrome.browser.price_tracking.PriceDropNotificationManagerFactory;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
import org.chromium.components.bookmarks.BookmarkItem;
|
||||
@@ -39,9 +38,6 @@ public class BookmarkSaveFlowMediator
|
||||
private BookmarkId mBookmarkId;
|
||||
private PowerBookmarkMeta mPowerBookmarkMeta;
|
||||
private boolean mWasBookmarkMoved;
|
||||
- private SubscriptionsManager mSubscriptionsManager;
|
||||
- private CommerceSubscription mSubscription;
|
||||
- private Callback<Boolean> mSubscriptionsManagerCallback;
|
||||
private String mFolderName;
|
||||
|
||||
/**
|
||||
@@ -121,23 +117,6 @@ public class BookmarkSaveFlowMediator
|
||||
}
|
||||
|
||||
void handleNotificationSwitchToggle(CompoundButton view, boolean toggled) {
|
||||
- if (mSubscriptionsManagerCallback == null) {
|
||||
- mSubscriptionsManagerCallback =
|
||||
- mCallbackController.makeCancelable((Boolean success) -> {
|
||||
- setPriceTrackingToggleVisualsOnly(success && view.isChecked());
|
||||
- setPriceTrackingNotificationUiEnabled(success);
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- // Make sure the notification channel is initialized when the user tracks a product.
|
||||
- // TODO(crbug.com/1382191): Add a SubscriptionsObserver in the PriceDropNotificationManager
|
||||
- // and initialize the channel there.
|
||||
- if (toggled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
- PriceDropNotificationManagerFactory.create().createNotificationChannel();
|
||||
- }
|
||||
- setPriceTrackingIconForEnabledState(toggled);
|
||||
- PriceTrackingUtils.setPriceTrackingStateForBookmark(Profile.getLastUsedRegularProfile(),
|
||||
- mBookmarkId.getId(), toggled, mSubscriptionsManagerCallback);
|
||||
}
|
||||
|
||||
void setPriceTrackingNotificationUiEnabled(boolean enabled) {
|
||||
diff --git a/components/commerce/core/commerce_feature_list.cc b/components/commerce/core/commerce_feature_list.cc
|
||||
--- a/components/commerce/core/commerce_feature_list.cc
|
||||
+++ b/components/commerce/core/commerce_feature_list.cc
|
||||
@@ -98,8 +98,8 @@ BASE_FEATURE(kCommerceMerchantViewer,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kCommercePriceTracking,
|
||||
- "CommercePriceTracking",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "CommercePriceTracking", // guard this
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // guard this
|
||||
|
||||
const base::FeatureParam<bool> kDeleteAllMerchantsOnClearBrowsingHistory{
|
||||
&kCommerceMerchantViewer, "delete_all_merchants_on_clear_history", false};
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,42 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:27:59 +0000
|
||||
Subject: Remove signin and sync integrations (add fixup)
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 1 +
|
||||
.../chrome/browser/app/feed/FeedActionDelegateImpl.java | 3 ---
|
||||
2 files changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -276,6 +276,7 @@ if (current_toolchain == default_toolchain) {
|
||||
"//chrome/browser/ui/android/management:java_resources",
|
||||
"//chrome/browser/ui/android/omnibox:java_resources",
|
||||
"//chrome/browser/ui/android/quickactionsearchwidget:java_resources",
|
||||
+ "//chrome/browser/ui/android/signin:java_resources",
|
||||
"//chrome/browser/ui/android/strings:ui_strings_grd",
|
||||
"//chrome/browser/ui/android/theme:java_resources",
|
||||
"//chrome/browser/ui/android/toolbar:java_resources",
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/feed/FeedActionDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/feed/FeedActionDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/feed/FeedActionDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/feed/FeedActionDelegateImpl.java
|
||||
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
|
||||
import org.chromium.chrome.browser.offlinepages.RequestCoordinatorBridge;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.share.crow.CrowButtonDelegate;
|
||||
-import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl;
|
||||
import org.chromium.chrome.browser.suggestions.SuggestionsConfig;
|
||||
import org.chromium.chrome.browser.tab.EmptyTabObserver;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
@@ -129,8 +128,6 @@ public class FeedActionDelegateImpl implements FeedActionDelegate {
|
||||
@Override
|
||||
public void showSignInActivity() {
|
||||
if (ChromeFeatureList.isEnabled(ChromeFeatureList.FEED_SHOW_SIGN_IN_COMMAND)) {
|
||||
- SyncConsentActivityLauncherImpl.get().launchActivityIfAllowed(
|
||||
- mActivityContext, SigninAccessPoint.NTP_CONTENT_SUGGESTIONS);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,28 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:36:46 +0000
|
||||
Subject: Timezone customization (add fixup)
|
||||
|
||||
---
|
||||
.../core/browser/content_settings_registry.cc | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -614,10 +614,10 @@ void ContentSettingsRegistry::Init() {
|
||||
|
||||
Register(ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override", CONTENT_SETTING_ALLOW,
|
||||
WebsiteSettingsInfo::SYNCABLE,
|
||||
- AllowlistedSchemes(kChromeUIScheme, kChromeDevToolsScheme),
|
||||
- ValidSettings(CONTENT_SETTING_ALLOW, // use system time
|
||||
- CONTENT_SETTING_ASK, // custom timezone, default UTC
|
||||
- CONTENT_SETTING_BLOCK), // random
|
||||
+ /*allowlisted_schemes=*/{},
|
||||
+ /*valid_settings=*/{CONTENT_SETTING_ALLOW, // use system time
|
||||
+ CONTENT_SETTING_ASK, // custom timezone, default UTC
|
||||
+ CONTENT_SETTING_BLOCK}, // random
|
||||
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,31 @@
|
||||
From: Your Name <you@example.com>
|
||||
Date: Thu, 5 Jan 2023 11:30:19 +0000
|
||||
Subject: User agent customization (add fixup)
|
||||
|
||||
---
|
||||
.../android/preferences/privacy_preferences_manager_impl.cc | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc b/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
|
||||
--- a/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
|
||||
+++ b/chrome/browser/android/preferences/privacy_preferences_manager_impl.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/base_switches.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
+#include "content/browser/attribution_reporting/attribution_manager.h"
|
||||
#include "content/browser/renderer_host/render_process_host_impl.h"
|
||||
#include "content/common/renderer.mojom.h"
|
||||
#include "chrome/browser/chrome_content_browser_client.h"
|
||||
@@ -88,7 +89,8 @@ static void UpdateOverrideUserAgent() {
|
||||
std::vector<std::string> cors_exempt_header_list;
|
||||
iter.GetCurrentValue()->GetRendererInterface()->InitializeRenderer(
|
||||
/*user_agent*/ ua, /*full_user_agent*/ ua, /*reduced_user_agent*/ ua,
|
||||
- /*metadata*/ blink::UserAgentMetadata(), cors_exempt_header_list);
|
||||
+ /*metadata*/ blink::UserAgentMetadata(), cors_exempt_header_list,
|
||||
+ content::AttributionManager::GetOsSupport());
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,258 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 5 May 2020 07:22:20 +0200
|
||||
Subject: AImageReader CFI crash mitigations
|
||||
|
||||
Revert "gpu/android: Remove setup for disabling AImageReader."
|
||||
This reverts commit dcd5a39518246eb999f1cc63bf1ec95d93fd5b2f.
|
||||
|
||||
Revert "Remove flags to enable/disable AImageReader."
|
||||
This reverts commit 463fa0f2e3b9e418bc26e2c8954463f0b0f76634.
|
||||
|
||||
Restore GPU bug blacklist for AImageReader on ARM and Qualcomm CPUs
|
||||
|
||||
Restore the AImageReader blacklist for ARM/Qualcomm chipsets which causes
|
||||
crashes on Android 9 and 10 (at different code locations).
|
||||
|
||||
See discussions at:
|
||||
* https://github.com/bromite/bromite/issues/445
|
||||
* https://github.com/bromite/bromite/issues/814
|
||||
* https://github.com/bromite/bromite/issues/1005
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
base/android/android_image_reader_compat.cc | 8 +++++++-
|
||||
base/android/android_image_reader_compat.h | 4 ++++
|
||||
chrome/browser/flag-metadata.json | 6 +++---
|
||||
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
|
||||
gpu/config/gpu_finch_features.cc | 5 +++++
|
||||
gpu/config/gpu_finch_features.h | 1 +
|
||||
gpu/config/gpu_util.cc | 8 ++++++++
|
||||
gpu/config/gpu_workaround_list.txt | 1 +
|
||||
gpu/ipc/service/gpu_init.cc | 5 +++++
|
||||
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
|
||||
media/base/media_switches.cc | 5 +++++
|
||||
media/base/media_switches.h | 1 +
|
||||
12 files changed, 66 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
|
||||
--- a/base/android/android_image_reader_compat.cc
|
||||
+++ b/base/android/android_image_reader_compat.cc
|
||||
@@ -23,6 +23,8 @@
|
||||
namespace base {
|
||||
namespace android {
|
||||
|
||||
+bool AndroidImageReader::disable_support_ = false;
|
||||
+
|
||||
AndroidImageReader& AndroidImageReader::GetInstance() {
|
||||
// C++11 static local variable initialization is
|
||||
// thread-safe.
|
||||
@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
+void AndroidImageReader::DisableSupport() {
|
||||
+ disable_support_ = true;
|
||||
+}
|
||||
+
|
||||
bool AndroidImageReader::IsSupported() {
|
||||
- return is_supported_;
|
||||
+ return !disable_support_ && is_supported_;
|
||||
}
|
||||
|
||||
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
|
||||
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
|
||||
--- a/base/android/android_image_reader_compat.h
|
||||
+++ b/base/android/android_image_reader_compat.h
|
||||
@@ -24,6 +24,9 @@ class BASE_EXPORT AndroidImageReader {
|
||||
AndroidImageReader(const AndroidImageReader&) = delete;
|
||||
AndroidImageReader& operator=(const AndroidImageReader&) = delete;
|
||||
|
||||
+ // Disable image reader support.
|
||||
+ static void DisableSupport();
|
||||
+
|
||||
// Check if the image reader usage is supported. This function returns TRUE
|
||||
// if android version is >=OREO, image reader support is not disabled and all
|
||||
// the required functions are loaded.
|
||||
@@ -61,6 +64,7 @@ class BASE_EXPORT AndroidImageReader {
|
||||
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
|
||||
|
||||
private:
|
||||
+ static bool disable_support_;
|
||||
friend class base::NoDestructor<AndroidImageReader>;
|
||||
|
||||
AndroidImageReader();
|
||||
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
|
||||
--- a/chrome/browser/flag-metadata.json
|
||||
+++ b/chrome/browser/flag-metadata.json
|
||||
@@ -2515,9 +2515,9 @@
|
||||
"expiry_milestone": 115
|
||||
},
|
||||
{
|
||||
- "name": "enable-image-reader",
|
||||
- "owners": [ "vikassoni", "liberato" ],
|
||||
- "expiry_milestone": 115
|
||||
+ "name": "enable-image-reader", // Bromite: do not expire
|
||||
+ "owners": [ "vikassoni", "liberato" ], // flag
|
||||
+ "expiry_milestone": -1
|
||||
},
|
||||
{
|
||||
"name": "enable-immersive-fullscreen-toolbar",
|
||||
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
|
||||
--- a/gpu/config/gpu_driver_bug_list.json
|
||||
+++ b/gpu/config/gpu_driver_bug_list.json
|
||||
@@ -3199,6 +3199,22 @@
|
||||
"dont_delete_source_texture_for_egl_image"
|
||||
]
|
||||
},
|
||||
+ {
|
||||
+ "id":335,
|
||||
+ "cr_bugs": [1051705],
|
||||
+ "description": "Disable AImageReader on ARM GPUs",
|
||||
+ "os": {
|
||||
+ "type": "android",
|
||||
+ "version": {
|
||||
+ "op": "<",
|
||||
+ "value": "10"
|
||||
+ }
|
||||
+ },
|
||||
+ "gl_vendor": "ARM.*|Qualcomm.*",
|
||||
+ "features": [
|
||||
+ "disable_aimagereader"
|
||||
+ ]
|
||||
+ },
|
||||
{
|
||||
"id": 336,
|
||||
"cr_bugs": [625785],
|
||||
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
|
||||
--- a/gpu/config/gpu_finch_features.cc
|
||||
+++ b/gpu/config/gpu_finch_features.cc
|
||||
@@ -64,6 +64,11 @@ BASE_FEATURE(kUseGles2ForOopR,
|
||||
#endif
|
||||
);
|
||||
|
||||
+
|
||||
+// Use android AImageReader when playing videos with MediaPlayer.
|
||||
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Use android SurfaceControl API for managing display compositor's buffer queue
|
||||
// and using overlays on Android. Also used by webview to disable surface
|
||||
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
|
||||
--- a/gpu/config/gpu_finch_features.h
|
||||
+++ b/gpu/config/gpu_finch_features.h
|
||||
@@ -17,6 +17,7 @@ namespace features {
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kUseGles2ForOopR);
|
||||
|
||||
// All features in alphabetical order. The features should be documented
|
||||
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
|
||||
// alongside the definition of their values in the .cc file.
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kAndroidSurfaceControl);
|
||||
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
|
||||
--- a/gpu/config/gpu_util.cc
|
||||
+++ b/gpu/config/gpu_util.cc
|
||||
@@ -121,6 +121,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
return kGpuFeatureStatusDisabled;
|
||||
#else
|
||||
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
|
||||
+ return kGpuFeatureStatusBlocklisted;
|
||||
+
|
||||
if (!gpu_preferences.enable_android_surface_control)
|
||||
return kGpuFeatureStatusDisabled;
|
||||
|
||||
@@ -344,6 +347,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
|
||||
gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
|
||||
kGpuFeatureStatusBlocklisted;
|
||||
}
|
||||
+
|
||||
+ if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
|
||||
+ gpu_feature_info->status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
|
||||
+ kGpuFeatureStatusBlocklisted;
|
||||
+ }
|
||||
}
|
||||
|
||||
// Estimates roughly user total disk space by counting in the drives where
|
||||
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
|
||||
--- a/gpu/config/gpu_workaround_list.txt
|
||||
+++ b/gpu/config/gpu_workaround_list.txt
|
||||
@@ -15,6 +15,7 @@ decode_encode_srgb_for_generatemipmap
|
||||
depth_stencil_renderbuffer_resize_emulation
|
||||
disable_2d_canvas_auto_flush
|
||||
disable_accelerated_av1_decode
|
||||
+disable_aimagereader
|
||||
disable_accelerated_av1_encode
|
||||
disable_accelerated_h264_encode
|
||||
disable_accelerated_hevc_decode
|
||||
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
|
||||
--- a/gpu/ipc/service/gpu_init.cc
|
||||
+++ b/gpu/ipc/service/gpu_init.cc
|
||||
@@ -626,6 +626,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
+ // Disable AImageReader if the workaround is enabled.
|
||||
+ if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
|
||||
+ base::android::AndroidImageReader::DisableSupport();
|
||||
+ }
|
||||
+
|
||||
if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] !=
|
||||
kGpuFeatureStatusEnabled ||
|
||||
!InitializeVulkan()) {
|
||||
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
|
||||
--- a/gpu/ipc/service/stream_texture_android.cc
|
||||
+++ b/gpu/ipc/service/stream_texture_android.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
+#include "base/android/android_image_reader_compat.h"
|
||||
#include "base/android/scoped_hardware_buffer_fence_sync.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/feature_list.h"
|
||||
@@ -51,7 +52,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
|
||||
}
|
||||
|
||||
TextureOwner::Mode GetTextureOwnerMode() {
|
||||
- return features::IsAImageReaderEnabled()
|
||||
+ const bool a_image_reader_supported =
|
||||
+ base::android::AndroidImageReader::GetInstance().IsSupported();
|
||||
+
|
||||
+ // TODO(vikassoni) : Currently we have 2 different flags to enable/disable
|
||||
+ // AImageReader - one for MCVD and other for MediaPlayer here. Merge those 2
|
||||
+ // flags into a single flag. Keeping the 2 flags separate for now since finch
|
||||
+ // experiment using this flag is in progress.
|
||||
+ return a_image_reader_supported && features::IsAImageReaderEnabled() &&
|
||||
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer)
|
||||
? TextureOwner::Mode::kAImageReaderInsecure
|
||||
: TextureOwner::Mode::kSurfaceTextureInsecure;
|
||||
}
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -758,6 +758,11 @@ BASE_FEATURE(kHardwareSecureDecryptionExperiment,
|
||||
// Allows automatically disabling hardware secure Content Decryption Module
|
||||
// (CDM) after failures or crashes to fallback to software secure CDMs. If this
|
||||
// feature is disabled, the fallback will never happen and users could be stuck
|
||||
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
|
||||
+BASE_FEATURE(kAImageReaderVideoOutput,
|
||||
+ "AImageReaderVideoOutput",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
// in playback failures.
|
||||
BASE_FEATURE(kHardwareSecureDecryptionFallback,
|
||||
"HardwareSecureDecryptionFallback",
|
||||
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
|
||||
--- a/media/base/media_switches.h
|
||||
+++ b/media/base/media_switches.h
|
||||
@@ -235,6 +235,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp8TemporalLayerHWEncoding);
|
||||
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp9kSVCHWEncoding);
|
||||
#endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
|
||||
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoBlitColorAccuracy);
|
||||
+MEDIA_EXPORT BASE_DECLARE_FEATURE(kAImageReaderVideoOutput);
|
||||
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVp9kSVCHWDecoding);
|
||||
MEDIA_EXPORT BASE_DECLARE_FEATURE(kWakeLockOptimisationHiddenMuted);
|
||||
MEDIA_EXPORT BASE_DECLARE_FEATURE(kWebContentsCaptureHiDpi);
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,168 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 26 Apr 2021 13:28:24 +0000
|
||||
Subject: Add AllowUserCertificates flag
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 3 +++
|
||||
.../chromium/chrome/browser/app/flags/ChromeCachedFlags.java | 1 +
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
chrome/browser/flags/android/chrome_feature_list.cc | 5 +++++
|
||||
chrome/browser/flags/android/chrome_feature_list.h | 1 +
|
||||
.../org/chromium/chrome/browser/flags/ChromeFeatureList.java | 3 +++
|
||||
net/android/java/src/org/chromium/net/X509Util.java | 5 +++++
|
||||
9 files changed, 30 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -226,6 +226,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
|
||||
import org.chromium.content_public.browser.SelectionPopupController;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
import org.chromium.content_public.common.ContentSwitches;
|
||||
+import org.chromium.net.X509Util;
|
||||
import org.chromium.printing.PrintManagerDelegateImpl;
|
||||
import org.chromium.printing.PrintingController;
|
||||
import org.chromium.printing.PrintingControllerImpl;
|
||||
@@ -961,6 +962,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
UpdateMenuItemHelper.getInstance().onStart();
|
||||
ChromeActivitySessionTracker.getInstance().onStartWithNative();
|
||||
ChromeCachedFlags.getInstance().cacheNativeFlags();
|
||||
+ X509Util.AllowUserCertificates = ChromeFeatureList.isEnabled(
|
||||
+ ChromeFeatureList.ALLOW_USER_CERTIFICATES);
|
||||
OfflineIndicatorController.initialize();
|
||||
|
||||
// postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever#onLoadStopped(),
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
@@ -77,6 +77,7 @@ public class ChromeCachedFlags {
|
||||
add(ChromeFeatureList.sAndroidAuxiliarySearch);
|
||||
add(ChromeFeatureList.sAnonymousUpdateChecks);
|
||||
add(ChromeFeatureList.sAppMenuMobileSiteOption);
|
||||
+ add(ChromeFeatureList.sAllowUserCertificates);
|
||||
add(ChromeFeatureList.sBackGestureRefactorAndroid);
|
||||
add(ChromeFeatureList.sCctBrandTransparency);
|
||||
add(ChromeFeatureList.sCctIncognito);
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -8936,6 +8936,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kWin10TabSearchCaptionButton)},
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
+ {"allow-user-certificates",
|
||||
+ flag_descriptions::kAllowUserCertificatesName,
|
||||
+ flag_descriptions::kAllowUserCertificatesDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(chrome::android::kAllowUserCertificates)},
|
||||
{"omnibox-updated-connection-security-indicators",
|
||||
flag_descriptions::kOmniboxUpdatedConnectionSecurityIndicatorsName,
|
||||
flag_descriptions::kOmniboxUpdatedConnectionSecurityIndicatorsDescription,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -13,6 +13,11 @@
|
||||
|
||||
namespace flag_descriptions {
|
||||
|
||||
+const char kAllowUserCertificatesName[] = "Allow user certificates";
|
||||
+const char kAllowUserCertificatesDescription[] =
|
||||
+ "Allow user CA certificates during "
|
||||
+ "validation of the certificate chain";
|
||||
+
|
||||
const char kAccelerated2dCanvasName[] = "Accelerated 2D canvas";
|
||||
const char kAccelerated2dCanvasDescription[] =
|
||||
"Enables the use of the GPU to perform 2d canvas rendering instead of "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -40,6 +40,9 @@ namespace flag_descriptions {
|
||||
|
||||
// Cross-platform -------------------------------------------------------------
|
||||
|
||||
+extern const char kAllowUserCertificatesName[];
|
||||
+extern const char kAllowUserCertificatesDescription[];
|
||||
+
|
||||
extern const char kAccelerated2dCanvasName[];
|
||||
extern const char kAccelerated2dCanvasDescription[];
|
||||
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -153,6 +153,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
|
||||
&feed::kFeedReplaceAll,
|
||||
&feed::kFeedShowSignInCommand,
|
||||
&feed::kInterestFeedContentSuggestions,
|
||||
+ &kAllowUserCertificates,
|
||||
&feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
|
||||
&feed::kInterestFeedV2,
|
||||
&feed::kInterestFeedV2Autoplay,
|
||||
@@ -469,6 +470,10 @@ BASE_FEATURE(kAllowNewIncognitoTabIntents,
|
||||
"AllowNewIncognitoTabIntents",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+BASE_FEATURE(kAllowUserCertificates,
|
||||
+ "AllowUserCertificates",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
BASE_FEATURE(kFocusOmniboxInIncognitoTabIntents,
|
||||
"FocusOmniboxInIncognitoTabIntents",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.h
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.h
|
||||
@@ -17,6 +17,7 @@ BASE_DECLARE_FEATURE(kAdaptiveButtonInTopToolbar);
|
||||
BASE_DECLARE_FEATURE(kAdaptiveButtonInTopToolbarCustomizationV2);
|
||||
BASE_DECLARE_FEATURE(kAddToHomescreenIPH);
|
||||
BASE_DECLARE_FEATURE(kAllowNewIncognitoTabIntents);
|
||||
+BASE_DECLARE_FEATURE(kAllowUserCertificates);
|
||||
BASE_DECLARE_FEATURE(kAndroidScrollOptimizations);
|
||||
BASE_DECLARE_FEATURE(kAndroidSearchEngineChoiceNotification);
|
||||
BASE_DECLARE_FEATURE(kAssistantConsentModal);
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
@@ -162,6 +162,7 @@ public abstract class ChromeFeatureList {
|
||||
}
|
||||
|
||||
/* Alphabetical: */
|
||||
+ public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates";
|
||||
public static final String ABOUT_THIS_SITE_BANNER = "AboutThisSiteBanner";
|
||||
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR = "AdaptiveButtonInTopToolbar";
|
||||
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_CUSTOMIZATION_V2 =
|
||||
@@ -612,6 +613,8 @@ public abstract class ChromeFeatureList {
|
||||
"SkipServiceWorkerForInstallPromot";
|
||||
|
||||
/* Alphabetical: */
|
||||
+ public static final CachedFlag sAllowUserCertificates =
|
||||
+ new CachedFlag(ALLOW_USER_CERTIFICATES, false);
|
||||
public static final CachedFlag sAndroidAuxiliarySearch =
|
||||
new CachedFlag(OMNIBOX_ANDROID_AUXILIARY_SEARCH, false);
|
||||
public static final CachedFlag sAnonymousUpdateChecks =
|
||||
diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java
|
||||
--- a/net/android/java/src/org/chromium/net/X509Util.java
|
||||
+++ b/net/android/java/src/org/chromium/net/X509Util.java
|
||||
@@ -437,6 +437,8 @@ public class X509Util {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ public static boolean AllowUserCertificates = false;
|
||||
+
|
||||
public static AndroidCertVerifyResult verifyServerCertificates(byte[][] certChain,
|
||||
String authType,
|
||||
String host)
|
||||
@@ -517,6 +519,9 @@ public class X509Util {
|
||||
isIssuedByKnownRoot = isKnownRoot(root);
|
||||
}
|
||||
|
||||
+ if (AllowUserCertificates == false && isIssuedByKnownRoot == false)
|
||||
+ return new AndroidCertVerifyResult(CertVerifyStatusAndroid.NO_TRUSTED_ROOT);
|
||||
+
|
||||
return new AndroidCertVerifyResult(CertVerifyStatusAndroid.OK,
|
||||
isIssuedByKnownRoot, verifiedChain);
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 9 Mar 2021 19:43:00 +0100
|
||||
Subject: Add Alt+D hotkey to focus address bar
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
@@ -155,6 +155,8 @@ public class KeyboardShortcuts {
|
||||
KeyEvent.KEYCODE_F, KeyEvent.META_CTRL_ON);
|
||||
addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
|
||||
KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON);
|
||||
+ addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
|
||||
+ KeyEvent.KEYCODE_D, KeyEvent.META_ALT_ON);
|
||||
shortcutGroups.add(chromeFeatureShortcutGroup);
|
||||
|
||||
KeyboardShortcutGroup webpageShortcutGroup = new KeyboardShortcutGroup(
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,954 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 11:06:18 +0200
|
||||
Subject: Add DuckDuckGo Lite search engine
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 10 +
|
||||
.../search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 202 +++++++++---------
|
||||
3 files changed, 112 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -102,6 +102,16 @@
|
||||
"id": 92
|
||||
},
|
||||
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
"ecosia": {
|
||||
"name": "Ecosia",
|
||||
"keyword": "ecosia.org",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -79,6 +79,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_STARTER_PACK_HISTORY = 62,
|
||||
SEARCH_ENGINE_STARTER_PACK_TABS = 63,
|
||||
SEARCH_ENGINE_GOOGLE_EN = 64,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT = 65,
|
||||
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -42,7 +42,7 @@ const PrepopulatedEngine* const engines_AE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ const PrepopulatedEngine* const engines_AL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ const PrepopulatedEngine* const engines_AR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_ar,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ const PrepopulatedEngine* const engines_AR[] = {
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_at,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -78,7 +78,7 @@ const PrepopulatedEngine* const engines_AU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_au,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -87,7 +87,7 @@ const PrepopulatedEngine* const engines_BA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -97,7 +97,7 @@ const PrepopulatedEngine* const engines_BE[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
@@ -105,7 +105,7 @@ const PrepopulatedEngine* const engines_BG[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ const PrepopulatedEngine* const engines_BH[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ const PrepopulatedEngine* const engines_BI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -132,7 +132,7 @@ const PrepopulatedEngine* const engines_BN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -141,7 +141,7 @@ const PrepopulatedEngine* const engines_BO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ const PrepopulatedEngine* const engines_BR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_br,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -160,7 +160,7 @@ const PrepopulatedEngine* const engines_BY[] = {
|
||||
&yandex_by,
|
||||
&mail_ru,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Belize
|
||||
@@ -168,7 +168,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ const PrepopulatedEngine* const engines_CA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_ca,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -185,7 +185,7 @@ const PrepopulatedEngine* const engines_CA[] = {
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
&yahoo_ch,
|
||||
};
|
||||
@@ -195,7 +195,7 @@ const PrepopulatedEngine* const engines_CL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_cl,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -214,7 +214,7 @@ const PrepopulatedEngine* const engines_CO[] = {
|
||||
&bing,
|
||||
&yahoo_co,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
@@ -222,7 +222,7 @@ const PrepopulatedEngine* const engines_CR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -232,7 +232,7 @@ const PrepopulatedEngine* const engines_CZ[] = {
|
||||
&seznam_cz,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Germany
|
||||
@@ -240,7 +240,7 @@ const PrepopulatedEngine* const engines_DE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_de,
|
||||
};
|
||||
|
||||
@@ -249,7 +249,7 @@ const PrepopulatedEngine* const engines_DK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_dk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -258,7 +258,7 @@ const PrepopulatedEngine* const engines_DO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -268,7 +268,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
|
||||
&bing,
|
||||
&yahoo_fr,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
@@ -277,7 +277,7 @@ const PrepopulatedEngine* const engines_EC[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
@@ -285,7 +285,7 @@ const PrepopulatedEngine* const engines_EE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -295,7 +295,7 @@ const PrepopulatedEngine* const engines_EG[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Spain
|
||||
@@ -303,7 +303,7 @@ const PrepopulatedEngine* const engines_ES[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -312,7 +312,7 @@ const PrepopulatedEngine* const engines_FI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_fi,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -321,7 +321,7 @@ const PrepopulatedEngine* const engines_FO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_dk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -339,7 +339,7 @@ const PrepopulatedEngine* const engines_GB[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_uk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -348,7 +348,7 @@ const PrepopulatedEngine* const engines_GR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -357,7 +357,7 @@ const PrepopulatedEngine* const engines_GT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -367,7 +367,7 @@ const PrepopulatedEngine* const engines_HK[] = {
|
||||
&yahoo_hk,
|
||||
&bing,
|
||||
&baidu,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
@@ -375,7 +375,7 @@ const PrepopulatedEngine* const engines_HN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -384,7 +384,7 @@ const PrepopulatedEngine* const engines_HR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -393,7 +393,7 @@ const PrepopulatedEngine* const engines_HU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -403,7 +403,7 @@ const PrepopulatedEngine* const engines_ID[] = {
|
||||
&yahoo_id,
|
||||
&bing,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
@@ -411,7 +411,7 @@ const PrepopulatedEngine* const engines_IE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_uk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -421,7 +421,7 @@ const PrepopulatedEngine* const engines_IL[] = {
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// India
|
||||
@@ -429,7 +429,7 @@ const PrepopulatedEngine* const engines_IN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_in,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&info_com,
|
||||
};
|
||||
|
||||
@@ -439,7 +439,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_tr,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Iran
|
||||
@@ -448,14 +448,14 @@ const PrepopulatedEngine* const engines_IR[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ask,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Iceland
|
||||
const PrepopulatedEngine* const engines_IS[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -465,7 +465,7 @@ const PrepopulatedEngine* const engines_IT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -474,7 +474,7 @@ const PrepopulatedEngine* const engines_JM[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -483,7 +483,7 @@ const PrepopulatedEngine* const engines_JO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -492,7 +492,7 @@ const PrepopulatedEngine* const engines_JP[] = {
|
||||
&googleen, &google,
|
||||
&yahoo_jp,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -501,7 +501,7 @@ const PrepopulatedEngine* const engines_KE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -519,7 +519,7 @@ const PrepopulatedEngine* const engines_KW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -529,7 +529,7 @@ const PrepopulatedEngine* const engines_KZ[] = {
|
||||
&yandex_kz,
|
||||
&mail_ru,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Lebanon
|
||||
@@ -537,7 +537,7 @@ const PrepopulatedEngine* const engines_LB[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -545,7 +545,7 @@ const PrepopulatedEngine* const engines_LB[] = {
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -555,7 +555,7 @@ const PrepopulatedEngine* const engines_LT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -563,7 +563,7 @@ const PrepopulatedEngine* const engines_LT[] = {
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -574,7 +574,7 @@ const PrepopulatedEngine* const engines_LV[] = {
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Libya
|
||||
@@ -583,7 +583,7 @@ const PrepopulatedEngine* const engines_LY[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
@@ -592,14 +592,14 @@ const PrepopulatedEngine* const engines_MA[] = {
|
||||
&bing,
|
||||
&yahoo_fr,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
const PrepopulatedEngine* const engines_MC[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_fr,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -619,7 +619,7 @@ const PrepopulatedEngine* const engines_ME[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
@@ -627,7 +627,7 @@ const PrepopulatedEngine* const engines_MK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -636,7 +636,7 @@ const PrepopulatedEngine* const engines_MX[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_mx,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -645,7 +645,7 @@ const PrepopulatedEngine* const engines_MY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_my,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -654,7 +654,7 @@ const PrepopulatedEngine* const engines_NI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -663,7 +663,7 @@ const PrepopulatedEngine* const engines_NL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_nl,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -672,7 +672,7 @@ const PrepopulatedEngine* const engines_NO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -681,7 +681,7 @@ const PrepopulatedEngine* const engines_NZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_nz,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -690,7 +690,7 @@ const PrepopulatedEngine* const engines_OM[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&petal_search,
|
||||
};
|
||||
|
||||
@@ -699,7 +699,7 @@ const PrepopulatedEngine* const engines_PA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -709,7 +709,7 @@ const PrepopulatedEngine* const engines_PE[] = {
|
||||
&bing,
|
||||
&yahoo_pe,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
@@ -718,7 +718,7 @@ const PrepopulatedEngine* const engines_PH[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
@@ -726,7 +726,7 @@ const PrepopulatedEngine* const engines_PK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -735,7 +735,7 @@ const PrepopulatedEngine* const engines_PL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -744,7 +744,7 @@ const PrepopulatedEngine* const engines_PR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -753,7 +753,7 @@ const PrepopulatedEngine* const engines_PT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -762,7 +762,7 @@ const PrepopulatedEngine* const engines_PY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -771,7 +771,7 @@ const PrepopulatedEngine* const engines_QA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_tr,
|
||||
};
|
||||
|
||||
@@ -780,7 +780,7 @@ const PrepopulatedEngine* const engines_RO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_tr,
|
||||
};
|
||||
|
||||
@@ -789,7 +789,7 @@ const PrepopulatedEngine* const engines_RS[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -799,7 +799,7 @@ const PrepopulatedEngine* const engines_RU[] = {
|
||||
&yandex_ru,
|
||||
&mail_ru,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
@@ -807,7 +807,7 @@ const PrepopulatedEngine* const engines_RW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -817,7 +817,7 @@ const PrepopulatedEngine* const engines_SA[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
@@ -825,7 +825,7 @@ const PrepopulatedEngine* const engines_SE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_se,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -834,7 +834,7 @@ const PrepopulatedEngine* const engines_SG[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_sg,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -842,7 +842,7 @@ const PrepopulatedEngine* const engines_SG[] = {
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
};
|
||||
@@ -851,7 +851,7 @@ const PrepopulatedEngine* const engines_SI[] = {
|
||||
const PrepopulatedEngine* const engines_SK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
};
|
||||
@@ -861,7 +861,7 @@ const PrepopulatedEngine* const engines_SV[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -871,7 +871,7 @@ const PrepopulatedEngine* const engines_SY[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
@@ -888,7 +888,7 @@ const PrepopulatedEngine* const engines_TN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_fr,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -898,7 +898,7 @@ const PrepopulatedEngine* const engines_TR[] = {
|
||||
&yandex_tr,
|
||||
&yahoo_tr,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
@@ -906,7 +906,7 @@ const PrepopulatedEngine* const engines_TT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -916,7 +916,7 @@ const PrepopulatedEngine* const engines_TW[] = {
|
||||
&yahoo_tw,
|
||||
&bing,
|
||||
&baidu,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Tanzania
|
||||
@@ -924,7 +924,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -933,7 +933,7 @@ const PrepopulatedEngine* const engines_UA[] = {
|
||||
&googleen, &google,
|
||||
&yandex_ua,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -942,7 +942,7 @@ const PrepopulatedEngine* const engines_US[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -951,7 +951,7 @@ const PrepopulatedEngine* const engines_UY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -960,7 +960,7 @@ const PrepopulatedEngine* const engines_VE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -979,7 +979,7 @@ const PrepopulatedEngine* const engines_YE[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
@@ -987,7 +987,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -996,7 +996,7 @@ const PrepopulatedEngine* const engines_ZW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,98 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 26 Apr 2021 15:04:11 +0000
|
||||
Subject: Add IsCleartextPermitted flag
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
net/base/features.cc | 4 ++++
|
||||
net/base/features.h | 2 ++
|
||||
net/url_request/url_request_http_job.cc | 4 ++++
|
||||
6 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -9171,6 +9171,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kRequestDesktopSiteExceptionsName,
|
||||
flag_descriptions::kRequestDesktopSiteExceptionsDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(features::kRequestDesktopSiteExceptions)},
|
||||
+ {"cleartext-permitted",
|
||||
+ flag_descriptions::kIsCleartextPermittedName,
|
||||
+ flag_descriptions::kIsCleartextPermittedDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)},
|
||||
#endif
|
||||
|
||||
{"export-bookmarks-use-saf",
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1651,6 +1651,10 @@ const char kHttpsOnlyModeDescription[] =
|
||||
"Adds a setting under chrome://settings/security to opt-in to HTTPS-First "
|
||||
"Mode.";
|
||||
|
||||
+const char kIsCleartextPermittedName[] = "Allow cleartext traffic";
|
||||
+const char kIsCleartextPermittedDescription[] =
|
||||
+ "Allow insecure connections over HTTP";
|
||||
+
|
||||
const char kIgnoreGpuBlocklistName[] = "Override software rendering list";
|
||||
const char kIgnoreGpuBlocklistDescription[] =
|
||||
"Overrides the built-in software rendering list and enables "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -935,6 +935,9 @@ extern const char kHideShelfControlsInTabletModeDescription[];
|
||||
extern const char kHttpsOnlyModeName[];
|
||||
extern const char kHttpsOnlyModeDescription[];
|
||||
|
||||
+extern const char kIsCleartextPermittedName[];
|
||||
+extern const char kIsCleartextPermittedDescription[];
|
||||
+
|
||||
extern const char kIgnoreGpuBlocklistName[];
|
||||
extern const char kIgnoreGpuBlocklistDescription[];
|
||||
|
||||
diff --git a/net/base/features.cc b/net/base/features.cc
|
||||
--- a/net/base/features.cc
|
||||
+++ b/net/base/features.cc
|
||||
@@ -113,6 +113,10 @@ BASE_FEATURE(kPartitionNelAndReportingByNetworkIsolationKey,
|
||||
"PartitionNelAndReportingByNetworkIsolationKey", // must be enabled
|
||||
base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
+BASE_FEATURE(kIsCleartextPermitted,
|
||||
+ "IsCleartextPermitted",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
BASE_FEATURE(kEnableDoubleKeyNetworkAnonymizationKey,
|
||||
"EnableDoubleKeyNetworkAnonymizationKey",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/net/base/features.h b/net/base/features.h
|
||||
--- a/net/base/features.h
|
||||
+++ b/net/base/features.h
|
||||
@@ -29,6 +29,8 @@ NET_EXPORT BASE_DECLARE_FEATURE(kAvoidH2Reprioritization);
|
||||
// origin requests are restricted to contain at most the source origin.
|
||||
NET_EXPORT BASE_DECLARE_FEATURE(kCapReferrerToOriginOnCrossOrigin);
|
||||
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kIsCleartextPermitted);
|
||||
+
|
||||
// Support for altering the parameters used for DNS transaction timeout. See
|
||||
// ResolveContext::SecureTransactionTimeout().
|
||||
NET_EXPORT BASE_DECLARE_FEATURE(kDnsTransactionDynamicTimeouts);
|
||||
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
||||
--- a/net/url_request/url_request_http_job.cc
|
||||
+++ b/net/url_request/url_request_http_job.cc
|
||||
@@ -212,6 +212,10 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kIsCleartextPermitted) == false) {
|
||||
+ return std::make_unique<URLRequestErrorJob>(request,
|
||||
+ ERR_CLEARTEXT_NOT_PERMITTED);
|
||||
+ }
|
||||
// Check whether the app allows cleartext traffic to this host, and return
|
||||
// ERR_CLEARTEXT_NOT_PERMITTED if not.
|
||||
if (request->context()->check_cleartext_permitted() &&
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,222 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 29 Aug 2018 11:03:44 +0200
|
||||
Subject: Add custom tab intents privacy option
|
||||
|
||||
Add custom tab intents privacy option and force
|
||||
open external links in incognito flag.
|
||||
|
||||
Flags are mutually exclusive.
|
||||
|
||||
See also: https://github.com/bromite/bromite/issues/1474
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/xml/privacy_preferences.xml | 10 ++++++++
|
||||
.../browser/LaunchIntentDispatcher.java | 22 +++++++++++++++++
|
||||
.../IncognitoCustomTabIntentDataProvider.java | 6 +++++
|
||||
.../privacy/settings/PrivacySettings.java | 24 +++++++++++++++++++
|
||||
.../chrome/browser/tab/TabAssociatedApp.java | 6 ++++-
|
||||
.../strings/android_chrome_strings.grd | 15 ++++++++++++
|
||||
6 files changed, 82 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -58,6 +58,16 @@ found in the LICENSE file.
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
|
||||
android:key="do_not_track"
|
||||
android:title="@string/do_not_track_title"/>
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="allow_custom_tab_intents"
|
||||
+ android:title="@string/allow_custom_tab_intents_title"
|
||||
+ android:summary="@string/allow_custom_tab_intents_summary"
|
||||
+ android:defaultValue="false" />
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="open_external_links_incognito"
|
||||
+ android:title="@string/open_external_links_incognito_title"
|
||||
+ android:summary="@string/open_external_links_incognito_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<Preference
|
||||
android:key="privacy_sandbox"
|
||||
android:title="@string/prefs_privacy_sandbox"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
@@ -45,6 +45,7 @@ import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
|
||||
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
|
||||
import org.chromium.chrome.browser.searchwidget.SearchActivity;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
+import org.chromium.chrome.browser.tab.TabLaunchType;
|
||||
import org.chromium.chrome.browser.translate.TranslateIntentHandler;
|
||||
import org.chromium.chrome.browser.util.AndroidTaskUtils;
|
||||
import org.chromium.chrome.browser.vr.VrModuleProvider;
|
||||
@@ -58,6 +59,8 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Set;
|
||||
|
||||
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
|
||||
+
|
||||
/**
|
||||
* Dispatches incoming intents to the appropriate activity based on the current configuration and
|
||||
* Intent fired.
|
||||
@@ -268,6 +271,9 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
*/
|
||||
public static boolean isCustomTabIntent(Intent intent) {
|
||||
if (intent == null) return false;
|
||||
+ if (!ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
|
||||
+ return false;
|
||||
if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
|
||||
|| !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
|
||||
return false;
|
||||
@@ -287,6 +293,10 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
newIntent.setData(uri);
|
||||
newIntent.setClassName(context, CustomTabActivity.class.getName());
|
||||
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ newIntent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true);
|
||||
+
|
||||
// Since configureIntentForResizableCustomTab() might change the componenet/class
|
||||
// associated with the passed intent, it needs to be called after #setClassName(context,
|
||||
// CustomTabActivity.class.getName());
|
||||
@@ -438,6 +448,18 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
|
||||
if (Intent.ACTION_VIEW.equals(newIntent.getAction())
|
||||
&& !IntentHandler.wasIntentSenderChrome(newIntent)) {
|
||||
+
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(
|
||||
+ PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false)) {
|
||||
+ Context applicationContext = ContextUtils.getApplicationContext();
|
||||
+ newIntent = IntentHandler.createTrustedOpenNewTabIntent(applicationContext,
|
||||
+ /*incognito*/true);
|
||||
+ newIntent.setData(mIntent.getData());
|
||||
+ newIntent.setPackage(applicationContext.getPackageName());
|
||||
+ IntentHandler.setTabLaunchType(newIntent, TabLaunchType.FROM_EXTERNAL_APP);
|
||||
+ newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
+ }
|
||||
+
|
||||
long time = SystemClock.elapsedRealtime();
|
||||
if (!chromeTabbedTaskExists()) {
|
||||
newIntent.putExtra(IntentHandler.EXTRA_STARTED_TABBED_CHROME_TASK, true);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
@@ -35,6 +35,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
|
||||
+
|
||||
/**
|
||||
* A model class that parses the incoming intent for incognito Custom Tabs specific customization
|
||||
* data.
|
||||
@@ -108,6 +111,9 @@ public class IncognitoCustomTabIntentDataProvider extends BrowserServicesIntentD
|
||||
}
|
||||
|
||||
private static boolean isIntentFromThirdPartyAllowed() {
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ return true;
|
||||
return ChromeFeatureList.sCctIncognitoAvailableToThirdParty.isEnabled();
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -76,6 +76,9 @@ public class PrivacySettings
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
private IncognitoLockSettings mIncognitoLockSettings;
|
||||
|
||||
+ private ChromeSwitchPreference allowCustomTabIntentsPref;
|
||||
+ private ChromeSwitchPreference openExternalLinksPref;
|
||||
+
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
PrivacyPreferencesManagerImpl privacyPrefManager =
|
||||
@@ -135,6 +138,9 @@ public class PrivacySettings
|
||||
updatePreferences();
|
||||
}
|
||||
|
||||
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
+ public static final String PREF_OPEN_EXTERNAL_LINKS_INCOGNITO = "open_external_links_incognito";
|
||||
+
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String key = preference.getKey();
|
||||
@@ -151,6 +157,14 @@ public class PrivacySettings
|
||||
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
|
||||
UserPrefs.get(Profile.getLastUsedRegularProfile())
|
||||
.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
|
||||
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ } else if (PREF_OPEN_EXTERNAL_LINKS_INCOGNITO.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -173,6 +187,16 @@ public class PrivacySettings
|
||||
canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
|
||||
}
|
||||
|
||||
+ allowCustomTabIntentsPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
|
||||
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
|
||||
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
+ openExternalLinksPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO);
|
||||
+ openExternalLinksPref.setOnPreferenceChangeListener(this);
|
||||
+ openExternalLinksPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
|
||||
if (doNotTrackPref != null) {
|
||||
doNotTrackPref.setSummary(prefService.getBoolean(Pref.ENABLE_DO_NOT_TRACK)
|
||||
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
--- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
+++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
@@ -84,7 +84,11 @@ public final class TabAssociatedApp extends TabWebContentsUserData implements Im
|
||||
public static boolean isOpenedFromExternalApp(Tab tab) {
|
||||
TabAssociatedApp app = get(tab);
|
||||
if (app == null) return false;
|
||||
-
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean("open_external_links_incognito", false) &&
|
||||
+ tab.isIncognito() &&
|
||||
+ tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP)
|
||||
+ return true;
|
||||
String packageName = ContextUtils.getApplicationContext().getPackageName();
|
||||
return tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP
|
||||
&& !TextUtils.equals(app.getAppId(), packageName);
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -4783,6 +4783,21 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_NEAR_OOM_REDUCTION_DECLINE" desc="The text of the button letting the user decline the browser's intervention, so that the page can be reloaded.">
|
||||
Show original
|
||||
</message>
|
||||
+ <!-- Allow custom tab intents -->
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_TITLE" desc="Text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow custom tab intents
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow applications to open custom tab intents, similar to webview.
|
||||
+ </message>
|
||||
+
|
||||
+ <!-- Open External Links in Incognito -->
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_TITLE" desc="Text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ Open external links in incognito
|
||||
+ </message>
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_SUMMARY" desc="Summary text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ Force the opening of all external links in incognito mode
|
||||
+ </message>
|
||||
|
||||
<!-- Autofill Assistant preferences -->
|
||||
<!-- TODO(b/168178344): Move to Assistant settings strings section below. -->
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,133 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 31 Jan 2017 22:12:27 -0500
|
||||
Subject: Add exit menu item
|
||||
|
||||
Corrected Exit functionality
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 6 ++++++
|
||||
.../org/chromium/chrome/browser/ApplicationLifetime.java | 2 ++
|
||||
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++++
|
||||
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 6 ++++++
|
||||
.../chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
|
||||
.../browser/ui/android/strings/android_chrome_strings.grd | 3 +++
|
||||
6 files changed, 26 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -161,6 +161,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/managed_by_menu_id"
|
||||
android:title="@string/managed_browser"
|
||||
android:icon="@drawable/ic_business" />
|
||||
+ <item android:id="@+id/exit_id"
|
||||
+ android:title="@string/menu_exit"
|
||||
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only in the tab switcher -->
|
||||
@@ -187,6 +190,9 @@ found in the LICENSE file.
|
||||
<item android:id="@id/preferences_id"
|
||||
android:title="@string/menu_settings"
|
||||
android:icon="@drawable/settings_cog" />
|
||||
+ <item android:id="@+id/exit_id"
|
||||
+ android:title="@string/menu_exit"
|
||||
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only when the tablet has no visible tabs -->
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
|
||||
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser;
|
||||
|
||||
import org.chromium.base.ObserverList;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
|
||||
|
||||
/**
|
||||
* Watches for when Chrome is told to restart itself.
|
||||
@@ -42,6 +43,7 @@ public class ApplicationLifetime {
|
||||
|
||||
@CalledByNative
|
||||
public static void terminate(boolean restart) {
|
||||
+ IncognitoNotificationManager.dismissIncognitoNotification();
|
||||
for (Observer observer : sObservers) {
|
||||
observer.onTerminate(restart);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -225,6 +225,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
+import org.chromium.chrome.browser.ApplicationLifetime;
|
||||
+
|
||||
/**
|
||||
* This is the main activity for ChromeMobile when not running in document mode. All the tabs
|
||||
* are accessible via a chrome specific tab switching UI.
|
||||
@@ -2202,6 +2204,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
} else if (id == R.id.close_tab) {
|
||||
getCurrentTabModel().closeTab(currentTab, true, false, true);
|
||||
RecordUserAction.record("MobileTabClosed");
|
||||
+ } else if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
} else if (id == R.id.close_all_tabs_menu_id) {
|
||||
// Close both incognito and normal tabs.
|
||||
CloseAllTabsDialog.show(this, getModalDialogManagerSupplier(),
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -63,6 +63,7 @@ import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ActivityTabProvider;
|
||||
import org.chromium.chrome.browser.ActivityUtils;
|
||||
import org.chromium.chrome.browser.AppHooks;
|
||||
+import org.chromium.chrome.browser.ApplicationLifetime;
|
||||
import org.chromium.chrome.browser.ChromeActivitySessionTracker;
|
||||
import org.chromium.chrome.browser.ChromeApplicationImpl;
|
||||
import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
|
||||
@@ -2332,6 +2333,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
return true;
|
||||
}
|
||||
|
||||
+ if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (id == R.id.update_menu_id) {
|
||||
UpdateMenuItemHelper.getInstance().onMenuItemClicked(this);
|
||||
return true;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
@@ -82,7 +82,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
|
||||
|
||||
// Kick off a timer to kill the process after a delay, which fires only if the Activities
|
||||
// take too long to be finished.
|
||||
- mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ if (restart) {
|
||||
+ mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ } else {
|
||||
+ fireBrowserRestartActivityIntent();
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -3470,6 +3470,9 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_AUTO_DARK_WEB_CONTENTS" desc="Menu item in Chrome's overflow/options menu. When Chrome's browser UI is set to dark theme and this option is checked, sites will have a dark theme automatically applied as well. [CHAR_LIMIT=24]">
|
||||
Dark theme
|
||||
</message>
|
||||
+ <message name="IDS_MENU_EXIT" desc="Menu item for exit browser. [CHAR-LIMIT=27]">
|
||||
+ Exit
|
||||
+ </message>
|
||||
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR_LIMIT=27]">
|
||||
Appearance
|
||||
</message>
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,140 @@
|
||||
From: Blaise <BlaiseD@GMail.com>
|
||||
Date: Sat, 22 Aug 2020 08:52:40 -0500
|
||||
Subject: Add flag for omnibox autocomplete filtering
|
||||
|
||||
Adds a flag that restricts whether search history, clipboard, bookmarks
|
||||
and internal chrome:// pages will be used for the autocomplete results.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 22 ++++++++++++++++++-
|
||||
.../browser/autocomplete_controller.cc | 11 ++++++++++
|
||||
.../omnibox/browser/history_url_provider.cc | 3 +++
|
||||
components/omnibox/browser/search_provider.cc | 4 ++++
|
||||
components/url_formatter/url_fixer.cc | 4 ++++
|
||||
5 files changed, 43 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -539,6 +539,22 @@ const FeatureEntry::FeatureVariation kReaderModeDiscoverabilityVariations[] = {
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
+const FeatureEntry::Choice kOmniboxAutocompleteFiltering[] = {
|
||||
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
|
||||
+ {"Search suggestions only",
|
||||
+ "omnibox-autocomplete-filtering",
|
||||
+ "search"},
|
||||
+ {"Search suggestions and bookmarks",
|
||||
+ "omnibox-autocomplete-filtering",
|
||||
+ "search-bookmarks"},
|
||||
+ {"Search suggestions and internal chrome pages",
|
||||
+ "omnibox-autocomplete-filtering",
|
||||
+ "search-chrome"},
|
||||
+ {"Search suggestions, bookmarks, and internal chrome pages",
|
||||
+ "omnibox-autocomplete-filtering",
|
||||
+ "search-bookmarks-chrome"},
|
||||
+};
|
||||
+
|
||||
const FeatureEntry::FeatureParam kAdaptiveButton_AlwaysNone[] = {
|
||||
{"mode", "always-none"}};
|
||||
const FeatureEntry::FeatureParam kAdaptiveButton_AlwaysNewTab[] = {
|
||||
@@ -4428,7 +4444,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
kOsMac | kOsLinux | kOsWin,
|
||||
FEATURE_VALUE_TYPE(features::kSystemNotifications)},
|
||||
#endif // BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS) && !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
+#if BUILDFLAG(IS_ANDROID) // Bromite autocomplete filtering
|
||||
+ {"omnibox-autocomplete-filtering",
|
||||
+ "Omnibox Autocomplete Filtering",
|
||||
+ "Restrict omnibox autocomplete results to a combination of search suggestions (if enabled), bookmarks, and internal chrome pages.",
|
||||
+ kOsAll, MULTI_VALUE_TYPE(kOmniboxAutocompleteFiltering)},
|
||||
{"adaptive-button-in-top-toolbar",
|
||||
flag_descriptions::kAdaptiveButtonInTopToolbarName,
|
||||
flag_descriptions::kAdaptiveButtonInTopToolbarDescription, kOsAndroid,
|
||||
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
|
||||
--- a/components/omnibox/browser/autocomplete_controller.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_controller.cc
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/check_op.h"
|
||||
+#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
@@ -337,6 +339,15 @@ AutocompleteController::AutocompleteController(
|
||||
is_cros_launcher_(is_cros_launcher),
|
||||
search_service_worker_signal_sent_(false),
|
||||
template_url_service_(provider_client_->GetTemplateURLService()) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering")) {
|
||||
+ const std::string flag_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering");
|
||||
+ provider_types &= AutocompleteProvider::TYPE_KEYWORD | AutocompleteProvider::TYPE_SEARCH |
|
||||
+ AutocompleteProvider::TYPE_HISTORY_URL | AutocompleteProvider::TYPE_BOOKMARK | AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ if (!base::Contains(flag_value, "bookmarks"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BOOKMARK;
|
||||
+ if (!base::Contains(flag_value, "chrome"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ }
|
||||
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
|
||||
|
||||
if (OmniboxFieldTrial::kAutocompleteStabilityAsyncProvidersFirst.Get()) {
|
||||
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
|
||||
--- a/components/omnibox/browser/history_url_provider.cc
|
||||
+++ b/components/omnibox/browser/history_url_provider.cc
|
||||
@@ -475,6 +475,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
|
||||
if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
|
||||
matches_.push_back(what_you_typed_match);
|
||||
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
// We'll need the history service to run both passes, so try to obtain it.
|
||||
history::HistoryService* const history_service =
|
||||
client()->GetHistoryService();
|
||||
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
|
||||
--- a/components/omnibox/browser/search_provider.cc
|
||||
+++ b/components/omnibox/browser/search_provider.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/base64.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/i18n/break_iterator.h"
|
||||
#include "base/i18n/case_conversion.h"
|
||||
@@ -671,6 +672,9 @@ void SearchProvider::Run(bool query_is_private) {
|
||||
}
|
||||
|
||||
void SearchProvider::DoHistoryQuery(bool minimal_changes) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
// The history query results are synchronous, so if minimal_changes is true,
|
||||
// we still have the last results and don't need to do anything.
|
||||
if (minimal_changes)
|
||||
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
|
||||
--- a/components/url_formatter/url_fixer.cc
|
||||
+++ b/components/url_formatter/url_fixer.cc
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "base/check_op.h"
|
||||
+#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/i18n/char_iterator.h"
|
||||
@@ -608,6 +610,8 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
|
||||
|
||||
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url);
|
||||
if (chrome_url && !parts.host.is_valid())
|
||||
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering") ||
|
||||
+ base::Contains(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering"), "chrome"))
|
||||
url.append(kChromeUIDefaultHost);
|
||||
FixupPort(trimmed, parts.port, &url);
|
||||
FixupPath(trimmed, parts.path, &url);
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,112 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Mon, 1 Feb 2021 19:18:55 +0200
|
||||
Subject: Add flag for save-data-header
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 5 ++++-
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../browser/loader/browser_initiated_resource_request.cc | 8 ++++++++
|
||||
services/network/public/cpp/features.cc | 5 +++++
|
||||
services/network/public/cpp/features.h | 2 +-
|
||||
6 files changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -5018,7 +5018,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"force-text-direction", flag_descriptions::kForceTextDirectionName,
|
||||
flag_descriptions::kForceTextDirectionDescription, kOsAll,
|
||||
MULTI_VALUE_TYPE(kForceTextDirectionChoices)},
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
+#if BUILDFLAG(IS_ANDROID) // Bromite save data header
|
||||
+ {"enable-save-data-header", flag_descriptions::kEnableSaveDataHeaderName,
|
||||
+ flag_descriptions::kEnableSaveDataHeaderDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kEnableSaveDataHeader)},
|
||||
{"force-update-menu-type", flag_descriptions::kUpdateMenuTypeName,
|
||||
flag_descriptions::kUpdateMenuTypeDescription, kOsAndroid,
|
||||
MULTI_VALUE_TYPE(kForceUpdateMenuTypeChoices)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1222,6 +1222,10 @@ const char kDeprecateAltBasedSixPackDescription[] =
|
||||
"Show deprecation notifications and disable functionality for Alt based "
|
||||
"six pack deprecations. The Search based versions continue to work.";
|
||||
|
||||
+const char kEnableSaveDataHeaderName[] = "Enable save-data header";
|
||||
+const char kEnableSaveDataHeaderDescription[] =
|
||||
+ "Enable save-data header without enabling Data Saver.";
|
||||
+
|
||||
const char kExperimentalAccessibilityLanguageDetectionName[] =
|
||||
"Experimental accessibility language detection";
|
||||
const char kExperimentalAccessibilityLanguageDetectionDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -650,6 +650,9 @@ extern const char kDeprecateAltClickDescription[];
|
||||
extern const char kDeprecateAltBasedSixPackName[];
|
||||
extern const char kDeprecateAltBasedSixPackDescription[];
|
||||
|
||||
+extern const char kEnableSaveDataHeaderName[];
|
||||
+extern const char kEnableSaveDataHeaderDescription[];
|
||||
+
|
||||
extern const char kMemlogName[];
|
||||
extern const char kMemlogDescription[];
|
||||
extern const char kMemlogModeMinimal[];
|
||||
diff --git a/content/browser/loader/browser_initiated_resource_request.cc b/content/browser/loader/browser_initiated_resource_request.cc
|
||||
--- a/content/browser/loader/browser_initiated_resource_request.cc
|
||||
+++ b/content/browser/loader/browser_initiated_resource_request.cc
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
#include "content/browser/loader/browser_initiated_resource_request.h"
|
||||
|
||||
+#include "base/feature_list.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
+
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
@@ -37,8 +40,13 @@ void UpdateAdditionalHeadersForBrowserInitiatedRequest(
|
||||
// Save-Data was previously included in hints for workers, thus we cannot
|
||||
// remove it for the time being. If you're reading this, consider building
|
||||
// permissions policies for workers and/or deprecating this inclusion.
|
||||
+ bool setHeader = false;
|
||||
if (is_for_worker_script &&
|
||||
GetContentClient()->browser()->IsDataSaverEnabled(browser_context)) {
|
||||
+ setHeader = true;
|
||||
+ }
|
||||
+ setHeader |= base::FeatureList::IsEnabled(network::features::kEnableSaveDataHeader);
|
||||
+ if (setHeader) {
|
||||
if (should_update_existing_headers) {
|
||||
headers->RemoveHeader("Save-Data");
|
||||
}
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -20,6 +20,11 @@ BASE_FEATURE(kExpectCTReporting,
|
||||
"ExpectCTReporting",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+// Enable save-data header separately (without enabled data reduction service).
|
||||
+BASE_FEATURE(kEnableSaveDataHeader,
|
||||
+ "EnableSaveDataHeader",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
BASE_FEATURE(kNetworkErrorLogging,
|
||||
"NetworkErrorLogging",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -50,7 +50,7 @@ extern const base::FeatureParam<TrustTokenOriginTrialSpec>
|
||||
kTrustTokenOperationsRequiringOriginTrial;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::FeatureParam<bool> kPlatformProvidedTrustTokenIssuance;
|
||||
-
|
||||
+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kEnableSaveDataHeader);
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
BASE_DECLARE_FEATURE(kWebSocketReassembleShortMessages);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,158 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 22:42:04 +0200
|
||||
Subject: Add flag to configure maximum connections per host
|
||||
|
||||
With the introduction of this flag it is possible to increase the maximum
|
||||
allowed connections per host; this can however be detrimental to devices
|
||||
with limited CPU/memory resources and it is disabled by default.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../common/network_features.cc | 3 +++
|
||||
.../common/network_features.h | 4 ++++
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
.../spoof_checks/top_domains/BUILD.gn | 1 +
|
||||
net/socket/client_socket_pool_manager.cc | 17 +++++++++++++++++
|
||||
8 files changed, 44 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1097,6 +1097,11 @@ const FeatureEntry::Choice kForceColorProfileChoices[] = {
|
||||
switches::kForceDisplayColorProfile, "hdr10"},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
|
||||
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
|
||||
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
|
||||
+};
|
||||
+
|
||||
const FeatureEntry::Choice kMemlogModeChoices[] = {
|
||||
{flags_ui::kGenericExperimentChoiceDisabled, "", ""},
|
||||
{flag_descriptions::kMemlogModeMinimal, heap_profiling::kMemlogMode,
|
||||
@@ -4917,6 +4922,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kAndroidPictureInPictureAPIName,
|
||||
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
|
||||
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
|
||||
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
{"reengagement-notification",
|
||||
flag_descriptions::kReengagementNotificationName,
|
||||
flag_descriptions::kReengagementNotificationDescription, kOsAndroid,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1830,6 +1830,10 @@ const char kUnthrottledNestedTimeoutDescription[] =
|
||||
"websites abusing the API will still eventually have their setTimeouts "
|
||||
"clamped.";
|
||||
|
||||
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
|
||||
+const char kMaxConnectionsPerHostDescription[] =
|
||||
+ "Customize maximum allowed connections per host.";
|
||||
+
|
||||
const char kMediaRouterCastAllowAllIPsName[] =
|
||||
"Connect to Cast devices on all IP addresses";
|
||||
const char kMediaRouterCastAllowAllIPsDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1037,6 +1037,9 @@ extern const char kLogJsConsoleMessagesDescription[];
|
||||
extern const char kUnthrottledNestedTimeoutName[];
|
||||
extern const char kUnthrottledNestedTimeoutDescription[];
|
||||
|
||||
+extern const char kMaxConnectionsPerHostName[];
|
||||
+extern const char kMaxConnectionsPerHostDescription[];
|
||||
+
|
||||
extern const char kMediaRouterCastAllowAllIPsName[];
|
||||
extern const char kMediaRouterCastAllowAllIPsDescription[];
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -8,4 +8,7 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
|
||||
+ kMaxConnectionsPerHostChoice15[] = "15";
|
||||
+
|
||||
} // namespace features
|
||||
diff --git a/components/network_session_configurator/common/network_features.h b/components/network_session_configurator/common/network_features.h
|
||||
--- a/components/network_session_configurator/common/network_features.h
|
||||
+++ b/components/network_session_configurator/common/network_features.h
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kMaxConnectionsPerHostChoiceDefault[],
|
||||
+ kMaxConnectionsPerHostChoice6[],
|
||||
+ kMaxConnectionsPerHostChoice15[];
|
||||
+
|
||||
} // namespace features
|
||||
|
||||
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -19,6 +19,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
|
||||
// Enables the QUIC protocol. This is a temporary testing flag.
|
||||
NETWORK_SWITCH(kEnableQuic, "enable-quic")
|
||||
|
||||
+// Allows specifying a higher number of maximum connections per host
|
||||
+// (15 instead of 6, mirroring the value Mozilla uses).
|
||||
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
|
||||
+
|
||||
// Ignores certificate-related errors.
|
||||
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
|
||||
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -89,6 +89,7 @@ executable("make_top_domain_list_variables") {
|
||||
"//base:i18n",
|
||||
"//components/url_formatter/spoof_checks/common_words:common",
|
||||
"//third_party/icu",
|
||||
+ "//components/network_session_configurator/common"
|
||||
]
|
||||
if (is_ios) {
|
||||
frameworks = [ "UIKit.framework" ]
|
||||
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
|
||||
--- a/net/socket/client_socket_pool_manager.cc
|
||||
+++ b/net/socket/client_socket_pool_manager.cc
|
||||
@@ -19,6 +19,10 @@
|
||||
#include "net/socket/client_socket_handle.h"
|
||||
#include "net/socket/client_socket_pool.h"
|
||||
#include "net/socket/connect_job.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
+
|
||||
+#include "base/command_line.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
#include "net/ssl/ssl_config.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -172,6 +176,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
|
||||
int ClientSocketPoolManager::max_sockets_per_group(
|
||||
HttpNetworkSession::SocketPoolType pool_type) {
|
||||
DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES);
|
||||
+
|
||||
+ if (pool_type == HttpNetworkSession::NORMAL_SOCKET_POOL) {
|
||||
+ int maxConnectionsPerHost = 0;
|
||||
+ auto value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kMaxConnectionsPerHost);
|
||||
+ if (!value.empty() && !base::StringToInt(value, &maxConnectionsPerHost)) {
|
||||
+ LOG(DFATAL) << "--" << switches::kMaxConnectionsPerHost << " only accepts integers as arguments (\"" << value << "\" is invalid)";
|
||||
+ }
|
||||
+ if (maxConnectionsPerHost != 0) {
|
||||
+ return maxConnectionsPerHost;
|
||||
+ }
|
||||
+ // fallthrough for default value
|
||||
+ }
|
||||
+
|
||||
return g_max_sockets_per_group[pool_type];
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,76 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 25 Oct 2018 23:13:34 +0200
|
||||
Subject: Add flag to control video playback resume feature
|
||||
|
||||
Disable it by default on Android as it is everywhere else
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
media/base/media_switches.cc | 8 ++------
|
||||
4 files changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -3730,6 +3730,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)},
|
||||
#endif // ENABLE_EXTENSIONS
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
+ {"resume-background-video",
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
{"osk-resizes-visual-viewport-by-default",
|
||||
flag_descriptions::kEnableOskResizesVisualViewportByDefaultName,
|
||||
flag_descriptions::kEnableOskResizesVisualViewportByDefaultDescription,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1317,6 +1317,11 @@ const char kEnablePenetratingImageSelectionDescription[] =
|
||||
"Enables image options to be surfaced in the context menu for nodes "
|
||||
"covered by transparent overlays.";
|
||||
|
||||
+const char kResumeBackgroundVideoName[] = "Resume background video.";
|
||||
+const char kResumeBackgroundVideoDescription[] =
|
||||
+ "Resume background video playback when tab re-gains focus; additionally, "
|
||||
+ "it will pause video playback every single time you switch tabs.";
|
||||
+
|
||||
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
|
||||
const char kEnablePixelCanvasRecordingDescription[] =
|
||||
"Pixel canvas recording allows the compositor to raster contents aligned "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -722,6 +722,9 @@ extern const char kEnablePortalsDescription[];
|
||||
extern const char kEnablePortalsCrossOriginName[];
|
||||
extern const char kEnablePortalsCrossOriginDescription[];
|
||||
|
||||
+extern const char kResumeBackgroundVideoName[];
|
||||
+extern const char kResumeBackgroundVideoDescription[];
|
||||
+
|
||||
extern const char kEnablePixelCanvasRecordingName[];
|
||||
extern const char kEnablePixelCanvasRecordingDescription[];
|
||||
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -316,12 +316,8 @@ BASE_FEATURE(kPreloadMetadataLazyLoad,
|
||||
// Let videos be resumed via remote controls (for example, the notification)
|
||||
// when in background.
|
||||
BASE_FEATURE(kResumeBackgroundVideo,
|
||||
- "resume-background-video",
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif
|
||||
+ "resume-background-video", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
|
||||
);
|
||||
|
||||
// When enabled, MediaCapabilities will check with GPU Video Accelerator
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,155 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Nov 2018 13:06:49 +0100
|
||||
Subject: Add flag to disable IPv6 probes
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
components/subresource_filter/tools/BUILD.gn | 6 ++++++
|
||||
.../url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
|
||||
net/dns/host_resolver_manager.cc | 9 ++++++++-
|
||||
services/network/public/cpp/features.cc | 5 +++++
|
||||
services/network/public/cpp/features.h | 1 +
|
||||
8 files changed, 33 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -6166,6 +6166,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-reader-mode-in-cct", flag_descriptions::kReaderModeInCCTName,
|
||||
flag_descriptions::kReaderModeInCCTDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
|
||||
+ {"ipv6-probing",
|
||||
+ flag_descriptions::kIPv6ProbingName,
|
||||
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
{"shopping-list", commerce::flag_descriptions::kShoppingListName,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -3517,6 +3517,10 @@ const char kCCTRealTimeEngagementSignalsDescription[] =
|
||||
"Enables sending real-time engagement signals (e.g. scroll) through "
|
||||
"CustomTabsCallback.";
|
||||
|
||||
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
|
||||
+const char kIPv6ProbingDescription[] =
|
||||
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
|
||||
+
|
||||
const char kChimeAlwaysShowNotificationDescription[] =
|
||||
"A debug flag to always show Chime notification after receiving a payload.";
|
||||
const char kChimeAlwaysShowNotificationName[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -788,6 +788,9 @@ extern const char kEnableWasmLazyCompilationName[];
|
||||
extern const char kEnableWasmLazyCompilationDescription[];
|
||||
|
||||
extern const char kEnableWasmTieringName[];
|
||||
+extern const char kIPv6ProbingName[];
|
||||
+extern const char kIPv6ProbingDescription[];
|
||||
+
|
||||
extern const char kEnableWasmTieringDescription[];
|
||||
|
||||
extern const char kEvDetailsInPageInfoName[];
|
||||
diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
|
||||
--- a/components/subresource_filter/tools/BUILD.gn
|
||||
+++ b/components/subresource_filter/tools/BUILD.gn
|
||||
@@ -50,6 +50,8 @@ if (!is_ios) {
|
||||
deps = [
|
||||
":tools_lib",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -61,6 +63,8 @@ if (!is_ios) {
|
||||
":tools_lib",
|
||||
"../core/common",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -70,6 +74,8 @@ if (!is_ios) {
|
||||
"ruleset_converter:support",
|
||||
"//base",
|
||||
"//third_party/protobuf:protobuf_lite",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -89,7 +89,8 @@ executable("make_top_domain_list_variables") {
|
||||
"//base:i18n",
|
||||
"//components/url_formatter/spoof_checks/common_words:common",
|
||||
"//third_party/icu",
|
||||
- "//components/network_session_configurator/common"
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
if (is_ios) {
|
||||
frameworks = [ "UIKit.framework" ]
|
||||
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
|
||||
--- a/net/dns/host_resolver_manager.cc
|
||||
+++ b/net/dns/host_resolver_manager.cc
|
||||
@@ -104,6 +104,7 @@
|
||||
#include "net/log/net_log_event_type.h"
|
||||
#include "net/log/net_log_source.h"
|
||||
#include "net/log/net_log_source_type.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
#include "net/log/net_log_with_source.h"
|
||||
#include "net/socket/client_socket_factory.h"
|
||||
#include "net/socket/datagram_client_socket.h"
|
||||
@@ -3758,8 +3759,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
|
||||
if (last_ipv6_probe_time_.is_null() ||
|
||||
(tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
|
||||
kIPv6ProbePeriodMs) {
|
||||
- SetLastIPv6ProbeResult(
|
||||
+
|
||||
+ if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
|
||||
+ // pretend IPv6 connectivy probe is successful when probing is disabled
|
||||
+ SetLastIPv6ProbeResult(true);
|
||||
+ } else {
|
||||
+ SetLastIPv6ProbeResult(
|
||||
IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
|
||||
+ }
|
||||
cached = false;
|
||||
}
|
||||
net_log.AddEvent(
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -38,6 +38,11 @@ BASE_FEATURE(kThrottleDelayable,
|
||||
"ThrottleDelayable",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+// Enable IPv6 ping probes to RIPE DNS.
|
||||
+BASE_FEATURE(kIPv6Probing,
|
||||
+ "IPv6Probing",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
|
||||
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
|
||||
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -17,6 +17,7 @@ COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kExpectCTReporting);
|
||||
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkErrorLogging);
|
||||
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kReporting);
|
||||
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kThrottleDelayable);
|
||||
+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kIPv6Probing);
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
BASE_DECLARE_FEATURE(kDelayRequestsOnMultiplexedConnections);
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,58 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 25 May 2021 19:46:14 +0200
|
||||
Subject: Add flag to disable external intent requests
|
||||
|
||||
Adds a new flag that allows to control the switch with same name;
|
||||
when flag is disabled no external intent will ever be allowed, for any URL.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -3692,6 +3692,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"ui-disable-partial-swap", flag_descriptions::kUiPartialSwapName,
|
||||
flag_descriptions::kUiPartialSwapDescription, kOsAll,
|
||||
SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
|
||||
+ {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName,
|
||||
+ flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll,
|
||||
+ SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")},
|
||||
{"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
|
||||
flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
|
||||
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -3874,6 +3874,12 @@ const char kPhotoPickerVideoSupportName[] = "Photo Picker Video Support";
|
||||
const char kPhotoPickerVideoSupportDescription[] =
|
||||
"Enables video files to be shown in the Photo Picker dialog";
|
||||
|
||||
+const char kDisableExternalIntentRequestsName[] =
|
||||
+ "Never forward URL requests to external intents";
|
||||
+const char kDisableExternalIntentRequestsDescription[] =
|
||||
+ "URL requests will never"
|
||||
+ "allow for redirecting to an external intent.";
|
||||
+
|
||||
const char kQueryTilesName[] = "Show query tiles";
|
||||
const char kQueryTilesDescription[] = "Shows query tiles in Chrome";
|
||||
const char kQueryTilesNTPName[] = "Show query tiles in NTP";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -2236,6 +2236,9 @@ extern const char kQueryTilesNTPDescription[];
|
||||
extern const char kQueryTilesOnStartName[];
|
||||
extern const char kQueryTilesOnStartDescription[];
|
||||
extern const char kQueryTilesSingleTierName[];
|
||||
+extern const char kDisableExternalIntentRequestsName[];
|
||||
+extern const char kDisableExternalIntentRequestsDescription[];
|
||||
+
|
||||
extern const char kQueryTilesSingleTierDescription[];
|
||||
extern const char kQueryTilesEnableQueryEditingName[];
|
||||
extern const char kQueryTilesEnableQueryEditingDescription[];
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,156 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Jun 2021 17:35:39 +0200
|
||||
Subject: Add flag to disable vibration
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.h | 2 ++
|
||||
content/child/runtime_features.cc | 1 +
|
||||
content/public/common/content_features.cc | 5 +++++
|
||||
content/public/common/content_features.h | 2 ++
|
||||
third_party/blink/public/platform/web_runtime_features.h | 1 +
|
||||
.../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++
|
||||
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
|
||||
10 files changed, 29 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -7623,6 +7623,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
|
||||
#endif
|
||||
|
||||
+ {"enable-vibration", flag_descriptions::kEnableVibrationName,
|
||||
+ flag_descriptions::kEnableVibrationDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kVibration)},
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
{"exo-gamepad-vibration", flag_descriptions::kExoGamepadVibrationName,
|
||||
flag_descriptions::kExoGamepadVibrationDescription, kOsCrOS,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -6271,6 +6271,9 @@ const char kLacrosScreenCoordinatesEnabledDescription[] =
|
||||
"moveBy, moveTo or session restore.";
|
||||
#endif // #if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
|
||||
+const char kEnableVibrationName[] = "Vibration";
|
||||
+const char kEnableVibrationDescription[] = "Enable vibration API; an user gesture will still be needed.";
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
const char kAllowDefaultWebAppMigrationForChromeOsManagedUsersName[] =
|
||||
"Allow default web app migration for ChromeOS managed users";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -3847,6 +3847,8 @@ extern const char kWebUITabStripTabDragIntegrationName[];
|
||||
extern const char kWebUITabStripTabDragIntegrationDescription[];
|
||||
#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
+extern const char kEnableVibrationName[];
|
||||
+extern const char kEnableVibrationDescription[];
|
||||
#if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_ANDROID)
|
||||
|
||||
extern const char kAutofillCreditCardUploadName[];
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -102,6 +102,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
|
||||
WebRuntimeFeatures::EnableMediaSession(false);
|
||||
+ WebRuntimeFeatures::EnableVibration(base::FeatureList::IsEnabled(features::kVibration));
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -131,6 +131,11 @@ BASE_FEATURE(kBackForwardCacheMemoryControls,
|
||||
#endif
|
||||
);
|
||||
|
||||
+// Enables vibration; an user gesture will still be required if enabled.
|
||||
+BASE_FEATURE(kVibration,
|
||||
+ "Vibration",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
// When this feature is enabled, private network requests initiated from
|
||||
// non-secure contexts in the `public` address space are blocked.
|
||||
//
|
||||
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
|
||||
--- a/content/public/common/content_features.h
|
||||
+++ b/content/public/common/content_features.h
|
||||
@@ -322,6 +322,8 @@ CONTENT_EXPORT extern const base::FeatureParam<base::TimeDelta>
|
||||
kCompositorLockTimeout;
|
||||
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
+CONTENT_EXPORT BASE_DECLARE_FEATURE(kVibration);
|
||||
+
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
CONTENT_EXPORT BASE_DECLARE_FEATURE(kDeviceMonitorMac);
|
||||
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -70,6 +70,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFeatures : public WebRuntimeFeaturesBase {
|
||||
static void EnableFingerprintingCanvasMeasureTextNoise(bool);
|
||||
static void EnableFingerprintingCanvasImageDataNoise(bool);
|
||||
static void EnableFluentScrollbars(bool);
|
||||
+ static void EnableVibration(bool);
|
||||
|
||||
WebRuntimeFeatures() = delete;
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
--- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
+++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "third_party/blink/renderer/core/frame/local_frame.h"
|
||||
#include "third_party/blink/renderer/core/frame/navigator.h"
|
||||
#include "third_party/blink/renderer/core/page/page.h"
|
||||
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
|
||||
// Maximum number of entries in a vibration pattern.
|
||||
const unsigned kVibrationPatternLengthMax = 99;
|
||||
@@ -152,6 +153,8 @@ bool VibrationController::vibrate(Navigator& navigator,
|
||||
// reference to |window| or |navigator| was retained in another window.
|
||||
if (!navigator.DomWindow())
|
||||
return false;
|
||||
+ if (!RuntimeEnabledFeatures::VibrationEnabled())
|
||||
+ return false;
|
||||
return From(navigator).Vibrate(pattern);
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
@@ -52,6 +52,10 @@ void WebRuntimeFeatures::EnableTestOnlyFeatures(bool enable) {
|
||||
RuntimeEnabledFeatures::SetTestFeaturesEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableVibration(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetVibrationEnabled(enable);
|
||||
+}
|
||||
+
|
||||
void WebRuntimeFeatures::EnableOriginTrialControlledFeatures(bool enable) {
|
||||
RuntimeEnabledFeatures::SetOriginTrialControlledFeaturesEnabled(enable);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -1903,6 +1903,10 @@
|
||||
name: "OrientationEvent",
|
||||
status: {"Android": "stable"},
|
||||
},
|
||||
+ {
|
||||
+ name: "Vibration",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
{
|
||||
name: "OriginIsolationHeader",
|
||||
status: "stable",
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,699 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 18 Feb 2021 21:22:52 +0100
|
||||
Subject: Add menu item to bookmark all tabs
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 7 +++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 24 ++++++++
|
||||
.../browser/bookmarks/BookmarkBridge.java | 61 +++++++++++++++++++
|
||||
.../browser/bookmarks/BookmarkUtils.java | 4 ++
|
||||
.../bookmarks/android/bookmark_bridge.cc | 17 ++++++
|
||||
.../bookmarks/android/bookmark_bridge.h | 4 ++
|
||||
.../browser/bookmarks/bookmark_html_writer.cc | 8 ++-
|
||||
.../bookmarks/chrome_bookmark_client.cc | 2 +
|
||||
.../dialogs/DownloadLocationCustomView.java | 4 +-
|
||||
.../strings/android_chrome_strings.grd | 3 +
|
||||
components/bookmark_bar_strings.grdp | 6 ++
|
||||
.../bookmarks/browser/bookmark_codec.cc | 24 ++++++--
|
||||
components/bookmarks/browser/bookmark_codec.h | 7 ++-
|
||||
.../browser/bookmark_load_details.cc | 4 ++
|
||||
.../bookmarks/browser/bookmark_load_details.h | 2 +
|
||||
.../bookmarks/browser/bookmark_model.cc | 3 +-
|
||||
components/bookmarks/browser/bookmark_model.h | 7 +++
|
||||
components/bookmarks/browser/bookmark_node.cc | 15 +++++
|
||||
components/bookmarks/browser/bookmark_node.h | 5 ++
|
||||
components/bookmarks/browser/model_loader.cc | 3 +-
|
||||
.../bookmark_specifics_conversions.cc | 1 +
|
||||
21 files changed, 201 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -66,6 +66,10 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/all_bookmarks_menu_id"
|
||||
android:title="@string/menu_bookmarks"
|
||||
android:icon="@drawable/btn_star_filled" />
|
||||
+ <item android:id="@+id/bookmark_all_tabs_menu_id"
|
||||
+ android:title="@string/menu_bookmark_all_tabs"
|
||||
+ android:titleCondensed="@string/menu_bookmark_all_tabs"
|
||||
+ android:icon="@drawable/ic_folder_blue_24dp" />
|
||||
<item android:id="@+id/recent_tabs_menu_id"
|
||||
android:title="@string/menu_recent_tabs"
|
||||
android:icon="@drawable/devices_black_24dp" />
|
||||
@@ -184,6 +188,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/menu_group_tabs"
|
||||
android:title="@string/menu_group_tabs"
|
||||
android:icon="@drawable/ic_widgets" />
|
||||
+ <item android:id="@+id/bookmark_all_tabs_menu_id"
|
||||
+ android:title="@string/menu_bookmark_all_tabs"
|
||||
+ android:icon="@drawable/ic_folder_blue_24dp" />
|
||||
<item android:id="@+id/menu_select_tabs"
|
||||
android:title="@string/menu_select_tabs"
|
||||
android:icon="@drawable/ic_select_tabs" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -77,6 +77,7 @@ import org.chromium.chrome.browser.back_press.MinimizeAppAndCloseTabBackPressHan
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkUtils;
|
||||
import org.chromium.chrome.browser.browserservices.intents.WebappConstants;
|
||||
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
|
||||
+import org.chromium.chrome.browser.bookmarks.BookmarkModel;
|
||||
import org.chromium.chrome.browser.compositor.layouts.Layout;
|
||||
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome;
|
||||
import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChromePhone;
|
||||
@@ -2217,6 +2218,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
CloseAllTabsDialog.show(this, getModalDialogManagerSupplier(),
|
||||
() -> getTabModelSelector().closeAllTabs(), /*isIncognito=*/false);
|
||||
RecordUserAction.record("MobileMenuCloseAllTabs");
|
||||
+ } else if (id == R.id.bookmark_all_tabs_menu_id) {
|
||||
+ bookmarkAllTabs();
|
||||
} else if (id == R.id.close_all_incognito_tabs_menu_id) {
|
||||
// Close only incognito tabs
|
||||
CloseAllTabsDialog.show(this, getModalDialogManagerSupplier(),
|
||||
@@ -2269,6 +2272,27 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
mTabModalHandler.onOmniboxFocusChanged(hasFocus);
|
||||
}
|
||||
|
||||
+ private void bookmarkAllTabs() {
|
||||
+ TabModel tabModel = getTabModelSelector().getCurrentModel();
|
||||
+ int count = tabModel.getCount();
|
||||
+ Log.i(TAG, "bookmarkAllTabs(): %d tabs to bookmark", count);
|
||||
+ if (count == 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ final BookmarkModel bookmarkModel = mBookmarkModelSupplier.get();
|
||||
+ bookmarkModel.finishLoadingBookmarkModel(() -> {
|
||||
+ for (int i = 0; i < tabModel.getCount(); i++) {
|
||||
+ Tab tab = tabModel.getTabAt(i);
|
||||
+ if (tab.isNativePage()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ bookmarkModel.addToTabsCollection(this, tab);
|
||||
+ }
|
||||
+ bookmarkModel.finishedAddingToTabsCollection(this, getSnackbarManager());
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
private void recordLauncherShortcutAction(boolean isIncognito) {
|
||||
if (isIncognito) {
|
||||
RecordUserAction.record("Android.LauncherShortcut.NewIncognitoTab");
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
@@ -29,6 +29,7 @@ import com.google.common.primitives.UnsignedLongs;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
|
||||
import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.base.Log;
|
||||
import org.chromium.base.ObserverList;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
@@ -40,6 +41,10 @@ import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.read_later.ReadingListUtils;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController;
|
||||
+import org.chromium.chrome.R;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
import org.chromium.components.bookmarks.BookmarkItem;
|
||||
import org.chromium.components.bookmarks.BookmarkType;
|
||||
@@ -84,6 +89,8 @@ import java.io.File;
|
||||
* bookmark model stored in native.
|
||||
*/
|
||||
class BookmarkBridge {
|
||||
+ private static final String TAG = "BookmarkBridge";
|
||||
+
|
||||
private final Profile mProfile;
|
||||
private boolean mIsDestroyed;
|
||||
private boolean mIsDoingExtensiveChanges;
|
||||
@@ -356,6 +363,16 @@ class BookmarkBridge {
|
||||
mNativeBookmarkBridge, BookmarkBridge.this);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * @return The BookmarkId for the Tabs collecction folder node
|
||||
+ */
|
||||
+ public BookmarkId getTabsCollectionFolderId() {
|
||||
+ ThreadUtils.assertOnUiThread();
|
||||
+ assert mIsNativeBookmarkModelLoaded;
|
||||
+ return BookmarkBridgeJni.get().getTabsCollectionFolderId(
|
||||
+ mNativeBookmarkBridge, BookmarkBridge.this);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return Id representing the special "other" folder from bookmark model.
|
||||
*/
|
||||
@@ -957,6 +974,49 @@ class BookmarkBridge {
|
||||
mNativeBookmarkBridge, BookmarkBridge.this, title, url);
|
||||
}
|
||||
|
||||
+ // Used to bookmark all tabs in a specific folder, created if not existing
|
||||
+ public BookmarkId addToTabsCollection(Context context, Tab tab) {
|
||||
+ BookmarkId parent = getTabsCollectionFolderId();
|
||||
+ BookmarkId existingId = getUserBookmarkIdForTab(tab);
|
||||
+ if (existingId != null && existingId.getId() != BookmarkId.INVALID_ID) {
|
||||
+ BookmarkId existingBookmarkId = new BookmarkId(existingId.getId(), BookmarkType.NORMAL);
|
||||
+ BookmarkItem existingBookmark = getBookmarkById(existingBookmarkId);
|
||||
+ if (parent.equals(existingBookmark.getParentId())) {
|
||||
+ // bookmark already exists in the tabs collection folder
|
||||
+ return existingBookmarkId;
|
||||
+ }
|
||||
+ }
|
||||
+ BookmarkId bookmarkId =
|
||||
+ addBookmark(parent, getChildCount(parent), tab.getTitle(), tab.getUrl());
|
||||
+
|
||||
+ if (bookmarkId == null) {
|
||||
+ Log.e(TAG,
|
||||
+ "Failed to add bookmarks: parentTypeAndId %s", parent);
|
||||
+ }
|
||||
+ return bookmarkId;
|
||||
+ }
|
||||
+
|
||||
+ public void finishedAddingToTabsCollection(Activity activity, SnackbarManager snackbarManager) {
|
||||
+ BookmarkId parent = getTabsCollectionFolderId();
|
||||
+
|
||||
+ BookmarkItem bookmarkItem = getBookmarkById(parent);
|
||||
+ String folderName;
|
||||
+ if (bookmarkItem != null) {
|
||||
+ folderName = bookmarkItem.getTitle();
|
||||
+ } else {
|
||||
+ folderName = "";
|
||||
+ }
|
||||
+ SnackbarController snackbarController = new SnackbarController() {
|
||||
+ @Override
|
||||
+ public void onAction(Object actionData) {
|
||||
+ }
|
||||
+ };
|
||||
+ Snackbar snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION,
|
||||
+ Snackbar.UMA_BOOKMARK_ADDED)
|
||||
+ .setTemplateText(activity.getString(R.string.bookmark_page_saved_folder));
|
||||
+ snackbarManager.showSnackbar(snackbar);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @param url The URL of the reading list item.
|
||||
* @return The reading list item with the URL, or null if no such reading list item.
|
||||
@@ -1167,6 +1227,7 @@ class BookmarkBridge {
|
||||
void getAllFoldersWithDepths(long nativeBookmarkBridge, BookmarkBridge caller,
|
||||
List<BookmarkId> folderList, List<Integer> depthList);
|
||||
BookmarkId getRootFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
|
||||
+ BookmarkId getTabsCollectionFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
|
||||
BookmarkId getMobileFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
|
||||
BookmarkId getOtherFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
|
||||
BookmarkId getDesktopFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
|
||||
@@ -648,6 +648,7 @@ public class BookmarkUtils {
|
||||
List<BookmarkId> topLevelFolders = new ArrayList<>();
|
||||
BookmarkId desktopNodeId = bookmarkModel.getDesktopFolderId();
|
||||
BookmarkId mobileNodeId = bookmarkModel.getMobileFolderId();
|
||||
+ BookmarkId tabsCollectionNodeId = bookmarkModel.getTabsCollectionFolderId();
|
||||
BookmarkId othersNodeId = bookmarkModel.getOtherFolderId();
|
||||
|
||||
List<BookmarkId> specialFoldersIds =
|
||||
@@ -673,6 +674,9 @@ public class BookmarkUtils {
|
||||
if (bookmarkModel.isFolderVisible(mobileNodeId)) {
|
||||
topLevelFolders.add(mobileNodeId);
|
||||
}
|
||||
+ if (bookmarkModel.isFolderVisible(tabsCollectionNodeId)) {
|
||||
+ topLevelFolders.add(tabsCollectionNodeId);
|
||||
+ }
|
||||
if (bookmarkModel.isFolderVisible(desktopNodeId)) {
|
||||
topLevelFolders.add(desktopNodeId);
|
||||
}
|
||||
diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
--- a/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
+++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc
|
||||
@@ -431,6 +431,11 @@ void BookmarkBridge::GetTopLevelFolderIDs(
|
||||
top_level_folders.push_back(node.get());
|
||||
}
|
||||
|
||||
+ for (const auto& node : bookmark_model_->tabs_collection_node()->children()) {
|
||||
+ if (node->is_folder())
|
||||
+ top_level_folders.push_back(node.get());
|
||||
+ }
|
||||
+
|
||||
for (const auto& node : bookmark_model_->bookmark_bar_node()->children()) {
|
||||
if (node->is_folder())
|
||||
top_level_folders.push_back(node.get());
|
||||
@@ -478,6 +483,7 @@ void BookmarkBridge::GetAllFoldersWithDepths(
|
||||
// Vector to temporarily contain all child bookmarks at same level for sorting
|
||||
std::vector<const BookmarkNode*> bookmarks = {
|
||||
bookmark_model_->mobile_node(),
|
||||
+ bookmark_model_->tabs_collection_node(),
|
||||
bookmark_model_->bookmark_bar_node(),
|
||||
bookmark_model_->other_node(),
|
||||
};
|
||||
@@ -530,6 +536,17 @@ ScopedJavaLocalRef<jobject> BookmarkBridge::GetMobileFolderId(
|
||||
return folder_id_obj;
|
||||
}
|
||||
|
||||
+ScopedJavaLocalRef<jobject> BookmarkBridge::GetTabsCollectionFolderId(
|
||||
+ JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj) {
|
||||
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
+ const BookmarkNode* tabs_collection_node = bookmark_model_->tabs_collection_node();
|
||||
+ ScopedJavaLocalRef<jobject> folder_id_obj =
|
||||
+ JavaBookmarkIdCreateBookmarkId(
|
||||
+ env, tabs_collection_node->id(), GetBookmarkType(tabs_collection_node));
|
||||
+ return folder_id_obj;
|
||||
+}
|
||||
+
|
||||
ScopedJavaLocalRef<jobject> BookmarkBridge::GetOtherFolderId(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj) {
|
||||
diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser/bookmarks/android/bookmark_bridge.h
|
||||
--- a/chrome/browser/bookmarks/android/bookmark_bridge.h
|
||||
+++ b/chrome/browser/bookmarks/android/bookmark_bridge.h
|
||||
@@ -119,6 +119,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& obj);
|
||||
|
||||
+ base::android::ScopedJavaLocalRef<jobject> GetTabsCollectionFolderId(
|
||||
+ JNIEnv* env,
|
||||
+ const base::android::JavaParamRef<jobject>& obj);
|
||||
+
|
||||
base::android::ScopedJavaLocalRef<jobject> GetOtherFolderId(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& obj);
|
||||
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
|
||||
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
|
||||
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
|
||||
@@ -190,6 +190,8 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
|
||||
roots->FindDictKey(BookmarkCodec::kOtherBookmarkFolderNameKey);
|
||||
base::Value* mobile_folder_value =
|
||||
roots->FindDictKey(BookmarkCodec::kMobileBookmarkFolderNameKey);
|
||||
+ base::Value* tabs_collection_value =
|
||||
+ roots->FindDictKey(BookmarkCodec::kTabsBookmarkFolderNameKey);
|
||||
DCHECK(root_folder_value);
|
||||
DCHECK(other_folder_value);
|
||||
DCHECK(mobile_folder_value);
|
||||
@@ -201,7 +203,9 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
|
||||
!WriteNode(*static_cast<base::DictionaryValue*>(other_folder_value),
|
||||
BookmarkNode::OTHER_NODE) ||
|
||||
!WriteNode(*static_cast<base::DictionaryValue*>(mobile_folder_value),
|
||||
- BookmarkNode::MOBILE)) {
|
||||
+ BookmarkNode::MOBILE) ||
|
||||
+ !WriteNode(*static_cast<base::DictionaryValue*>(tabs_collection_value),
|
||||
+ BookmarkNode::TABS_COLLECTION)) {
|
||||
NotifyOnFinish(BookmarksExportObserver::Result::kCouldNotWriteNodes);
|
||||
return;
|
||||
}
|
||||
@@ -466,6 +470,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() {
|
||||
BookmarkModelFactory::GetForBrowserContext(profile_)->other_node());
|
||||
ExtractUrls(
|
||||
BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node());
|
||||
+ ExtractUrls(
|
||||
+ BookmarkModelFactory::GetForBrowserContext(profile_)->tabs_collection_node());
|
||||
if (!bookmark_urls_.empty())
|
||||
FetchNextFavicon();
|
||||
else
|
||||
diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.cc b/chrome/browser/bookmarks/chrome_bookmark_client.cc
|
||||
--- a/chrome/browser/bookmarks/chrome_bookmark_client.cc
|
||||
+++ b/chrome/browser/bookmarks/chrome_bookmark_client.cc
|
||||
@@ -144,6 +144,8 @@ bool ChromeBookmarkClient::IsPermanentNodeVisibleWhenEmpty(
|
||||
return !is_mobile;
|
||||
case bookmarks::BookmarkNode::MOBILE:
|
||||
return is_mobile;
|
||||
+ case bookmarks::BookmarkNode::TABS_COLLECTION:
|
||||
+ return is_mobile;
|
||||
}
|
||||
|
||||
return false;
|
||||
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
|
||||
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
|
||||
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
|
||||
@@ -79,7 +79,7 @@ public class DownloadLocationCustomView
|
||||
mDirectoryAdapter.update();
|
||||
}
|
||||
|
||||
- void setTitle(CharSequence title) {
|
||||
+ public void setTitle(CharSequence title) {
|
||||
mTitle.setText(title);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DownloadLocationCustomView
|
||||
mSubtitleView.setText(subtitle);
|
||||
}
|
||||
|
||||
- void setFileName(CharSequence fileName) {
|
||||
+ public void setFileName(CharSequence fileName) {
|
||||
mFileName.setText(fileName);
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -3603,6 +3603,9 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_SELECT_TABS" desc="Menu item for bulk editing tabs. [CHAR_LIMIT=27]">
|
||||
Select tabs
|
||||
</message>
|
||||
+ <message name="IDS_MENU_BOOKMARK_ALL_TABS" desc="Menu item to bookmark all tabs. [CHAR-LIMIT=27]">
|
||||
+ Bookmark all tabs
|
||||
+ </message>
|
||||
<message name="IDS_MENU_GET_IMAGE_DESCRIPTIONS" desc="Menu item to start getting alt text accessibility image labels/descriptions [CHAR_LIMIT=27]">
|
||||
Get image descriptions
|
||||
</message>
|
||||
diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_strings.grdp
|
||||
--- a/components/bookmark_bar_strings.grdp
|
||||
+++ b/components/bookmark_bar_strings.grdp
|
||||
@@ -20,6 +20,9 @@
|
||||
<message name="IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME" desc="Name shown in the tree for the mobile bookmarks folder">
|
||||
Mobile bookmarks
|
||||
</message>
|
||||
+ <message name="IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME" desc="Name shown in the tree for the tabs collection bookmarks folder">
|
||||
+ Tabs collection
|
||||
+ </message>
|
||||
<message name="IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME" desc="Name shown in the tree for the other bookmarks folder">
|
||||
Other bookmarks
|
||||
</message>
|
||||
@@ -34,6 +37,9 @@
|
||||
<message name="IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME" desc="In Title Case: Name shown in the tree for the mobile bookmarks folder">
|
||||
Mobile Bookmarks
|
||||
</message>
|
||||
+ <message name="IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME" desc="Name shown in the tree for the tabs collection bookmarks folder">
|
||||
+ Tabs Collection
|
||||
+ </message>
|
||||
<message name="IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME" desc="In Title Case: Name shown in the tree for the other bookmarks folder">
|
||||
Other Bookmarks
|
||||
</message>
|
||||
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc
|
||||
--- a/components/bookmarks/browser/bookmark_codec.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_codec.cc
|
||||
@@ -35,6 +35,7 @@ const char BookmarkCodec::kBookmarkBarFolderNameKey[] = "bookmark_bar";
|
||||
const char BookmarkCodec::kOtherBookmarkFolderNameKey[] = "other";
|
||||
// The value is left as 'synced' for historical reasons.
|
||||
const char BookmarkCodec::kMobileBookmarkFolderNameKey[] = "synced";
|
||||
+const char BookmarkCodec::kTabsBookmarkFolderNameKey[] = "tabs";
|
||||
const char BookmarkCodec::kVersionKey[] = "version";
|
||||
const char BookmarkCodec::kChecksumKey[] = "checksum";
|
||||
const char BookmarkCodec::kIdKey[] = "id";
|
||||
@@ -78,7 +79,8 @@ BookmarkCodec::~BookmarkCodec() = default;
|
||||
base::Value BookmarkCodec::Encode(BookmarkModel* model,
|
||||
std::string sync_metadata_str) {
|
||||
return Encode(model->bookmark_bar_node(), model->other_node(),
|
||||
- model->mobile_node(), model->root_node()->GetMetaInfoMap(),
|
||||
+ model->mobile_node(), model->tabs_collection_node(),
|
||||
+ model->root_node()->GetMetaInfoMap(),
|
||||
model->root_node()->GetUnsyncedMetaInfoMap(),
|
||||
std::move(sync_metadata_str));
|
||||
}
|
||||
@@ -87,6 +89,7 @@ base::Value BookmarkCodec::Encode(
|
||||
const BookmarkNode* bookmark_bar_node,
|
||||
const BookmarkNode* other_folder_node,
|
||||
const BookmarkNode* mobile_folder_node,
|
||||
+ const BookmarkNode* tabs_folder_node,
|
||||
const BookmarkNode::MetaInfoMap* model_meta_info_map,
|
||||
const BookmarkNode::MetaInfoMap* model_unsynced_meta_info_map,
|
||||
std::string sync_metadata_str) {
|
||||
@@ -109,6 +112,7 @@ base::Value BookmarkCodec::Encode(
|
||||
roots.SetKey(kBookmarkBarFolderNameKey, EncodeNode(bookmark_bar_node));
|
||||
roots.SetKey(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node));
|
||||
roots.SetKey(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node));
|
||||
+ roots.SetKey(kTabsBookmarkFolderNameKey, EncodeNode(tabs_folder_node));
|
||||
if (model_meta_info_map)
|
||||
roots.SetKey(kMetaInfo, EncodeMetaInfo(*model_meta_info_map));
|
||||
if (model_unsynced_meta_info_map) {
|
||||
@@ -130,6 +134,7 @@ bool BookmarkCodec::Decode(const base::Value& value,
|
||||
BookmarkNode* bb_node,
|
||||
BookmarkNode* other_folder_node,
|
||||
BookmarkNode* mobile_folder_node,
|
||||
+ BookmarkNode* tabs_folder_node,
|
||||
int64_t* max_id,
|
||||
std::string* sync_metadata_str) {
|
||||
ids_.clear();
|
||||
@@ -137,7 +142,8 @@ bool BookmarkCodec::Decode(const base::Value& value,
|
||||
base::GUID::ParseLowercase(BookmarkNode::kBookmarkBarNodeGuid),
|
||||
base::GUID::ParseLowercase(BookmarkNode::kOtherBookmarksNodeGuid),
|
||||
base::GUID::ParseLowercase(BookmarkNode::kMobileBookmarksNodeGuid),
|
||||
- base::GUID::ParseLowercase(BookmarkNode::kManagedNodeGuid)};
|
||||
+ base::GUID::ParseLowercase(BookmarkNode::kManagedNodeGuid),
|
||||
+ base::GUID::ParseLowercase(BookmarkNode::kTabsCollectionBookmarksNodeGuid)};
|
||||
ids_reassigned_ = false;
|
||||
guids_reassigned_ = false;
|
||||
ids_valid_ = true;
|
||||
@@ -145,12 +151,13 @@ bool BookmarkCodec::Decode(const base::Value& value,
|
||||
stored_checksum_.clear();
|
||||
InitializeChecksum();
|
||||
bool success = DecodeHelper(bb_node, other_folder_node, mobile_folder_node,
|
||||
+ tabs_folder_node,
|
||||
value, sync_metadata_str);
|
||||
FinalizeChecksum();
|
||||
// If either the checksums differ or some IDs were missing/not unique,
|
||||
// reassign IDs.
|
||||
if (!ids_valid_ || computed_checksum() != stored_checksum())
|
||||
- ReassignIDs(bb_node, other_folder_node, mobile_folder_node);
|
||||
+ ReassignIDs(bb_node, other_folder_node, mobile_folder_node, tabs_folder_node);
|
||||
*max_id = maximum_id_ + 1;
|
||||
return success;
|
||||
}
|
||||
@@ -207,6 +214,7 @@ base::Value BookmarkCodec::EncodeMetaInfo(
|
||||
bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node,
|
||||
BookmarkNode* other_folder_node,
|
||||
BookmarkNode* mobile_folder_node,
|
||||
+ BookmarkNode* tabs_folder_node,
|
||||
const base::Value& value,
|
||||
std::string* sync_metadata_str) {
|
||||
if (!value.is_dict())
|
||||
@@ -238,6 +246,12 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node,
|
||||
return false;
|
||||
|
||||
DecodeNode(*bb_value, nullptr, bb_node);
|
||||
+ const base::DictionaryValue* tabs_folder_d_value = nullptr;
|
||||
+ const base::Value* tabs_folder_value =
|
||||
+ roots->FindDictKey(kTabsBookmarkFolderNameKey);
|
||||
+ if (tabs_folder_value && tabs_folder_value->GetAsDictionary(&tabs_folder_d_value))
|
||||
+ DecodeNode(*tabs_folder_d_value, nullptr, tabs_folder_node);
|
||||
+
|
||||
DecodeNode(*other_folder_value, nullptr, other_folder_node);
|
||||
DecodeNode(*mobile_folder_value, nullptr, mobile_folder_node);
|
||||
|
||||
@@ -508,11 +522,13 @@ void BookmarkCodec::DecodeMetaInfoHelper(
|
||||
|
||||
void BookmarkCodec::ReassignIDs(BookmarkNode* bb_node,
|
||||
BookmarkNode* other_node,
|
||||
- BookmarkNode* mobile_node) {
|
||||
+ BookmarkNode* mobile_node,
|
||||
+ BookmarkNode* tabs_folder_node) {
|
||||
maximum_id_ = 0;
|
||||
ReassignIDsHelper(bb_node);
|
||||
ReassignIDsHelper(other_node);
|
||||
ReassignIDsHelper(mobile_node);
|
||||
+ ReassignIDsHelper(tabs_folder_node);
|
||||
ids_reassigned_ = true;
|
||||
}
|
||||
|
||||
diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h
|
||||
--- a/components/bookmarks/browser/bookmark_codec.h
|
||||
+++ b/components/bookmarks/browser/bookmark_codec.h
|
||||
@@ -49,6 +49,7 @@ class BookmarkCodec {
|
||||
const BookmarkNode* bookmark_bar_node,
|
||||
const BookmarkNode* other_folder_node,
|
||||
const BookmarkNode* mobile_folder_node,
|
||||
+ const BookmarkNode* tabs_folder_node,
|
||||
const BookmarkNode::MetaInfoMap* model_meta_info_map,
|
||||
const BookmarkNode::MetaInfoMap* model_unsynced_meta_info_map,
|
||||
std::string sync_metadata_str);
|
||||
@@ -62,6 +63,7 @@ class BookmarkCodec {
|
||||
BookmarkNode* bb_node,
|
||||
BookmarkNode* other_folder_node,
|
||||
BookmarkNode* mobile_folder_node,
|
||||
+ BookmarkNode* tabs_folder_node,
|
||||
int64_t* max_node_id,
|
||||
std::string* sync_metadata_str);
|
||||
|
||||
@@ -113,6 +115,7 @@ class BookmarkCodec {
|
||||
// Allows the BookmarkClient to read and a write a string blob from the JSON
|
||||
// file. That string captures the bookmarks sync metadata.
|
||||
static const char kSyncMetadata[];
|
||||
+ static const char kTabsBookmarkFolderNameKey[];
|
||||
static const char kDateLastUsed[];
|
||||
|
||||
// Possible values for kTypeKey.
|
||||
@@ -130,6 +133,7 @@ class BookmarkCodec {
|
||||
bool DecodeHelper(BookmarkNode* bb_node,
|
||||
BookmarkNode* other_folder_node,
|
||||
BookmarkNode* mobile_folder_node,
|
||||
+ BookmarkNode* tabs_folder_node,
|
||||
const base::Value& value,
|
||||
std::string* sync_metadata_str);
|
||||
|
||||
@@ -141,7 +145,8 @@ class BookmarkCodec {
|
||||
// Reassigns bookmark IDs for all nodes.
|
||||
void ReassignIDs(BookmarkNode* bb_node,
|
||||
BookmarkNode* other_node,
|
||||
- BookmarkNode* mobile_node);
|
||||
+ BookmarkNode* mobile_node,
|
||||
+ BookmarkNode* tabs_folder_node);
|
||||
|
||||
// Helper to recursively reassign IDs.
|
||||
void ReassignIDsHelper(BookmarkNode* node);
|
||||
diff --git a/components/bookmarks/browser/bookmark_load_details.cc b/components/bookmarks/browser/bookmark_load_details.cc
|
||||
--- a/components/bookmarks/browser/bookmark_load_details.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_load_details.cc
|
||||
@@ -37,6 +37,10 @@ BookmarkLoadDetails::BookmarkLoadDetails(BookmarkClient* client)
|
||||
root_node_->Add(BookmarkPermanentNode::CreateMobileBookmarks(
|
||||
max_id_++,
|
||||
client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::MOBILE))));
|
||||
+ tabs_collection_folder_node_ = static_cast<BookmarkPermanentNode*>(
|
||||
+ root_node_->Add(BookmarkPermanentNode::CreateTabsCollectionBookmarks(
|
||||
+ max_id_++,
|
||||
+ client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::TABS_COLLECTION))));
|
||||
}
|
||||
|
||||
BookmarkLoadDetails::~BookmarkLoadDetails() = default;
|
||||
diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/bookmarks/browser/bookmark_load_details.h
|
||||
--- a/components/bookmarks/browser/bookmark_load_details.h
|
||||
+++ b/components/bookmarks/browser/bookmark_load_details.h
|
||||
@@ -47,6 +47,7 @@ class BookmarkLoadDetails {
|
||||
BookmarkPermanentNode* bb_node() { return bb_node_; }
|
||||
BookmarkPermanentNode* mobile_folder_node() { return mobile_folder_node_; }
|
||||
BookmarkPermanentNode* other_folder_node() { return other_folder_node_; }
|
||||
+ BookmarkPermanentNode* tabs_collection_folder_node() { return tabs_collection_folder_node_; }
|
||||
|
||||
TitledUrlIndex* index() { return index_.get(); }
|
||||
std::unique_ptr<TitledUrlIndex> owned_index() { return std::move(index_); }
|
||||
@@ -112,6 +113,7 @@ class BookmarkLoadDetails {
|
||||
nullptr;
|
||||
raw_ptr<BookmarkPermanentNode, DanglingUntriaged> mobile_folder_node_ =
|
||||
nullptr;
|
||||
+ BookmarkPermanentNode* tabs_collection_folder_node_ = nullptr;
|
||||
LoadManagedNodeCallback load_managed_node_callback_;
|
||||
std::unique_ptr<TitledUrlIndex> index_;
|
||||
BookmarkNode::MetaInfoMap model_meta_info_map_;
|
||||
diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc
|
||||
--- a/components/bookmarks/browser/bookmark_model.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_model.cc
|
||||
@@ -670,7 +670,7 @@ bool BookmarkModel::HasBookmarks() {
|
||||
bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
return bookmark_bar_node_->children().empty() &&
|
||||
- other_node_->children().empty() && mobile_node_->children().empty();
|
||||
+ other_node_->children().empty() && mobile_node_->children().empty() && tabs_collection_node_->children().empty();
|
||||
}
|
||||
|
||||
bool BookmarkModel::IsBookmarked(const GURL& url) {
|
||||
@@ -926,6 +926,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr<BookmarkLoadDetails> details) {
|
||||
bookmark_bar_node_ = details->bb_node();
|
||||
other_node_ = details->other_folder_node();
|
||||
mobile_node_ = details->mobile_folder_node();
|
||||
+ tabs_collection_node_ = details->tabs_collection_folder_node();
|
||||
|
||||
titled_url_index_->SetNodeSorter(
|
||||
std::make_unique<TypedCountSorter>(client_.get()));
|
||||
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
|
||||
--- a/components/bookmarks/browser/bookmark_model.h
|
||||
+++ b/components/bookmarks/browser/bookmark_model.h
|
||||
@@ -122,6 +122,12 @@ class BookmarkModel : public BookmarkUndoProvider,
|
||||
return mobile_node_;
|
||||
}
|
||||
|
||||
+ // Returns the 'mobile' node. This is NULL until loaded.
|
||||
+ const BookmarkNode* tabs_collection_node() const {
|
||||
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
+ return tabs_collection_node_;
|
||||
+ }
|
||||
+
|
||||
bool is_root_node(const BookmarkNode* node) const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
return node == root_;
|
||||
@@ -446,6 +452,7 @@ class BookmarkModel : public BookmarkUndoProvider,
|
||||
nullptr;
|
||||
raw_ptr<BookmarkPermanentNode, DanglingUntriaged> other_node_ = nullptr;
|
||||
raw_ptr<BookmarkPermanentNode, DanglingUntriaged> mobile_node_ = nullptr;
|
||||
+ raw_ptr<BookmarkPermanentNode> tabs_collection_node_ = nullptr;
|
||||
|
||||
// The maximum ID assigned to the bookmark nodes in the model.
|
||||
int64_t next_node_id_ = 1;
|
||||
diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmarks/browser/bookmark_node.cc
|
||||
--- a/components/bookmarks/browser/bookmark_node.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_node.cc
|
||||
@@ -60,6 +60,10 @@ const char BookmarkNode::kOtherBookmarksNodeGuid[] =
|
||||
const char BookmarkNode::kMobileBookmarksNodeGuid[] =
|
||||
"4cf2e351-0e85-532b-bb37-df045d8f8d0f";
|
||||
|
||||
+// static
|
||||
+const char BookmarkNode::kTabsCollectionBookmarksNodeGuid[] =
|
||||
+ "00000000-0000-4000-a000-000000000006";
|
||||
+
|
||||
// static
|
||||
const char BookmarkNode::kManagedNodeGuid[] =
|
||||
"323123f4-9381-5aee-80e6-ea5fca2f7672";
|
||||
@@ -275,6 +279,17 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id,
|
||||
visible_when_empty));
|
||||
}
|
||||
|
||||
+// static
|
||||
+std::unique_ptr<BookmarkPermanentNode>
|
||||
+BookmarkPermanentNode::CreateTabsCollectionBookmarks(int64_t id,
|
||||
+ bool visible_when_empty) {
|
||||
+ // base::WrapUnique() used because the constructor is private.
|
||||
+ return base::WrapUnique(new BookmarkPermanentNode(
|
||||
+ id, TABS_COLLECTION, base::GUID::ParseLowercase(kTabsCollectionBookmarksNodeGuid),
|
||||
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME),
|
||||
+ visible_when_empty));
|
||||
+}
|
||||
+
|
||||
BookmarkPermanentNode::BookmarkPermanentNode(int64_t id,
|
||||
Type type,
|
||||
const base::GUID& guid,
|
||||
diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks/browser/bookmark_node.h
|
||||
--- a/components/bookmarks/browser/bookmark_node.h
|
||||
+++ b/components/bookmarks/browser/bookmark_node.h
|
||||
@@ -35,6 +35,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
|
||||
FOLDER,
|
||||
BOOKMARK_BAR,
|
||||
OTHER_NODE,
|
||||
+ TABS_COLLECTION,
|
||||
MOBILE
|
||||
};
|
||||
|
||||
@@ -52,6 +53,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
|
||||
static const char kBookmarkBarNodeGuid[];
|
||||
static const char kOtherBookmarksNodeGuid[];
|
||||
static const char kMobileBookmarksNodeGuid[];
|
||||
+ static const char kTabsCollectionBookmarksNodeGuid[];
|
||||
static const char kManagedNodeGuid[];
|
||||
|
||||
// A bug in sync caused some problematic GUIDs to be produced.
|
||||
@@ -270,6 +272,9 @@ class BookmarkPermanentNode : public BookmarkNode {
|
||||
static std::unique_ptr<BookmarkPermanentNode> CreateMobileBookmarks(
|
||||
int64_t id,
|
||||
bool visible_when_empty);
|
||||
+ static std::unique_ptr<BookmarkPermanentNode> CreateTabsCollectionBookmarks(
|
||||
+ int64_t id,
|
||||
+ bool visible_when_empty);
|
||||
|
||||
// Constructor is private to disallow the construction of permanent nodes
|
||||
// other than the well-known ones, see factory methods.
|
||||
diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks/browser/model_loader.cc
|
||||
--- a/components/bookmarks/browser/model_loader.cc
|
||||
+++ b/components/bookmarks/browser/model_loader.cc
|
||||
@@ -58,7 +58,8 @@ void LoadBookmarks(const base::FilePath& path,
|
||||
std::string sync_metadata_str;
|
||||
BookmarkCodec codec;
|
||||
codec.Decode(*root, details->bb_node(), details->other_folder_node(),
|
||||
- details->mobile_folder_node(), &max_node_id,
|
||||
+ details->mobile_folder_node(),
|
||||
+ details->tabs_collection_folder_node(), &max_node_id,
|
||||
&sync_metadata_str);
|
||||
details->set_sync_metadata_str(std::move(sync_metadata_str));
|
||||
details->set_max_id(std::max(max_node_id, details->max_id()));
|
||||
diff --git a/components/sync_bookmarks/bookmark_specifics_conversions.cc b/components/sync_bookmarks/bookmark_specifics_conversions.cc
|
||||
--- a/components/sync_bookmarks/bookmark_specifics_conversions.cc
|
||||
+++ b/components/sync_bookmarks/bookmark_specifics_conversions.cc
|
||||
@@ -446,6 +446,7 @@ sync_pb::BookmarkSpecifics::Type GetProtoTypeFromBookmarkNode(
|
||||
case bookmarks::BookmarkNode::BOOKMARK_BAR:
|
||||
case bookmarks::BookmarkNode::OTHER_NODE:
|
||||
case bookmarks::BookmarkNode::MOBILE:
|
||||
+ case bookmarks::BookmarkNode::TABS_COLLECTION:
|
||||
DCHECK(node->is_folder());
|
||||
return sync_pb::BookmarkSpecifics::FOLDER;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,130 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 13 Jul 2020 00:37:06 +0200
|
||||
Subject: Add menu item to view source
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../android/java/res/menu/custom_tabs_menu.xml | 3 +++
|
||||
chrome/android/java/res/menu/main_menu.xml | 3 +++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 2 ++
|
||||
.../chrome/browser/app/ChromeActivity.java | 5 +++++
|
||||
.../appmenu/AppMenuPropertiesDelegateImpl.java | 18 ++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
|
||||
.../android/strings/android_chrome_strings.grd | 4 ++++
|
||||
7 files changed, 36 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -51,6 +51,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/add_to_homescreen_id"
|
||||
android:title="@string/menu_add_to_homescreen"
|
||||
android:orderInCategory="2" />
|
||||
+ <item android:id="@+id/view_source_id"
|
||||
+ android:title="@string/view_source"
|
||||
+ android:orderInCategory="2" />
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:orderInCategory="2" />
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -108,6 +108,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/add_to_homescreen_id"
|
||||
android:title="@string/menu_add_to_homescreen"
|
||||
android:icon="@drawable/ic_add_to_home_screen" />
|
||||
+ <item android:id="@+id/view_source_id"
|
||||
+ android:title="@string/view_source"
|
||||
+ android:icon="@drawable/ic_drive_document_24dp" />
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:icon="@drawable/ic_add_to_home_screen" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -2243,6 +2243,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
|
||||
}
|
||||
RecordUserAction.record("MobileMenuDownloadManager");
|
||||
+ } else if (id == R.id.view_source_id) {
|
||||
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrl().getSpec()));
|
||||
} else if (id == R.id.open_recently_closed_tab) {
|
||||
TabModel currentModel = mTabModelSelector.getCurrentModel();
|
||||
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedEntry();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -2488,6 +2488,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
return true;
|
||||
}
|
||||
|
||||
+ if (id == R.id.view_source_id) {
|
||||
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrl().getSpec()));
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (id == R.id.request_desktop_site_id || id == R.id.request_desktop_site_check_id) {
|
||||
boolean usingDesktopUserAgent =
|
||||
currentTab.getWebContents().getNavigationController().getUseDesktopUserAgent();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
@@ -550,6 +550,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
isChromeScheme, isFileScheme, isContentScheme, isIncognito, url));
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isChromeScheme);
|
||||
+ updateViewSourceMenuItem(menu, currentTab);
|
||||
|
||||
updateAutoDarkMenuItem(menu, currentTab, isChromeScheme);
|
||||
|
||||
@@ -1244,6 +1245,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
stopPriceTrackingMenuItem.setVisible(false);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Updates the view source menu item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for view source.
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateViewSourceMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem viewSourceMenuItem = menu.findItem(R.id.view_source_id);
|
||||
+ boolean visible = false;
|
||||
+ if (currentTab != null) {
|
||||
+ String url = currentTab.getUrl().getSpec();
|
||||
+ visible = !url.isEmpty() && !url.startsWith("view-source:");
|
||||
+ }
|
||||
+ viewSourceMenuItem.setVisible(visible);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Updates the request desktop site item's state.
|
||||
*
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -228,6 +228,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
|
||||
updateRequestDesktopSiteMenuItem(
|
||||
menu, currentTab, requestDesktopSiteVisible, isChromeScheme);
|
||||
+ updateViewSourceMenuItem(menu, currentTab);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -312,6 +312,10 @@ CHAR_LIMIT guidelines:
|
||||
USB
|
||||
</message>
|
||||
|
||||
+ <message name="IDS_VIEW_SOURCE" desc="Title for the menu command to view the source of the current page. [CHAR-LIMIT=40]">
|
||||
+ View source
|
||||
+ </message>
|
||||
+
|
||||
<!-- Sign-in, sync and personalization preferences -->
|
||||
<message name="IDS_PREFS_SECTION_ACCOUNT_AND_GOOGLE_SERVICES" desc="Title for the group of account-related entries and google services in Settings. [CHAR_LIMIT=32]">
|
||||
You and Google
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,252 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Mon, 1 Feb 2021 19:18:55 +0200
|
||||
Subject: Add option to force tablet UI
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../ChromeAccessibilitySettingsDelegate.java | 19 +++++++++++++++++++
|
||||
.../preferences/ChromePreferenceKeys.java | 1 +
|
||||
.../LegacyChromePreferenceKeys.java | 1 +
|
||||
.../omnibox/LocationBarCoordinator.java | 2 +-
|
||||
.../strings/android_chrome_strings.grd | 6 ++++++
|
||||
.../toolbar/top/ToolbarControlContainer.java | 16 ----------------
|
||||
components/BUILD.gn | 6 +++---
|
||||
.../res/xml/accessibility_preferences.xml | 5 +++++
|
||||
.../accessibility/AccessibilitySettings.java | 10 ++++++++++
|
||||
.../AccessibilitySettingsDelegate.java | 2 ++
|
||||
ui/android/BUILD.gn | 2 ++
|
||||
.../chromium/ui/base/DeviceFormFactor.java | 5 +++++
|
||||
12 files changed, 55 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
@@ -68,6 +68,25 @@ public class ChromeAccessibilitySettingsDelegate implements AccessibilitySetting
|
||||
return new ReaderForAccessibilityDelegate();
|
||||
}
|
||||
|
||||
+ private static class ForceTabletUIDelegate implements BooleanPreferenceDelegate {
|
||||
+ @Override
|
||||
+ public boolean isEnabled() {
|
||||
+ return SharedPreferencesManager.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setEnabled(boolean value) {
|
||||
+ SharedPreferencesManager.getInstance().writeBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public BooleanPreferenceDelegate getForceTabletUIDelegate() {
|
||||
+ return new ForceTabletUIDelegate();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void addExtraPreferences(PreferenceFragmentCompat fragment) {
|
||||
if (ImageDescriptionsController.getInstance().shouldShowImageDescriptionsMenuItem()) {
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
@@ -418,6 +418,7 @@ public final class ChromePreferenceKeys {
|
||||
AccessibilityConstants.FONT_USER_SET_FORCE_ENABLE_ZOOM;
|
||||
|
||||
public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info";
|
||||
+ public static final String FLAGS_FORCE_TABLET_UI_ENABLED = "force_tablet_ui_enabled";
|
||||
|
||||
/** Keys used to save settings related to homepage. */
|
||||
public static final String HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
@@ -67,6 +67,7 @@ public class LegacyChromePreferenceKeys {
|
||||
ChromePreferenceKeys.FLAGS_CACHED_SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT,
|
||||
ChromePreferenceKeys.FLAGS_CACHED_TAB_GROUPS_ANDROID_ENABLED,
|
||||
ChromePreferenceKeys.FONT_USER_FONT_SCALE_FACTOR,
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED,
|
||||
ChromePreferenceKeys.FONT_USER_SET_FORCE_ENABLE_ZOOM,
|
||||
ChromePreferenceKeys.HISTORY_SHOW_HISTORY_INFO,
|
||||
ChromePreferenceKeys.HOMEPAGE_CUSTOM_URI,
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
@@ -376,7 +376,7 @@ public class LocationBarCoordinator implements LocationBar, NativeInitObserver,
|
||||
// OmniboxSuggestionsDropdownEmbedder implementation
|
||||
@Override
|
||||
public boolean isTablet() {
|
||||
- return DeviceFormFactor.isWindowOnTablet(mWindowAndroid);
|
||||
+ return DeviceFormFactor.isWindowOnTablet(mWindowAndroid) || isTabletLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1439,6 +1439,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_PRIVACY_GUIDE_SB_ENHANCED_ITEM_SEVEN" desc="Seventh bullet point that describes the details of the Safe Browsing control.">
|
||||
Temporarily links this data to your Google Account when you’re signed in, to protect you across Google apps
|
||||
</message>
|
||||
+ <message name="IDS_FORCE_TABLET_UI_SUMMARY" desc="Summary of the preference that allows the user to force chromium to use tablet UI.">
|
||||
+ Open chromium in Tablet Mode
|
||||
+ </message>
|
||||
+ <message name="IDS_FORCE_TABLET_UI_TITLE" desc="Title of the preference that allows the user to update force tablet UI settings.">
|
||||
+ Force Tablet Mode
|
||||
+ </message>
|
||||
|
||||
<!-- Safety check -->
|
||||
<message name="IDS_PREFS_SAFETY_CHECK" desc="Title of the Safety check element in settings, allowing the user to check multiple areas of browser safety. [CHAR_LIMIT=32]">
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
@@ -138,22 +138,6 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
|
||||
mToolbarContainer.setPostInitializationDependencies(mToolbar, constraintsSupplier,
|
||||
tabSupplier, compositorInMotionSupplier,
|
||||
browserStateBrowserControlsVisibilityDelegate, isVisible);
|
||||
-
|
||||
- View toolbarView = findViewById(R.id.toolbar);
|
||||
- assert toolbarView != null;
|
||||
-
|
||||
- if (toolbarView instanceof ToolbarTablet) {
|
||||
- // On tablet, draw a fake tab strip and toolbar until the compositor is
|
||||
- // ready to draw the real tab strip. (On phone, the toolbar is made entirely
|
||||
- // of Android views, which are already initialized.)
|
||||
- final Drawable backgroundDrawable =
|
||||
- AppCompatResources.getDrawable(getContext(), R.drawable.toolbar_background)
|
||||
- .mutate();
|
||||
- backgroundDrawable.setTint(
|
||||
- ChromeColors.getDefaultThemeColor(getContext(), isIncognito));
|
||||
- backgroundDrawable.setTintMode(PorterDuff.Mode.MULTIPLY);
|
||||
- setBackground(backgroundDrawable);
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/components/BUILD.gn b/components/BUILD.gn
|
||||
--- a/components/BUILD.gn
|
||||
+++ b/components/BUILD.gn
|
||||
@@ -45,7 +45,7 @@ if (is_ios) {
|
||||
|
||||
# Omit Lacros because it allows //components to depend on //chrome, which in
|
||||
# turn depends on //extensions.
|
||||
-if (!is_chromeos_lacros) {
|
||||
+if (!is_chromeos_lacros && !is_android) {
|
||||
disallowed_extension_deps_ = [
|
||||
# Components should largely not depend on //extensions. Since // extensions
|
||||
# is not a component target and is linked with //chrome, depending on most
|
||||
@@ -686,7 +686,7 @@ test("components_unittests") {
|
||||
# On other platforms, no components should depend on Chrome.
|
||||
# Since //chrome depends on //extensions, we also only assert_no_deps on
|
||||
# extensions targets for non-lacros builds.
|
||||
- if (!is_chromeos_lacros) {
|
||||
+ if (!is_chromeos_lacros && !is_android) {
|
||||
assert_no_deps = [ "//chrome/*" ]
|
||||
assert_no_deps += disallowed_extension_deps_
|
||||
}
|
||||
@@ -966,7 +966,7 @@ if (!is_ios) {
|
||||
# dependency. On other platforms, no components should depend on Chrome.
|
||||
# Since //chrome depends on //extensions, we also only assert_no_deps on
|
||||
# extensions targets for non-lacros builds.
|
||||
- if (!is_chromeos_lacros) {
|
||||
+ if (!is_chromeos_lacros && !is_android) {
|
||||
assert_no_deps = [ "//chrome/*" ]
|
||||
assert_no_deps += disallowed_extension_deps_
|
||||
}
|
||||
diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -36,6 +36,11 @@ found in the LICENSE file.
|
||||
android:summary="@string/accessibility_tab_switcher_summary"
|
||||
android:title="@string/accessibility_tab_switcher_title" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
|
||||
+ android:key="force_tablet_ui"
|
||||
+ android:summary="@string/force_tablet_ui_summary"
|
||||
+ android:title="@string/force_tablet_ui_title" />
|
||||
+
|
||||
<Preference
|
||||
android:key="captions"
|
||||
android:title="@string/accessibility_captions_title"/>
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
@@ -30,6 +30,8 @@ public class AccessibilitySettings
|
||||
public static final String PREF_READER_FOR_ACCESSIBILITY = "reader_for_accessibility";
|
||||
public static final String PREF_CAPTIONS = "captions";
|
||||
|
||||
+ private BooleanPreferenceDelegate mForceTabletUIDelegate;
|
||||
+ static final String PREF_FORCE_TABLET_UI = "force_tablet_ui";
|
||||
private TextScalePreference mTextScalePref;
|
||||
private PageZoomPreference mPageZoomDefaultZoomPref;
|
||||
private ChromeSwitchPreference mPageZoomAlwaysShowPref;
|
||||
@@ -106,6 +108,12 @@ public class AccessibilitySettings
|
||||
getPreferenceScreen().removePreference(readerForAccessibilityPref);
|
||||
}
|
||||
|
||||
+ ChromeBaseCheckBoxPreference forceTabletUiPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_FORCE_TABLET_UI);
|
||||
+ mForceTabletUIDelegate = mDelegate.getForceTabletUIDelegate();
|
||||
+ forceTabletUiPref.setChecked(mForceTabletUIDelegate.isEnabled());
|
||||
+ forceTabletUiPref.setOnPreferenceChangeListener(this);
|
||||
+
|
||||
ChromeBaseCheckBoxPreference accessibilityTabSwitcherPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(
|
||||
AccessibilityConstants.ACCESSIBILITY_TAB_SWITCHER);
|
||||
@@ -162,6 +170,8 @@ public class AccessibilitySettings
|
||||
mFontSizePrefs.setUserFontScaleFactor((Float) newValue);
|
||||
} else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) {
|
||||
mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue);
|
||||
+ } else if (PREF_FORCE_TABLET_UI.equals(preference.getKey())) {
|
||||
+ mForceTabletUIDelegate.setEnabled((Boolean) newValue);
|
||||
} else if (PREF_READER_FOR_ACCESSIBILITY.equals(preference.getKey())) {
|
||||
if (mReaderForAccessibilityDelegate != null) {
|
||||
mReaderForAccessibilityDelegate.setEnabled((Boolean) newValue);
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
@@ -44,6 +44,8 @@ public interface AccessibilitySettingsDelegate {
|
||||
*/
|
||||
BooleanPreferenceDelegate getReaderForAccessibilityDelegate();
|
||||
|
||||
+ BooleanPreferenceDelegate getForceTabletUIDelegate();
|
||||
+
|
||||
/**
|
||||
* Allows the embedder to add more preferences to the preference screen.
|
||||
*
|
||||
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
|
||||
--- a/ui/android/BUILD.gn
|
||||
+++ b/ui/android/BUILD.gn
|
||||
@@ -373,6 +373,8 @@ android_library("ui_no_recycler_view_java") {
|
||||
deps = [
|
||||
":ui_java_resources",
|
||||
":ui_utils_java",
|
||||
+ # dependency for ui_no_recycler_view_java
|
||||
+ "//chrome/browser/preferences:java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
"//build/android:build_java",
|
||||
diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
--- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
+++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
@@ -12,6 +12,8 @@ import androidx.annotation.VisibleForTesting;
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
+import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
|
||||
+import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
|
||||
import org.chromium.ui.R;
|
||||
import org.chromium.ui.display.DisplayAndroid;
|
||||
import org.chromium.ui.display.DisplayUtil;
|
||||
@@ -62,6 +64,9 @@ public class DeviceFormFactor {
|
||||
* E.g. http://developer.samsung.com/samsung-dex/testing
|
||||
*/
|
||||
public static boolean isNonMultiDisplayContextOnTablet(Context context) {
|
||||
+ if (SharedPreferencesManager.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false))
|
||||
+ return true;
|
||||
return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,122 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 7 Sep 2019 15:07:42 +0200
|
||||
Subject: Add option to not persist tabs across sessions
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../android/java/res/xml/privacy_preferences.xml | 5 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 5 ++++-
|
||||
.../privacy/settings/PrivacySettings.java | 16 +++++++++++++++-
|
||||
.../android/strings/android_chrome_strings.grd | 6 ++++++
|
||||
4 files changed, 30 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -45,6 +45,11 @@ found in the LICENSE file.
|
||||
android:title="@string/incognito_settings_title"
|
||||
android:summary="@string/incognito_settings_summary"
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.IncognitoSettings"/>
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="close_tabs_on_exit"
|
||||
+ android:title="@string/close_tabs_on_exit_title"
|
||||
+ android:summary="@string/close_tabs_on_exit_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<Preference
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
|
||||
android:key="do_not_track"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -40,6 +40,7 @@ import androidx.lifecycle.LifecycleRegistry;
|
||||
import org.chromium.base.BuildInfo;
|
||||
import org.chromium.base.CallbackController;
|
||||
import org.chromium.base.CommandLine;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.MemoryPressureListener;
|
||||
@@ -1322,8 +1323,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
boolean hadCipherData =
|
||||
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
|
||||
|
||||
+ String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
|
||||
boolean noRestoreState =
|
||||
- CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE);
|
||||
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE) ||
|
||||
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
|
||||
if (noRestoreState) {
|
||||
// Clear the state files because they are inconsistent and useless from now on.
|
||||
mTabModelOrchestrator.clearState();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -5,6 +5,7 @@
|
||||
package org.chromium.chrome.browser.privacy.settings;
|
||||
|
||||
import android.os.Build;
|
||||
+import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Menu;
|
||||
@@ -15,6 +16,8 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.base.BuildInfo;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
@@ -67,6 +70,8 @@ public class PrivacySettings
|
||||
SharedPreferencesManager.getInstance();
|
||||
private final PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile());
|
||||
|
||||
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
|
||||
+
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
private IncognitoLockSettings mIncognitoLockSettings;
|
||||
|
||||
@@ -132,7 +137,11 @@ public class PrivacySettings
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String key = preference.getKey();
|
||||
- if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
+ if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ } else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
UserPrefs.get(Profile.getLastUsedRegularProfile())
|
||||
.setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
|
||||
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
|
||||
@@ -176,6 +185,11 @@ public class PrivacySettings
|
||||
PreloadPagesSettingsFragment.getPreloadPagesSummaryString(getContext()));
|
||||
}
|
||||
|
||||
+ ChromeSwitchPreference closeTabsOnExitPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
|
||||
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
|
||||
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
|
||||
if (secureDnsPref != null && secureDnsPref.isVisible()) {
|
||||
secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -4415,6 +4415,12 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
|
||||
IMAGE
|
||||
</message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_TITLE" desc="Text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Close all open tabs on exit
|
||||
+ </message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Don't persist tabs between browsing sessions
|
||||
+ </message>
|
||||
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
|
||||
LINK
|
||||
</message>
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,207 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 20 Nov 2021 15:36:54 +0000
|
||||
Subject: Add option to use home page as NTP
|
||||
|
||||
And allow use about:blank as default homepage
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/xml/homepage_preferences.xml | 5 +++++
|
||||
.../chrome/browser/homepage/HomepageManager.java | 16 ++++++++++++++++
|
||||
.../homepage/settings/HomepageSettings.java | 12 ++++++++++++
|
||||
.../chrome/browser/metrics/LaunchMetrics.java | 1 -
|
||||
.../browser/tabmodel/ChromeTabCreator.java | 7 +++++++
|
||||
.../preferences/ChromePreferenceKeys.java | 1 +
|
||||
.../preferences/LegacyChromePreferenceKeys.java | 1 +
|
||||
.../android/strings/android_chrome_strings.grd | 3 +++
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 2 ++
|
||||
chrome/common/pref_names.cc | 4 ++++
|
||||
chrome/common/pref_names.h | 1 +
|
||||
11 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
@@ -14,6 +14,11 @@ found in the LICENSE file.
|
||||
android:summaryOn="@string/text_on"
|
||||
android:summaryOff="@string/text_off" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="ntp_is_homepage_switch"
|
||||
+ android:summaryOn="@string/options_ntp_is_homepage_label"
|
||||
+ android:summaryOff="@string/options_ntp_is_homepage_label" />
|
||||
+
|
||||
<org.chromium.chrome.browser.homepage.settings.RadioButtonGroupHomepagePreference
|
||||
android:key="homepage_radio_group"
|
||||
android:selectable="false"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
@@ -223,6 +223,22 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat
|
||||
notifyHomepageUpdated();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Returns the user preference for whether the New Tab Page is the homepage or not.
|
||||
+ *
|
||||
+ */
|
||||
+ public boolean getPrefNTPIsHomepageEnabled() {
|
||||
+ return mSharedPreferencesManager.readBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the user preference for whether the new tab page is the homepage or not.
|
||||
+ */
|
||||
+ public void setPrefNTPIsHomepageEnabled(boolean enabled) {
|
||||
+ mSharedPreferencesManager.writeBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, enabled);
|
||||
+ notifyHomepageUpdated();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return User specified homepage custom URI string.
|
||||
*/
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
@@ -22,6 +22,7 @@ import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
|
||||
import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||||
import org.chromium.components.embedder_support.util.UrlUtilities;
|
||||
import org.chromium.components.url_formatter.UrlFormatter;
|
||||
+import org.chromium.components.embedder_support.util.UrlConstants;
|
||||
|
||||
/**
|
||||
* Fragment that allows the user to configure homepage related preferences.
|
||||
@@ -32,6 +33,8 @@ public class HomepageSettings extends PreferenceFragmentCompat {
|
||||
@VisibleForTesting
|
||||
public static final String PREF_HOMEPAGE_RADIO_GROUP = "homepage_radio_group";
|
||||
|
||||
+ private static final String PREF_NTP_HOMEPAGE_SWITCH = "ntp_is_homepage_switch";
|
||||
+
|
||||
/**
|
||||
* Delegate used to mark that the homepage is being managed.
|
||||
* Created for {@link org.chromium.chrome.browser.settings.HomepagePreferences}
|
||||
@@ -72,6 +75,15 @@ public class HomepageSettings extends PreferenceFragmentCompat {
|
||||
});
|
||||
mRadioButtons.setupPreferenceValues(createPreferenceValuesForRadioGroup());
|
||||
|
||||
+ ChromeSwitchPreference mNTPIsHomepageSwitch =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
|
||||
+ boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
|
||||
+ mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
|
||||
+ mNTPIsHomepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
+ mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
|
||||
+ return true;
|
||||
+ });
|
||||
+
|
||||
RecordUserAction.record("Settings.Homepage.Opened");
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
@@ -103,7 +103,6 @@ public class LaunchMetrics {
|
||||
boolean showHomeButton, boolean homepageIsNtp, String homepageUrl) {
|
||||
if (homepageUrl == null) {
|
||||
homepageUrl = "";
|
||||
- assert !showHomeButton : "Homepage should be disabled for a null URL";
|
||||
}
|
||||
LaunchMetricsJni.get().recordHomePageLaunchMetrics(
|
||||
showHomeButton, homepageIsNtp, homepageUrl);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
@@ -19,6 +19,7 @@ import org.chromium.chrome.browser.ServiceTabLauncher;
|
||||
import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingDelegateFactory;
|
||||
import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingTask;
|
||||
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
|
||||
+import org.chromium.chrome.browser.homepage.HomepageManager;
|
||||
import org.chromium.chrome.browser.ntp.NewTabPageLaunchOrigin;
|
||||
import org.chromium.chrome.browser.ntp.NewTabPageUtils;
|
||||
import org.chromium.chrome.browser.tab.RedirectHandlerTabHelper;
|
||||
@@ -311,6 +312,12 @@ public class ChromeTabCreator extends TabCreator {
|
||||
* @return the created tab.
|
||||
*/
|
||||
public Tab launchUrl(String url, @TabLaunchType int type, Intent intent, long intentTimestamp) {
|
||||
+ if (!mIncognito && url.equals(UrlConstants.NTP_URL)) {
|
||||
+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ url = HomepageManager.getInstance().getHomepageUri();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
|
||||
loadUrlParams.setIntentReceivedTimestamp(intentTimestamp);
|
||||
return createNewTab(loadUrlParams, type, null, intent);
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
@@ -429,6 +429,7 @@ public final class ChromePreferenceKeys {
|
||||
public static final String HOMEPAGE_PARTNER_CUSTOMIZED_DEFAULT_GURL =
|
||||
"Chrome.Homepage.PartnerCustomizedDefaultGurl";
|
||||
|
||||
+ public static final String HOMEPAGE_NTP_IS_HOMEPAGE = "newtabpage_is_homepage";
|
||||
/**
|
||||
* Key used to save homepage location set by enterprise policy
|
||||
*/
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
@@ -72,6 +72,7 @@ public class LegacyChromePreferenceKeys {
|
||||
ChromePreferenceKeys.HOMEPAGE_CUSTOM_URI,
|
||||
ChromePreferenceKeys.HOMEPAGE_ENABLED,
|
||||
ChromePreferenceKeys.HOMEPAGE_USE_DEFAULT_URI,
|
||||
+ ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE,
|
||||
ChromePreferenceKeys.INCOGNITO_SHORTCUT_ADDED,
|
||||
ChromePreferenceKeys.LATEST_UNSUPPORTED_VERSION,
|
||||
ChromePreferenceKeys.LEGACY_FIRST_RUN_AND_BACKUP_SIGNIN_COMPLETE,
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1254,6 +1254,9 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_HOUR" desc="The option to delete browsing data from the last hour.">
|
||||
Last hour
|
||||
</message>
|
||||
+ <message name="IDS_OPTIONS_NTP_IS_HOMEPAGE_LABEL" desc="The label for switch that allows the user to toggle whether opening a new tab leads to the new tab page or the home page.">
|
||||
+ Use for new tabs
|
||||
+ </message>
|
||||
<message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_24_HOURS" desc="The option to delete browsing data from the last 24 hours.">
|
||||
Last 24 hours
|
||||
</message>
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -65,6 +65,8 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
+ registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false,
|
||||
+ GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
bool reset_check_default = false;
|
||||
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
|
||||
--- a/chrome/common/pref_names.cc
|
||||
+++ b/chrome/common/pref_names.cc
|
||||
@@ -61,6 +61,10 @@ const char kForceEphemeralProfiles[] = "profile.ephemeral_mode";
|
||||
// A boolean specifying whether the New Tab page is the home page or not.
|
||||
const char kHomePageIsNewTabPage[] = "homepage_is_newtabpage";
|
||||
|
||||
+// A boolean specifying whether opening a new tab should open the Home page
|
||||
+// instead of the New Tab page.
|
||||
+const char kNewTabPageIsHomePage[] = "newtabpage_is_homepage";
|
||||
+
|
||||
// This is the URL of the page to load when opening new tabs.
|
||||
const char kHomePage[] = "homepage";
|
||||
|
||||
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -389,6 +389,7 @@ extern const char kRestrictedManagedGuestSessionExtensionCleanupExemptList[];
|
||||
extern const char kUsedPolicyCertificates[];
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
extern const char kShowHomeButton[];
|
||||
+extern const char kNewTabPageIsHomePage[];
|
||||
extern const char kSpeechRecognitionFilterProfanities[];
|
||||
extern const char kAllowDeletingBrowserHistory[];
|
||||
extern const char kForceGoogleSafeSearch[];
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,186 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 2 May 2022 11:48:03 +0000
|
||||
Subject: Add site engagement flag
|
||||
|
||||
Enabled by default.
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++
|
||||
chrome/browser/flag_descriptions.h | 3 ++
|
||||
.../content/site_engagement_score.cc | 5 +++
|
||||
components/site_engagement/core/BUILD.gn | 6 ++++
|
||||
components/site_engagement/core/features.cc | 29 ++++++++++++++++
|
||||
components/site_engagement/core/features.h | 34 +++++++++++++++++++
|
||||
7 files changed, 88 insertions(+)
|
||||
create mode 100644 components/site_engagement/core/features.cc
|
||||
create mode 100644 components/site_engagement/core/features.h
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -144,6 +144,7 @@
|
||||
#include "components/segmentation_platform/public/features.h"
|
||||
#include "components/send_tab_to_self/features.h"
|
||||
#include "components/services/heap_profiling/public/cpp/switches.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
|
||||
#include "components/signin/core/browser/dice_account_reconcilor_delegate.h"
|
||||
#include "components/signin/public/base/signin_buildflags.h"
|
||||
@@ -9283,6 +9284,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kSearchReadyOmniboxDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kSearchReadyOmniboxFeature)},
|
||||
|
||||
+ {"site-engagement",
|
||||
+ flag_descriptions::kSiteEngagementName,
|
||||
+ flag_descriptions::kSiteEngagementDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(site_engagement::features::kSiteEngagement)},
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
{"use-multiple-overlays", flag_descriptions::kUseMultipleOverlaysName,
|
||||
flag_descriptions::kUseMultipleOverlaysDescription, kOsCrOS,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -3407,6 +3407,11 @@ const char kSkipServiceWorkerFetchHandlerDescription[] =
|
||||
"Skips starting the service worker and run the fetch handler if the fetch "
|
||||
"handler is recognized as skippable.";
|
||||
|
||||
+const char kSiteEngagementName[] =
|
||||
+ "Enable site engagement feature";
|
||||
+const char kSiteEngagementDescription[] =
|
||||
+ "Site Engagement Service provides information about how engaged a user is with a origin; this affects which NTP tiles are automatically created.";
|
||||
+
|
||||
const char kWebSQLAccessName[] = "Allows access to WebSQL APIs";
|
||||
const char kWebSQLAccessDescription[] =
|
||||
"The WebSQL API is enabled by default, but can be disabled here.";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1957,6 +1957,9 @@ extern const char kReduceUserAgentPlatformOsCpuDescription[];
|
||||
extern const char kSkipServiceWorkerFetchHandlerName[];
|
||||
extern const char kSkipServiceWorkerFetchHandlerDescription[];
|
||||
|
||||
+extern const char kSiteEngagementName[];
|
||||
+extern const char kSiteEngagementDescription[];
|
||||
+
|
||||
extern const char kWebSQLAccessName[];
|
||||
extern const char kWebSQLAccessDescription[];
|
||||
|
||||
diff --git a/components/site_engagement/content/site_engagement_score.cc b/components/site_engagement/content/site_engagement_score.cc
|
||||
--- a/components/site_engagement/content/site_engagement_score.cc
|
||||
+++ b/components/site_engagement/content/site_engagement_score.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
#include "components/content_settings/core/common/content_settings_utils.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/site_engagement/content/engagement_type.h"
|
||||
#include "components/site_engagement/content/site_engagement_metrics.h"
|
||||
#include "components/variations/variations_associated_data.h"
|
||||
@@ -275,6 +276,10 @@ void SiteEngagementScore::Commit() {
|
||||
if (!UpdateScoreDict(*score_dict_))
|
||||
return;
|
||||
|
||||
+ if (!base::FeatureList::IsEnabled(features::kSiteEngagement)) {
|
||||
+ score_dict_.reset();
|
||||
+ return;
|
||||
+ }
|
||||
settings_map_->SetWebsiteSettingDefaultScope(
|
||||
origin_, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
|
||||
base::Value(std::move(*score_dict_)));
|
||||
diff --git a/components/site_engagement/core/BUILD.gn b/components/site_engagement/core/BUILD.gn
|
||||
--- a/components/site_engagement/core/BUILD.gn
|
||||
+++ b/components/site_engagement/core/BUILD.gn
|
||||
@@ -4,8 +4,14 @@
|
||||
|
||||
static_library("core") {
|
||||
sources = [
|
||||
+ "features.cc",
|
||||
+ "features.h",
|
||||
"pref_names.cc",
|
||||
"pref_names.h",
|
||||
"site_engagement_score_provider.h",
|
||||
]
|
||||
+
|
||||
+ deps = [
|
||||
+ "//base",
|
||||
+ ]
|
||||
}
|
||||
diff --git a/components/site_engagement/core/features.cc b/components/site_engagement/core/features.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/site_engagement/core/features.cc
|
||||
@@ -0,0 +1,29 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
+
|
||||
+#include "base/feature_list.h"
|
||||
+
|
||||
+namespace site_engagement {
|
||||
+namespace features {
|
||||
+
|
||||
+const base::Feature kSiteEngagement{"SiteEngagement",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
+} // namespace features
|
||||
+} // namespace site_engagement
|
||||
diff --git a/components/site_engagement/core/features.h b/components/site_engagement/core/features.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/site_engagement/core/features.h
|
||||
@@ -0,0 +1,34 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#ifndef SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
+#define SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
+
|
||||
+#include <string>
|
||||
+
|
||||
+#include "base/feature_list.h"
|
||||
+
|
||||
+namespace site_engagement {
|
||||
+namespace features {
|
||||
+
|
||||
+// Enable site engagement
|
||||
+extern const base::Feature kSiteEngagement;
|
||||
+
|
||||
+} // namespace features
|
||||
+} // namespace site_engagement
|
||||
+
|
||||
+#endif // SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,53 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 17 May 2021 12:30:12 +0000
|
||||
Subject: Add support for ISupportHelpAndFeedback
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chrome/browser/settings/SettingsActivity.java | 11 ++++++++---
|
||||
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
|
||||
2 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
@@ -66,6 +66,7 @@ import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerFacto
|
||||
import org.chromium.components.browser_ui.modaldialog.AppModalPresenter;
|
||||
import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
|
||||
import org.chromium.components.browser_ui.settings.SettingsLauncher;
|
||||
+import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||||
import org.chromium.components.browser_ui.site_settings.SiteSettingsPreferenceFragment;
|
||||
import org.chromium.components.browser_ui.widget.displaystyle.UiConfig;
|
||||
import org.chromium.components.browser_ui.widget.displaystyle.ViewResizer;
|
||||
@@ -328,9 +329,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
|
||||
finish();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.menu_id_general_help) {
|
||||
- HelpAndFeedbackLauncherImpl.getInstance().show(this,
|
||||
- getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
|
||||
- null);
|
||||
+ if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) {
|
||||
+ ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed();
|
||||
+ } else {
|
||||
+ HelpAndFeedbackLauncherImpl.getInstance().show(this,
|
||||
+ getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
|
||||
+ null);
|
||||
+ }
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
--- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
+++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
@@ -97,4 +97,8 @@ public class SettingsUtils {
|
||||
ToolbarUtils.setOverflowMenuVisibility(toolbar, visibility);
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ public interface ISupportHelpAndFeedback {
|
||||
+ void onHelpAndFeebackPressed();
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,100 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 12 Apr 2022 15:58:01 +0000
|
||||
Subject: Add support for writing URIs
|
||||
|
||||
Allows native-side URI file writing
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
base/android/content_uri_utils.cc | 10 ++++++
|
||||
base/android/content_uri_utils.h | 4 +++
|
||||
.../org/chromium/base/ContentUriUtils.java | 33 +++++++++++++++++++
|
||||
3 files changed, 47 insertions(+)
|
||||
|
||||
diff --git a/base/android/content_uri_utils.cc b/base/android/content_uri_utils.cc
|
||||
--- a/base/android/content_uri_utils.cc
|
||||
+++ b/base/android/content_uri_utils.cc
|
||||
@@ -30,6 +30,16 @@ File OpenContentUriForRead(const FilePath& content_uri) {
|
||||
return File(fd);
|
||||
}
|
||||
|
||||
+File OpenContentUriForWrite(const FilePath& content_uri) {
|
||||
+ JNIEnv* env = base::android::AttachCurrentThread();
|
||||
+ ScopedJavaLocalRef<jstring> j_uri =
|
||||
+ ConvertUTF8ToJavaString(env, content_uri.value());
|
||||
+ jint fd = Java_ContentUriUtils_openContentUriForWrite(env, j_uri);
|
||||
+ if (fd < 0)
|
||||
+ return File();
|
||||
+ return File(fd);
|
||||
+}
|
||||
+
|
||||
std::string GetContentUriMimeType(const FilePath& content_uri) {
|
||||
JNIEnv* env = base::android::AttachCurrentThread();
|
||||
ScopedJavaLocalRef<jstring> j_uri =
|
||||
diff --git a/base/android/content_uri_utils.h b/base/android/content_uri_utils.h
|
||||
--- a/base/android/content_uri_utils.h
|
||||
+++ b/base/android/content_uri_utils.h
|
||||
@@ -18,6 +18,10 @@ namespace base {
|
||||
// Returns -1 if the URI is invalid.
|
||||
BASE_EXPORT File OpenContentUriForRead(const FilePath& content_uri);
|
||||
|
||||
+// Opens a content URI for write and returns the file descriptor to the caller.
|
||||
+// Returns -1 if the URI is invalid.
|
||||
+BASE_EXPORT File OpenContentUriForWrite(const FilePath& content_uri);
|
||||
+
|
||||
// Check whether a content URI exists.
|
||||
BASE_EXPORT bool ContentUriExists(const FilePath& content_uri);
|
||||
|
||||
diff --git a/base/android/java/src/org/chromium/base/ContentUriUtils.java b/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
--- a/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
+++ b/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
@@ -23,6 +23,9 @@ import org.chromium.base.annotations.CalledByNative;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
+import android.system.Os;
|
||||
+import android.content.ContentProviderClient;
|
||||
+
|
||||
/**
|
||||
* This class provides methods to access content URI schemes.
|
||||
*/
|
||||
@@ -89,6 +92,36 @@ public abstract class ContentUriUtils {
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ @CalledByNative
|
||||
+ public static int openContentUriForWrite(String uriString) {
|
||||
+ try {
|
||||
+ Uri uri = Uri.parse(uriString);
|
||||
+ ContentResolver resolver = ContextUtils.getApplicationContext().getContentResolver();
|
||||
+ ContentProviderClient client = resolver.acquireContentProviderClient(
|
||||
+ uri.getAuthority());
|
||||
+ ParcelFileDescriptor pfd = client.openFile(uri, "rw");
|
||||
+ int fd = pfd.detachFd();
|
||||
+ client.close();
|
||||
+ return fd;
|
||||
+ } catch (Exception e) {
|
||||
+ Log.e(TAG, "Cannot open intermediate URI", e);
|
||||
+ }
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ public static String getFilePathFromContentUri(Uri uri) {
|
||||
+ String path = null;
|
||||
+ try {
|
||||
+ ContentResolver resolver = ContextUtils.getApplicationContext().getContentResolver();
|
||||
+ ParcelFileDescriptor pfd = resolver.openFileDescriptor(uri, "r");
|
||||
+ path = Os.readlink("/proc/self/fd/" + pfd.getFd());
|
||||
+ pfd.close();
|
||||
+ } catch (Exception e) {
|
||||
+ Log.e(TAG, "Cannot get file path from content URI", e);
|
||||
+ }
|
||||
+ return path;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Check whether a content URI exists.
|
||||
*
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,505 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 3 May 2022 14:44:11 +0000
|
||||
Subject: Add webGL site setting
|
||||
|
||||
Do not provide any device information when serving context creation errors.
|
||||
|
||||
Requires patch: Content-settings-infrastructure.patch
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser_ui/site_settings/android/BUILD.gn | 3 +
|
||||
.../BromiteCustomContentSettingImpl.java | 1 +
|
||||
.../BromiteWebGLContentSetting.java | 85 +++++++++++++++++++
|
||||
.../site_settings/SiteSettingsCategory.java | 5 +-
|
||||
.../strings/android/browser_ui_strings.grd | 1 +
|
||||
.../browser_ui/strings/android/webgl.grdp | 18 ++++
|
||||
components/components_strings.grd | 1 +
|
||||
.../core/browser/content_settings_registry.cc | 14 +++
|
||||
.../core/browser/content_settings_utils.cc | 2 +
|
||||
.../core/common/content_settings.cc | 4 +-
|
||||
.../core/common/content_settings.h | 1 +
|
||||
.../core/common/content_settings.mojom | 1 +
|
||||
.../common/content_settings_mojom_traits.cc | 3 +-
|
||||
.../common/content_settings_mojom_traits.h | 5 ++
|
||||
.../core/common/content_settings_types.h | 2 +
|
||||
.../renderer/content_settings_agent_impl.cc | 9 ++
|
||||
.../renderer/content_settings_agent_impl.h | 1 +
|
||||
.../platform/web_content_settings_client.h | 2 +
|
||||
.../execution_context/execution_context.cc | 23 +++++
|
||||
.../execution_context/execution_context.h | 5 ++
|
||||
.../webgl/webgl_rendering_context_base.cc | 32 +++----
|
||||
.../webgl/webgl_rendering_context_base.h | 2 +
|
||||
22 files changed, 197 insertions(+), 23 deletions(-)
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java
|
||||
create mode 100644 components/browser_ui/strings/android/webgl.grdp
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
--- a/components/browser_ui/site_settings/android/BUILD.gn
|
||||
+++ b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
@@ -92,6 +92,9 @@ android_library("java") {
|
||||
"java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java",
|
||||
"java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java",
|
||||
]
|
||||
+ sources += [
|
||||
+ "java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java",
|
||||
+ ]
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
resources_package = "org.chromium.components.browser_ui.site_settings"
|
||||
deps = [
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
@@ -43,6 +43,7 @@ public abstract class BromiteCustomContentSettingImpl {
|
||||
|
||||
static {
|
||||
mItemList = new ArrayList<BromiteCustomContentSetting>();
|
||||
+ mItemList.add(new BromiteWebGLContentSetting());
|
||||
}
|
||||
|
||||
public static SiteSettingsCategory createFromType(
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java
|
||||
@@ -0,0 +1,85 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.components.browser_ui.site_settings;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
|
||||
+import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||||
+import org.chromium.components.content_settings.ContentSettingValues;
|
||||
+import org.chromium.components.content_settings.ContentSettingsType;
|
||||
+import org.chromium.content_public.browser.BrowserContextHandle;
|
||||
+
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+
|
||||
+public class BromiteWebGLContentSetting extends BromiteCustomContentSetting {
|
||||
+ public BromiteWebGLContentSetting() {
|
||||
+ super(/*contentSettingsType*/ ContentSettingsType.WEBGL,
|
||||
+ /*siteSettingsCategory*/ SiteSettingsCategory.Type.WEBGL,
|
||||
+ /*defaultEnabledValue*/ ContentSettingValues.ALLOW,
|
||||
+ /*defaultDisabledValue*/ ContentSettingValues.BLOCK,
|
||||
+ /*allowException*/ true,
|
||||
+ /*preferenceKey*/ "webgl",
|
||||
+ /*profilePrefKey*/ "webgl");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ContentSettingsResources.ResourceItem getResourceItem() {
|
||||
+ return new ContentSettingsResources.ResourceItem(
|
||||
+ /*icon*/ R.drawable.web_asset,
|
||||
+ /*title*/ R.string.webgl_permission_title,
|
||||
+ /*defaultEnabledValue*/ getDefaultEnabledValue(),
|
||||
+ /*defaultDisabledValue*/ getDefaultDisabledValue(),
|
||||
+ /*enabledSummary*/ R.string.website_settings_category_webgl_enabled,
|
||||
+ /*disabledSummary*/ R.string.website_settings_category_webgl_disabled);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategorySummary(@Nullable @ContentSettingValues int value) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_webgl_enabled;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_webgl_disabled;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean requiresTriStateContentSetting() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean showOnlyDescriptions() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAddExceptionDialogMessage() {
|
||||
+ return R.string.website_settings_category_webgl_enabled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) {
|
||||
+ return value != ContentSettingValues.BLOCK;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
@@ -44,7 +44,7 @@ public class SiteSettingsCategory {
|
||||
Type.PROTECTED_MEDIA, Type.SENSORS, Type.SOUND, Type.USB, Type.VIRTUAL_REALITY,
|
||||
Type.USE_STORAGE, Type.AUTO_DARK_WEB_CONTENT, Type.REQUEST_DESKTOP_SITE,
|
||||
Type.FEDERATED_IDENTITY_API, Type.TIMEZONE_OVERRIDE, Type.AUTOPLAY, Type.JAVASCRIPT_JIT,
|
||||
- Type.IMAGES})
|
||||
+ Type.IMAGES, Type.WEBGL})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Type {
|
||||
// All updates here must also be reflected in {@link #preferenceKey(int)
|
||||
@@ -79,10 +79,11 @@ public class SiteSettingsCategory {
|
||||
int AUTOPLAY = 27;
|
||||
int JAVASCRIPT_JIT = 28;
|
||||
int IMAGES = 29;
|
||||
+ int WEBGL = 30;
|
||||
/**
|
||||
* Number of handled categories used for calculating array sizes.
|
||||
*/
|
||||
- int NUM_ENTRIES = 30;
|
||||
+ int NUM_ENTRIES = 31;
|
||||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
--- a/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
+++ b/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
@@ -174,6 +174,7 @@
|
||||
<release seq="1">
|
||||
<messages fallback_to_english="true">
|
||||
<part file="site_settings.grdp" />
|
||||
+ <part file="webgl.grdp" />
|
||||
|
||||
<message name="IDS_GOT_IT" desc="Button for the user to accept a disclosure/message" formatter_data="android_java">
|
||||
Got it
|
||||
diff --git a/components/browser_ui/strings/android/webgl.grdp b/components/browser_ui/strings/android/webgl.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/strings/android/webgl.grdp
|
||||
@@ -0,0 +1,18 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBGL" desc="The label used for webgl site settings controls.">
|
||||
+ Webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBGL_MID_SENTENCE" desc="The label used for webgl site settings controls when used mid-sentence.">
|
||||
+ webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBGL_PERMISSION_TITLE" desc="Title of the permission to use webgl [CHAR-LIMIT=32]">
|
||||
+ Webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_ENABLED" desc="Summary text explaining that webgl is full enabled.">
|
||||
+ Enabled
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_DISABLED" desc="Summary text explaining that webgl is full disabled.">
|
||||
+ Disabled
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/components_strings.grd b/components/components_strings.grd
|
||||
--- a/components/components_strings.grd
|
||||
+++ b/components/components_strings.grd
|
||||
@@ -338,6 +338,7 @@
|
||||
<part file="version_ui_strings.grdp" />
|
||||
<part file="webapps_strings.grdp" />
|
||||
|
||||
+ <part file="browser_ui/strings/android/webgl.grdp" />
|
||||
<if expr="not is_ios">
|
||||
<part file="history_clusters_strings.grdp" />
|
||||
</if>
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -633,6 +633,20 @@ void ContentSettingsRegistry::Init() {
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
ContentSettingsInfo::PERSISTENT,
|
||||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
|
||||
+
|
||||
+ Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_BLOCK,
|
||||
+ WebsiteSettingsInfo::SYNCABLE,
|
||||
+ AllowlistedSchemes(),
|
||||
+ ValidSettings(CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK),
|
||||
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
+ WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
+ ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
+ ContentSettingsInfo::PERSISTENT,
|
||||
+ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS,
|
||||
+ /*show_into_info_page*/ true,
|
||||
+ /*permission_type_ui*/ IDS_SITE_SETTINGS_TYPE_WEBGL,
|
||||
+ /*permission_type_ui_mid_sentence*/ IDS_SITE_SETTINGS_TYPE_WEBGL_MID_SENTENCE);
|
||||
}
|
||||
|
||||
void ContentSettingsRegistry::Register(
|
||||
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_utils.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_utils.cc
|
||||
@@ -156,6 +156,8 @@ void GetRendererContentSettingRules(const HostContentSettingsMap* map,
|
||||
std::string timezone;
|
||||
map->GetTimezoneOverrideValue(timezone);
|
||||
rules->timezone_override_value = timezone;
|
||||
+ map->GetSettingsForOneType(ContentSettingsType::WEBGL,
|
||||
+ &(rules->webgl_rules));
|
||||
}
|
||||
|
||||
bool IsMorePermissive(ContentSetting a, ContentSetting b) {
|
||||
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc
|
||||
--- a/components/content_settings/core/common/content_settings.cc
|
||||
+++ b/components/content_settings/core/common/content_settings.cc
|
||||
@@ -208,7 +208,8 @@ bool RendererContentSettingRules::IsRendererContentSetting(
|
||||
content_type == ContentSettingsType::AUTOPLAY ||
|
||||
content_type == ContentSettingsType::MIXEDSCRIPT ||
|
||||
content_type == ContentSettingsType::AUTO_DARK_WEB_CONTENT ||
|
||||
- content_type == ContentSettingsType::TIMEZONE_OVERRIDE;
|
||||
+ content_type == ContentSettingsType::TIMEZONE_OVERRIDE ||
|
||||
+ content_type == ContentSettingsType::WEBGL;
|
||||
}
|
||||
|
||||
void RendererContentSettingRules::FilterRulesByOutermostMainFrameURL(
|
||||
@@ -220,6 +221,7 @@ void RendererContentSettingRules::FilterRulesByOutermostMainFrameURL(
|
||||
FilterRulesForType(auto_dark_content_rules, outermost_main_frame_url);
|
||||
FilterRulesForType(timezone_override_rules, outermost_main_frame_url);
|
||||
FilterRulesForType(autoplay_rules, outermost_main_frame_url);
|
||||
+ FilterRulesForType(webgl_rules, outermost_main_frame_url);
|
||||
}
|
||||
|
||||
RendererContentSettingRules::RendererContentSettingRules() = default;
|
||||
diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h
|
||||
--- a/components/content_settings/core/common/content_settings.h
|
||||
+++ b/components/content_settings/core/common/content_settings.h
|
||||
@@ -96,6 +96,7 @@ struct RendererContentSettingRules {
|
||||
ContentSettingsForOneType auto_dark_content_rules;
|
||||
ContentSettingsForOneType timezone_override_rules;
|
||||
std::string timezone_override_value;
|
||||
+ ContentSettingsForOneType webgl_rules;
|
||||
};
|
||||
|
||||
namespace content_settings {
|
||||
diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom
|
||||
--- a/components/content_settings/core/common/content_settings.mojom
|
||||
+++ b/components/content_settings/core/common/content_settings.mojom
|
||||
@@ -81,4 +81,5 @@ struct RendererContentSettingRules {
|
||||
array<ContentSettingPatternSource> auto_dark_content_rules;
|
||||
array<ContentSettingPatternSource> timezone_override_rules;
|
||||
string timezone_override_value;
|
||||
+ array<ContentSettingPatternSource> webgl_rules;
|
||||
};
|
||||
diff --git a/components/content_settings/core/common/content_settings_mojom_traits.cc b/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
--- a/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
+++ b/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
@@ -105,7 +105,8 @@ bool StructTraits<content_settings::mojom::RendererContentSettingRulesDataView,
|
||||
data.ReadMixedContentRules(&out->mixed_content_rules) &&
|
||||
data.ReadAutoDarkContentRules(&out->auto_dark_content_rules) &&
|
||||
data.ReadTimezoneOverrideRules(&out->timezone_override_rules) &&
|
||||
- data.ReadTimezoneOverrideValue(&out->timezone_override_value);
|
||||
+ data.ReadTimezoneOverrideValue(&out->timezone_override_value) &&
|
||||
+ data.ReadWebglRules(&out->webgl_rules);
|
||||
}
|
||||
|
||||
} // namespace mojo
|
||||
diff --git a/components/content_settings/core/common/content_settings_mojom_traits.h b/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
--- a/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
+++ b/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
@@ -165,6 +165,11 @@ struct StructTraits<
|
||||
return r.timezone_override_value;
|
||||
}
|
||||
|
||||
+ static const std::vector<ContentSettingPatternSource>& webgl_rules(
|
||||
+ const RendererContentSettingRules& r) {
|
||||
+ return r.webgl_rules;
|
||||
+ }
|
||||
+
|
||||
static bool Read(
|
||||
content_settings::mojom::RendererContentSettingRulesDataView data,
|
||||
RendererContentSettingRules* out);
|
||||
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h
|
||||
--- a/components/content_settings/core/common/content_settings_types.h
|
||||
+++ b/components/content_settings/core/common/content_settings_types.h
|
||||
@@ -277,6 +277,8 @@ enum class ContentSettingsType : int32_t {
|
||||
// site instead of the mobile one.
|
||||
REQUEST_DESKTOP_SITE,
|
||||
|
||||
+ WEBGL,
|
||||
+
|
||||
// Setting to indicate whether browser should allow signing into a website via
|
||||
// the browser FedCM API.
|
||||
FEDERATED_IDENTITY_API,
|
||||
diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
--- a/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
+++ b/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
@@ -449,6 +449,15 @@ void ContentSettingsAgentImpl::ClearBlockedContentSettings() {
|
||||
cached_script_permissions_.clear();
|
||||
}
|
||||
|
||||
+bool ContentSettingsAgentImpl::AllowWebgl(bool enabled_per_settings) {
|
||||
+ if (!content_setting_rules_)
|
||||
+ return false;
|
||||
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
+ return CONTENT_SETTING_ALLOW == GetContentSettingFromRules(
|
||||
+ content_setting_rules_->webgl_rules,
|
||||
+ url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL());
|
||||
+}
|
||||
+
|
||||
bool ContentSettingsAgentImpl::IsAllowlistedForContentSettings() const {
|
||||
if (should_allowlist_)
|
||||
return true;
|
||||
diff --git a/components/content_settings/renderer/content_settings_agent_impl.h b/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
--- a/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
+++ b/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
@@ -99,6 +99,7 @@ class ContentSettingsAgentImpl
|
||||
bool AllowAutoplay(bool default_value) override;
|
||||
bool AllowPopupsAndRedirects(bool default_value) override;
|
||||
bool ShouldAutoupgradeMixedContent() override;
|
||||
+ bool AllowWebgl(bool enabled_per_settings) override;
|
||||
|
||||
bool allow_running_insecure_content() const {
|
||||
return allow_running_insecure_content_;
|
||||
diff --git a/third_party/blink/public/platform/web_content_settings_client.h b/third_party/blink/public/platform/web_content_settings_client.h
|
||||
--- a/third_party/blink/public/platform/web_content_settings_client.h
|
||||
+++ b/third_party/blink/public/platform/web_content_settings_client.h
|
||||
@@ -99,6 +99,8 @@ class WebContentSettingsClient {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
+ virtual bool AllowWebgl(bool default_value) { return default_value; }
|
||||
+
|
||||
// Reports that passive mixed content was found at the provided URL.
|
||||
virtual void PassiveInsecureContentFound(const WebURL&) {}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
@@ -67,6 +67,29 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
+blink::WebContentSettingsClient* GetContentSettingsClientFor(
|
||||
+ ExecutionContext* context) {
|
||||
+ blink::WebContentSettingsClient* settings = nullptr;
|
||||
+ if (!context)
|
||||
+ return settings;
|
||||
+ if (auto* window = blink::DynamicTo<blink::LocalDOMWindow>(context)) {
|
||||
+ auto* frame = window->GetFrame();
|
||||
+ if (frame)
|
||||
+ settings = frame->GetContentSettingsClient();
|
||||
+ } else if (context->IsWorkerGlobalScope()) {
|
||||
+ settings =
|
||||
+ blink::To<blink::WorkerGlobalScope>(context)->ContentSettingsClient();
|
||||
+ }
|
||||
+ return settings;
|
||||
+}
|
||||
+
|
||||
+bool AllowWebgl(ExecutionContext* context) {
|
||||
+ blink::WebContentSettingsClient* settings = GetContentSettingsClientFor(context);
|
||||
+ if (settings)
|
||||
+ return settings->AllowWebgl(false);
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
ExecutionContext::ExecutionContext(v8::Isolate* isolate, Agent* agent)
|
||||
: isolate_(isolate),
|
||||
security_context_(this),
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
@@ -101,6 +101,7 @@ class SecurityOrigin;
|
||||
class ScriptState;
|
||||
class ScriptWrappable;
|
||||
class TrustedTypePolicyFactory;
|
||||
+class WebContentSettingsClient;
|
||||
|
||||
enum ReasonForCallingCanExecuteScripts {
|
||||
kAboutToExecuteScript,
|
||||
@@ -109,6 +110,10 @@ enum ReasonForCallingCanExecuteScripts {
|
||||
|
||||
enum ReferrerPolicySource { kPolicySourceHttpHeader, kPolicySourceMetaTag };
|
||||
|
||||
+CORE_EXPORT bool AllowWebgl(ExecutionContext* context);
|
||||
+CORE_EXPORT WebContentSettingsClient* GetContentSettingsClientFor(
|
||||
+ ExecutionContext* context);
|
||||
+
|
||||
// An environment in which script can execute. This class exposes the common
|
||||
// properties of script execution environments on the web (i.e, common between
|
||||
// script executing in a window and script executing in a worker), such as:
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
@@ -246,6 +246,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits(
|
||||
}
|
||||
}
|
||||
|
||||
+bool WebGLRenderingContextBase::AllowWebglForHost(blink::CanvasRenderingContextHost* host) {
|
||||
+ if (!host)
|
||||
+ return false;
|
||||
+ blink::ExecutionContext* context = host->GetTopExecutionContext();
|
||||
+ return blink::AllowWebgl(context);
|
||||
+}
|
||||
+
|
||||
unsigned WebGLRenderingContextBase::CurrentMaxGLContexts() {
|
||||
base::AutoLock locker(WebGLContextLimitLock());
|
||||
DCHECK(webgl_context_limits_initialized_);
|
||||
@@ -492,25 +499,6 @@ static String ExtractWebGLContextCreationError(
|
||||
const Platform::GraphicsInfo& info) {
|
||||
StringBuilder builder;
|
||||
builder.Append("Could not create a WebGL context");
|
||||
- FormatWebGLStatusString(
|
||||
- "VENDOR",
|
||||
- info.vendor_id ? String::Format("0x%04x", info.vendor_id) : "0xffff",
|
||||
- builder);
|
||||
- FormatWebGLStatusString(
|
||||
- "DEVICE",
|
||||
- info.device_id ? String::Format("0x%04x", info.device_id) : "0xffff",
|
||||
- builder);
|
||||
- FormatWebGLStatusString("GL_VENDOR", info.vendor_info, builder);
|
||||
- FormatWebGLStatusString("GL_RENDERER", info.renderer_info, builder);
|
||||
- FormatWebGLStatusString("GL_VERSION", info.driver_version, builder);
|
||||
- FormatWebGLStatusString("Sandboxed", info.sandboxed ? "yes" : "no", builder);
|
||||
- FormatWebGLStatusString("Optimus", info.optimus ? "yes" : "no", builder);
|
||||
- FormatWebGLStatusString("AMD switchable", info.amd_switchable ? "yes" : "no",
|
||||
- builder);
|
||||
- FormatWebGLStatusString(
|
||||
- "Reset notification strategy",
|
||||
- String::Format("0x%04x", info.reset_notification_strategy).Utf8().c_str(),
|
||||
- builder);
|
||||
FormatWebGLStatusString("ErrorMessage", info.error_message.Utf8().c_str(),
|
||||
builder);
|
||||
builder.Append('.');
|
||||
@@ -579,6 +567,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider(
|
||||
const CanvasContextCreationAttributesCore& attributes,
|
||||
Platform::ContextType context_type,
|
||||
Platform::GraphicsInfo* graphics_info) {
|
||||
+ if (!AllowWebglForHost(host)) {
|
||||
+ host->HostDispatchEvent(WebGLContextEvent::Create(
|
||||
+ event_type_names::kWebglcontextcreationerror,
|
||||
+ "disabled by site settings policy."));
|
||||
+ return nullptr;
|
||||
+ }
|
||||
if ((context_type == Platform::kWebGL1ContextType &&
|
||||
!host->IsWebGL1Enabled()) ||
|
||||
(context_type == Platform::kWebGL2ContextType &&
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
@@ -1920,6 +1920,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
|
||||
DOMArrayBufferView* pixels,
|
||||
int64_t offset);
|
||||
|
||||
+ static bool AllowWebglForHost(blink::CanvasRenderingContextHost* host);
|
||||
+
|
||||
// Record Canvas/OffscreenCanvas.RenderingContextDrawnTo at the first draw
|
||||
// call.
|
||||
void RecordUKMCanvasDrawnToAtFirstDrawCall();
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,401 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Fri, 6 May 2022 14:27:17 +0000
|
||||
Subject: Add webRTC site settings
|
||||
|
||||
Requires patch: Content-settings-infrastructure.patch
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser_ui/site_settings/android/BUILD.gn | 3 +
|
||||
.../BromiteCustomContentSettingImpl.java | 1 +
|
||||
.../BromiteWebRTCContentSetting.java | 86 +++++++++++++++++++
|
||||
.../site_settings/SiteSettingsCategory.java | 5 +-
|
||||
.../strings/android/browser_ui_strings.grd | 1 +
|
||||
.../browser_ui/strings/android/webrtc.grdp | 18 ++++
|
||||
components/components_strings.grd | 1 +
|
||||
.../core/browser/content_settings_registry.cc | 14 +++
|
||||
.../core/browser/content_settings_utils.cc | 2 +
|
||||
.../core/common/content_settings.cc | 4 +-
|
||||
.../core/common/content_settings.h | 1 +
|
||||
.../core/common/content_settings.mojom | 1 +
|
||||
.../common/content_settings_mojom_traits.cc | 3 +-
|
||||
.../common/content_settings_mojom_traits.h | 5 ++
|
||||
.../core/common/content_settings_types.h | 2 +
|
||||
.../renderer/content_settings_agent_impl.cc | 9 ++
|
||||
.../renderer/content_settings_agent_impl.h | 1 +
|
||||
.../platform/web_content_settings_client.h | 2 +
|
||||
.../peer_connection_dependency_factory.cc | 6 ++
|
||||
19 files changed, 161 insertions(+), 4 deletions(-)
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebRTCContentSetting.java
|
||||
create mode 100644 components/browser_ui/strings/android/webrtc.grdp
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
--- a/components/browser_ui/site_settings/android/BUILD.gn
|
||||
+++ b/components/browser_ui/site_settings/android/BUILD.gn
|
||||
@@ -95,6 +95,9 @@ android_library("java") {
|
||||
sources += [
|
||||
"java/src/org/chromium/components/browser_ui/site_settings/BromiteWebGLContentSetting.java",
|
||||
]
|
||||
+ sources += [
|
||||
+ "java/src/org/chromium/components/browser_ui/site_settings/BromiteWebRTCContentSetting.java",
|
||||
+ ]
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
resources_package = "org.chromium.components.browser_ui.site_settings"
|
||||
deps = [
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
|
||||
@@ -44,6 +44,7 @@ public abstract class BromiteCustomContentSettingImpl {
|
||||
static {
|
||||
mItemList = new ArrayList<BromiteCustomContentSetting>();
|
||||
mItemList.add(new BromiteWebGLContentSetting());
|
||||
+ mItemList.add(new BromiteWebRTCContentSetting());
|
||||
}
|
||||
|
||||
public static SiteSettingsCategory createFromType(
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebRTCContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebRTCContentSetting.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteWebRTCContentSetting.java
|
||||
@@ -0,0 +1,86 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.components.browser_ui.site_settings;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
|
||||
+import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||||
+import org.chromium.components.content_settings.ContentSettingValues;
|
||||
+import org.chromium.components.content_settings.ContentSettingsType;
|
||||
+import org.chromium.content_public.browser.BrowserContextHandle;
|
||||
+
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+
|
||||
+public class BromiteWebRTCContentSetting extends BromiteCustomContentSetting {
|
||||
+ public BromiteWebRTCContentSetting() {
|
||||
+ super(/*contentSettingsType*/ ContentSettingsType.WEBRTC,
|
||||
+ /*siteSettingsCategory*/ SiteSettingsCategory.Type.WEBRTC,
|
||||
+ /*defaultEnabledValue*/ ContentSettingValues.ALLOW,
|
||||
+ /*defaultDisabledValue*/ ContentSettingValues.BLOCK,
|
||||
+ /*allowException*/ true,
|
||||
+ /*preferenceKey*/ "webrtc",
|
||||
+ /*profilePrefKey*/ "webrtc");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ContentSettingsResources.ResourceItem getResourceItem() {
|
||||
+ return new ContentSettingsResources.ResourceItem(
|
||||
+ /*icon*/ R.drawable.web_asset,
|
||||
+ /*title*/ R.string.webrtc_permission_title,
|
||||
+ /*defaultEnabledValue*/ getDefaultEnabledValue(),
|
||||
+ /*defaultDisabledValue*/ getDefaultDisabledValue(),
|
||||
+ /*enabledSummary*/ R.string.website_settings_category_webrtc_enabled,
|
||||
+ /*disabledSummary*/ R.string.website_settings_category_webrtc_disabled);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategorySummary(@Nullable @ContentSettingValues int value) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_webrtc_enabled;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_webrtc_disabled;
|
||||
+ default:
|
||||
+ // this will cause a runtime exception
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean requiresTriStateContentSetting() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean showOnlyDescriptions() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAddExceptionDialogMessage() {
|
||||
+ return R.string.website_settings_category_webrtc_enabled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) {
|
||||
+ return value != ContentSettingValues.BLOCK;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java
|
||||
@@ -44,7 +44,7 @@ public class SiteSettingsCategory {
|
||||
Type.PROTECTED_MEDIA, Type.SENSORS, Type.SOUND, Type.USB, Type.VIRTUAL_REALITY,
|
||||
Type.USE_STORAGE, Type.AUTO_DARK_WEB_CONTENT, Type.REQUEST_DESKTOP_SITE,
|
||||
Type.FEDERATED_IDENTITY_API, Type.TIMEZONE_OVERRIDE, Type.AUTOPLAY, Type.JAVASCRIPT_JIT,
|
||||
- Type.IMAGES, Type.WEBGL})
|
||||
+ Type.IMAGES, Type.WEBGL, Type.WEBRTC})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Type {
|
||||
// All updates here must also be reflected in {@link #preferenceKey(int)
|
||||
@@ -80,10 +80,11 @@ public class SiteSettingsCategory {
|
||||
int JAVASCRIPT_JIT = 28;
|
||||
int IMAGES = 29;
|
||||
int WEBGL = 30;
|
||||
+ int WEBRTC = 31;
|
||||
/**
|
||||
* Number of handled categories used for calculating array sizes.
|
||||
*/
|
||||
- int NUM_ENTRIES = 31;
|
||||
+ int NUM_ENTRIES = 32;
|
||||
}
|
||||
|
||||
private final BrowserContextHandle mBrowserContextHandle;
|
||||
diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
--- a/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
+++ b/components/browser_ui/strings/android/browser_ui_strings.grd
|
||||
@@ -175,6 +175,7 @@
|
||||
<messages fallback_to_english="true">
|
||||
<part file="site_settings.grdp" />
|
||||
<part file="webgl.grdp" />
|
||||
+ <part file="webrtc.grdp" />
|
||||
|
||||
<message name="IDS_GOT_IT" desc="Button for the user to accept a disclosure/message" formatter_data="android_java">
|
||||
Got it
|
||||
diff --git a/components/browser_ui/strings/android/webrtc.grdp b/components/browser_ui/strings/android/webrtc.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/strings/android/webrtc.grdp
|
||||
@@ -0,0 +1,18 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBRTC" desc="The label used for webrtc site settings controls.">
|
||||
+ WebRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBRTC_MID_SENTENCE" desc="The label used for webrtc site settings controls when used mid-sentence.">
|
||||
+ webRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBRTC_PERMISSION_TITLE" desc="Title of the permission to use webrtc [CHAR-LIMIT=32]">
|
||||
+ WebRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_ENABLED" desc="Summary text explaining that webrtc is full enabled.">
|
||||
+ Enabled
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_DISABLED" desc="Summary text explaining that webrtc is full disabled.">
|
||||
+ Disabled
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/components_strings.grd b/components/components_strings.grd
|
||||
--- a/components/components_strings.grd
|
||||
+++ b/components/components_strings.grd
|
||||
@@ -339,6 +339,7 @@
|
||||
<part file="webapps_strings.grdp" />
|
||||
|
||||
<part file="browser_ui/strings/android/webgl.grdp" />
|
||||
+ <part file="browser_ui/strings/android/webrtc.grdp" />
|
||||
<if expr="not is_ios">
|
||||
<part file="history_clusters_strings.grdp" />
|
||||
</if>
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -647,6 +647,20 @@ void ContentSettingsRegistry::Init() {
|
||||
/*show_into_info_page*/ true,
|
||||
/*permission_type_ui*/ IDS_SITE_SETTINGS_TYPE_WEBGL,
|
||||
/*permission_type_ui_mid_sentence*/ IDS_SITE_SETTINGS_TYPE_WEBGL_MID_SENTENCE);
|
||||
+
|
||||
+ Register(ContentSettingsType::WEBRTC, "webrtc", CONTENT_SETTING_BLOCK,
|
||||
+ WebsiteSettingsInfo::SYNCABLE,
|
||||
+ AllowlistedSchemes(),
|
||||
+ ValidSettings(CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK),
|
||||
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
+ WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
+ ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
+ ContentSettingsInfo::PERSISTENT,
|
||||
+ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS,
|
||||
+ /*show_into_info_page*/ true,
|
||||
+ /*permission_type_ui*/ IDS_SITE_SETTINGS_TYPE_WEBRTC,
|
||||
+ /*permission_type_ui_mid_sentence*/ IDS_SITE_SETTINGS_TYPE_WEBRTC_MID_SENTENCE);
|
||||
}
|
||||
|
||||
void ContentSettingsRegistry::Register(
|
||||
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_utils.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_utils.cc
|
||||
@@ -158,6 +158,8 @@ void GetRendererContentSettingRules(const HostContentSettingsMap* map,
|
||||
rules->timezone_override_value = timezone;
|
||||
map->GetSettingsForOneType(ContentSettingsType::WEBGL,
|
||||
&(rules->webgl_rules));
|
||||
+ map->GetSettingsForOneType(ContentSettingsType::WEBRTC,
|
||||
+ &(rules->webrtc_rules));
|
||||
}
|
||||
|
||||
bool IsMorePermissive(ContentSetting a, ContentSetting b) {
|
||||
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc
|
||||
--- a/components/content_settings/core/common/content_settings.cc
|
||||
+++ b/components/content_settings/core/common/content_settings.cc
|
||||
@@ -209,7 +209,8 @@ bool RendererContentSettingRules::IsRendererContentSetting(
|
||||
content_type == ContentSettingsType::MIXEDSCRIPT ||
|
||||
content_type == ContentSettingsType::AUTO_DARK_WEB_CONTENT ||
|
||||
content_type == ContentSettingsType::TIMEZONE_OVERRIDE ||
|
||||
- content_type == ContentSettingsType::WEBGL;
|
||||
+ content_type == ContentSettingsType::WEBGL ||
|
||||
+ content_type == ContentSettingsType::WEBRTC;
|
||||
}
|
||||
|
||||
void RendererContentSettingRules::FilterRulesByOutermostMainFrameURL(
|
||||
@@ -222,6 +223,7 @@ void RendererContentSettingRules::FilterRulesByOutermostMainFrameURL(
|
||||
FilterRulesForType(timezone_override_rules, outermost_main_frame_url);
|
||||
FilterRulesForType(autoplay_rules, outermost_main_frame_url);
|
||||
FilterRulesForType(webgl_rules, outermost_main_frame_url);
|
||||
+ FilterRulesForType(webrtc_rules, outermost_main_frame_url);
|
||||
}
|
||||
|
||||
RendererContentSettingRules::RendererContentSettingRules() = default;
|
||||
diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h
|
||||
--- a/components/content_settings/core/common/content_settings.h
|
||||
+++ b/components/content_settings/core/common/content_settings.h
|
||||
@@ -97,6 +97,7 @@ struct RendererContentSettingRules {
|
||||
ContentSettingsForOneType timezone_override_rules;
|
||||
std::string timezone_override_value;
|
||||
ContentSettingsForOneType webgl_rules;
|
||||
+ ContentSettingsForOneType webrtc_rules;
|
||||
};
|
||||
|
||||
namespace content_settings {
|
||||
diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom
|
||||
--- a/components/content_settings/core/common/content_settings.mojom
|
||||
+++ b/components/content_settings/core/common/content_settings.mojom
|
||||
@@ -82,4 +82,5 @@ struct RendererContentSettingRules {
|
||||
array<ContentSettingPatternSource> timezone_override_rules;
|
||||
string timezone_override_value;
|
||||
array<ContentSettingPatternSource> webgl_rules;
|
||||
+ array<ContentSettingPatternSource> webrtc_rules;
|
||||
};
|
||||
diff --git a/components/content_settings/core/common/content_settings_mojom_traits.cc b/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
--- a/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
+++ b/components/content_settings/core/common/content_settings_mojom_traits.cc
|
||||
@@ -106,7 +106,8 @@ bool StructTraits<content_settings::mojom::RendererContentSettingRulesDataView,
|
||||
data.ReadAutoDarkContentRules(&out->auto_dark_content_rules) &&
|
||||
data.ReadTimezoneOverrideRules(&out->timezone_override_rules) &&
|
||||
data.ReadTimezoneOverrideValue(&out->timezone_override_value) &&
|
||||
- data.ReadWebglRules(&out->webgl_rules);
|
||||
+ data.ReadWebglRules(&out->webgl_rules) &&
|
||||
+ data.ReadWebrtcRules(&out->webrtc_rules);
|
||||
}
|
||||
|
||||
} // namespace mojo
|
||||
diff --git a/components/content_settings/core/common/content_settings_mojom_traits.h b/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
--- a/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
+++ b/components/content_settings/core/common/content_settings_mojom_traits.h
|
||||
@@ -170,6 +170,11 @@ struct StructTraits<
|
||||
return r.webgl_rules;
|
||||
}
|
||||
|
||||
+ static const std::vector<ContentSettingPatternSource>& webrtc_rules(
|
||||
+ const RendererContentSettingRules& r) {
|
||||
+ return r.webrtc_rules;
|
||||
+ }
|
||||
+
|
||||
static bool Read(
|
||||
content_settings::mojom::RendererContentSettingRulesDataView data,
|
||||
RendererContentSettingRules* out);
|
||||
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h
|
||||
--- a/components/content_settings/core/common/content_settings_types.h
|
||||
+++ b/components/content_settings/core/common/content_settings_types.h
|
||||
@@ -279,6 +279,8 @@ enum class ContentSettingsType : int32_t {
|
||||
|
||||
WEBGL,
|
||||
|
||||
+ WEBRTC,
|
||||
+
|
||||
// Setting to indicate whether browser should allow signing into a website via
|
||||
// the browser FedCM API.
|
||||
FEDERATED_IDENTITY_API,
|
||||
diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
--- a/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
+++ b/components/content_settings/renderer/content_settings_agent_impl.cc
|
||||
@@ -458,6 +458,15 @@ bool ContentSettingsAgentImpl::AllowWebgl(bool enabled_per_settings) {
|
||||
url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL());
|
||||
}
|
||||
|
||||
+bool ContentSettingsAgentImpl::AllowWebRTC(bool enabled_per_settings) {
|
||||
+ if (!content_setting_rules_)
|
||||
+ return false;
|
||||
+ blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
||||
+ return CONTENT_SETTING_ALLOW == GetContentSettingFromRules(
|
||||
+ content_setting_rules_->webrtc_rules,
|
||||
+ url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL());
|
||||
+}
|
||||
+
|
||||
bool ContentSettingsAgentImpl::IsAllowlistedForContentSettings() const {
|
||||
if (should_allowlist_)
|
||||
return true;
|
||||
diff --git a/components/content_settings/renderer/content_settings_agent_impl.h b/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
--- a/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
+++ b/components/content_settings/renderer/content_settings_agent_impl.h
|
||||
@@ -100,6 +100,7 @@ class ContentSettingsAgentImpl
|
||||
bool AllowPopupsAndRedirects(bool default_value) override;
|
||||
bool ShouldAutoupgradeMixedContent() override;
|
||||
bool AllowWebgl(bool enabled_per_settings) override;
|
||||
+ bool AllowWebRTC(bool enabled_per_settings) override;
|
||||
|
||||
bool allow_running_insecure_content() const {
|
||||
return allow_running_insecure_content_;
|
||||
diff --git a/third_party/blink/public/platform/web_content_settings_client.h b/third_party/blink/public/platform/web_content_settings_client.h
|
||||
--- a/third_party/blink/public/platform/web_content_settings_client.h
|
||||
+++ b/third_party/blink/public/platform/web_content_settings_client.h
|
||||
@@ -101,6 +101,8 @@ class WebContentSettingsClient {
|
||||
|
||||
virtual bool AllowWebgl(bool default_value) { return default_value; }
|
||||
|
||||
+ virtual bool AllowWebRTC(bool default_value) { return default_value; }
|
||||
+
|
||||
// Reports that passive mixed content was found at the provided URL.
|
||||
virtual void PassiveInsecureContentFound(const WebURL&) {}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
+++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
|
||||
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
+#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
#include "third_party/blink/public/platform/web_url.h"
|
||||
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
@@ -804,6 +805,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
|
||||
// origin.
|
||||
WebRTCIPHandlingPolicy policy =
|
||||
GetWebRTCIPHandlingPolicy(webrtc_ip_handling_policy);
|
||||
+ blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient();
|
||||
+ if (settings && settings->AllowWebRTC(false)) {
|
||||
+ policy = kDefault;
|
||||
+ }
|
||||
+
|
||||
switch (policy) {
|
||||
// TODO(guoweis): specify the flag of disabling local candidate
|
||||
// collection when webrtc is updated.
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,440 @@
|
||||
From: Zoraver Kang <Zoraver@users.noreply.github.com>
|
||||
Date: Fri, 22 May 2020 22:43:27 -0400
|
||||
Subject: Allow building without enable_reporting
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser/devtools/protocol/network_handler.cc | 2 ++
|
||||
.../cross_origin_embedder_policy_reporter.cc | 7 +++++--
|
||||
.../cross_origin_opener_policy_reporter.cc | 16 +++++++---------
|
||||
.../browser/network/reporting_service_proxy.cc | 3 +++
|
||||
.../renderer_host/render_frame_host_impl.cc | 6 ------
|
||||
.../web_package/signed_exchange_reporter.cc | 2 ++
|
||||
...content_switch_dependent_feature_overrides.cc | 1 +
|
||||
net/reporting/reporting_service.cc | 6 ++++++
|
||||
services/network/network_context.h | 4 ++--
|
||||
services/network/public/mojom/BUILD.gn | 1 -
|
||||
.../network/public/mojom/network_context.mojom | 2 ++
|
||||
.../blink/renderer/core/frame/local_frame.cc | 3 +++
|
||||
.../blink/renderer/core/frame/local_frame.h | 6 +++---
|
||||
.../renderer/core/frame/reporting_context.cc | 9 +++++++++
|
||||
.../renderer/core/frame/reporting_context.h | 7 +++++--
|
||||
15 files changed, 50 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
|
||||
--- a/content/browser/devtools/protocol/network_handler.cc
|
||||
+++ b/content/browser/devtools/protocol/network_handler.cc
|
||||
@@ -1291,6 +1291,7 @@ String BuildReportStatus(const net::ReportingReport::Status status) {
|
||||
}
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
|
||||
std::vector<GURL> urls;
|
||||
base::queue<FrameTreeNode*> queue;
|
||||
@@ -1308,6 +1309,7 @@ std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
+#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
|
||||
} // namespace
|
||||
|
||||
diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
--- a/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
+++ b/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "content/browser/network/cross_origin_embedder_policy_reporter.h"
|
||||
|
||||
+#include "net/base/features.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
@@ -95,8 +96,6 @@ void CrossOriginEmbedderPolicyReporter::Clone(
|
||||
void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
std::initializer_list<std::pair<base::StringPiece, base::StringPiece>> body,
|
||||
bool report_only) {
|
||||
- const absl::optional<std::string>& endpoint =
|
||||
- report_only ? report_only_endpoint_ : endpoint_;
|
||||
const char* const disposition = report_only ? "reporting" : "enforce";
|
||||
if (observer_) {
|
||||
std::vector<blink::mojom::ReportBodyElementPtr> list;
|
||||
@@ -111,6 +110,9 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
observer_->Notify(blink::mojom::Report::New(
|
||||
kType, context_url_, blink::mojom::ReportBody::New(std::move(list))));
|
||||
}
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+ const absl::optional<std::string>& endpoint =
|
||||
+ report_only ? report_only_endpoint_ : endpoint_;
|
||||
if (endpoint) {
|
||||
base::Value::Dict body_to_pass;
|
||||
for (const auto& pair : body) {
|
||||
@@ -125,6 +127,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
/*user_agent=*/absl::nullopt, std::move(body_to_pass));
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/browser/network/cross_origin_opener_policy_reporter.cc b/content/browser/network/cross_origin_opener_policy_reporter.cc
|
||||
--- a/content/browser/network/cross_origin_opener_policy_reporter.cc
|
||||
+++ b/content/browser/network/cross_origin_opener_policy_reporter.cc
|
||||
@@ -18,25 +18,17 @@
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/source_location.mojom.h"
|
||||
#include "url/origin.h"
|
||||
+#include "build/build_config.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
namespace {
|
||||
|
||||
// Report attribute names (camelCase):
|
||||
-constexpr char kColumnNumber[] = "columnNumber";
|
||||
constexpr char kDisposition[] = "disposition";
|
||||
-constexpr char kEffectivePolicy[] = "effectivePolicy";
|
||||
-constexpr char kInitialPopupURL[] = "initialPopupURL";
|
||||
-constexpr char kLineNumber[] = "lineNumber";
|
||||
constexpr char kNextURL[] = "nextResponseURL";
|
||||
-constexpr char kOpeneeURL[] = "openeeURL";
|
||||
-constexpr char kOpenerURL[] = "openerURL";
|
||||
-constexpr char kOtherDocumentURL[] = "otherDocumentURL";
|
||||
constexpr char kPreviousURL[] = "previousResponseURL";
|
||||
-constexpr char kProperty[] = "property";
|
||||
constexpr char kReferrer[] = "referrer";
|
||||
-constexpr char kSourceFile[] = "sourceFile";
|
||||
constexpr char kType[] = "type";
|
||||
|
||||
// Report attribute values:
|
||||
@@ -45,6 +37,7 @@ constexpr char kDispositionReporting[] = "reporting";
|
||||
constexpr char kTypeFromResponse[] = "navigation-from-response";
|
||||
constexpr char kTypeToResponse[] = "navigation-to-response";
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
|
||||
switch (coop_value) {
|
||||
case network::mojom::CrossOriginOpenerPolicyValue::kUnsafeNone:
|
||||
@@ -62,6 +55,7 @@ std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
|
||||
return "restrict-properties-plus-coep";
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {
|
||||
FrameTreeNode* opener =
|
||||
@@ -233,6 +227,7 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
|
||||
network::mojom::SourceLocationPtr source_location,
|
||||
const std::string& reported_window_url,
|
||||
const std::string& initial_popup_url) const {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
// Cross-Origin-Opener-Policy-Report-Only is not required to provide
|
||||
// endpoints.
|
||||
if (!coop_.report_only_reporting_endpoint)
|
||||
@@ -280,12 +275,14 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
|
||||
storage_partition_->GetNetworkContext()->QueueReport(
|
||||
"coop", endpoint, context_url_, reporting_source_,
|
||||
network_anonymization_key_, absl::nullopt, std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
|
||||
base::Value::Dict body,
|
||||
const std::string& endpoint,
|
||||
bool is_report_only) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
body.Set(kDisposition,
|
||||
is_report_only ? kDispositionReporting : kDispositionEnforce);
|
||||
body.Set(kEffectivePolicy,
|
||||
@@ -294,6 +291,7 @@ void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
|
||||
"coop", endpoint, context_url_, reporting_source_,
|
||||
network_anonymization_key_,
|
||||
/*user_agent=*/absl::nullopt, std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browser/network/reporting_service_proxy.cc
|
||||
--- a/content/browser/network/reporting_service_proxy.cc
|
||||
+++ b/content/browser/network/reporting_service_proxy.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/values.h"
|
||||
+#include "net/base/features.h"
|
||||
#include "content/browser/service_worker/service_worker_host.h"
|
||||
#include "content/browser/worker_host/dedicated_worker_host.h"
|
||||
#include "content/browser/worker_host/shared_worker_host.h"
|
||||
@@ -174,12 +175,14 @@ class ReportingServiceProxyImpl : public blink::mojom::ReportingServiceProxy {
|
||||
const std::string& group,
|
||||
const std::string& type,
|
||||
base::Value::Dict body) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
auto* rph = RenderProcessHost::FromID(render_process_id_);
|
||||
if (!rph)
|
||||
return;
|
||||
rph->GetStoragePartition()->GetNetworkContext()->QueueReport(
|
||||
type, group, url, reporting_source_, network_anonymization_key_,
|
||||
/*user_agent=*/absl::nullopt, std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
const int render_process_id_;
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -11993,12 +11993,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport(
|
||||
base::Value::Dict body;
|
||||
if (!reason.empty())
|
||||
body.Set("reason", reason);
|
||||
-
|
||||
- // Send the crash report to the Reporting API.
|
||||
- GetProcess()->GetStoragePartition()->GetNetworkContext()->QueueReport(
|
||||
- /*type=*/"crash", /*group=*/"default", last_committed_url_,
|
||||
- GetReportingSource(), isolation_info_.network_anonymization_key(),
|
||||
- absl::nullopt /* user_agent */, std::move(body));
|
||||
}
|
||||
|
||||
void RenderFrameHostImpl::SendCommitNavigation(
|
||||
diff --git a/content/browser/web_package/signed_exchange_reporter.cc b/content/browser/web_package/signed_exchange_reporter.cc
|
||||
--- a/content/browser/web_package/signed_exchange_reporter.cc
|
||||
+++ b/content/browser/web_package/signed_exchange_reporter.cc
|
||||
@@ -128,6 +128,7 @@ void ReportResult(
|
||||
int frame_tree_node_id,
|
||||
network::mojom::SignedExchangeReportPtr report,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
FrameTreeNode* frame_tree_node =
|
||||
FrameTreeNode::GloballyFindByID(frame_tree_node_id);
|
||||
if (!frame_tree_node)
|
||||
@@ -142,6 +143,7 @@ void ReportResult(
|
||||
DCHECK(partition);
|
||||
partition->GetNetworkContext()->QueueSignedExchangeReport(
|
||||
std::move(report), network_anonymization_key);
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
--- a/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
+++ b/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "content/public/common/content_features.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/features.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc
|
||||
--- a/net/reporting/reporting_service.cc
|
||||
+++ b/net/reporting/reporting_service.cc
|
||||
@@ -211,6 +211,12 @@ class ReportingServiceImpl : public ReportingService {
|
||||
base::Value::Dict body,
|
||||
int depth,
|
||||
base::TimeTicks queued_ticks) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+ if ((true))
|
||||
+ return;
|
||||
+#else
|
||||
+#error Attempting to build with enable_reporting
|
||||
+#endif
|
||||
DCHECK(initialized_);
|
||||
context_->cache()->AddReport(
|
||||
reporting_source, network_anonymization_key, sanitized_url, user_agent,
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -465,10 +465,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
const absl::optional<base::UnguessableToken>& reporting_source,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key,
|
||||
const absl::optional<std::string>& user_agent,
|
||||
- base::Value::Dict body) override;
|
||||
+ base::Value::Dict body);
|
||||
void QueueSignedExchangeReport(
|
||||
mojom::SignedExchangeReportPtr report,
|
||||
- const net::NetworkAnonymizationKey& network_anonymization_key) override;
|
||||
+ const net::NetworkAnonymizationKey& network_anonymization_key);
|
||||
void AddDomainReliabilityContextForTesting(
|
||||
const url::Origin& origin,
|
||||
const GURL& upload_url,
|
||||
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn
|
||||
--- a/services/network/public/mojom/BUILD.gn
|
||||
+++ b/services/network/public/mojom/BUILD.gn
|
||||
@@ -1168,7 +1168,6 @@ mojom("mojom") {
|
||||
export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
|
||||
export_header_blink = "third_party/blink/public/platform/web_common.h"
|
||||
if (enable_reporting) {
|
||||
- enabled_features += [ "enable_reporting" ]
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1072,6 +1072,7 @@ interface NetworkContext {
|
||||
// provided |network_isolation_key|.
|
||||
//
|
||||
// Spec: https://w3c.github.io/reporting/#concept-reports
|
||||
+ [EnableIf=enable_reporting]
|
||||
QueueReport(string type,
|
||||
string group,
|
||||
url.mojom.Url url,
|
||||
@@ -1085,6 +1086,7 @@ interface NetworkContext {
|
||||
// Note that this queued report will never be delivered if no reporting
|
||||
// endpoint matching is registered for with the provided
|
||||
// |network_isolation_key|.
|
||||
+ [EnableIf=enable_reporting]
|
||||
QueueSignedExchangeReport(SignedExchangeReport report,
|
||||
NetworkAnonymizationKey network_anonymization_key);
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
#include "mojo/public/cpp/system/message_pipe.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "services/data_decoder/public/mojom/resource_snapshot_for_web_bundle.mojom-blink.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
|
||||
@@ -2328,9 +2329,11 @@ const base::UnguessableToken& LocalFrame::GetAgentClusterId() const {
|
||||
return base::UnguessableToken::Null();
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
mojom::blink::ReportingServiceProxy* LocalFrame::GetReportingService() {
|
||||
return mojo_handler_->ReportingService();
|
||||
}
|
||||
+#endif
|
||||
|
||||
// static
|
||||
void LocalFrame::NotifyUserActivation(
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -35,9 +35,9 @@
|
||||
#include "base/time/default_tick_clock.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/unguessable_token.h"
|
||||
-#include "build/build_config.h"
|
||||
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h"
|
||||
#include "services/network/public/mojom/fetch_api.mojom-blink-forward.h"
|
||||
#include "third_party/blink/public/common/frame/frame_ad_evidence.h"
|
||||
@@ -596,9 +596,9 @@ class CORE_EXPORT LocalFrame final
|
||||
}
|
||||
|
||||
SmoothScrollSequencer& GetSmoothScrollSequencer();
|
||||
-
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
mojom::blink::ReportingServiceProxy* GetReportingService();
|
||||
-
|
||||
+#endif
|
||||
// Returns the frame host ptr. The interface returned is backed by an
|
||||
// associated interface with the legacy Chrome IPC channel.
|
||||
mojom::blink::LocalFrameHost& GetLocalFrameHostRemote() const;
|
||||
diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
--- a/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "third_party/blink/renderer/core/frame/reporting_context.h"
|
||||
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
@@ -53,7 +54,9 @@ const char ReportingContext::kSupplementName[] = "ReportingContext";
|
||||
ReportingContext::ReportingContext(ExecutionContext& context)
|
||||
: Supplement<ExecutionContext>(context),
|
||||
execution_context_(context),
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
reporting_service_(&context),
|
||||
+#endif
|
||||
receiver_(this, &context) {}
|
||||
|
||||
// static
|
||||
@@ -117,7 +120,9 @@ void ReportingContext::Trace(Visitor* visitor) const {
|
||||
visitor->Trace(observers_);
|
||||
visitor->Trace(report_buffer_);
|
||||
visitor->Trace(execution_context_);
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
visitor->Trace(reporting_service_);
|
||||
+#endif
|
||||
visitor->Trace(receiver_);
|
||||
Supplement<ExecutionContext>::Trace(visitor);
|
||||
}
|
||||
@@ -139,6 +144,7 @@ void ReportingContext::CountReport(Report* report) {
|
||||
UseCounter::Count(execution_context_, feature);
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
const HeapMojoRemote<mojom::blink::ReportingServiceProxy>&
|
||||
ReportingContext::GetReportingService() const {
|
||||
if (!reporting_service_.is_bound()) {
|
||||
@@ -148,6 +154,7 @@ ReportingContext::GetReportingService() const {
|
||||
}
|
||||
return reporting_service_;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void ReportingContext::NotifyInternal(Report* report) {
|
||||
// Buffer the report.
|
||||
@@ -170,6 +177,7 @@ void ReportingContext::NotifyInternal(Report* report) {
|
||||
|
||||
void ReportingContext::SendToReportingAPI(Report* report,
|
||||
const String& endpoint) const {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
const String& type = report->type();
|
||||
if (!(type == ReportType::kCSPViolation || type == ReportType::kDeprecation ||
|
||||
type == ReportType::kPermissionsPolicyViolation ||
|
||||
@@ -227,6 +235,7 @@ void ReportingContext::SendToReportingAPI(Report* report,
|
||||
url, endpoint, body->featureId(), body->disposition(), body->message(),
|
||||
body->sourceFile(), line_number, column_number);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_party/blink/renderer/core/frame/reporting_context.h
|
||||
--- a/third_party/blink/renderer/core/frame/reporting_context.h
|
||||
+++ b/third_party/blink/renderer/core/frame/reporting_context.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_
|
||||
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "third_party/blink/public/mojom/frame/reporting_observer.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h"
|
||||
#include "third_party/blink/renderer/core/core_export.h"
|
||||
@@ -55,10 +56,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
private:
|
||||
// Counts the use of a report type via UseCounter.
|
||||
void CountReport(Report*);
|
||||
-
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
const HeapMojoRemote<mojom::blink::ReportingServiceProxy>&
|
||||
GetReportingService() const;
|
||||
-
|
||||
+#endif
|
||||
void NotifyInternal(Report* report);
|
||||
// Send |report| via the Reporting API to |endpoint|.
|
||||
void SendToReportingAPI(Report* report, const String& endpoint) const;
|
||||
@@ -69,8 +70,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
|
||||
// This is declared mutable so that the service endpoint can be cached by
|
||||
// const methods.
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
mutable HeapMojoRemote<mojom::blink::ReportingServiceProxy>
|
||||
reporting_service_;
|
||||
+#endif
|
||||
|
||||
HeapMojoReceiver<mojom::blink::ReportingObserver, ReportingContext> receiver_;
|
||||
};
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,53 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 21 Feb 2022 01:24:11 +0100
|
||||
Subject: Allow building without supervised users
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser/supervised_user/ChildAccountService.java | 11 -----------
|
||||
.../child_accounts/child_account_service_android.cc | 9 ---------
|
||||
2 files changed, 20 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
|
||||
@@ -31,21 +31,10 @@ public class ChildAccountService {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
final Activity activity = windowAndroid.getActivity().get();
|
||||
if (activity == null) {
|
||||
- PostTask.postTask(UiThreadTaskTraits.DEFAULT, () -> {
|
||||
- ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
|
||||
- });
|
||||
return;
|
||||
}
|
||||
Account account = AccountUtils.createAccountFromName(accountName);
|
||||
AccountManagerFacadeProvider.getInstance().updateCredentials(account, activity, success -> {
|
||||
- if (!success) {
|
||||
- ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
|
||||
- }
|
||||
});
|
||||
}
|
||||
-
|
||||
- @NativeMethods
|
||||
- interface Natives {
|
||||
- void onReauthenticationFailed(long onFailureCallbackPtr);
|
||||
- }
|
||||
}
|
||||
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
||||
--- a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
||||
+++ b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
|
||||
@@ -39,12 +39,3 @@ void ReauthenticateChildAccount(
|
||||
env, window_android->GetJavaObject(), ConvertUTF8ToJavaString(env, email),
|
||||
reinterpret_cast<jlong>(callback_copy.release()));
|
||||
}
|
||||
-
|
||||
-void JNI_ChildAccountService_OnReauthenticationFailed(JNIEnv* env,
|
||||
- jlong jcallbackPtr) {
|
||||
- // Cast the pointer value back to a Callback and take ownership of it.
|
||||
- std::unique_ptr<base::RepeatingCallback<void()>> callback(
|
||||
- reinterpret_cast<base::RepeatingCallback<void()>*>(jcallbackPtr));
|
||||
-
|
||||
- callback->Run();
|
||||
-}
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,53 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 2 Nov 2017 18:21:16 +0200
|
||||
Subject: Allow playing audio in background
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../renderer/platform/media/web_media_player_impl.cc | 11 ++++++++++-
|
||||
.../renderer/platform/media/web_media_player_impl.h | 3 +++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
--- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
+++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
@@ -1237,6 +1237,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
|
||||
return pipeline_metadata_.has_audio;
|
||||
}
|
||||
|
||||
+bool WebMediaPlayerImpl::HasVideoNonEmptySize() const {
|
||||
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
|
||||
+
|
||||
+ return pipeline_metadata_.has_video && pipeline_metadata_.natural_size.width() != 0 && pipeline_metadata_.natural_size.height() != 0;
|
||||
+}
|
||||
+
|
||||
void WebMediaPlayerImpl::EnabledAudioTracksChanged(
|
||||
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) {
|
||||
DCHECK(main_task_runner_->BelongsToCurrentThread());
|
||||
@@ -3662,7 +3668,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
|
||||
: HasAudio();
|
||||
|
||||
// Audio only stream is allowed to play when in background.
|
||||
- if (!HasVideo() && preserve_audio)
|
||||
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
|
||||
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
|
||||
+ //streams be played in background.
|
||||
+ if (!HasVideoNonEmptySize() && preserve_audio)
|
||||
return false;
|
||||
|
||||
// MediaPlayer always signals audio and video, so use an empty natural size to
|
||||
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.h b/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
--- a/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
+++ b/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
@@ -197,6 +197,9 @@ class PLATFORM_EXPORT WebMediaPlayerImpl
|
||||
bool HasVideo() const override;
|
||||
bool HasAudio() const override;
|
||||
|
||||
+ // True is has video and it's frame size is not zero
|
||||
+ bool HasVideoNonEmptySize() const;
|
||||
+
|
||||
void EnabledAudioTracksChanged(
|
||||
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) override;
|
||||
void SelectedVideoTrackChanged(
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,27 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 11:02:38 +0200
|
||||
Subject: Always use new tab page for default home page
|
||||
|
||||
Ignore any partner-provided home page.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../org/chromium/chrome/browser/homepage/HomepageManager.java | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
@@ -147,10 +147,6 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat
|
||||
* if the homepage button is force enabled via flag.
|
||||
*/
|
||||
public static String getDefaultHomepageUri() {
|
||||
- if (PartnerBrowserCustomizations.getInstance().isHomepageProviderAvailableAndEnabled()) {
|
||||
- return PartnerBrowserCustomizations.getInstance().getHomePageUrl().getSpec();
|
||||
- }
|
||||
-
|
||||
String homepagePartnerDefaultUri;
|
||||
String homepagePartnerDefaultGurlSerialized =
|
||||
SharedPreferencesManager.getInstance().readString(
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,63 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 25 Mar 2018 21:49:37 +0200
|
||||
Subject: AudioBuffer, AnalyserNode: fp mitigations
|
||||
|
||||
Truncate base latency precision to two digits
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
|
||||
.../blink/renderer/modules/webaudio/audio_buffer.idl | 6 ------
|
||||
.../blink/renderer/modules/webaudio/audio_context.cc | 4 +++-
|
||||
3 files changed, 7 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
@@ -40,10 +40,10 @@
|
||||
|
||||
// Copies the current frequency data into the passed array.
|
||||
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
|
||||
- [HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
|
||||
// Real-time waveform data
|
||||
- [HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
@@ -37,12 +37,6 @@
|
||||
|
||||
// Channel access
|
||||
readonly attribute unsigned long numberOfChannels;
|
||||
- [HighEntropy=Direct, Measure, RaisesException] Float32Array getChannelData(
|
||||
- unsigned long channelIndex);
|
||||
- [HighEntropy, Measure, RaisesException] void copyFromChannel(
|
||||
- Float32Array destination,
|
||||
- unsigned long channelNumber,
|
||||
- optional unsigned long bufferOffset = 0);
|
||||
[RaisesException] void copyToChannel(
|
||||
Float32Array source,
|
||||
unsigned long channelNumber,
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
@@ -508,7 +508,9 @@ double AudioContext::baseLatency() const {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination());
|
||||
|
||||
- return base_latency_;
|
||||
+ // remove precision past two decimal digits
|
||||
+ int l = base_latency_ * 100;
|
||||
+ return double(l)/100;
|
||||
}
|
||||
|
||||
double AudioContext::outputLatency() const {
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,67 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 22 Mar 2018 22:11:57 +0100
|
||||
Subject: Battery API: return nothing
|
||||
|
||||
Include @thestinger's fix for correct charging/unknown values
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../modules/battery/battery_manager.cc | 26 +++----------------
|
||||
1 file changed, 4 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
--- a/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
+++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
@@ -77,46 +77,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
|
||||
}
|
||||
|
||||
bool BatteryManager::charging() {
|
||||
- return battery_status_.Charging();
|
||||
+ return true;
|
||||
}
|
||||
|
||||
double BatteryManager::chargingTime() {
|
||||
- return battery_status_.charging_time().InSecondsF();
|
||||
+ return 0.0;
|
||||
}
|
||||
|
||||
double BatteryManager::dischargingTime() {
|
||||
- return battery_status_.discharging_time().InSecondsF();
|
||||
+ return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
double BatteryManager::level() {
|
||||
- return battery_status_.Level();
|
||||
+ return 1.0;
|
||||
}
|
||||
|
||||
void BatteryManager::DidUpdateData() {
|
||||
DCHECK(battery_property_);
|
||||
|
||||
- BatteryStatus old_status = battery_status_;
|
||||
- battery_status_ = *battery_dispatcher_->LatestData();
|
||||
-
|
||||
if (battery_property_->GetState() == BatteryProperty::kPending) {
|
||||
battery_property_->Resolve(this);
|
||||
return;
|
||||
}
|
||||
-
|
||||
- DCHECK(GetExecutionContext());
|
||||
- if (GetExecutionContext()->IsContextPaused() ||
|
||||
- GetExecutionContext()->IsContextDestroyed()) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (battery_status_.Charging() != old_status.Charging())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kChargingchange));
|
||||
- if (battery_status_.charging_time() != old_status.charging_time())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kChargingtimechange));
|
||||
- if (battery_status_.discharging_time() != old_status.discharging_time())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange));
|
||||
- if (battery_status_.Level() != old_status.Level())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kLevelchange));
|
||||
}
|
||||
|
||||
void BatteryManager::RegisterWithDispatcher() {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,286 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 28 Jul 2020 12:28:58 +0200
|
||||
Subject: Block gateway attacks via websockets
|
||||
|
||||
This approach is not comprehensive, see also:
|
||||
* https://bugs.chromium.org/p/chromium/issues/detail?id=590714
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../execution_context/execution_context.cc | 16 ++++++++++
|
||||
.../execution_context/execution_context.h | 1 +
|
||||
.../renderer/core/loader/base_fetch_context.h | 1 +
|
||||
.../core/loader/frame_fetch_context.cc | 20 ++++++++++++
|
||||
.../core/loader/frame_fetch_context.h | 1 +
|
||||
.../core/loader/worker_fetch_context.cc | 21 +++++++++++++
|
||||
.../core/loader/worker_fetch_context.h | 1 +
|
||||
.../background_fetch_manager.cc | 31 +++++++++++++++++++
|
||||
.../websockets/websocket_channel_impl.cc | 5 +++
|
||||
.../modules/websockets/websocket_common.cc | 29 +++++++++++++++++
|
||||
.../modules/websockets/websocket_common.h | 4 +++
|
||||
11 files changed, 130 insertions(+)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
@@ -720,4 +720,20 @@ void ExecutionContext::WriteIntoTrace(
|
||||
proto->set_type(GetContextType(*this));
|
||||
}
|
||||
|
||||
+String ExecutionContext::addressSpaceForBindings() const {
|
||||
+ switch (AddressSpace()) {
|
||||
+ case network::mojom::IPAddressSpace::kPublic:
|
||||
+ case network::mojom::IPAddressSpace::kUnknown:
|
||||
+ return "public";
|
||||
+
|
||||
+ case network::mojom::IPAddressSpace::kPrivate:
|
||||
+ return "private";
|
||||
+
|
||||
+ case network::mojom::IPAddressSpace::kLocal:
|
||||
+ return "local";
|
||||
+ }
|
||||
+ NOTREACHED();
|
||||
+ return "public";
|
||||
+}
|
||||
+
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
@@ -401,6 +401,7 @@ class CORE_EXPORT ExecutionContext : public Supplementable<ExecutionContext>,
|
||||
void SetAddressSpace(network::mojom::blink::IPAddressSpace ip_address_space);
|
||||
|
||||
HeapObserverSet<ContextLifecycleObserver>& ContextLifecycleObserverSet();
|
||||
+ String addressSpaceForBindings() const;
|
||||
unsigned ContextLifecycleStateObserverCountForTesting() const;
|
||||
|
||||
// Implementation of WindowOrWorkerGlobalScope.crossOriginIsolated.
|
||||
diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.h b/third_party/blink/renderer/core/loader/base_fetch_context.h
|
||||
--- a/third_party/blink/renderer/core/loader/base_fetch_context.h
|
||||
+++ b/third_party/blink/renderer/core/loader/base_fetch_context.h
|
||||
@@ -84,6 +84,7 @@ class CORE_EXPORT BaseFetchContext : public FetchContext {
|
||||
|
||||
virtual SubresourceFilter* GetSubresourceFilter() const = 0;
|
||||
virtual bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const = 0;
|
||||
+ virtual bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const = 0;
|
||||
virtual std::unique_ptr<WebSocketHandshakeThrottle>
|
||||
CreateWebSocketHandshakeThrottle() = 0;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
|
||||
--- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
|
||||
@@ -578,6 +578,26 @@ bool FrameFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
|
||||
return should_block_request;
|
||||
}
|
||||
|
||||
+bool FrameFetchContext::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
|
||||
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
|
||||
+ // all this up to //net and //content in order to have any real impact on
|
||||
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
|
||||
+ if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
|
||||
+ requestor_space = network::mojom::IPAddressSpace::kPublic;
|
||||
+ network::mojom::IPAddressSpace target_space =
|
||||
+ network::mojom::IPAddressSpace::kPublic;
|
||||
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
|
||||
+ target_space = network::mojom::IPAddressSpace::kPrivate;
|
||||
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
|
||||
+ target_space = network::mojom::IPAddressSpace::kLocal;
|
||||
+
|
||||
+ bool is_external_request = requestor_space > target_space;
|
||||
+ if (is_external_request)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void FrameFetchContext::DispatchDidBlockRequest(
|
||||
const ResourceRequest& resource_request,
|
||||
const ResourceLoaderOptions& options,
|
||||
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.h b/third_party/blink/renderer/core/loader/frame_fetch_context.h
|
||||
--- a/third_party/blink/renderer/core/loader/frame_fetch_context.h
|
||||
+++ b/third_party/blink/renderer/core/loader/frame_fetch_context.h
|
||||
@@ -168,6 +168,7 @@ class CORE_EXPORT FrameFetchContext final : public BaseFetchContext,
|
||||
bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const override;
|
||||
std::unique_ptr<WebSocketHandshakeThrottle> CreateWebSocketHandshakeThrottle()
|
||||
override;
|
||||
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const override;
|
||||
bool ShouldBlockFetchByMixedContentCheck(
|
||||
mojom::blink::RequestContextType request_context,
|
||||
network::mojom::blink::IPAddressSpace target_address_space,
|
||||
diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.cc b/third_party/blink/renderer/core/loader/worker_fetch_context.cc
|
||||
--- a/third_party/blink/renderer/core/loader/worker_fetch_context.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/worker_fetch_context.cc
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "third_party/blink/renderer/platform/loader/fetch/resource_timing_info.h"
|
||||
#include "third_party/blink/renderer/platform/loader/fetch/worker_resource_timing_notifier.h"
|
||||
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
|
||||
+#include "third_party/blink/renderer/platform/network/network_utils.h"
|
||||
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
#include "third_party/blink/renderer/platform/supplementable.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
|
||||
@@ -91,6 +92,26 @@ bool WorkerFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
|
||||
return should_block_request;
|
||||
}
|
||||
|
||||
+bool WorkerFetchContext::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
|
||||
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
|
||||
+ // all this up to //net and //content in order to have any real impact on
|
||||
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
|
||||
+ if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
|
||||
+ requestor_space = network::mojom::IPAddressSpace::kPublic;
|
||||
+ network::mojom::IPAddressSpace target_space =
|
||||
+ network::mojom::IPAddressSpace::kPublic;
|
||||
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
|
||||
+ target_space = network::mojom::IPAddressSpace::kPrivate;
|
||||
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
|
||||
+ target_space = network::mojom::IPAddressSpace::kLocal;
|
||||
+
|
||||
+ bool is_external_request = requestor_space > target_space;
|
||||
+ if (is_external_request)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void WorkerFetchContext::DispatchDidBlockRequest(
|
||||
const ResourceRequest& resource_request,
|
||||
const ResourceLoaderOptions& options,
|
||||
diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.h b/third_party/blink/renderer/core/loader/worker_fetch_context.h
|
||||
--- a/third_party/blink/renderer/core/loader/worker_fetch_context.h
|
||||
+++ b/third_party/blink/renderer/core/loader/worker_fetch_context.h
|
||||
@@ -62,6 +62,7 @@ class WorkerFetchContext final : public BaseFetchContext {
|
||||
bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const override;
|
||||
std::unique_ptr<WebSocketHandshakeThrottle> CreateWebSocketHandshakeThrottle()
|
||||
override;
|
||||
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const override;
|
||||
bool ShouldBlockFetchByMixedContentCheck(
|
||||
mojom::blink::RequestContextType request_context,
|
||||
network::mojom::blink::IPAddressSpace target_address_space,
|
||||
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
|
||||
--- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
|
||||
+++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
|
||||
@@ -102,6 +102,30 @@ bool ShouldBlockDanglingMarkup(const KURL& request_url) {
|
||||
request_url.ProtocolIsInHTTPFamily();
|
||||
}
|
||||
|
||||
+bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
|
||||
+ const KURL& request_url) {
|
||||
+ network::mojom::IPAddressSpace requestor_space =
|
||||
+ execution_context->AddressSpace();
|
||||
+ if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
|
||||
+ requestor_space = network::mojom::IPAddressSpace::kPublic;
|
||||
+
|
||||
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
|
||||
+ // all this up to //net and //content in order to have any real impact on
|
||||
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
|
||||
+ network::mojom::IPAddressSpace target_space =
|
||||
+ network::mojom::IPAddressSpace::kPublic;
|
||||
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
|
||||
+ target_space = network::mojom::IPAddressSpace::kPrivate;
|
||||
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
|
||||
+ target_space = network::mojom::IPAddressSpace::kLocal;
|
||||
+
|
||||
+ bool is_external_request = requestor_space > target_space;
|
||||
+ if (is_external_request)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
scoped_refptr<BlobDataHandle> ExtractBlobHandle(
|
||||
Request* request,
|
||||
ExceptionState& exception_state) {
|
||||
@@ -221,6 +245,13 @@ ScriptPromise BackgroundFetchManager::fetch(
|
||||
exception_state);
|
||||
}
|
||||
|
||||
+ if (ShouldBlockGateWayAttacks(execution_context, request_url)) {
|
||||
+ return RejectWithTypeError(script_state, request_url,
|
||||
+ "Requestor IP address space doesn't match the "
|
||||
+ "target address space.",
|
||||
+ exception_state);
|
||||
+ }
|
||||
+
|
||||
kurls.insert(request_url);
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
|
||||
--- a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
|
||||
+++ b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
|
||||
@@ -276,6 +276,11 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (GetBaseFetchContext()->ShouldBlockGateWayAttacks(execution_context_->AddressSpace(), url)) {
|
||||
+ has_initiated_opening_handshake_ = false;
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
if (auto* scheduler = execution_context_->GetScheduler()) {
|
||||
feature_handle_for_scheduler_ = scheduler->RegisterFeature(
|
||||
SchedulingPolicy::Feature::kWebSocket,
|
||||
diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.cc b/third_party/blink/renderer/modules/websockets/websocket_common.cc
|
||||
--- a/third_party/blink/renderer/modules/websockets/websocket_common.cc
|
||||
+++ b/third_party/blink/renderer/modules/websockets/websocket_common.cc
|
||||
@@ -125,9 +125,38 @@ WebSocketCommon::ConnectResult WebSocketCommon::Connect(
|
||||
return ConnectResult::kException;
|
||||
}
|
||||
|
||||
+ network::mojom::IPAddressSpace requestor_space =
|
||||
+ execution_context->AddressSpace();
|
||||
+ if (ShouldBlockGateWayAttacks(requestor_space, url_)) {
|
||||
+ state_ = kClosed;
|
||||
+ exception_state.ThrowSecurityError(
|
||||
+ "Access to address of '" + url_.Host() + "' is not allowed from '" + execution_context->addressSpaceForBindings() + "' address space.");
|
||||
+ return ConnectResult::kException;
|
||||
+ }
|
||||
+
|
||||
return ConnectResult::kSuccess;
|
||||
}
|
||||
|
||||
+bool WebSocketCommon::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
|
||||
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
|
||||
+ // all this up to //net and //content in order to have any real impact on
|
||||
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
|
||||
+ if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
|
||||
+ requestor_space = network::mojom::IPAddressSpace::kPublic;
|
||||
+ network::mojom::IPAddressSpace target_space =
|
||||
+ network::mojom::IPAddressSpace::kPublic;
|
||||
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
|
||||
+ target_space = network::mojom::IPAddressSpace::kPrivate;
|
||||
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
|
||||
+ target_space = network::mojom::IPAddressSpace::kLocal;
|
||||
+
|
||||
+ bool is_external_request = requestor_space > target_space;
|
||||
+ if (is_external_request)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void WebSocketCommon::CloseInternal(int code,
|
||||
const String& reason,
|
||||
WebSocketChannel* channel,
|
||||
diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/third_party/blink/renderer/modules/websockets/websocket_common.h
|
||||
--- a/third_party/blink/renderer/modules/websockets/websocket_common.h
|
||||
+++ b/third_party/blink/renderer/modules/websockets/websocket_common.h
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_COMMON_H_
|
||||
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_COMMON_H_
|
||||
|
||||
+#include "services/network/public/mojom/ip_address_space.mojom.h"
|
||||
+#include "third_party/blink/renderer/platform/network/network_utils.h"
|
||||
#include "third_party/blink/renderer/modules/modules_export.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
@@ -54,6 +56,8 @@ class MODULES_EXPORT WebSocketCommon {
|
||||
void SetState(State state) { state_ = state; }
|
||||
const KURL& Url() const { return url_; }
|
||||
|
||||
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& url) const;
|
||||
+
|
||||
// The following methods are public for testing.
|
||||
|
||||
// Returns true if |protocol| is a valid WebSocket subprotocol name.
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,290 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 30 Oct 2019 11:50:13 +0100
|
||||
Subject: Block 'qjz9zk' or 'trk:' requests
|
||||
|
||||
An info bar is displayed unless the --disable-trkbar command-line flag or the chrome://flag option is used.
|
||||
This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved'
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chrome_autocomplete_scheme_classifier.cc | 1 +
|
||||
chrome/browser/history/history_utils.cc | 1 +
|
||||
chrome/browser/ui/singleton_tabs.cc | 5 ++++
|
||||
.../omnibox/browser/autocomplete_input.cc | 8 ++++-
|
||||
components/url_formatter/url_fixer.cc | 4 +++
|
||||
.../child_process_security_policy_impl.cc | 1 +
|
||||
net/BUILD.gn | 2 ++
|
||||
net/url_request/trk_protocol_handler.cc | 25 ++++++++++++++++
|
||||
net/url_request/trk_protocol_handler.h | 30 +++++++++++++++++++
|
||||
net/url_request/url_request.cc | 8 +++++
|
||||
.../url_request_context_builder.cc | 3 ++
|
||||
url/url_constants.cc | 1 +
|
||||
url/url_constants.h | 1 +
|
||||
url/url_util.cc | 2 ++
|
||||
14 files changed, 91 insertions(+), 1 deletion(-)
|
||||
create mode 100644 net/url_request/trk_protocol_handler.cc
|
||||
create mode 100644 net/url_request/trk_protocol_handler.h
|
||||
|
||||
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
--- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
+++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
@@ -58,6 +58,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
|
||||
if (base::IsStringASCII(scheme) &&
|
||||
(ProfileIOData::IsHandledProtocol(scheme) ||
|
||||
base::EqualsCaseInsensitiveASCII(scheme, content::kViewSourceScheme) ||
|
||||
+ base::EqualsCaseInsensitiveASCII(scheme, url::kTraceScheme) ||
|
||||
base::EqualsCaseInsensitiveASCII(scheme, url::kJavaScriptScheme) ||
|
||||
base::EqualsCaseInsensitiveASCII(scheme, url::kDataScheme))) {
|
||||
return metrics::OmniboxInputType::URL;
|
||||
diff --git a/chrome/browser/history/history_utils.cc b/chrome/browser/history/history_utils.cc
|
||||
--- a/chrome/browser/history/history_utils.cc
|
||||
+++ b/chrome/browser/history/history_utils.cc
|
||||
@@ -22,6 +22,7 @@ bool CanAddURLToHistory(const GURL& url) {
|
||||
url.SchemeIs(content::kChromeUIScheme) ||
|
||||
url.SchemeIs(content::kChromeUIUntrustedScheme) ||
|
||||
url.SchemeIs(content::kViewSourceScheme) ||
|
||||
+ url.SchemeIs(url::kTraceScheme) ||
|
||||
url.SchemeIs(chrome::kChromeNativeScheme) ||
|
||||
url.SchemeIs(chrome::kChromeSearchScheme) ||
|
||||
url.SchemeIs(dom_distiller::kDomDistillerScheme))
|
||||
diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc
|
||||
--- a/chrome/browser/ui/singleton_tabs.cc
|
||||
+++ b/chrome/browser/ui/singleton_tabs.cc
|
||||
@@ -101,6 +101,11 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+ // trk: URLs must not be rewritten
|
||||
+ if (tab_url.SchemeIs(url::kTraceScheme)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
GURL rewritten_tab_url = tab_url;
|
||||
content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
|
||||
&rewritten_tab_url, browser->profile());
|
||||
diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc
|
||||
--- a/components/omnibox/browser/autocomplete_input.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_input.cc
|
||||
@@ -89,10 +89,15 @@ void OffsetComponentsExcludingScheme(url::Parsed* parts, int offset) {
|
||||
bool HasScheme(const std::u16string& input, const char* scheme) {
|
||||
std::string utf8_input(base::UTF16ToUTF8(input));
|
||||
url::Component view_source_scheme;
|
||||
+
|
||||
+ if (url::FindAndCompareScheme(utf8_input, url::kTraceScheme, &view_source_scheme)) {
|
||||
+ return false;
|
||||
+ }
|
||||
if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme,
|
||||
&view_source_scheme)) {
|
||||
utf8_input.erase(0, view_source_scheme.end() + 1);
|
||||
}
|
||||
+
|
||||
return url::FindAndCompareScheme(utf8_input, scheme, nullptr);
|
||||
}
|
||||
|
||||
@@ -573,7 +578,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
|
||||
// For the view-source and blob schemes, we should emphasize the host of the
|
||||
// URL qualified by the view-source or blob prefix.
|
||||
if ((base::EqualsCaseInsensitiveASCII(scheme_str, kViewSourceScheme) ||
|
||||
- base::EqualsCaseInsensitiveASCII(scheme_str, url::kBlobScheme)) &&
|
||||
+ base::EqualsCaseInsensitiveASCII(scheme_str, url::kBlobScheme) ||
|
||||
+ base::EqualsCaseInsensitiveASCII(scheme_str, url::kTraceScheme)) &&
|
||||
(static_cast<int>(text.length()) > after_scheme_and_colon)) {
|
||||
// Obtain the URL prefixed by view-source or blob and parse it.
|
||||
std::u16string real_url(text.substr(after_scheme_and_colon));
|
||||
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
|
||||
--- a/components/url_formatter/url_fixer.cc
|
||||
+++ b/components/url_formatter/url_fixer.cc
|
||||
@@ -563,6 +563,10 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (scheme == url::kTraceScheme) {
|
||||
+ return GURL();
|
||||
+ }
|
||||
+
|
||||
// We handle the file scheme separately.
|
||||
if (scheme == url::kFileScheme)
|
||||
return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
|
||||
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
|
||||
--- a/content/browser/child_process_security_policy_impl.cc
|
||||
+++ b/content/browser/child_process_security_policy_impl.cc
|
||||
@@ -756,6 +756,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl()
|
||||
RegisterPseudoScheme(url::kJavaScriptScheme);
|
||||
RegisterPseudoScheme(kViewSourceScheme);
|
||||
RegisterPseudoScheme(kGoogleChromeScheme);
|
||||
+ RegisterWebSafeScheme(url::kTraceScheme);
|
||||
}
|
||||
|
||||
ChildProcessSecurityPolicyImpl::~ChildProcessSecurityPolicyImpl() {
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1032,6 +1032,8 @@ component("net") {
|
||||
"url_request/url_request_http_job.cc",
|
||||
"url_request/url_request_http_job.h",
|
||||
"url_request/url_request_interceptor.cc",
|
||||
+ "url_request/trk_protocol_handler.cc",
|
||||
+ "url_request/trk_protocol_handler.h",
|
||||
"url_request/url_request_interceptor.h",
|
||||
"url_request/url_request_job.cc",
|
||||
"url_request/url_request_job.h",
|
||||
diff --git a/net/url_request/trk_protocol_handler.cc b/net/url_request/trk_protocol_handler.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/trk_protocol_handler.cc
|
||||
@@ -0,0 +1,25 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "net/url_request/trk_protocol_handler.h"
|
||||
+
|
||||
+#include "base/logging.h"
|
||||
+#include "net/base/net_errors.h"
|
||||
+#include "net/url_request/url_request_error_job.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+TrkProtocolHandler::TrkProtocolHandler() = default;
|
||||
+
|
||||
+std::unique_ptr<URLRequestJob> TrkProtocolHandler::CreateJob(
|
||||
+ URLRequest* request) const {
|
||||
+ LOG(ERROR) << "Blocked URL in TrkProtocolHandler: " << request->original_url();
|
||||
+ return std::make_unique<URLRequestErrorJob>(request, ERR_BLOCKED_BY_CLIENT);
|
||||
+}
|
||||
+
|
||||
+bool TrkProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protocol_handler.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/trk_protocol_handler.h
|
||||
@@ -0,0 +1,30 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
+
|
||||
+#include "base/compiler_specific.h"
|
||||
+#include "net/base/net_export.h"
|
||||
+#include "net/url_request/url_request_job_factory.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+class URLRequestJob;
|
||||
+
|
||||
+// Implements a ProtocolHandler for Trk jobs.
|
||||
+class NET_EXPORT TrkProtocolHandler
|
||||
+ : public URLRequestJobFactory::ProtocolHandler {
|
||||
+ public:
|
||||
+ TrkProtocolHandler(const TrkProtocolHandler&) = delete;
|
||||
+ TrkProtocolHandler& operator=(const TrkProtocolHandler&) = delete;
|
||||
+
|
||||
+ TrkProtocolHandler();
|
||||
+ std::unique_ptr<URLRequestJob> CreateJob(URLRequest* request) const override;
|
||||
+ bool IsSafeRedirectTarget(const GURL& location) const override;
|
||||
+};
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
||||
--- a/net/url_request/url_request.cc
|
||||
+++ b/net/url_request/url_request.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
+#include "base/strings/string_util.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "base/values.h"
|
||||
@@ -45,6 +46,7 @@
|
||||
#include "net/url_request/url_request_redirect_job.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
+#include "url/url_constants.h"
|
||||
|
||||
namespace net {
|
||||
|
||||
@@ -593,6 +595,12 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
+ if (!url.SchemeIs(url::kTraceScheme) &&
|
||||
+ base::EndsWith(url.host(), "qjz9zk", base::CompareCase::INSENSITIVE_ASCII)) {
|
||||
+ LOG(ERROR) << "Block URL in URLRequest: " << url;
|
||||
+ url_chain_[0] = GURL(url::kTraceScheme + (":" + url.possibly_invalid_spec()));
|
||||
+ }
|
||||
+
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] {
|
||||
return NetLogURLRequestConstructorParams(url, priority_,
|
||||
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
|
||||
--- a/net/url_request/url_request_context_builder.cc
|
||||
+++ b/net/url_request/url_request_context_builder.cc
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "net/socket/network_binding_client_socket_factory.h"
|
||||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
#include "net/url_request/static_http_user_agent_settings.h"
|
||||
+#include "net/url_request/trk_protocol_handler.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
#include "net/url_request/url_request_throttler_manager.h"
|
||||
@@ -571,6 +572,8 @@ std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
|
||||
job_factory->SetProtocolHandler(scheme_handler.first,
|
||||
std::move(scheme_handler.second));
|
||||
}
|
||||
+ job_factory->SetProtocolHandler(url::kTraceScheme,
|
||||
+ std::make_unique<TrkProtocolHandler>());
|
||||
protocol_handlers_.clear();
|
||||
|
||||
context->set_job_factory(std::move(job_factory));
|
||||
diff --git a/url/url_constants.cc b/url/url_constants.cc
|
||||
--- a/url/url_constants.cc
|
||||
+++ b/url/url_constants.cc
|
||||
@@ -29,6 +29,7 @@ const char16_t kDataScheme16[] = u"data";
|
||||
const char kFileScheme[] = "file";
|
||||
const char16_t kFileScheme16[] = u"file";
|
||||
const char kFileSystemScheme[] = "filesystem";
|
||||
+const char kTraceScheme[] = "trk";
|
||||
const char16_t kFileSystemScheme16[] = u"filesystem";
|
||||
const char kFtpScheme[] = "ftp";
|
||||
const char16_t kFtpScheme16[] = u"ftp";
|
||||
diff --git a/url/url_constants.h b/url/url_constants.h
|
||||
--- a/url/url_constants.h
|
||||
+++ b/url/url_constants.h
|
||||
@@ -33,6 +33,7 @@ COMPONENT_EXPORT(URL) extern const char16_t kContentIDScheme16[];
|
||||
COMPONENT_EXPORT(URL) extern const char kDataScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char16_t kDataScheme16[];
|
||||
COMPONENT_EXPORT(URL) extern const char kFileScheme[];
|
||||
+COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char16_t kFileScheme16[];
|
||||
COMPONENT_EXPORT(URL) extern const char kFileSystemScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char16_t kFileSystemScheme16[];
|
||||
diff --git a/url/url_util.cc b/url/url_util.cc
|
||||
--- a/url/url_util.cc
|
||||
+++ b/url/url_util.cc
|
||||
@@ -46,6 +46,7 @@ struct SchemeRegistry {
|
||||
std::vector<SchemeWithType> standard_schemes = {
|
||||
{kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
|
||||
{kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
|
||||
+ {kTraceScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
|
||||
// Yes, file URLs can have a hostname, so file URLs should be handled as
|
||||
// "standard". File URLs never have a port as specified by the SchemeType
|
||||
// field. Unlike other SCHEME_WITH_HOST schemes, the 'host' in a file
|
||||
@@ -89,6 +90,7 @@ struct SchemeRegistry {
|
||||
kAboutScheme,
|
||||
kJavaScriptScheme,
|
||||
kDataScheme,
|
||||
+ kTraceScheme,
|
||||
};
|
||||
|
||||
// Schemes that can be sent CORS requests.
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,96 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 9 Apr 2022 23:01:55 +0200
|
||||
Subject: Bookmarks select all menu entry
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/menu/bookmark_action_bar_menu.xml | 7 +++++++
|
||||
.../browser/bookmarks/BookmarkActionBar.java | 15 +++++++++++++++
|
||||
.../ui/android/strings/android_chrome_strings.grd | 3 +++
|
||||
3 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/bookmark_action_bar_menu.xml b/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
--- a/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
@@ -23,6 +23,13 @@ found in the LICENSE file.
|
||||
android:visible="false"
|
||||
app:showAsAction="ifRoom"
|
||||
app:iconTint="@color/default_icon_color_secondary_tint_list" />
|
||||
+ <item
|
||||
+ android:id="@+id/select_all_menu_id"
|
||||
+ android:icon="@drawable/ic_done_blue"
|
||||
+ android:title="@string/select_all_bookmarks"
|
||||
+ android:visible="true"
|
||||
+ app:showAsAction="ifRoom"
|
||||
+ app:iconTint="@color/default_icon_color_tint_list" />
|
||||
<item
|
||||
android:id="@+id/import_menu_id"
|
||||
android:icon="@drawable/ic_folder_blue_24dp"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
@@ -27,6 +27,7 @@ import org.chromium.components.browser_ui.widget.selectable_list.SelectableListT
|
||||
import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate;
|
||||
|
||||
import java.util.List;
|
||||
+import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Main action bar of bookmark UI. It is responsible for displaying title and buttons
|
||||
@@ -146,6 +147,17 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
}
|
||||
selectionDelegate.clearSelection();
|
||||
return true;
|
||||
+ } else if (menuItem.getItemId() == R.id.select_all_menu_id) {
|
||||
+ BookmarkModel bookmarkModel = mDelegate.getModel();
|
||||
+ if (bookmarkModel.isBookmarkModelLoaded()) {
|
||||
+ List<BookmarkItem> items = bookmarkModel.getBookmarksForFolder(mCurrentFolder.getId());
|
||||
+ HashSet<BookmarkId> ids = new HashSet<>(items.size());
|
||||
+ for (BookmarkItem item : items) {
|
||||
+ ids.add(item.getId());
|
||||
+ }
|
||||
+ selectionDelegate.setSelectedItems(ids);
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
|
||||
assert false : "Unhandled menu click.";
|
||||
@@ -155,6 +167,7 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
void showLoadingUi() {
|
||||
setTitle(null);
|
||||
setNavigationButton(NAVIGATION_BUTTON_NONE);
|
||||
+ getMenu().findItem(R.id.select_all_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.import_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.export_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(false);
|
||||
@@ -166,6 +179,7 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
super.showNormalView();
|
||||
|
||||
if (mDelegate == null) {
|
||||
+ getMenu().findItem(R.id.select_all_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.import_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.export_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(false);
|
||||
@@ -197,6 +211,7 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
@Override
|
||||
public void onFolderStateSet(BookmarkId folder) {
|
||||
mCurrentFolder = mDelegate.getModel().getBookmarkById(folder);
|
||||
+ getMenu().findItem(R.id.select_all_menu_id).setVisible(true);
|
||||
getMenu().findItem(R.id.import_menu_id).setVisible(true);
|
||||
getMenu().findItem(R.id.export_menu_id).setVisible(true);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(true);
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -243,6 +243,9 @@ CHAR_LIMIT guidelines:
|
||||
<message name="IDS_NOTIFICATION_CATEGORY_SITES" desc="Label for notifications from websites, within a list of notification categories. [CHAR_LIMIT=32]">
|
||||
Sites
|
||||
</message>
|
||||
+ <message name="IDS_SELECT_ALL_BOOKMARKS" desc="The label for the select all bookmarks button.">
|
||||
+ Select all
|
||||
+ </message>
|
||||
<message name="IDS_IMPORT_BOOKMARKS" desc="The label for the import bookmarks button.">
|
||||
Import
|
||||
</message>
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 8 Jan 2022 19:42:34 +0100
|
||||
Subject: Bromite package name
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/BUILD.gn | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -47,7 +47,7 @@ chrome_jni_registration_header =
|
||||
chrome_jni_for_test_registration_header = "$root_build_dir/gen/chrome/browser/android/chrome_jni_for_test_registration.h"
|
||||
|
||||
if (current_toolchain == default_toolchain) {
|
||||
- _default_package = "org.chromium.chrome"
|
||||
+ _default_package = "org.bromite.bromite"
|
||||
if (use_stable_package_name_for_trichrome) {
|
||||
_default_package += ".stable"
|
||||
} else if (android_channel != "default" && android_channel != "stable") {
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 8 Jan 2022 19:42:34 +0100
|
||||
Subject: Chromium package name
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/BUILD.gn | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -51,7 +51,7 @@ chrome_jni_registration_header =
|
||||
chrome_jni_for_test_registration_header = "$root_build_dir/gen/chrome/browser/android/chrome_jni_for_test_registration.h"
|
||||
|
||||
if (current_toolchain == default_toolchain) {
|
||||
- _default_package = "org.chromium.chrome"
|
||||
+ _default_package = "org.bromite.chromium"
|
||||
if (use_stable_package_name_for_trichrome) {
|
||||
_default_package += ".stable"
|
||||
} else if (android_channel != "default" && android_channel != "stable") {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,40 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 3 Oct 2022 09:39:07 +0000
|
||||
Subject: Clamp time resolution in requestAnimationFrame
|
||||
|
||||
Aligns requestAnimationFrame's WebWorker callback to the W3C specification
|
||||
See https://bugs.chromium.org/p/chromium/issues/detail?id=1236113
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../animation_frame/worker_animation_frame_provider.cc | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc
|
||||
--- a/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc
|
||||
+++ b/third_party/blink/renderer/core/animation_frame/worker_animation_frame_provider.cc
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "third_party/blink/renderer/core/execution_context/agent.h"
|
||||
#include "third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h"
|
||||
+#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/casting.h"
|
||||
#include "third_party/blink/renderer/core/timing/worker_global_scope_performance.h"
|
||||
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
|
||||
@@ -63,7 +65,11 @@ void WorkerAnimationFrameProvider::BeginFrame(const viz::BeginFrameArgs& args) {
|
||||
}
|
||||
}
|
||||
|
||||
- double time = (args.frame_time - base::TimeTicks()).InMillisecondsF();
|
||||
+ auto* global_scope = DynamicTo<WorkerGlobalScope>(provider->context_.Get());
|
||||
+ DCHECK(global_scope);
|
||||
+ double time = Performance::ClampTimeResolution(
|
||||
+ args.frame_time - global_scope->TimeOrigin(),
|
||||
+ provider->context_->CrossOriginIsolatedCapability());
|
||||
provider->callback_collection_.ExecuteFrameCallbacks(time, time);
|
||||
}
|
||||
provider->begin_frame_provider_->FinishBeginFrame(args);
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,139 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 22 Jul 2021 23:10:52 +0200
|
||||
Subject: Client hints overrides
|
||||
|
||||
Disable critical client hints
|
||||
Use Google Chrome branding for client hints
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
components/embedder_support/user_agent_utils.cc | 4 +---
|
||||
content/browser/client_hints/client_hints.cc | 3 ++-
|
||||
content/browser/loader/navigation_url_loader_impl.cc | 5 +++++
|
||||
content/public/common/content_features.cc | 4 ++--
|
||||
services/network/public/cpp/client_hints.cc | 1 +
|
||||
services/network/public/cpp/features.cc | 2 +-
|
||||
third_party/blink/common/client_hints/client_hints.cc | 1 +
|
||||
.../blink/common/client_hints/enabled_client_hints.cc | 4 +++-
|
||||
8 files changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc
|
||||
--- a/components/embedder_support/user_agent_utils.cc
|
||||
+++ b/components/embedder_support/user_agent_utils.cc
|
||||
@@ -265,9 +265,7 @@ const blink::UserAgentBrandList GetUserAgentBrandList(
|
||||
bool parse_result = base::StringToInt(major_version, &major_version_number);
|
||||
DCHECK(parse_result);
|
||||
absl::optional<std::string> brand;
|
||||
-#if !BUILDFLAG(CHROMIUM_BRANDING)
|
||||
- brand = version_info::GetProductName();
|
||||
-#endif
|
||||
+ brand = "Google Chrome";
|
||||
absl::optional<std::string> maybe_brand_override =
|
||||
base::GetFieldTrialParamValueByFeature(features::kGreaseUACH,
|
||||
"brand_override");
|
||||
diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/client_hints/client_hints.cc
|
||||
--- a/content/browser/client_hints/client_hints.cc
|
||||
+++ b/content/browser/client_hints/client_hints.cc
|
||||
@@ -478,7 +478,8 @@ void AddPrefersReducedMotionHeader(net::HttpRequestHeaders* headers,
|
||||
: network::kPrefersReducedMotionNoPreference);
|
||||
}
|
||||
|
||||
-bool IsValidURLForClientHints(const url::Origin& origin) {
|
||||
+bool IsValidURLForClientHints(const url::Origin& origin) { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
return network::IsOriginPotentiallyTrustworthy(origin);
|
||||
}
|
||||
|
||||
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc
|
||||
--- a/content/browser/loader/navigation_url_loader_impl.cc
|
||||
+++ b/content/browser/loader/navigation_url_loader_impl.cc
|
||||
@@ -1024,6 +1024,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!base::FeatureList::IsEnabled(network::features::kAcceptCHFrame)) {
|
||||
+ std::move(callback).Run(net::OK);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
LogAcceptCHFrameStatus(AcceptCHFrameRestart::kFramePresent);
|
||||
|
||||
// Given that this is happening in the middle of navigation, there should
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -257,8 +257,8 @@ BASE_FEATURE(kCrashReporting,
|
||||
// Enables support for the `Critical-CH` response header.
|
||||
// https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
|
||||
BASE_FEATURE(kCriticalClientHint,
|
||||
- "CriticalClientHint",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "CriticalClientHint", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enable debugging the issue crbug.com/1201355
|
||||
BASE_FEATURE(kDebugHistoryInterventionNoUserActivation,
|
||||
diff --git a/services/network/public/cpp/client_hints.cc b/services/network/public/cpp/client_hints.cc
|
||||
--- a/services/network/public/cpp/client_hints.cc
|
||||
+++ b/services/network/public/cpp/client_hints.cc
|
||||
@@ -113,6 +113,7 @@ const DecodeMap& GetDecodeMap() {
|
||||
|
||||
absl::optional<std::vector<network::mojom::WebClientHintsType>>
|
||||
ParseClientHintsHeader(const std::string& header) {
|
||||
+ if ((true)) return absl::nullopt;
|
||||
// Accept-CH is an sh-list of tokens; see:
|
||||
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-header-structure-19#section-3.1
|
||||
absl::optional<net::structured_headers::List> maybe_list =
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -198,7 +198,7 @@ BASE_FEATURE(kWebSocketReassembleShortMessages,
|
||||
// Enable support for ACCEPT_CH H2/3 frame as part of Client Hint Reliability.
|
||||
// See:
|
||||
// https://tools.ietf.org/html/draft-davidben-http-client-hint-reliability-02#section-4.3
|
||||
-BASE_FEATURE(kAcceptCHFrame, "AcceptCHFrame", base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kAcceptCHFrame, "AcceptCHFrame", base::FEATURE_DISABLED_BY_DEFAULT); // disabled by default in Bromite
|
||||
|
||||
BASE_FEATURE(kSCTAuditingRetryReports,
|
||||
"SCTAuditingRetryReports",
|
||||
diff --git a/third_party/blink/common/client_hints/client_hints.cc b/third_party/blink/common/client_hints/client_hints.cc
|
||||
--- a/third_party/blink/common/client_hints/client_hints.cc
|
||||
+++ b/third_party/blink/common/client_hints/client_hints.cc
|
||||
@@ -105,6 +105,7 @@ const PolicyFeatureToClientHintMap& GetPolicyFeatureToClientHintMap() {
|
||||
}
|
||||
|
||||
bool IsClientHintSentByDefault(network::mojom::WebClientHintsType type) {
|
||||
+ if ((true)) return false;
|
||||
switch (type) {
|
||||
case network::mojom::WebClientHintsType::kSaveData:
|
||||
case network::mojom::WebClientHintsType::kUA:
|
||||
diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/third_party/blink/common/client_hints/enabled_client_hints.cc
|
||||
--- a/third_party/blink/common/client_hints/enabled_client_hints.cc
|
||||
+++ b/third_party/blink/common/client_hints/enabled_client_hints.cc
|
||||
@@ -21,6 +21,7 @@ namespace {
|
||||
using ::network::mojom::WebClientHintsType;
|
||||
|
||||
bool IsDisabledByFeature(const WebClientHintsType type) {
|
||||
+ if ((true)) return true;
|
||||
switch (type) {
|
||||
case WebClientHintsType::kUA:
|
||||
case WebClientHintsType::kUAArch:
|
||||
@@ -138,7 +139,7 @@ bool IsOriginTrialEnabled(const GURL& url,
|
||||
} // namespace
|
||||
|
||||
bool EnabledClientHints::IsEnabled(const WebClientHintsType type) const {
|
||||
- return enabled_types_[static_cast<int>(type)];
|
||||
+ return false;
|
||||
}
|
||||
|
||||
void EnabledClientHints::SetIsEnabled(const WebClientHintsType type,
|
||||
@@ -167,6 +168,7 @@ void EnabledClientHints::SetIsEnabled(
|
||||
|
||||
std::vector<WebClientHintsType> EnabledClientHints::GetEnabledHints() const {
|
||||
std::vector<WebClientHintsType> hints;
|
||||
+ if ((true)) return hints;
|
||||
for (const auto& elem : network::GetClientHintToNameMap()) {
|
||||
const auto& type = elem.first;
|
||||
if (IsEnabled(type))
|
||||
--
|
||||
2.25.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,978 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 19 Mar 2022 10:53:24 +0100
|
||||
Subject: Dictionary suggestions for the Omnibox
|
||||
|
||||
Revert "Disable Dictionary suggestions for the Omnibox"
|
||||
|
||||
This reverts commit d3ec2b2d25066ec089f8351a44b919ded4270e83.
|
||||
|
||||
Original License: BSD-3-Clause - https://spdx.org/licenses/BSD-3-Clause.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/java/res/layout/url_bar.xml | 1 +
|
||||
.../chrome/browser/omnibox/UrlBar.java | 931 ++++++++++++++++++
|
||||
.../chrome/browser/omnibox/UrlBar.java | 3 +-
|
||||
3 files changed, 933 insertions(+), 2 deletions(-)
|
||||
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/url_bar.xml b/chrome/android/java/res/layout/url_bar.xml
|
||||
--- a/chrome/android/java/res/layout/url_bar.xml
|
||||
+++ b/chrome/android/java/res/layout/url_bar.xml
|
||||
@@ -15,5 +15,6 @@ found in the LICENSE file.
|
||||
android:singleLine="true"
|
||||
android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen"
|
||||
android:textSize="@dimen/location_bar_url_text_size"
|
||||
+ android:inputType="textUri"
|
||||
android:hint="@string/search_or_type_web_address"
|
||||
android:importantForAutofill="no" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
@@ -0,0 +1,931 @@
|
||||
+// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+package org.chromium.chrome.browser.omnibox;
|
||||
+
|
||||
+import android.content.Context;
|
||||
+import android.graphics.Canvas;
|
||||
+import android.graphics.Paint;
|
||||
+import android.graphics.Rect;
|
||||
+import android.os.Build;
|
||||
+import android.provider.Settings;
|
||||
+import android.text.Editable;
|
||||
+import android.text.InputType;
|
||||
+import android.text.Layout;
|
||||
+import android.text.Selection;
|
||||
+import android.text.SpannableStringBuilder;
|
||||
+import android.text.TextUtils;
|
||||
+import android.text.TextWatcher;
|
||||
+import android.text.style.ReplacementSpan;
|
||||
+import android.util.AttributeSet;
|
||||
+import android.view.GestureDetector;
|
||||
+import android.view.KeyEvent;
|
||||
+import android.view.MotionEvent;
|
||||
+import android.view.View;
|
||||
+import android.view.inputmethod.EditorInfo;
|
||||
+import android.view.inputmethod.InputConnection;
|
||||
+import android.widget.TextView;
|
||||
+
|
||||
+import androidx.annotation.IntDef;
|
||||
+import androidx.annotation.NonNull;
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.core.text.BidiFormatter;
|
||||
+import androidx.core.util.ObjectsCompat;
|
||||
+import androidx.core.view.inputmethod.EditorInfoCompat;
|
||||
+
|
||||
+import org.chromium.base.ApiCompatibilityUtils;
|
||||
+import org.chromium.base.Callback;
|
||||
+import org.chromium.base.Log;
|
||||
+import org.chromium.base.SysUtils;
|
||||
+import org.chromium.base.ThreadUtils;
|
||||
+import org.chromium.base.compat.ApiHelperForO;
|
||||
+import org.chromium.base.metrics.RecordUserAction;
|
||||
+import org.chromium.ui.KeyboardVisibilityDelegate;
|
||||
+import org.chromium.ui.base.WindowDelegate;
|
||||
+
|
||||
+import java.lang.annotation.Retention;
|
||||
+import java.lang.annotation.RetentionPolicy;
|
||||
+
|
||||
+/**
|
||||
+ * The URL text entry view for the Omnibox.
|
||||
+ */
|
||||
+public abstract class UrlBar extends AutocompleteEditText {
|
||||
+ private static final String TAG = "UrlBar";
|
||||
+
|
||||
+ private static final boolean DEBUG = false;
|
||||
+
|
||||
+ // TextView becomes very slow on long strings, so we limit maximum length
|
||||
+ // of what is displayed to the user, see limitDisplayableLength().
|
||||
+ private static final int MAX_DISPLAYABLE_LENGTH = 4000;
|
||||
+ private static final int MAX_DISPLAYABLE_LENGTH_LOW_END = 1000;
|
||||
+
|
||||
+ private boolean mFirstDrawComplete;
|
||||
+
|
||||
+ /**
|
||||
+ * The text direction of the URL or query: LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, or
|
||||
+ * LAYOUT_DIRECTION_RTL.
|
||||
+ * */
|
||||
+ private int mUrlDirection;
|
||||
+
|
||||
+ private UrlBarDelegate mUrlBarDelegate;
|
||||
+ private UrlTextChangeListener mUrlTextChangeListener;
|
||||
+ private TextWatcher mTextChangedListener;
|
||||
+ private UrlBarTextContextMenuDelegate mTextContextMenuDelegate;
|
||||
+ private Callback<Integer> mUrlDirectionListener;
|
||||
+
|
||||
+ /**
|
||||
+ * The gesture detector is used to detect long presses. Long presses require special treatment
|
||||
+ * because the URL bar has custom touch event handling. See: {@link #onTouchEvent}.
|
||||
+ */
|
||||
+ private final GestureDetector mGestureDetector;
|
||||
+
|
||||
+ private final KeyboardHideHelper mKeyboardHideHelper;
|
||||
+
|
||||
+ private boolean mFocused;
|
||||
+ private boolean mSuppressingTouchMoveEventsForThisTouch;
|
||||
+ private MotionEvent mSuppressedTouchDownEvent;
|
||||
+ private boolean mAllowFocus = true;
|
||||
+
|
||||
+ private boolean mPendingScroll;
|
||||
+ private int mPreviousWidth;
|
||||
+
|
||||
+ @ScrollType
|
||||
+ private int mPreviousScrollType;
|
||||
+ private String mPreviousScrollText;
|
||||
+ private int mPreviousScrollViewWidth;
|
||||
+ private int mPreviousScrollResultXPosition;
|
||||
+ private float mPreviousScrollFontSize;
|
||||
+ private boolean mPreviousScrollWasRtl;
|
||||
+
|
||||
+ // Used as a hint to indicate the text may contain an ellipsize span. This will be true if an
|
||||
+ // ellispize span was applied the last time the text changed. A true value here does not
|
||||
+ // guarantee that the text does contain the span currently as newly set text may have cleared
|
||||
+ // this (and it the value will only be recalculated after the text has been changed).
|
||||
+ private boolean mDidEllipsizeTextHint;
|
||||
+
|
||||
+ /** A cached point for getting this view's location in the window. */
|
||||
+ private final int[] mCachedLocation = new int[2];
|
||||
+
|
||||
+ /** The location of this view on the last ACTION_DOWN event. */
|
||||
+ private float mDownEventViewTop;
|
||||
+
|
||||
+ /**
|
||||
+ * The character index in the displayed text where the origin ends. This is required to
|
||||
+ * ensure that the end of the origin is not scrolled out of view for long hostnames.
|
||||
+ */
|
||||
+ private int mOriginEndIndex;
|
||||
+
|
||||
+ @ScrollType
|
||||
+ private int mScrollType;
|
||||
+
|
||||
+ /** What scrolling action should be taken after the URL bar text changes. **/
|
||||
+ @IntDef({ScrollType.NO_SCROLL, ScrollType.SCROLL_TO_TLD, ScrollType.SCROLL_TO_BEGINNING})
|
||||
+ @Retention(RetentionPolicy.SOURCE)
|
||||
+ public @interface ScrollType {
|
||||
+ int NO_SCROLL = 0;
|
||||
+ int SCROLL_TO_TLD = 1;
|
||||
+ int SCROLL_TO_BEGINNING = 2;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * An optional string to use with AccessibilityNodeInfo to report text content.
|
||||
+ * This is particularly important for auto-fill applications, such as password managers, that
|
||||
+ * rely on AccessibilityNodeInfo data to apply related form-fill data.
|
||||
+ */
|
||||
+ private CharSequence mTextForAutofillServices;
|
||||
+ protected boolean mRequestingAutofillStructure;
|
||||
+
|
||||
+ /**
|
||||
+ * Delegate used to communicate with the content side and the parent layout.
|
||||
+ */
|
||||
+ public interface UrlBarDelegate {
|
||||
+ /**
|
||||
+ * @return The view to be focused on a backward focus traversal.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ View getViewForUrlBackFocus();
|
||||
+
|
||||
+ /**
|
||||
+ * @return Whether the keyboard should be allowed to learn from the user input.
|
||||
+ */
|
||||
+ boolean allowKeyboardLearning();
|
||||
+
|
||||
+ /**
|
||||
+ * Called to notify that back key has been pressed while the URL bar has focus.
|
||||
+ */
|
||||
+ void backKeyPressed();
|
||||
+
|
||||
+ /**
|
||||
+ * Called to notify that a tap or long press gesture has been detected.
|
||||
+ * @param isLongPress Whether or not is a long press gesture.
|
||||
+ */
|
||||
+ void gestureDetected(boolean isLongPress);
|
||||
+ }
|
||||
+
|
||||
+ /** Provides updates about the URL text changes. */
|
||||
+ public interface UrlTextChangeListener {
|
||||
+ /**
|
||||
+ * Called when the text state has changed.
|
||||
+ * @param textWithoutAutocomplete The url bar text without autocompletion.
|
||||
+ * @param textWithAutocomplete The url bar text with autocompletion.
|
||||
+ */
|
||||
+ // TODO(crbug.com/1003080): Consider splitting these into two different callbacks.
|
||||
+ void onTextChanged(String textWithoutAutocomplete, String textWithAutocomplete);
|
||||
+ }
|
||||
+
|
||||
+ /** Delegate that provides the additional functionality to the textual context menus. */
|
||||
+ interface UrlBarTextContextMenuDelegate {
|
||||
+ /** @return The text to be pasted into the UrlBar. */
|
||||
+ @NonNull
|
||||
+ String getTextToPaste();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets potential replacement text to be used instead of the current selected text for
|
||||
+ * cut/copy actions. If null is returned, the existing text will be cut or copied.
|
||||
+ *
|
||||
+ * @param currentText The current displayed text.
|
||||
+ * @param selectionStart The selection start in the display text.
|
||||
+ * @param selectionEnd The selection end in the display text.
|
||||
+ * @return The text to be cut/copied instead of the currently selected text.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ String getReplacementCutCopyText(String currentText, int selectionStart, int selectionEnd);
|
||||
+ }
|
||||
+
|
||||
+ public UrlBar(Context context, AttributeSet attrs) {
|
||||
+ super(context, attrs);
|
||||
+ mUrlDirection = LAYOUT_DIRECTION_LOCALE;
|
||||
+
|
||||
+ // The URL Bar is derived from an text edit class, and as such is focusable by
|
||||
+ // default. This means that if it is created before the first draw of the UI it
|
||||
+ // will (as the only focusable element of the UI) get focus on the first draw.
|
||||
+ // We react to this by greying out the tab area and bringing up the keyboard,
|
||||
+ // which we don't want to do at startup. Prevent this by disabling focus until
|
||||
+ // the first draw.
|
||||
+ setFocusable(false);
|
||||
+ setFocusableInTouchMode(false);
|
||||
+
|
||||
+ // The HTC Sense IME will attempt to autocomplete words in the Omnibox when Prediction is
|
||||
+ // enabled. We want to disable this feature and rely on the Omnibox's implementation.
|
||||
+ // Their IME does not respect ~TYPE_TEXT_FLAG_AUTO_COMPLETE nor any of the other InputType
|
||||
+ // options I tried, but setting the filter variation prevents it. Sadly, it also removes
|
||||
+ // the .com button, but the prediction was buggy as it would autocomplete words even when
|
||||
+ // typing at the beginning of the omnibox text when other content was present (messing up
|
||||
+ // what was previously there). See bug: http://b/issue?id=6200071
|
||||
+ String defaultIme = Settings.Secure.getString(
|
||||
+ getContext().getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
|
||||
+ if (defaultIme != null && defaultIme.contains("com.htc.android.htcime")) {
|
||||
+ setInputType(getInputType() | InputType.TYPE_TEXT_VARIATION_FILTER);
|
||||
+ }
|
||||
+
|
||||
+ mGestureDetector =
|
||||
+ new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
||||
+ @Override
|
||||
+ public void onLongPress(MotionEvent e) {
|
||||
+ if (mUrlBarDelegate == null) return;
|
||||
+ mUrlBarDelegate.gestureDetected(true);
|
||||
+ performLongClick();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onSingleTapUp(MotionEvent e) {
|
||||
+ if (mUrlBarDelegate == null) return true;
|
||||
+ requestFocus();
|
||||
+ mUrlBarDelegate.gestureDetected(false);
|
||||
+ return true;
|
||||
+ }
|
||||
+ }, ThreadUtils.getUiThreadHandler());
|
||||
+ mGestureDetector.setOnDoubleTapListener(null);
|
||||
+ mKeyboardHideHelper = new KeyboardHideHelper(this, new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ if (mUrlBarDelegate != null) mUrlBarDelegate.backKeyPressed();
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
+ ApiCompatibilityUtils.disableSmartSelectionTextClassifier(this);
|
||||
+ }
|
||||
+
|
||||
+ public void destroy() {
|
||||
+ setAllowFocus(false);
|
||||
+ mUrlBarDelegate = null;
|
||||
+ setOnFocusChangeListener(null);
|
||||
+ mTextContextMenuDelegate = null;
|
||||
+ mUrlTextChangeListener = null;
|
||||
+ mTextChangedListener = null;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Initialize the delegate that allows interaction with the Window.
|
||||
+ */
|
||||
+ public void setWindowDelegate(WindowDelegate windowDelegate) {
|
||||
+ mKeyboardHideHelper.setWindowDelegate(windowDelegate);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the delegate to be used for text context menu actions.
|
||||
+ */
|
||||
+ public void setTextContextMenuDelegate(UrlBarTextContextMenuDelegate delegate) {
|
||||
+ mTextContextMenuDelegate = delegate;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
||||
+ if (KeyEvent.KEYCODE_BACK == keyCode && event.getAction() == KeyEvent.ACTION_UP) {
|
||||
+ mKeyboardHideHelper.monitorForKeyboardHidden();
|
||||
+ }
|
||||
+ return super.onKeyPreIme(keyCode, event);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * See {@link AutocompleteEditText#setIgnoreTextChangesForAutocomplete(boolean)}.
|
||||
+ * <p>
|
||||
+ * {@link #setDelegate(UrlBarDelegate)} must be called with a non-null instance prior to
|
||||
+ * enabling autocomplete.
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setIgnoreTextChangesForAutocomplete(boolean ignoreAutocomplete) {
|
||||
+ assert mUrlBarDelegate != null;
|
||||
+ super.setIgnoreTextChangesForAutocomplete(ignoreAutocomplete);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
|
||||
+ mFocused = focused;
|
||||
+ super.onFocusChanged(focused, direction, previouslyFocusedRect);
|
||||
+
|
||||
+ if (focused) {
|
||||
+ mPendingScroll = false;
|
||||
+ }
|
||||
+ fixupTextDirection();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets whether this {@link UrlBar} should be focusable.
|
||||
+ */
|
||||
+ public void setAllowFocus(boolean allowFocus) {
|
||||
+ mAllowFocus = allowFocus;
|
||||
+ setFocusable(allowFocus);
|
||||
+ setFocusableInTouchMode(allowFocus);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the {@link UrlBar}'s text direction based on focus and contents.
|
||||
+ *
|
||||
+ * Should be called whenever focus or text contents change.
|
||||
+ */
|
||||
+ private void fixupTextDirection() {
|
||||
+ // When unfocused, force left-to-right rendering at the paragraph level (which is desired
|
||||
+ // for URLs). Right-to-left runs are still rendered RTL, but will not flip the whole URL
|
||||
+ // around. This is consistent with OmniboxViewViews on desktop. When focused, render text
|
||||
+ // normally (to allow users to make non-URL searches and to avoid showing Android's split
|
||||
+ // insertion point when an RTL user enters RTL text). Also render text normally when the
|
||||
+ // text field is empty (because then it displays an instruction that is not a URL).
|
||||
+ if (mFocused || length() == 0) {
|
||||
+ setTextDirection(TEXT_DIRECTION_INHERIT);
|
||||
+ } else {
|
||||
+ setTextDirection(TEXT_DIRECTION_LTR);
|
||||
+ }
|
||||
+ // Always align to the same as the paragraph direction (LTR = left, RTL = right).
|
||||
+ setTextAlignment(TEXT_ALIGNMENT_TEXT_START);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onWindowFocusChanged(boolean hasWindowFocus) {
|
||||
+ super.onWindowFocusChanged(hasWindowFocus);
|
||||
+ if (DEBUG) Log.i(TAG, "onWindowFocusChanged: " + hasWindowFocus);
|
||||
+ if (hasWindowFocus) {
|
||||
+ if (isFocused()) {
|
||||
+ // Without the call to post(..), the keyboard was not getting shown when the
|
||||
+ // window regained focus despite this being the final call in the view system
|
||||
+ // flow.
|
||||
+ post(new Runnable() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ KeyboardVisibilityDelegate.getInstance().showKeyboard(UrlBar.this);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public View focusSearch(int direction) {
|
||||
+ if (mUrlBarDelegate != null && direction == View.FOCUS_BACKWARD
|
||||
+ && mUrlBarDelegate.getViewForUrlBackFocus() != null) {
|
||||
+ return mUrlBarDelegate.getViewForUrlBackFocus();
|
||||
+ } else {
|
||||
+ return super.focusSearch(direction);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
|
||||
+ super.onTextChanged(text, start, lengthBefore, lengthAfter);
|
||||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
+ // Due to crbug.com/1103555, Autofill had to be disabled on the UrlBar to work around
|
||||
+ // an issue on Android Q+. With Autofill disabled, the Autofill compat mode no longer
|
||||
+ // learns of changes to the UrlBar, which prevents it from cancelling the session if
|
||||
+ // the domain changes. We restore this behavior by mimicking the relevant part of
|
||||
+ // TextView.notifyListeningManagersAfterTextChanged().
|
||||
+ // https://cs.android.com/android/platform/superproject/+/5d123b67756dffcfdebdb936ab2de2b29c799321:frameworks/base/core/java/android/widget/TextView.java;l=10618;drc=master;bpv=0
|
||||
+ ApiHelperForO.notifyValueChangedForAutofill(this);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onTouchEvent(MotionEvent event) {
|
||||
+ // This method contains special logic to enable long presses to be handled correctly.
|
||||
+
|
||||
+ // One piece of the logic is to suppress all ACTION_DOWN events received while the UrlBar is
|
||||
+ // not focused, and only pass them to super.onTouchEvent() if it turns out we're about to
|
||||
+ // perform a long press. Long pressing will not behave properly without sending this event,
|
||||
+ // but if we always send it immediately, it will cause the keyboard to show immediately,
|
||||
+ // whereas we want to wait to show it until after the URL focus animation finishes, to avoid
|
||||
+ // performance issues on slow devices.
|
||||
+
|
||||
+ // The other piece of the logic is to suppress ACTION_MOVE events received after an
|
||||
+ // ACTION_DOWN received while the UrlBar is not focused. This is because the UrlBar moves to
|
||||
+ // the side as it's focusing, and a finger held still on the screen would therefore be
|
||||
+ // interpreted as a drag selection.
|
||||
+
|
||||
+ if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
+ getLocationInWindow(mCachedLocation);
|
||||
+ mDownEventViewTop = mCachedLocation[1];
|
||||
+ mSuppressingTouchMoveEventsForThisTouch = !mFocused;
|
||||
+ }
|
||||
+
|
||||
+ if (!mFocused) {
|
||||
+ if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
+ mSuppressedTouchDownEvent = MotionEvent.obtain(event);
|
||||
+ }
|
||||
+ mGestureDetector.onTouchEvent(event);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (event.getActionMasked() == MotionEvent.ACTION_UP
|
||||
+ || event.getActionMasked() == MotionEvent.ACTION_CANCEL) {
|
||||
+ // Minor optimization to avoid unnecessarily holding onto a MotionEvent after the touch
|
||||
+ // finishes.
|
||||
+ mSuppressedTouchDownEvent = null;
|
||||
+ }
|
||||
+
|
||||
+ if (mSuppressingTouchMoveEventsForThisTouch
|
||||
+ && event.getActionMasked() == MotionEvent.ACTION_MOVE) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ return super.onTouchEvent(event);
|
||||
+ } catch (NullPointerException e) {
|
||||
+ // Working around a platform bug (b/25562038) that was fixed in N that can throw an
|
||||
+ // exception during text selection. We just swallow the exception. The outcome is that
|
||||
+ // the text selection handle doesn't show.
|
||||
+
|
||||
+ // If this happens on N or later, there's a different issue here that we might want to
|
||||
+ // know about.
|
||||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) throw e;
|
||||
+
|
||||
+ Log.w(TAG, "Ignoring NPE in UrlBar#onTouchEvent.", e);
|
||||
+ return true;
|
||||
+ } catch (IndexOutOfBoundsException e) {
|
||||
+ // Work around crash of unknown origin (https://crbug.com/837419).
|
||||
+ Log.w(TAG, "Ignoring IndexOutOfBoundsException in UrlBar#onTouchEvent.", e);
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean performLongClick() {
|
||||
+ if (!shouldPerformLongClick()) return false;
|
||||
+
|
||||
+ releaseSuppressedTouchDownEvent();
|
||||
+ return super.performLongClick();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return Whether or not a long click should be performed.
|
||||
+ */
|
||||
+ private boolean shouldPerformLongClick() {
|
||||
+ getLocationInWindow(mCachedLocation);
|
||||
+
|
||||
+ // If the view moved between the last down event, block the long-press.
|
||||
+ return mDownEventViewTop == mCachedLocation[1];
|
||||
+ }
|
||||
+
|
||||
+ private void releaseSuppressedTouchDownEvent() {
|
||||
+ if (mSuppressedTouchDownEvent != null) {
|
||||
+ super.onTouchEvent(mSuppressedTouchDownEvent);
|
||||
+ mSuppressedTouchDownEvent = null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onDraw(Canvas canvas) {
|
||||
+ super.onDraw(canvas);
|
||||
+
|
||||
+ if (!mFirstDrawComplete) {
|
||||
+ mFirstDrawComplete = true;
|
||||
+
|
||||
+ // We have now avoided the first draw problem (see the comment in
|
||||
+ // the constructor) so we want to make the URL bar focusable so that
|
||||
+ // touches etc. activate it.
|
||||
+ setFocusable(mAllowFocus);
|
||||
+ setFocusableInTouchMode(mAllowFocus);
|
||||
+ }
|
||||
+
|
||||
+ // Notify listeners if the URL's direction has changed.
|
||||
+ updateUrlDirection();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * If the direction of the URL has changed, update mUrlDirection and notify the
|
||||
+ * UrlDirectionListeners.
|
||||
+ */
|
||||
+ private void updateUrlDirection() {
|
||||
+ Layout layout = getLayout();
|
||||
+ if (layout == null) return;
|
||||
+
|
||||
+ int urlDirection;
|
||||
+ if (length() == 0) {
|
||||
+ urlDirection = LAYOUT_DIRECTION_LOCALE;
|
||||
+ } else if (layout.getParagraphDirection(0) == Layout.DIR_LEFT_TO_RIGHT) {
|
||||
+ urlDirection = LAYOUT_DIRECTION_LTR;
|
||||
+ } else {
|
||||
+ urlDirection = LAYOUT_DIRECTION_RTL;
|
||||
+ }
|
||||
+
|
||||
+ if (urlDirection != mUrlDirection) {
|
||||
+ mUrlDirection = urlDirection;
|
||||
+ if (mUrlDirectionListener != null) {
|
||||
+ mUrlDirectionListener.onResult(urlDirection);
|
||||
+ }
|
||||
+
|
||||
+ // Ensure the display text is visible after updating the URL direction.
|
||||
+ scrollDisplayText();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return The text direction of the URL, e.g. LAYOUT_DIRECTION_LTR.
|
||||
+ */
|
||||
+ public int getUrlDirection() {
|
||||
+ return mUrlDirection;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the listener for changes in the url bar's layout direction. Also calls
|
||||
+ * onUrlDirectionChanged() immediately on the listener.
|
||||
+ *
|
||||
+ * @param listener The UrlDirectionListener to receive callbacks when the url direction changes,
|
||||
+ * or null to unregister any previously registered listener.
|
||||
+ */
|
||||
+ public void setUrlDirectionListener(Callback<Integer> listener) {
|
||||
+ mUrlDirectionListener = listener;
|
||||
+ if (mUrlDirectionListener != null) {
|
||||
+ mUrlDirectionListener.onResult(mUrlDirection);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the url delegate to handle communication from the {@link UrlBar} to the rest of the UI.
|
||||
+ * @param delegate The {@link UrlBarDelegate} to be used.
|
||||
+ */
|
||||
+ public void setDelegate(UrlBarDelegate delegate) {
|
||||
+ mUrlBarDelegate = delegate;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the listener to be notified when the URL text has changed.
|
||||
+ * @param listener The listener to be notified.
|
||||
+ */
|
||||
+ public void setUrlTextChangeListener(UrlTextChangeListener listener) {
|
||||
+ mUrlTextChangeListener = listener;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the listener to be notified when the view's text has changed.
|
||||
+ * @param textChangedListener The listener to be notified.
|
||||
+ */
|
||||
+ public void setTextChangedListener(TextWatcher textChangedListener) {
|
||||
+ if (ObjectsCompat.equals(mTextChangedListener, textChangedListener)) {
|
||||
+ return;
|
||||
+ } else if (mTextChangedListener != null) {
|
||||
+ removeTextChangedListener(mTextChangedListener);
|
||||
+ }
|
||||
+
|
||||
+ mTextChangedListener = textChangedListener;
|
||||
+ addTextChangedListener(mTextChangedListener);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the text to report to Autofill services upon call to onProvideAutofillStructure.
|
||||
+ */
|
||||
+ public void setTextForAutofillServices(CharSequence text) {
|
||||
+ mTextForAutofillServices = text;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onTextContextMenuItem(int id) {
|
||||
+ if (mTextContextMenuDelegate == null) return super.onTextContextMenuItem(id);
|
||||
+
|
||||
+ if (id == android.R.id.paste) {
|
||||
+ String pasteString = mTextContextMenuDelegate.getTextToPaste();
|
||||
+ if (pasteString != null) {
|
||||
+ int min = 0;
|
||||
+ int max = getText().length();
|
||||
+
|
||||
+ if (isFocused()) {
|
||||
+ final int selStart = getSelectionStart();
|
||||
+ final int selEnd = getSelectionEnd();
|
||||
+
|
||||
+ min = Math.max(0, Math.min(selStart, selEnd));
|
||||
+ max = Math.max(0, Math.max(selStart, selEnd));
|
||||
+ }
|
||||
+
|
||||
+ Selection.setSelection(getText(), max);
|
||||
+ getText().replace(min, max, pasteString);
|
||||
+ onPaste();
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if ((id == android.R.id.cut || id == android.R.id.copy)) {
|
||||
+ if (id == android.R.id.cut) {
|
||||
+ RecordUserAction.record("Omnibox.LongPress.Cut");
|
||||
+ } else {
|
||||
+ RecordUserAction.record("Omnibox.LongPress.Copy");
|
||||
+ }
|
||||
+ String currentText = getText().toString();
|
||||
+ String replacementCutCopyText = mTextContextMenuDelegate.getReplacementCutCopyText(
|
||||
+ currentText, getSelectionStart(), getSelectionEnd());
|
||||
+ if (replacementCutCopyText == null) return super.onTextContextMenuItem(id);
|
||||
+
|
||||
+ setIgnoreTextChangesForAutocomplete(true);
|
||||
+ setText(replacementCutCopyText);
|
||||
+ setSelection(0, replacementCutCopyText.length());
|
||||
+ setIgnoreTextChangesForAutocomplete(false);
|
||||
+
|
||||
+ boolean retVal = super.onTextContextMenuItem(id);
|
||||
+
|
||||
+ if (TextUtils.equals(getText(), replacementCutCopyText)) {
|
||||
+ // Restore the old text if the operation did modify the text.
|
||||
+ setIgnoreTextChangesForAutocomplete(true);
|
||||
+ setText(currentText);
|
||||
+
|
||||
+ // Move the cursor to the end.
|
||||
+ setSelection(getText().length());
|
||||
+ setIgnoreTextChangesForAutocomplete(false);
|
||||
+ }
|
||||
+
|
||||
+ return retVal;
|
||||
+ }
|
||||
+
|
||||
+ if (id == android.R.id.shareText) {
|
||||
+ RecordUserAction.record("Omnibox.LongPress.Share");
|
||||
+ }
|
||||
+
|
||||
+ return super.onTextContextMenuItem(id);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Specified how text should be scrolled within the UrlBar.
|
||||
+ *
|
||||
+ * @param scrollType What type of scroll should be applied to the text.
|
||||
+ * @param scrollToIndex The index that should be scrolled to, which only applies to
|
||||
+ * {@link ScrollType#SCROLL_TO_TLD}.
|
||||
+ */
|
||||
+ public void setScrollState(@ScrollType int scrollType, int scrollToIndex) {
|
||||
+ if (scrollType == ScrollType.SCROLL_TO_TLD) {
|
||||
+ mOriginEndIndex = scrollToIndex;
|
||||
+ } else {
|
||||
+ mOriginEndIndex = 0;
|
||||
+ }
|
||||
+ mScrollType = scrollType;
|
||||
+ scrollDisplayText();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Scrolls the omnibox text to a position determined by the current scroll type.
|
||||
+ *
|
||||
+ * @see #setScrollState(int, int)
|
||||
+ */
|
||||
+ private void scrollDisplayText() {
|
||||
+ if (isLayoutRequested()) {
|
||||
+ mPendingScroll = mScrollType != ScrollType.NO_SCROLL;
|
||||
+ return;
|
||||
+ }
|
||||
+ scrollDisplayTextInternal(mScrollType);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Scrolls the omnibox text to the position specified, based on the {@link ScrollType}.
|
||||
+ *
|
||||
+ * @param scrollType What type of scroll to perform.
|
||||
+ * SCROLL_TO_TLD: Scrolls the omnibox text to bring the TLD into view.
|
||||
+ * SCROLL_TO_BEGINNING: Scrolls text that's too long to fit in the omnibox
|
||||
+ * to the beginning so we can see the first character.
|
||||
+ */
|
||||
+ private void scrollDisplayTextInternal(@ScrollType int scrollType) {
|
||||
+ mPendingScroll = false;
|
||||
+
|
||||
+ if (mFocused) return;
|
||||
+
|
||||
+ Editable text = getText();
|
||||
+ if (TextUtils.isEmpty(text)) scrollType = ScrollType.SCROLL_TO_BEGINNING;
|
||||
+
|
||||
+ // Ensure any selection from the focus state is cleared.
|
||||
+ setSelection(0);
|
||||
+
|
||||
+ float currentTextSize = getTextSize();
|
||||
+ boolean currentIsRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
|
||||
+
|
||||
+ int measuredWidth = getMeasuredWidth() - (getPaddingLeft() + getPaddingRight());
|
||||
+ if (scrollType == mPreviousScrollType && TextUtils.equals(text, mPreviousScrollText)
|
||||
+ && measuredWidth == mPreviousScrollViewWidth
|
||||
+ // Font size is float but it changes in discrete range (eg small font, big font),
|
||||
+ // therefore false negative using regular equality is unlikely.
|
||||
+ && currentTextSize == mPreviousScrollFontSize
|
||||
+ && currentIsRtl == mPreviousScrollWasRtl) {
|
||||
+ scrollTo(mPreviousScrollResultXPosition, getScrollY());
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ switch (scrollType) {
|
||||
+ case ScrollType.SCROLL_TO_TLD:
|
||||
+ scrollToTLD();
|
||||
+ break;
|
||||
+ case ScrollType.SCROLL_TO_BEGINNING:
|
||||
+ scrollToBeginning();
|
||||
+ break;
|
||||
+ default:
|
||||
+ // Intentional return to avoid clearing scroll state when no scroll was applied.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ mPreviousScrollType = scrollType;
|
||||
+ mPreviousScrollText = text.toString();
|
||||
+ mPreviousScrollViewWidth = measuredWidth;
|
||||
+ mPreviousScrollFontSize = currentTextSize;
|
||||
+ mPreviousScrollResultXPosition = getScrollX();
|
||||
+ mPreviousScrollWasRtl = currentIsRtl;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Scrolls the omnibox text to show the very beginning of the text entered.
|
||||
+ */
|
||||
+ private void scrollToBeginning() {
|
||||
+ Editable text = getText();
|
||||
+ float scrollPos = 0f;
|
||||
+ if (TextUtils.isEmpty(text)) {
|
||||
+ if (getLayoutDirection() == LAYOUT_DIRECTION_RTL
|
||||
+ && BidiFormatter.getInstance().isRtl(getHint())) {
|
||||
+ // Compared to below that uses getPrimaryHorizontal(1) due to 0 returning an
|
||||
+ // invalid value, if the text is empty, getPrimaryHorizontal(0) returns the actual
|
||||
+ // max scroll amount.
|
||||
+ scrollPos = (int) getLayout().getPrimaryHorizontal(0) - getMeasuredWidth();
|
||||
+ }
|
||||
+ } else if (BidiFormatter.getInstance().isRtl(text)) {
|
||||
+ // RTL.
|
||||
+ float endPointX = getLayout().getPrimaryHorizontal(text.length());
|
||||
+ int measuredWidth = getMeasuredWidth();
|
||||
+ float width = getLayout().getPaint().measureText(text.toString());
|
||||
+ scrollPos = Math.max(0, endPointX - measuredWidth + width);
|
||||
+ }
|
||||
+ scrollTo((int) scrollPos, getScrollY());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Scrolls the omnibox text to bring the TLD into view.
|
||||
+ */
|
||||
+ private void scrollToTLD() {
|
||||
+ Editable url = getText();
|
||||
+ int measuredWidth = getMeasuredWidth() - (getPaddingLeft() + getPaddingRight());
|
||||
+
|
||||
+ Layout textLayout = getLayout();
|
||||
+ assert getLayout().getLineCount() == 1;
|
||||
+ final int originEndIndex = Math.min(mOriginEndIndex, url.length());
|
||||
+ if (mOriginEndIndex > url.length()) {
|
||||
+ // If discovered locally, please update crbug.com/859219 with the steps to reproduce.
|
||||
+ assert false : "Attempting to scroll past the end of the URL: " + url + ", end index: "
|
||||
+ + mOriginEndIndex;
|
||||
+ }
|
||||
+ float endPointX = textLayout.getPrimaryHorizontal(originEndIndex);
|
||||
+ // Compare the position offset of the last character and the character prior to determine
|
||||
+ // the LTR-ness of the final component of the URL.
|
||||
+ float priorToEndPointX = url.length() == 1
|
||||
+ ? 0
|
||||
+ : textLayout.getPrimaryHorizontal(Math.max(0, originEndIndex - 1));
|
||||
+
|
||||
+ float scrollPos;
|
||||
+ if (priorToEndPointX < endPointX) {
|
||||
+ // LTR
|
||||
+ scrollPos = Math.max(0, endPointX - measuredWidth);
|
||||
+ } else {
|
||||
+ // RTL
|
||||
+
|
||||
+ // To handle BiDirectional text, search backward from the two existing offsets to find
|
||||
+ // the first LTR character. Ensure the final RTL component of the domain is visible
|
||||
+ // above any of the prior LTR pieces.
|
||||
+ int rtlStartIndexForEndingRun = originEndIndex - 1;
|
||||
+ for (int i = originEndIndex - 2; i >= 0; i--) {
|
||||
+ float indexOffsetDrawPosition = textLayout.getPrimaryHorizontal(i);
|
||||
+ if (indexOffsetDrawPosition > endPointX) {
|
||||
+ rtlStartIndexForEndingRun = i;
|
||||
+ } else {
|
||||
+ // getPrimaryHorizontal determines the index position for the next character
|
||||
+ // based on the previous characters. In bi-directional text, the first RTL
|
||||
+ // character following LTR text will have an LTR-appearing horizontal offset
|
||||
+ // as it is based on the preceding LTR text. Thus, the start of the RTL
|
||||
+ // character run will be after and including the first LTR horizontal index.
|
||||
+ rtlStartIndexForEndingRun = Math.max(0, rtlStartIndexForEndingRun - 1);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ float width = textLayout.getPaint().measureText(
|
||||
+ url.subSequence(rtlStartIndexForEndingRun, originEndIndex).toString());
|
||||
+ if (width < measuredWidth) {
|
||||
+ scrollPos = Math.max(0, endPointX + width - measuredWidth);
|
||||
+ } else {
|
||||
+ scrollPos = endPointX + measuredWidth;
|
||||
+ }
|
||||
+ }
|
||||
+ scrollTo((int) scrollPos, getScrollY());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
+ super.onLayout(changed, left, top, right, bottom);
|
||||
+
|
||||
+ if (mPendingScroll) {
|
||||
+ scrollDisplayTextInternal(mScrollType);
|
||||
+ } else if (mPreviousWidth != (right - left)) {
|
||||
+ scrollDisplayTextInternal(mScrollType);
|
||||
+ mPreviousWidth = right - left;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean bringPointIntoView(int offset) {
|
||||
+ // TextView internally attempts to keep the selection visible, but in the unfocused state
|
||||
+ // this class ensures that the TLD is visible.
|
||||
+ if (!mFocused) return false;
|
||||
+ assert !mPendingScroll;
|
||||
+
|
||||
+ return super.bringPointIntoView(offset);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||
+ InputConnection connection = super.onCreateInputConnection(outAttrs);
|
||||
+ if (mUrlBarDelegate == null || !mUrlBarDelegate.allowKeyboardLearning()) {
|
||||
+ outAttrs.imeOptions |= EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING;
|
||||
+ }
|
||||
+ return connection;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setText(CharSequence text, BufferType type) {
|
||||
+ if (DEBUG) Log.i(TAG, "setText -- text: %s", text);
|
||||
+ super.setText(text, type);
|
||||
+ fixupTextDirection();
|
||||
+ }
|
||||
+
|
||||
+ private void limitDisplayableLength() {
|
||||
+ // To limit displayable length we replace middle portion of the string with ellipsis.
|
||||
+ // That affects only presentation of the text, and doesn't affect other aspects like
|
||||
+ // copying to the clipboard, getting text with getText(), etc.
|
||||
+ final int maxLength =
|
||||
+ SysUtils.isLowEndDevice() ? MAX_DISPLAYABLE_LENGTH_LOW_END : MAX_DISPLAYABLE_LENGTH;
|
||||
+
|
||||
+ Editable text = getText();
|
||||
+ int textLength = text.length();
|
||||
+ if (textLength <= maxLength) {
|
||||
+ if (mDidEllipsizeTextHint) {
|
||||
+ EllipsisSpan[] spans = text.getSpans(0, textLength, EllipsisSpan.class);
|
||||
+ if (spans != null && spans.length > 0) {
|
||||
+ assert spans.length == 1 : "Should never apply more than a single EllipsisSpan";
|
||||
+ for (int i = 0; i < spans.length; i++) {
|
||||
+ text.removeSpan(spans[i]);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ mDidEllipsizeTextHint = false;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ mDidEllipsizeTextHint = true;
|
||||
+
|
||||
+ int spanLeft = text.nextSpanTransition(0, textLength, EllipsisSpan.class);
|
||||
+ if (spanLeft != textLength) return;
|
||||
+
|
||||
+ spanLeft = maxLength / 2;
|
||||
+ text.setSpan(EllipsisSpan.INSTANCE, spanLeft, textLength - spanLeft,
|
||||
+ Editable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Editable getText() {
|
||||
+ if (mRequestingAutofillStructure) {
|
||||
+ // crbug.com/1109186: mTextForAutofillServices must not be null here, but Autofill
|
||||
+ // requests can be triggered before it is initialized.
|
||||
+ return new SpannableStringBuilder(
|
||||
+ mTextForAutofillServices != null ? mTextForAutofillServices : "");
|
||||
+ }
|
||||
+ return super.getText();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public CharSequence getAccessibilityClassName() {
|
||||
+ // When UrlBar is used as a read-only TextView, force Talkback to pronounce it like
|
||||
+ // TextView. Otherwise Talkback will say "Edit box, http://...". crbug.com/636988
|
||||
+ if (isEnabled()) {
|
||||
+ return super.getAccessibilityClassName();
|
||||
+ } else {
|
||||
+ return TextView.class.getName();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void replaceAllTextFromAutocomplete(String text) {
|
||||
+ if (DEBUG) Log.i(TAG, "replaceAllTextFromAutocomplete: " + text);
|
||||
+ setText(text);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onAutocompleteTextStateChanged(boolean updateDisplay) {
|
||||
+ if (DEBUG) {
|
||||
+ Log.i(TAG, "onAutocompleteTextStateChanged: DIS[%b]", updateDisplay);
|
||||
+ }
|
||||
+ if (mUrlTextChangeListener == null) return;
|
||||
+ if (updateDisplay) limitDisplayableLength();
|
||||
+ // crbug.com/764749
|
||||
+ Log.w(TAG, "Text change observed, triggering autocomplete.");
|
||||
+
|
||||
+ mUrlTextChangeListener.onTextChanged(
|
||||
+ getTextWithoutAutocomplete(), getTextWithAutocomplete());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Span that displays ellipsis instead of the text. Used to hide portion of
|
||||
+ * very large string to get decent performance from TextView.
|
||||
+ */
|
||||
+ private static class EllipsisSpan extends ReplacementSpan {
|
||||
+ private static final String ELLIPSIS = "...";
|
||||
+
|
||||
+ public static final EllipsisSpan INSTANCE = new EllipsisSpan();
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSize(
|
||||
+ Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) {
|
||||
+ return (int) paint.measureText(ELLIPSIS);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top,
|
||||
+ int y, int bottom, Paint paint) {
|
||||
+ canvas.drawText(ELLIPSIS, x, y, paint);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
||||
@@ -223,8 +223,7 @@ public abstract class UrlBar extends AutocompleteEditText {
|
||||
setFocusableInTouchMode(mAllowFocus);
|
||||
});
|
||||
|
||||
- setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI
|
||||
- | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||
+ setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
|
||||
|
||||
// The HTC Sense IME will attempt to autocomplete words in the Omnibox when Prediction is
|
||||
// enabled. We want to disable this feature and rely on the Omnibox's implementation.
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,306 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Sep 2021 11:17:53 +0200
|
||||
Subject: Disable AGSA by default
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/BUILD.gn | 3 ---
|
||||
.../org/chromium/chrome/browser/AppHooks.java | 1 -
|
||||
.../chrome/browser/IntentHandler.java | 5 ----
|
||||
.../chrome/browser/app/ChromeActivity.java | 27 -------------------
|
||||
.../ChromeContextMenuPopulator.java | 7 -----
|
||||
...stomTabActivityClientConnectionKeeper.java | 9 -------
|
||||
.../init/ProcessInitializationHandler.java | 8 ------
|
||||
.../browser/ntp/search/SearchBoxMediator.java | 1 -
|
||||
.../chrome/browser/share/LensUtils.java | 12 +--------
|
||||
.../flags/android/chrome_feature_list.cc | 4 +--
|
||||
chrome/browser/ui/android/omnibox/BUILD.gn | 2 --
|
||||
.../browser/omnibox/LocationBarMediator.java | 1 -
|
||||
12 files changed, 3 insertions(+), 77 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -420,7 +420,6 @@ if (current_toolchain == default_toolchain) {
|
||||
"//chrome/browser/first_run/android:java",
|
||||
"//chrome/browser/flags:java",
|
||||
"//chrome/browser/fullscreen/android:java",
|
||||
- "//chrome/browser/gsa:java",
|
||||
"//chrome/browser/history_clusters:java",
|
||||
"//chrome/browser/history_clusters:java_resources",
|
||||
"//chrome/browser/image_descriptions:java",
|
||||
@@ -1015,7 +1014,6 @@ if (current_toolchain == default_toolchain) {
|
||||
"//chrome/browser/flags:flags_junit_tests",
|
||||
"//chrome/browser/flags:java",
|
||||
"//chrome/browser/fullscreen/android:java",
|
||||
- "//chrome/browser/gsa:java",
|
||||
"//chrome/browser/history_clusters:java",
|
||||
"//chrome/browser/image_descriptions:java",
|
||||
"//chrome/browser/image_editor/public:java",
|
||||
@@ -1531,7 +1529,6 @@ if (current_toolchain == default_toolchain) {
|
||||
"//chrome/browser/first_run/android:java",
|
||||
"//chrome/browser/flags:java",
|
||||
"//chrome/browser/fullscreen/android:java",
|
||||
- "//chrome/browser/gsa:java",
|
||||
"//chrome/browser/history_clusters:java",
|
||||
"//chrome/browser/image_descriptions:javatests",
|
||||
"//chrome/browser/incognito:incognito_java_tests",
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
@@ -17,7 +17,6 @@ import org.chromium.chrome.browser.directactions.DirectActionCoordinator;
|
||||
import org.chromium.chrome.browser.feedback.FeedbackReporter;
|
||||
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher;
|
||||
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
|
||||
-import org.chromium.chrome.browser.gsa.GSAHelper;
|
||||
import org.chromium.chrome.browser.historyreport.AppIndexingReporter;
|
||||
import org.chromium.chrome.browser.init.ChromeStartupDelegate;
|
||||
import org.chromium.chrome.browser.init.ProcessInitializationHandler;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
@@ -43,7 +43,6 @@ import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
||||
import org.chromium.chrome.browser.externalnav.IntentWithRequestMetadataHandler;
|
||||
import org.chromium.chrome.browser.externalnav.IntentWithRequestMetadataHandler.RequestMetadata;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
|
||||
import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
@@ -267,8 +266,6 @@ public class IntentHandler {
|
||||
private static int sReferrerId;
|
||||
private static String sPendingIncognitoUrl;
|
||||
|
||||
- public static final String PACKAGE_GSA = GSAState.PACKAGE_NAME;
|
||||
-
|
||||
private static final String PACKAGE_GMAIL = "com.google.android.gm";
|
||||
private static final String PACKAGE_PLUS = "com.google.android.apps.plus";
|
||||
private static final String PACKAGE_HANGOUTS = "com.google.android.talk";
|
||||
@@ -498,8 +495,6 @@ public class IntentHandler {
|
||||
return ExternalAppId.LINE;
|
||||
} else if (packageName.equals(PACKAGE_WHATSAPP)) {
|
||||
return ExternalAppId.WHATSAPP;
|
||||
- } else if (packageName.equals(PACKAGE_GSA)) {
|
||||
- return ExternalAppId.GSA;
|
||||
} else if (packageName.equals(ContextUtils.getApplicationContext().getPackageName())) {
|
||||
return ExternalAppId.CHROME;
|
||||
} else if (packageName.startsWith(WEBAPK_PACKAGE_PREFIX)) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -113,10 +113,6 @@ import org.chromium.chrome.browser.fullscreen.BrowserControlsManager;
|
||||
import org.chromium.chrome.browser.fullscreen.BrowserControlsManagerSupplier;
|
||||
import org.chromium.chrome.browser.fullscreen.FullscreenBackPressHandler;
|
||||
import org.chromium.chrome.browser.fullscreen.FullscreenManager;
|
||||
-import org.chromium.chrome.browser.gsa.ContextReporter;
|
||||
-import org.chromium.chrome.browser.gsa.GSAAccountChangeListener;
|
||||
-import org.chromium.chrome.browser.gsa.GSAContextDisplaySelection;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.history.HistoryManagerUtils;
|
||||
import org.chromium.chrome.browser.init.AsyncInitializationActivity;
|
||||
import org.chromium.chrome.browser.init.ProcessInitializationHandler;
|
||||
@@ -377,8 +373,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
|
||||
private LaunchCauseMetrics mLaunchCauseMetrics;
|
||||
|
||||
- private GSAAccountChangeListener mGSAAccountChangeListener;
|
||||
-
|
||||
// TODO(972867): Pull MenuOrKeyboardActionController out of ChromeActivity.
|
||||
private List<MenuOrKeyboardActionController.MenuOrKeyboardActionHandler> mMenuActionHandlers =
|
||||
new ArrayList<>();
|
||||
@@ -1189,10 +1183,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
|
||||
@Override
|
||||
public void onStopWithNative() {
|
||||
- if (GSAState.getInstance(this).isGsaAvailable() && !SysUtils.isLowEndDevice()) {
|
||||
- if (mGSAAccountChangeListener != null) mGSAAccountChangeListener.disconnect();
|
||||
- }
|
||||
-
|
||||
super.onStopWithNative();
|
||||
}
|
||||
|
||||
@@ -1284,23 +1274,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
.recordUserFontPrefOnStartup();
|
||||
});
|
||||
|
||||
- // GSA connection is not needed on low-end devices because Icing is disabled.
|
||||
- if (!SysUtils.isLowEndDevice()) {
|
||||
- if (isActivityFinishingOrDestroyed()) return;
|
||||
- DeferredStartupHandler.getInstance().addDeferredTask(() -> {
|
||||
- if (!GSAState.getInstance(this).isGsaAvailable()) {
|
||||
- ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (mGSAAccountChangeListener == null) {
|
||||
- mGSAAccountChangeListener =
|
||||
- GSAAccountChangeListener.create(AppHooks.get().createGsaHelper());
|
||||
- }
|
||||
- mGSAAccountChangeListener.connect();
|
||||
- });
|
||||
- }
|
||||
-
|
||||
DeferredStartupHandler.getInstance().addDeferredTask(
|
||||
() -> { MemoryPurgeManager.getInstance().start(); });
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
@@ -37,7 +37,6 @@ import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator.ListItemTy
|
||||
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
|
||||
import org.chromium.chrome.browser.firstrun.FirstRunStatus;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.lens.LensController;
|
||||
import org.chromium.chrome.browser.lens.LensEntryPoint;
|
||||
import org.chromium.chrome.browser.lens.LensIntentParams;
|
||||
@@ -978,12 +977,6 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
||||
LensMetrics.LensSupportStatus.ACTIVITY_NOT_ACCESSIBLE);
|
||||
return false;
|
||||
}
|
||||
- if (GSAState.getInstance(mContext).isAgsaVersionBelowMinimum(
|
||||
- versionName, LensUtils.getMinimumAgsaVersionForLensSupport())) {
|
||||
- LensMetrics.recordLensSupportStatus(
|
||||
- LENS_SUPPORT_STATUS_HISTOGRAM_NAME, LensMetrics.LensSupportStatus.OUT_OF_DATE);
|
||||
- return false;
|
||||
- }
|
||||
|
||||
if (LensUtils.isDeviceOsBelowMinimum()) {
|
||||
LensMetrics.recordLensSupportStatus(
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java
|
||||
@@ -11,7 +11,6 @@ import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider;
|
||||
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider;
|
||||
import org.chromium.chrome.browser.dependency_injection.ActivityScope;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
|
||||
import org.chromium.chrome.browser.lifecycle.StartStopWithNativeObserver;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
@@ -95,13 +94,5 @@ public class CustomTabActivityClientConnectionKeeper implements StartStopWithNat
|
||||
}
|
||||
}
|
||||
assert status >= 0;
|
||||
-
|
||||
- if (GSAState.isGsaPackageName(packageName)) {
|
||||
- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.GSA",
|
||||
- status, ConnectionStatus.NUM_ENTRIES);
|
||||
- } else {
|
||||
- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.NonGSA",
|
||||
- status, ConnectionStatus.NUM_ENTRIES);
|
||||
- }
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
@@ -356,14 +356,6 @@ public class ProcessInitializationHandler {
|
||||
}
|
||||
});
|
||||
|
||||
- deferredStartupHandler.addDeferredTask(new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
- // Starts syncing with GSA.
|
||||
- AppHooks.get().createGsaHelper().startSync();
|
||||
- }
|
||||
- });
|
||||
-
|
||||
deferredStartupHandler.addDeferredTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/search/SearchBoxMediator.java
|
||||
@@ -13,7 +13,6 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.core.graphics.drawable.RoundedBitmapDrawable;
|
||||
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.lens.LensController;
|
||||
import org.chromium.chrome.browser.lens.LensEntryPoint;
|
||||
import org.chromium.chrome.browser.lens.LensIntentParams;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java
|
||||
@@ -10,7 +10,6 @@ import android.text.TextUtils;
|
||||
|
||||
import org.chromium.chrome.browser.IntentHandler;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.lens.LensController;
|
||||
import org.chromium.components.externalauth.ExternalAuthUtils;
|
||||
|
||||
@@ -57,12 +56,7 @@ public class LensUtils {
|
||||
if (context == null) {
|
||||
return "";
|
||||
}
|
||||
- String agsaVersion = GSAState.getInstance(context).getAgsaVersionName();
|
||||
- if (agsaVersion == null) {
|
||||
return "";
|
||||
- } else {
|
||||
- return agsaVersion;
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,11 +108,7 @@ public class LensUtils {
|
||||
* @return Whether the package is valid.
|
||||
*/
|
||||
public static boolean isValidAgsaPackage(final ExternalAuthUtils externalAuthUtils) {
|
||||
- if (sFakePassableLensEnvironmentForTesting) {
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- return externalAuthUtils.isGoogleSigned(IntentHandler.PACKAGE_GSA);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -750,8 +750,8 @@ BASE_FEATURE(kDuetTabStripIntegrationAndroid,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kExperimentsForAgsa,
|
||||
- "ExperimentsForAgsa",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "ExperimentsForAgsa", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kExploreSites, "ExploreSites", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
diff --git a/chrome/browser/ui/android/omnibox/BUILD.gn b/chrome/browser/ui/android/omnibox/BUILD.gn
|
||||
--- a/chrome/browser/ui/android/omnibox/BUILD.gn
|
||||
+++ b/chrome/browser/ui/android/omnibox/BUILD.gn
|
||||
@@ -146,7 +146,6 @@ android_library("java") {
|
||||
"//chrome/browser/device:java",
|
||||
"//chrome/browser/feature_engagement:java",
|
||||
"//chrome/browser/flags:java",
|
||||
- "//chrome/browser/gsa:java",
|
||||
"//chrome/browser/history_clusters:java",
|
||||
"//chrome/browser/language/android:java",
|
||||
"//chrome/browser/lens:java",
|
||||
@@ -441,7 +440,6 @@ robolectric_library("junit") {
|
||||
"//chrome/browser/commerce/merchant_viewer/android:java",
|
||||
"//chrome/browser/device:java",
|
||||
"//chrome/browser/flags:java",
|
||||
- "//chrome/browser/gsa:java",
|
||||
"//chrome/browser/lens:java",
|
||||
"//chrome/browser/locale:java",
|
||||
"//chrome/browser/preferences:java",
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
||||
@@ -38,7 +38,6 @@ import org.chromium.chrome.browser.back_press.BackPressManager;
|
||||
import org.chromium.chrome.browser.device.DeviceClassManager;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.flags.ChromeSwitches;
|
||||
-import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.lens.LensController;
|
||||
import org.chromium.chrome.browser.lens.LensEntryPoint;
|
||||
import org.chromium.chrome.browser.lens.LensIntentParams;
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,74 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 8 Nov 2021 09:47:23 +0000
|
||||
Subject: Disable Accessibility service by default
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser/ui/android/strings/android_chrome_strings.grd | 6 ++++++
|
||||
.../android/java/res/xml/accessibility_preferences.xml | 5 +++++
|
||||
.../browser_ui/accessibility/AccessibilitySettings.java | 3 +++
|
||||
.../browser/accessibility/WebContentsAccessibilityImpl.java | 5 +++++
|
||||
4 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1500,6 +1500,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_SAFETY_CHECK_BUTTON" desc="Text for the button to start Safety check.">
|
||||
Check now
|
||||
</message>
|
||||
+ <message name="IDS_ENABLE_ACCESSIBILITY_TITLE" desc="Title of enable accessibility settings, which allows the user to enable service. [CHAR_LIMIT=32]">
|
||||
+ Enable Accessibility Service
|
||||
+ </message>
|
||||
+ <message name="IDS_ENABLE_ACCESSIBILITY_SUMMARY" desc="Summary of enable accessibility settings.">
|
||||
+ Activates or deactivates the communication of all user activities in ui to the Accessibility provider
|
||||
+ </message>
|
||||
<message name="IDS_SAFETY_CHECK_ERROR" desc="A generic error state.">
|
||||
An error occurred.
|
||||
</message>
|
||||
diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -7,6 +7,11 @@ found in the LICENSE file.
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
|
||||
+ android:key="enable_accessibility"
|
||||
+ android:summary="@string/enable_accessibility_summary"
|
||||
+ android:title="@string/enable_accessibility_title" />
|
||||
+
|
||||
<org.chromium.components.browser_ui.accessibility.TextScalePreference
|
||||
android:key="text_scale"
|
||||
android:title="@string/font_size"
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
@@ -18,6 +18,9 @@ import org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference;
|
||||
import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
|
||||
import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||||
|
||||
+import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
|
||||
+import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
|
||||
+
|
||||
/**
|
||||
* Fragment to keep track of all the accessibility related preferences.
|
||||
*/
|
||||
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
|
||||
--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
|
||||
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
|
||||
@@ -900,6 +900,11 @@ public class WebContentsAccessibilityImpl extends AccessibilityNodeProviderCompa
|
||||
structure.setChildCount(0);
|
||||
return;
|
||||
}
|
||||
+ // Do not collect accessibility tree if disabled
|
||||
+ if (!ContextUtils.getAppSharedPreferences().getBoolean("enable_accessibility", false)) {
|
||||
+ structure.setChildCount(0);
|
||||
+ return;
|
||||
+ }
|
||||
structure.setChildCount(1);
|
||||
final ViewStructure viewRoot = structure.asyncNewChild(0);
|
||||
viewRoot.setClassName("");
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,33 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 26 Mar 2022 16:41:55 +0100
|
||||
Subject: Disable AsyncDNS by default
|
||||
|
||||
This feature is detrimental to privacy, see also:
|
||||
* https://bugs.chromium.org/p/chromium/issues/detail?id=805020
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/common/chrome_features.cc | 9 ++-------
|
||||
1 file changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -98,13 +98,8 @@ BASE_FEATURE(kAppShimNewCloseBehavior,
|
||||
|
||||
// Enables the built-in DNS resolver.
|
||||
BASE_FEATURE(kAsyncDns,
|
||||
- "AsyncDns",
|
||||
-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID) || \
|
||||
- BUILDFLAG(IS_WIN)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif
|
||||
+ "AsyncDns", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
|
||||
);
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,25 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 24 Jan 2020 09:46:48 +0100
|
||||
Subject: Disable DRM media origin IDs preprovisioning
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
media/base/media_switches.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -851,8 +851,8 @@ BASE_FEATURE(kMediaDrmPersistentLicense,
|
||||
// MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
|
||||
// which will trigger provisioning process after MediaDrmBridge is created.
|
||||
BASE_FEATURE(kMediaDrmPreprovisioning,
|
||||
- "MediaDrmPreprovisioning",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "MediaDrmPreprovisioning", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Determines if MediaDrmOriginIdManager should attempt to pre-provision origin
|
||||
// IDs at startup (whenever a profile is loaded). Also used by tests that
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,251 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Sat, 13 Nov 2021 09:17:06 +0000
|
||||
Subject: Disable FLoC and privacy sandbox
|
||||
|
||||
Remove UI from the settings and set the flags to inactive
|
||||
Permanently removes FLoC support, disabling the download of LSH clusters,
|
||||
the marking the history navigation and the javascript API and permission policies.
|
||||
Also added the disabling of blink features through the DisabledForBromite tag
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/xml/privacy_preferences.xml | 4 ---
|
||||
.../privacy/settings/PrivacySettings.java | 23 ------------
|
||||
.../browser/chrome_content_browser_client.cc | 3 ++
|
||||
.../history/core/browser/history_backend.cc | 13 +------
|
||||
.../privacy_sandbox/privacy_sandbox_prefs.cc | 2 +-
|
||||
.../privacy_sandbox_settings.cc | 35 +++++++++++--------
|
||||
.../privacy_sandbox_settings.h | 1 -
|
||||
7 files changed, 25 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -68,10 +68,6 @@ found in the LICENSE file.
|
||||
android:title="@string/open_external_links_incognito_title"
|
||||
android:summary="@string/open_external_links_incognito_summary"
|
||||
android:defaultValue="false" />
|
||||
- <Preference
|
||||
- android:key="privacy_sandbox"
|
||||
- android:title="@string/prefs_privacy_sandbox"
|
||||
- android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragment"/>
|
||||
<PreferenceCategory
|
||||
android:key="services_category"
|
||||
android:title="@string/services_category_title">
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -58,8 +58,6 @@ public class PrivacySettings
|
||||
private static final String PREF_SECURE_DNS = "secure_dns";
|
||||
private static final String PREF_DO_NOT_TRACK = "do_not_track";
|
||||
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
|
||||
- private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
|
||||
- private static final String PREF_PROXY_OPTIONS = "proxy";
|
||||
private static final String PREF_PRIVACY_GUIDE = "privacy_guide";
|
||||
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
|
||||
|
||||
@@ -86,21 +84,6 @@ public class PrivacySettings
|
||||
SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences);
|
||||
getActivity().setTitle(R.string.prefs_privacy_security);
|
||||
|
||||
- Preference sandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
|
||||
- // Hide the Privacy Sandbox if it is restricted.
|
||||
- if (PrivacySandboxBridge.isPrivacySandboxRestricted()) {
|
||||
- getPreferenceScreen().removePreference(sandboxPreference);
|
||||
- } else {
|
||||
- sandboxPreference.setSummary(
|
||||
- PrivacySandboxSettingsFragment.getStatusString(getContext()));
|
||||
- // Overwrite the click listener to pass a correct referrer to the fragment.
|
||||
- sandboxPreference.setOnPreferenceClickListener(preference -> {
|
||||
- PrivacySandboxSettingsFragmentV3.launchPrivacySandboxSettings(getContext(),
|
||||
- new SettingsLauncherImpl(), PrivacySandboxReferrer.PRIVACY_SETTINGS);
|
||||
- return true;
|
||||
- });
|
||||
- }
|
||||
-
|
||||
Preference privacyGuidePreference = findPreference(PREF_PRIVACY_GUIDE);
|
||||
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_GUIDE)) {
|
||||
getPreferenceScreen().removePreference(privacyGuidePreference);
|
||||
@@ -220,12 +203,6 @@ public class PrivacySettings
|
||||
secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
|
||||
}
|
||||
|
||||
- Preference privacySandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
|
||||
- if (privacySandboxPreference != null) {
|
||||
- privacySandboxPreference.setSummary(
|
||||
- PrivacySandboxSettingsFragment.getStatusString(getContext()));
|
||||
- }
|
||||
-
|
||||
mIncognitoLockSettings.updateIncognitoReauthPreferenceIfNeeded(getActivity());
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -3231,6 +3231,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed(
|
||||
const url::Origin* source_origin,
|
||||
const url::Origin* destination_origin,
|
||||
const url::Origin* reporting_origin) {
|
||||
+ // make sure that this is always disabled in Bromite even if privacy sandbox is already disabled in the prefs
|
||||
+ if ((true))
|
||||
+ return false;
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
|
||||
auto* privacy_sandbox_settings =
|
||||
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
|
||||
--- a/components/history/core/browser/history_backend.cc
|
||||
+++ b/components/history/core/browser/history_backend.cc
|
||||
@@ -517,18 +517,7 @@ void HistoryBackend::SetBrowsingTopicsAllowed(ContextID context_id,
|
||||
if (!visit_id)
|
||||
return;
|
||||
|
||||
- // Only add to the annotations table if the visit_id exists in the visits
|
||||
- // table.
|
||||
- VisitContentAnnotations annotations;
|
||||
- if (db_->GetContentAnnotationsForVisit(visit_id, &annotations)) {
|
||||
- annotations.annotation_flags |=
|
||||
- VisitContentAnnotationFlag::kBrowsingTopicsEligible;
|
||||
- db_->UpdateContentAnnotationsForVisit(visit_id, annotations);
|
||||
- } else {
|
||||
- annotations.annotation_flags |=
|
||||
- VisitContentAnnotationFlag::kBrowsingTopicsEligible;
|
||||
- db_->AddContentAnnotationsForVisit(visit_id, annotations);
|
||||
- }
|
||||
+ // in Bromite disallow marking anything in history related to topics
|
||||
ScheduleCommit();
|
||||
}
|
||||
|
||||
diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc
|
||||
--- a/components/privacy_sandbox/privacy_sandbox_prefs.cc
|
||||
+++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc
|
||||
@@ -66,7 +66,7 @@ namespace privacy_sandbox {
|
||||
|
||||
void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kPrivacySandboxApisEnabled, true,
|
||||
+ prefs::kPrivacySandboxApisEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2, false);
|
||||
registry->RegisterBooleanPref(
|
||||
diff --git a/components/privacy_sandbox/privacy_sandbox_settings.cc b/components/privacy_sandbox/privacy_sandbox_settings.cc
|
||||
--- a/components/privacy_sandbox/privacy_sandbox_settings.cc
|
||||
+++ b/components/privacy_sandbox/privacy_sandbox_settings.cc
|
||||
@@ -68,8 +68,7 @@ PrivacySandboxSettings::PrivacySandboxSettings(
|
||||
: delegate_(std::move(delegate)),
|
||||
host_content_settings_map_(host_content_settings_map),
|
||||
cookie_settings_(cookie_settings),
|
||||
- pref_service_(pref_service),
|
||||
- incognito_profile_(incognito_profile) {
|
||||
+ pref_service_(pref_service) {
|
||||
DCHECK(pref_service_);
|
||||
DCHECK(host_content_settings_map_);
|
||||
DCHECK(cookie_settings_);
|
||||
@@ -94,7 +93,8 @@ PrivacySandboxSettings::PrivacySandboxSettings(
|
||||
|
||||
PrivacySandboxSettings::~PrivacySandboxSettings() = default;
|
||||
|
||||
-bool PrivacySandboxSettings::IsTopicsAllowed() const {
|
||||
+bool PrivacySandboxSettings::IsTopicsAllowed() const { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
// Topics API calculation should be prevented if the user has blocked 3PC
|
||||
// cookies, as there will be no context specific check.
|
||||
const auto cookie_controls_mode =
|
||||
@@ -119,7 +119,8 @@ bool PrivacySandboxSettings::IsTopicsAllowedForContext(
|
||||
IsPrivacySandboxEnabledForContext(url, top_frame_origin);
|
||||
}
|
||||
|
||||
-bool PrivacySandboxSettings::IsTopicAllowed(const CanonicalTopic& topic) {
|
||||
+bool PrivacySandboxSettings::IsTopicAllowed(const CanonicalTopic& topic) { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
const auto& blocked_topics =
|
||||
pref_service_->GetList(prefs::kPrivacySandboxBlockedTopics);
|
||||
|
||||
@@ -187,9 +188,8 @@ base::Time PrivacySandboxSettings::TopicsDataAccessibleSince() const {
|
||||
|
||||
bool PrivacySandboxSettings::IsAttributionReportingAllowed(
|
||||
const url::Origin& top_frame_origin,
|
||||
- const url::Origin& reporting_origin) const {
|
||||
- return IsPrivacySandboxEnabledForContext(reporting_origin.GetURL(),
|
||||
- top_frame_origin);
|
||||
+ const url::Origin& reporting_origin) const { // disabled in Bromite
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool PrivacySandboxSettings::MaySendAttributionReport(
|
||||
@@ -278,7 +278,8 @@ void PrivacySandboxSettings::ClearFledgeJoiningAllowedSettings(
|
||||
}
|
||||
|
||||
bool PrivacySandboxSettings::IsFledgeJoiningAllowed(
|
||||
- const url::Origin& top_frame_origin) const {
|
||||
+ const url::Origin& top_frame_origin) const { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
ScopedDictPrefUpdate scoped_pref_update(
|
||||
pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked);
|
||||
auto& pref_data = scoped_pref_update.Get();
|
||||
@@ -334,7 +335,9 @@ bool PrivacySandboxSettings::IsPrivateAggregationAllowed(
|
||||
top_frame_origin);
|
||||
}
|
||||
|
||||
-bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const {
|
||||
+bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const { // disabled in Bromite
|
||||
+ if ((true))
|
||||
+ return false;
|
||||
// If the delegate is restricting access the Privacy Sandbox is disabled.
|
||||
if (delegate_->IsPrivacySandboxRestricted())
|
||||
return false;
|
||||
@@ -349,7 +352,7 @@ bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const {
|
||||
// settings is available.
|
||||
if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3)) {
|
||||
// For Privacy Sandbox Settings 3, APIs are disabled in incognito.
|
||||
- if (incognito_profile_)
|
||||
+ if ((true))
|
||||
return false;
|
||||
|
||||
if (should_override_setting_for_local_testing) {
|
||||
@@ -367,7 +370,8 @@ bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const {
|
||||
return pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled);
|
||||
}
|
||||
|
||||
-void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) {
|
||||
+void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) { // disabled in Bromite
|
||||
+ enabled = false;
|
||||
// Only apply the decision to the appropriate preference.
|
||||
if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3)) {
|
||||
pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, enabled);
|
||||
@@ -376,7 +380,8 @@ void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
-bool PrivacySandboxSettings::IsTrustTokensAllowed() {
|
||||
+bool PrivacySandboxSettings::IsTrustTokensAllowed() { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
// The PrivacySandboxSettings is only involved in Trust Token access
|
||||
// decisions when the Release 3 flag is enabled.
|
||||
if (!base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3))
|
||||
@@ -441,9 +446,9 @@ bool PrivacySandboxSettings::IsPrivacySandboxEnabledForContext(
|
||||
content_settings::CookieSettings::QueryReason::kPrivacySandbox);
|
||||
}
|
||||
|
||||
-void PrivacySandboxSettings::SetTopicsDataAccessibleFromNow() const {
|
||||
- pref_service_->SetTime(prefs::kPrivacySandboxTopicsDataAccessibleSince,
|
||||
- base::Time::Now());
|
||||
+void PrivacySandboxSettings::SetTopicsDataAccessibleFromNow() const { // disabled in Bromite
|
||||
+ pref_service_->ClearPref(prefs::kPrivacySandboxTopicsDataAccessibleSince);
|
||||
+ if ((true)) return;
|
||||
|
||||
for (auto& observer : observers_)
|
||||
observer.OnTopicsDataAccessibleSinceUpdated();
|
||||
diff --git a/components/privacy_sandbox/privacy_sandbox_settings.h b/components/privacy_sandbox/privacy_sandbox_settings.h
|
||||
--- a/components/privacy_sandbox/privacy_sandbox_settings.h
|
||||
+++ b/components/privacy_sandbox/privacy_sandbox_settings.h
|
||||
@@ -227,7 +227,6 @@ class PrivacySandboxSettings : public KeyedService {
|
||||
scoped_refptr<content_settings::CookieSettings> cookie_settings_;
|
||||
raw_ptr<PrefService, DanglingUntriaged> pref_service_;
|
||||
PrefChangeRegistrar pref_change_registrar_;
|
||||
- bool incognito_profile_;
|
||||
};
|
||||
|
||||
} // namespace privacy_sandbox
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,51 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:15:17 +0200
|
||||
Subject: Disable NTP remote suggestions by default
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
components/feed/core/shared_prefs/pref_names.cc | 4 ++--
|
||||
components/ntp_snippets/features.cc | 8 ++++----
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/components/feed/core/shared_prefs/pref_names.cc b/components/feed/core/shared_prefs/pref_names.cc
|
||||
--- a/components/feed/core/shared_prefs/pref_names.cc
|
||||
+++ b/components/feed/core/shared_prefs/pref_names.cc
|
||||
@@ -20,8 +20,8 @@ const char kArticlesListVisible[] = "ntp_snippets.list_visible";
|
||||
const char kVideoPreviewsType[] = "ntp_snippets.video_previews_type";
|
||||
|
||||
void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) {
|
||||
- registry->RegisterBooleanPref(kEnableSnippets, true);
|
||||
- registry->RegisterBooleanPref(kArticlesListVisible, true);
|
||||
+ registry->RegisterBooleanPref(kEnableSnippets, false);
|
||||
+ registry->RegisterBooleanPref(kArticlesListVisible, false);
|
||||
registry->RegisterIntegerPref(kVideoPreviewsType, 1);
|
||||
}
|
||||
|
||||
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
|
||||
--- a/components/ntp_snippets/features.cc
|
||||
+++ b/components/ntp_snippets/features.cc
|
||||
@@ -39,8 +39,8 @@ const base::Feature* const kAllFeatures[] = {
|
||||
&kOptionalImagesEnabledFeature};
|
||||
|
||||
BASE_FEATURE(kArticleSuggestionsFeature,
|
||||
- "NTPArticleSuggestions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "NTPArticleSuggestions", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kRemoteSuggestionsEmulateM58FetchingSchedule,
|
||||
"RemoteSuggestionsEmulateM58FetchingSchedule",
|
||||
@@ -71,8 +71,8 @@ const char kNotificationsDailyLimit[] = "daily_limit";
|
||||
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
|
||||
|
||||
BASE_FEATURE(kKeepPrefetchedContentSuggestions,
|
||||
- "KeepPrefetchedContentSuggestions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "KeepPrefetchedContentSuggestions", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kOptionalImagesEnabledFeature,
|
||||
"NTPRemoteSuggestionsOptionalImages",
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,40 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 31 Jul 2022 22:13:11 +0200
|
||||
Subject: Disable PrivacyGuide
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/common/chrome_features.cc | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -505,8 +505,8 @@ BASE_FEATURE(kHaTSDesktopDevToolsIssuesCSP,
|
||||
|
||||
// Enables or disables the Happiness Tracking System for Desktop Privacy Guide.
|
||||
BASE_FEATURE(kHappinessTrackingSurveysForDesktopPrivacyGuide,
|
||||
- "HappinessTrackingSurveysForDesktopPrivacyGuide",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "HappinessTrackingSurveysForDesktopPrivacyGuide", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
const base::FeatureParam<base::TimeDelta>
|
||||
kHappinessTrackingSurveysForDesktopPrivacyGuideTime{
|
||||
&kHappinessTrackingSurveysForDesktopPrivacyGuide, "settings-time",
|
||||
@@ -915,11 +915,11 @@ BASE_FEATURE(kPrerenderFallbackToPreconnect,
|
||||
"PrerenderFallbackToPreconnect",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
-BASE_FEATURE(kPrivacyGuide2, "PrivacyGuide2", base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kPrivacyGuide2, "PrivacyGuide2", base::FEATURE_DISABLED_BY_DEFAULT); // always disabled in Bromite
|
||||
|
||||
BASE_FEATURE(kPrivacyGuideAndroid,
|
||||
- "PrivacyGuideAndroid",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "PrivacyGuideAndroid", // always disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enables or disables push subscriptions keeping Chrome running in the
|
||||
// background when closed.
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,27 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 16 Nov 2022 11:18:07 +0100
|
||||
Subject: Disable StartSurface feature
|
||||
|
||||
This feature would normally show a search box but leads to crashes.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/flags/android/chrome_feature_list.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -1069,8 +1069,8 @@ BASE_FEATURE(kShowExtendedPreloadingSetting,
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kStartSurfaceAndroid,
|
||||
- "StartSurfaceAndroid",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "StartSurfaceAndroid", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kFeedPositionAndroid,
|
||||
"FeedPositionAndroid",
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,297 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Thu, 24 Mar 2022 10:08:00 +0000
|
||||
Subject: Disable TLS resumption
|
||||
|
||||
Disable resumption feature for all HTTPS and QUIC connections;
|
||||
the feature could be used to track users even without cookies.
|
||||
|
||||
Sessions are not currently saved to disk in Chromium (although
|
||||
there is support for it) but are long enough to constitute a
|
||||
privacy risk (2h for TLS 1.2 and 7 days for TLS 1.3) if user
|
||||
does not frequently close the browser.
|
||||
|
||||
Since session information is not kept in the HTTP cache it is
|
||||
not cleared when deleting navigation data (although it is possible
|
||||
to clear it by selecting "passwords").
|
||||
|
||||
Two new user configurable flags are introduced:
|
||||
* kDisableTLSResumption, active by default
|
||||
* kLogTLSResumption, that would allow to find in logcat reused
|
||||
sessions in lines matching "SSL Log:"
|
||||
|
||||
See also:
|
||||
* https://arxiv.org/abs/1810.07304
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 +++
|
||||
chrome/browser/flag_descriptions.cc | 8 ++++
|
||||
chrome/browser/flag_descriptions.h | 6 +++
|
||||
net/base/features.cc | 8 ++++
|
||||
net/base/features.h | 6 +++
|
||||
net/http/http_network_session.cc | 1 +
|
||||
net/quic/quic_stream_factory.cc | 35 ++++++++++++++++-
|
||||
net/socket/ssl_client_socket_impl.cc | 59 ++++++++++++++++++++++++++++
|
||||
net/socket/ssl_client_socket_impl.h | 2 +
|
||||
9 files changed, 130 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -5053,6 +5053,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-tls13-early-data", flag_descriptions::kEnableTLS13EarlyDataName,
|
||||
flag_descriptions::kEnableTLS13EarlyDataDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(net::features::kEnableTLS13EarlyData)},
|
||||
+ {"disable-tls-resumption", flag_descriptions::kDisableTLSResumptionName,
|
||||
+ flag_descriptions::kDisableTLSResumptionDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kDisableTLSResumption)},
|
||||
+ {"log-tls-resumption", flag_descriptions::kLogTLSResumptionName,
|
||||
+ flag_descriptions::kLogTLSResumptionDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kLogTLSResumption)},
|
||||
{"post-quantum-cecpq2", flag_descriptions::kPostQuantumCECPQ2Name,
|
||||
flag_descriptions::kPostQuantumCECPQ2Description, kOsAll,
|
||||
FEATURE_VALUE_TYPE(net::features::kPostQuantumCECPQ2)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -994,6 +994,14 @@ const char kEnableTLS13EarlyDataDescription[] =
|
||||
"during the handshake when resuming a connection to a compatible TLS 1.3 "
|
||||
"server.";
|
||||
|
||||
+const char kDisableTLSResumptionName[] = "Disable TLS Session Resumption";
|
||||
+const char kDisableTLSResumptionDescription[] =
|
||||
+ "Disable TLS session resumption.";
|
||||
+
|
||||
+const char kLogTLSResumptionName[] = "Log TLS Session Resumption";
|
||||
+const char kLogTLSResumptionDescription[] =
|
||||
+ "Log TLS session resumption";
|
||||
+
|
||||
const char kEnhancedNetworkVoicesName[] = "Enhanced network voices";
|
||||
const char kEnhancedNetworkVoicesDescription[] =
|
||||
"This option enables high-quality, network-based voices in "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -577,6 +577,12 @@ extern const char kEnablePreinstalledWebAppDuplicationFixerDescription[];
|
||||
extern const char kEnableTLS13EarlyDataName[];
|
||||
extern const char kEnableTLS13EarlyDataDescription[];
|
||||
|
||||
+extern const char kDisableTLSResumptionName[];
|
||||
+extern const char kDisableTLSResumptionDescription[];
|
||||
+
|
||||
+extern const char kLogTLSResumptionName[];
|
||||
+extern const char kLogTLSResumptionDescription[];
|
||||
+
|
||||
extern const char kEnhancedNetworkVoicesName[];
|
||||
extern const char kEnhancedNetworkVoicesDescription[];
|
||||
|
||||
diff --git a/net/base/features.cc b/net/base/features.cc
|
||||
--- a/net/base/features.cc
|
||||
+++ b/net/base/features.cc
|
||||
@@ -61,6 +61,14 @@ const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbSecureExtraTimeMin{
|
||||
&kUseDnsHttpsSvcb, "UseDnsHttpsSvcbSecureExtraTimeMin",
|
||||
base::Milliseconds(5)};
|
||||
|
||||
+BASE_FEATURE(kDisableTLSResumption,
|
||||
+ "DisableTLSResumption",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
+BASE_FEATURE(kLogTLSResumption,
|
||||
+ "LogTLSResumption",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
BASE_FEATURE(kUseDnsHttpsSvcbAlpn,
|
||||
"UseDnsHttpsSvcbAlpn",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/net/base/features.h b/net/base/features.h
|
||||
--- a/net/base/features.h
|
||||
+++ b/net/base/features.h
|
||||
@@ -91,6 +91,12 @@ NET_EXPORT BASE_DECLARE_FEATURE(kUseDnsHttpsSvcbAlpn);
|
||||
// Enables TLS 1.3 early data.
|
||||
NET_EXPORT BASE_DECLARE_FEATURE(kEnableTLS13EarlyData);
|
||||
|
||||
+// Disables TLS resumption.
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kDisableTLSResumption);
|
||||
+
|
||||
+// Log TLS resumption.
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kLogTLSResumption);
|
||||
+
|
||||
// Enables the TLS Encrypted ClientHello feature.
|
||||
// https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-13
|
||||
NET_EXPORT BASE_DECLARE_FEATURE(kEncryptedClientHello);
|
||||
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
|
||||
--- a/net/http/http_network_session.cc
|
||||
+++ b/net/http/http_network_session.cc
|
||||
@@ -211,6 +211,7 @@ HttpNetworkSession::HttpNetworkSession(const HttpNetworkSessionParams& params,
|
||||
|
||||
next_protos_.push_back(kProtoHTTP11);
|
||||
|
||||
+ DCHECK(context.quic_context->params()->max_server_configs_stored_in_properties == 0);
|
||||
http_server_properties_->SetMaxServerConfigsStoredInProperties(
|
||||
context.quic_context->params()->max_server_configs_stored_in_properties);
|
||||
http_server_properties_->SetBrokenAlternativeServicesDelayParams(
|
||||
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
|
||||
--- a/net/quic/quic_stream_factory.cc
|
||||
+++ b/net/quic/quic_stream_factory.cc
|
||||
@@ -72,6 +72,7 @@
|
||||
#include "net/third_party/quiche/src/quiche/quic/core/quic_utils.h"
|
||||
#include "net/third_party/quiche/src/quiche/quic/platform/api/quic_flags.h"
|
||||
#include "third_party/boringssl/src/include/openssl/aead.h"
|
||||
+#include "third_party/boringssl/src/include/openssl/ssl.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/scheme_host_port.h"
|
||||
#include "url/url_constants.h"
|
||||
@@ -245,6 +246,38 @@ quic::ParsedQuicVersion SelectQuicVersion(
|
||||
|
||||
} // namespace
|
||||
|
||||
+class BromiteSessionCache : public quic::QuicClientSessionCache {
|
||||
+ public:
|
||||
+ BromiteSessionCache() = default;
|
||||
+ ~BromiteSessionCache() override = default;
|
||||
+
|
||||
+ void Insert(const quic::QuicServerId& server_id,
|
||||
+ bssl::UniquePtr<SSL_SESSION> session,
|
||||
+ const quic::TransportParameters& params,
|
||||
+ const quic::ApplicationState* application_state) override {
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kDisableTLSResumption))
|
||||
+ SSL_SESSION_set_timeout(session.get(), 0);
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kLogTLSResumption)) {
|
||||
+ LOG(INFO) << "SSL Log: new quic session created "
|
||||
+ << server_id.host();
|
||||
+ }
|
||||
+ quic::QuicClientSessionCache::Insert(server_id,
|
||||
+ std::move(session), params, application_state);
|
||||
+ }
|
||||
+
|
||||
+ std::unique_ptr<quic::QuicResumptionState> Lookup(
|
||||
+ const quic::QuicServerId& server_id, quic::QuicWallTime now,
|
||||
+ const SSL_CTX* ctx) override {
|
||||
+ auto value = quic::QuicClientSessionCache::Lookup(server_id, now, ctx);
|
||||
+ if (value != nullptr &&
|
||||
+ base::FeatureList::IsEnabled(net::features::kLogTLSResumption)) {
|
||||
+ LOG(INFO) << "SSL Log: QUIC session resumed "
|
||||
+ << server_id.host();
|
||||
+ }
|
||||
+ return value;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
// Refcounted class that owns quic::QuicCryptoClientConfig and tracks how many
|
||||
// consumers are using it currently. When the last reference is freed, the
|
||||
// QuicCryptoClientConfigHandle informs the owning QuicStreamFactory, moves it
|
||||
@@ -2249,7 +2282,7 @@ QuicStreamFactory::CreateCryptoConfigHandle(
|
||||
sct_auditing_delegate_,
|
||||
HostsFromOrigins(params_.origins_to_force_quic_on),
|
||||
actual_network_anonymization_key),
|
||||
- std::make_unique<quic::QuicClientSessionCache>(), this);
|
||||
+ std::make_unique<BromiteSessionCache>(), this);
|
||||
|
||||
quic::QuicCryptoClientConfig* crypto_config = crypto_config_owner->config();
|
||||
crypto_config->set_user_agent_id(params_.user_agent_id);
|
||||
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
|
||||
--- a/net/socket/ssl_client_socket_impl.cc
|
||||
+++ b/net/socket/ssl_client_socket_impl.cc
|
||||
@@ -392,7 +392,33 @@ SSLClientSocketImpl::SSLClientSocketImpl(
|
||||
CHECK(context_);
|
||||
}
|
||||
|
||||
+void SSLClientSocketImpl::Log_ssl_session_data(const std::string& tag, SSL_SESSION* session) {
|
||||
+ if (session == NULL) {
|
||||
+ LOG(INFO) << "SSL Log: "
|
||||
+ << tag
|
||||
+ << " host: " << host_and_port_.ToString()
|
||||
+ << " NIK: " << ssl_config_.network_anonymization_key.ToDebugString();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ unsigned len;
|
||||
+ auto* session_id = SSL_SESSION_get_id(session, &len);
|
||||
+
|
||||
+ const uint8_t *ticket;
|
||||
+ size_t ticklen;
|
||||
+ SSL_SESSION_get0_ticket(session, &ticket, &ticklen);
|
||||
+
|
||||
+ LOG(INFO) << "SSL Log: "
|
||||
+ << tag
|
||||
+ << " host: " << host_and_port_.ToString()
|
||||
+ << " NIK: " << ssl_config_.network_anonymization_key.ToDebugString()
|
||||
+ << " sessionid: " << base::HexEncode(session_id, len)
|
||||
+ << (ticklen > 0 ? " ticket:" + base::HexEncode(ticket, ticklen) : "");
|
||||
+}
|
||||
+
|
||||
SSLClientSocketImpl::~SSLClientSocketImpl() {
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kLogTLSResumption))
|
||||
+ Log_ssl_session_data("Disconnect", NULL);
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -786,6 +812,8 @@ int SSLClientSocketImpl::Init() {
|
||||
}
|
||||
if (session)
|
||||
SSL_set_session(ssl_.get(), session.get());
|
||||
+ if (session && base::FeatureList::IsEnabled(net::features::kLogTLSResumption))
|
||||
+ Log_ssl_session_data("Old session resumed", session.get());
|
||||
}
|
||||
|
||||
transport_adapter_ = std::make_unique<SocketBIOAdapter>(
|
||||
@@ -1077,6 +1105,35 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) {
|
||||
: SSLHandshakeDetails::kTLS13Full;
|
||||
}
|
||||
}
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kLogTLSResumption)) {
|
||||
+ switch(details)
|
||||
+ {
|
||||
+ case SSLHandshakeDetails::kTLS13Early:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS13Early mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS13ResumeWithHelloRetryRequest:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS13ResumeWithHelloRetryRequest mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS13Resume:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS13Resume mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS12Resume:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS12Resume mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS12Full:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS12Full mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS12FalseStart:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS12FalseStart mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS13Full:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS13Full mode", NULL);
|
||||
+ break;
|
||||
+ case SSLHandshakeDetails::kTLS13FullWithHelloRetryRequest:
|
||||
+ Log_ssl_session_data("SSL Log: session reused: kTLS13FullWithHelloRetryRequest mode", NULL);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
UMA_HISTOGRAM_ENUMERATION("Net.SSLHandshakeDetails", details);
|
||||
|
||||
// Measure TLS connections that implement the renegotiation_info extension.
|
||||
@@ -1760,6 +1817,8 @@ bool SSLClientSocketImpl::IsRenegotiationAllowed() const {
|
||||
}
|
||||
|
||||
bool SSLClientSocketImpl::IsCachingEnabled() const {
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kDisableTLSResumption))
|
||||
+ return false;
|
||||
return context_->ssl_client_session_cache() != nullptr;
|
||||
}
|
||||
|
||||
diff --git a/net/socket/ssl_client_socket_impl.h b/net/socket/ssl_client_socket_impl.h
|
||||
--- a/net/socket/ssl_client_socket_impl.h
|
||||
+++ b/net/socket/ssl_client_socket_impl.h
|
||||
@@ -127,6 +127,8 @@ class SSLClientSocketImpl : public SSLClientSocket,
|
||||
friend class SSLClientSocket;
|
||||
friend class SSLContext;
|
||||
|
||||
+ void Log_ssl_session_data(const std::string& tag, SSL_SESSION* session);
|
||||
+
|
||||
int Init();
|
||||
void DoReadCallback(int result);
|
||||
void DoWriteCallback(int result);
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,61 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 16 Feb 2022 14:28:58 +0000
|
||||
Subject: Disable UA full version
|
||||
|
||||
getHighEntropyValues will return only the major version
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../renderer/core/frame/navigator_ua_data.cc | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_party/blink/renderer/core/frame/navigator_ua_data.cc
|
||||
--- a/third_party/blink/renderer/core/frame/navigator_ua_data.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/navigator_ua_data.cc
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
+#include "base/version.h"
|
||||
+#include "base/strings/strcat.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
|
||||
@@ -39,6 +41,16 @@ void MaybeRecordMetric(bool record_identifiability,
|
||||
.Record(execution_context->UkmRecorder());
|
||||
}
|
||||
|
||||
+const String GetReducedVersionNumber(const std::string& fullVersion) {
|
||||
+ base::Version version(fullVersion);
|
||||
+ std::string version_str;
|
||||
+ const std::vector<uint32_t>& components = version.components();
|
||||
+ if (components.size() > 0) {
|
||||
+ version_str = base::StrCat({base::NumberToString(components[0]), ".0.0.0"});
|
||||
+ }
|
||||
+ return String::FromUTF8(version_str);
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
NavigatorUAData::NavigatorUAData(ExecutionContext* context)
|
||||
@@ -77,7 +89,7 @@ void NavigatorUAData::SetFullVersionList(
|
||||
const UserAgentBrandList& full_version_list) {
|
||||
for (const auto& brand_version : full_version_list) {
|
||||
AddBrandFullVersion(String::FromUTF8(brand_version.brand),
|
||||
- String::FromUTF8(brand_version.version));
|
||||
+ GetReducedVersionNumber(brand_version.version));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +111,7 @@ void NavigatorUAData::SetModel(const String& model) {
|
||||
}
|
||||
|
||||
void NavigatorUAData::SetUAFullVersion(const String& ua_full_version) {
|
||||
- ua_full_version_ = ua_full_version;
|
||||
+ ua_full_version_ = GetReducedVersionNumber(ua_full_version.Ascii());
|
||||
}
|
||||
|
||||
void NavigatorUAData::SetBitness(const String& bitness) {
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,26 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 28 Sep 2022 00:54:10 +0200
|
||||
Subject: Disable add to home screen prompt
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../webapps/AddToHomescreenMostVisitedTileClickObserver.java | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java
|
||||
@@ -43,10 +43,7 @@ public class AddToHomescreenMostVisitedTileClickObserver implements MostVisitedT
|
||||
ntp.addMostVisitedTileClickObserver(
|
||||
AddToHomescreenMostVisitedTileClickObserver.this);
|
||||
} else {
|
||||
- // If it is a regular web page, and started from a most visited tile, show IPH.
|
||||
- if (url.getOrigin().equals(mLastClickedMostVisitedTileUrl)) {
|
||||
- addToHomescreenIPHController.showAddToHomescreenIPH(tab);
|
||||
- }
|
||||
+ // do not show any add to home screen IPH in Bromite
|
||||
removeObserver(tab);
|
||||
}
|
||||
mLastClickedMostVisitedTileUrl = null;
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,298 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 25 Jan 2022 12:22:52 +0000
|
||||
Subject: Disable all predictors code
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chrome_hints_manager.cc | 1 +
|
||||
.../optimization_guide_keyed_service.cc | 1 -
|
||||
chrome/common/chrome_features.cc | 8 ++--
|
||||
.../optimization_guide/core/hints_fetcher.cc | 1 +
|
||||
.../optimization_guide/core/hints_manager.cc | 5 +++
|
||||
.../core/optimization_guide_features.cc | 38 +++++++++----------
|
||||
.../core/prediction_model_download_manager.cc | 6 ++-
|
||||
.../core/prediction_model_fetcher_impl.cc | 1 +
|
||||
components/optimization_guide/features.gni | 4 +-
|
||||
components/permissions/features.cc | 8 ++--
|
||||
third_party/blink/common/features.cc | 8 +---
|
||||
11 files changed, 40 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/browser/optimization_guide/chrome_hints_manager.cc
|
||||
--- a/chrome/browser/optimization_guide/chrome_hints_manager.cc
|
||||
+++ b/chrome/browser/optimization_guide/chrome_hints_manager.cc
|
||||
@@ -26,6 +26,7 @@ bool IsAllowedToFetchForNavigationPrediction(
|
||||
const absl::optional<NavigationPredictorKeyedService::Prediction>
|
||||
prediction) {
|
||||
DCHECK(prediction);
|
||||
+ if ((true)) return false;
|
||||
|
||||
if (prediction->prediction_source() !=
|
||||
NavigationPredictorKeyedService::PredictionSource::
|
||||
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
|
||||
--- a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
|
||||
+++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
|
||||
@@ -318,7 +318,6 @@ void OptimizationGuideKeyedService::RemoveObserverForOptimizationTargetModel(
|
||||
void OptimizationGuideKeyedService::RegisterOptimizationTypes(
|
||||
const std::vector<optimization_guide::proto::OptimizationType>&
|
||||
optimization_types) {
|
||||
- hints_manager_->RegisterOptimizationTypes(optimization_types);
|
||||
}
|
||||
|
||||
optimization_guide::OptimizationGuideDecision
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -889,8 +889,8 @@ BASE_FEATURE(kPermissionAuditing,
|
||||
// Enables using the prediction service for permission prompts. We will keep
|
||||
// this feature in order to allow us to update the holdback chance via finch.
|
||||
BASE_FEATURE(kPermissionPredictions,
|
||||
- "PermissionPredictions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "PermissionPredictions", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// The holdback chance is 30% but it can also be configured/updated
|
||||
// through finch if needed.
|
||||
@@ -901,8 +901,8 @@ const base::FeatureParam<double> kPermissionPredictionsHoldbackChance(
|
||||
|
||||
// Enables using the prediction service for geolocation permission prompts.
|
||||
BASE_FEATURE(kPermissionGeolocationPredictions,
|
||||
- "PermissionGeolocationPredictions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "PermissionGeolocationPredictions", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
const base::FeatureParam<double>
|
||||
kPermissionGeolocationPredictionsHoldbackChance(
|
||||
diff --git a/components/optimization_guide/core/hints_fetcher.cc b/components/optimization_guide/core/hints_fetcher.cc
|
||||
--- a/components/optimization_guide/core/hints_fetcher.cc
|
||||
+++ b/components/optimization_guide/core/hints_fetcher.cc
|
||||
@@ -174,6 +174,7 @@ bool HintsFetcher::FetchOptimizationGuideServiceHints(
|
||||
optimization_guide::proto::RequestContext request_context,
|
||||
const std::string& locale,
|
||||
HintsFetchedCallback hints_fetched_callback) {
|
||||
+ if ((true)) return false;
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK_GT(optimization_types.size(), 0u);
|
||||
request_context_ = request_context;
|
||||
diff --git a/components/optimization_guide/core/hints_manager.cc b/components/optimization_guide/core/hints_manager.cc
|
||||
--- a/components/optimization_guide/core/hints_manager.cc
|
||||
+++ b/components/optimization_guide/core/hints_manager.cc
|
||||
@@ -352,6 +352,7 @@ void HintsManager::Shutdown() {
|
||||
OptimizationGuideDecision
|
||||
HintsManager::GetOptimizationGuideDecisionFromOptimizationTypeDecision(
|
||||
OptimizationTypeDecision optimization_type_decision) {
|
||||
+ if ((true)) return OptimizationGuideDecision::kFalse;
|
||||
switch (optimization_type_decision) {
|
||||
case OptimizationTypeDecision::kAllowedByOptimizationFilter:
|
||||
case OptimizationTypeDecision::kAllowedByHint:
|
||||
@@ -1056,6 +1057,7 @@ void HintsManager::CanApplyOptimizationOnDemand(
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
// TODO(crbug/1275612): Check whether we have consent to fetch.
|
||||
+ if ((true)) return; // no consent on bromite
|
||||
|
||||
// This set contains URLs that require some information to be fetched, whether
|
||||
// that be a URL-keyed hint or a host-keyed hint.
|
||||
@@ -1263,6 +1265,9 @@ OptimizationTypeDecision HintsManager::CanApplyOptimization(
|
||||
proto::OptimizationType optimization_type,
|
||||
OptimizationMetadata* optimization_metadata) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
+ if ((true)) {
|
||||
+ return OptimizationTypeDecision::kNoHintAvailable;
|
||||
+ }
|
||||
|
||||
ScopedCanApplyOptimizationLogger scoped_logger(
|
||||
optimization_type, navigation_url, optimization_guide_logger_);
|
||||
diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc
|
||||
--- a/components/optimization_guide/core/optimization_guide_features.cc
|
||||
+++ b/components/optimization_guide/core/optimization_guide_features.cc
|
||||
@@ -78,17 +78,17 @@ bool IsSupportedLocaleForFeature(const std::string locale,
|
||||
// Enables the syncing of the Optimization Hints component, which provides
|
||||
// hints for what optimizations can be applied on a page load.
|
||||
BASE_FEATURE(kOptimizationHints,
|
||||
- "OptimizationHints",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OptimizationHints", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enables fetching from a remote Optimization Guide Service.
|
||||
BASE_FEATURE(kRemoteOptimizationGuideFetching,
|
||||
- "OptimizationHintsFetching",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OptimizationHintsFetching", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kRemoteOptimizationGuideFetchingAnonymousDataConsent,
|
||||
- "OptimizationHintsFetchingAnonymousDataConsent",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OptimizationHintsFetchingAnonymousDataConsent", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enables performance info in the context menu and fetching from a remote
|
||||
// Optimization Guide Service.
|
||||
@@ -98,17 +98,13 @@ BASE_FEATURE(kContextMenuPerformanceInfoAndRemoteHintFetching,
|
||||
|
||||
// Enables the prediction of optimization targets.
|
||||
BASE_FEATURE(kOptimizationTargetPrediction,
|
||||
- "OptimizationTargetPrediction",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OptimizationTargetPrediction", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enables the downloading of models.
|
||||
BASE_FEATURE(kOptimizationGuideModelDownloading,
|
||||
- "OptimizationGuideModelDownloading",
|
||||
-#if BUILDFLAG(BUILD_WITH_TFLITE_LIB)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else // BUILD_WITH_TFLITE_LIB
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif // !BUILD_WITH_TFLITE_LIB
|
||||
+ "OptimizationGuideModelDownloading", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
|
||||
);
|
||||
|
||||
// Enables page content to be annotated.
|
||||
@@ -143,8 +139,8 @@ BASE_FEATURE(kPageEntitiesModelResetOnShutdown,
|
||||
|
||||
// Enables push notification of hints.
|
||||
BASE_FEATURE(kPushNotifications,
|
||||
- "OptimizationGuidePushNotifications",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "OptimizationGuidePushNotifications", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// This feature flag does not turn off any behavior, it is only used for
|
||||
// experiment parameters.
|
||||
@@ -158,15 +154,15 @@ BASE_FEATURE(kOptimizationGuideMetadataValidation,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kPageTopicsBatchAnnotations,
|
||||
- "PageTopicsBatchAnnotations",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "PageTopicsBatchAnnotations", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
BASE_FEATURE(kPageVisibilityBatchAnnotations,
|
||||
"PageVisibilityBatchAnnotations",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kUseLocalPageEntitiesMetadataProvider,
|
||||
- "UseLocalPageEntitiesMetadataProvider",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "UseLocalPageEntitiesMetadataProvider", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kPageContentAnnotationsValidation,
|
||||
"PageContentAnnotationsValidation",
|
||||
@@ -414,7 +410,7 @@ size_t MaxURLKeyedHintCacheSize() {
|
||||
|
||||
bool ShouldPersistHintsToDisk() {
|
||||
return GetFieldTrialParamByFeatureAsBool(kOptimizationHints,
|
||||
- "persist_hints_to_disk", true);
|
||||
+ "persist_hints_to_disk", false);
|
||||
}
|
||||
|
||||
bool ShouldOverrideOptimizationTargetDecisionForMetricsPurposes(
|
||||
diff --git a/components/optimization_guide/core/prediction_model_download_manager.cc b/components/optimization_guide/core/prediction_model_download_manager.cc
|
||||
--- a/components/optimization_guide/core/prediction_model_download_manager.cc
|
||||
+++ b/components/optimization_guide/core/prediction_model_download_manager.cc
|
||||
@@ -45,7 +45,7 @@ constexpr char kGoogApiKey[] = "X-Goog-Api-Key";
|
||||
// we require models to come from.
|
||||
constexpr uint8_t kPublisherKeyHash[] = {
|
||||
0x66, 0xa1, 0xd9, 0x3e, 0x4e, 0x5a, 0x66, 0x8a, 0x0f, 0xd3, 0xfa,
|
||||
- 0xa3, 0x70, 0x71, 0x42, 0x16, 0x0d, 0x2d, 0x68, 0xb0, 0x53, 0x02,
|
||||
+ 0x01, 0x02, 0x03, 0x04, 0x16, 0x0d, 0x2d, 0x68, 0xb0, 0x53, 0x02,
|
||||
0x5c, 0x7f, 0xd0, 0x0c, 0xa1, 0x6e, 0xef, 0xdd, 0x63, 0x7a};
|
||||
const net::NetworkTrafficAnnotationTag
|
||||
kOptimizationGuidePredictionModelsTrafficAnnotation =
|
||||
@@ -93,7 +93,7 @@ PredictionModelDownloadManager::PredictionModelDownloadManager(
|
||||
const base::FilePath& models_dir_path,
|
||||
scoped_refptr<base::SequencedTaskRunner> background_task_runner)
|
||||
: download_service_(download_service),
|
||||
- is_available_for_downloads_(true),
|
||||
+ is_available_for_downloads_(false),
|
||||
api_key_(features::GetOptimizationGuideServiceAPIKey()),
|
||||
models_dir_path_(models_dir_path),
|
||||
background_task_runner_(background_task_runner) {}
|
||||
@@ -103,6 +103,7 @@ PredictionModelDownloadManager::~PredictionModelDownloadManager() = default;
|
||||
void PredictionModelDownloadManager::StartDownload(
|
||||
const GURL& download_url,
|
||||
proto::OptimizationTarget optimization_target) {
|
||||
+ if ((true)) return;
|
||||
download::DownloadParams download_params;
|
||||
download_params.client =
|
||||
download::DownloadClient::OPTIMIZATION_GUIDE_PREDICTION_MODELS;
|
||||
@@ -239,6 +240,7 @@ void PredictionModelDownloadManager::OnDownloadFailed(
|
||||
absl::optional<std::pair<base::FilePath, base::FilePath>>
|
||||
PredictionModelDownloadManager::VerifyDownload(const base::FilePath& file_path,
|
||||
bool delete_file_on_error) {
|
||||
+ if ((true)) return absl::nullopt;
|
||||
if (!switches::ShouldSkipModelDownloadVerificationForTesting()) {
|
||||
// Verify that the |file_path| contains a valid CRX file.
|
||||
std::string public_key;
|
||||
diff --git a/components/optimization_guide/core/prediction_model_fetcher_impl.cc b/components/optimization_guide/core/prediction_model_fetcher_impl.cc
|
||||
--- a/components/optimization_guide/core/prediction_model_fetcher_impl.cc
|
||||
+++ b/components/optimization_guide/core/prediction_model_fetcher_impl.cc
|
||||
@@ -50,6 +50,7 @@ bool PredictionModelFetcherImpl::FetchOptimizationGuideServiceModels(
|
||||
proto::RequestContext request_context,
|
||||
const std::string& locale,
|
||||
ModelsFetchedCallback models_fetched_callback) {
|
||||
+ if ((true)) return false;
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
if (url_loader_)
|
||||
diff --git a/components/optimization_guide/features.gni b/components/optimization_guide/features.gni
|
||||
--- a/components/optimization_guide/features.gni
|
||||
+++ b/components/optimization_guide/features.gni
|
||||
@@ -10,9 +10,7 @@ if (is_android) {
|
||||
declare_args() {
|
||||
# This enables build with TFLite library.
|
||||
# Currently only available for Desktop and Android.
|
||||
- build_with_tflite_lib =
|
||||
- is_android || (is_win && target_cpu != "arm64") || is_linux || is_mac ||
|
||||
- is_chromeos || is_fuchsia || is_ios
|
||||
+ build_with_tflite_lib = false
|
||||
|
||||
# You can set the variable 'build_with_internal_optimization_guide' to true
|
||||
# even in a developer build in args.gn. Setting this variable explicitly to true will
|
||||
diff --git a/components/permissions/features.cc b/components/permissions/features.cc
|
||||
--- a/components/permissions/features.cc
|
||||
+++ b/components/permissions/features.cc
|
||||
@@ -85,12 +85,12 @@ BASE_FEATURE(kPermissionChipRequestTypeSensitive,
|
||||
// When enabled, use the value of the `service_url` FeatureParam as the url
|
||||
// for the Web Permission Predictions Service.
|
||||
BASE_FEATURE(kPermissionPredictionServiceUseUrlOverride,
|
||||
- "kPermissionPredictionServiceUseUrlOverride",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "kPermissionPredictionServiceUseUrlOverride", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kPermissionOnDeviceNotificationPredictions,
|
||||
- "PermissionOnDeviceNotificationPredictions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "PermissionOnDeviceNotificationPredictions", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kPermissionOnDeviceGeolocationPredictions,
|
||||
"PermissionOnDeviceGeolocationPredictions",
|
||||
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -230,12 +230,8 @@ BASE_FEATURE(kMixedContentAutoupgrade,
|
||||
// predictor may preconnect/prefetch to resources/origins to make the
|
||||
// future navigations faster.
|
||||
BASE_FEATURE(kNavigationPredictor,
|
||||
- "NavigationPredictor",
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif
|
||||
+ "NavigationPredictor", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite
|
||||
);
|
||||
|
||||
// Anchor Element Interaction
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,34 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:09:26 +0200
|
||||
Subject: Disable all promo dialogs
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
@@ -856,7 +856,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
|
||||
* displayed.
|
||||
*/
|
||||
private boolean triggerPromo(boolean intentWithEffect) {
|
||||
- try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
|
||||
+ /*try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
|
||||
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_STARTUP_PROMOS)) {
|
||||
return false;
|
||||
}
|
||||
@@ -891,8 +891,8 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
|
||||
preferenceManager.writeBoolean(
|
||||
ChromePreferenceKeys.PROMOS_SKIPPED_ON_FIRST_START, true);
|
||||
}
|
||||
- return isShowingPromo;
|
||||
- }
|
||||
+ return isShowingPromo; } */
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,227 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 15 Nov 2021 09:43:29 +0000
|
||||
Subject: Disable conversion measurement api
|
||||
|
||||
Disable Conversion Measurement API by disabling the flag and removing
|
||||
support for the AttributionReporting provider. it also removes
|
||||
the handling of attributions via intents between apps.
|
||||
This patch enforces the deactivation by preventing the report from
|
||||
being sent and being saved to disk, although it is currently in uncalled code.
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser/flags/android/chrome_feature_list.cc | 4 ++--
|
||||
.../embedder_support/origin_trials/features.cc | 8 ++++----
|
||||
.../render_view_context_menu_base.cc | 3 ---
|
||||
.../aggregatable_report_sender.cc | 15 +++++++--------
|
||||
.../attribution_reporting/attribution_host.cc | 1 +
|
||||
.../attribution_report_network_sender.cc | 11 ++++++++---
|
||||
.../attribution_storage_sql.cc | 8 +++++---
|
||||
content/browser/storage_partition_impl.cc | 7 +------
|
||||
content/public/browser/navigation_controller.cc | 1 -
|
||||
third_party/blink/common/features.cc | 4 ++--
|
||||
.../platform/runtime_enabled_features.json5 | 7 +++++++
|
||||
11 files changed, 37 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -522,8 +522,8 @@ BASE_FEATURE(kAppMenuMobileSiteOption,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kAppToWebAttribution,
|
||||
- "AppToWebAttribution",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "AppToWebAttribution", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kBackgroundThreadPool,
|
||||
"BackgroundThreadPool",
|
||||
diff --git a/components/embedder_support/origin_trials/features.cc b/components/embedder_support/origin_trials/features.cc
|
||||
--- a/components/embedder_support/origin_trials/features.cc
|
||||
+++ b/components/embedder_support/origin_trials/features.cc
|
||||
@@ -14,11 +14,11 @@ namespace embedder_support {
|
||||
// Users from control group will have the feature disabled, excluding them
|
||||
// from the origin trial.
|
||||
BASE_FEATURE(kOriginTrialsSampleAPIThirdPartyAlternativeUsage,
|
||||
- "OriginTrialsSampleAPIThirdPartyAlternativeUsage",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OriginTrialsSampleAPIThirdPartyAlternativeUsage", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kConversionMeasurementAPIAlternativeUsage,
|
||||
- "ConversionMeasurementAPIAlternativeUsage",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "ConversionMeasurementAPIAlternativeUsage", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
} // namespace embedder_support
|
||||
diff --git a/components/renderer_context_menu/render_view_context_menu_base.cc b/components/renderer_context_menu/render_view_context_menu_base.cc
|
||||
--- a/components/renderer_context_menu/render_view_context_menu_base.cc
|
||||
+++ b/components/renderer_context_menu/render_view_context_menu_base.cc
|
||||
@@ -486,9 +486,6 @@ void RenderViewContextMenuBase::OpenURLWithExtraHeaders(
|
||||
|
||||
open_url_params.source_site_instance = site_instance_;
|
||||
|
||||
- if (disposition != WindowOpenDisposition::OFF_THE_RECORD)
|
||||
- open_url_params.impression = params_.impression;
|
||||
-
|
||||
source_web_contents_->OpenURL(open_url_params);
|
||||
}
|
||||
|
||||
diff --git a/content/browser/aggregation_service/aggregatable_report_sender.cc b/content/browser/aggregation_service/aggregatable_report_sender.cc
|
||||
--- a/content/browser/aggregation_service/aggregatable_report_sender.cc
|
||||
+++ b/content/browser/aggregation_service/aggregatable_report_sender.cc
|
||||
@@ -136,19 +136,18 @@ void AggregatableReportSender::SendReport(const GURL& url,
|
||||
// Allow bodies of non-2xx responses to be returned.
|
||||
simple_url_loader_ptr->SetAllowHttpErrorResults(true);
|
||||
|
||||
- // Unretained is safe because the URLLoader is owned by `this` and will be
|
||||
- // deleted before `this`.
|
||||
- simple_url_loader_ptr->DownloadHeadersOnly(
|
||||
- url_loader_factory_.get(),
|
||||
- base::BindOnce(&AggregatableReportSender::OnReportSent,
|
||||
- base::Unretained(this), std::move(it),
|
||||
- std::move(callback)));
|
||||
+ // this is never called on Bromite but nothing would be sent if it were
|
||||
+ OnReportSent(std::move(it), std::move(callback), nullptr);
|
||||
}
|
||||
|
||||
void AggregatableReportSender::OnReportSent(
|
||||
UrlLoaderList::iterator it,
|
||||
ReportSentCallback callback,
|
||||
- scoped_refptr<net::HttpResponseHeaders> headers) {
|
||||
+ scoped_refptr<net::HttpResponseHeaders> headers) { // disable in Bromite
|
||||
+ if ((true)) {
|
||||
+ std::move(callback).Run(RequestStatus::kOk);
|
||||
+ return;
|
||||
+ }
|
||||
RequestStatus status;
|
||||
|
||||
absl::optional<int> http_response_code;
|
||||
diff --git a/content/browser/attribution_reporting/attribution_host.cc b/content/browser/attribution_reporting/attribution_host.cc
|
||||
--- a/content/browser/attribution_reporting/attribution_host.cc
|
||||
+++ b/content/browser/attribution_reporting/attribution_host.cc
|
||||
@@ -126,6 +126,7 @@ void AttributionHost::DidRedirectNavigation(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if ((true)) return;
|
||||
AttributionManager* attribution_manager =
|
||||
AttributionManager::FromWebContents(web_contents());
|
||||
if (!attribution_manager)
|
||||
diff --git a/content/browser/attribution_reporting/attribution_report_network_sender.cc b/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
--- a/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
+++ b/content/browser/attribution_reporting/attribution_report_network_sender.cc
|
||||
@@ -132,9 +132,8 @@ void AttributionReportNetworkSender::SendReport(GURL url,
|
||||
network::SimpleURLLoader::RETRY_ON_NAME_NOT_RESOLVED;
|
||||
simple_url_loader_ptr->SetRetryOptions(/*max_retries=*/1, retry_mode);
|
||||
|
||||
- simple_url_loader_ptr->DownloadHeadersOnly(
|
||||
- url_loader_factory_.get(),
|
||||
- base::BindOnce(std::move(callback), std::move(it)));
|
||||
+ // this is never called on Bromite but nothing would be sent if it were
|
||||
+ OnReportSent(std::move(it), report, is_debug_report, std::move(sent_callback), nullptr);
|
||||
}
|
||||
|
||||
void AttributionReportNetworkSender::OnReportSent(
|
||||
@@ -143,6 +142,12 @@ void AttributionReportNetworkSender::OnReportSent(
|
||||
ReportSentCallback sent_callback,
|
||||
UrlLoaderList::iterator it,
|
||||
scoped_refptr<net::HttpResponseHeaders> headers) {
|
||||
+ if ((true)) {
|
||||
+ std::move(sent_callback)
|
||||
+ .Run(std::move(report),
|
||||
+ SendResult(SendResult::Status::kSent, headers ? headers->response_code() : 200));
|
||||
+ return;
|
||||
+ }
|
||||
network::SimpleURLLoader* loader = it->get();
|
||||
|
||||
// Consider a non-200 HTTP code as a non-internal error.
|
||||
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc
|
||||
--- a/content/browser/attribution_reporting/attribution_storage_sql.cc
|
||||
+++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
|
||||
@@ -514,6 +514,8 @@ DestinationLimitResult GetDestinationLimitResult(
|
||||
}
|
||||
}
|
||||
|
||||
+bool g_run_in_memory = true;
|
||||
+
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
@@ -525,9 +527,9 @@ bool AttributionStorageSql::DeleteStorageForTesting(
|
||||
AttributionStorageSql::AttributionStorageSql(
|
||||
const base::FilePath& user_data_directory,
|
||||
std::unique_ptr<AttributionStorageDelegate> delegate)
|
||||
- : path_to_database_(user_data_directory.empty()
|
||||
- ? base::FilePath()
|
||||
- : DatabasePath(user_data_directory)),
|
||||
+ : path_to_database_(user_data_directory.empty() || g_run_in_memory
|
||||
+ ? base::FilePath()
|
||||
+ : DatabasePath(user_data_directory)),
|
||||
delegate_(std::move(delegate)),
|
||||
rate_limit_table_(delegate_.get()) {
|
||||
DCHECK(delegate_);
|
||||
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
|
||||
--- a/content/browser/storage_partition_impl.cc
|
||||
+++ b/content/browser/storage_partition_impl.cc
|
||||
@@ -1358,12 +1358,7 @@ void StoragePartitionImpl::Initialize(
|
||||
|
||||
bucket_manager_ = std::make_unique<BucketManager>(this);
|
||||
|
||||
- // The Conversion Measurement API is not available in Incognito mode.
|
||||
- if (!is_in_memory() &&
|
||||
- base::FeatureList::IsEnabled(blink::features::kConversionMeasurement)) {
|
||||
- attribution_manager_ = std::make_unique<AttributionManagerImpl>(
|
||||
- this, path, special_storage_policy_);
|
||||
- }
|
||||
+ // The Conversion Measurement API is not available in Bromite.
|
||||
|
||||
if (base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
|
||||
// Auction worklets on non-Android use dedicated processes; on Android due
|
||||
diff --git a/content/public/browser/navigation_controller.cc b/content/public/browser/navigation_controller.cc
|
||||
--- a/content/public/browser/navigation_controller.cc
|
||||
+++ b/content/public/browser/navigation_controller.cc
|
||||
@@ -39,7 +39,6 @@ NavigationController::LoadURLParams::LoadURLParams(const OpenURLParams& input)
|
||||
blob_url_loader_factory(input.blob_url_loader_factory),
|
||||
href_translate(input.href_translate),
|
||||
reload_type(input.reload_type),
|
||||
- impression(input.impression),
|
||||
is_pdf(input.is_pdf) {
|
||||
#if DCHECK_IS_ON()
|
||||
DCHECK(input.Valid());
|
||||
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -121,8 +121,8 @@ BASE_FEATURE(kBlockingDownloadsInAdFrameWithoutUserActivation,
|
||||
|
||||
// Controls whether the Conversion Measurement API infrastructure is enabled.
|
||||
BASE_FEATURE(kConversionMeasurement,
|
||||
- "ConversionMeasurement",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "ConversionMeasurement", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Controls whether LCP calculations should exclude low-entropy images. If
|
||||
// enabled, then the associated parameter sets the cutoff, expressed as the
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -201,6 +201,13 @@
|
||||
},
|
||||
|
||||
data: [
|
||||
+ {
|
||||
+ // disable by default features by marking as
|
||||
+ // depends_on: ["DisabledForBromite"]
|
||||
+ // to work is needed to remove "origin_trial_feature_name"
|
||||
+ // and "origin_trial_allows_third_party"
|
||||
+ name: "DisabledForBromite",
|
||||
+ },
|
||||
{
|
||||
name: "AbortSignalThrowIfAborted",
|
||||
status: "stable",
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,25 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 9 Apr 2022 21:43:35 +0200
|
||||
Subject: Disable crash reporting
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
content/public/common/content_features.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -251,8 +251,8 @@ BASE_FEATURE(kCooperativeScheduling,
|
||||
// Enables crash reporting via Reporting API.
|
||||
// https://www.w3.org/TR/reporting/#crash-report
|
||||
BASE_FEATURE(kCrashReporting,
|
||||
- "CrashReporting",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "CrashReporting", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Enables support for the `Critical-CH` response header.
|
||||
// https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,52 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 19 Dec 2019 22:52:53 +0100
|
||||
Subject: Disable feeds support by default
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../org/chromium/chrome/browser/feed/FeedFeatures.java | 8 +-------
|
||||
components/feed/feed_feature_list.cc | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
|
||||
--- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
|
||||
+++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
|
||||
@@ -48,13 +48,7 @@ public final class FeedFeatures {
|
||||
* the user is signed in and confirms it's not a child profile.
|
||||
*/
|
||||
public static boolean isWebFeedUIEnabled() {
|
||||
- // TODO(b/197354832, b/188188861): change consent check to SIGNIN.
|
||||
- return ChromeFeatureList.isEnabled(ChromeFeatureList.WEB_FEED)
|
||||
- && IdentityServicesProvider.get()
|
||||
- .getSigninManager(Profile.getLastUsedRegularProfile())
|
||||
- .getIdentityManager()
|
||||
- .hasPrimaryAccount(ConsentLevel.SYNC)
|
||||
- && !Profile.getLastUsedRegularProfile().isChild();
|
||||
+ return false;
|
||||
}
|
||||
|
||||
public static boolean shouldUseWebFeedAwarenessIPH() {
|
||||
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc
|
||||
--- a/components/feed/feed_feature_list.cc
|
||||
+++ b/components/feed/feed_feature_list.cc
|
||||
@@ -17,14 +17,14 @@
|
||||
namespace feed {
|
||||
|
||||
BASE_FEATURE(kInterestFeedContentSuggestions,
|
||||
- "InterestFeedContentSuggestions",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "InterestFeedContentSuggestions", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default in Bromite
|
||||
// InterestFeedV2 takes precedence over InterestFeedContentSuggestions.
|
||||
// InterestFeedV2 is cached in ChromeCachedFlags. If the default value here is
|
||||
// changed, please update the cached one's default value in CachedFeatureFlags.
|
||||
BASE_FEATURE(kInterestFeedV2,
|
||||
- "InterestFeedV2",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "InterestFeedV2", // must be disabled
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default in Bromite
|
||||
|
||||
BASE_FEATURE(kInterestFeedV2Autoplay,
|
||||
"InterestFeedV2Autoplay",
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,236 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 18:16:34 +0200
|
||||
Subject: Disable fetching of all field trials
|
||||
|
||||
Disable seed-based field trials.
|
||||
Disable reporting of Omnibox suggestions header.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
android_webview/nonembedded/BUILD.gn | 2 --
|
||||
.../services/VariationsSeedServer.java | 2 --
|
||||
.../metrics/chrome_browser_sampling_trials.cc | 4 +++
|
||||
components/ukm/ukm_recorder_impl.cc | 3 +++
|
||||
.../firstrun/VariationsSeedBridge.java | 2 +-
|
||||
.../firstrun/VariationsSeedFetcher.java | 26 ++++---------------
|
||||
.../variations/net/omnibox_http_headers.cc | 4 +--
|
||||
.../variations/net/variations_http_headers.cc | 3 +++
|
||||
.../service/variations_field_trial_creator.cc | 3 ++-
|
||||
.../variations/service/variations_service.cc | 15 +++--------
|
||||
.../renderer/core/loader/document_loader.cc | 7 -----
|
||||
11 files changed, 23 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/android_webview/nonembedded/BUILD.gn b/android_webview/nonembedded/BUILD.gn
|
||||
--- a/android_webview/nonembedded/BUILD.gn
|
||||
+++ b/android_webview/nonembedded/BUILD.gn
|
||||
@@ -107,7 +107,6 @@ android_library("services_java") {
|
||||
sources = [
|
||||
"java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
|
||||
"java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
|
||||
- "java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
|
||||
"java/src/org/chromium/android_webview/services/ComponentUpdaterSafeModeUtils.java",
|
||||
"java/src/org/chromium/android_webview/services/ComponentsProviderPathUtil.java",
|
||||
"java/src/org/chromium/android_webview/services/ComponentsProviderService.java",
|
||||
@@ -120,7 +119,6 @@ android_library("services_java") {
|
||||
"java/src/org/chromium/android_webview/services/SafeModeService.java",
|
||||
"java/src/org/chromium/android_webview/services/ServicesStatsHelper.java",
|
||||
"java/src/org/chromium/android_webview/services/StartupFeatureMetadataHolder.java",
|
||||
- "java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
|
||||
"java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
|
||||
]
|
||||
deps = [
|
||||
diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
|
||||
--- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
|
||||
+++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
|
||||
@@ -31,8 +31,6 @@ public class VariationsSeedServer extends Service {
|
||||
@Override
|
||||
public void getSeed(ParcelFileDescriptor newSeedFile, long oldSeedDate,
|
||||
IVariationsSeedServerCallback callback) {
|
||||
- maybeReportMetrics(callback);
|
||||
- VariationsSeedHolder.getInstance().writeSeedIfNewer(newSeedFile, oldSeedDate);
|
||||
}
|
||||
};
|
||||
|
||||
diff --git a/chrome/browser/metrics/chrome_browser_sampling_trials.cc b/chrome/browser/metrics/chrome_browser_sampling_trials.cc
|
||||
--- a/chrome/browser/metrics/chrome_browser_sampling_trials.cc
|
||||
+++ b/chrome/browser/metrics/chrome_browser_sampling_trials.cc
|
||||
@@ -54,6 +54,8 @@ void CreateFallbackSamplingTrial(
|
||||
const std::string& feature_name,
|
||||
const int sampled_in_rate_per_mille,
|
||||
base::FeatureList* feature_list) {
|
||||
+ if ((true))
|
||||
+ return;
|
||||
scoped_refptr<base::FieldTrial> trial(
|
||||
base::FieldTrialList::FactoryGetFieldTrial(
|
||||
trial_name, /*total_probability=*/1000, "Default", entropy_provider));
|
||||
@@ -93,6 +95,8 @@ void CreateFallbackUkmSamplingTrial(
|
||||
const base::FieldTrial::EntropyProvider& entropy_provider,
|
||||
bool is_stable_channel,
|
||||
base::FeatureList* feature_list) {
|
||||
+ if ((true))
|
||||
+ return;
|
||||
static const char kSampledGroup_Stable[] = "Sampled_NoSeed_Stable";
|
||||
static const char kSampledGroup_Other[] = "Sampled_NoSeed_Other";
|
||||
const char* sampled_group = kSampledGroup_Other;
|
||||
diff --git a/components/ukm/ukm_recorder_impl.cc b/components/ukm/ukm_recorder_impl.cc
|
||||
--- a/components/ukm/ukm_recorder_impl.cc
|
||||
+++ b/components/ukm/ukm_recorder_impl.cc
|
||||
@@ -206,6 +206,9 @@ bool HasUnknownMetrics(const builders::DecodeMap& decode_map,
|
||||
|
||||
UkmRecorderImpl::UkmRecorderImpl()
|
||||
: sampling_seed_(static_cast<uint32_t>(base::RandUint64())) {
|
||||
+ if ((true))
|
||||
+ return;
|
||||
+
|
||||
max_kept_sources_ =
|
||||
static_cast<size_t>(base::GetFieldTrialParamByFeatureAsInt(
|
||||
kUkmFeature, "MaxKeptSources", max_kept_sources_));
|
||||
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
|
||||
--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
|
||||
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
|
||||
@@ -51,7 +51,7 @@ public class VariationsSeedBridge {
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
- private static void clearFirstRunPrefs() {
|
||||
+ public static void clearFirstRunPrefs() {
|
||||
ContextUtils.getAppSharedPreferences()
|
||||
.edit()
|
||||
.remove(VARIATIONS_FIRST_RUN_SEED_BASE64)
|
||||
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
|
||||
--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
|
||||
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
|
||||
@@ -340,29 +340,13 @@ public class VariationsSeedFetcher {
|
||||
*/
|
||||
public void fetchSeed(String restrictMode, String milestone, String channel) {
|
||||
assert !ThreadUtils.runningOnUiThread();
|
||||
- // Prevent multiple simultaneous fetches
|
||||
- synchronized (sLock) {
|
||||
- SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
||||
- // Early return if an attempt has already been made to fetch the seed, even if it
|
||||
- // failed. Only attempt to get the initial Java seed once, since a failure probably
|
||||
- // indicates a network problem that is unlikely to be resolved by a second attempt.
|
||||
- // Note that VariationsSeedBridge.hasNativePref() is a pure Java function, reading an
|
||||
- // Android preference that is set when the seed is fetched by the native code.
|
||||
- if (prefs.getBoolean(VARIATIONS_INITIALIZED_PREF, false)
|
||||
- || VariationsSeedBridge.hasNativePref()) {
|
||||
- return;
|
||||
- }
|
||||
+ synchronized (sLock) {
|
||||
+ VariationsSeedBridge.clearFirstRunPrefs();
|
||||
|
||||
- SeedFetchInfo fetchInfo = downloadContent(
|
||||
- VariationsPlatform.ANDROID, restrictMode, milestone, channel, null);
|
||||
- if (fetchInfo.seedInfo != null) {
|
||||
- SeedInfo info = fetchInfo.seedInfo;
|
||||
- VariationsSeedBridge.setVariationsFirstRunSeed(info.seedData, info.signature,
|
||||
- info.country, info.date, info.isGzipCompressed);
|
||||
- }
|
||||
+ SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
||||
// VARIATIONS_INITIALIZED_PREF should still be set to true when exceptions occur
|
||||
prefs.edit().putBoolean(VARIATIONS_INITIALIZED_PREF, true).apply();
|
||||
- }
|
||||
+ }
|
||||
}
|
||||
|
||||
private void recordFetchResultOrCode(int resultOrCode) {
|
||||
@@ -405,7 +389,7 @@ public class VariationsSeedFetcher {
|
||||
* @param curSeedInfo optional currently saved seed info to set the `If-None-Match` header.
|
||||
* @return the object holds the request result and seed data with its related header fields.
|
||||
*/
|
||||
- public SeedFetchInfo downloadContent(@VariationsPlatform int platform, String restrictMode,
|
||||
+ private SeedFetchInfo downloadContent(@VariationsPlatform int platform, String restrictMode,
|
||||
String milestone, String channel, @Nullable SeedInfo curSeedInfo) {
|
||||
SeedFetchInfo fetchInfo = new SeedFetchInfo();
|
||||
HttpURLConnection connection = null;
|
||||
diff --git a/components/variations/net/omnibox_http_headers.cc b/components/variations/net/omnibox_http_headers.cc
|
||||
--- a/components/variations/net/omnibox_http_headers.cc
|
||||
+++ b/components/variations/net/omnibox_http_headers.cc
|
||||
@@ -21,8 +21,8 @@ const char kOmniboxOnDeviceSuggestionsHeader[] =
|
||||
// Whether to enable reporting the header. Included as a quick escape hatch in
|
||||
// case of crashes.
|
||||
BASE_FEATURE(kReportOmniboxOnDeviceSuggestionsHeader,
|
||||
- "ReportOmniboxOnDeviceSuggestionsHeader",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "ReportOmniboxOnDeviceSuggestionsHeader", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
std::string GetHeaderValue() {
|
||||
const std::string group =
|
||||
diff --git a/components/variations/net/variations_http_headers.cc b/components/variations/net/variations_http_headers.cc
|
||||
--- a/components/variations/net/variations_http_headers.cc
|
||||
+++ b/components/variations/net/variations_http_headers.cc
|
||||
@@ -257,6 +257,9 @@ class VariationsHeaderHelper {
|
||||
VariationsHeaderHelper& operator=(const VariationsHeaderHelper&) = delete;
|
||||
|
||||
bool AppendHeaderIfNeeded(const GURL& url, InIncognito incognito) {
|
||||
+ if((true))
|
||||
+ return false;
|
||||
+
|
||||
AppendOmniboxOnDeviceSuggestionsHeaderIfNeeded(url, resource_request_);
|
||||
|
||||
// Note the criteria for attaching client experiment headers:
|
||||
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
|
||||
--- a/components/variations/service/variations_field_trial_creator.cc
|
||||
+++ b/components/variations/service/variations_field_trial_creator.cc
|
||||
@@ -158,7 +158,8 @@ Study::CpuArchitecture GetCurrentCpuArchitecture() {
|
||||
// "--variations-server-url" switches are passed. It is however possible to
|
||||
// apply the testing config as well as specify additional field trials (using
|
||||
// "--force-fieldtrials") by using the "--enable-field-trial-config" switch.
|
||||
-bool ShouldUseFieldTrialTestingConfig(const base::CommandLine* command_line) {
|
||||
+bool ShouldUseFieldTrialTestingConfig(const base::CommandLine* command_line) { // disabled in Bromite
|
||||
+ if ((true)) return false;
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
return command_line->HasSwitch(switches::kEnableFieldTrialTestingConfig);
|
||||
#else
|
||||
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
|
||||
--- a/components/variations/service/variations_service.cc
|
||||
+++ b/components/variations/service/variations_service.cc
|
||||
@@ -220,17 +220,8 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers,
|
||||
// Variations seed fetching is only enabled in official Chrome builds, if a URL
|
||||
// is specified on the command line, and for testing.
|
||||
bool IsFetchingEnabled() {
|
||||
-#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
- switches::kVariationsServerURL) &&
|
||||
- !g_should_fetch_for_testing) {
|
||||
- DVLOG(1)
|
||||
- << "Not performing repeated fetching in unofficial build without --"
|
||||
- << switches::kVariationsServerURL << " specified.";
|
||||
- return false;
|
||||
- }
|
||||
-#endif
|
||||
- return true;
|
||||
+ // set to false even if not used on Android
|
||||
+ return false;
|
||||
}
|
||||
|
||||
// Returns the already downloaded first run seed, and clear the seed from the
|
||||
@@ -589,7 +580,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) {
|
||||
// debugger or if the machine was suspended) and OnURLFetchComplete() hasn't
|
||||
// had a chance to run yet from the previous request. In this case, don't
|
||||
// start a new request and just let the previous one finish.
|
||||
- if (pending_seed_request_)
|
||||
+ if ((true) || pending_seed_request_)
|
||||
return false;
|
||||
|
||||
last_request_was_http_retry_ = is_http_retry;
|
||||
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
--- a/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
|
||||
@@ -174,13 +174,6 @@ Vector<OriginTrialFeature> CopyInitiatorOriginTrials(
|
||||
WebVector<int> CopyInitiatorOriginTrials(
|
||||
const Vector<OriginTrialFeature>& initiator_origin_trial_features) {
|
||||
WebVector<int> result;
|
||||
- for (auto feature : initiator_origin_trial_features) {
|
||||
- // Convert from OriginTrialFeature to int. These values are passed between
|
||||
- // blink navigations. OriginTrialFeature isn't visible outside of blink (and
|
||||
- // doesn't need to be) so the values are transferred outside of blink as
|
||||
- // ints and casted to OriginTrialFeature once being processed in blink.
|
||||
- result.emplace_back(static_cast<int>(feature));
|
||||
- }
|
||||
return result;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 19 Feb 2022 12:01:33 +0100
|
||||
Subject: Disable idle detection
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
content/public/common/content_features.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -501,7 +501,7 @@ BASE_FEATURE(kGreaseUACH, "GreaseUACH", base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
// This is intended as a kill switch for the Idle Detection feature. To enable
|
||||
// this feature, the experimental web platform features flag should be set,
|
||||
// or the site should obtain an Origin Trial token.
|
||||
-BASE_FEATURE(kIdleDetection, "IdleDetection", base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kIdleDetection, "IdleDetection", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
// A feature flag for the memory-backed code cache.
|
||||
BASE_FEATURE(kInMemoryCodeCache,
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,25 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 8 Oct 2021 00:30:26 +0200
|
||||
Subject: Disable lock icon in address bar by default
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
components/omnibox/common/omnibox_features.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc
|
||||
--- a/components/omnibox/common/omnibox_features.cc
|
||||
+++ b/components/omnibox/common/omnibox_features.cc
|
||||
@@ -459,8 +459,8 @@ BASE_FEATURE(kSiteSearchStarterPack,
|
||||
|
||||
// Experiment to introduce new security indicators for HTTPS.
|
||||
BASE_FEATURE(kUpdatedConnectionSecurityIndicators,
|
||||
- "OmniboxUpdatedConnectionSecurityIndicators",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ "OmniboxUpdatedConnectionSecurityIndicators", // enabled by default
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
// Feature used to default typed navigations to use HTTPS instead of HTTP.
|
||||
// This only applies to navigations that don't have a scheme such as
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,79 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Thu, 4 Jul 2019 19:08:52 -0400
|
||||
Subject: Disable media router and remoting by default
|
||||
|
||||
Original License: MIT - https://spdx.org/licenses/MIT.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../media/router/media_router_feature.cc | 27 ++++++-------------
|
||||
chrome/browser/profiles/profile_impl.cc | 2 +-
|
||||
2 files changed, 9 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
|
||||
--- a/chrome/browser/media/router/media_router_feature.cc
|
||||
+++ b/chrome/browser/media/router/media_router_feature.cc
|
||||
@@ -60,26 +60,15 @@ BASE_FEATURE(kGlobalMediaControlsCastStartStop,
|
||||
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
-namespace {
|
||||
-const PrefService::Preference* GetMediaRouterPref(
|
||||
- content::BrowserContext* context) {
|
||||
- return user_prefs::UserPrefs::Get(context)->FindPreference(
|
||||
- ::prefs::kEnableMediaRouter);
|
||||
-}
|
||||
-
|
||||
-base::flat_map<content::BrowserContext*, bool>& GetStoredPrefValues() {
|
||||
- static base::NoDestructor<base::flat_map<content::BrowserContext*, bool>>
|
||||
- stored_pref_values;
|
||||
-
|
||||
- return *stored_pref_values;
|
||||
-}
|
||||
-} // namespace
|
||||
-
|
||||
-void ClearMediaRouterStoredPrefsForTesting() {
|
||||
+/*void ClearMediaRouterStoredPrefsForTesting() {
|
||||
GetStoredPrefValues().clear();
|
||||
-}
|
||||
+}*/
|
||||
|
||||
bool MediaRouterEnabled(content::BrowserContext* context) {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
if (!base::FeatureList::IsEnabled(kMediaRouter))
|
||||
return false;
|
||||
@@ -107,7 +96,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
|
||||
return allowed;
|
||||
}
|
||||
return true;
|
||||
-}
|
||||
+}*/
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
|
||||
@@ -120,7 +109,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
PrefRegistry::PUBLIC);
|
||||
|
||||
registry->RegisterBooleanPref(
|
||||
- media_router::prefs::kMediaRouterMediaRemotingEnabled, true);
|
||||
+ media_router::prefs::kMediaRouterMediaRemotingEnabled, false); // disabled in Bromite
|
||||
registry->RegisterListPref(
|
||||
media_router::prefs::kMediaRouterTabMirroringSources);
|
||||
|
||||
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
||||
--- a/chrome/browser/profiles/profile_impl.cc
|
||||
+++ b/chrome/browser/profiles/profile_impl.cc
|
||||
@@ -413,7 +413,7 @@ void ProfileImpl::RegisterProfilePrefs(
|
||||
#endif
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
|
||||
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,39 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Feb 2022 23:58:22 +0100
|
||||
Subject: Disable minidump upload scheduling
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
components/endpoint_fetcher/endpoint_fetcher.cc | 2 +-
|
||||
.../minidump_uploader/MinidumpUploadJobService.java | 5 ++++-
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/endpoint_fetcher/endpoint_fetcher.cc b/components/endpoint_fetcher/endpoint_fetcher.cc
|
||||
--- a/components/endpoint_fetcher/endpoint_fetcher.cc
|
||||
+++ b/components/endpoint_fetcher/endpoint_fetcher.cc
|
||||
@@ -340,7 +340,7 @@ void EndpointFetcher::OnResponseFetched(
|
||||
}
|
||||
} else {
|
||||
std::string net_error = net::ErrorToString(net_error_code);
|
||||
- VLOG(1) << __func__ << " with response error: " << net_error;
|
||||
+ LOG(ERROR) << __func__ << " with response error: " << net_error;
|
||||
response->response = "There was a response error";
|
||||
std::move(endpoint_fetcher_callback).Run(std::move(response));
|
||||
}
|
||||
diff --git a/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java b/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java
|
||||
--- a/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java
|
||||
+++ b/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java
|
||||
@@ -45,7 +45,10 @@ public abstract class MinidumpUploadJobService extends JobService {
|
||||
* to build an upload job for scheduling.
|
||||
*/
|
||||
public static void scheduleUpload(JobInfo.Builder jobInfoBuilder) {
|
||||
- Log.i(TAG, "Scheduling upload of all pending minidumps.");
|
||||
+ Log.i(TAG, "Scheduling upload of all pending minidumps is disabled.");
|
||||
+ if ((true)) {
|
||||
+ return;
|
||||
+ }
|
||||
JobScheduler scheduler =
|
||||
(JobScheduler) ContextUtils.getApplicationContext().getSystemService(
|
||||
Context.JOB_SCHEDULER_SERVICE);
|
||||
--
|
||||
2.25.1
|
||||
@@ -0,0 +1,25 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 30 May 2019 03:37:45 +0200
|
||||
Subject: Disable offline pages in CCT
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
components/offline_pages/core/offline_page_feature.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc
|
||||
--- a/components/offline_pages/core/offline_page_feature.cc
|
||||
+++ b/components/offline_pages/core/offline_page_feature.cc
|
||||
@@ -41,8 +41,8 @@ BASE_FEATURE(kOfflinePagesDescriptivePendingStatusFeature,
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kOfflinePagesInDownloadHomeOpenInCctFeature,
|
||||
- "OfflinePagesInDownloadHomeOpenInCct",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ "OfflinePagesInDownloadHomeOpenInCct", // disabled by default
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
|
||||
|
||||
BASE_FEATURE(kOfflineIndicatorFeature,
|
||||
"OfflineIndicator",
|
||||
--
|
||||
2.25.1
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user