Compare commits

...
Author SHA1 Message Date
Carmelo Messina b7acca2470 v109 2023-01-06 15:39:07 +01:00
Carmelo Messina 1d38ff41ec v108 2022-12-18 21:08:10 +01:00
Carmelo Messina 2316e737ad v107 2022-11-14 15:00:34 +01:00
Carmelo Messina 5a5169ec88 first version 2022-09-29 13:36:34 +02:00
csagan5 a9fa3ee3a7 Fix some typos in CHANGELOG 2022-09-28 22:24:33 +02:00
csagan5 992d7ba767 Release 105.0.5195.147 2022-09-28 22:22:16 +02:00
8dcef19700 Remove http referrals in cross origin navigation (#2343)
* Remove http referrals in cross origin navigation

* Update build/patches/Remove-http-referrals-in-cross-origin-navigation.patch

Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>

* Update patch description

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>
2022-09-28 01:28:03 +02:00
ebb00aec78 fixed injection with back-forward cache enabled (#2334)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-09-28 01:23:30 +02:00
csagan5 42b1cc902b Remove incorrect information about site-engagement flag 2022-09-27 23:42:12 +02:00
1910dad049 Partition blobs by top frame url (#2338)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-09-27 23:38:13 +02:00
87d3ef70eb Uses the first of the accept-languages as the system language for blink (#2311)
and fix the selection in the UI for the browser language

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-09-27 23:37:41 +02:00
csagan5 a38283a21a Release 105.0.5195.41 2022-09-18 09:25:07 +02:00
CarlandGitHub 0b195c831b Patches for v105 (#2308) 2022-09-17 18:11:36 +02:00
csagan5 236a41fbc4 Add mention of strict origin isolation and strict site isolation 2022-09-04 20:25:50 +02:00
csagan5 182c239e96 Remove unused patch 2022-08-14 08:26:08 +02:00
csagan5 c2366cad99 Release 104.0.5112.91 2022-08-14 08:25:05 +02:00
zhmarsandGitHub a2cf968b7d Update zh_CN translations (#2248) 2022-08-13 21:38:10 -07:00
a3605523e5 Add svg fingerprinting mitigation (#2215)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-08-13 21:37:51 -07:00
csagan5 7dcdc98732 Improve description for #disable-external-intent-requests flag 2022-08-14 04:17:13 +02:00
csagan5 adcc477c33 Add explanation for #site-engagement flag 2022-08-08 06:25:56 +02:00
csagan5 6df964528a Release 104.0.5112.63 2022-08-08 02:07:12 +02:00
CarlandGitHub dca45015a4 Patches for v104 (#2232) 2022-08-07 17:04:16 -07:00
csagan5 069095f200 Clarify distinction for bug reports/feature requests about the browser itself 2022-07-25 04:45:04 +02:00
csagan5 1a874980c9 Update patch description 2022-07-25 04:40:03 +02:00
csagan5 94fb357b3e Release 103.0.5060.140 2022-07-25 03:32:52 +02:00
csagan5 41ab84eba8 Add pull request template 2022-07-21 12:11:34 +02:00
CarlandGitHub ff8c9f219c Merge pull request #2172 from uazo/remove-navigator-connection
Remove navigator.connection info
2022-07-21 03:04:10 -07:00
CarlandGitHub 8d0f1903c7 Merge pull request #2207 from uazo/fix-timezone
Fix incorrect handling of blink::TimeZoneController::TimeZoneOverride
2022-07-21 03:00:14 -07:00
CarlandGitHub 69e7f5cc91 Merge pull request #2208 from uazo/fix-user-agent-customization
Fix the correct management of the custom ua.
2022-07-21 02:59:34 -07:00
csagan5 5971dfdcb0 Update wording for FAQ 2022-07-21 11:52:33 +02:00
Carmelo Messina 82625a734e fix the correct management of the custom ua.
also fix ua reduction management for desktop version (not managed by chromium)
2022-07-20 18:10:09 +02:00
Carmelo Messina 622da7ae82 fix incorrect handling of blink::TimeZoneController::TimeZoneOverride 2022-07-20 18:04:49 +02:00
csagan5 2b57217034 Release 103.0.5060.126 2022-07-17 20:44:26 +02:00
Carmelo Messina d65d4a3d6b Change the result of navigator.connection to default values and disable observers 2022-07-14 15:53:48 +02:00
CarlandGitHub ddb789ed0d Merge pull request #2171 from uazo/fix-clangd-build
Add kill switch for no-unqualified-std-cast-call build option
2022-07-13 22:40:20 +02:00
CarlandGitHub a8f50230a0 Merge pull request #2173 from uazo/partition-blink-memory-cache
Partitioning Blink memory cache
2022-07-13 22:35:18 +02:00
CarlandGitHub 5d7913cf42 Merge pull request #2191 from uazo/some-changes-on-v103
Some changes on v103
2022-07-13 22:33:57 +02:00
CarlandGitHub ae91ca61c9 Merge pull request #2192 from uazo/fix-signin-and-sync-integrations-v103
Fix open password setting and recents tab crash
2022-07-13 22:27:18 +02:00
CarlandGitHub 3b19df2828 Merge pull request #2193 from uazo/fix-2179
Fix sticky desktop mode
2022-07-13 22:25:13 +02:00
Carmelo Messina 650d6bfcb6 fix sticky desktop mode 2022-07-13 17:10:15 +02:00
Carmelo Messina 996fff2c7a fix open password setting and recents tab crash 2022-07-13 17:06:28 +02:00
Carmelo Messina 216f4ce5c0 use space as separator 2022-07-13 17:04:07 +02:00
Carmelo Messina 506d1a51b8 rename to skip_clangd_unsupported_options 2022-07-13 13:46:04 +02:00
Carmelo Messina 9a8759023c merge with master 2022-07-13 13:44:46 +02:00
Carmelo Messina 57ea2280a0 some changes on v103 2022-07-13 13:30:40 +02:00
csagan5 67edc4337f Updated CHANGELOG with correct issue URL 2022-07-12 08:46:20 +02:00
csagan5 994c9dbd98 Release 103.0.5060.121 2022-07-12 08:27:37 +02:00
CarlandGitHub 505b939073 Merge pull request #2157 from bromite/next/v103
Patches for v103
2022-07-12 00:53:26 +02:00
csagan5 99ed991ace Merge branch 'master' into next/v103 2022-07-12 00:44:47 +02:00
csagan5 c7a6d5e006 Fixes from debug build and uazo 2022-07-12 00:14:07 +02:00
Carmelo MessinaandCarl 1576384e02 Remove preload of com.google.android.gms.fonts 2022-07-10 23:13:00 +02:00
Carmelo MessinaandCarl f77ac33155 Remove window name on cross origin navigation 2022-07-10 23:04:09 +02:00
csagan5 8439ece721 Fix SystemWebView building issue and signin crash 2022-07-08 23:13:21 +02:00
csagan5 b60242dde9 Fix other build/link issues 2022-07-07 21:54:47 +02:00
Carmelo Messina 10247f9b65 Partitioning Blink memory cache 2022-07-06 13:54:58 +02:00
Carmelo Messina 32258dc105 Remove navigator.connection info 2022-07-06 13:46:03 +02:00
Carmelo Messina 0162eb0566 Add kill switch for no-unqualified-std-cast-call 2022-07-06 13:35:31 +02:00
csagan5 796a3b0acf Include new patch for dark mode 2022-07-05 23:59:00 +02:00
krlvmandcsagan5 b590fcae83 Patch for allowing to match only system dark mode 2022-07-05 23:59:00 +02:00
csagan5 b21c08de2f Fixed linking issues 2022-07-05 23:59:00 +02:00
krlvmandCarl ad1a13d393 Patch for allowing to match only system dark mode 2022-07-05 01:21:53 +02:00
csagan5 76277b4c08 Remove more signin integrations 2022-06-27 23:31:53 +02:00
csagan5 90e29193cb Remove more signin-related integrations 2022-06-26 23:55:28 +02:00
csagan5 06259daa58 More fixes related to password manager 2022-06-26 19:11:08 +02:00
csagan5 b7d091858e More fixes for linking and removed files 2022-06-26 11:43:20 +02:00
csagan5 a880d8cf53 Patches for v103 2022-06-25 22:03:04 +02:00
csagan5 f5a6e77bb1 Release 102.0.5005.96 2022-06-11 09:02:03 +02:00
c34f5ec6c7 Fix call to StartExpiringOldStuff (#2120)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-06-08 20:07:35 +02:00
23fde85228 fix category setting activation (#2119)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-06-08 20:05:40 +02:00
csagan5 8c127918e2 Release 102.0.5005.92 2022-06-05 11:25:52 +02:00
Zelda189andGitHub 57fc5159d1 Remove duplicate offline-indicator-v2 flag (#2092)
Sort flags by name
2022-06-04 17:21:00 +02:00
csagan5 cd52789b01 Release 102.0.5005.67 2022-05-28 12:24:04 +02:00
csagan5 6c2d2ee368 Patches for v102 2022-05-28 12:06:53 +02:00
Bruno PaganiandCarl 3d471a28a1 Fix incognito screenshots flag name
It was apparently renamed at some point but not reflected here.
2022-05-27 11:26:53 +02:00
csagan5 88072763d3 Release 101.0.4951.69 2022-05-15 12:05:41 +02:00
uazoandCarl 13f981d893 Update build/patches/Add-webrtc-site-setting.patch
Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>
2022-05-14 21:44:00 +02:00
Carmelo MessinaandCarl ceed58fb61 Add webRTC site settings 2022-05-14 21:44:00 +02:00
csagan5 7ce7f94c36 Do not specify 'latest' 2022-05-14 11:31:24 +02:00
Carmelo MessinaandCarl e37ccd0330 fix odd behaviour with search or site suggestions 2022-05-13 21:24:26 +02:00
csagan5 922192904e Add Android 12L to version list 2022-05-13 21:03:40 +02:00
Carmelo MessinaandCarl 63e834c092 Add a flag to site engagement feature 2022-05-05 09:28:07 +02:00
Carmelo MessinaandCarl b7fee7d282 Add webgl site setting 2022-05-05 09:22:28 +02:00
csagan5 ce7cf99887 Add missing CHANGELOG entries 2022-05-03 01:10:18 +02:00
csagan5 1533105a64 Release 101.0.4951.53 2022-05-03 01:05:15 +02:00
csagan5 540f6c5418 Fix merge typo in privacy patch 2022-05-02 22:18:28 +02:00
csagan5 01b1d9144a Updated patches for v101
Add welcome screen patch
2022-05-02 21:55:55 +02:00
Carmelo MessinaandCarl f1a942e3ad multiple fixes 2022-05-02 21:27:49 +02:00
Carmelo MessinaandCarl abb05cb97c reverse the order of appmenu 2022-05-02 21:13:52 +02:00
b7bad88837 Fix Move-navigation-bar-to-bottom.patch (#2029)
* fix 1995 and 2011

* fixgit apply

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-04-29 15:39:18 +02:00
csagan5 685c40dbda Release 101.0.4951.39 2022-04-29 00:34:12 +02:00
CarlandGitHub 432f4a0cd7 Patches for v101 (#2010) 2022-04-29 00:31:49 +02:00
csagan5 39bf208aa1 Quote grep expression 2022-04-24 18:43:52 +02:00
csagan5 22241eabc8 Document home page as NTP 2022-04-24 18:30:09 +02:00
csagan5 0c1d649f30 Fix some incorrect entries in CHANGELOG 2022-04-20 23:17:52 +02:00
csagan5 cc92a9aed0 Re-add bugfix for site engagement
PR #1964 was inadvertently rolled back with release 100.0.4896.83
2022-04-20 23:16:09 +02:00
csagan5 47d47a75f4 Add better description for patch 2022-04-20 23:15:10 +02:00
csagan5 87c19d0bf9 Document new flag move-top-toolbar-to-bottom 2022-04-18 23:35:43 +02:00
csagan5 03da31a022 Release 100.0.4896.135 2022-04-18 23:34:15 +02:00
csagan5 5e4cd6c4ee Add temptative patch for mremap removal 2022-04-16 16:59:48 +02:00
csagan5 727bc7517c Add another pattern for logcat filter 2022-04-16 16:39:28 +02:00
2b0f9b0929 Move toolbar to bottom: fix tabstrip in tablet mode and NewTabPage (#1985)
* fix newtabpage and tabstrip in tablet mode

* rename to Move-navigation-bar-to-bottom.patch

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-04-16 16:29:52 +02:00
csagan5 6639691985 Remove unused patches from list 2022-04-16 10:18:17 +02:00
csagan5 48a205e99b Remove patches not yet tailored for Android 2022-04-16 10:12:07 +02:00
csagan5 7f49ed9fa4 Remove patch not yet used 2022-04-15 16:44:20 +02:00
csagan5 878ef04e92 Release 100.0.4896.92 2022-04-15 16:41:31 +02:00
uazoandGitHub e8b1446c03 Move top toolbar to bottom (#1975) 2022-04-14 19:45:50 +02:00
uazoandGitHub 69f3cc0d41 Disable TLS Resumption (#1973)
* Disable TLS Resumption

* improved the log
2022-04-14 19:38:48 +02:00
csagan5 7ce235d1c5 Add new patches, improve wording 2022-04-13 17:45:39 +02:00
uazoandGitHub 4111a62f3d Partition DNS requests by top-frame NIK (#1974) 2022-04-13 17:08:41 +02:00
uazoandGitHub 2de7773a24 Userscripts: fix some minor issues (#1957) 2022-04-13 15:57:28 +02:00
csagan5 2d2623f6dd Add some missing entries from CHANGELOG
Update autofill patch authorship information
2022-04-11 23:42:10 +02:00
csagan5 f819874002 Release 100.0.4896.83 2022-04-11 23:29:29 +02:00
csagan5 59b049f461 Minor logging improvements for bookmarks import/export patch 2022-04-11 20:02:57 +02:00
90486fde89 don't save WebsiteSettings if it's not a ContentSetting (#1964)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-04-11 19:46:32 +02:00
csagan5 b4095e087a Updated OpenSearch patch to include fix for upstream bug
Fixes upstream issue with recently-added search engines not showing up
2022-04-11 16:31:51 +02:00
csagan5 52717de04d Updated DoH patch with latest improvements/bugfixes
Includes a fix for upstream system DNS config issue
See also: https://github.com/bromite/bromite/issues/1960
2022-04-11 16:29:30 +02:00
csagan5 1bcb6ca125 Update webRTC FAQ 2022-04-11 16:16:13 +02:00
csagan5 7847515fff Improve suggested grep for logcat 2022-04-11 16:15:54 +02:00
csagan5 8520a538a7 Update webRTC patch 2022-04-11 16:15:14 +02:00
4f10d11318 Add lifetime options support for permissions (#1958)
* Add lifetime options support for permissions

* Update build/patches/Add-lifetime-options-permissions.patch

* add csagan5 suggestion

* Add description from pr

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-04-08 18:04:11 +02:00
csagan5 f6a6bca87b Mention certificate-transparency-enabled flag 2022-04-07 21:42:02 +02:00
zhmarsandGitHub e3930c39c2 Update zh_CN translations (#1940) 2022-04-07 21:23:55 +02:00
c76b9c6567 fix the lack of use of the useragent passed by the user (#1943)
with reduced user agent flag active

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-04-07 21:18:02 +02:00
csagan5 e40a7f8a61 Update some undocumented features 2022-03-29 23:48:47 +02:00
csagan5 692764d073 Release 100.0.4896.57 2022-03-29 23:35:25 +02:00
CarlandGitHub 73886eac62 Patches for v100 (#1930)
* Patches for v100

* Remove unused patches
2022-03-29 15:58:56 +02:00
csagan5 7b8130f61e Add FAQ about ads not blocked 2022-03-29 15:54:08 +02:00
csagan5 3ac3be9b5e Add URL to SearchEngines wiki page 2022-03-29 15:45:43 +02:00
CarlandGitHub 48a2d6c5f4 Merge pull request #1929 from zhmars/translation
Update zh_CN translations
2022-03-28 17:44:06 +02:00
mars 5c0e3ffed7 Update zh_CN translations 2022-03-27 15:39:16 +08:00
CarlandGitHub 8066120fa3 Merge pull request #1925 from nikolowry/master
Fix for contextual search manager removal patch
2022-03-26 16:20:26 +01:00
Niko Lowry fc6eeab58b Fix for removing contextual search manager patch 2022-03-24 16:26:25 -04:00
csagan5 47d0d4f9f8 Release 99.0.4844.77 2022-03-19 11:52:52 +01:00
csagan5 c91167ff8d Release 99.0.4844.58 2022-03-12 17:35:06 +01:00
CarlandGitHub d6621afae1 Merge pull request #1878 from zhmars/translation
Update zh_CN translations
2022-03-11 15:41:08 +01:00
mars c02e6e6cdf Update zh_CN translations 2022-03-11 22:09:45 +08:00
CarlandGitHub 0a7d6c8799 Merge pull request #1877 from zhmars/translation
Update zh_CN translations
2022-03-11 13:16:28 +01:00
mars a5c0da6fda Update zh_CN translations 2022-03-11 16:46:56 +08:00
6fb06e9614 Add Disable-ua-full-version.patch (#1869)
* Add Disable-ua-full-version.patch

* add csagan5 suggestions

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-03-10 15:46:15 +01:00
CarlandGitHub 33135920da Merge pull request #1872 from uazo/fix-1870
Add an option that allows changing the number of days to keep navigation history
2022-03-10 15:12:05 +01:00
Carmelo Messina 86ea470189 Add an option that allows changing the number of days to keep navigation history 2022-03-10 14:15:30 +01:00
csagan5 b4fe978836 Add another missing issue from CHANGELOG 2022-03-08 14:25:37 +01:00
csagan5 85e9e55ddc Add missing issues in CHANGELOG 2022-03-08 14:22:07 +01:00
csagan5 870e6277c0 Fix bug with vulnerable version update showing incorrectly 2022-03-08 10:51:11 +01:00
csagan5 117e80daff Update README with new features 2022-03-07 23:49:59 +01:00
csagan5 f645da9e44 Release 99.0.4844.55 2022-03-07 23:42:23 +01:00
CarlandGitHub 7e0c8e2ef3 Patches for v99 (#1858)
* Add fix for NTP

* Fixes after uazo's review

* Disable safety checks

* Add new patches, other build fixes
2022-03-07 23:35:29 +01:00
csagan5 3a7e27df6a Experimental user scripts for v99
Patch from uazo
2022-03-06 17:28:45 +01:00
Carmelo MessinaandCarl e9cfbf1749 change comment 2022-03-06 17:18:28 +01:00
Carmelo MessinaandCarl 3373b44270 multiple fixes to user script patch
added support for unicode scripts
fix handling of multiple scripts with more detailed log
not allowed access to native pages
2022-03-06 17:18:28 +01:00
Carmelo MessinaandCarl 86225ca1ed fix log style in AlwaysIncognitoLinkInterceptor
added new method IsAlwaysIncognitoEnabled in AutocompleteProviderClient to activate the minimum necessary
2022-03-06 10:53:00 +01:00
Carmelo MessinaandCarl fa0b570677 Added preference in native 2022-03-06 10:53:00 +01:00
uazoandCarl 4f01288ceb Update commit description 2022-03-03 12:00:18 +01:00
Carmelo MessinaandCarl d86e096dc0 Implement jit toggle patch 2022-03-03 12:00:18 +01:00
Carmelo MessinaandCarl 7e2ee59147 minor changes to v98 patches
no functionality changed
2022-03-03 11:49:11 +01:00
csagan5 72547ac4c3 Release 98.0.4758.116 2022-03-02 11:00:40 +01:00
Carmelo MessinaandCarl 6005259c20 complete disabling of client hints 2022-02-26 16:18:02 +01:00
Carmelo MessinaandCarl b9ec284ba4 fix another way to activate origin trials 2022-02-26 16:07:14 +01:00
14250fa45e fix Block gateway attacks via websockets (#1828)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2022-02-25 19:16:24 +01:00
csagan5 35e9170312 Release 98.0.4758.108 2022-02-21 23:52:26 +01:00
CarlandGitHub bd83693292 Patches for v98 (#1806) 2022-02-21 23:50:51 +01:00
JustAnUserLolandGitHub b1c8a498fe Fix an URL in FAQs (#1815)
Fix mention of Protected Content menu
2022-02-20 21:03:17 +01:00
csagan5 ca40180ce9 Remove unused patch 2022-02-17 21:26:17 +01:00
csagan5 1243c3a8a3 Release 97.0.4692.106 2022-02-17 19:19:38 +01:00
CarlandGitHub 68e2652402 Patches for v97 (#1795)
Patches for v97

Add uazo's patch to build with use_sysroot=false
Start using new SystemWebView package name
Cleanup metrics patches and add a few more patches from Vanadium
Enable use_cfi_cast
2022-02-17 19:16:35 +01:00
csagan5 a4f6c4cf7b Updated automated domain substitution patch 2022-02-13 21:11:53 +01:00
csagan5 2450c334cf Rename GN_ARGS -> bromite.gn_args 2022-02-13 21:11:53 +01:00
csagan5 b2741b8d4e Add missing architectures
Fix header for SystemWebView question
2022-02-13 16:37:48 +01:00
CarlandGitHub 6696caee49 Merge pull request #1758 from TacoTheDank/yml
Migrate to using GitHub issue forms
2022-02-13 14:45:51 +01:00
CarlandGitHub 4af2a2e018 Merge branch 'master' into yml 2022-02-13 14:44:35 +01:00
csagan5 1dc2fe7cf7 Adjust issue forms 2022-02-13 14:42:23 +01:00
TacoTheDankandcsagan5 7c906e6a15 Migrate to using GitHub issue forms 2022-02-13 13:48:03 +01:00
csagan5 bab0abb2bf Minor patch updates for v97 2022-02-13 13:47:38 +01:00
TacoTheDank 6d614aee45 Migrate to using GitHub issue forms 2022-02-06 01:00:18 -05:00
csagan5 b96c17030f Add FAQ about default search engine 2022-02-05 18:03:23 +01:00
csagan5 3b901cf774 Remove [PATCH] from patches 2022-02-05 18:00:21 +01:00
BayLee4andCarl c46d636377 Resolve issue #1749 : build with '-ftrivial-auto-var-init=zero' 2022-02-05 17:48:28 +01:00
csagan5 0b2a41b2af Release 96.0.4664.183 2022-02-05 17:27:33 +01:00
zhmarsandGitHub 260fea5b66 Update zh_CN translations (#1696)
* Update zh_CN translations

* Update zh_CN translations
2022-02-05 00:04:06 +01:00
csagan5 a5e7515a34 Updated CHANGELOG 2022-02-04 22:11:55 +01:00
csagan5 2c4fff8752 Release 96.0.4664.104 2022-02-04 22:09:00 +01:00
csagan5 83af2e261d Add more explicit comments about what 'or' means and information to fill in on other fields 2022-01-08 19:04:21 +01:00
csagan5 c3ecb0d482 Update donation address 2022-01-07 01:41:45 +01:00
csagan5 685105abc9 Updated minimum SDK required version 2021-12-05 16:50:12 +01:00
csagan5 5b6a7442e0 Release 96.0.4664.54 2021-12-04 15:29:26 +01:00
csagan5 4774aeba9f Added missing improvements for v96 2021-12-03 12:36:58 +01:00
csagan5 288479a5e1 Minor fixes to build v96 2021-12-03 10:24:44 +01:00
csagan5 8b9c14c8b7 Add missing patches 2021-12-03 01:23:23 +01:00
csagan5 820e23fb3d Updated patches for v96
Minus timezone customization and user scripts patches
2021-12-03 00:26:46 +01:00
510a513535 Update Add-option-to-use-home-page-as-NTP.patch for v95 (#1586)
* update patch for v95

* ntp_set_about_blank_button removed

Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-12-02 12:25:57 +01:00
csagan5 3444be04d8 Re-introduce patch to add option to use home page as NTP 2021-12-02 12:25:57 +01:00
e14d909347 Fix crash on tablet (#1617)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-12-02 12:16:33 +01:00
Apparatus_ZeroandGitHub cabdae7c37 Add hyperlinks to version and license shields (#1628) 2021-12-02 12:14:22 +01:00
bd6faa1227 Ask user before close all tabs (#1605)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-12-02 12:10:42 +01:00
csagan5 785af3a5b2 Release 95.0.4638.79 2021-11-17 18:45:34 +01:00
7700be360a Permanently Disable Floc (#1582)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-11-16 09:56:44 +01:00
uazoandGitHub fb59381932 permanently removed all relative code to ENABLE_REPORTING buid flag (#1556)
* permanently removed all relative code

* removed unused constants

* use of the error directive
2021-11-15 17:45:51 +01:00
jylitalbitandGitHub ffc4e30278 Ignore StrictMode warning (#1567)
Currently the SystemWebView fails a CTS test case, specifically
testStrictMode from WebViewHostSideStartupTest, due to StrictMode
warnings. So ignore the StrictMode warning as is done elsewhere.
2021-11-15 17:43:59 +01:00
8a4476d697 Disable privacy sandbox (#1581)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-11-15 17:35:04 +01:00
1bf35985be Disable conversion measurement api (#1583)
Co-authored-by: Carmelo Messina <uazo@users.noreply.github.com>
2021-11-15 17:32:19 +01:00
csagan5 43dbb5e70b Consolidate some patches, updates 2021-11-15 09:39:39 +01:00
csagan5 f7b74aa489 Updated issue template to mention chrome://crashes UI 2021-11-14 22:57:00 +01:00
uazoandGitHub 33d0efa1fa permanently disabled the fetch of field trials (#1558)
* permanently disabled the fetch of field trials

* fix comment
2021-11-14 22:47:32 +01:00
uazoandGitHub 64b257fbeb fix overlap in patch editing (#1555) 2021-11-14 22:45:07 +01:00
uazoandGitHub 016ba130b2 removed ForceEnableOriginTrials related code (#1557) 2021-11-14 22:43:33 +01:00
uazoandGitHub bd10a43371 Disable Accessibility service by default (#1559)
* Disable Accessibility service by default

* fix not correct author

* fix, incorrect check, default false means inactive
2021-11-14 22:40:58 +01:00
csagan5 a426d7f98b Add missing issue in CHANGELOG 2021-11-07 11:36:00 +01:00
csagan5 19bcbb3055 Release 95.0.4638.78 2021-11-07 11:34:05 +01:00
csagan5 ee5a65e4c1 Updated patch for third-party origin trials as suggested by @uazo
New patch to never use HTTP probes
2021-11-06 10:04:12 +01:00
csagan5 aaa6072b7a Add missing changes from third-party origin trials patch 2021-11-05 17:28:58 +01:00
2fe296b6b9 Patches for v95 (#1532)
* fix build

* only lines changes

* remove patch not referenced in patch list

* fix crash when open an offline page without any opened tabs

* Remove duplicate patch for pull-to-refresh

* Latest PRs and disable third-party origin trials

Co-authored-by: uazo <29201891+uazo@users.noreply.github.com>
2021-11-05 08:25:06 +01:00
uazoandGitHub 5b51895953 removed flags exclusivity constraint (#1514) 2021-11-04 09:32:53 +01:00
uazoandGitHub 6b613c2171 Keep empty tabs between sessions (#1515) 2021-11-04 09:20:19 +01:00
csagan5 08f9970bcb Fix wrong URL in CHANGELOG 2021-10-27 20:20:32 +02:00
csagan5 fb5839d5eb Release 94.0.4606.109 2021-10-26 22:55:06 +02:00
uazoandGitHub 3129f5e2c2 fix potential crash on android M (#1512) 2021-10-24 23:06:27 +02:00
csagan5 76add6b7dc Update FAQs and README about autofill and automatic updates 2021-10-24 21:03:56 +02:00
uazoandGitHub 5a4f720d39 enable android autofill with a flag default true (#1511)
* enable android autofill with a flag default true

* removed change of prefs::kAutofillProfileEnabled
2021-10-24 20:53:57 +02:00
uazoandGitHub 01d2217a21 Experimental user scripts support (#857)
* version 0.5

* fix whitespace errors and rebase with 87.0.4280.106

* fix bug [FATAL:utf_string_conversions.cc(338)] Check failed: IsStringASCII(utf16). Tampermonkey • Userscript Sources

* add details for unmatch header, bug DOCUMENT_START not work, add a flag for logging

* deny network access to injected scripts

* removed log + fix ui + upstream update (@9f2aac4)

* update patch for v88

* force char as unsigned in invalidChar

* adapt to v89, add view script source, replace checkbox in preferences, removed extension work, add support to non-standard @url declaration, use saf directly

* updates for v90

* update for v91

* remove flag and keep only toggle
tell that the script has failed with errors
remove copy to temporary file
remove approach with XML overlays so that there are no exceptions thrown while inflating

* change install message + add homepage support + make url clickable

* adaptation for v92

* v93 ready

* add prompt also after selecting file by ui, remove prefs addon patch, add commit message

* add README.md
2021-10-23 12:53:42 +02:00
csagan5 90baa52b27 Add missing issue fixed in CHANGELOG 2021-10-21 00:03:46 +02:00
csagan5 5a25a4d9ea Release 94.0.4606.102 2021-10-20 23:58:39 +02:00
uazoandGitHub 3787e8e9af add snackbar in settings activity (#1492)
* add snackbar in settings activity to inform the user of the reboot required when change the flag

* removed BrowserRestartActivity in favor of ApplicationLifetime
2021-10-20 21:59:24 +02:00
uazoandGitHub a5e03a6664 Add custom tab intents privacy option and force open external links in incognito flag. (#1489)
Add-custom-tab-intents-privacy-option.patch and Force-open-external-links-in-incognito.patch have been unified
2021-10-20 21:56:34 +02:00
csagan5 ba293ac0dc Updated patches for v94 2021-10-20 01:34:25 +02:00
uazoandGitHub e6c854cc9c Add recents, offlinepage and send to home screen for always incognito (#1427)
* Add recents, offlinepage and send to home screen for always incognito

* Add patch description
2021-10-20 01:25:37 +02:00
csagan5 54ee34f629 Mention missing features, mention new auto updates mechanism
Fix a mistake in release notes for v91
2021-10-17 10:58:45 +02:00
csagan5 77822a7efb Release 94.0.4606.94 2021-10-16 22:28:37 +02:00
uazoandGitHub ad34a777bb Enable update notification (#1454)
* Enable update notification

* version check rather than build time

* fixup with Disable-Omaha-update-checks.patch

* taking the last-modified together with the redirect.

the check between build times in any case is currently commented (see isNewVersionAvailableByBuildTime)

* removed code related to build time check

* removed PREF_LATEST_MODIFIED_BUILDTIME
2021-10-16 09:27:49 +02:00
uazoandGitHub ed23baeb48 Add site setting for images (#1447) 2021-10-15 20:55:44 +02:00
csagan5 3884e3d733 Release 93.0.4577.110 2021-10-10 11:03:59 +02:00
Carmelo Messinaandcsagan5 9b61de8734 Enable share intent patch 2021-10-09 10:12:21 +02:00
csagan5 cb9ff4ac99 Document Alt+D shortcut 2021-10-08 19:40:55 +02:00
csagan5 6e457009b4 Updated recent patches 2021-10-08 01:17:15 +02:00
Carmelo MessinaandCarl ce42e0c0ea fix build 2021-10-08 01:07:50 +02:00
Carmelo MessinaandCarl 229aa9a115 add Force-open-external-links-in-incognito.patch 2021-10-08 00:37:29 +02:00
Niko LowryandCarl 07d13a350b Set enable_reporting to false
Added `ungoogled-chromium-Fix-building-without-enabling-reporting.patch`
to fix build issues. See the following PR for more details:
https://github.com/Eloston/ungoogled-chromium/pull/1416
2021-09-26 23:50:19 +02:00
csagan5 858e85b59b Release 93.0.4577.83 2021-09-25 16:23:57 +02:00
csagan5 72e4a6e1eb Release 92.0.4515.176 2021-09-12 11:38:03 +02:00
csagan5 63d816332b Release 92.0.4515.134 2021-08-05 12:04:51 +02:00
csagan5 b9a07b2cea Release 92.0.4515.125 2021-07-27 07:45:58 +02:00
uazoandGitHub 3a5f052e8c reactivation of subresource filter (#1302) 2021-07-25 16:57:44 +02:00
csagan5 2251acbca8 Release 92.0.4515.103 2021-07-23 12:50:01 +02:00
zhmarsandGitHub e5771ef891 Update zh_CN translations (#1282) 2021-07-20 17:42:41 +02:00
csagan5 71ec2c54b0 Release 91.0.4472.158 2021-07-10 12:38:36 +02:00
csagan5 46701c75ed Minor patches fix 2021-06-29 08:42:31 +02:00
csagan5 df446ba6f7 Release 91.0.4472.146 2021-06-29 08:23:34 +02:00
uazoandGitHub 5efb5dd7d4 fix garbled ui by clearing float style (#1236) 2021-06-27 12:28:59 +02:00
csagan5 e093c89001 Release 91.0.4472.143 2021-06-25 11:04:55 +02:00
2a91a60d3e Enable crash reporting ui, allow save report to primary download folder (#1105)
* make sure that only the user wants to save

* Fix DCHECK failed + make a zip file

* fix author

* use standard download ui, tested with A9,A10,A11

* add request new log + clear all files

* reactivated immediate deletion of original files after zipping them + review tips

* Specify "n/a" as file size

* Reword button text as "Generate now"

* Change patch file name

* Change patch subject

* version for v91

* fix garbled UI

Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>
2021-06-21 20:07:09 +02:00
csagan5 c5c35b06a4 Release 91.0.4472.102 2021-06-10 22:55:24 +02:00
csagan5 413c2c7645 Fix patch mistakes for always incognito new tabs and external intent requests flag 2021-06-09 21:49:50 +02:00
csagan5 4997dcab23 Mention flag to disable external intent requets 2021-06-06 08:03:03 +02:00
csagan5 40c93af283 Release 91.0.4472.97 2021-06-06 07:53:35 +02:00
uazoandGitHub 07102294d0 added export of tabs collection (#1177) 2021-05-27 19:22:27 +02:00
csagan5 73df91cb28 Simplify issue template crash section 2021-05-26 20:20:16 +02:00
uazoandGitHub e3414b5d6b fix saving tabs bookmarks folder (#1166) 2021-05-25 20:58:03 +02:00
uazoandGitHub a1e07fa54b Allow open new tabs and save as link in always incognito mode (#1165) 2021-05-24 12:06:11 +02:00
csagan5 1953e3d415 Release 91.0.4472.50 2021-05-19 19:52:13 +02:00
csagan5 bb68ef38b1 Updated draft for v91 patches 2021-05-15 13:48:28 +02:00
csagan5 b4ca5cb0bd Update bookmarks import/export patch 2021-05-13 19:56:19 +02:00
csagan5 674ab0adbd Draft for v91 patches 2021-05-13 10:44:15 +02:00
CarlandGitHub 5745c4f970 Mention feeds being disabled 2021-05-10 22:35:55 +02:00
csagan5 ded81bf625 Release 90.0.4430.204 2021-05-04 20:55:02 +02:00
uazoandGitHub b2075a3562 revert last changes + remove record incognito launch reason histogram (#1125) 2021-05-02 10:53:01 +02:00
csagan5 d9876e2da3 Release 90.0.4430.101 2021-04-30 08:44:11 +02:00
csagan5 38eeb63d4b Mention new flags in README.md 2021-04-27 18:21:10 +02:00
csagan5 a0ad5d29e8 Release 90.0.4430.92 2021-04-27 00:20:51 +02:00
ad010db02d Add flag IsCleartextPermitted default true (#1111)
Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>
2021-04-26 21:41:23 +02:00
uazoandGitHub b3f5b62956 New flag "allow-user-certificates" (#1110)
* Add a flag AllowUserCertificates default false

* add to bromite patches list
2021-04-26 21:37:39 +02:00
uazoandGitHub ce1a039537 explicit denial to fetch (#1106) 2021-04-26 14:24:51 +02:00
csagan5 54302084f1 Release 90.0.4430.92 2021-04-26 10:11:43 +02:00
uazoandGitHub e3e5a45562 fix update ui for pac url config (#1098) 2021-04-24 00:39:30 +02:00
CarlandGitHub 1e87d1b0df Mention what to do for bugs unrelated to Chromium 2021-04-15 23:32:23 +02:00
oldphones68andGitHub 4af239c785 README.md (#1076)
Since, `export-bookmarks-use-saf`, is disabled by default, I edited the `New Flags` section of README.
2021-04-15 23:27:05 +02:00
CarlandGitHub a89f8a3150 Add question for incognito tabs 2021-04-15 00:51:32 +02:00
csagan5 0ef43d4eae Release 90.0.4430.74 2021-04-15 00:49:15 +02:00
CarlandGitHub e3b4bf00c9 Merge pull request #1064 from uazo/fix-1051
always-incognito mode: remove unnecessary code for v90
2021-04-14 23:20:53 +02:00
Carmelo Messina 45ddc3909b remove unnecessary code for v90 2021-04-14 10:58:25 +02:00
CarlandGitHub b2975f635a Merge pull request #1054 from uazo/fix-1049
User agent customization: patch update for v90
2021-04-10 09:00:01 +02:00
Carmelo Messina 1aef9679ae updated patch for v90 2021-04-09 22:14:23 +02:00
Carmelo Messina b5a8dc1ebf actual patch v89 2021-04-09 22:13:14 +02:00
csagan5 aaac339b89 Release 90.0.4430.59 2021-04-07 14:05:56 +02:00
csagan5 f4cd704284 v90 patches update 2021-04-05 13:40:42 +02:00
csagan5 feb98f1fb1 Draft for v90 patches 2021-04-04 18:49:59 +02:00
csagan5 4e0e82b3c1 Release 89.0.4389.117 2021-04-02 06:39:28 +02:00
CarlandGitHub 20551a44a3 Minor improvements 2021-03-28 13:44:41 +02:00
CarlandGitHub e751833928 Add some yes/no answers to issue template for bugs 2021-03-22 20:13:07 +01:00
csagan5 c332245d48 Document missing features in README.md 2021-03-21 14:45:22 +01:00
csagan5 777304be3f Release 89.0.4389.100 2021-03-21 14:17:13 +01:00
CarlandGitHub fbecba6643 Mention anti-fingerprinting mitigation flags 2021-03-19 14:00:54 +01:00
CarlandGitHub 6f38083e18 Add section for reporting flags 2021-03-17 08:40:18 +01:00
csagan5 02334e85ab Fix downloads image URL 2021-03-13 21:31:22 +01:00
csagan5 aa0b4b6b59 Release 89.0.4389.92 2021-03-13 18:59:15 +01:00
csagan5 33124cc5d6 Add note about steps to reproduce 2021-03-13 18:56:27 +01:00
CarlandGitHub 167f96019a Merge pull request #999 from uazo/fix-963
fix menu items display with 6 columns + fix disappear after exiting
2021-03-12 22:08:27 +01:00
csagan5 bfdcef797e Mention enable_reporting=true change in v83 2021-03-12 05:43:47 +01:00
CarlandGitHub c6b6838e1e Merge pull request #1000 from zhmars/translation
Update zh_CN translations
2021-03-12 05:43:06 +01:00
mars bdbc25e3ca Update zh_CN translations 2021-03-11 14:08:44 +08:00
Carmelo Messina 6c53bb33b5 fix menu items display with 6 columns + fix disappear after exiting (https://github.com/bromite/bromite/issues/570#issuecomment-782585897) 2021-03-10 17:53:06 +01:00
csagan5 a55c7672af Release 89.0.4389.78 2021-03-09 00:42:09 +01:00
csagan5 6c2412b39d Add question about ad blocker 2021-03-08 22:03:00 +01:00
csagan5 ff09829f7d Updated patches for v89 2021-03-08 09:02:01 +01:00
csagan5 fb90e00324 Patches for next release (v89) 2021-03-07 11:42:42 +01:00
CarlandGitHub 9e1fa7d614 Merge pull request #964 from zhmars/i18n
Update zh_CN translations
2021-03-02 19:51:15 +01:00
mars 262fde89ce Update zh_CN translations 2021-03-02 17:46:43 +08:00
csagan5 302fc11efa Release 88.0.4324.207 2021-03-01 21:38:01 +01:00
csagan5 973ede4ad1 Patches for next release 88.0.4324.207 2021-02-28 20:10:46 +01:00
CarlandGitHub e64e4be007 Merge pull request #945 from uazo/fix-941
fix  wrong last datetime update when opening settings + better check
2021-02-25 21:44:19 +01:00
Carmelo Messina ca839f9480 fix wrong last datetime update when opening settings + better check for first install 2021-02-22 15:09:41 +01:00
csagan5 d70bd10285 Release 88.0.4324.187 2021-02-20 09:24:45 +01:00
CarlandGitHub 9fcce580ab Merge pull request #905 from uazo/fix-811
Ability to see when adblock filters were last updated; button to manually update adblock filters
2021-02-17 20:37:33 +01:00
CarlandGitHub 21e0153b28 Change wording for user-disabled updates log message 2021-02-17 20:36:44 +01:00
CarlandGitHub cb7f579590 Mention removal of dropped patch for user-installed certificates 2021-02-16 22:47:05 +01:00
csagan5 cef459eab9 Release 88.0.4324.185 2021-02-16 22:44:19 +01:00
Carmelo Messina 80c163754a fix strings + UPDATE_IN_PROGRESS message + possibility to disable update + fix crash 2021-02-15 19:38:56 +01:00
Carmelo Messina 51b8c9b04f avoid using ForTesting methods + rename ReStart in StartWithDelay 2021-02-13 18:02:39 +01:00
CarlandGitHub d56cae904d Merge pull request #925 from Ahrotahn/dialpatchfix
Update DIAL repeating discovery patch
2021-02-13 15:21:50 +01:00
CarlandGitHub f350bf9a1b Merge pull request #927 from uazo/fix-788
Fix favicons search for fallback
2021-02-13 15:15:43 +01:00
Carmelo Messina eb1e6fc0b7 Fix favicons search for fallback 2021-02-13 11:48:57 +01:00
Blaise 026b290582 Update DIAL repeating discovery patch 2021-02-11 10:13:31 -06:00
Carmelo Messina b11ab2588e change period in frequency + move next_check_delay_ + call OnFinishedCallback 2021-02-11 17:13:25 +01:00
CarlandGitHub c8417ba29f Merge pull request #922 from uazo/fix-899
remove TabModelSelectorBase.java changes
2021-02-11 00:52:38 +01:00
Carmelo Messina e94630c2b6 remove DCHECK + do not set empty useragent 2021-02-09 21:39:44 +01:00
Carmelo Messina 634c5b2a52 remove TabModelSelectorBase.java changes 2021-02-09 21:31:42 +01:00
Carmelo Messina 95ab44c7af add setting for check + enum from native + revision changes 2021-02-09 21:24:17 +01:00
csagan5 674481d28d Add missing entry to CHANGELOG 2021-02-06 15:34:38 +01:00
csagan5 0292b9612f Release 88.0.4324.149 2021-02-06 15:32:57 +01:00
Carmelo Messina 78a9c7eb85 fix request on start 2021-02-05 16:34:50 +01:00
CarlandGitHub 0fde359db6 Merge pull request #901 from uazo/fix-proxy-system-network
Enable proxy config for the system network context
2021-02-04 22:45:05 +01:00
CarlandGitHub 300460a3ae Merge branch 'master' into fix-proxy-system-network 2021-02-04 22:42:37 +01:00
CarlandGitHub d9922db41c Merge pull request #898 from uazo/fix-884
add reading of kProxyReverseBypass from config
2021-02-04 22:40:26 +01:00
Carmelo Messina 788775f849 Ability to see when adblock filters were last updated; button to manually update adblock filters 2021-02-04 18:27:20 +01:00
Carmelo Messina 126c1afb4d enable proxy config for the system network context 2021-02-02 14:46:10 +01:00
csagan5 cc06b37ef7 Release 88.0.4324.141 2021-01-31 12:59:26 +01:00
Carmelo Messina 30b18d8e15 added reading of kProxyReverseBypass from config 2021-01-30 17:23:11 +01:00
CarlandGitHub 5f22cda333 Merge pull request #896 from uazo/fix-bookmark-import-export
little fix to "Add bookmark import/export actions" patch
2021-01-30 17:15:59 +01:00
Carmelo Messina 902961d756 fix wrong thread (DCHECK failed) + request WRITE_EXTERNAL_STORAGE permission 2021-01-30 14:54:40 +01:00
csagan5 8340b1da10 Mention GitHub Discussions 2021-01-29 23:29:49 +01:00
csagan5 02abc71790 Updating patches for next 88.0.4324.141 release 2021-01-29 21:41:38 +01:00
CarlandGitHub 344da255ba Merge pull request #892 from uazo/fix-v88
fix proxy and bookmark page
2021-01-29 20:38:00 +01:00
Carmelo Messina cf2a2adc87 fix proxy and bookmark page 2021-01-28 21:18:06 +01:00
csagan5 47c948a929 Release 88.0.4324.95 2021-01-26 01:12:38 +01:00
CarlandGitHub f9c06b613d Add section about contributing 2021-01-15 01:34:00 +01:00
csagan5 c3f43a2f14 Update CHANGELOG and network isolation patch 2020-12-27 22:11:25 +01:00
csagan5 6be731cca7 Release 87.0.4280.131 2020-12-27 21:39:48 +01:00
csagan5 b201775f4e Release 87.0.4280.106 2020-12-11 13:29:26 +01:00
CarlandGitHub 42ffe7b18a Merge pull request #830 from uazo/fix-828
Add random seed to TimezoneOverride patch
2020-12-07 00:50:49 +01:00
Carmelo Messina 76992d379b use base::RandInt 2020-12-02 16:29:42 +01:00
Carmelo Messina 95090b016d add random seed 2020-12-01 16:52:31 +01:00
csagan5 d4dd2dd63b Release 87.0.4280.81 2020-11-27 21:48:48 +01:00
CarlandGitHub aecf9624db Merge pull request #823 from uazo/fix-819
Fix allow custom user agent patch
2020-11-25 21:47:31 +01:00
CarlandGitHub b42ba1aef6 Merge pull request #825 from uazo/fix-autoplay
fix global "Autoplay" site-setting
2020-11-25 21:46:07 +01:00
CarlandGitHub b93b06ed88 Merge pull request #821 from zhmars/i18n
Update zh_CN translations
2020-11-25 21:45:31 +01:00
Carmelo Messina fd0b637eef fix autoplay setting 2020-11-25 21:27:07 +01:00
Carmelo Messina 92111e3b07 - correctly passed user agent to blink
- in settings, flag assigned at focus of the control
- loading of overrides at startup
2020-11-24 17:09:56 +01:00
mars a5fe3a57f6 Update zh_CN translations 2020-11-24 02:40:29 +08:00
csagan5 e9a29a5f61 Current version of the user agent customization patch 2020-11-21 22:16:53 +01:00
csagan5 bd63e0463a Release 87.0.4280.68 2020-11-21 17:31:40 +01:00
CarlandGitHub b41c9f3236 Merge pull request #816 from nikolowry/master
Intent handling fix for local apps on Android 11
2020-11-21 12:24:27 +01:00
CarlandGitHub d5ff0c04f4 Merge pull request #807 from uazo/fix-798
Allow custom user agent
2020-11-21 11:49:11 +01:00
Niko Lowry a17ef28063 Intent handling fix for local apps on Android 11 2020-11-20 20:23:17 -05:00
csagan5 7b83448cea Update CHANGELOG.md 2020-11-19 21:16:10 +01:00
csagan5 73ef7f3ea1 Release 87.0.4280.67 2020-11-19 21:00:03 +01:00
Carmelo Messina 06936970d1 readded new title to preference 2020-11-19 13:29:12 +01:00
Carmelo Messina 491c46b6c1 merge with master 2020-11-18 17:54:22 +01:00
Carmelo Messina fdaf4ada21 update for v87 2020-11-18 17:46:05 +01:00
CarlandGitHub d446f0e453 Merge pull request #809 from uazo/v87
Update patches for v87
2020-11-16 20:19:20 +01:00
CarlandGitHub 2e2fa340ef Apply suggestions from code review 2020-11-16 20:18:44 +01:00
Carmelo Messina f545de305f update Disable-sync-services-menu-entry.patch 2020-11-16 19:53:06 +01:00
Carmelo Messina 916169fd14 update timezone-customization patch + fix others 2020-11-16 17:44:12 +01:00
Carmelo Messina 461860fbe3 updated patch with wiggle
added timezone-override patch
2020-11-16 14:45:24 +01:00
Carmelo Messina 997f047926 update patchs with wiggle 2020-11-15 22:25:05 +01:00
Carmelo Messina a8848ed4f6 update patch with wiggle 2020-11-15 18:20:09 +01:00
Carmelo Messina c6060f0d79 [wip] patch before wiggle 2020-11-15 16:21:49 +01:00
Carmelo Messina caef723507 update Disable safe browsing 2020-11-15 15:16:42 +01:00
csagan5 bf42b995a2 Fix adblock filters patch 2020-11-14 20:36:11 +01:00
csagan5 9a1f7c4242 Updated patches for v87 2020-11-14 17:58:46 +01:00
Carmelo Messina 204fafbf4a Allow custom user agent 2020-11-13 13:19:42 +01:00
csagan5 578556604a Release 86.0.4240.194 2020-11-09 19:39:04 +01:00
CarlandGitHub f444a7dba6 Merge pull request #802 from uazo/fix-791
Revert the removal of an option to block autoplay
2020-11-08 08:47:14 +01:00
csagan5 200c855c3e Fix missing index lines
Fix patch order
2020-11-08 02:09:41 +01:00
Carmelo Messina 36e72671b0 Revert the removal of an option to block autoplay 2020-11-07 23:03:08 +01:00
CarlandGitHub a3d4ff7371 Merge pull request #796 from uazo/fix-789
Fix Omnibox flag not working
2020-11-07 21:29:06 +01:00
CarlandGitHub bc9eead93b Merge pull request #800 from uazo/fix-780
Always desktop view mode: exclude internal schemes
2020-11-07 20:37:20 +01:00
Carmelo Messina b886ead295 removed useless flag 2020-11-07 15:13:34 +01:00
Carmelo Messina 525889600f restore search ready omnibox flags behaviour 2020-11-06 21:49:09 +01:00
Carmelo Messina 66cded0cd7 fix transition from and to webui with new flag enabled 2020-11-06 21:44:09 +01:00
Carmelo Messina bbd0f8c531 add a option to exclude internal schemes 2020-11-06 17:10:22 +01:00
Carmelo Messina b2a36c11b8 merge from master 2020-11-06 16:39:34 +01:00
csagan5 85f8338501 Release 86.0.4240.181 2020-11-03 19:29:03 +01:00
CarlandGitHub ed5a1533d9 Merge pull request #787 from uazo/fix-780
Add flag to always view the desktop site for all websites
2020-11-02 22:04:00 +01:00
Carmelo Messina 58395a30a4 fix 789 2020-10-31 23:17:00 +01:00
Carmelo Messina d360de85cc fix toggling the new option alone does not affect the user agent 2020-10-26 17:53:06 +01:00
Carmelo Messina 221c8a3ec3 toggling the new option alone does not affect the user agent 2020-10-26 16:32:32 +01:00
Carmelo Messina 9ed77fd7d6 fixed flag behavior and added new setting menu 2020-10-26 13:05:53 +01:00
Carmelo Messina 6b238924ee removed trailing whitespace 2020-10-24 22:19:53 +02:00
Carmelo Messina 71f1163b2a added flags in homepage_preferences and site_settings_preferences.xml
we need to choose.
2020-10-24 21:49:49 +02:00
csagan5 93f7b0aef6 Release 86.0.4240.112 2020-10-22 00:22:06 +02:00
CarlandGitHub 8b8c74af26 Merge pull request #777 from uazo/fix-771
add item in main_menu_regroup.xml resource
2020-10-20 22:54:20 +02:00
Carmelo Messina 75887279ac updated exit icon menu 2020-10-17 14:31:31 +02:00
csagan5 7e3c9d2064 Release 86.0.4240.99 2020-10-16 22:50:41 +02:00
Carmelo Messina 8a3b173910 add item in main_menu_regroup.xml resource 2020-10-11 21:06:49 +02:00
csagan5 6ebce2bf0c Release 86.0.4240.92 2020-10-10 12:20:40 +02:00
CarlandGitHub ad47e646ee Merge pull request #775 from uazo/fix-758
fix patchs for "All preferences in the screen should be added in the new order list"
2020-10-09 23:43:24 +02:00
Carmelo Messina 32049708d5 fix patchs for "All preferences in the screen should be added in the new order list" 2020-10-09 19:03:14 +02:00
csagan5 8839e61ea5 Release 86.0.4240.73 2020-10-05 00:32:13 +02:00
csagan5 565b2f70a9 Add reference to list of URLs 2020-10-04 12:13:37 +02:00
csagan5 a505fac5d3 Release 86.0.4240.70 2020-10-03 19:01:12 +02:00
csagan5 f97d8aa345 Release 86.0.4240.66 2020-10-02 08:55:51 +02:00
CarlandGitHub eaf47e2099 Merge pull request #757 from uazo/time-override-v86
update timezone override patch for v86
2020-10-01 22:38:21 +02:00
Carmelo Messina 75706ea313 update timezone override patch for v86 2020-09-30 09:52:25 +02:00
csagan5 7a9188d76e v86 patches 2020-09-28 22:00:09 +02:00
CarlandGitHub 7c1c9c5620 Mention media casting in F.A.Q.s 2020-09-28 21:22:08 +02:00
csagan5 47e3933004 Release 85.0.4183.114 2020-09-18 10:50:03 +02:00
CarlandGitHub d2d29d3401 Update Brave link 2020-09-14 00:41:03 +02:00
csagan5 8f01561842 Release 85.0.4183.110 2020-09-11 19:52:12 +02:00
csagan5 62455cbd5a Release 85.0.4183.94 2020-09-05 13:08:53 +02:00
csagan5 57634d6021 Text and layout improvements for the timezone customization patch 2020-09-05 00:19:17 +02:00
CarlandGitHub be7404a961 Merge pull request #725 from uazo/fix-proxy-patch
fix proxy settings patch with always incognito profile
2020-09-04 23:30:39 +02:00
Carmelo Messina d804ba7400 fix for always incognito profile 2020-09-04 15:01:50 +02:00
csagan5 986d04a2c9 Updated timezone customization patch
Added patch for DIAL repeating discovery
2020-09-04 01:06:12 +02:00
CarlandGitHub 23485dc259 Merge pull request #723 from uazo/timezone-override
Add timezone override patch
2020-09-03 20:58:14 +02:00
CarlandGitHub a865bcdedd English text improvements 2020-09-03 20:56:51 +02:00
Carmelo Messina 3a9a367259 fix for 85.0.4183.86 without session-only patch 2020-09-03 17:56:18 +02:00
Carmelo Messina ea53b99aa1 adding suggestions 2020-09-03 09:28:09 +02:00
csagan5 631072f5d6 Remove session-only cookies support 2020-09-01 19:42:42 +02:00
Carmelo Messina 6d9c47e8e6 add timezone override patch 2020-09-01 16:01:00 +02:00
CarlandGitHub d65477e14a Mention that latest version should be used 2020-08-27 08:23:31 +02:00
csagan5 5b28504837 Release 85.0.4183.86 2020-08-26 18:30:56 +02:00
csagan5 90635707e9 Fix LocationBarPhone app crash at startup 2020-08-26 17:47:19 +02:00
csagan5 5daca63561 Release 85.0.4183.84 2020-08-25 21:01:43 +02:00
csagan5 9b30907ddd Minor fixes to proxy patch 2020-08-25 15:02:00 +02:00
csagan5 576f8eb7d0 Cleanup proxy configuration patch, fix mode 2020-08-24 21:49:24 +02:00
uazoandGitHub bfd783f62a Introduce direct mode for proxy configuration
* fix Bromite bugs #377 and #679

* add Add-a-proxy-configuration-page-fix-377-679.patch
2020-08-24 21:25:01 +02:00
csagan5 21c6b87914 Updated patches for v85 2020-08-23 23:06:29 +02:00
csagan5 6717730428 Add changelog entry for issue #654 2020-08-23 22:29:19 +02:00
csagan5 46985eced7 Release 85.0.4183.82 2020-08-23 22:09:50 +02:00
CarlandGitHub d0e9d700f1 Merge pull request #705 from uazo/fix-681
fix RestoreForeignSessionTab in android
2020-08-23 22:03:54 +02:00
Carmelo Messina bc58f108fc fix RestoreForeignSessionTab in android 2020-08-23 11:39:19 +02:00
csagan5 5da292bc15 Remove symlink 2020-08-18 17:08:57 +02:00
csagan5 34bc3555dc Update feature request template 2020-08-18 08:14:00 +02:00
CarlandGitHub 74767e397a Merge pull request #692 from uazo/fix-654
force incognito profile when mStartIncognito is true

Fixes #654
2020-08-17 17:31:29 +02:00
Carmelo Messinaandcsagan5 67dc28859d force incognito profile when mStartIncognito is true 2020-08-17 17:29:54 +02:00
csagan5 c65e5bbda4 Release 84.0.4147.132 2020-08-17 17:07:38 +02:00
CarlandGitHub ce75c13b20 Merge pull request #688 from uazo/fix-exit-menu-item
Fix patch "Add exit menu item"

Fixes #673
2020-08-17 10:33:42 +02:00
CarlandGitHub a6df80f815 Merge pull request #675 from uazo/history-on-incognito
Add history on incognito tabs
2020-08-15 23:23:49 +02:00
CarlandGitHub 15e75eeb88 Merge branch 'master' into history-on-incognito 2020-08-15 23:23:36 +02:00
csagan5 5dd2efd498 Minor patch cleanup 2020-08-15 23:22:16 +02:00
CarlandGitHub 28c2972673 Merge pull request #671 from uazo/session-only-cookies
session only cookies patch - rev 01
2020-08-15 23:20:08 +02:00
csagan5 6dbdeec051 Merge branch 'session-only-cookies' of https://github.com/uazo/bromite into session-only-cookies 2020-08-15 23:18:35 +02:00
csagan5 90a40e41a8 Adjust description and position 2020-08-15 23:17:27 +02:00
Carmelo Messina f241d0183c fix patch "Add exit menu item" 2020-08-15 21:55:09 +02:00
CarlandGitHub 5479f2e978 Merge branch 'master' into session-only-cookies 2020-08-14 08:38:34 +02:00
Carmelo Messinaandcsagan5 bec74e52f4 session only patch rev 01
add session only cookies preferences for site settings

Apply suggestions from code review

Co-authored-by: Carl <32685696+csagan5@users.noreply.github.com>
2020-08-14 08:37:07 +02:00
Carmelo Messina d1e398ce3a add first version 2020-08-07 18:36:16 +02:00
csagan5 225e19cf99 Release 84.0.4147.121 2020-08-07 15:12:29 +02:00
CarlandGitHub ae1fec5f3e Mention URL that explains how to use custom filters 2020-08-06 18:46:10 +02:00
csagan5 96671ab221 Release 84.0.4147.119 2020-08-05 08:49:10 +02:00
zhmarsandGitHub 166c05b5c5 Update zh_CN translations (#665) 2020-08-04 07:55:16 +02:00
csagan5 f513eb76ec Release 84.0.4147.113 2020-07-31 15:09:43 +02:00
csagan5 2de59b6a0c Fixed patch for site settings 2020-07-28 10:35:10 +02:00
csagan5 4eff892d17 Release 84.0.4147.106 2020-07-28 10:15:39 +02:00
csagan5 a634e3ac81 Fix minimum required Android version 2020-07-28 10:08:24 +02:00
csagan5 84a9001629 Release 84.0.4147.95 2020-07-17 15:46:36 +02:00
csagan5 265ab75e24 Release 84.0.4147.90 2020-07-16 23:30:56 +02:00
csagan5 f82057aabf Specify exception about CFI on x86 2020-06-26 21:38:40 +02:00
csagan5 ab94462f0a Fix CFI build flag 2020-06-24 09:06:47 +02:00
csagan5 08874f25ee Release 83.0.4103.119 2020-06-24 09:05:42 +02:00
csagan5 ae8ad945c1 Mention cause for autofill not working 2020-06-23 20:17:13 +02:00
csagan5 47f4e2f650 Remove exception wording for CFI 2020-06-14 19:54:05 +02:00
csagan5 c1ecd4c36a Release 83.0.4103.101 2020-06-10 00:30:29 +02:00
CarlandGitHub 398a3aa344 Provide some pointers for new bug submissions 2020-06-05 00:07:39 +02:00
CarlandGitHub 95e1be4eb2 Clarify what to do before submitting feature requests 2020-06-05 00:06:00 +02:00
csagan5 f210af1b51 Mention autofill in FAQs 2020-06-02 22:33:08 +02:00
csagan5 c63223848d Release 83.0.4103.93 2020-06-02 01:12:43 +02:00
csagan5 d9ebf3fd67 Remove outdated bullet point about QUIC 2020-05-29 19:53:13 +02:00
csagan5 e9f00816c3 Document all the new flags 2020-05-26 22:49:19 +02:00
csagan5 9fd6b12319 Remove mention of additional search engines 2020-05-26 22:05:00 +02:00
csagan5 a7e311242a Release 83.0.4103.76 2020-05-21 10:50:58 +02:00
csagan5 746bf414a2 Combine omnibox-related patches, drop workaround 2020-05-17 12:12:05 +02:00
csagan5 4c4dd71824 Updated domain substitution patch to run before text replacements 2020-05-16 17:43:15 +02:00
csagan5 08f4eacdff Release 83.0.4103.53 2020-05-15 18:45:43 +02:00
lucianlauandGitHub a52d7ffd83 Update CHANGELOG.md (#571)
Fix broken hyperlink
2020-05-14 19:54:02 +02:00
csagan5 6f3ded493a Latest version of the translation patch for zh_CN 2020-05-13 19:42:47 +02:00
csagan5 b6ed0c18db Updated automated domain substitution patch
Reduce changes in testdata files
2020-05-13 19:35:14 +02:00
csagan5 3be92ec2b6 Add missing changelog entry 2020-05-13 19:34:41 +02:00
csagan5 dd87f6cf0a Document new flag for incognito tabs 2020-05-13 19:34:33 +02:00
csagan5 65bd5c1df9 Release 83.0.4103.46 2020-05-13 19:34:31 +02:00
csagan5 45df4acfe5 Introduce patch for webRTC CCT tabs leaks 2020-05-09 17:50:55 +02:00
csagan5 c8825825e4 Fix typo in issue number 2020-04-26 21:23:39 +02:00
csagan5 15f047e484 Release 81.0.4044.127 2020-04-26 21:21:06 +02:00
csagan5 0170036187 Adjust patch for incognito custom tabs support 2020-04-23 22:55:46 +02:00
uazoandcsagan5 fe93fa8497 Enable incognito custom tab 2020-04-23 22:55:42 +02:00
CarlandGitHub 88030934c7 Merge pull request #529 from bromite/always-incognito-bg-fix
Add patch for always-incognito crashes fixes
2020-04-22 18:51:34 +02:00
csagan5 2140ce4f53 Updated patch to latest version 2020-04-20 22:33:15 +02:00
csagan5 0132b51132 Add patch for always-incognito crashes fixes 2020-04-19 16:19:17 +02:00
csagan5 41f3eb6400 Release 81.0.4044.106 2020-04-16 09:10:09 +02:00
csagan5 154ff73784 Minor description update 2020-04-08 20:21:40 +02:00
csagan5 6981d4ee4c Remove invalid changelog entry 2020-04-08 20:15:33 +02:00
csagan5 3c9c050df0 Release 81.0.4044.97 2020-04-08 09:43:51 +02:00
csagan5 119088d986 Minor fixes for bug issue template 2020-04-07 00:24:30 +02:00
CarlandGitHub d12c186bbc Merge pull request #518 from cacheiforindicium/patch-1
Update README.md
2020-04-05 01:56:52 +02:00
cacheiforindiciumandGitHub 95dca6a146 Update README.md
Startpage removed as search engine from browser
2020-04-04 19:22:16 +00:00
csagan5 3c510a3a8e Release 81.0.4044.83 2020-04-01 00:02:24 +02:00
csagan5 7f15412ae0 Update issue/feature templates 2020-03-25 19:32:20 +01:00
csagan5 406bedb7a2 Release 81.0.4044.76 2020-03-23 20:08:12 +01:00
csagan5 c696b6f939 Release 81.0.4044.70 2020-03-20 06:26:36 +01:00
csagan5 97ad845a27 Backport missing Android surface control fix 2020-03-18 19:49:34 +01:00
csagan5 a6ca6a5cee Release 81.0.4044.63 2020-03-13 18:52:40 +01:00
csagan5 7c25daa521 Mention when AdGuard filters were removed 2020-03-09 18:42:38 +01:00
csagan5 f5275180b4 Add question about PWAs WebAPK support 2020-03-07 08:47:32 +01:00
csagan5 e7d8daac10 Update donation address 2020-02-27 23:34:45 +01:00
csagan5 7c6ba84acd Release 80.0.3987.118 2020-02-22 14:33:41 +01:00
csagan5 8d85bfa7d0 Release 80.0.3987.109 2020-02-18 07:50:35 +01:00
csagan5 152903d847 Mention wiki 2020-02-16 18:25:58 +01:00
csagan5 4fad3bf5bc Update patch description 2020-02-15 09:27:21 +01:00
CarlandGitHub 1cc0dfb1ff Merge pull request #491 from bromite/v80/AImageReader-bugfix
Bugfix for AImageReader crash on Android10/arm64
2020-02-15 09:20:28 +01:00
csagan5 0d00af6e73 Bugfix for AImageReader crash on Android10/arm64 #445 2020-02-15 08:55:35 +01:00
csagan5 b902ec74ad Release 80.0.3987.95 2020-02-14 07:46:11 +01:00
csagan5 e9ba098f8e Update README regarding frozen user agent 2020-02-14 00:00:42 +01:00
CarlandGitHub 410fc50a21 Updated patches for v80 (#482)
* Updated patches for v80

* Fix arm64 build of openH264

* Fix linking error

* Update other patches too

* Fix remaining crashes
2020-02-07 07:52:41 +01:00
csagan5 24320da307 Split FAQ into own file 2020-01-31 11:20:13 +01:00
csagan5 8d85b59eac Mention that Push API does not work due to GCM
Thanks to @randomshell for looking into it.

Fixes #474
2020-01-29 09:51:35 +01:00
csagan5 00411eb209 Release 79.0.3945.139 2020-01-26 18:15:04 +01:00
csagan5 a56884e75e Explain how DRM works in Bromite 2020-01-24 10:02:21 +01:00
CarlandGitHub 1f363eba23 Mention enable-search-ready-omnibox flag
Fixes #469
2020-01-18 21:22:39 +07:00
csagan5 6f5d36bc5c Various improvements after proofreading 2020-01-17 22:22:16 +01:00
csagan5 a500255598 Release 79.0.3945.123 2020-01-11 17:11:14 +01:00
csagan5 af8378b675 Updated FAQs and features list 2020-01-08 03:02:57 +01:00
csagan5 3c916480b2 Document patch about video decode acceleration 2020-01-08 02:18:38 +01:00
csagan5 dbf32840c6 Release 79.0.3945.111 2020-01-08 02:14:39 +01:00
csagan5 4b8e47060b Update features list 2020-01-06 09:44:32 +01:00
csagan5 43bf98a956 Remove entry about bug not yet fixed 2019-12-31 18:15:28 +01:00
csagan5 b94b80e096 Release 79.0.3945.107 2019-12-31 18:07:47 +01:00
csagan5 52202a3ffb Release 79.0.3945.100 2019-12-27 16:08:41 +01:00
CarlandGitHub 4e5c7c36a1 Merge pull request #447 from bromite/v79/bugfixes
Bugfixes to build vanilla Chromium
2019-12-27 16:05:39 +01:00
csagan5 d1fb4d4974 Updated patches for next v79 release 2019-12-27 16:05:14 +01:00
csagan5 edaf4c0f17 Fixes for unified consent and feed build issues 2019-12-23 02:28:56 +01:00
csagan5 4a9cbe673d Bugfixes to build vanilla Chromium 2019-12-21 10:03:09 +01:00
csagan5 6340bb4398 Remove duplicate symbols in GN_ARGS 2019-12-20 08:43:56 +01:00
csagan5 ba0e1dc920 Release 79.0.3945.94 2019-12-20 07:58:59 +01:00
CarlandGitHub c8e8919714 Updated patches for v79 (#440)
* Updated patches for v79

Remaining issue:
* blank tabs when running on x86 emulators

Waiting on upstream to fix that.

The other upstream storage bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1033655) is fixed in this version.
2019-12-19 23:55:40 +01:00
csagan5 4902cfb5d5 Remove mention of original nochromo patch, no more used 2019-12-15 11:18:30 +01:00
csagan5 bc3ef3746a Release 78.0.3904.130 2019-12-09 11:51:40 +01:00
csagan5 c941fcf137 Release 78.0.3904.119 2019-11-30 17:51:25 +01:00
CarlandGitHub 86f3e97b6b Use headers for the feature request template 2019-11-18 22:10:54 +01:00
csagan5 f62bd97771 Release 78.0.3904.105 2019-11-17 13:30:59 +01:00
csagan5 11ec80bed4 Release 78.0.3904.93 2019-11-10 22:36:38 +01:00
CarlandGitHub b52188adfa Use smaller headers 2019-11-04 08:06:03 +01:00
CarlandGitHub 290ac541a5 Use headers 2019-11-04 08:04:08 +01:00
csagan5 a237a5ce1b Remove mention to old filters 2019-11-01 22:50:06 +01:00
Madis OtenurmandCarl 764cf585dd Remove "enable" from menu items (#398)
Remove "enable" from menu items
Renamed more references for consistency
2019-10-26 10:12:47 +02:00
csagan5 bbaf497fc7 Fix donation button image source 2019-10-25 22:22:02 +02:00
csagan5 2a03789061 Release 78.0.3904.72 2019-10-25 08:55:16 +02:00
csagan5 c2ab0f4667 Remove unused old AdBlock filters header 2019-10-22 22:33:54 +02:00
csagan5 b692f721a3 Publish list of patches for the Chromium build 2019-10-22 22:33:38 +02:00
csagan5 28e950d9be Updated patches to fix #387 and #388 2019-10-21 16:23:03 +02:00
csagan5 6a9e562dde Release 78.0.3904.63 2019-10-18 00:55:10 +02:00
csagan5 158d782db4 Updated donation buttons 2019-10-02 16:08:25 +02:00
csagan5 8d494540e2 Release 77.0.3865.104 2019-09-28 09:55:06 +02:00
CarlandGitHub 74cb09ea83 Removed question about dark mode and themes (fixes #376) 2019-09-25 23:42:20 +02:00
CarlandGitHub 3f19511574 Mention that no support for SystemWebView installations is provided 2019-09-23 22:00:16 +02:00
csagan5 e866631846 Release 77.0.3865.95 2019-09-23 21:54:14 +02:00
CarlandGitHub 00c28793f4 Add question about SystemWebView 2019-09-23 09:24:44 +02:00
CarlandGitHub 932d5c680f Explain how to find Chromium 2019-09-23 09:20:37 +02:00
csagan5 aa408e6d21 Update information after switch to native engine 2019-09-16 08:58:01 +02:00
csagan5 5330cb879f Release 77.0.3865.81 2019-09-16 08:39:49 +02:00
csagan5 d86fcd1c5f Update feature request template 2019-09-15 18:30:13 +02:00
csagan5 ec98e6e11c Release 76.0.3809.129 2019-08-24 21:03:55 +02:00
csagan5 528c999cbb Update issue template; add device model field 2019-08-22 21:52:59 +02:00
csagan5 65c5722a09 Release 76.0.3809.115 2019-08-13 07:57:29 +02:00
csagan5 35f447cf0c Release 76.0.3809.100 2019-08-07 07:49:14 +02:00
csagan5 a5b818c8ab Release 76.0.3809.91 2019-08-02 07:20:44 +02:00
csagan5 21ef4d1c37 Fix Qwant patch 2019-07-28 10:00:48 +02:00
csagan5 b05d50bcad Release 76.0.3809.85 2019-07-28 09:32:54 +02:00
csagan5 07985cf503 Release 75.0.3770.139 2019-07-13 07:15:37 +02:00
csagan5 323864669b Release 75.0.3770.132 2019-07-09 00:23:34 +02:00
csagan5 50b0961a8d Release 75.0.3770.109 2019-06-25 08:18:06 +02:00
CarlandGitHub 8eb36db315 Create FUNDING.yml 2019-06-18 08:07:44 +02:00
csagan5 a2efd643de Release 75.0.3770.86 2019-06-10 19:27:28 +02:00
csagan5 c611bc0855 Release 75.0.3770.82 2019-06-06 08:03:40 +02:00
csagan5 028c1567bd Report Android v4.4 and above as supported (SDK19) 2019-05-30 21:15:31 +02:00
csagan5 bd0b93cb3e Release 75.0.3770.70 2019-05-30 21:08:04 +02:00
csagan5 84d6403e06 Increase minimum SDK version from 17 to 19 2019-05-24 23:43:18 +02:00
csagan5 73b524f627 Release 75.0.3770.53 2019-05-24 19:54:43 +02:00
csagan5 232dd7f970 Report correct minimum SDK version 16 -> 17 2019-05-24 05:54:10 +02:00
csagan5 ca366d39b9 Release 75.0.3770.50 2019-05-22 06:11:41 +02:00
csagan5 5cf852d97d AndroidHardening -> GrapheneOS 2019-05-18 12:34:51 +02:00
csagan5 f2977bac96 Update CHANGELOG 2019-05-18 12:31:09 +02:00
csagan5 a162d5820e Release 74.0.3729.162 2019-05-18 12:30:04 +02:00
csagan5 95c717eb59 Release 74.0.3729.154 2019-05-15 09:47:17 +02:00
csagan5 873c245f6e Release 74.0.3729.141 2019-05-06 22:55:18 +02:00
csagan5 56fa92cbff Release 74.0.3729.122 2019-04-28 18:26:54 +02:00
csagan5 acc8cbb1e9 Release 74.0.3729.106 2019-04-21 14:26:39 +02:00
csagan5 c4bce0f449 Updated patches for latest release 2019-04-15 08:38:09 +02:00
csagan5 cf3313d156 Release 74.0.3729.86 2019-04-15 08:35:49 +02:00
csagan5 a6ffa85a0e Release 74.0.3729.80 2019-04-13 10:25:57 +02:00
csagan5 e940ac0998 Release 73.0.3683.107 2019-04-08 22:08:24 +02:00
csagan5 d1069ed023 Release 73.0.3683.105 2019-04-06 20:26:09 +02:00
csagan5 3a9775c5c0 Add note about privacy limitations and link to Tor Browser project 2019-04-05 22:09:45 +02:00
csagan5 d1c1ce61ff Release 73.0.3683.97 2019-03-31 22:58:00 +02:00
csagan5 525243125d Release 73.0.3683.88 2019-03-23 00:59:15 +01:00
csagan5 c15c433631 Add AndroidHardening to credits section as well 2019-03-18 21:57:09 +01:00
csagan5 e7e7afdc2d Release 73.0.3683.82 2019-03-18 21:51:54 +01:00
csagan5 a600d36a56 Mention AndroidHardening project 2019-03-18 01:01:09 +01:00
csagan5 e012e0aa9f Release 73.0.3683.79 2019-03-15 16:34:48 +01:00
csagan5 a320e83fa1 Changelog for 73.0.3683.70 2019-03-12 21:25:07 +01:00
csagan5 5d3367398f Release 73.0.3683.70 2019-03-10 20:05:38 +01:00
csagan5 a34b285160 Release 73.0.3683.61 2019-03-03 08:25:32 +01:00
csagan5 a672f8d057 Release 72.0.3626.120 2019-02-27 14:11:24 +01:00
csagan5 503e4b8f27 Release 72.0.3626.119 2019-02-22 09:38:54 +01:00
csagan5 b615a77f51 Release 72.0.3626.114 2019-02-18 17:58:13 +01:00
csagan5 7f6cc79541 Release 72.0.3626.108 2019-02-13 17:41:35 +01:00
csagan5 2951298a6b Add URL to AV1 support wiki page 2019-02-12 07:42:39 +01:00
csagan5 d5b09217ef Release 72.0.3626.99 2019-02-08 17:54:20 +01:00
csagan5 28d274b712 Release 72.0.3626.87 2019-02-03 21:52:41 +01:00
csagan5 c800e61cc3 Release 72.0.3626.81 2019-01-29 18:14:13 +01:00
csagan5 d66be65985 Add section for 72.0.3626.73 2019-01-25 11:34:02 +01:00
csagan5 30b0e61732 Release 72.0.3626.73 2019-01-25 07:06:36 +01:00
csagan5 a7c33014b6 Add missing reference to AV1 patch 2019-01-24 20:15:35 +01:00
297 changed files with 290000 additions and 127826 deletions
+4
View File
@@ -0,0 +1,4 @@
# These are supported funding model platforms
liberapay: csagan5
custom: https://www.bromite.org/#donate
-37
View File
@@ -1,37 +0,0 @@
---
name: Bug report
about: Create a Bromite bug report
---
**Bromite version**
Version: `69.0...`
Arch: `arm` or `arm64` or `x86`
Android version: ... (example: `lollipop`)
**Is the bug reproducible with latest version?**
`Bug must be reproducible with latest version`
**Can the bug be reproduced with corresponding [Chromium](https://github.com/bromite/chromium/releases) version?**
`Bug must NOT be reproducible with Chromium to be qualified as a Bromite bug`
If yes then report it upstream on [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; all Chromium issues reported here will be closed as `invalid`.
**Is the bug a crash?**
If yes then individuate and post the logcat dump (remove privacy sensitive information, if any), otherwise remove this section.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
+212
View File
@@ -0,0 +1,212 @@
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 the website nor F-Droid nor 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:
- 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
-17
View File
@@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest a privacy-related idea for this project
---
**Is your feature request related to privacy?**
Features that are not related to privacy are unlikely to be considered.
**Is there a patch available for this feature somewhere?**
...
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you have considered.
@@ -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
+15
View File
@@ -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
+811
View File
@@ -1,3 +1,814 @@
# 105.0.5195.147
* enable HEVC by default (fixes https://github.com/bromite/bromite/issues/2331)
* partition blobs by top frame URL (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2312)
* use first accept-language as system language for Blink (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2160)
* fix user scripts injection with back-forward cache enabled (thanks to @uazo)
* remove HTTP referrals in cross-origin navigation (thanks to @uazo)
* update noise factor for anti-fingerpriting mitigations only once per document (fixes https://github.com/bromite/bromite/issues/2352)
* disable add to home screen prompt (fixes https://github.com/bromite/bromite/issues/2340)
# 105.0.5195.41
* revert by-pass for clipboard permissions for NTP doodles (fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1334203)
* prevent history detection via favicon (fixes https://github.com/bromite/bromite/issues/2269)
* fix the lack of protection in canvas.convertToBlob()
* improve incognito mode detection countermeasures (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1615)
* fix toolbar gesture when using bottom navigation bar (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2253)
# 104.0.5112.91
* re-introduce modal flag to prompt when closing all tabs
* sharing hub: always use visible URL (fixes https://github.com/bromite/bromite/issues/2204)
* add SVG fingerprinting mitigation (thanks to @uazo)
* updated zh_CN translactions (thanks to @zhmars)
* dropped patch to open YouTube links in Bromite
# 104.0.5112.63
# 103.0.5060.140
* fix timezone override not working correctly (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2133)
* never provide navigator.connection info (thanks to @uazo)
* fix management of custom User-Agent (thanks to @uazo)
# 103.0.5060.126
* fix malfunctioning sticky desktop mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2179)
* fix non-working passwords manager (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2188)
* fix crash when opening recent tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2190)
* fix autoplay not working correctly (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2096)
* add GN flag for clangd builds (thanks to @uazo)
# 103.0.5060.121
* do not enable always use HTTPS by default
* match system dark mode (thanks to @krlvm)
* remove window name on cross origin navigation (thanks to @uazo)
* remove preload of GMS fonts on stock Android (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2156)
# 102.0.5005.96
* fix history expiration bug (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2104)
* fix category setting activation (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2091)
* improve plain text rendering on mobile
* rewritten certificate transparency patch (fixes https://github.com/bromite/bromite/issues/2101)
# 102.0.5005.92
* restore offline-indicator-v2 flag functionality (thanks to @Zelda189)
# 102.0.5005.67
* dropped patch to disable mobile identity consistency by default
* fix text for blocked ads (fixes https://github.com/bromite/bromite/issues/2026)
* fix OpenSeach visited site detection bug (fixes https://github.com/bromite/bromite/issues/1994)
# 101.0.4951.69
* flag to toggle site engagement (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2022)
* site settings to enable webGL (thanks to @uazo)
* removed flag to disable webGL
* fix bottom navigation bar search/site suggestions behaviour (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2049)
* enable process isolation for all iframes
* add webRTC site settings (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1965)
# 101.0.4951.53
* move incognito settings to separate page (thanks to @uazo)
* disable automatic offline pages saving by default (thanks to @uazo)
* make history support and site settings in always incognito mode disabled by default (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1991)
* move pop-up toolbar to the bottom when using bottom navigation bar (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2030)
* menu does not show all entries (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/2011)
* stray shadow when using bottom toolbar (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1995)
# 101.0.4951.39
* save only ContentSettings in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1942)
* fix a couple issues related to signin and metrics leftover code affecting debug builds (thanks to @uazo)
* remove some more parameters from the English-version search engine (thanks to @uazo)
* add welcome screen with mention of privacy statements (fixes https://github.com/bromite/bromite/issues/691)
# 100.0.4896.135
* remove mremap from seccomp baseline policy
* add flag to move top toolbar to bottom (thanks to @uazo)
# 100.0.4896.92
* improve user script errors and visualized name (thanks to @uazo)
* fix autofill password not working anymore (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1956)
* mark sites as visited when they have an already-parsed OpenSearch descriptor
* disable TLS resumption by default (thanks to @uazo)
* partition DoH requests by top-frame NIK (thanks to @uazo)
# 100.0.4896.83
* update zh_CN translations (thanks to @zhmars)
* fix custom UA reported via Javascript (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1936)
* introduce session granularity for permissions (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1549)
* disable crash reporting
* avoid script injection on some sites
* fix upstream OpenSearch bug with search engines prematurely discarded
* fix upstream DNS bug with inconsistent Android system DNS configuration (fixes https://github.com/bromite/bromite/issues/1960)
* use less invasive approach to protect local IP address when using webRTC (fixes https://github.com/bromite/bromite/issues/589)
* add menu entry to select all bookmarks (fixes https://github.com/bromite/bromite/issues/1959)
* fix Note 9 crash on startup (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1871)
* remove passwords menu entry for leak check
* remove privacy menu entry to use phone as a security key
# 100.0.4896.57
* allow OpenSearch search engine URLs with path
* disable AsyncDNS by default
* remove translate menu entries
* fix patch to remove contextual search (thanks to @nikolowry)
* add option to never expire history
* improve description for JIT site settings (fixes https://github.com/bromite/bromite/issues/1931)
* remove more signin integration (fixes https://github.com/bromite/bromite/issues/1902)
* miscellaneous fixes for AMP and background video playback (fixes https://github.com/bromite/bromite/issues/1921)
* update zh_CN translations (thanks to @zhmars)
# 99.0.4844.77
* fix missing adaptive icon for updates
* do not close adblock filters editor when tapping reset button
* change text for 'Never' in history days to keep setting
* bring back dictionary hints in address bar
# 99.0.4844.58
* remove contextual search (fixes https://github.com/bromite/bromite/issues/1750)
* remove global JIT settings
* add privacy setting for how many number of days of history to keep (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1870)
* disable UA full version (thanks to @uazo)
* reintroduce patch for Save-Data header
* updated zh_CN translations (thanks to @zhmars)
* reintroduce Save-Data header flag
# 99.0.4844.55
* flag to enable Certificate Transparency (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1554)
* allow adding search engines from incognito mode
* disable all predictors code (thanks to @uazo)
* revert allow block of view-source URLs
* enable StrictOriginIsolation and SitePerProcess for all devices (thanks to @uazo)
* JIT toggle site setting (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1720 and https://github.com/bromite/bromite/issues/1819)
* move always incognito preference to native (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1496 and https://github.com/bromite/bromite/issues/1568)
* remove Save-Data header flag
* close a potential security issue with user scripts on native pages (thanks to @uazo)
* disable safety checks and possible Omaha interactions
* disable SegmentationPlatformFeature and Optimization Hints (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1632)
* add notification for a major upstream version being released (fixes https://github.com/bromite/bromite/issues/1796)
* fix screenshots in incognito allowed by default (fixes https://github.com/bromite/bromite/issues/1816)
# 98.0.4758.116
* disable minidumps upload
* complete disabling of client hint headers (thanks to @uazo)
* disable another way to activate origin trials (thanks to @uazo)
* fix for gateway attacks via websockets blocking (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1693)
# 98.0.4758.108
* re-introduce flag for text fragments
* re-introduce content feature flag to disable field trials
* disable idle detection
* disable critical client hints
* disable supervised users
* partial fix for incognito notification (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1503)
* consider websockets 'unknown' address space as 'public' (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1693)
* fix crash when accessing site settings of some sites (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1355)
# 97.0.4692.106
* disable url-keyed metrics reporting service (thanks to @uazo)
* disable mobile identity consistency by default
* disable appending variations header
* use Google Chrome branding for client hints
* make HTTPS-only mode enabled by default
* enable trivial auto var init (thanks to @BayLee4, fixes https://github.com/bromite/bromite/issues/1749)
* enable use_cfi_cast
# 96.0.4664.183
* updated zh_CN translations (thanks to @zhmars)
# 96.0.4664.104
* separate patches for package name
# 96.0.4664.54
* restored offline-indicator-v2 flag (fixes https://github.com/bromite/bromite/issues/1588)
* re-introduced option to use home page as NTP (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1519)
* ask user before closing all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1561)
* fix crash on always incognito on tablet (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1611)
* dropped patch to not upload crash data
* fix autofill pop-up not appearing (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1534)
# 95.0.4638.79
* improvements for field trials disable patch (thanks to @uazo)
* remove privacy sandbox UI leftover (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1560)
* disable conversion measurement API (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1531)
* remove all code related to FLoC (thanks to @uazo)
* remove all code related to ENABLE_REPORTING (thanks to @uazo)
* enable ad-tagging feature
* SystemWebView: ignore StrictMode warning (thanks to @jylitalbit, https://github.com/bromite/bromite/pull/1567)
* improvements for field trials fetch patch (thanks to @uazo)
* disable accessibility service by default (thanks to @uazo, https://github.com/bromite/bromite/pull/1559)
# 95.0.4638.78
* disable third-party origin trials (fixes https://github.com/bromite/bromite/issues/1530)
* dropped patch for async DNS flag
* dropped duplicate patch for pull-to-refresh flag
* fix application not closing on incognito tab (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1503)
* fix external links in incognito not always opening (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1474)
* fix incognito tab closing new tab under normal tab (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1030)
* allow custom tab intents and opening external links in incognito (thanks to @uazo)
* never use HTTP probes for connectivity check on Android < M
* re-introduce option to use home page as NTP (thanks to @uazo, https://github.com/bromite/bromite/pull/1586)
# 94.0.4606.109
* experimental user scripts support (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/792)
* Bromite auto-update notifications enabled by default
* enable Android native autofill (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/547)
# 94.0.4606.102
* add flag to disable pull-to-refresh effect
* add recents, offlinepage and send to home screen for always incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182 and https://github.com/bromite/bromite/issues/1362)
* prompt to restart when always-incognito is enabled (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1459)
* merge patches for custom tab intents
# 94.0.4606.94
* Bromite auto-update feature, disabled by default (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/706)
* add site setting for images (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1339)
* use SM-G960U as model provided via client hints and Javascript
* drop patches already merged upstream
# 93.0.4577.110
* set enable_reporting to false (thanks to @nikolowry)
* backported patches for security issues https://crbug.com/1245578 and https://crbug.com/1251787
* disable AGSA by default
* disable UA client hint for model
* disable lock icon in address bar by default
* enable share intent (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1062)
* allow forcing external links to open in incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/728)
* avoid double restart for default tab groups flags status
# 93.0.4577.83
* dropped patch for FLoC (already disabled by upstream)
* dropped patch for build with system sysroots
* disable tab groups by default (needs restart)
* added 'services/network/public/mojom' to ad blocker patch to avoid a build error
# 92.0.4515.176
* use upstream feature to prevent default search engine permissions grants
* slightly improve error message for gateway attacks prevention error
# 92.0.4515.134
# 92.0.4515.125
* replace patch for missing API keys warning
* fix subresource filter not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1299)
# 92.0.4515.103
* disable User Agent client hints
* fix builds with system sysroots
* force text/x-suse-ymp to be downloaded
# 91.0.4472.158
* added x64 releases
# 91.0.4472.146
* removed flags for device motion/orientation (fixes https://github.com/bromite/bromite/issues/1204)
* prevent crash on download on API level 21 (fixes https://github.com/bromite/bromite/issues/1184)
* fix crash reporting garbled UI for small screens (thanks to @uazo, https://github.com/bromite/bromite/pull/1236)
* add flag to enable/disable vibration API (fixes https://github.com/bromite/bromite/issues/1045)
# 91.0.4472.143
* add support for ISupportHelpAndFeedback
* JIT-less toggle (fixes https://github.com/bromite/bromite/issues/1235)
* enable crash reporting UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/944)
# 91.0.4472.102
* fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154)
# 91.0.4472.97
* add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152)
* enable IntentBlockExternalFormRedirectsNoGesture by default
* add flag to disable external intent requests
* fix for tab collection temporary/non-exportable (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1138)
# 91.0.4472.50
* unexpire tab group flags `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
* replace known good hostname used for DoH test (fixes https://github.com/bromite/bromite/issues/1148)
* drop patch to disable preview fetching
* drop patch to restore horizontal tab switcher
# 90.0.4430.204
* fix for custom tab intent tab crashes when in always incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1116)
# 90.0.4430.101
* disable RTCGetCurrentBrowsingContextMedia by default
* disable FLoC by default
# 90.0.4430.92
* restore horizontal tab switcher feature (fixes https://github.com/bromite/bromite/issues/1077)
* fix a couple of bugs in proxy saving UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1072)
* disable feeds V2 toggle (fixes https://github.com/bromite/bromite/issues/1070)
* allow fetching field trials from flags (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1021)
* add AllowUserCertificates flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/921)
* add IsCleartextPermitted flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1068)
# 90.0.4430.74
* re-added patch for User agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1049)
* fix always-incognito custom tab intents issues (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1047 and https://github.com/bromite/bromite/issues/1051)
* prevent Omnibox URL elisions by default
# 90.0.4430.59
* fix menu items not properly displayed with tab overflow menu regroup (fixes https://github.com/bromite/bromite/issues/963)
* fix text displayed for menu entry to bookmark all tabs
* bookmarks import/export: disable SAF by default (fixes https://github.com/bromite/bromite/issues/1039)
* disable offline measurement background task
* dropped patch to show warnings for TSLv1.0/v1.1 connections (upstream now disallows them)
* disable AImageReader by default on Android 9 and below for Qualcomm (fixes https://github.com/bromite/bromite/issues/1005)
# 89.0.4389.117
* disable AImageReader by default on Android 9 and below for ARM (fixes https://github.com/bromite/bromite/issues/1005)
* log checksum of AdBlock filters
# 89.0.4389.100
* enable AImageReader by default (fixes https://github.com/bromite/bromite/issues/1005)
* fix missing flag for AImageReader
* move incognito snapshots flag to proper section (fixes https://github.com/bromite/bromite/issues/1006)
* add missing icon for exit menu
* implement SAF for bookmarks export functionality (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/831)
# 89.0.4389.92
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/1000)
* introduce Alt+D hotkey to focus address bar (fixes https://github.com/bromite/bromite/issues/979)
* use 64-bit ABI for webview processes (fixes https://github.com/bromite/bromite/issues/997)
* use dedicated folder for bookmark all tabs
* fix Javascript and cookies permissions missing (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/990)
* fix missing enable Save-Data header flag (fixes https://github.com/bromite/bromite/issues/989)
* fix menu items not properly displayed with tab overflow menu regroup (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/963)
# 89.0.4389.78
* make all favicon requests on-demand
* restored older icon for view source menu item
* prevent adblock filters update check on app start (fixes https://github.com/bromite/bromite/issues/967)
* removed UI for adblock filters (fixes https://github.com/bromite/bromite/issues/941)
* dropped patch for swapped favicons bug
* dropped patch to enable reduced-referrer-granularity by default (already present upstream)
* dropped password reuse detection patch
* dropped UA customization patch
* enabled PartitionExpectCTStateByNetworkIsolationKey and PartitionDomainReliabilityByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/985)
# 88.0.4324.207
* add flag for save-data-header
* add option to force tablet UI
* fix bug with adblock filters not being downloaded correctly (fixes https://github.com/bromite/bromite/issues/960)
* move up bookmark all tabs menu item (fixes https://github.com/bromite/bromite/issues/943)
* fix icons for exit and view source menu items
# 88.0.4324.187
* fix exit menu item not working in tablet mode
* add menu item to bookmark all tabs (fixes https://github.com/bromite/bromite/issues/570)
* enable app overflow menu icons by default
* UI for adblock filters (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/811)
* dropped patch to not permit user-installed certificates
* ignore enterprise policies for secure DNS (fixes https://github.com/bromite/bromite/issues/832)
# 88.0.4324.185
* fix favicons fallback search (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/788)
* fix potential DIAL crash when network state changes (thanks to @Ahrotahn)
* fix crash when opening links in incognito-only mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/899)
* disallow empty custom user agent (thanks to @uazo)
# 88.0.4324.149
* fix proxy PAC URL option not working (fixes https://github.com/bromite/bromite/issues/908)
* store proxy configuration in LocalState instead of Profile (thanks to @uazo)
* fix toggle for reversing the meaning of bypass rules (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/884)
* do not permit user-installed certificates
# 88.0.4324.141
* fix bookmarks not opening (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/891)
* fix proxy page not loading (fixes https://github.com/bromite/bromite/issues/890)
# 88.0.4324.95
* fix broken recent tabs behaviour (fixes https://github.com/bromite/bromite/issues/886)
* re-introduce flags for number of raster threads (fixes https://github.com/bromite/bromite/issues/875)
* avoid initializing histogram data for the WebView (https://github.com/bromite/bromite/issues/873)
* dropped patch for manifest changes for Q/R (already present upstream)
* fix check for HTML extension in bookmark import dialog
# 87.0.4280.131
* enable all network isolation features (fixes https://github.com/bromite/bromite/issues/836)
* disable unified autoplay feature (fixes https://github.com/bromite/bromite/issues/804)
# 87.0.4280.106
* enable SplitCacheByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/836)
* fix random timezone option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/828)
* disable autofill server communication by default
* ask permission to play protected media by default
* disable SystemWebView variations support
# 87.0.4280.81
* fix text fragment not disabled by default, unexpire flag (fixes https://github.com/bromite/bromite/issues/803)
* turn AImageReader off by default on ARM64 (fixes https://github.com/bromite/bromite/issues/814)
* fix issue with global autoplay settings (thanks to @uazo, https://github.com/bromite/bromite/pull/825)
* fix issues with user agent customization (thanks to @uazo, https://github.com/bromite/bromite/pull/823)
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/821)
# 87.0.4280.68
* user agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/798)
* fix for intent handling for local apps on Android 11 (https://github.com/bromite/bromite/pull/816)
# 87.0.4280.67
# 86.0.4240.194
* fix native pages displaying incorrectly with the sticky desktop mode (thanks to @uazo)
* re-introduce simplified NTP (fixes https://github.com/bromite/bromite/issues/701)
* re-introduce site settings to block autoplay (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/791)
* fix Omnibox flag not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/789)
# 86.0.4240.181
* allow sticky desktop mode for all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/780)
# 86.0.4240.112
* fix crash in new overflow menu (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/771)
# 86.0.4240.99
# 86.0.4240.92
* upstream fix for video playback audio issue (fixes https://github.com/bromite/bromite/issues/755)
* fix order of entries in privacy settings (fixes https://github.com/bromite/bromite/issues/758)
# 86.0.4240.73
* re-introduce ARM64 AImageReader mitigations (fixes https://github.com/bromite/bromite/issues/766)
* re-introduce menu items for autocomplete, autofill assistant and contextual search (fixes https://github.com/bromite/bromite/issues/763)
# 86.0.4240.70
* fixed crash on unused menu item tap (fixes https://github.com/bromite/bromite/issues/760)
* fixed issue on new installations without DoH configuration (fixes https://github.com/bromite/bromite/issues/761)
# 86.0.4240.66
* switch to upstream UI for DoH URL customization
* remove weblayer dependency on Play Services
* build fixes for password service
* removed obsolete patch to kill Translate
* removed patch to revert unified consent code
* removed patch for dav1d library
* removed patch for improved cookie controls defaults
* removed patches for ARM64 AImageReader issues
# 85.0.4183.114
# 85.0.4183.110
* hardening against incognito mode detection
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/734)
# 85.0.4183.94
* disable the DIAL repeating discovery
* removed patch for session-only cookies support
* add timezone customization patch (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/331)
* fixed bug happening when configuring proxies in incognito mode (thanks to @uazo)
# 85.0.4183.86
* fix LocationBarPhone app crash at startup (fixes https://github.com/bromite/bromite/issues/565)
# 85.0.4183.84
* fix crash in About page (fixes https://github.com/bromite/bromite/issues/710)
* fix adding more than one proxy (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/679)
* fix system proxy configuration (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/377)
# 85.0.4183.82
* fixes bookmark button not working with always-incognito (fixes https://github.com/bromite/bromite/issues/654)
* disable scroll-to-text-fragment
* remove NTP blocklisted URLs when adding an URL as bookmark
* removed duet flags
* unexpire `#darken-websites-checkbox-in-themes-setting` flag
* rollback dav1d upgrade which breaks x86
# 84.0.4147.132
* fix exit menu item not always working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/673)
* session-only cookies site settings option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/142)
* add setting to enable history on incognito mode (thanks to @uazo)
* removed old non-working site settings patches
# 84.0.4147.121
* removed Qwant search engine
* fixed zh_CN translations
* added patch to not embed non-free unrar library (fixes https://github.com/bromite/bromite/issues/674)
* enable improved cookie controls by default
# 84.0.4147.119
* update zh_CN translations
* disable CORS RFC1918 (fixes https://github.com/bromite/bromite/issues/664)
* restore duet flags (fixes https://github.com/bromite/bromite/issues/667)
# 84.0.4147.113
* block gateway attacks via websockets (fixes https://github.com/bromite/bromite/issues/590)
* enable prefetch-privacy-changes by default (fixes https://github.com/bromite/bromite/issues/659)
* enable reduced-referrer-granularity by default (fixes https://github.com/bromite/bromite/issues/659)
# 84.0.4147.106
* fixed bug with Javascript site settings not showing
* add exit menu item to overview menu (fixes https://github.com/bromite/bromite/issues/619)
# 84.0.4147.95
* show warnings for TLSv1.0/TLSv1.1 connections (fixes https://github.com/bromite/bromite/issues/645)
* fix bug with unconfigured DoH (fixes https://github.com/bromite/bromite/issues/646)
# 84.0.4147.90
* added menu item to view source of current page
* fixed dialog for SSL/TLS errors (fixes https://github.com/bromite/bromite/issues/638)
* build with feeds support due to upstream build flags combination bugs
# 83.0.4103.119
* restored non-CFI builds for x86
# 83.0.4103.101
* enable HEVC and Dolby Vision
# 83.0.4103.93
* fix undesired replacement for search engines (fixes https://github.com/bromite/bromite/issues/595)
* fix resume flag not visible
# 83.0.4103.76
* fixed inverted Omnibox flag
* fixed LocationBarPhone/LocationBarTablet crash (fixes https://github.com/bromite/bromite/issues/565)
# 83.0.4103.53
* updated zh_CN translations
* mitigation for LocationBarPhone crash (https://github.com/bromite/bromite/issues/565)
# 83.0.4103.46
* add zh_CN missing translations (fixes https://github.com/bromite/bromite/issues/546)
* change default mode for WebRTC (fixes https://github.com/bromite/bromite/issues/553)
* add flag to allow screenshots of incognito tabs (fixes https://github.com/bromite/bromite/issues/551)
* reintroduced patches for disabling AImageReader
* fixed DevTools issue with domain substitution (fixes https://github.com/bromite/bromite/issues/526)
* drop patch to disable QUIC by default
* drop patch for DoH minimum timeout (upstream also implemented it)
* dropped patch for removal of support of CCT dynamic modules (upstream also removed it)
* removed upstream patch for SD card not found issue (upstream merged it)
* enable reporting because of COEP
# 81.0.4044.127
* fix always-incognito crashes (https://github.com/bromite/bromite/issues/135 and https://github.com/bromite/bromite/pull/529)
* improved crash uploader mock by calling done callback
# 81.0.4044.106
* remove option to add NTP as homepage (fixes https://github.com/bromite/bromite/issues/517)
# 81.0.4044.97
* disable browser auto-login by default
* show download prompt again
# 81.0.4044.83
# 81.0.4044.76
# 81.0.4044.70
* backport surface control fix (fixes https://github.com/bromite/bromite/issues/445)
# 81.0.4044.63
* use upstream fix for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
* do not compile QR code sharing
* remove obsolete patch for GCM experiment status
* drop 2 patches for AImageReader crash fix (upstream has the same revert patches)
# 80.0.3987.118
* disable AImageReader for all ARM64 devices (fixes https://github.com/bromite/bromite/issues/497)
* use upstream possible workaround for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
# 80.0.3987.109
* restored GPU workaround for the ARM/ARM64 AImageReader crash (https://github.com/bromite/bromite/issues/445)
# 80.0.3987.95
* enable user-agent freeze (fixes https://github.com/bromite/bromite/issues/483)
* fix issue with AMP (fixes https://github.com/bromite/bromite/issues/488)
* fix crash on home page (fixes https://github.com/bromite/bromite/issues/484)
# 80.0.3987.78
* removed ungoogled-chromium patch for non-remote developer tools resources
* removed patch for 64-bit webview (it is now a default from upstream)
* removed patch for enabling dark mode menu entry by default (it is now a default from upstream)
* removed patch for enabling download rename by default (it is now a default from upstream)
* removed some redundant Iridium safe browsing patches
# 79.0.3945.139
* remove patch to automatically disable video decoding acceleration on Android 10+ and arm64
* fix referral headers bug in non-DoH requests (fixes https://github.com/bromite/bromite/issues/470)
* disable smart selection by default, enable web search in incognito mode
* disable DRM media pre-provisioning (fixes https://github.com/bromite/bromite/issues/471)
# 79.0.3945.123
* updated User-agent version
* increase minimum DoH timeout to 400ms (fixes https://github.com/bromite/bromite/issues/437)
# 79.0.3945.111
* automatically disable video decoding acceleration on Android 10+ and arm64
* restore enable-horizontal-tab-switcher flag
* remove non-working contextual search settings
* disable QUIC by default
* remove logging for DoH timeouts
# 79.0.3945.107
* always show cookies, javascript and ads site settings (fixes https://github.com/bromite/bromite/issues/133)
* remove global ads and javascript menu options
# 79.0.3945.100
* log timeout values for DoH
* enable DFM (fixes https://github.com/bromite/bromite/issues/441)
* updated User-agent version
# 79.0.3945.94
* removed patches which do not apply anymore (Widevine version punting, always show homepage settings, network errors UMA recording)
* removed split APKs support (Play integration)
* disabled password reuse functionality (Play integration)
* re-introduced minimal headers for DoH
* removed Startpage
* disable feed support
* updated User-agent version
# 78.0.3904.130
* support user-specified subresources filter URL (fixes https://github.com/bromite/bromite/issues/2)
* revert removal of flag for disabling pull-to-refresh effect
* fix crash when entering no DoH URL (fixes https://github.com/bromite/bromite/issues/430)
* added Peter Lowe's Ad and tracking server list (fixes https://github.com/bromite/bromite/issues/423)
* enabled dav1d_decoder
# 78.0.3904.119
* replace fixed DNS-over-HTTPS feature flag with user-customizable option
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/424)
# 78.0.3904.105
* add flag to disable WebGL (fixes https://github.com/bromite/bromite/issues/411)
* more selective AMP sanitization (fixes https://github.com/bromite/bromite/issues/410)
* build optimizations to disable debug information
# 78.0.3904.93
* introduce flags to disable browser fingerprinting capabilities (fixes https://github.com/bromite/bromite/issues/402)
* major enhancements to AMP sanitization for news/images
* remove duplicate network predictions privacy setting
* disable some signed exchanges features
* ungoogled-chromium-android: patches to block all GCM/GMS/PlayServices integrations
* ungoogled-chromium: block all connection requests to substituted domains
* disable GVR services build flag
* disable HEAD requests for single words typed and clicked in Omnibar
* increase number of autocomplete matches from 5 to 10
* replace DoH probe domain with RIPE domain
* merged fixes for adblock/javascript menu text (https://github.com/bromite/bromite/pull/398)
* updated User-agent phone model and version
# 78.0.3904.72
* updated User-agent phone model and version
* fix network predictions bug (fixes https://github.com/bromite/bromite/issues/387)
* fix crash in settings (fixes https://github.com/bromite/bromite/issues/388)
# 78.0.3904.63
* replace Beta DoH service URL for Google (https://developers.google.com/speed/public-dns/docs/doh/migration)
* disable AImageReaderMediaPlayer until upstream bug is fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=977583)
* disabled face detection provider
* removed non-working SystemWebView adblock patch (not working since v77)
* bring back some privacy options which upstream moved to Sync settings (fixes https://github.com/bromite/bromite/issues/383)
# 77.0.3865.104
* revert upstream commit for search privacy options and related translations removal (fixes https://github.com/bromite/bromite/issues/375)
* remove unused patch for enabling subresource filter on all sites
# 77.0.3865.95
# 77.0.3865.81
* use native subresource filtering instead of Bromite engine
* introduce Bromite AdBlockUpdate service
* keep using Bromite engine for SystemWebView
* enable subresource filter for all sites
* disable subresource filter popup
* enable IPv6 probing by default
* drop DnsTransaction default security level patch
* drop patch to visualize all type of extensions
* drop patches for Network Service
* enable CFI for all architectures except x86
# 76.0.3809.129
* disable CFI to fix x86 crashes (fixes https://github.com/bromite/bromite/issues/357)
# 76.0.3809.115
* disable search-ready omnibox by default
* disable unified consent
# 76.0.3809.100
* use default feature flags for autofill (fixes https://github.com/bromite/bromite/issues/348)
# 76.0.3809.91
# 76.0.3809.85
* add flag to toggle Network Service
* disable Network Service by default
* do not record UMA for network errors
* use fixed User Agent and Android OS version
* dropped patch for history requirement of user gesture
# 75.0.3770.139
* disable media router and remoting by default (fixes https://github.com/bromite/bromite/issues/281)
* enable CFI in GN build flags
# 75.0.3770.132
# 75.0.3770.109
* disable payment support by default
* disable background sync by default
* better patch from GrapheneOS/Vanadium for disabling sensors access (fixes https://github.com/bromite/bromite/issues/319)
* use new patch for content settings sensors allow/block (fixes https://github.com/bromite/bromite/issues/319)
* fix impossible values in Battery Status API (fixes https://github.com/bromite/bromite/issues/322)
# 75.0.3770.86
# 75.0.3770.82
# 75.0.3770.70
* enable changing default downloads storage location by default
* enable download rename option by default
* disable offline pages in the downloads home to be opened in CCT by default
* increase minimum SDK from 17 to 19 (fixes https://github.com/bromite/bromite/issues/310)
* prefs: disable SigninAllowed by default
* prefs: always prompt for download directory by default
* build: remove calling untrusted hooks
# 75.0.3770.53
* fix crash when downloading or from browser-initiated requests (fixes https://github.com/bromite/bromite/issues/309)
# 75.0.3770.50
* disable dynamic module loading
* more fixes to allow building for SDK 17
# 74.0.3729.162
* remove recent tabs signin
# 74.0.3729.154
# 74.0.3729.141
# 74.0.3729.122
* remove more unnecessary permissions
# 74.0.3729.106
* remove account/sync menu entries (fixes https://github.com/bromite/bromite/issues/285)
* fix failed debug builds
# 74.0.3729.86
* enable dark mode settings entry by default
* fix permission request for Play services on reboot (fixes https://github.com/bromite/bromite/issues/281)
# 74.0.3729.80
* increase minimum SDK version to 17 (Jelly Bean 4.2)
* dropped obsolete patch for hyperlink auditing disable
# 73.0.3683.107
* dropped patch to disable smooth scrolling
* fixed custom tab intents issue (fixes https://github.com/bromite/bromite/issues/279)
# 73.0.3683.105
* removed Fanboy's Annoyance List and Peter Lowe's adservers list from filters
# 73.0.3683.97
* dropped redundant patch to hide NTP tiles (use home page + about:blank)
# 73.0.3683.88
* add option to use home page as NTP
# 73.0.3683.82
* remove force home page button flag
* enable site per process isolation for devices with memory > 1GB
* use 64-bit processes for SystemWebView
* disable local field trials seed (redundant)
* fix patch for classic new tab page (redundant)
# 73.0.3683.79
* add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
* DoH: include upstream patch for DNS secure mode
* DoH: enable DNS secure mode by default
# 73.0.3683.70
# 73.0.3683.61
* drop patches with functionality now available from upstream (DuckDuckGo and Qwant search engines, TLS 1.3 final)
* add only DuckDuckGo Lite search engine
* provide image URL for Qwant
* disable safe browsing subresource filter by default
* fix PAC URL support in proxy configuration
# 72.0.3626.120
* add support for resource type in adblock engine (fixes https://github.com/bromite/bromite/issues/115)
* adblock engine speed optimizations
* use adblock engine also in SystemWebView
* add back uBlock Origin and EasyList filters
* added Fanboy's Annoyance List
* remove AdGuard filters
# 72.0.3626.119
* use AdGuard filters
* fixes for new tile rows usage
* re-introduce patch to hide NTP tiles
* disable NTP tile metrics collection
# 72.0.3626.114
* use 4 tile rows instead of 2 in the new tab page
* do not grant geolocation permission to default search engine (fixes https://github.com/bromite/bromite/issues/250)
# 72.0.3626.108
# 72.0.3626.99
# 72.0.3626.87
* update bookmarks view after import
# 72.0.3626.81
* serve empty content for blocked scripts/images (fixes https://github.com/bromite/bromite/issues/238)
* keep support of Jelly Bean (workaround for upstream https://bugs.chromium.org/p/chromium/issues/detail?id=923477)
# 72.0.3626.73
# 72.0.3626.68
* do not ignore save prompt for users without SD card (workaround for upstream wontfix https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
* remove third_party/analytics patch (now fixed upstream in https://chromium.googlesource.com/chromium/src.git/+/64d6a56f094efbab83802c07ad3ddffa014f9903)
+91
View File
@@ -0,0 +1,91 @@
# 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 sites 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
+169 -77
View File
@@ -1,14 +1,22 @@
# 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>
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
Bromite is only available for Android Marshmallow (v6.0, API level 23) and above.
Bromite is [Chromium](https://www.chromium.org/Home) plus some patches for ad blocking and enhanced privacy.
<img src="https://fdroid.bromite.org/fdroid/bromite_bromite_gh_downloads.svg" alt="Downloads on Github" title="Downloads on Github" />
Bromite is only available for Android v4.1 and above.
For the Frequently Asked Questions see [F.A.Q.](./FAQ.md).
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" />
For documentation see the [wiki](https://github.com/bromite/bromite/wiki).
# Goals
@@ -19,92 +27,157 @@ Minimal UI changes are applied to help curbing the idea of "browser as an advert
Please donate to support development of Bromite and the costs for the build system.
Support development with a donation of 3 EUR: [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
[&rarr; Support development with a donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2): [![paypal](https://www.bromite.org/assets/img/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
Support development with a free amount donation: [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC7Q6A3UAQPY8)
<a href="bitcoin:bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw">BTC donations address</a>: `bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw`
<a href="bitcoin:3MkC3idL61npQSCxL1gceksmRTkNkiCPcG">BTC donations address</a>: `3MkC3idL61npQSCxL1gceksmRTkNkiCPcG`
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
# F.A.Q.
## 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.
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
## 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.
## How to enable DNS-over-HTTPS?
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
## Can you add dark mode/some cool themes?
No.
Bromite is about privacy and adblocking.
## 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 unlikely 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?
Yes, since version 69. While the desktop version of Chromium has an option to disable it (video/audio site settings), the Android version cannot.
ETH donations address: `0x5d392F8FBf3465afe05B1Adc575e248D33B891F6`
# Features
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
* 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 via Google, Cloudflare, Quad9 and AdGuard servers
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
* chrome flags to disable custom intents and clear session on exit
* DNS-over-HTTPS support with any valid IETF DoH endpoint
* always-incognito mode
* completely removed safe browsing and other privacy-unfriendly features
* anti-fingerprinting mitigations for canvas, audio, client rects, webGL and sensor APIs
* use fixed User-Agent to conceal real model and browser version
* 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
* AV1 codec support
* 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
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
### 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 select the one apt for your device (or none otherwise).
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 versions 16 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
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
@@ -117,8 +190,6 @@ arm64_ChromePublic.apk: OK
arm64_ChromeModernPublic.apk: OK
```
If you prefer an UI-based tool, you might want to look into [GtkHash](https://github.com/tristanheaven/gtkhash).
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
@@ -129,28 +200,49 @@ 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).
**NOTE:** releases before v68 did not have published signed hashes files.
# 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 GN args used to build Bromite are available here: [GN_ARGS](./build/GN_ARGS).
The patches are to be applied second the order specified in the `patches_list.txt` file (you can use `git am`); the big file `adblock_entries.h` (containing all the AdBlock filters) needs to be copied under `src/net/url_request/`.
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`).
## 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/browser-android-tabs) for some patches
* nochromo for the original adblock patch
* [AdBlock Plus](https://adblockplus.org/), [uBlock Origin](https://github.com/uBlockOrigin), [Peter Lowe's adservers list](https://pgl.yoyo.org/adservers/), [EasyList and EasyPrivacy](https://easylist.to/) for the filters included
* [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).
-30
View File
@@ -1,30 +0,0 @@
android_channel="stable"
blink_symbol_level=1
dcheck_always_on=false
debuggable_apks=false
enable_ac3_eac3_audio_demuxing=true enable_hevc_demuxing=true enable_iterator_debugging=false
enable_hangout_services_extension=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true ffmpeg_branding="Chrome" proprietary_codecs=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_remoting=false
enable_reporting=false
enable_resource_whitelist_generation=false
enable_vr=false
fieldtrial_testing_like_official_build=true
is_component_build=false
is_debug=false
is_official_build=true
jumbo_file_merge_limit=60
safe_browsing_mode=0
strip_absolute_paths_from_debug_symbols=true
strip_debug_info=false
symbol_level=1
target_os="android"
use_debug_fission=true
use_errorprone_java_compiler=false
use_jumbo_build=false
use_official_google_api_keys=false
use_openh264=true chrome_pgo_phase=0 full_wpo_on_official=true
use_sysroot=false
+1
View File
@@ -0,0 +1 @@
f62e5bffd9c2c0b8c221851fa8a032f02f105141-
+1
View File
@@ -0,0 +1 @@
105.0.5195.147
+1
View File
@@ -0,0 +1 @@
5c842aa7b24e6252ccabc8bcac8dafa4fe8ad9cd
+47
View File
@@ -0,0 +1,47 @@
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_sysroot=false
webview_includes_weblayer=false
+208
View File
@@ -0,0 +1,208 @@
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
AV1-codec-support.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-safe-browsing.patch
Disable-all-promo-dialogs.patch
Remove-signin-and-sync-integrations.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
Move-some-account-settings-back-to-privacy-settings.patch
Remove-contextual-search-manager.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
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
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-AdBlockUpdaterService.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
Enable-user-agent-freeze-by-default.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
Timezone-customization.patch
Restore-Simplified-NTP-launch.patch
Add-option-to-use-home-page-as-NTP.patch
Revert-the-removal-of-an-option-to-block-autoplay.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
Ask-user-before-closing-all-tabs.patch
Add-option-to-force-tablet-UI.patch
Make-all-favicon-requests-on-demand.patch
Add-Alt-D-hotkey-to-focus-address-bar.patch
Remove-offline-measurement-background-task.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
Enable-IntentBlockExternalFormRedirectsNoGesture.patch
Add-flag-to-disable-external-intent-requests.patch
Logcat-crash-reports-UI.patch
Add-support-for-ISupportHelpAndFeedback.patch
JIT-site-settings.patch
API-level-21-prevent-crash-on-download.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
Enable-share-intent.patch
Site-setting-for-images.patch
Bromite-auto-updater.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
Partition-DNS-requests-by-top-frame-NIK.patch
Remove-mremap-from-seccomp-baseline-policy.patch
Move-navigation-bar-to-bottom.patch
Welcome-screen.patch
Content-settings-infrastructure.patch
Add-webGL-site-setting.patch
Add-site-engagement-flag.patch
Add-webRTC-site-settings.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
Re-introduce-modal-dialog-flag-to-close-all-tabs.patch
sharing-hub-always-use-visible-URL.patch
Re-introduce-kWebAuthCable.patch
Add-new-cache-check-function.patch
Stop-cross-origin-cache-hits.patch
Revert-clipboard-user-gesture-requirement-removal.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
Automated-domain-substitution.patch
+47
View File
@@ -0,0 +1,47 @@
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_sysroot=false
webview_includes_weblayer=false
+11
View File
@@ -0,0 +1,11 @@
AV1-codec-support.patch
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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,257 @@
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 | 4 ++++
media/base/media_switches.h | 1 +
12 files changed, 65 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
@@ -2392,9 +2392,9 @@
"expiry_milestone": 106
},
{
- "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
@@ -63,6 +63,11 @@ const 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 extern const base::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 extern const base::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
@@ -122,6 +122,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;
@@ -345,6 +348,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_h264_encode
disable_accelerated_hevc_decode
disable_accelerated_vp8_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
@@ -589,6 +589,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
@@ -756,6 +756,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
// Note: Has no effect if kMediaDrmPreprovisioning feature is disabled.
const base::Feature kMediaDrmPreprovisioningAtStartup{
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// Enable picture in picture web api for android.
const base::Feature kPictureInPictureAPI{"PictureInPictureAPI",
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
@@ -233,6 +233,7 @@ MEDIA_EXPORT extern const base::Feature kForceHardwareAudioDecoders;
MEDIA_EXPORT extern const base::Feature kAllowNonSecureOverlays;
MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
--
2.25.1
@@ -0,0 +1,47 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 16:53:48 +0200
Subject: API level 21: prevent crash on download
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
This patch ignores boolean settings for them and prevents the crash.
See also: https://github.com/bromite/bromite/issues/1184
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../BundleToPersistableBundleConverter.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -4,6 +4,7 @@
package org.chromium.components.background_task_scheduler.internal;
+import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
@@ -82,9 +83,17 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);
} else if (obj instanceof Boolean) {
- persistableBundle.putBoolean(key, (Boolean) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBoolean(key, (Boolean) obj);
+ }
} else if (obj instanceof boolean[]) {
- persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ }
} else if (obj instanceof Double) {
persistableBundle.putDouble(key, (Double) obj);
} else if (obj instanceof double[]) {
--
2.25.1
+36 -236
View File
@@ -4,80 +4,49 @@ Subject: AV1 codec support
libaom build fixes (requires -fPIC)
Report AV1 as playable on Android
---
media/base/mime_util_internal.cc | 6 +++++-
third_party/libaom/BUILD.gn | 6 ++++--
third_party/libaom/libaom_srcs.gni | 5 +++++
.../source/config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
.../source/config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
.../libaom/source/config/linux/arm-neon/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
third_party/libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/arm/config/aom_config.h | 2 +-
third_party/libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
.../libaom/source/config/linux/generic/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/generic/config/aom_config.h | 2 +-
third_party/libaom/source/config/linux/ia32/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/ia32/config/aom_config.h | 2 +-
third_party/libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
third_party/libaom/source/config/linux/x64/config/aom_config.h | 2 +-
17 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc
--- a/media/base/mime_util_internal.cc
+++ b/media/base/mime_util_internal.cc
@@ -548,9 +548,13 @@ bool MimeUtil::IsCodecSupportedOnAndroid(
case THEORA:
return false;
- // AV1 is not supported on Android yet.
+ // AV1 is supported on Android.
case AV1:
+#if BUILDFLAG(ENABLE_AV1_DECODER)
+ return true;
+#else
return false;
+#endif
// ----------------------------------------------------------------------
// The remaining codecs may be supported depending on platform abilities.
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
third_party/libaom/BUILD.gn | 6 ++++--
third_party/libaom/libaom_srcs.gni | 5 +++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
--- a/third_party/libaom/BUILD.gn
+++ b/third_party/libaom/BUILD.gn
@@ -74,7 +74,7 @@ if (enable_av1_decoder) {
sources = aom_dsp_common_asm_sse2
sources += aom_dsp_common_asm_ssse3
sources += aom_ports_asm_x86
- defines = [ "CHROMIUM" ]
+ defines = [ "CHROMIUM", "PIC" ]
include_dirs = libaom_include_dirs
@@ -81,7 +81,7 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
sources += aom_dsp_encoder_asm_sse2_x86_64
sources += aom_dsp_encoder_asm_ssse3_x86_64
}
- defines = [ "CHROMIUM" ]
+ defines = [ "CHROMIUM", "PIC" ]
include_dirs = libaom_include_dirs
}
@@ -158,7 +158,7 @@ if (enable_av1_decoder) {
configs += [ "//build/config/compiler:no_chromium_code" ]
if (current_cpu == "arm") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
- cflags = [ "-mfpu=neon" ]
+ cflags = [ "-mfpu=neon", "-fPIC" ]
}
configs += [ ":libaom_config" ]
sources = aom_av1_common_intrin_neon
@@ -198,6 +198,8 @@ if (enable_av1_decoder) {
if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
cpu_arch_full == "arm-neon-cpu-detect") {
deps += [ ":libaom_intrinsics_neon" ]
+ # will detect CPU
+ sources += aom_ports_arm_sources
@@ -193,7 +193,7 @@ if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
configs += [ "//build/config/compiler:no_chromium_code" ]
if (current_cpu == "arm") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
- cflags = [ "-mfpu=neon" ]
+ cflags = [ "-mfpu=neon", "-fPIC" ]
}
if (is_android) {
deps += [ "//third_party/android_tools:cpu_features" ]
configs += [ ":libaom_config" ]
@@ -255,6 +255,8 @@ static_library("libaom") {
if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
cpu_arch_full == "arm-neon-cpu-detect") {
deps += [ ":libaom_intrinsics_neon" ]
+ # will detect CPU
+ sources += aom_ports_arm_sources
}
if (is_android) {
deps += [ "//third_party/android_ndk:cpu_features" ]
diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
--- a/third_party/libaom/libaom_srcs.gni
+++ b/third_party/libaom/libaom_srcs.gni
@@ -479,6 +479,11 @@ aom_mem_sources = [
aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/emms.asm" ]
@@ -666,6 +666,11 @@ aom_rc_interface_sources = [
"//third_party/libaom/source/libaom/test/yuv_video_source.h",
]
+aom_ports_arm_sources = [
+ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
@@ -85,176 +54,7 @@ diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs
+ ]
+
aom_rtcd_sources = [
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd_defs.pl",
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_ONE_PASS_SVM equ 0
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REDUCED_ENCODER_BORDER equ 0
CONFIG_RUNTIME_CPU_DETECT equ 1
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 1
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_ONE_PASS_SVM equ 0
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REDUCED_ENCODER_BORDER equ 0
CONFIG_RUNTIME_CPU_DETECT equ 0
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 0
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_ONE_PASS_SVM equ 0
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REDUCED_ENCODER_BORDER equ 0
CONFIG_RUNTIME_CPU_DETECT equ 0
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 0
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_ONE_PASS_SVM equ 0
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REDUCED_ENCODER_BORDER equ 0
CONFIG_RUNTIME_CPU_DETECT equ 0
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 0
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_ONE_PASS_SVM equ 0
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REDUCED_ENCODER_BORDER equ 0
CONFIG_RUNTIME_CPU_DETECT equ 1
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 1
diff --git a/third_party/libaom/source/config/linux/ia32/config/aom_config.asm b/third_party/libaom/source/config/linux/ia32/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/ia32/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/ia32/config/aom_config.asm
@@ -35,7 +35,7 @@
%define CONFIG_NORMAL_TILE_MODE 1
%define CONFIG_ONE_PASS_SVM 0
%define CONFIG_OS_SUPPORT 1
-%define CONFIG_PIC 0
+%define CONFIG_PIC 1
%define CONFIG_RD_DEBUG 0
%define CONFIG_REDUCED_ENCODER_BORDER 0
%define CONFIG_RUNTIME_CPU_DETECT 1
diff --git a/third_party/libaom/source/config/linux/ia32/config/aom_config.h b/third_party/libaom/source/config/linux/ia32/config/aom_config.h
--- a/third_party/libaom/source/config/linux/ia32/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/ia32/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 1
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
@@ -35,7 +35,7 @@
%define CONFIG_NORMAL_TILE_MODE 1
%define CONFIG_ONE_PASS_SVM 0
%define CONFIG_OS_SUPPORT 1
-%define CONFIG_PIC 0
+%define CONFIG_PIC 1
%define CONFIG_RD_DEBUG 0
%define CONFIG_REDUCED_ENCODER_BORDER 0
%define CONFIG_RUNTIME_CPU_DETECT 1
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
@@ -47,7 +47,7 @@
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_ONE_PASS_SVM 0
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REDUCED_ENCODER_BORDER 0
#define CONFIG_RUNTIME_CPU_DETECT 1
--
2.11.0
"//third_party/libaom/source/libaom/aom_scale/aom_scale_rtcd.c",
--
2.25.1
@@ -0,0 +1,181 @@
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 +++
.../chrome/browser/app/flags/ChromeCachedFlags.java | 1 +
chrome/browser/about_flags.cc | 6 +++++-
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
chrome/browser/flags/android/chrome_feature_list.cc | 4 ++++
chrome/browser/flags/android/chrome_feature_list.h | 1 +
.../chromium/chrome/browser/flags/CachedFeatureFlags.java | 1 +
.../chromium/chrome/browser/flags/ChromeFeatureList.java | 3 +++
net/android/java/src/org/chromium/net/X509Util.java | 5 +++++
10 files changed, 31 insertions(+), 1 deletion(-)
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
@@ -222,6 +222,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;
@@ -939,6 +940,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
@@ -74,6 +74,7 @@ public class ChromeCachedFlags {
add(ChromeFeatureList.sAndroidAuxiliarySearch);
add(ChromeFeatureList.sAnonymousUpdateChecks);
add(ChromeFeatureList.sAppMenuMobileSiteOption);
+ add(ChromeFeatureList.sAllowUserCertificates);
add(ChromeFeatureList.sBackGestureRefactorAndroid);
add(ChromeFeatureList.sCctIncognito);
add(ChromeFeatureList.sCctIncognitoAvailableToThirdParty);
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
@@ -3419,7 +3419,11 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-container-queries", flag_descriptions::kCSSContainerQueriesName,
flag_descriptions::kCSSContainerQueriesDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kCSSContainerQueries)},
-#if BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(IS_ANDROID) // Bromite allow user certificates
+ {"allow-user-certificates",
+ flag_descriptions::kAllowUserCertificatesName,
+ flag_descriptions::kAllowUserCertificatesDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(chrome::android::kAllowUserCertificates)},
{"explore-sites", flag_descriptions::kExploreSitesName,
flag_descriptions::kExploreSitesDescription, kOsAndroid,
FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kExploreSites,
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
@@ -39,6 +39,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
@@ -145,6 +145,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&feed::kFeedInteractiveRefresh,
&feed::kFeedLoadingPlaceholder,
&feed::kInterestFeedContentSuggestions,
+ &kAllowUserCertificates,
&feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
&feed::kInterestFeedV2,
&feed::kInterestFeedV2Autoplay,
@@ -438,6 +439,9 @@ const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2{
"AdaptiveButtonInTopToolbarCustomizationV2",
base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kAllowUserCertificates = {
+ "AllowUserCertificates", base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kAddToHomescreenIPH{"AddToHomescreenIPH",
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
@@ -12,6 +12,7 @@
namespace chrome {
namespace android {
+extern const base::Feature kAllowUserCertificates;
// Alphabetical:
extern const base::Feature kAdaptiveButtonInTopToolbar;
extern const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -50,6 +50,7 @@ public class CachedFeatureFlags {
ImmutableMap.<String, Boolean>builder()
.put(ChromeFeatureList.ANONYMOUS_UPDATE_CHECKS, true)
.put(ChromeFeatureList.APP_MENU_MOBILE_SITE_OPTION, false)
+ .put(ChromeFeatureList.ALLOW_USER_CERTIFICATES, false)
.put(ChromeFeatureList.BACK_GESTURE_REFACTOR, false)
.put(ChromeFeatureList.CCT_INCOGNITO, true)
.put(ChromeFeatureList.CCT_INCOGNITO_AVAILABLE_TO_THIRD_PARTY, false)
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
@@ -193,6 +193,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 =
@@ -600,6 +601,8 @@ public abstract class ChromeFeatureList {
public static final String FEED_ABLATION = "FeedAblation";
/* 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
@@ -41,7 +41,7 @@ const PrepopulatedEngine* const engines_AE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -50,7 +50,7 @@ const PrepopulatedEngine* const engines_AL[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -59,7 +59,7 @@ const PrepopulatedEngine* const engines_AR[] = {
&googleen, &google,
&bing,
&yahoo_ar,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -67,7 +67,7 @@ const PrepopulatedEngine* const engines_AR[] = {
const PrepopulatedEngine* const engines_AT[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_at,
&ecosia,
};
@@ -77,7 +77,7 @@ const PrepopulatedEngine* const engines_AU[] = {
&googleen, &google,
&bing,
&yahoo_au,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -86,7 +86,7 @@ const PrepopulatedEngine* const engines_BA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -96,7 +96,7 @@ const PrepopulatedEngine* const engines_BE[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Bulgaria
@@ -104,7 +104,7 @@ const PrepopulatedEngine* const engines_BG[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -113,7 +113,7 @@ const PrepopulatedEngine* const engines_BH[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -122,7 +122,7 @@ const PrepopulatedEngine* const engines_BI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -131,7 +131,7 @@ const PrepopulatedEngine* const engines_BN[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -140,7 +140,7 @@ const PrepopulatedEngine* const engines_BO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -149,7 +149,7 @@ const PrepopulatedEngine* const engines_BR[] = {
&googleen, &google,
&bing,
&yahoo_br,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -159,7 +159,7 @@ const PrepopulatedEngine* const engines_BY[] = {
&yandex_by,
&mail_ru,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Belize
@@ -167,7 +167,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -176,7 +176,7 @@ const PrepopulatedEngine* const engines_CA[] = {
&googleen, &google,
&bing,
&yahoo_ca,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -184,7 +184,7 @@ const PrepopulatedEngine* const engines_CA[] = {
const PrepopulatedEngine* const engines_CH[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
&yahoo_ch,
};
@@ -194,7 +194,7 @@ const PrepopulatedEngine* const engines_CL[] = {
&googleen, &google,
&bing,
&yahoo_cl,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -213,7 +213,7 @@ const PrepopulatedEngine* const engines_CO[] = {
&bing,
&yahoo_co,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Costa Rica
@@ -221,7 +221,7 @@ const PrepopulatedEngine* const engines_CR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -231,7 +231,7 @@ const PrepopulatedEngine* const engines_CZ[] = {
&seznam_cz,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Germany
@@ -239,7 +239,7 @@ const PrepopulatedEngine* const engines_DE[] = {
&googleen, &google,
&bing,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_de,
};
@@ -248,7 +248,7 @@ const PrepopulatedEngine* const engines_DK[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -257,7 +257,7 @@ const PrepopulatedEngine* const engines_DO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -267,7 +267,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
&bing,
&yahoo_fr,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Ecuador
@@ -276,7 +276,7 @@ const PrepopulatedEngine* const engines_EC[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Estonia
@@ -284,7 +284,7 @@ const PrepopulatedEngine* const engines_EE[] = {
&googleen, &google,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
};
@@ -294,7 +294,7 @@ const PrepopulatedEngine* const engines_EG[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Spain
@@ -302,7 +302,7 @@ const PrepopulatedEngine* const engines_ES[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -311,7 +311,7 @@ const PrepopulatedEngine* const engines_FI[] = {
&googleen, &google,
&bing,
&yahoo_fi,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -320,7 +320,7 @@ const PrepopulatedEngine* const engines_FO[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -338,7 +338,7 @@ const PrepopulatedEngine* const engines_GB[] = {
&googleen, &google,
&bing,
&yahoo_uk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -347,7 +347,7 @@ const PrepopulatedEngine* const engines_GR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -356,7 +356,7 @@ const PrepopulatedEngine* const engines_GT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -366,7 +366,7 @@ const PrepopulatedEngine* const engines_HK[] = {
&yahoo_hk,
&bing,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Honduras
@@ -374,7 +374,7 @@ const PrepopulatedEngine* const engines_HN[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -383,7 +383,7 @@ const PrepopulatedEngine* const engines_HR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -392,7 +392,7 @@ const PrepopulatedEngine* const engines_HU[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -402,7 +402,7 @@ const PrepopulatedEngine* const engines_ID[] = {
&yahoo_id,
&bing,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Ireland
@@ -410,7 +410,7 @@ const PrepopulatedEngine* const engines_IE[] = {
&googleen, &google,
&bing,
&yahoo_uk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -420,7 +420,7 @@ const PrepopulatedEngine* const engines_IL[] = {
&bing,
&yandex_ru,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// India
@@ -428,7 +428,7 @@ const PrepopulatedEngine* const engines_IN[] = {
&googleen, &google,
&bing,
&yahoo_in,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&info_com,
};
@@ -438,7 +438,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
&bing,
&yahoo,
&yandex_tr,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Iran
@@ -447,14 +447,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,
};
@@ -464,7 +464,7 @@ const PrepopulatedEngine* const engines_IT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -473,7 +473,7 @@ const PrepopulatedEngine* const engines_JM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -482,7 +482,7 @@ const PrepopulatedEngine* const engines_JO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -491,7 +491,7 @@ const PrepopulatedEngine* const engines_JP[] = {
&googleen, &google,
&yahoo_jp,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -500,7 +500,7 @@ const PrepopulatedEngine* const engines_KE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -518,7 +518,7 @@ const PrepopulatedEngine* const engines_KW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -528,7 +528,7 @@ const PrepopulatedEngine* const engines_KZ[] = {
&yandex_kz,
&mail_ru,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Lebanon
@@ -536,7 +536,7 @@ const PrepopulatedEngine* const engines_LB[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -544,7 +544,7 @@ const PrepopulatedEngine* const engines_LB[] = {
const PrepopulatedEngine* const engines_LI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -554,7 +554,7 @@ const PrepopulatedEngine* const engines_LT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -562,7 +562,7 @@ const PrepopulatedEngine* const engines_LT[] = {
const PrepopulatedEngine* const engines_LU[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -573,7 +573,7 @@ const PrepopulatedEngine* const engines_LV[] = {
&bing,
&yandex_ru,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Libya
@@ -582,7 +582,7 @@ const PrepopulatedEngine* const engines_LY[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Morocco
@@ -591,14 +591,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,
};
@@ -618,7 +618,7 @@ const PrepopulatedEngine* const engines_ME[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Macedonia
@@ -626,7 +626,7 @@ const PrepopulatedEngine* const engines_MK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -635,7 +635,7 @@ const PrepopulatedEngine* const engines_MX[] = {
&googleen, &google,
&bing,
&yahoo_mx,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -644,7 +644,7 @@ const PrepopulatedEngine* const engines_MY[] = {
&googleen, &google,
&bing,
&yahoo_my,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -653,7 +653,7 @@ const PrepopulatedEngine* const engines_NI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -662,7 +662,7 @@ const PrepopulatedEngine* const engines_NL[] = {
&googleen, &google,
&bing,
&yahoo_nl,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -671,7 +671,7 @@ const PrepopulatedEngine* const engines_NO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -680,7 +680,7 @@ const PrepopulatedEngine* const engines_NZ[] = {
&googleen, &google,
&bing,
&yahoo_nz,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -689,7 +689,7 @@ const PrepopulatedEngine* const engines_OM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&petal_search,
};
@@ -698,7 +698,7 @@ const PrepopulatedEngine* const engines_PA[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -708,7 +708,7 @@ const PrepopulatedEngine* const engines_PE[] = {
&bing,
&yahoo_pe,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Philippines
@@ -717,7 +717,7 @@ const PrepopulatedEngine* const engines_PH[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Pakistan
@@ -725,7 +725,7 @@ const PrepopulatedEngine* const engines_PK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -734,7 +734,7 @@ const PrepopulatedEngine* const engines_PL[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -743,7 +743,7 @@ const PrepopulatedEngine* const engines_PR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -752,7 +752,7 @@ const PrepopulatedEngine* const engines_PT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -761,7 +761,7 @@ const PrepopulatedEngine* const engines_PY[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -770,7 +770,7 @@ const PrepopulatedEngine* const engines_QA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_tr,
};
@@ -779,7 +779,7 @@ const PrepopulatedEngine* const engines_RO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_tr,
};
@@ -788,7 +788,7 @@ const PrepopulatedEngine* const engines_RS[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -798,7 +798,7 @@ const PrepopulatedEngine* const engines_RU[] = {
&yandex_ru,
&mail_ru,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Rwanda
@@ -806,7 +806,7 @@ const PrepopulatedEngine* const engines_RW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -816,7 +816,7 @@ const PrepopulatedEngine* const engines_SA[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Sweden
@@ -824,7 +824,7 @@ const PrepopulatedEngine* const engines_SE[] = {
&googleen, &google,
&bing,
&yahoo_se,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -833,7 +833,7 @@ const PrepopulatedEngine* const engines_SG[] = {
&googleen, &google,
&bing,
&yahoo_sg,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -841,7 +841,7 @@ const PrepopulatedEngine* const engines_SG[] = {
const PrepopulatedEngine* const engines_SI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&yandex_com,
};
@@ -850,7 +850,7 @@ const PrepopulatedEngine* const engines_SI[] = {
const PrepopulatedEngine* const engines_SK[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&yandex_com,
};
@@ -860,7 +860,7 @@ const PrepopulatedEngine* const engines_SV[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -870,7 +870,7 @@ const PrepopulatedEngine* const engines_SY[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Thailand
@@ -887,7 +887,7 @@ const PrepopulatedEngine* const engines_TN[] = {
&googleen, &google,
&bing,
&yahoo_fr,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -897,7 +897,7 @@ const PrepopulatedEngine* const engines_TR[] = {
&yandex_tr,
&yahoo_tr,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Trinidad and Tobago
@@ -905,7 +905,7 @@ const PrepopulatedEngine* const engines_TT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -915,7 +915,7 @@ const PrepopulatedEngine* const engines_TW[] = {
&yahoo_tw,
&bing,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Tanzania
@@ -923,7 +923,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -932,7 +932,7 @@ const PrepopulatedEngine* const engines_UA[] = {
&googleen, &google,
&yandex_ua,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
};
@@ -941,7 +941,7 @@ const PrepopulatedEngine* const engines_US[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -950,7 +950,7 @@ const PrepopulatedEngine* const engines_UY[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -959,7 +959,7 @@ const PrepopulatedEngine* const engines_VE[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -978,7 +978,7 @@ const PrepopulatedEngine* const engines_YE[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// South Africa
@@ -986,7 +986,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -995,7 +995,7 @@ const PrepopulatedEngine* const engines_ZW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
--
2.25.1
@@ -1,715 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 11:06:18 +0200
Subject: Add DuckDuckGo search engine
---
.../search_engines/prepopulated_engines.json | 19 ++
components/search_engines/search_engine_type.h | 2 +
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
3 files changed, 130 insertions(+), 109 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
@@ -38,6 +38,25 @@
// The following engines are included in country lists and are added to the
// list of search engines on the first run depending on user's country.
"elements": {
+ "duckduckgo": {
+ "name": "DuckDuckGo",
+ "keyword": "duckduckgo.com",
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
+ "search_url": "https://duckduckgo.com/?q={searchTerms}",
+ "suggest_url": "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list",
+ "type": "SEARCH_ENGINE_DUCKDUCKGO",
+ "id": 11
+ },
+
+ "duckduckgo_light": {
+ "name": "DuckDuckGo Light",
+ "keyword": "duckduckgo.com/lite",
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
+ "id": 12
+ },
+
"aol": {
"name": "AOL",
"keyword": "aol.com",
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
@@ -63,6 +63,8 @@ enum SearchEngineType {
SEARCH_ENGINE_YANDEX,
SEARCH_ENGINE_ZOZNAM,
SEARCH_ENGINE_360,
+ SEARCH_ENGINE_DUCKDUCKGO,
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
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
@@ -33,548 +33,548 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// United Arab Emirates
const PrepopulatedEngine* const engines_AE[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Albania
const PrepopulatedEngine* const engines_AL[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Argentina
const PrepopulatedEngine* const engines_AR[] = {
- &google, &bing, &yahoo_ar,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
};
// Austria
const PrepopulatedEngine* const engines_AT[] = {
- &google, &bing, &yahoo_at,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
};
// Australia
const PrepopulatedEngine* const engines_AU[] = {
- &google, &bing, &yahoo_au,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
};
// Bosnia and Herzegovina
const PrepopulatedEngine* const engines_BA[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Belgium
const PrepopulatedEngine* const engines_BE[] = {
- &google, &bing, &yahoo, &yahoo_fr,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
};
// Bulgaria
const PrepopulatedEngine* const engines_BG[] = {
- &google, &bing, &ask,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Bahrain
const PrepopulatedEngine* const engines_BH[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Burundi
const PrepopulatedEngine* const engines_BI[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Brunei
const PrepopulatedEngine* const engines_BN[] = {
- &google, &yahoo_my, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Bolivia
const PrepopulatedEngine* const engines_BO[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Brazil
const PrepopulatedEngine* const engines_BR[] = {
- &google, &ask_br, &bing, &yahoo_br,
+ &google, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
};
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &google, &yandex_by, &mail_ru,
+ &google, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
};
// Belize
const PrepopulatedEngine* const engines_BZ[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Canada
const PrepopulatedEngine* const engines_CA[] = {
- &google, &bing, &ask, &yahoo_ca, &yahoo_qc,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
};
// Switzerland
const PrepopulatedEngine* const engines_CH[] = {
- &google, &bing, &yahoo_ch,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
};
// Chile
const PrepopulatedEngine* const engines_CL[] = {
- &google, &bing, &yahoo_cl,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
};
// China
const PrepopulatedEngine* const engines_CN[] = {
- &google, &baidu, &sogou, &so_360,
+ &google, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
};
// Colombia
const PrepopulatedEngine* const engines_CO[] = {
- &google, &bing, &yahoo_co,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
};
// Costa Rica
const PrepopulatedEngine* const engines_CR[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Czech Republic
const PrepopulatedEngine* const engines_CZ[] = {
- &google, &seznam, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &seznam, &bing,
};
// Germany
const PrepopulatedEngine* const engines_DE[] = {
- &google, &bing, &yahoo_de,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Denmark
const PrepopulatedEngine* const engines_DK[] = {
- &google, &bing, &yahoo_dk,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
};
// Dominican Republic
const PrepopulatedEngine* const engines_DO[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Algeria
const PrepopulatedEngine* const engines_DZ[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Ecuador
const PrepopulatedEngine* const engines_EC[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Estonia
const PrepopulatedEngine* const engines_EE[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Egypt
const PrepopulatedEngine* const engines_EG[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Spain
const PrepopulatedEngine* const engines_ES[] = {
- &google, &bing, &yahoo_es,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
};
// Faroe Islands
const PrepopulatedEngine* const engines_FO[] = {
- &google, &bing, &ask,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Finland
const PrepopulatedEngine* const engines_FI[] = {
- &google, &bing, &yahoo_fi,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
};
// France
const PrepopulatedEngine* const engines_FR[] = {
- &google, &bing, &yahoo_fr,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// United Kingdom
const PrepopulatedEngine* const engines_GB[] = {
- &google, &bing, &yahoo_uk, &ask_uk,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
};
// Greece
const PrepopulatedEngine* const engines_GR[] = {
- &google, &bing, &yahoo_gr,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
};
// Guatemala
const PrepopulatedEngine* const engines_GT[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Hong Kong
const PrepopulatedEngine* const engines_HK[] = {
- &google, &yahoo_hk, &baidu, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
};
// Honduras
const PrepopulatedEngine* const engines_HN[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Croatia
const PrepopulatedEngine* const engines_HR[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Hungary
const PrepopulatedEngine* const engines_HU[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Indonesia
const PrepopulatedEngine* const engines_ID[] = {
- &google, &yahoo_id, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
};
// Ireland
const PrepopulatedEngine* const engines_IE[] = {
- &google, &bing, &yahoo_uk,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
};
// Israel
const PrepopulatedEngine* const engines_IL[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// India
const PrepopulatedEngine* const engines_IN[] = {
- &google, &bing, &yahoo_in,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
};
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Iran
const PrepopulatedEngine* const engines_IR[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Iceland
const PrepopulatedEngine* const engines_IS[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Italy
const PrepopulatedEngine* const engines_IT[] = {
- &google, &virgilio, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
};
// Jamaica
const PrepopulatedEngine* const engines_JM[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Jordan
const PrepopulatedEngine* const engines_JO[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Japan
const PrepopulatedEngine* const engines_JP[] = {
- &google, &yahoo_jp, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
};
// Kenya
const PrepopulatedEngine* const engines_KE[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Kuwait
const PrepopulatedEngine* const engines_KW[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// South Korea
const PrepopulatedEngine* const engines_KR[] = {
- &google, &naver, &daum,
+ &google, &duckduckgo, &duckduckgo_light, &naver, &daum,
};
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &google, &mail_ru, &yandex_kz,
+ &google, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
};
// Lebanon
const PrepopulatedEngine* const engines_LB[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Liechtenstein
const PrepopulatedEngine* const engines_LI[] = {
- &google, &bing, &yahoo_de,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Lithuania
const PrepopulatedEngine* const engines_LT[] = {
- &google, &bing, &yandex_ru,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
};
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
- &google, &bing, &yahoo_fr,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// Latvia
const PrepopulatedEngine* const engines_LV[] = {
- &google, &yandex_ru, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
};
// Libya
const PrepopulatedEngine* const engines_LY[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Morocco
const PrepopulatedEngine* const engines_MA[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Monaco
const PrepopulatedEngine* const engines_MC[] = {
- &google, &yahoo_fr, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
};
// Moldova
const PrepopulatedEngine* const engines_MD[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Montenegro
const PrepopulatedEngine* const engines_ME[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Macedonia
const PrepopulatedEngine* const engines_MK[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Mexico
const PrepopulatedEngine* const engines_MX[] = {
- &google, &bing, &yahoo_mx,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
};
// Malaysia
const PrepopulatedEngine* const engines_MY[] = {
- &google, &yahoo_my, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Nicaragua
const PrepopulatedEngine* const engines_NI[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Netherlands
const PrepopulatedEngine* const engines_NL[] = {
- &google, &yahoo_nl, &vinden,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
};
// Norway
const PrepopulatedEngine* const engines_NO[] = {
- &google, &bing, &kvasir,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
};
// New Zealand
const PrepopulatedEngine* const engines_NZ[] = {
- &google, &bing, &yahoo_nz,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
};
// Oman
const PrepopulatedEngine* const engines_OM[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Panama
const PrepopulatedEngine* const engines_PA[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Peru
const PrepopulatedEngine* const engines_PE[] = {
- &google, &bing, &yahoo_pe,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
};
// Philippines
const PrepopulatedEngine* const engines_PH[] = {
- &google, &yahoo_ph, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
};
// Pakistan
const PrepopulatedEngine* const engines_PK[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Puerto Rico
const PrepopulatedEngine* const engines_PR[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Poland
const PrepopulatedEngine* const engines_PL[] = {
- &google, &onet, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &onet, &bing,
};
// Portugal
const PrepopulatedEngine* const engines_PT[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Paraguay
const PrepopulatedEngine* const engines_PY[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Qatar
const PrepopulatedEngine* const engines_QA[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Romania
const PrepopulatedEngine* const engines_RO[] = {
- &google, &yahoo_ro, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
};
// Serbia
const PrepopulatedEngine* const engines_RS[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Russia
const PrepopulatedEngine* const engines_RU[] = {
- &google, &yandex_ru, &mail_ru,
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
};
// Rwanda
const PrepopulatedEngine* const engines_RW[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Saudi Arabia
const PrepopulatedEngine* const engines_SA[] = {
- &google, &yahoo_maktoob, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Sweden
const PrepopulatedEngine* const engines_SE[] = {
- &google, &bing, &yahoo_se,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
};
// Singapore
const PrepopulatedEngine* const engines_SG[] = {
- &google, &yahoo_sg, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
};
// Slovenia
const PrepopulatedEngine* const engines_SI[] = {
- &google, &najdi, &ask,
+ &google, &duckduckgo, &duckduckgo_light, &najdi, &ask,
};
// Slovakia
const PrepopulatedEngine* const engines_SK[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// El Salvador
const PrepopulatedEngine* const engines_SV[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Syria
const PrepopulatedEngine* const engines_SY[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Thailand
const PrepopulatedEngine* const engines_TH[] = {
- &google, &yahoo_th, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
};
// Tunisia
const PrepopulatedEngine* const engines_TN[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &google, &bing, &yahoo_tr, &yandex_tr,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
};
// Trinidad and Tobago
const PrepopulatedEngine* const engines_TT[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Taiwan
const PrepopulatedEngine* const engines_TW[] = {
- &google, &yahoo_tw, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
};
// Tanzania
const PrepopulatedEngine* const engines_TZ[] = {
- &google, &yahoo, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Ukraine
const PrepopulatedEngine* const engines_UA[] = {
- &google, &yandex_ua, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
};
// United States
const PrepopulatedEngine* const engines_US[] = {
- &google, &bing, &yahoo, &aol, &ask,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
};
// Uruguay
const PrepopulatedEngine* const engines_UY[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Venezuela
const PrepopulatedEngine* const engines_VE[] = {
- &google, &bing, &yahoo_ve,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
};
// Vietnam
const PrepopulatedEngine* const engines_VN[] = {
- &google, &yahoo_vn, &bing,
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
};
// Yemen
const PrepopulatedEngine* const engines_YE[] = {
- &google, &bing, &yahoo_maktoob,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// South Africa
const PrepopulatedEngine* const engines_ZA[] = {
- &google, &bing, &yahoo,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Zimbabwe
const PrepopulatedEngine* const engines_ZW[] = {
- &google, &bing, &yahoo, &ask,
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
};
// A list of all the engines that we know about.
const PrepopulatedEngine* const kAllEngines[] = {
// Prepopulated engines:
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &kvasir,
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &duckduckgo, &duckduckgo_light, &kvasir,
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
--
2.11.0
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,97 @@
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 | 3 +++
net/base/features.h | 2 ++
net/url_request/url_request_http_job.cc | 4 ++++
6 files changed, 20 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
@@ -8561,6 +8561,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
@@ -1629,6 +1629,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
@@ -915,6 +915,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
@@ -114,6 +114,9 @@ const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
const base::Feature kEncryptedClientHello{"EncryptedClientHello",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kIsCleartextPermitted{"IsCleartextPermitted",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
const base::Feature kNetworkQualityEstimator{"NetworkQualityEstimator",
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
@@ -33,6 +33,8 @@ NET_EXPORT extern const base::Feature kAvoidH2Reprioritization;
// origin requests are restricted to contain at most the source origin.
NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
+NET_EXPORT extern const base::Feature kIsCleartextPermitted;
+
// Support for altering the parameters used for DNS transaction timeout. See
// ResolveContext::SecureTransactionTimeout().
NET_EXPORT extern const base::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
@@ -211,6 +211,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
-726
View File
@@ -1,726 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 12 Mar 2018 20:31:44 +0100
Subject: Add Qwant search engine
---
.../search_engines/prepopulated_engines.json | 24 ++-
components/search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
3 files changed, 133 insertions(+), 110 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
@@ -32,7 +32,7 @@
// Increment this if you change the data in ways that mean users with
// existing data should get a new version.
- "kCurrentDataVersion": 105
+ "kCurrentDataVersion": 106
},
// The following engines are included in country lists and are added to the
@@ -954,6 +954,28 @@
"id": 6
},
+ "qwant": {
+ "name": "Qwant",
+ "keyword": "qwant.com",
+ "favicon_url": "https://www.qwant.com/favicon.ico",
+ "search_url": "https://www.qwant.com/?client=opensearch&q={searchTerms}",
+ "suggest_url": "https://api.qwant.com/api/suggest/?client=opensearch&q={searchTerms}",
+ "image_url": "https://www.qwant.com/?t=images&q={searchTerms}",
+ "type": "SEARCH_ENGINE_QWANT",
+ "id": 14
+ },
+
+ "qwant": {
+ "name": "Qwant",
+ "keyword": "qwant.com",
+ "favicon_url": "https://www.qwant.com/favicon.ico",
+ "search_url": "https://www.qwant.com/?client=opensearch&q={searchTerms}",
+ "suggest_url": "https://api.qwant.com/api/suggest/?client=opensearch&q={searchTerms}",
+ "image_url": "https://www.qwant.com/?t=images&q={searchTerms}",
+ "type": "SEARCH_ENGINE_QWANT",
+ "id": 14
+ },
+
"rambler": {
"name": "\u0420\u0430\u043c\u0431\u043b\u0435\u0440",
"keyword": "rambler.ru",
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
@@ -67,6 +67,7 @@ enum SearchEngineType {
SEARCH_ENGINE_DUCKDUCKGOLIGHT,
SEARCH_ENGINE_STARTPAGE,
SEARCH_ENGINE_GOOGLE_EN,
+ SEARCH_ENGINE_QWANT,
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
@@ -33,548 +33,548 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// United Arab Emirates
const PrepopulatedEngine* const engines_AE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Albania
const PrepopulatedEngine* const engines_AL[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Argentina
const PrepopulatedEngine* const engines_AR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
};
// Austria
const PrepopulatedEngine* const engines_AT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
};
// Australia
const PrepopulatedEngine* const engines_AU[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
};
// Bosnia and Herzegovina
const PrepopulatedEngine* const engines_BA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Belgium
const PrepopulatedEngine* const engines_BE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
};
// Bulgaria
const PrepopulatedEngine* const engines_BG[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Bahrain
const PrepopulatedEngine* const engines_BH[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Burundi
const PrepopulatedEngine* const engines_BI[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Brunei
const PrepopulatedEngine* const engines_BN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Bolivia
const PrepopulatedEngine* const engines_BO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Brazil
const PrepopulatedEngine* const engines_BR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
};
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
};
// Belize
const PrepopulatedEngine* const engines_BZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Canada
const PrepopulatedEngine* const engines_CA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
};
// Switzerland
const PrepopulatedEngine* const engines_CH[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
};
// Chile
const PrepopulatedEngine* const engines_CL[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
};
// China
const PrepopulatedEngine* const engines_CN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
};
// Colombia
const PrepopulatedEngine* const engines_CO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
};
// Costa Rica
const PrepopulatedEngine* const engines_CR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Czech Republic
const PrepopulatedEngine* const engines_CZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &seznam, &bing,
};
// Germany
const PrepopulatedEngine* const engines_DE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Denmark
const PrepopulatedEngine* const engines_DK[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
};
// Dominican Republic
const PrepopulatedEngine* const engines_DO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Algeria
const PrepopulatedEngine* const engines_DZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Ecuador
const PrepopulatedEngine* const engines_EC[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Estonia
const PrepopulatedEngine* const engines_EE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Egypt
const PrepopulatedEngine* const engines_EG[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Spain
const PrepopulatedEngine* const engines_ES[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
};
// Faroe Islands
const PrepopulatedEngine* const engines_FO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Finland
const PrepopulatedEngine* const engines_FI[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
};
// France
const PrepopulatedEngine* const engines_FR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// United Kingdom
const PrepopulatedEngine* const engines_GB[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
};
// Greece
const PrepopulatedEngine* const engines_GR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
};
// Guatemala
const PrepopulatedEngine* const engines_GT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Hong Kong
const PrepopulatedEngine* const engines_HK[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
};
// Honduras
const PrepopulatedEngine* const engines_HN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Croatia
const PrepopulatedEngine* const engines_HR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Hungary
const PrepopulatedEngine* const engines_HU[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Indonesia
const PrepopulatedEngine* const engines_ID[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
};
// Ireland
const PrepopulatedEngine* const engines_IE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
};
// Israel
const PrepopulatedEngine* const engines_IL[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// India
const PrepopulatedEngine* const engines_IN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
};
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Iran
const PrepopulatedEngine* const engines_IR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Iceland
const PrepopulatedEngine* const engines_IS[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Italy
const PrepopulatedEngine* const engines_IT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
};
// Jamaica
const PrepopulatedEngine* const engines_JM[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Jordan
const PrepopulatedEngine* const engines_JO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Japan
const PrepopulatedEngine* const engines_JP[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
};
// Kenya
const PrepopulatedEngine* const engines_KE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Kuwait
const PrepopulatedEngine* const engines_KW[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// South Korea
const PrepopulatedEngine* const engines_KR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &naver, &daum,
};
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
};
// Lebanon
const PrepopulatedEngine* const engines_LB[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Liechtenstein
const PrepopulatedEngine* const engines_LI[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Lithuania
const PrepopulatedEngine* const engines_LT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
};
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// Latvia
const PrepopulatedEngine* const engines_LV[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
};
// Libya
const PrepopulatedEngine* const engines_LY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Morocco
const PrepopulatedEngine* const engines_MA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Monaco
const PrepopulatedEngine* const engines_MC[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
};
// Moldova
const PrepopulatedEngine* const engines_MD[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Montenegro
const PrepopulatedEngine* const engines_ME[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Macedonia
const PrepopulatedEngine* const engines_MK[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Mexico
const PrepopulatedEngine* const engines_MX[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
};
// Malaysia
const PrepopulatedEngine* const engines_MY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Nicaragua
const PrepopulatedEngine* const engines_NI[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Netherlands
const PrepopulatedEngine* const engines_NL[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
};
// Norway
const PrepopulatedEngine* const engines_NO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
};
// New Zealand
const PrepopulatedEngine* const engines_NZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
};
// Oman
const PrepopulatedEngine* const engines_OM[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Panama
const PrepopulatedEngine* const engines_PA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Peru
const PrepopulatedEngine* const engines_PE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
};
// Philippines
const PrepopulatedEngine* const engines_PH[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
};
// Pakistan
const PrepopulatedEngine* const engines_PK[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Puerto Rico
const PrepopulatedEngine* const engines_PR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Poland
const PrepopulatedEngine* const engines_PL[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &onet, &bing,
};
// Portugal
const PrepopulatedEngine* const engines_PT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Paraguay
const PrepopulatedEngine* const engines_PY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Qatar
const PrepopulatedEngine* const engines_QA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Romania
const PrepopulatedEngine* const engines_RO[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
};
// Serbia
const PrepopulatedEngine* const engines_RS[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Russia
const PrepopulatedEngine* const engines_RU[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
};
// Rwanda
const PrepopulatedEngine* const engines_RW[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Saudi Arabia
const PrepopulatedEngine* const engines_SA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Sweden
const PrepopulatedEngine* const engines_SE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
};
// Singapore
const PrepopulatedEngine* const engines_SG[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
};
// Slovenia
const PrepopulatedEngine* const engines_SI[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &najdi, &ask,
};
// Slovakia
const PrepopulatedEngine* const engines_SK[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// El Salvador
const PrepopulatedEngine* const engines_SV[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Syria
const PrepopulatedEngine* const engines_SY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Thailand
const PrepopulatedEngine* const engines_TH[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
};
// Tunisia
const PrepopulatedEngine* const engines_TN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
};
// Trinidad and Tobago
const PrepopulatedEngine* const engines_TT[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Taiwan
const PrepopulatedEngine* const engines_TW[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
};
// Tanzania
const PrepopulatedEngine* const engines_TZ[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Ukraine
const PrepopulatedEngine* const engines_UA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
};
// United States
const PrepopulatedEngine* const engines_US[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
};
// Uruguay
const PrepopulatedEngine* const engines_UY[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Venezuela
const PrepopulatedEngine* const engines_VE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
};
// Vietnam
const PrepopulatedEngine* const engines_VN[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
};
// Yemen
const PrepopulatedEngine* const engines_YE[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// South Africa
const PrepopulatedEngine* const engines_ZA[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Zimbabwe
const PrepopulatedEngine* const engines_ZW[] = {
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
};
// A list of all the engines that we know about.
const PrepopulatedEngine* const kAllEngines[] = {
// Prepopulated engines:
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &kvasir,
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
--
2.11.0
@@ -1,714 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 18 Oct 2017 21:24:05 +0200
Subject: Add StartPage search engine
---
.../search_engines/prepopulated_engines.json | 12 +-
components/search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
3 files changed, 121 insertions(+), 110 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
@@ -32,7 +32,7 @@
// Increment this if you change the data in ways that mean users with
// existing data should get a new version.
- "kCurrentDataVersion": 103
+ "kCurrentDataVersion": 104
},
// The following engines are included in country lists and are added to the
@@ -247,6 +247,16 @@
"id": 56
},
+ "startpage": {
+ "name": "StartPage",
+ "keyword": "startpage.com",
+ "favicon_url": "https://www.startpage.com/graphics/favicon/sp-favicon-16x16.png",
+ "search_url": "https://www.startpage.com/do/dsearch?query={searchTerms}&cat=web&pl=opensearch",
+ "suggest_url": "https://www.startpage.com/cgi-bin/csuggest?query={searchTerms}&limit=10&format=json",
+ "type": "SEARCH_ENGINE_STARTPAGE",
+ "id": 33
+ },
+
"vinden": {
"name": "Vinden.nl",
"keyword": "vinden.nl",
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
@@ -65,6 +65,7 @@ enum SearchEngineType {
SEARCH_ENGINE_360,
SEARCH_ENGINE_DUCKDUCKGO,
SEARCH_ENGINE_DUCKDUCKGOLIGHT,
+ SEARCH_ENGINE_STARTPAGE,
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
@@ -33,548 +33,548 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// United Arab Emirates
const PrepopulatedEngine* const engines_AE[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Albania
const PrepopulatedEngine* const engines_AL[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Argentina
const PrepopulatedEngine* const engines_AR[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
};
// Austria
const PrepopulatedEngine* const engines_AT[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
};
// Australia
const PrepopulatedEngine* const engines_AU[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
};
// Bosnia and Herzegovina
const PrepopulatedEngine* const engines_BA[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Belgium
const PrepopulatedEngine* const engines_BE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
};
// Bulgaria
const PrepopulatedEngine* const engines_BG[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Bahrain
const PrepopulatedEngine* const engines_BH[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Burundi
const PrepopulatedEngine* const engines_BI[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Brunei
const PrepopulatedEngine* const engines_BN[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Bolivia
const PrepopulatedEngine* const engines_BO[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Brazil
const PrepopulatedEngine* const engines_BR[] = {
- &google, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
};
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &google, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
};
// Belize
const PrepopulatedEngine* const engines_BZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Canada
const PrepopulatedEngine* const engines_CA[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
};
// Switzerland
const PrepopulatedEngine* const engines_CH[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
};
// Chile
const PrepopulatedEngine* const engines_CL[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
};
// China
const PrepopulatedEngine* const engines_CN[] = {
- &google, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
};
// Colombia
const PrepopulatedEngine* const engines_CO[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
};
// Costa Rica
const PrepopulatedEngine* const engines_CR[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Czech Republic
const PrepopulatedEngine* const engines_CZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &seznam, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
};
// Germany
const PrepopulatedEngine* const engines_DE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Denmark
const PrepopulatedEngine* const engines_DK[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
};
// Dominican Republic
const PrepopulatedEngine* const engines_DO[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Algeria
const PrepopulatedEngine* const engines_DZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Ecuador
const PrepopulatedEngine* const engines_EC[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Estonia
const PrepopulatedEngine* const engines_EE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Egypt
const PrepopulatedEngine* const engines_EG[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Spain
const PrepopulatedEngine* const engines_ES[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
};
// Faroe Islands
const PrepopulatedEngine* const engines_FO[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
};
// Finland
const PrepopulatedEngine* const engines_FI[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
};
// France
const PrepopulatedEngine* const engines_FR[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// United Kingdom
const PrepopulatedEngine* const engines_GB[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
};
// Greece
const PrepopulatedEngine* const engines_GR[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
};
// Guatemala
const PrepopulatedEngine* const engines_GT[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Hong Kong
const PrepopulatedEngine* const engines_HK[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
};
// Honduras
const PrepopulatedEngine* const engines_HN[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Croatia
const PrepopulatedEngine* const engines_HR[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Hungary
const PrepopulatedEngine* const engines_HU[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Indonesia
const PrepopulatedEngine* const engines_ID[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
};
// Ireland
const PrepopulatedEngine* const engines_IE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
};
// Israel
const PrepopulatedEngine* const engines_IL[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// India
const PrepopulatedEngine* const engines_IN[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
};
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Iran
const PrepopulatedEngine* const engines_IR[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Iceland
const PrepopulatedEngine* const engines_IS[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Italy
const PrepopulatedEngine* const engines_IT[] = {
- &google, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
};
// Jamaica
const PrepopulatedEngine* const engines_JM[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Jordan
const PrepopulatedEngine* const engines_JO[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Japan
const PrepopulatedEngine* const engines_JP[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
};
// Kenya
const PrepopulatedEngine* const engines_KE[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Kuwait
const PrepopulatedEngine* const engines_KW[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// South Korea
const PrepopulatedEngine* const engines_KR[] = {
- &google, &duckduckgo, &duckduckgo_light, &naver, &daum,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
};
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
};
// Lebanon
const PrepopulatedEngine* const engines_LB[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Liechtenstein
const PrepopulatedEngine* const engines_LI[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
};
// Lithuania
const PrepopulatedEngine* const engines_LT[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
};
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
};
// Latvia
const PrepopulatedEngine* const engines_LV[] = {
- &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
};
// Libya
const PrepopulatedEngine* const engines_LY[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Morocco
const PrepopulatedEngine* const engines_MA[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Monaco
const PrepopulatedEngine* const engines_MC[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
};
// Moldova
const PrepopulatedEngine* const engines_MD[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Montenegro
const PrepopulatedEngine* const engines_ME[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Macedonia
const PrepopulatedEngine* const engines_MK[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Mexico
const PrepopulatedEngine* const engines_MX[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
};
// Malaysia
const PrepopulatedEngine* const engines_MY[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
};
// Nicaragua
const PrepopulatedEngine* const engines_NI[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Netherlands
const PrepopulatedEngine* const engines_NL[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
};
// Norway
const PrepopulatedEngine* const engines_NO[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
};
// New Zealand
const PrepopulatedEngine* const engines_NZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
};
// Oman
const PrepopulatedEngine* const engines_OM[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Panama
const PrepopulatedEngine* const engines_PA[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Peru
const PrepopulatedEngine* const engines_PE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
};
// Philippines
const PrepopulatedEngine* const engines_PH[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
};
// Pakistan
const PrepopulatedEngine* const engines_PK[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Puerto Rico
const PrepopulatedEngine* const engines_PR[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Poland
const PrepopulatedEngine* const engines_PL[] = {
- &google, &duckduckgo, &duckduckgo_light, &onet, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
};
// Portugal
const PrepopulatedEngine* const engines_PT[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Paraguay
const PrepopulatedEngine* const engines_PY[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Qatar
const PrepopulatedEngine* const engines_QA[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Romania
const PrepopulatedEngine* const engines_RO[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
};
// Serbia
const PrepopulatedEngine* const engines_RS[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Russia
const PrepopulatedEngine* const engines_RU[] = {
- &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
};
// Rwanda
const PrepopulatedEngine* const engines_RW[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Saudi Arabia
const PrepopulatedEngine* const engines_SA[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
};
// Sweden
const PrepopulatedEngine* const engines_SE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
};
// Singapore
const PrepopulatedEngine* const engines_SG[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
};
// Slovenia
const PrepopulatedEngine* const engines_SI[] = {
- &google, &duckduckgo, &duckduckgo_light, &najdi, &ask,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
};
// Slovakia
const PrepopulatedEngine* const engines_SK[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// El Salvador
const PrepopulatedEngine* const engines_SV[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Syria
const PrepopulatedEngine* const engines_SY[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Thailand
const PrepopulatedEngine* const engines_TH[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
};
// Tunisia
const PrepopulatedEngine* const engines_TN[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
};
// Trinidad and Tobago
const PrepopulatedEngine* const engines_TT[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Taiwan
const PrepopulatedEngine* const engines_TW[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
};
// Tanzania
const PrepopulatedEngine* const engines_TZ[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
};
// Ukraine
const PrepopulatedEngine* const engines_UA[] = {
- &google, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
};
// United States
const PrepopulatedEngine* const engines_US[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
};
// Uruguay
const PrepopulatedEngine* const engines_UY[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Venezuela
const PrepopulatedEngine* const engines_VE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
};
// Vietnam
const PrepopulatedEngine* const engines_VN[] = {
- &google, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
};
// Yemen
const PrepopulatedEngine* const engines_YE[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
};
// South Africa
const PrepopulatedEngine* const engines_ZA[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
};
// Zimbabwe
const PrepopulatedEngine* const engines_ZW[] = {
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
};
// A list of all the engines that we know about.
const PrepopulatedEngine* const kAllEngines[] = {
// Prepopulated engines:
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &duckduckgo, &duckduckgo_light, &kvasir,
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
--
2.11.0
@@ -1,289 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 28 Apr 2018 08:30:26 +0200
Subject: Add a flag for DNS-over-HTTPS
Allow selection between Google and Cloudflare endpoints.
Serve DoH requests with maximum priority, remove traffic annotation.
Reduce HTTP headers in DoH requests to bare minimum.
Add AdGuard (default) endpoint
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-14.txt
---
chrome/browser/about_flags.cc | 14 +++++++++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 3 +++
.../browser/net/system_network_context_manager.cc | 16 ++++++-------
.../common/network_features.cc | 7 ++++--
.../common/network_features.h | 5 +++-
.../common/network_switch_list.h | 4 ++++
net/base/load_flags_list.h | 6 +++++
net/dns/dns_transaction.cc | 28 +++-------------------
net/url_request/url_request_http_job.cc | 26 ++++++++++++--------
10 files changed, 65 insertions(+), 47 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
@@ -427,6 +427,14 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
base::size(kCCTModuleCache_ThirtyMinutes), nullptr},
};
+const FeatureEntry::Choice kDnsOverHttpsChoices[] = {
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google.com/experimental"},
+ {features::kDnsOverHttpsChoiceCloudflare, switches::kDnsOverHttpsServer, "https://1.1.1.1/dns-query"},
+ {features::kDnsOverHttpsChoiceQuad9, switches::kDnsOverHttpsServer, "https://9.9.9.9/dns-query"},
+ {features::kDnsOverHttpsChoiceAdGuard, switches::kDnsOverHttpsServer, "https://dns.adguard.com/dns-query"}
+};
+
#endif // OS_ANDROID
const FeatureEntry::Choice kNumRasterThreadsChoices[] = {
@@ -3556,6 +3564,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kAsyncDns)},
#endif // defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+ {"enable-dns-over-https", flag_descriptions::kDnsOverHttpsName,
+ flag_descriptions::kDnsOverHttpsDescription, kOsAndroid,
+ MULTI_VALUE_TYPE(kDnsOverHttpsChoices)},
+#endif // defined(OS_ANDROID)
+
{"enable-overflow-icons-for-media-controls",
flag_descriptions::kOverflowIconsForMediaControlsName,
flag_descriptions::kOverflowIconsForMediaControlsDescription, kOsAll,
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
@@ -2254,6 +2254,9 @@ const char kAutoFetchOnNetErrorPageDescription[] =
"When enabled, and navigation fails with an offline error, schedule a "
"fetch of the page when online again.";
+const char kDnsOverHttpsName[] = "DNS over HTTPS";
+const char kDnsOverHttpsDescription[] = "Enables DNS-over-HTTPS (experimental).";
+
const char kAutofillAccessoryViewName[] =
"Autofill suggestions as keyboard accessory view";
const char kAutofillAccessoryViewDescription[] =
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
@@ -1352,6 +1352,9 @@ extern const char kAsyncDnsDescription[];
extern const char kAutoFetchOnNetErrorPageName[];
extern const char kAutoFetchOnNetErrorPageDescription[];
+extern const char kDnsOverHttpsName[];
+extern const char kDnsOverHttpsDescription[];
+
extern const char kAutofillAccessoryViewName[];
extern const char kAutofillAccessoryViewDescription[];
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
--- a/chrome/browser/net/system_network_context_manager.cc
+++ b/chrome/browser/net/system_network_context_manager.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/component_updater/sth_set_component_installer.h"
#include "chrome/browser/io_thread.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
+#include "components/network_session_configurator/common/network_switches.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/ssl/ssl_config_service_manager.h"
#include "chrome/common/channel_info.h"
@@ -395,15 +396,12 @@ SystemNetworkContextManager::SystemNetworkContextManager(
base::Value(ShouldEnableAsyncDns()));
base::ListValue default_doh_servers;
base::ListValue default_doh_server_methods;
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
- std::string server(variations::GetVariationParamValueByFeature(
- features::kDnsOverHttps, "server"));
- std::string method(variations::GetVariationParamValueByFeature(
- features::kDnsOverHttps, "method"));
- if (!server.empty()) {
- default_doh_servers.AppendString(server);
- default_doh_server_methods.AppendString(method);
- }
+ std::string server =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kDnsOverHttpsServer);
+ if (!server.empty()) {
+ default_doh_servers.AppendString(server);
+ default_doh_server_methods.AppendString("POST");
}
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsServers,
std::move(default_doh_servers));
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,7 +8,10 @@
namespace features {
-const base::Feature kDnsOverHttps{"dns-over-https",
- base::FEATURE_DISABLED_BY_DEFAULT};
+const char kDnsOverHttpsChoiceDefault[] = "Disabled",
+ kDnsOverHttpsChoiceGoogle[] = "Google",
+ kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
+ kDnsOverHttpsChoiceQuad9[] = "Quad9",
+ kDnsOverHttpsChoiceAdGuard[] = "AdGuard";
} // 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,9 +10,12 @@
namespace features {
-// Enabled DNS over HTTPS
+// DNS over HTTPS server endpoint choices
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kDnsOverHttpsChoiceDefault[],
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[],
+ kDnsOverHttpsChoiceAdGuard[];
} // namespace features
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
@@ -35,6 +35,10 @@ NETWORK_SWITCH(kOriginToForceQuicOn, "origin-to-force-quic-on")
// the server.
NETWORK_SWITCH(kQuicConnectionOptions, "quic-connection-options")
+// Specifies an IETF DNS-over-HTTPS server endpoint
+// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-02.txt).
+NETWORK_SWITCH(kDnsOverHttpsServer, "dns-over-https-server")
+
// Specifies the maximum length for a QUIC packet.
NETWORK_SWITCH(kQuicMaxPacketLength, "quic-max-packet-length")
diff --git a/net/base/load_flags_list.h b/net/base/load_flags_list.h
--- a/net/base/load_flags_list.h
+++ b/net/base/load_flags_list.h
@@ -89,6 +89,12 @@ LOAD_FLAG(MAYBE_USER_GESTURE, 1 << 13)
LOAD_FLAG(DO_NOT_USE_EMBEDDED_IDENTITY, 1 << 14)
// Indicates that this request is not to be migrated to a cellular network when
+
+// This load will not send Accept-Language or User-Agent headers, and not
+// advertise brotli encoding.
+// Used to comply with IETF (draft) DNS-over-HTTPS:
+// "Implementors SHOULD NOT set non-essential HTTP headers in DoH client requests."
+LOAD_FLAG(MINIMAL_HEADERS, 1 << 18)
// QUIC connection migration is enabled.
LOAD_FLAG(DISABLE_CONNECTION_MIGRATION_TO_CELLULAR, 1 << 15)
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -358,30 +358,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
HttpRequestHeaders extra_request_headers;
extra_request_headers.SetHeader("Accept", kDnsOverHttpResponseContentType);
-
- request_ = url_request_context->CreateRequest(
- url, request_priority_, this,
- net::DefineNetworkTrafficAnnotation("dns_over_https", R"(
- semantics {
- sender: "DNS over HTTPS"
- description: "Domain name resolution over HTTPS"
- trigger: "User enters a navigates to a domain or Chrome otherwise "
- "makes a connection to a domain whose IP address isn't cached"
- data: "The domain name that is being requested"
- destination: OTHER
- destination_other: "The user configured DNS over HTTPS server, which"
- "may be dns.google.com"
- }
- policy {
- cookies_allowed: NO
- setting:
- "You can configure this feature via that 'dns_over_https_servers' and"
- "'dns_over_https.method' prefs. Empty lists imply this feature is"
- "disabled"
- policy_exception_justification: "Experimental feature that"
- "is disabled by default"
- }
- )"));
+ request_ = url_request_context->CreateRequest(url, request_priority_, this);
net_log_ = request_->net_log();
if (use_post) {
@@ -397,6 +374,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
request_->SetExtraRequestHeaders(extra_request_headers);
request_->SetLoadFlags(request_->load_flags() | LOAD_DISABLE_CACHE |
+ LOAD_IGNORE_LIMITS | LOAD_MINIMAL_HEADERS |
LOAD_BYPASS_PROXY);
request_->set_allow_credentials(false);
}
@@ -819,7 +797,7 @@ class DnsTransactionImpl : public DnsTransaction,
had_tcp_attempt_(false),
doh_attempt_(false),
first_server_index_(0),
- request_priority_(DEFAULT_PRIORITY) {
+ request_priority_(MAXIMUM_PRIORITY) {
DCHECK(session_.get());
DCHECK(!hostname_.empty());
DCHECK(!callback_.is_null());
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
@@ -422,19 +422,23 @@ void URLRequestHttpJob::Start() {
// plugin could set a referrer although sending the referrer is inhibited.
request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer);
- // Our consumer should have made sure that this is a safe referrer. See for
- // instance WebCore::FrameLoader::HideReferrer.
- if (referrer.is_valid()) {
- request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
+ // Our consumer should have made sure that this is a safe referrer. See for
+ // instance WebCore::FrameLoader::HideReferrer.
+ if (referrer.is_valid()) {
+ request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
referrer.spec());
+ }
}
// This should be kept in sync with the corresponding code in
// URLRequest::GetUserAgent.
- request_info_.extra_headers.SetHeaderIfMissing(
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
+ request_info_.extra_headers.SetHeaderIfMissing(
HttpRequestHeaders::kUserAgent,
http_user_agent_settings_ ?
http_user_agent_settings_->GetUserAgent() : std::string());
+ }
AddExtraHeaders();
AddCookieHeaderAndStart();
@@ -647,10 +651,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
HttpRequestHeaders::kAcceptEncoding)) {
// Advertise "br" encoding only if transferred data is opaque to proxy.
bool advertise_brotli = false;
- if (request()->context()->enable_brotli()) {
- if (request()->url().SchemeIsCryptographic() ||
- IsLocalhost(request()->url())) {
- advertise_brotli = true;
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
+ if (request()->context()->enable_brotli()) {
+ if (request()->url().SchemeIsCryptographic() ||
+ IsLocalhost(request()->url())) {
+ advertise_brotli = true;
+ }
}
}
@@ -667,7 +673,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
advertised_encodings);
}
- if (http_user_agent_settings_) {
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS) && http_user_agent_settings_) {
// Only add default Accept-Language if the request didn't have it
// specified.
std::string accept_language =
--
2.11.0
+365 -172
View File
@@ -6,27 +6,36 @@ Accessible from proxy settings and chrome://proxy
Allows to use a PAC script URL, automatic configuration and explicit proxy
settings.
Offer auto-complete for the proxy page URL.
Store proxy settings in LocalState instead of Profile, so that proxy is used
for SimpleURLLoaders as well.
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/android/java/res/values/values.xml | 3 +
.../android/java/res/xml/privacy_preferences.xml | 5 +
.../chrome_autocomplete_provider_client.cc | 2 +
chrome/browser/browser_resources.grd | 2 +
.../prefs/chrome_command_line_pref_store.cc | 2 +-
chrome/browser/resources/proxy_config.css | 61 ++++
chrome/browser/resources/proxy_config.html | 78 ++++
chrome/browser/resources/proxy_config.js | 252 +++++++++++++
chrome/browser/ui/BUILD.gn | 2 +
.../ui/webui/chrome_web_ui_controller_factory.cc | 3 +
chrome/browser/ui/webui/proxy_config_ui.cc | 399 +++++++++++++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 33 ++
chrome/common/webui_url_constants.cc | 4 +
chrome/common/webui_url_constants.h | 2 +
.../policy/core/browser/proxy_policy_handler.cc | 2 +-
components/proxy_config/proxy_config_dictionary.cc | 22 +-
components/proxy_config/proxy_config_dictionary.h | 6 +-
net/proxy_resolution/proxy_config.cc | 45 +++
net/proxy_resolution/proxy_config.h | 3 +
19 files changed, 914 insertions(+), 12 deletions(-)
chrome/android/java/res/values/values.xml | 3 +
.../java/res/xml/privacy_preferences.xml | 4 +
.../privacy/settings/PrivacySettings.java | 1 +
.../chrome_autocomplete_provider_client.cc | 2 +
chrome/browser/browser_resources.grd | 6 +
chrome/browser/net/proxy_service_factory.cc | 24 +-
chrome/browser/net/proxy_service_factory.h | 3 +
chrome/browser/prefs/browser_prefs.cc | 4 +
.../prefs/chrome_command_line_pref_store.cc | 2 +-
chrome/browser/resources/proxy_config.css | 61 +++
chrome/browser/resources/proxy_config.html | 79 ++++
chrome/browser/resources/proxy_config.js | 266 +++++++++++
chrome/browser/ui/BUILD.gn | 2 +
.../webui/chrome_web_ui_controller_factory.cc | 3 +
chrome/browser/ui/webui/proxy_config_ui.cc | 418 ++++++++++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 31 ++
chrome/common/webui_url_constants.cc | 4 +
chrome/common/webui_url_constants.h | 2 +
.../pref_proxy_config_tracker_impl.cc | 1 +
.../proxy_config/proxy_config_dictionary.cc | 30 +-
.../proxy_config/proxy_config_dictionary.h | 7 +-
.../proxy_config/proxy_policy_handler.cc | 2 +-
net/proxy_resolution/proxy_config.cc | 52 ++-
net/proxy_resolution/proxy_config.h | 3 +
24 files changed, 996 insertions(+), 14 deletions(-)
create mode 100644 chrome/browser/resources/proxy_config.css
create mode 100644 chrome/browser/resources/proxy_config.html
create mode 100644 chrome/browser/resources/proxy_config.js
@@ -36,61 +45,166 @@ Offer auto-complete for the proxy page URL.
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -81,6 +81,9 @@
<integer name="list_item_level_selected">1</integer>
<integer name="list_item_level_incognito">2</integer>
@@ -25,6 +25,9 @@
<!-- Compositor Tab Title Text -->
<bool name="compositor_tab_title_fake_bold_text">true</bool>
+ <string name="proxy_title">Proxy configuration</string>
+ <string name="proxy_url">chrome://proxy</string>
+
<!-- Download InfoBar animation. -->
<integer name="download_infobar_sweep_up_delay">500</integer>
<integer name="download_infobar_sweep_down_delay">800</integer>
<integer name="download_infobar_fill_in_delay">1200</integer>
<integer name="download_infobar_fill_out_delay">200</integer>
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
@@ -5,8 +5,13 @@
@@ -6,6 +6,10 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
+ <org.chromium.chrome.browser.preferences.HyperlinkPreference
+ <org.chromium.chrome.browser.about_settings.HyperlinkPreference
+ android:key="proxy"
+ android:title="@string/proxy_title"
+ app:url="@string/proxy_url" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="navigation_error"
android:title="@string/navigation_error_title"
<Preference
android:key="clear_browsing_data"
android:title="@string/clear_browsing_data_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
@@ -57,6 +57,7 @@ public class PrivacySettings
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_REVIEW = "privacy_review";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -237,6 +237,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
@@ -271,6 +271,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIFlagsURL));
builtins_to_provide.push_back(
+ base::ASCIIToUTF16(chrome::kChromeUIProxyConfigURL));
base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
#endif
+ builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL));
#if !defined(OS_ANDROID)
+ base::ASCIIToUTF16(chrome::kChromeUIProxyConfigURL));
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIVersionURL));
return builtins_to_provide;
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -204,6 +204,8 @@
<include name="IDR_SNIPPETS_INTERNALS_CSS" file="resources\snippets_internals\snippets_internals.css" compress="gzip" type="BINDATA" />
<include name="IDR_SNIPPETS_INTERNALS_JS" file="resources\snippets_internals\snippets_internals.js" compress="gzip" type="BINDATA" />
<include name="IDR_SNIPPETS_INTERNALS_MOJO_JS" file="${root_gen_dir}\chrome\browser\ui\webui\snippets_internals\snippets_internals.mojom.js" use_base_dir="false" type="BINDATA" compress="gzip" />
@@ -80,6 +80,12 @@
<include name="IDR_CONTACT_CENTER_INSIGHTS_MANIFEST" file="resources\chromeos\contact_center_insights\manifest.json" type="BINDATA" />
</if>
+ <!-- Bromite Proxy Configuration UI -->
+ <if expr="is_android">
+ <include name="IDR_PROXY_CONFIG_HTML" file="resources\proxy_config.html" flattenhtml="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_PROXY_CONFIG_JS" file="resources\proxy_config.js" type="BINDATA" compress="gzip" />
</if>
<include name="IDR_SUPERVISED_USER_INTERNALS_HTML" file="resources\supervised_user_internals.html" allowexternalscript="true" compress="gzip" type="BINDATA" />
<include name="IDR_SUPERVISED_USER_INTERNALS_CSS" file="resources\supervised_user_internals.css" compress="gzip" type="BINDATA" />
+ </if>
+
<if expr="not is_android">
<!-- Page not available for guest. -->
<include name="IDR_PAGE_NOT_AVAILABLE_FOR_GUEST_APP_HTML" file="resources\page_not_available_for_guest\app.html" type="BINDATA" />
diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/proxy_service_factory.cc
--- a/chrome/browser/net/proxy_service_factory.cc
+++ b/chrome/browser/net/proxy_service_factory.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/logging.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -13,6 +14,9 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/proxy_resolution/proxy_config_service.h"
+#include "components/proxy_config/proxy_config_pref_names.h"
+#include "components/prefs/pref_service.h"
+#include "components/prefs/pref_registry_simple.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/ash/components/network/proxy/proxy_config_service_impl.h"
@@ -70,7 +74,20 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
return std::make_unique<chromeos::ProxyConfigServiceImpl>(
profile_prefs, local_state_prefs, nullptr);
#else
- return std::make_unique<PrefProxyConfigTrackerImpl>(profile_prefs, nullptr);
+ // Migrate from profile_prefs to local_state_prefs
+ if (local_state_prefs->GetBoolean("proxy_migrated") == false) {
+ const base::Value* dict =
+ profile_prefs->GetDictionary(proxy_config::prefs::kProxy);
+
+ LOG(INFO) << "CreatePrefProxyConfigTrackerOfProfile: Migration from profile to local state";
+
+ const base::Value /*ProxyConfigDictionary*/ proxy_dict(dict->Clone());
+ local_state_prefs->Set(proxy_config::prefs::kProxy, proxy_dict);
+
+ local_state_prefs->SetBoolean("proxy_migrated", true);
+ local_state_prefs->CommitPendingWrite();
+ }
+ return std::make_unique<PrefProxyConfigTrackerImpl>(local_state_prefs, nullptr);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
@@ -86,3 +103,8 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
nullptr);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
+
+// static
+void ProxyServiceFactory::RegisterPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterBooleanPref("proxy_migrated", false);
+}
diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/proxy_service_factory.h
--- a/chrome/browser/net/proxy_service_factory.h
+++ b/chrome/browser/net/proxy_service_factory.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
#include <memory>
+#include "components/prefs/pref_registry_simple.h"
class PrefProxyConfigTracker;
class PrefService;
@@ -35,6 +36,8 @@ class ProxyServiceFactory {
CreatePrefProxyConfigTrackerOfProfile(PrefService* profile_prefs,
PrefService* local_state_prefs);
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
// Creates a PrefProxyConfigTracker that tracks local state only. This tracker
// should be used for the system request context and the signin screen
// (ChromeOS only).
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -163,6 +163,8 @@
#include "printing/buildflags/buildflags.h"
#include "rlz/buildflags/buildflags.h"
+#include "chrome/browser/net/proxy_service_factory.h"
+
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
#include "chrome/browser/background/background_mode_manager.h"
#endif
@@ -1045,6 +1047,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
chrome::enterprise_util::RegisterLocalStatePrefs(registry);
component_updater::RegisterPrefs(registry);
embedder_support::OriginTrialPrefs::RegisterPrefs(registry);
+ ProxyServiceFactory::RegisterPrefs(registry);
+
enterprise_reporting::RegisterLocalStatePrefs(registry);
ExternalProtocolHandler::RegisterPrefs(registry);
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry);
diff --git a/chrome/browser/prefs/chrome_command_line_pref_store.cc b/chrome/browser/prefs/chrome_command_line_pref_store.cc
--- a/chrome/browser/prefs/chrome_command_line_pref_store.cc
+++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
@@ -157,7 +157,7 @@ void ChromeCommandLinePrefStore::ApplyProxyMode() {
@@ -162,7 +162,7 @@ void ChromeCommandLinePrefStore::ApplyProxyMode() {
SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreateFixedServers(
@@ -169,7 +283,7 @@ diff --git a/chrome/browser/resources/proxy_config.html b/chrome/browser/resourc
new file mode 100644
--- /dev/null
+++ b/chrome/browser/resources/proxy_config.html
@@ -0,0 +1,78 @@
@@ -0,0 +1,79 @@
+<!doctype html>
+<html>
+<head>
@@ -183,9 +297,9 @@ new file mode 100644
+<script src="chrome://resources/js/ios/web_ui.js"></script>
+</if>
+
+<script src="chrome://resources/js/assert.js"></script>
+<script src="chrome://resources/js/util.js"></script>
+<script src="chrome://resources/js/cr.js"></script>
+<script src="chrome://proxy/proxy_config.js"></script>
+<script type="module" src="chrome://proxy/proxy_config.js"></script>
+<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
+<link rel="stylesheet" href="proxy_config.css">
+<title>Proxy configuration</title>
@@ -216,7 +330,8 @@ new file mode 100644
+ Reset will update the displayed configuration to match the one currently in use.
+ </div>
+ <div class="section-container">
+ <input type="radio" id="empty" name="mode" value="empty" checked><label for="empty">None</label><br/>
+ <input type="radio" id="empty" name="mode" value="empty"><label for="empty">System Default</label><br/>
+ <input type="radio" id="direct" name="mode" value="direct"><label for="direct">Direct</label><br/>
+ <input type="radio" id="auto-detect" name="mode" value="auto-detect"><label for="auto-detect">Auto-detect (WPAD DHCP/DNS)</label><br/>
+ <input type="radio" id="use-pac-url" name="mode" value="use-pac-url"><label for="use-pac-url">Use PAC URL: <input id='pac-url' value="" size="40" /></label>
+ <p><input type="checkbox" id="pac-mandatory" name="pac-mandatory"><label for="pac-mandatory">Do not allow fallback to direct connection in case PAC script fails</label></p>
@@ -252,7 +367,7 @@ diff --git a/chrome/browser/resources/proxy_config.js b/chrome/browser/resources
new file mode 100644
--- /dev/null
+++ b/chrome/browser/resources/proxy_config.js
@@ -0,0 +1,252 @@
@@ -0,0 +1,266 @@
+/*
+ This file is part of Bromite.
+
@@ -270,6 +385,8 @@ new file mode 100644
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+import {addSingletonGetter} from 'chrome://resources/js/cr.m.js';
+
+/**
+ * Main entry point called once the page has loaded.
+ */
@@ -295,6 +412,7 @@ new file mode 100644
+ var kIdClearButton = 'clear';
+
+ var kIdModeEmpty = 'empty';
+ var kIdModeDirect = 'direct';
+ var kIdModeAutoDetect = 'auto-detect';
+ var kIdModeUsePacURL = 'use-pac-url';
+
@@ -326,7 +444,8 @@ new file mode 100644
+ chrome.send('enableNotifyUIWithState');
+ }
+
+ cr.addSingletonGetter(ProxyConfigView);
+ addSingletonGetter(ProxyConfigView);
+ window.ProxyConfigView = ProxyConfigView;
+
+ ProxyConfigView.prototype = {
+ /**
@@ -380,7 +499,7 @@ new file mode 100644
+ "rules": {
+ "bypass_rules": "",
+ "reverse_bypass": false,
+ "type": "empty"
+ "type": "none"
+ }
+ };
+ },
@@ -393,7 +512,14 @@ new file mode 100644
+ return {
+ "auto_detect": false,
+ "rules": {
+ "type": "empty"
+ "type": "none"
+ }
+ };
+ } else if ($(kIdModeDirect).checked) {
+ return {
+ "auto_detect": false,
+ "rules": {
+ "type": "direct"
+ }
+ };
+ } else if ($(kIdModeAutoDetect).checked) {
@@ -404,7 +530,8 @@ new file mode 100644
+ return {
+ "auto_detect": false,
+ "pac_url": $(kIdPacURL).value.trim(),
+ "pac_mandatory": $(kIdPacMandatory).checked
+ "pac_mandatory": $(kIdPacMandatory).checked,
+ "rules": {}
+ };
+ } else if ($(kIdModeUseListPerScheme).checked || $(kIdModeUseSingleList).checked) {
+ var config = {
@@ -437,14 +564,16 @@ new file mode 100644
+ * Updates the UI to display the current proxy configuration.
+ */
+ renderConfig_: function() {
+ if (this.currentConfig.auto_detect)
+ if (this.currentConfig.auto_detect) {
+ $(kIdModeAutoDetect).checked = true;
+ else if (this.currentConfig.rules.type == "empty")
+ $(kIdModeEmpty).checked = true;
+ else if (this.currentConfig.hasOwnProperty('pac_url')) {
+ } else if (this.currentConfig.hasOwnProperty('pac_url')) {
+ $(kIdPacURL).value = this.currentConfig.pac_url;
+ $(kIdPacMandatory).checked = this.currentConfig.pac_mandatory;
+ $(kIdModeUsePacURL).checked = true;
+ } else if (this.currentConfig.rules.type == "none") {
+ $(kIdModeEmpty).checked = true;
+ } else if (this.currentConfig.rules.type == "direct") {
+ $(kIdModeDirect).checked = true;
+ } else {
+ $(kIdBypassRules).value = this.currentConfig.rules.bypass_rules;
+ $(kIdReverseBypass).checked = this.currentConfig.rules.reverse_bypass;
@@ -508,7 +637,7 @@ new file mode 100644
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -273,6 +273,8 @@ jumbo_split_static_library("ui") {
@@ -283,6 +283,8 @@ static_library("ui") {
"webui/metrics_handler.h",
"webui/net_export_ui.cc",
"webui/net_export_ui.h",
@@ -520,28 +649,28 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -51,6 +51,7 @@
#include "chrome/browser/ui/webui/policy_tool_ui.h"
#include "chrome/browser/ui/webui/policy_ui.h"
#include "chrome/browser/ui/webui/predictors/predictors_ui.h"
@@ -57,6 +57,7 @@
#include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h"
#include "chrome/browser/ui/webui/omnibox/omnibox_ui.h"
#include "chrome/browser/ui/webui/policy/policy_ui.h"
+#include "chrome/browser/ui/webui/proxy_config_ui.h"
#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h"
#include "chrome/browser/ui/webui/settings/md_settings_ui.h"
#include "chrome/browser/ui/webui/settings_utils.h"
@@ -529,6 +530,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<SnippetsInternalsUI>;
if (url.host_piece() == chrome::kChromeUIWebApksHost)
return &NewWebUI<WebApksUI>;
#include "chrome/browser/ui/webui/predictors/predictors_ui.h"
#include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h"
#include "chrome/browser/ui/webui/signin_internals_ui.h"
@@ -779,6 +780,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<MemoryInternalsUI>;
if (url.host_piece() == chrome::kChromeUINetExportHost)
return &NewWebUI<NetExportUI>;
+ if (url.host_piece() == chrome::kChromeUIProxyConfigHost)
+ return &NewWebUI<ProxyConfigUI>;
#else
if (url.SchemeIs(content::kChromeDevToolsScheme)) {
if (!DevToolsUIBindings::IsValidFrontendURL(url))
if (url.host_piece() == chrome::kChromeUINetInternalsHost)
return &NewWebUI<NetInternalsUI>;
if (url.host_piece() == chrome::kChromeUINTPTilesInternalsHost)
diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webui/proxy_config_ui.cc
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/webui/proxy_config_ui.cc
@@ -0,0 +1,399 @@
@@ -0,0 +1,418 @@
+/*
+ This file is part of Bromite.
+
@@ -570,14 +699,11 @@ new file mode 100644
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/scoped_observer.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/io_thread.h"
+#include "chrome/browser/net/proxy_service_factory.h"
+#include "chrome/browser/platform_util.h"
+#include "chrome/browser/profiles/profile.h"
@@ -606,10 +732,9 @@ new file mode 100644
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIProxyConfigHost);
+
+ source->SetJsonPath("strings.js");
+ source->UseStringsJs();
+ source->AddResourcePath("proxy_config.js", IDR_PROXY_CONFIG_JS);
+ source->SetDefaultResource(IDR_PROXY_CONFIG_HTML);
+ source->UseGzip();
+ return source;
+}
+
@@ -621,6 +746,8 @@ new file mode 100644
+ public base::SupportsWeakPtr<ProxyConfigMessageHandler>,
+ public net::ProxyConfigService::Observer {
+ public:
+ ProxyConfigMessageHandler(const ProxyConfigMessageHandler&) = delete;
+ ProxyConfigMessageHandler& operator=(const ProxyConfigMessageHandler&) = delete;
+ // Creates a ProxyConfigMessageHandler that handles message exchanges with the Javascript
+ // side of the UI and gets proxy settings from the Web UI associated profile to watch for changes.
+ // The created ProxyConfigMessageHandler must be destroyed before |profile|.
@@ -631,9 +758,9 @@ new file mode 100644
+ void RegisterMessages() override;
+
+ // Messages
+ void OnEnableNotifyUIWithState(const base::ListValue* list);
+ void OnApply(const base::ListValue* config);
+ void OnClear(const base::ListValue* config);
+ void OnEnableNotifyUIWithState(const base::Value::List& args);
+ void OnApply(const base::Value::List& args);
+ void OnClear(const base::Value::List& args);
+
+ // net::ProxyConfigService::Observer implementation:
+ // Calls ProxyConfigView.onProxyConfigChanged JavaScript function in the
@@ -644,7 +771,7 @@ new file mode 100644
+
+ private:
+ // Not owned.
+ Profile *profile_;
+ PrefService *pref_service_;
+ std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
+ // Monitors global and Profile prefs related to proxy configuration.
+ std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
@@ -655,8 +782,6 @@ new file mode 100644
+ void apply(const net::ProxyConfig& config);
+
+ base::WeakPtrFactory<ProxyConfigMessageHandler> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyConfigMessageHandler);
+};
+
+ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile)
@@ -664,7 +789,7 @@ new file mode 100644
+ weak_ptr_factory_(this) {
+
+ // used to set new configuration preferences
+ profile_ = profile;
+ pref_service_ = g_browser_process->local_state();
+ // observer is explicitly added only later in enableNotifyUIWithState
+ is_observing_ = false;
+
@@ -679,13 +804,13 @@ new file mode 100644
+#endif // defined(OS_CHROMEOS)
+
+ if (!pref_proxy_config_tracker_) {
+ pref_proxy_config_tracker_.reset(
+ pref_proxy_config_tracker_ =
+ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
+ profile->GetPrefs(), g_browser_process->local_state()));
+ profile->GetPrefs(), g_browser_process->local_state());
+ }
+
+ proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService(
+ pref_proxy_config_tracker_.get());
+ pref_proxy_config_tracker_.get(), nullptr);
+}
+
+void ProxyConfigMessageHandler::OnProxyConfigChanged(
@@ -701,7 +826,7 @@ new file mode 100644
+ encodeConfig(config.value(), state);
+ break;
+ case net::ProxyConfigService::CONFIG_UNSET:
+ // nothing will be populated
+ state.SetPath({"config", "rules", "type"}, base::Value("none"));
+ break;
+ case net::ProxyConfigService::CONFIG_PENDING:
+ //NOTE: this can only happen when triggered manually first time
@@ -728,16 +853,20 @@ new file mode 100644
+
+ state.SetPath({"config", "auto_detect"}, base::Value(config.auto_detect()));
+
+ auto rules = config.proxy_rules();
+ if (config.has_pac_url()) {
+ state.SetPath({"config", "pac_url"}, base::Value(config.pac_url().spec()));
+ state.SetPath({"config", "pac_mandatory"}, base::Value(config.pac_mandatory()));
+ state.SetPath({"config", "rules", "type"}, base::Value("none"));
+ state.SetPath({"config", "rules", "bypass_rules"}, base::Value(rules.bypass_rules.ToString()));
+ state.SetPath({"config", "rules", "reverse_bypass"}, base::Value(rules.reverse_bypass));
+ return;
+ }
+
+ auto rules = config.proxy_rules();
+ const char *type;
+ switch (rules.type) {
+ case net::ProxyConfig::ProxyRules::Type::EMPTY:
+ type = "empty";
+ type = "direct";
+ break;
+ case net::ProxyConfig::ProxyRules::Type::PROXY_LIST:
+ type = "list";
@@ -790,7 +919,7 @@ new file mode 100644
+// The proxy configuration UI is not notified of state changes until this function runs.
+// After this function, OnProxyConfigChanged() will be called on all proxy state changes.
+void ProxyConfigMessageHandler::OnEnableNotifyUIWithState(
+ const base::ListValue* list) {
+ const base::Value::List& list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ if (!is_observing_) {
@@ -800,26 +929,36 @@ new file mode 100644
+
+ net::ProxyConfigWithAnnotation config;
+ auto availability = proxy_config_service_->GetLatestProxyConfig(&config);
+
+ const base::Value* dict =
+ pref_service_->GetDictionary(proxy_config::prefs::kProxy);
+ ProxyConfigDictionary proxy_dict(dict->Clone());
+ ProxyPrefs::ProxyMode mode;
+ if (!proxy_dict.GetMode(&mode) || mode == ProxyPrefs::MODE_SYSTEM) {
+ availability = net::ProxyConfigService::CONFIG_UNSET;
+ }
+
+ OnProxyConfigChanged(config, availability);
+}
+
+void ProxyConfigMessageHandler::OnClear(const base::ListValue* list) {
+void ProxyConfigMessageHandler::OnClear(const base::Value::List& list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ profile_->GetPrefs()->ClearPref(proxy_config::prefs::kProxy);
+ const base::Value cfg = ProxyConfigDictionary::CreateSystem();
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ pref_service_->CommitPendingWrite();
+ OnEnableNotifyUIWithState(list);
+}
+
+void ProxyConfigMessageHandler::OnApply(const base::ListValue* list) {
+void ProxyConfigMessageHandler::OnApply(const base::Value::List& list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ const base::Value::ListStorage& params = list->GetList();
+
+ if ((params.size() != 1) || !params[0].is_dict()) {
+ if ((list.size() != 1) || !list[0].is_dict()) {
+ return;
+ }
+
+ const base::DictionaryValue* config = nullptr;
+ if (!list->GetDictionary(0, &config))
+ if (!list[0].GetAsDictionary(&config))
+ return;
+
+ const base::Value *autoDetect = config->FindKeyOfType("auto_detect", base::Value::Type::BOOLEAN);
@@ -886,8 +1025,12 @@ new file mode 100644
+ proxyConfig.proxy_rules().proxies_for_ftp.SetFromPacString(ftp->GetString());
+ proxyConfig.proxy_rules().fallback_proxies.SetFromPacString(fallback->GetString());
+ readBypass = true;
+ } else if (t == "empty") {
+ } else if (t == "direct") {
+ proxyConfig.proxy_rules().type = net::ProxyConfig::ProxyRules::Type::EMPTY;
+ } else if (t == "none") {
+ base::Value::List empty;
+ OnClear(empty);
+ return;
+ } else {
+ // invalid type
+ LOG(WARNING) << "invalid proxy configuration type";
@@ -914,21 +1057,26 @@ new file mode 100644
+void ProxyConfigMessageHandler::apply(const net::ProxyConfig& proxyConfig) {
+ if (proxyConfig.auto_detect()) {
+ const base::Value cfg = ProxyConfigDictionary::CreateAutoDetect();
+ profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+ return;
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ } else if (proxyConfig.has_pac_url()) {
+ const base::Value cfg = ProxyConfigDictionary::CreatePacScript(proxyConfig.pac_url().spec(), proxyConfig.pac_mandatory());
+ profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+ return;
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ } else if (proxyConfig.proxy_rules().type == net::ProxyConfig::ProxyRules::Type::EMPTY) {
+ const base::Value cfg = ProxyConfigDictionary::CreateDirect();
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ } else {
+ auto proxyRulesAsString = proxyConfig.proxy_rules().ToString();
+ auto bypassRulesAsString = proxyConfig.proxy_rules().bypass_rules.ToString();
+
+ // fixed servers
+ const base::Value cfg = ProxyConfigDictionary::CreateFixedServers(proxyRulesAsString,
+ bypassRulesAsString, proxyConfig.proxy_rules().reverse_bypass);
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ }
+ pref_service_->CommitPendingWrite();
+
+ auto proxyRulesAsString = proxyConfig.proxy_rules().ToString();
+ auto bypassRulesAsString = proxyConfig.proxy_rules().bypass_rules.ToString();
+
+ // fixed servers
+ const base::Value cfg = ProxyConfigDictionary::CreateFixedServers(proxyRulesAsString,
+ bypassRulesAsString, proxyConfig.proxy_rules().reverse_bypass);
+ profile_->GetPrefs()->Set(proxy_config::prefs::kProxy, cfg);
+ base::Value::List empty;
+ OnEnableNotifyUIWithState(empty);
+}
+
+} // namespace
@@ -945,7 +1093,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.h b/chrome/browser/ui/webui
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/webui/proxy_config_ui.h
@@ -0,0 +1,33 @@
@@ -0,0 +1,31 @@
+/*
+ This file is part of Bromite.
+
@@ -966,42 +1114,40 @@ new file mode 100644
+#ifndef CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
+#define CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_controller.h"
+
+// The WebUI for chrome://proxy/.
+class ProxyConfigUI : public content::WebUIController {
+ public:
+ ProxyConfigUI(const ProxyConfigUI&) = delete;
+ ProxyConfigUI& operator=(const ProxyConfigUI&) = delete;
+ explicit ProxyConfigUI(content::WebUI* web_ui);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ProxyConfigUI);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc
--- a/chrome/common/webui_url_constants.cc
+++ b/chrome/common/webui_url_constants.cc
@@ -183,6 +183,8 @@ const char kChromeUINativePhysicalWebDiagnosticsURL[] =
const char kChromeUINativeScheme[] = "chrome-native";
const char kChromeUIOfflineInternalsHost[] = "offline-internals";
const char kChromeUIPhysicalWebDiagnosticsHost[] = "physical-web-diagnostics";
@@ -46,6 +46,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert";
const char kChromeUICertificateViewerURL[] = "chrome://view-cert/";
const char kChromeUIChromeSigninHost[] = "chrome-signin";
const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/";
+const char kChromeUIProxyConfigHost[] = "proxy";
+const char kChromeUIProxyConfigURL[] = "chrome://proxy/";
const char kChromeUISnippetsInternalsHost[] = "snippets-internals";
const char kChromeUIWebApksHost[] = "webapks";
#endif
@@ -344,6 +346,7 @@ const char* const kChromeHostURLs[] = {
kChromeUIPasswordManagerInternalsHost,
kChromeUIPolicyHost,
kChromeUIPredictorsHost,
const char kChromeUIChromeURLsHost[] = "chrome-urls";
const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/";
const char kChromeUIComponentsHost[] = "components";
@@ -432,6 +434,7 @@ bool IsSystemWebUIHost(base::StringPiece host) {
kChromeUILockScreenNetworkHost,
kChromeUILockScreenStartReauthHost,
kChromeUIMobileSetupHost,
+ kChromeUIProxyConfigHost,
kChromeUIQuotaInternalsHost,
kChromeUISignInInternalsHost,
kChromeUISiteEngagementHost,
@@ -378,6 +381,7 @@ const char* const kChromeHostURLs[] = {
#if !defined(OS_ANDROID)
#if !defined(OS_CHROMEOS)
kChromeUIMultiDeviceSetupHost,
kChromeUINetworkHost,
kChromeUINotificationTesterHost,
@@ -692,6 +695,7 @@ const char* const kChromeHostURLs[] = {
#if !BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
kChromeUIAppLauncherPageHost,
+ kChromeUIProxyConfigHost,
#endif
@@ -1010,7 +1156,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h
--- a/chrome/common/webui_url_constants.h
+++ b/chrome/common/webui_url_constants.h
@@ -105,6 +105,8 @@ extern const char kChromeUIMemoryInternalsHost[];
@@ -133,6 +133,8 @@ extern const char kChromeUIMemoryInternalsHost[];
extern const char kChromeUINTPTilesInternalsHost[];
extern const char kChromeUINaClHost[];
extern const char kChromeUINetExportHost[];
@@ -1019,22 +1165,21 @@ diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_const
extern const char kChromeUINetInternalsHost[];
extern const char kChromeUINetInternalsURL[];
extern const char kChromeUINewTabHost[];
diff --git a/components/policy/core/browser/proxy_policy_handler.cc b/components/policy/core/browser/proxy_policy_handler.cc
--- a/components/policy/core/browser/proxy_policy_handler.cc
+++ b/components/policy/core/browser/proxy_policy_handler.cc
@@ -203,7 +203,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
prefs->SetValue(proxy_config::prefs::kProxy,
std::make_unique<base::Value>(
ProxyConfigDictionary::CreateFixedServers(
- proxy_server, bypass_list_string)));
+ proxy_server, bypass_list_string, false)));
diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/components/proxy_config/pref_proxy_config_tracker_impl.cc
--- a/components/proxy_config/pref_proxy_config_tracker_impl.cc
+++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc
@@ -381,6 +381,7 @@ bool PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(
if (proxy_dict.GetBypassList(&proxy_bypass)) {
proxy_config.proxy_rules().bypass_rules.ParseFromString(proxy_bypass);
}
break;
}
+ proxy_config.proxy_rules().reverse_bypass = proxy_dict.HasReverseBypass();
*config = net::ProxyConfigWithAnnotation(
proxy_config, kSettingsProxyConfigTrafficAnnotation);
return true;
diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/proxy_config/proxy_config_dictionary.cc
--- a/components/proxy_config/proxy_config_dictionary.cc
+++ b/components/proxy_config/proxy_config_dictionary.cc
@@ -28,6 +28,8 @@ const char kProxyPacMandatory[] = "pac_mandatory";
@@ -30,6 +30,8 @@ const char kProxyPacMandatory[] = "pac_mandatory";
// String containing proxy bypass rules. For a specification of the
// expected syntax see net::ProxyBypassRules::ParseFromString().
const char kProxyBypassList[] = "bypass_list";
@@ -1043,7 +1188,22 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
} // namespace
@@ -79,29 +81,30 @@ const base::Value& ProxyConfigDictionary::GetDictionary() const {
@@ -78,6 +80,14 @@ bool ProxyConfigDictionary::HasBypassList() const {
return dict_.FindKey(kProxyBypassList);
}
+bool ProxyConfigDictionary::HasReverseBypass() const {
+ const base::Value* value = dict_.FindKey(kProxyReverseBypass);
+ if (!value || !value->is_bool()) {
+ return false;
+ }
+ return value->GetBool();
+}
+
const base::Value& ProxyConfigDictionary::GetDictionary() const {
return dict_;
}
@@ -85,29 +95,30 @@ const base::Value& ProxyConfigDictionary::GetDictionary() const {
// static
base::Value ProxyConfigDictionary::CreateDirect() {
return CreateDictionary(ProxyPrefs::MODE_DIRECT, std::string(), false,
@@ -1079,7 +1239,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
} else {
return CreateDirect();
}
@@ -110,7 +113,7 @@ base::Value ProxyConfigDictionary::CreateFixedServers(
@@ -116,7 +127,7 @@ base::Value ProxyConfigDictionary::CreateFixedServers(
// static
base::Value ProxyConfigDictionary::CreateSystem() {
return CreateDictionary(ProxyPrefs::MODE_SYSTEM, std::string(), false,
@@ -1088,7 +1248,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
}
// static
@@ -119,7 +122,8 @@ base::Value ProxyConfigDictionary::CreateDictionary(
@@ -125,7 +136,8 @@ base::Value ProxyConfigDictionary::CreateDictionary(
const std::string& pac_url,
bool pac_mandatory,
const std::string& proxy_server,
@@ -1098,7 +1258,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetKey(kProxyMode, base::Value(ProxyModeToString(mode)));
if (!pac_url.empty()) {
@@ -128,8 +132,10 @@ base::Value ProxyConfigDictionary::CreateDictionary(
@@ -134,8 +146,10 @@ base::Value ProxyConfigDictionary::CreateDictionary(
}
if (!proxy_server.empty())
dict.SetKey(kProxyServer, base::Value(proxy_server));
@@ -1113,7 +1273,15 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/proxy_config/proxy_config_dictionary.h
--- a/components/proxy_config/proxy_config_dictionary.h
+++ b/components/proxy_config/proxy_config_dictionary.h
@@ -46,7 +46,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
@@ -42,6 +42,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
bool GetProxyServer(std::string* out) const;
bool GetBypassList(std::string* out) const;
bool HasBypassList() const;
+ bool HasReverseBypass() const;
const base::Value& GetDictionary() const;
@@ -50,7 +51,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
static base::Value CreatePacScript(const std::string& pac_url,
bool pac_mandatory);
static base::Value CreateFixedServers(const std::string& proxy_server,
@@ -1123,7 +1291,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
static base::Value CreateSystem();
// Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>".
@@ -62,7 +63,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
@@ -66,7 +68,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
const std::string& pac_url,
bool pac_mandatory,
const std::string& proxy_server,
@@ -1132,11 +1300,32 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
+ bool reverse_bypass);
base::Value dict_;
};
diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_config/proxy_policy_handler.cc
--- a/components/proxy_config/proxy_policy_handler.cc
+++ b/components/proxy_config/proxy_policy_handler.cc
@@ -260,7 +260,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
ProxyConfigDictionary::CreateFixedServers(
server->GetString(), bypass_list && bypass_list->is_string()
? bypass_list->GetString()
- : std::string()));
+ : std::string(), false));
}
break;
}
diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_config.cc
--- a/net/proxy_resolution/proxy_config.cc
+++ b/net/proxy_resolution/proxy_config.cc
@@ -140,6 +140,51 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
@@ -109,7 +109,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
&single_proxies,
ProxyServer::SCHEME_HTTP);
type = Type::PROXY_LIST;
- return;
+ continue;
}
// Trim whitespace off the url scheme.
@@ -140,6 +140,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
}
}
@@ -1145,13 +1334,18 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
+ return "";
+ }
+
+ // special case: a single proxy server specified
+ // special case: a single proxy servers list specified
+ if (type == Type::PROXY_LIST) {
+ if (single_proxies.size() == 1) {
+ return single_proxies.Get().ToURI();
+ std::string proxy_list;
+ for (const ProxyServer& proxy_server :
+ single_proxies.GetAll()) {
+ proxy_list += ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ // more than 1 proxies or 0 proxies is unexpected
+ return "";
+ // remove last semicolon
+ if (proxy_list.length() != 0 ) {
+ proxy_list.pop_back();
+ }
+ return proxy_list;
+ }
+
+ if (type != Type::PROXY_LIST_PER_SCHEME) {
@@ -1164,19 +1358,19 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
+ std::string list;
+ for (const ProxyServer& proxy_server :
+ proxies_for_http.GetAll()) {
+ list += "http=" + proxy_server.ToURI() + ";";
+ list += "http=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_https.GetAll()) {
+ list += "https=" + proxy_server.ToURI() + ";";
+ list += "https=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_ftp.GetAll()) {
+ list += "ftp=" + proxy_server.ToURI() + ";";
+ list += "ftp=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ fallback_proxies.GetAll()) {
+ list += "socks=" + proxy_server.ToURI() + ";";
+ list += "socks=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ if (list.length() != 0 ) {
+ // remove last semicolon
@@ -1191,7 +1385,7 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
diff --git a/net/proxy_resolution/proxy_config.h b/net/proxy_resolution/proxy_config.h
--- a/net/proxy_resolution/proxy_config.h
+++ b/net/proxy_resolution/proxy_config.h
@@ -104,6 +104,9 @@ class NET_EXPORT ProxyConfig {
@@ -103,6 +103,9 @@ class NET_EXPORT ProxyConfig {
// and use socks4://foopy2 for all other
// URLs.
void ParseFromString(const std::string& proxy_rules);
@@ -1201,6 +1395,5 @@ diff --git a/net/proxy_resolution/proxy_config.h b/net/proxy_resolution/proxy_co
// Returns one of {&proxies_for_http, &proxies_for_https, &proxies_for_ftp,
// &fallback_proxies}, or NULL if there is no proxy to use.
--
2.11.0
--
2.25.1
File diff suppressed because it is too large Load Diff
@@ -1,875 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 1 Aug 2018 09:19:40 +0200
Subject: Add bookmark import/export actions in bookmarks activity and page
Thanks to Arnaud for the snippet on how to add toast notifications
---
.../java/res/menu/bookmark_action_bar_menu.xml | 14 ++
.../browser/bookmarks/BookmarkActionBar.java | 12 ++
.../chrome/browser/bookmarks/BookmarkActivity.java | 19 ++
.../chrome/browser/bookmarks/BookmarkBridge.java | 56 ++++++
.../chrome/browser/bookmarks/BookmarkDelegate.java | 10 +
.../chrome/browser/bookmarks/BookmarkManager.java | 20 ++
.../chrome/browser/bookmarks/BookmarkPage.java | 1 +
.../java/strings/android_chrome_strings.grd | 6 +
chrome/browser/BUILD.gn | 8 +-
.../browser/android/bookmarks/bookmark_bridge.cc | 215 +++++++++++++++++++++
chrome/browser/android/bookmarks/bookmark_bridge.h | 20 +-
chrome/browser/importer/profile_writer.cc | 2 +
chrome/common/BUILD.gn | 3 +
chrome/utility/BUILD.gn | 7 +-
chrome/utility/importer/bookmark_html_reader.cc | 27 ++-
chrome/utility/importer/bookmark_html_reader.h | 9 +
16 files changed, 419 insertions(+), 10 deletions(-)
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
@@ -22,6 +22,20 @@
app:showAsAction="ifRoom"
app:iconTint="@color/dark_mode_tint" />
<item
+ android:id="@+id/import_menu_id"
+ android:icon="@drawable/add_circle_blue"
+ android:title="@string/import_bookmarks"
+ android:visible="true"
+ app:showAsAction="ifRoom"
+ app:iconTint="@color/dark_mode_tint" />
+ <item
+ android:id="@+id/export_menu_id"
+ android:icon="@drawable/ic_file_download_white_24dp"
+ android:title="@string/export_bookmarks"
+ android:visible="true"
+ app:showAsAction="ifRoom"
+ app:iconTint="@color/dark_mode_tint" />
+ <item
android:id="@+id/close_menu_id"
android:icon="@drawable/btn_close"
android:title="@string/bookmark_action_bar_close"
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
@@ -89,6 +89,12 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
} else if (menuItem.getItemId() == R.id.search_menu_id) {
mDelegate.openSearchUI();
return true;
+ } else if (menuItem.getItemId() == R.id.import_menu_id) {
+ mDelegate.importBookmarks();
+ return true;
+ } else if (menuItem.getItemId() == R.id.export_menu_id) {
+ mDelegate.exportBookmarks();
+ return true;
}
SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
@@ -132,6 +138,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
void showLoadingUi() {
setTitle(null);
setNavigationButton(NAVIGATION_BUTTON_NONE);
+ 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);
getMenu().findItem(R.id.edit_menu_id).setVisible(false);
}
@@ -141,6 +149,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
super.showNormalView();
if (mDelegate == null) {
+ 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);
getMenu().findItem(R.id.edit_menu_id).setVisible(false);
}
@@ -173,6 +183,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
public void onFolderStateSet(BookmarkId folder) {
mCurrentFolder = mDelegate.getModel().getBookmarkById(folder);
+ 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);
getMenu().findItem(R.id.edit_menu_id).setVisible(mCurrentFolder.isEditable());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
@@ -12,6 +12,7 @@ import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.browser.SnackbarActivity;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.components.bookmarks.BookmarkId;
+import org.chromium.ui.base.ActivityWindowAndroid;
/**
* The activity that displays the bookmark UI on the phone. It keeps a {@link BookmarkManager}
@@ -21,6 +22,7 @@ import org.chromium.components.bookmarks.BookmarkId;
public class BookmarkActivity extends SnackbarActivity {
private BookmarkManager mBookmarkManager;
+ private ActivityWindowAndroid mWindowAndroid;
static final int EDIT_BOOKMARK_REQUEST_CODE = 14;
public static final String INTENT_VISIT_BOOKMARK_ID = "BookmarkEditActivity.VisitBookmarkId";
@@ -32,6 +34,22 @@ public class BookmarkActivity extends SnackbarActivity {
if (TextUtils.isEmpty(url)) url = UrlConstants.BOOKMARKS_URL;
mBookmarkManager.updateForUrl(url);
setContentView(mBookmarkManager.getView());
+
+ final boolean listenToActivityState = true;
+ mWindowAndroid = new ActivityWindowAndroid(this, listenToActivityState);
+ mWindowAndroid.restoreInstanceState(savedInstanceState);
+ mBookmarkManager.setWindow(mWindowAndroid);
+ // Set up the animation placeholder to be the SurfaceView. This disables the
+ // SurfaceView's 'hole' clipping during animations that are notified to the window.
+// mWindowAndroid.setAnimationPlaceholderView(
+// mBookmarkManager.getContentViewRenderView().getSurfaceView());
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
+ mWindowAndroid.saveInstanceState(outState);
}
@Override
@@ -48,6 +66,7 @@ public class BookmarkActivity extends SnackbarActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
+ mWindowAndroid.onActivityResult(requestCode, resultCode, data);
if (requestCode == EDIT_BOOKMARK_REQUEST_CODE && resultCode == RESULT_OK) {
BookmarkId bookmarkId = BookmarkId.getBookmarkIdFromString(data.getStringExtra(
INTENT_VISIT_BOOKMARK_ID));
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
@@ -4,7 +4,11 @@
package org.chromium.chrome.browser.bookmarks;
+import android.content.Intent;
+import android.content.Context;
+import android.net.Uri;
import android.os.SystemClock;
+import android.provider.Browser;
import android.text.TextUtils;
import android.util.Pair;
@@ -13,11 +17,16 @@ import org.chromium.base.ObserverList;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.chrome.browser.document.ChromeLauncherActivity;
+import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.components.bookmarks.BookmarkId;
import org.chromium.components.bookmarks.BookmarkType;
import org.chromium.components.url_formatter.UrlFormatter;
+import org.chromium.ui.base.PageTransition;
+import org.chromium.ui.base.WindowAndroid;
+import org.chromium.ui.widget.Toast;
import java.util.ArrayList;
import java.util.List;
@@ -508,6 +517,24 @@ public class BookmarkBridge {
}
/**
+ * Import bookmarks from a selected file.
+ * @param window The current window of the bookmarks activity or page.
+ */
+ public void importBookmarks(WindowAndroid window) {
+ assert mIsNativeBookmarkModelLoaded;
+ nativeImportBookmarks(mNativeBookmarkBridge, window);
+ }
+
+ /**
+ * Export bookmarks to a path selected by the user.
+ * @param window The current window of the bookmarks activity or page.
+ */
+ public void exportBookmarks() {
+ assert mIsNativeBookmarkModelLoaded;
+ nativeExportBookmarks(mNativeBookmarkBridge);
+ }
+
+ /**
* Synchronously gets a list of bookmarks that match the specified search query.
* @param query Keyword used for searching bookmarks.
* @param maxNumberOfResult Maximum number of result to fetch.
@@ -840,6 +867,33 @@ public class BookmarkBridge {
depthList.add(depth);
}
+
+ @CalledByNative
+ public void bookmarksImported() {
+ Context context = ContextUtils.getApplicationContext();
+
+ //TODO: call this after actual import
+ //Toast.makeText(ContextUtils.getApplicationContext(), "Bookmarks imported", Toast.LENGTH_LONG).show();
+ }
+
+ @CalledByNative
+ public void bookmarksExported(String bookmarksPath) {
+ Context context = ContextUtils.getApplicationContext();
+
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("file://" + bookmarksPath));
+ intent.putExtra(Browser.EXTRA_APPLICATION_ID,
+ context.getPackageName());
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra(IntentHandler.EXTRA_PAGE_TRANSITION_TYPE, PageTransition.AUTO_BOOKMARK);
+
+ // If the bookmark manager is shown in a tab on a phone (rather than in a separate
+ // activity) the component name may be null. Send the intent through
+ // ChromeLauncherActivity instead to avoid crashing. See crbug.com/615012.
+ intent.setClass(context, ChromeLauncherActivity.class);
+
+ IntentHandler.startActivityForTrustedIntent(intent);
+ }
+
private static List<Pair<Integer, Integer>> createPairsList(int[] left, int[] right) {
List<Pair<Integer, Integer>> pairList = new ArrayList<Pair<Integer, Integer>>();
for (int i = 0; i < left.length; i++) {
@@ -906,6 +960,8 @@ public class BookmarkBridge {
boolean getFolders, boolean getBookmarks, List<BookmarkId> bookmarksList);
private native BookmarkId nativeGetChildAt(long nativeBookmarkBridge, long id, int type,
int index);
+ private native void nativeImportBookmarks(long nativeBookmarkBridge, WindowAndroid window);
+ private native void nativeExportBookmarks(long nativeBookmarkBridge);
private native int nativeGetTotalBookmarkCount(long nativeBookmarkBridge, long id, int type);
private native void nativeSetBookmarkTitle(long nativeBookmarkBridge, long id, int type,
String title);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
@@ -69,6 +69,16 @@ interface BookmarkDelegate {
void openSearchUI();
/**
+ * Imports bookmarks from user-selected file.
+ */
+ void importBookmarks();
+
+ /**
+ * Exports bookmarks to downloads directory.
+ */
+ void exportBookmarks();
+
+ /**
* Dismisses the search UI.
*/
void closeSearchUI();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
@@ -21,6 +21,7 @@ import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem;
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver;
+import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.favicon.LargeIconBridge;
import org.chromium.chrome.browser.native_page.BasicNativePage;
import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksReader;
@@ -31,6 +32,7 @@ import org.chromium.chrome.browser.widget.selection.SelectableListLayout;
import org.chromium.chrome.browser.widget.selection.SelectableListToolbar.SearchDelegate;
import org.chromium.chrome.browser.widget.selection.SelectionDelegate;
import org.chromium.components.bookmarks.BookmarkId;
+import org.chromium.ui.base.ActivityWindowAndroid;
import java.util.Stack;
@@ -55,6 +57,7 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
private Activity mActivity;
private ViewGroup mMainView;
private BookmarkModel mBookmarkModel;
+ private ActivityWindowAndroid mWindowAndroid;
private BookmarkUndoController mUndoController;
private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
private BasicNativePage mNativePage;
@@ -267,6 +270,13 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
}
/**
+ * Sets the Android window that is used by further intents created by the bookmark activity.
+ */
+ public void setWindow(ActivityWindowAndroid window) {
+ mWindowAndroid = window;
+ }
+
+ /**
* @return Current URL representing the UI state of bookmark manager. If no state has been shown
* yet in this session, on phone return last used state stored in preference; on tablet
* return the url previously set by {@link #updateForUrl(String)}.
@@ -414,6 +424,16 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
}
@Override
+ public void importBookmarks() {
+ mBookmarkModel.importBookmarks(mWindowAndroid);
+ }
+
+ @Override
+ public void exportBookmarks() {
+ mBookmarkModel.exportBookmarks();
+ }
+
+ @Override
public void openSearchUI() {
setState(BookmarkUIState.createSearchState());
mSelectableListLayout.onStartSearch();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
@@ -35,6 +35,7 @@ public class BookmarkPage extends BasicNativePage {
mManager = new BookmarkManager(
activity, false, ((SnackbarManageable) activity).getSnackbarManager());
mManager.setBasicNativePage(this);
+ mManager.setWindow(activity.getWindowAndroid());
mTitle = activity.getString(R.string.bookmarks);
}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -227,6 +227,12 @@ CHAR-LIMIT guidelines:
<message name="IDS_SEARCH" desc="The label for a search button.">
Search
</message>
+ <message name="IDS_IMPORT_BOOKMARKS" desc="The label for the import bookmarks button.">
+ Import
+ </message>
+ <message name="IDS_EXPORT_BOOKMARKS" desc="The label for an export bookmarks button.">
+ Export
+ </message>
<message name="IDS_SHOW_INFO" desc="The label for a info button to show info.">
Show Info
</message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -150,6 +150,10 @@ jumbo_split_static_library("browser") {
"bitmap_fetcher/bitmap_fetcher_service.h",
"bitmap_fetcher/bitmap_fetcher_service_factory.cc",
"bitmap_fetcher/bitmap_fetcher_service_factory.h",
+ "importer/profile_writer.cc",
+ "importer/profile_writer.h",
+ "bookmarks/bookmark_html_writer.cc",
+ "bookmarks/bookmark_html_writer.h",
"bookmarks/bookmark_model_factory.cc",
"bookmarks/bookmark_model_factory.h",
"bookmarks/bookmark_stats.cc",
@@ -2614,8 +2618,6 @@ jumbo_split_static_library("browser") {
"banners/app_banner_infobar_delegate_desktop.h",
"banners/app_banner_manager_desktop.cc",
"banners/app_banner_manager_desktop.h",
- "bookmarks/bookmark_html_writer.cc",
- "bookmarks/bookmark_html_writer.h",
"certificate_viewer.h",
"chrome_browser_field_trials_desktop.cc",
"chrome_browser_field_trials_desktop.h",
@@ -2704,8 +2706,6 @@ jumbo_split_static_library("browser") {
"importer/importer_uma.h",
"importer/in_process_importer_bridge.cc",
"importer/in_process_importer_bridge.h",
- "importer/profile_writer.cc",
- "importer/profile_writer.h",
"lifetime/browser_close_manager.cc",
"lifetime/browser_close_manager.h",
"lifetime/termination_notification.cc",
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
@@ -9,18 +9,29 @@
#include <memory>
+#include "base/android/content_uri_utils.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
+#include "base/android/path_utils.h"
#include "base/containers/stack.h"
#include "base/containers/stack_container.h"
#include "base/i18n/string_compare.h"
+#include "base/strings/utf_string_conversions.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
+#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
+#include "chrome/browser/importer/profile_writer.h"
+#include "chrome/browser/platform_util.h"
+#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
+#include "chrome/common/importer/imported_bookmark_entry.h"
+#include "chrome/common/importer/importer_data_types.h"
+#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/browser/scoped_group_bookmark_actions.h"
@@ -30,10 +41,13 @@
#include "components/bookmarks/managed/managed_bookmark_service.h"
#include "components/prefs/pref_service.h"
#include "components/query_parser/query_parser.h"
+#include "components/search_engines/template_url.h"
#include "components/undo/bookmark_undo_service.h"
#include "components/undo/undo_manager.h"
+#include "components/url_formatter/url_fixer.h"
#include "content/public/browser/browser_thread.h"
#include "jni/BookmarkBridge_jni.h"
+#include "ui/android/window_android.h"
#include "services/identity/public/cpp/identity_manager.h"
using base::android::AttachCurrentThread;
@@ -53,6 +67,57 @@ using bookmarks::BookmarkPermanentNode;
using bookmarks::BookmarkType;
using content::BrowserThread;
+namespace internal {
+
+// Returns true if |url| has a valid scheme that we allow to import. We
+// filter out the URL with a unsupported scheme.
+bool CanImportURL(const GURL& url) {
+ // The URL is not valid.
+ if (!url.is_valid())
+ return false;
+
+ // Filter out the URLs with unsupported schemes.
+ const char* const kInvalidSchemes[] = {"wyciwyg", "place"};
+ for (size_t i = 0; i < arraysize(kInvalidSchemes); ++i) {
+ if (url.SchemeIs(kInvalidSchemes[i]))
+ return false;
+ }
+
+ // Check if |url| is about:blank.
+ if (url == url::kAboutBlankURL)
+ return true;
+
+ // If |url| starts with chrome:// or about:, check if it's one of the URLs
+ // that we support.
+ if (url.SchemeIs(content::kChromeUIScheme) ||
+ url.SchemeIs(url::kAboutScheme)) {
+ if (url.host_piece() == chrome::kChromeUIUberHost ||
+ url.host_piece() == chrome::kChromeUIAboutHost)
+ return true;
+
+ GURL fixed_url(url_formatter::FixupURL(url.spec(), std::string()));
+ for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) {
+ if (fixed_url.DomainIs(chrome::kChromeHostURLs[i]))
+ return true;
+ }
+
+ for (size_t i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) {
+ if (fixed_url == chrome::kChromeDebugURLs[i])
+ return true;
+ }
+
+ // If url has either chrome:// or about: schemes but wasn't found in the
+ // above lists, it means we don't support it, so we don't allow the user
+ // to import it.
+ return false;
+ }
+
+ // Otherwise, we assume the url has a valid (importable) scheme.
+ return true;
+}
+
+} // internal
+
namespace {
class BookmarkTitleComparer {
@@ -129,6 +194,10 @@ BookmarkBridge::~BookmarkBridge() {
bookmark_model_->RemoveObserver(this);
if (partner_bookmarks_shim_)
partner_bookmarks_shim_->RemoveObserver(this);
+ // There may be pending file dialogs, we need to tell them that we've gone
+ // away so they don't try and call back to us.
+ if (select_file_dialog_)
+ select_file_dialog_->ListenerDestroyed();
}
void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
@@ -470,6 +539,152 @@ jint BookmarkBridge::GetTotalBookmarkCount(
return count;
}
+void BookmarkBridge::ImportBookmarks(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ const JavaParamRef<jobject>& java_window) {
+ DCHECK(IsLoaded());
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ ui::WindowAndroid* window =
+ ui::WindowAndroid::FromJavaWindowAndroid(java_window);
+ CHECK(window);
+
+ select_file_dialog_ = ui::SelectFileDialog::Create(
+ this, std::make_unique<ChromeSelectFilePolicy>(nullptr));
+
+ //NOTE: extension and description are not used on Android
+ ui::SelectFileDialog::FileTypeInfo file_type_info;
+ file_type_info.extensions.resize(1);
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("htm"));
+ file_type_info.extension_description_overrides.push_back(base::ASCIIToUTF16("Netscape Bookmark"));
+ file_type_info.allowed_paths =
+ ui::SelectFileDialog::FileTypeInfo::NATIVE_OR_DRIVE_PATH;
+
+ select_file_dialog_->SelectFile(
+ ui::SelectFileDialog::SELECT_OPEN_FILE,
+ base::string16(),
+ import_path_,
+ &file_type_info,
+ 0,
+ base::FilePath::StringType(),
+ window,
+ NULL);
+
+ //NOTE: this should be called after the actual import
+ Java_BookmarkBridge_bookmarksImported(env, obj);
+}
+
+void BookmarkBridge::ExportBookmarks(JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ DCHECK(IsLoaded());
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ if (import_path_.empty()) {
+ if (!base::android::GetDownloadsDirectory(&import_path_)) {
+ LOG(ERROR) << "Could not retrieve downloads directory for bookmarks export";
+ return;
+ }
+ import_path_ = import_path_.Append(FILE_PATH_LITERAL("bookmarks.html"));
+ }
+
+ bookmark_html_writer::WriteBookmarks(profile_, import_path_, NULL);
+
+ //NOTE: nothing will be written if write permission has not been granted before
+ LOG(INFO) << "Bookmarks exported successfully in " << import_path_;
+
+ Java_BookmarkBridge_bookmarksExported(env, obj, ConvertUTF8ToJavaString(env, import_path_.MaybeAsASCII()));
+}
+
+// Attempts to create a TemplateURL from the provided data. |title| is optional.
+// If TemplateURL creation fails, returns null.
+std::unique_ptr<TemplateURL> CreateTemplateURL(const base::string16& url,
+ const base::string16& keyword,
+ const base::string16& title) {
+ if (url.empty() || keyword.empty())
+ return nullptr;
+ TemplateURLData data;
+ data.SetKeyword(keyword);
+ // We set short name by using the title if it exists.
+ // Otherwise, we use the shortcut.
+ data.SetShortName(title.empty() ? keyword : title);
+ data.SetURL(TemplateURLRef::DisplayURLToURLRef(url));
+ return std::make_unique<TemplateURL>(data);
+}
+
+void BookmarkBridge::FileSelected(const base::FilePath& path, int index,
+ void* params) {
+ base::File file;
+ if (path.IsContentUri()) {
+ file = base::OpenContentUriForRead(path);
+ } else {
+ file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
+ }
+ if (!file.IsValid()) {
+ LOG(ERROR) << "Cannot open bookmarks file for import";
+ return;
+ }
+
+ auto fileLength = file.GetLength();
+ if (-1 == fileLength) {
+ LOG(ERROR) << "Cannot read bookmarks file length";
+ return;
+ }
+
+ if (fileLength > 10 * 1024 * 1024) {
+ LOG(ERROR) << "Bookmarks file is too big";
+ return;
+ }
+
+ std::vector<char> buffer(fileLength);
+ if (-1 == file.ReadAtCurrentPos(buffer.data(), fileLength)) {
+ LOG(ERROR) << "Could not read bookmarks file";
+ return;
+ }
+
+ if (buffer.empty()) {
+ LOG(ERROR) << "Empty bookmarks file";
+ return;
+ }
+
+ std::string contents(buffer.begin(), buffer.end());
+
+ // the following import logic comes from BookmarksFileImporter class
+ std::vector<ImportedBookmarkEntry> bookmarks;
+ std::vector<importer::SearchEngineInfo> search_engines;
+
+ bookmark_html_reader::ImportBookmarksFile(
+ base::Callback<bool(void)>(),
+ base::Bind(internal::CanImportURL),
+ contents,
+ &bookmarks,
+ &search_engines,
+ nullptr);
+
+ // writing to profile will begin extensive changes and use the same bookmarks model for persisting changes
+ auto *writer = new ProfileWriter(profile_);
+
+ if (!bookmarks.empty()) {
+ writer->AddBookmarks(bookmarks, base::ASCIIToUTF16("Imported"));
+ }
+ if (!search_engines.empty()) {
+ TemplateURLService::OwnedTemplateURLVector owned_template_urls;
+ for (const auto& search_engine : search_engines) {
+ std::unique_ptr<TemplateURL> owned_template_url = CreateTemplateURL(
+ search_engine.url, search_engine.keyword, search_engine.display_name);
+ if (owned_template_url)
+ owned_template_urls.push_back(std::move(owned_template_url));
+ }
+ writer->AddKeywords(std::move(owned_template_urls), false);
+ }
+
+ LOG(INFO) << "Imported " << bookmarks.size() << " bookmarks and " <<
+ search_engines.size() << " search engines from " << import_path_;
+}
+
+void BookmarkBridge::FileSelectionCanceled(void* params) {
+}
+
void BookmarkBridge::SetBookmarkTitle(JNIEnv* env,
const JavaParamRef<jobject>& obj,
jlong id,
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser/android/bookmarks/bookmark_bridge.h
--- a/chrome/browser/android/bookmarks/bookmark_bridge.h
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
@@ -13,6 +13,8 @@
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
#include "components/bookmarks/common/android/bookmark_id.h"
#include "components/prefs/pref_change_registrar.h"
+#include "components/search_engines/template_url.h"
+#include "ui/shell_dialogs/select_file_dialog.h"
namespace bookmarks {
class BookmarkModel;
@@ -26,7 +28,8 @@ class Profile;
// bookmark page. This fetches the bookmarks, title, urls, folder
// hierarchy.
class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
- public PartnerBookmarksShim::Observer {
+ public PartnerBookmarksShim::Observer,
+ public ui::SelectFileDialog::Listener {
public:
BookmarkBridge(JNIEnv* env,
const base::android::JavaRef<jobject>& obj,
@@ -36,6 +39,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
bool IsDoingExtensiveChanges(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
+ // SelectFileDialog::Listener implementation.
+ void FileSelected(const base::FilePath& path,
+ int index,
+ void* params) override;
+ void FileSelectionCanceled(void* params) override;
+
jboolean IsEditBookmarksEnabled(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
@@ -116,6 +125,13 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
jlong id,
jint type);
+ void ImportBookmarks(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jobject>& java_window);
+
+ void ExportBookmarks(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
void SetBookmarkTitle(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong id,
@@ -261,12 +277,14 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
void ShimBeingDeleted(PartnerBookmarksShim* shim) override;
Profile* profile_;
+ base::FilePath import_path_;
JavaObjectWeakGlobalRef weak_java_ref_;
bookmarks::BookmarkModel* bookmark_model_; // weak
bookmarks::ManagedBookmarkService* managed_bookmark_service_; // weak
std::unique_ptr<bookmarks::ScopedGroupBookmarkActions>
grouped_bookmark_actions_;
PrefChangeRegistrar pref_change_registrar_;
+ scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
// Information about the Partner bookmarks (must check for IsLoaded()).
// This is owned by profile.
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -97,12 +97,14 @@ void ProfileWriter::AddHistoryPage(const history::URLRows& page,
HistoryServiceFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS)
->AddPagesWithDetails(page, visit_source);
+#if !defined(OS_ANDROID)
// Measure the size of the history page after Auto Import on first run.
if (first_run::IsChromeFirstRun() &&
visit_source == history::SOURCE_IE_IMPORTED) {
UMA_HISTOGRAM_COUNTS_1M("Import.ImportedHistorySize.AutoImportFromIE",
page.size());
}
+#endif
}
void ProfileWriter::AddHomepage(const GURL& home_page) {
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
--- a/chrome/common/BUILD.gn
+++ b/chrome/common/BUILD.gn
@@ -441,6 +441,9 @@ static_library("common") {
sources += [
"media/chrome_media_drm_bridge_client.cc",
"media/chrome_media_drm_bridge_client.h",
+ ## Bromite dependencies for bookmark import functionality
+ "importer/imported_bookmark_entry.cc",
+ "importer/imported_bookmark_entry.h",
]
} else {
# Non-Android.
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
--- a/chrome/utility/BUILD.gn
+++ b/chrome/utility/BUILD.gn
@@ -58,8 +58,6 @@ static_library("utility") {
if (!is_android) {
sources += [
- "importer/bookmark_html_reader.cc",
- "importer/bookmark_html_reader.h",
"importer/bookmarks_file_importer.cc",
"importer/bookmarks_file_importer.h",
"importer/edge_database_reader_win.cc",
@@ -162,6 +160,11 @@ static_library("utility") {
]
}
+ sources += [
+ "importer/bookmark_html_reader.cc",
+ "importer/bookmark_html_reader.h",
+ ]
+
if (use_nss_certs) {
sources += [
"importer/nss_decryptor_system_nss.cc",
diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc
--- a/chrome/utility/importer/bookmark_html_reader.cc
+++ b/chrome/utility/importer/bookmark_html_reader.cc
@@ -17,7 +17,9 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
+#if !defined(OS_ANDROID)
#include "chrome/utility/importer/favicon_reencode.h"
+#endif
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "net/base/data_url.h"
@@ -56,6 +58,7 @@ bool GetAttribute(const std::string& attribute_list,
return true;
}
+#if !defined(OS_ANDROID)
// Given the URL of a page and a favicon data URL, adds an appropriate record
// to the given favicon usage vector.
void DataURLToFaviconUsage(const GURL& link_url,
@@ -86,6 +89,7 @@ void DataURLToFaviconUsage(const GURL& link_url,
favicons->push_back(usage);
}
+#endif
} // namespace
@@ -108,12 +112,10 @@ static std::string stripDt(const std::string& lineDt) {
void ImportBookmarksFile(
const base::Callback<bool(void)>& cancellation_callback,
const base::Callback<bool(const GURL&)>& valid_url_callback,
- const base::FilePath& file_path,
+ const std::string& content,
std::vector<ImportedBookmarkEntry>* bookmarks,
std::vector<importer::SearchEngineInfo>* search_engines,
favicon_base::FaviconUsageDataList* favicons) {
- std::string content;
- base::ReadFileToString(file_path, &content);
std::vector<std::string> lines = base::SplitString(
content, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
@@ -126,6 +128,7 @@ void ImportBookmarksFile(
std::vector<base::string16> path;
size_t toolbar_folder_index = 0;
std::string charset = "UTF-8"; // If no charset is specified, assume utf-8.
+
for (size_t i = 0;
i < lines.size() &&
(cancellation_callback.is_null() || !cancellation_callback.Run());
@@ -218,10 +221,12 @@ void ImportBookmarksFile(
}
bookmarks->push_back(entry);
+#if !defined(OS_ANDROID)
// Save the favicon. DataURLToFaviconUsage will handle the case where
// there is no favicon.
if (favicons)
DataURLToFaviconUsage(url, favicon, favicons);
+#endif
continue;
}
@@ -278,6 +283,22 @@ void ImportBookmarksFile(
}
}
+void ImportBookmarksFile(
+ const base::Callback<bool(void)>& cancellation_callback,
+ const base::Callback<bool(const GURL&)>& valid_url_callback,
+ const base::FilePath& file_path,
+ std::vector<ImportedBookmarkEntry>* bookmarks,
+ std::vector<importer::SearchEngineInfo>* search_engines,
+ favicon_base::FaviconUsageDataList* favicons) {
+ std::string content;
+ if (!base::ReadFileToString(file_path, &content)) {
+ LOG(ERROR) << "Could not directly read bookmarks import file";
+ return;
+ }
+
+ ImportBookmarksFile(cancellation_callback, valid_url_callback, content, bookmarks, search_engines, favicons);
+}
+
bool CanImportURLAsSearchEngine(const GURL& url,
std::string* search_engine_url) {
std::string url_spec = url.possibly_invalid_spec();
diff --git a/chrome/utility/importer/bookmark_html_reader.h b/chrome/utility/importer/bookmark_html_reader.h
--- a/chrome/utility/importer/bookmark_html_reader.h
+++ b/chrome/utility/importer/bookmark_html_reader.h
@@ -51,6 +51,15 @@ void ImportBookmarksFile(
std::vector<importer::SearchEngineInfo>* search_engines,
favicon_base::FaviconUsageDataList* favicons);
+void ImportBookmarksFile(
+ const base::Callback<bool(void)>& cancellation_callback,
+ const base::Callback<bool(const GURL&)>& valid_url_callback,
+ const std::string& content,
+ std::vector<ImportedBookmarkEntry>* bookmarks,
+ std::vector<importer::SearchEngineInfo>* search_engines,
+ favicon_base::FaviconUsageDataList* favicons);
+
+
// Returns true if |url| should be imported as a search engine, i.e. because it
// has replacement terms. Chrome treats such bookmarks as search engines rather
// than true bookmarks.
--
2.11.0
File diff suppressed because it is too large Load Diff
@@ -2,102 +2,205 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 29 Aug 2018 11:03:44 +0200
Subject: Add custom tab intents privacy option
---
chrome/android/java/res/values/values.xml | 3 +++
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
.../org/chromium/chrome/browser/LaunchIntentDispatcher.java | 2 ++
.../chrome/browser/preferences/privacy/PrivacyPreferences.java | 10 ++++++++++
chrome/android/java/strings/android_chrome_strings.grd | 7 +++++++
5 files changed, 27 insertions(+)
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/values/values.xml b/chrome/android/java/res/values/values.xml
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -18,6 +18,9 @@
<item name="top_controls_show_threshold" format="float" type="dimen">0.5</item>
<item name="top_controls_hide_threshold" format="float" type="dimen">0.5</item>
+ <string name="allow_custom_tab_intents_title">Allow custom tab intents from applications</string>
+ <string name="allow_custom_tab_intents_summary">When disabled, all custom tab intents will be processed as regular navigation instead</string>
+
<!-- The number of thumbnails that the thumbnail cache can hold. -->
<integer name="default_thumbnail_cache_size">5</integer>
<!-- The number of approximation thumbnails that the approximation cache can hold. -->
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
@@ -43,6 +43,11 @@
android:title="@string/clear_browsing_data_title"
android:summary="@string/clear_browsing_data_summary"
android:fragment="org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment" />
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
@@ -55,6 +55,16 @@
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="sync_and_services_link_divider"
android:layout="@layout/divider_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
@@ -39,6 +39,7 @@ import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
@@ -44,6 +44,7 @@ import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferences;
import org.chromium.chrome.browser.searchwidget.SearchActivity;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin;
@@ -273,6 +274,7 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
+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;
@@ -57,6 +58,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.
@@ -267,6 +270,9 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
*/
public static boolean isCustomTabIntent(Intent intent) {
if (intent == null) return false;
+ if (!ContextUtils.getAppSharedPreferences().getBoolean(PrivacyPreferences.PREF_ALLOW_CUSTOM_TAB_INTENTS, false)) 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;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
@@ -38,6 +38,7 @@ public class PrivacyPreferences extends PreferenceFragment
implements OnPreferenceChangeListener {
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
@@ -101,6 +102,11 @@ public class PrivacyPreferences extends PreferenceFragment
navigationErrorPref.setOnPreferenceChangeListener(this);
navigationErrorPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
@@ -286,6 +292,10 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
newIntent.setData(uri);
newIntent.setClassName(context, CustomTabActivity.class.getName());
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+ if (ContextUtils.getAppSharedPreferences()
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
+ newIntent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true);
+
ChromeBaseCheckBoxPreference searchSuggestionsPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_SEARCH_SUGGESTIONS);
searchSuggestionsPref.setOnPreferenceChangeListener(this);
@@ -123,6 +129,10 @@ public class PrivacyPreferences extends PreferenceFragment
recordNetworkPredictionEnablingUMA((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
// Since configureIntentForResizableCustomTab() might change the componenet/class
// associated with the passed intent, it needs to be called after #setClassName(context,
// CustomTabActivity.class.getName());
@@ -413,6 +423,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
@@ -81,6 +81,9 @@ public class PrivacySettings
private ViewGroup mDialogContainer;
private BottomSheetController mBottomSheetController;
+ private ChromeSwitchPreference allowCustomTabIntentsPref;
+ private ChromeSwitchPreference openExternalLinksPref;
+
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
PrivacyPreferencesManagerImpl privacyPrefManager =
@@ -148,6 +151,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();
@@ -164,6 +170,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_CAN_MAKE_PAYMENT.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3972,6 +3972,13 @@ However, you arent invisible. Going private doesnt hide your browsing from
Browse
</message>
+ } 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;
}
@@ -186,6 +200,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
@@ -4756,6 +4756,21 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</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>
@@ -105,9 +208,15 @@ diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/and
+ Allow applications to open custom tab intents, similar to webview.
+ </message>
+
<!-- Migration strings -->
<message name="IDS_UPDATING_CHROME" desc="String that indicates that Chrome is updating">
Updating Chrome...
--
2.11.0
+ <!-- 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
+96 -31
View File
@@ -3,41 +3,107 @@ 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 | 2 ++
.../java/src/org/chromium/chrome/browser/ChromeActivity.java | 2 ++
.../org/chromium/chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
chrome/android/java/strings/android_chrome_strings.grd | 3 +++
4 files changed, 12 insertions(+), 1 deletion(-)
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
@@ -80,6 +80,8 @@
android:title="@string/menu_help" />
<item android:id="@+id/enter_vr_id"
android:title="@string/enter_vr" />
@@ -159,6 +159,9 @@
<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:title="@string/menu_exit"
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
</group>
<!-- Items shown only in the tab switcher -->
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -2096,6 +2096,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
RecordUserAction.record("MobileMenuSettings");
} else if (id == R.id.show_menu) {
showAppMenuForKeyboardEvent();
@@ -185,6 +188,9 @@
<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
@@ -223,6 +223,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.
@@ -2179,6 +2181,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.find_in_page_id) {
if (mFindToolbarManager == null) return 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
@@ -61,6 +61,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;
@@ -2311,6 +2312,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
@@ -87,7 +87,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
@@ -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.
@@ -50,19 +116,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLife
}
@Override
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3050,6 +3050,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_PREFERENCES" desc="Menu item for opening browser preferences. [CHAR-LIMIT=27]">
Settings
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
@@ -3484,6 +3484,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</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_CLOSE_ALL_TABS" desc="Menu item for closing all open tabs. [CHAR-LIMIT=27]">
Close all tabs
<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.11.0
--
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
@@ -494,6 +494,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[] = {
@@ -4118,7 +4134,11 @@ const FeatureEntry kFeatureEntries[] = {
kOsMac | kOsLinux | kOsLacros | 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"
@@ -295,6 +297,15 @@ AutocompleteController::AutocompleteController(
in_start_(false),
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
@@ -483,6 +483,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"
@@ -652,6 +653,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
@@ -9,6 +9,8 @@
#include <algorithm>
#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/ranges/algorithm.h"
@@ -607,6 +609,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,113 @@
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 | 3 ++-
6 files changed, 26 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
@@ -4718,7 +4718,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
@@ -1214,6 +1214,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
@@ -634,6 +634,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 @@ namespace features {
const base::Feature kExpectCTReporting{"ExpectCTReporting",
base::FEATURE_ENABLED_BY_DEFAULT};
+
+// Enable save-data header separately (without enabled data reduction service).
+const base::Feature kEnableSaveDataHeader{"EnableSaveDataHeader",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
const 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
@@ -45,7 +45,8 @@ COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kMdnsResponderGeneratedNameListing;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kOpaqueResponseBlockingV01;
-
+COMPONENT_EXPORT(NETWORK_CPP)
+extern const base::Feature kEnableSaveDataHeader;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kTrustTokens;
--
2.25.1
@@ -5,21 +5,24 @@ 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 ++++
net/socket/client_socket_pool_manager.cc | 16 ++++++++++++++++
7 files changed, 42 insertions(+)
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
@@ -912,6 +912,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
net::kEffectiveConnectionType4G},
@@ -979,6 +979,11 @@ const FeatureEntry::Choice kForceColorProfileChoices[] = {
switches::kForceDisplayColorProfile, "hdr10"},
};
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
@@ -27,25 +30,25 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
+};
+
// Ensure that all effective connection types returned by Network Quality
// Estimator (NQE) are also exposed via flags.
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
@@ -2495,6 +2500,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kMaterialDesignIncognitoNTPName,
flag_descriptions::kMaterialDesignIncognitoNTPDescription, kOsAndroid,
FEATURE_VALUE_TYPE(features::kMaterialDesignIncognitoNTP)},
const FeatureEntry::Choice kMemlogModeChoices[] = {
{flags_ui::kGenericExperimentChoiceDisabled, "", ""},
{flag_descriptions::kMemlogModeMinimal, heap_profiling::kMemlogMode,
@@ -4647,6 +4652,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)},
{"safe-search-url-reporting",
flag_descriptions::kSafeSearchUrlReportingName,
flag_descriptions::kSafeSearchUrlReportingDescription, kOsAll,
{"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
@@ -1231,6 +1231,10 @@ const char kMaterialDesignIncognitoNTPDescription[] =
"If enabled, the Incognito New Tab page uses the new material design with "
"a better readable text.";
@@ -1777,6 +1777,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[] =
@@ -57,9 +60,9 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
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
@@ -748,6 +748,9 @@ extern const char kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards[];
extern const char kMaterialDesignIncognitoNTPName[];
extern const char kMaterialDesignIncognitoNTPDescription[];
@@ -996,6 +996,9 @@ extern const char kLogJsConsoleMessagesDescription[];
extern const char kUnthrottledNestedTimeoutName[];
extern const char kUnthrottledNestedTimeoutDescription[];
+extern const char kMaxConnectionsPerHostName[];
+extern const char kMaxConnectionsPerHostDescription[];
@@ -70,16 +73,14 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
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,6 +8,9 @@
@@ -8,4 +8,7 @@
namespace features {
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
+ kMaxConnectionsPerHostChoice15[] = "15";
+
const char kDnsOverHttpsChoiceDefault[] = "Disabled",
kDnsOverHttpsChoiceGoogle[] = "Google",
kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
} // 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
@@ -91,13 +92,13 @@ diff --git a/components/network_session_configurator/common/network_features.h b
+ kMaxConnectionsPerHostChoice6[],
+ kMaxConnectionsPerHostChoice15[];
+
// DNS over HTTPS server endpoint choices
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
} // 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
@@ -21,6 +21,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
@@ -19,6 +19,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
// Enables the QUIC protocol. This is a temporary testing flag.
NETWORK_SWITCH(kEnableQuic, "enable-quic")
@@ -105,32 +106,35 @@ diff --git a/components/network_session_configurator/common/network_switch_list.
+// (15 instead of 6, mirroring the value Mozilla uses).
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
+
// Enable use of experimental TCP sockets API for sending data in the
// SYN packet.
NETWORK_SWITCH(kEnableTcpFastOpen, "enable-tcp-fastopen")
// 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
@@ -6,8 +6,10 @@
#include <memory>
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/string_number_conversions.h"
#include "net/base/load_flags.h"
#include "net/http/http_proxy_client_socket_pool.h"
#include "net/http/http_request_info.h"
@@ -19,6 +21,7 @@
#include "net/socket/ssl_client_socket_pool.h"
#include "net/socket/transport_client_socket_pool.h"
#include "net/ssl/ssl_config.h"
@@ -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"
namespace net {
@@ -314,6 +317,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
+
+#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);
@@ -150,6 +154,5 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket
return g_max_sockets_per_group[pool_type];
}
--
2.11.0
--
2.25.1
@@ -3,34 +3,35 @@ 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 | 5 +++++
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
media/base/media_switches.cc | 6 +-----
4 files changed, 14 insertions(+), 5 deletions(-)
media/base/media_switches.cc | 4 ----
4 files changed, 12 insertions(+), 4 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
@@ -3330,6 +3330,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kUseGoogleLocalNtp)},
#endif // !defined(OS_ANDROID)
@@ -3349,6 +3349,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kWebRtcRemoteEventLogName,
flag_descriptions::kWebRtcRemoteEventLogDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kWebRtcRemoteEventLog)},
+ {"resume-background-video",
+ flag_descriptions::kResumeBackgroundVideoName,
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
+
#if defined(OS_MACOSX)
{"mac-rtl", flag_descriptions::kMacRTLName,
flag_descriptions::kMacRTLDescription, kOsMac,
#endif
{"enable-webrtc-srtp-aes-gcm", flag_descriptions::kWebrtcSrtpAesGcmName,
flag_descriptions::kWebrtcSrtpAesGcmDescription, kOsAll,
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
@@ -791,6 +791,11 @@ const char kEnablePictureInPictureName[] = "Enable Picture-in-Picture.";
const char kEnablePictureInPictureDescription[] =
"Enable the Picture-in-Picture feature for videos.";
@@ -1305,6 +1305,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[] =
@@ -43,9 +44,9 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
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
@@ -479,6 +479,9 @@ extern const char kOOPHPStackModePseudo[];
extern const char kEnablePictureInPictureName[];
extern const char kEnablePictureInPictureDescription[];
@@ -713,6 +713,9 @@ extern const char kEnablePortalsDescription[];
extern const char kEnablePortalsCrossOriginName[];
extern const char kEnablePortalsCrossOriginDescription[];
+extern const char kResumeBackgroundVideoName[];
+extern const char kResumeBackgroundVideoDescription[];
@@ -56,19 +57,17 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
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
@@ -217,11 +217,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
@@ -287,11 +287,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
// when in background.
const base::Feature kResumeBackgroundVideo {
"resume-background-video",
-#if defined(OS_ANDROID)
-#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ base::FEATURE_DISABLED_BY_DEFAULT
};
// Enable Media Capabilities with finch-parameters.
--
2.11.0
// When enabled, MediaCapabilities will check with GPU Video Accelerator
--
2.25.1
@@ -2,109 +2,154 @@ 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 | 5 +++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
net/dns/host_resolver_impl.cc | 10 ++++++++--
services/network/public/cpp/features.cc | 3 +++
services/network/public/cpp/features.h | 2 ++
6 files changed, 25 insertions(+), 2 deletions(-)
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 | 4 ++++
services/network/public/cpp/features.h | 2 ++
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
@@ -3382,6 +3382,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kEnableVirtualKeyboardUkm)},
#endif // OS_CHROMEOS
@@ -5586,6 +5586,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)},
+
#if !defined(OS_ANDROID)
{"enable-picture-in-picture",
flag_descriptions::kEnablePictureInPictureName,
#endif // BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_ANDROID)
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
@@ -795,6 +795,10 @@ const char kOOPHPStackModeNative[] = "Native";
const char kOOPHPStackModeNativeWithThreadNames[] = "Native with thread names";
const char kOOPHPStackModePseudo[] = "Trace events";
@@ -3305,6 +3305,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 kEnablePictureInPictureName[] = "Enable Picture-in-Picture.";
const char kEnablePictureInPictureDescription[] =
"Enable the Picture-in-Picture feature for videos.";
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
@@ -482,6 +482,9 @@ extern const char kOOPHPStackModeNative[];
extern const char kOOPHPStackModeNativeWithThreadNames[];
extern const char kOOPHPStackModePseudo[];
@@ -785,6 +785,9 @@ extern const char kEnableWasmLazyCompilationName[];
extern const char kEnableWasmLazyCompilationDescription[];
extern const char kEnableWasmTieringName[];
+extern const char kIPv6ProbingName[];
+extern const char kIPv6ProbingDescription[];
+
extern const char kEnablePictureInPictureName[];
extern const char kEnablePictureInPictureDescription[];
extern const char kEnableWasmTieringDescription[];
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -78,6 +78,7 @@
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"
+#include "services/network/public/cpp/features.h"
#include "url/url_canon_ip.h"
#if BUILDFLAG(ENABLE_MDNS)
@@ -2773,8 +2774,13 @@ bool HostResolverImpl::IsIPv6Reachable(const NetLogWithSource& net_log) {
bool cached = true;
if ((tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
kIPv6ProbePeriodMs) {
- last_ipv6_probe_result_ =
- IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
@@ -4092,8 +4093,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
+ last_ipv6_probe_result_ = true;
+ SetLastIPv6ProbeResult(true);
+ } else {
+ last_ipv6_probe_result_ =
+ IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
+ SetLastIPv6ProbeResult(
IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
+ }
last_ipv6_probe_time_ = tick_clock_->NowTicks();
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
@@ -14,6 +14,9 @@ const base::Feature kExpectCTReporting{"ExpectCTReporting",
@@ -36,6 +36,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kThrottleDelayable{"ThrottleDelayable",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kNetworkErrorLogging{"NetworkErrorLogging",
base::FEATURE_ENABLED_BY_DEFAULT};
+
+// Enable IPv6 ping probes to RIPE DNS.
+const base::Feature kIPv6Probing{"IPv6Probing",
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Enables the network service.
const base::Feature kNetworkService{"NetworkService",
base::FEATURE_DISABLED_BY_DEFAULT};
+ 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
@@ -18,6 +18,8 @@ extern const base::Feature kNetworkErrorLogging;
@@ -18,6 +18,8 @@ extern const base::Feature kExpectCTReporting;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kNetworkService;
extern const base::Feature kNetworkErrorLogging;
COMPONENT_EXPORT(NETWORK_CPP)
+extern const base::Feature kIPv6Probing;
+COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kOutOfBlinkCors;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kReporting;
--
2.11.0
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kThrottleDelayable;
--
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
@@ -3348,6 +3348,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
@@ -3673,6 +3673,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
@@ -2100,6 +2100,9 @@ extern const char kQueryTilesDescription[];
extern const char kQueryTilesNTPName[];
extern const char kQueryTilesNTPDescription[];
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,155 @@
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 | 4 ++++
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, 28 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
@@ -6983,6 +6983,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
@@ -5952,6 +5952,9 @@ extern const char kLacrosScreenCoordinatesDescription[];
#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
@@ -3627,6 +3627,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
@@ -100,6 +100,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
@@ -121,6 +121,10 @@ const base::Feature kBackForwardCacheMemoryControls {
#endif
};
+// Enables vibration; an user gesture will still be required if enabled.
+const 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
@@ -321,6 +321,8 @@ CONTENT_EXPORT extern const base::FeatureParam<base::TimeDelta>
kCompositorLockTimeout;
#endif // BUILDFLAG(IS_ANDROID)
+CONTENT_EXPORT extern const base::Feature kVibration;
+
#if BUILDFLAG(IS_MAC)
CONTENT_EXPORT extern const base::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
@@ -87,6 +87,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableBlockingFocusWithoutUserActivation(
bool);
BLINK_PLATFORM_EXPORT static void EnableClickPointerEvent(bool enable);
+ BLINK_PLATFORM_EXPORT static void EnableVibration(bool);
BLINK_PLATFORM_EXPORT static void EnableCompositeBGColorAnimation(
bool enable);
BLINK_PLATFORM_EXPORT static void EnableCanvas2dImageChromium(bool);
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
@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/mojo/mojo_helper.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
// Maximum number of entries in a vibration pattern.
const unsigned kVibrationPatternLengthMax = 99;
@@ -153,6 +154,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
@@ -156,6 +156,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
}
+void WebRuntimeFeatures::EnableVibration(bool enable) {
+ RuntimeEnabledFeatures::SetVibrationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableKeyboardAccessibleTooltip(bool enable) {
RuntimeEnabledFeatures::SetKeyboardAccessibleTooltipEnabled(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
@@ -1611,6 +1611,10 @@
name: "OrientationEvent",
status: {"Android": "stable"},
},
+ {
+ name: "Vibration",
+ status: "stable",
+ },
{
name: "OriginIsolationHeader",
status: "stable",
--
2.25.1
@@ -1,184 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 22 Oct 2018 21:29:53 +0200
Subject: Add flags to disable device motion and orientation APIs
Both flags will be disabled by default and prevent usage of gyroscope and
legacy acceleration events.
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 8 ++++++++
chrome/browser/flag_descriptions.h | 6 ++++++
content/child/runtime_features.cc | 3 +++
content/public/common/content_features.cc | 10 ++++++++++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 2 ++
third_party/blink/renderer/modules/modules_initializer.cc | 9 ++++++---
.../blink/renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
10 files changed, 59 insertions(+), 3 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
@@ -2900,6 +2900,12 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-generic-sensor", flag_descriptions::kEnableGenericSensorName,
flag_descriptions::kEnableGenericSensorDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kGenericSensor)},
+ {"enable-device-motion", flag_descriptions::kEnableDeviceMotionName,
+ flag_descriptions::kEnableDeviceMotionDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceMotion)},
+ {"enable-device-orientation", flag_descriptions::kEnableDeviceOrientationName,
+ flag_descriptions::kEnableDeviceOrientationDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceOrientation)},
{"enable-generic-sensor-extra-classes",
flag_descriptions::kEnableGenericSensorExtraClassesName,
flag_descriptions::kEnableGenericSensorExtraClassesDescription, kOsAll,
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
@@ -567,6 +567,14 @@ const char kEnableGenericSensorDescription[] =
"Accelerometer, LinearAccelerationSensor, Gyroscope, "
"AbsoluteOrientationSensor and RelativeOrientationSensor interfaces.";
+const char kEnableDeviceMotionName[] = "Enable device motion";
+const char kEnableDeviceMotionDescription[] =
+ "Enable device motion API which is used to detect changes in acceleration";
+
+const char kEnableDeviceOrientationName[] = "Enable device orientation";
+const char kEnableDeviceOrientationDescription[] =
+ "Enable device orientation API which is used to detect changes in orientation";
+
const char kEnableGenericSensorExtraClassesName[] =
"Generic Sensor Extra Classes";
const char kEnableGenericSensorExtraClassesDescription[] =
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
@@ -368,6 +368,12 @@ extern const char kEnableEnumeratingAudioDevicesDescription[];
extern const char kEnableGenericSensorName[];
extern const char kEnableGenericSensorDescription[];
+extern const char kEnableDeviceMotionName[];
+extern const char kEnableDeviceMotionDescription[];
+
+extern const char kEnableDeviceOrientationName[];
+extern const char kEnableDeviceOrientationDescription[];
+
extern const char kEnableGenericSensorExtraClassesName[];
extern const char kEnableGenericSensorExtraClassesDescription[];
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
@@ -145,6 +145,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
base::FeatureList::IsEnabled(features::kSharedArrayBuffer) ||
base::FeatureList::IsEnabled(features::kWebAssemblyThreads));
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
+
if (command_line.HasSwitch(switches::kDisableSharedWorkers))
WebRuntimeFeatures::EnableSharedWorker(false);
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
@@ -598,6 +598,16 @@ const base::Feature kWebRtcHideLocalIpsWithMdns{
// https://wicg.github.io/webusb
const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the device motion API used to track device acceleration;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceMotion{"DeviceMotion",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables the device orientation API used to track device orientation;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceOrientation{"DeviceOrientation",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Controls whether WebVR VSync-aligned render loop timing is enabled.
const base::Feature kWebVrVsyncAlign{"WebVrVsyncAlign",
base::FEATURE_ENABLED_BY_DEFAULT};
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
@@ -156,6 +156,8 @@ CONTENT_EXPORT extern const char kWebXrRenderPathParamValueGpuFence[];
CONTENT_EXPORT extern const char kWebXrRenderPathParamValueSharedBuffer[];
#endif // defined(OS_ANDROID)
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
+
#if !defined(OS_ANDROID)
CONTENT_EXPORT extern const base::Feature kWebUIPolymer2;
#endif // !defined(OS_ANDROID)
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
@@ -97,6 +97,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableCSSFragmentIdentifiers(bool);
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
BLINK_PLATFORM_EXPORT static void EnableDatabase(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
BLINK_PLATFORM_EXPORT static void EnableDecodeToYUV(bool);
BLINK_PLATFORM_EXPORT static void EnableDisplayCutoutAPI(bool);
BLINK_PLATFORM_EXPORT static void EnableFastMobileScrolling(bool);
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
--- a/third_party/blink/renderer/modules/modules_initializer.cc
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
@@ -233,9 +233,12 @@ void ModulesInitializer::InitInspectorAgentSession(
void ModulesInitializer::OnClearWindowObjectInMainWorld(
Document& document,
const Settings& settings) const {
- DeviceMotionController::From(document);
- DeviceOrientationController::From(document);
- DeviceOrientationAbsoluteController::From(document);
+ if (RuntimeEnabledFeatures::DeviceMotionEnabled())
+ DeviceMotionController::From(document);
+ if (RuntimeEnabledFeatures::DeviceOrientationEnabled()) {
+ DeviceOrientationController::From(document);
+ DeviceOrientationAbsoluteController::From(document);
+ }
NavigatorGamepad::From(document);
NavigatorServiceWorker::From(document);
DOMWindowStorageController::From(document);
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
@@ -152,6 +152,14 @@ void WebRuntimeFeatures::EnableDatabase(bool enable) {
RuntimeEnabledFeatures::SetDatabaseEnabled(enable);
}
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableDecodeToYUV(bool enable) {
RuntimeEnabledFeatures::SetDecodeToYUVEnabled(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
@@ -371,6 +371,14 @@
status: "stable",
},
{
+ name: "DeviceMotion",
+ status: "stable",
+ },
+ {
+ name: "DeviceOrientation",
+ status: "stable",
+ },
+ {
name: "DecodeToYUV",
status: "experimental",
},
--
2.11.0
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,700 @@
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 | 26 ++++++++
.../browser/bookmarks/BookmarkBridge.java | 60 +++++++++++++++++++
.../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, 202 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
@@ -64,6 +64,10 @@
<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" />
@@ -182,6 +186,9 @@
<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/track_prices_row_menu_id"
android:title="@string/menu_track_prices"
android:icon="@drawable/ic_trending_down_black" />
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
@@ -75,6 +75,8 @@ 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.BookmarkBridge;
+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;
@@ -2193,6 +2195,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(),
@@ -2245,6 +2249,28 @@ 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 BookmarkBridge bridge = mBookmarkBridgeSupplier.get();
+ final BookmarkModel bookmarkModel = new BookmarkModel();
+ bookmarkModel.finishLoadingBookmarkModel(() -> {
+ for (int i = 0; i < tabModel.getCount(); i++) {
+ Tab tab = tabModel.getTabAt(i);
+ if (tab.isNativePage()) {
+ continue;
+ }
+ bridge.addToTabsCollection(this, tab);
+ }
+ bridge.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;
@@ -39,6 +40,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.BookmarkType;
import org.chromium.components.commerce.PriceTracking.ProductPrice;
@@ -86,6 +91,7 @@ import java.io.File;
* bookmark model stored in native.
*/
public class BookmarkBridge {
+ private static final String TAG = "BookmarkBridge";
private final Profile mProfile;
private boolean mIsDestroyed;
private boolean mIsDoingExtensiveChanges;
@@ -603,6 +609,16 @@ public 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.
*/
@@ -1258,6 +1274,49 @@ public 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.
@@ -1555,6 +1614,7 @@ public 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
@@ -614,6 +614,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 =
@@ -639,6 +640,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
@@ -435,6 +435,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());
@@ -482,6 +487,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(),
};
@@ -534,6 +540,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
@@ -121,6 +121,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
@@ -117,6 +117,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
@@ -3573,6 +3573,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_TRACK_PRICES" desc="Menu item for tracking prices on tabs. [CHAR_LIMIT=27]">
Track prices
</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
@@ -34,6 +34,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";
@@ -75,7 +76,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(),
std::move(sync_metadata_str));
}
@@ -83,6 +85,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,
std::string sync_metadata_str) {
ids_reassigned_ = false;
@@ -104,6 +107,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));
FinalizeChecksum();
@@ -120,6 +124,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();
@@ -127,7 +132,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;
@@ -135,12 +141,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;
}
@@ -190,6 +197,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())
@@ -221,6 +229,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);
@@ -456,11 +470,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
@@ -48,6 +48,7 @@ class BookmarkCodec {
base::Value 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,
std::string sync_metadata_str);
@@ -60,6 +61,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);
@@ -105,6 +107,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[];
// Possible values for kTypeKey.
static const char kTypeURL[];
@@ -121,6 +124,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);
@@ -132,7 +136,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_); }
@@ -103,6 +104,7 @@ class BookmarkLoadDetails {
raw_ptr<BookmarkPermanentNode> bb_node_ = nullptr;
raw_ptr<BookmarkPermanentNode> other_folder_node_ = nullptr;
raw_ptr<BookmarkPermanentNode> 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
@@ -571,7 +571,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) {
@@ -825,6 +825,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
@@ -121,6 +121,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_;
@@ -411,6 +417,7 @@ class BookmarkModel : public BookmarkUndoProvider,
raw_ptr<BookmarkPermanentNode> bookmark_bar_node_ = nullptr;
raw_ptr<BookmarkPermanentNode> other_node_ = nullptr;
raw_ptr<BookmarkPermanentNode> 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";
@@ -225,6 +229,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.
@@ -250,6 +252,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
@@ -57,7 +57,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
@@ -419,6 +419,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,126 @@
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
---
chrome/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 +++++
.../app/appmenu/AppMenuPropertiesDelegateImpl.java | 14 ++++++++++++++
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
.../ui/android/strings/android_chrome_strings.grd | 4 ++++
7 files changed, 32 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
@@ -46,6 +46,9 @@
<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
@@ -106,6 +106,9 @@
<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
@@ -2219,6 +2219,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
@@ -2417,6 +2417,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
@@ -527,6 +527,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);
@@ -1157,6 +1158,19 @@ 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);
+ String url = currentTab.getUrl().getSpec();
+ viewSourceMenuItem.setVisible(!url.isEmpty() && !url.startsWith("view-source:"));
+ }
+
/**
* 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
@@ -220,6 +220,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
@@ -1,207 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 18 Oct 2017 21:26:53 +0200
Subject: Add menu option to toggle global Javascript preference
---
chrome/android/java/res/menu/custom_tabs_menu.xml | 13 ++++++++
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 ++++++++++++++++++++++
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
.../java/strings/android_chrome_strings.grd | 11 +++++++
7 files changed, 92 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
@@ -49,6 +49,7 @@
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk"
android:orderInCategory="2" />
+
<item android:id="@+id/request_desktop_site_row_menu_id"
android:title="@null"
android:orderInCategory="2">
@@ -61,6 +62,18 @@
</menu>
</item>
+ <item android:id="@+id/enable_javascript_row_menu_id"
+ android:title="@null"
+ android:orderInCategory="2">
+ <menu>
+ <item android:id="@+id/enable_javascript_id"
+ android:title="@string/menu_enable_javascript" />
+ <item android:id="@+id/enable_javascript_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<!-- Title is intentionally left blank in xml and will be set in java. -->
<item android:id="@+id/open_in_browser_id"
android:title=""
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
@@ -61,6 +61,7 @@
android:title="@string/menu_add_to_homescreen" />
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk" />
+
<item android:id="@+id/request_desktop_site_row_menu_id"
android:title="@null">
<menu>
@@ -71,6 +72,18 @@
android:checkable="true" />
</menu>
</item>
+
+ <item android:id="@+id/enable_javascript_row_menu_id"
+ android:title="@null">
+ <menu>
+ <item android:id="@+id/enable_javascript_id"
+ android:title="@string/menu_enable_javascript" />
+ <item android:id="@+id/enable_javascript_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<item android:id="@+id/reader_mode_prefs_id"
android:title="@string/menu_reader_mode_prefs"
android:icon="@drawable/reader_mode_prefs_icon" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -2196,6 +2196,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
final boolean usingDesktopUserAgent = currentTab.getUseDesktopUserAgent();
currentTab.setUseDesktopUserAgent(!usingDesktopUserAgent, reloadOnChange);
RecordUserAction.record("MobileMenuRequestDesktopSite");
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
} else if (id == R.id.reader_mode_prefs_id) {
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
} else {
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
@@ -1709,6 +1709,14 @@ public class ChromeTabbedActivity
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
}
RecordUserAction.record("MobileMenuDownloadManager");
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
} else if (id == R.id.open_recently_closed_tab) {
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
@@ -25,6 +25,7 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches;
+import org.chromium.chrome.browser.ContentSettingsType;
import org.chromium.chrome.browser.ShortcutHelper;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.banners.AppBannerManager;
@@ -197,6 +198,8 @@ public class AppMenuPropertiesDelegate {
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
+ updateEnableJavascriptMenuItem(menu, currentTab);
+
// Only display reader mode settings menu option if the current page is in reader mode.
menu.findItem(R.id.reader_mode_prefs_id)
.setVisible(DomDistillerUrlUtils.isDistilledPage(currentTab.getUrl()));
@@ -450,6 +453,41 @@ public class AppMenuPropertiesDelegate {
}
/**
+ * Updates the enable JavaScript item's state.
+ *
+ * @param menu {@link Menu} for enable javascript
+ * @param currentTab Current tab being displayed.
+ */
+ protected void updateEnableJavascriptMenuItem(
+ Menu menu, Tab currentTab) {
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_javascript_row_menu_id);
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_javascript_id);
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_javascript_check_id);
+
+ // Hide enable javascript on all chrome:// pages except for the NTP.
+ String url = currentTab.getUrl();
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
+ // Also hide enable javascsript on Reader Mode.
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
+
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
+ enableMenuRow.setVisible(itemVisible);
+ if (!itemVisible) return;
+
+ boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
+
+ // Mark the checkbox if Javascript is activated on this tab.
+ enableMenuCheck.setChecked(jsEnabled);
+
+ // This title doesn't seem to be displayed by Android, but it is used to set up
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
+ enableMenuLabel.setTitleCondensed(jsEnabled
+ ? mActivity.getString(R.string.menu_enable_javascript_on)
+ : mActivity.getString(R.string.menu_enable_javascript_off));
+ }
+
+ /**
* A notification that the header view has finished inflating.
* @param view The view that was inflated.
* @param appMenu The menu the view is inside of.
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
@@ -182,6 +182,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
}
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
+ updateEnableJavascriptMenuItem(menu, currentTab);
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
}
}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3035,6 +3035,17 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_FIND_IN_PAGE" desc="Menu item allowing users to find text within the current page. [CHAR-LIMIT=27]">
Find in page
</message>
+
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable JavaScript support for the page. [CHAR-LIMIT=27]">
+ Enable JavaScript
+ </message>
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_ON" desc="Accessibility description for when Enable JavaScript is selected.">
+ Turn off JavaScript
+ </message>
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_OFF" desc="Accessibility description for when Enable JavaScript is unselected.">
+ Turn on JavaScript
+ </message>
+
<message name="IDS_MENU_REQUEST_DESKTOP_SITE" desc="Menu item in Chrome's overflow/options menu. By default, when a user navigates to a web page, Chrome shows the mobile site, that is, the version of the site designed for mobile phones. If this menu item is selected, however, Chrome will try to load the 'desktop' site instead, i.e. the site designed for desktop computers or laptop computers, which have larger screens. [CHAR-LIMIT=24]">
Desktop site
</message>
--
2.11.0
@@ -0,0 +1,191 @@
From: Ari Chivukula <arichiv@chromium.org>
Date: Wed, 10 Aug 2022 23:41:51 +0000
Subject: Add new cache check function
Currently, if a.com is loaded and has a favicon at a.com/icon.png and
then b.com is loaded and has the exact same favicon, the cache entry is
shared which permits b.com to notice that a.com was visited. The end
goal of this task is to prevent cross-origin cache leaks.
This CL adds a new variant of GetFaviconIDForFaviconURL that filters
results by page origin. This will be used in UpdateFaviconMappingsAndFetch
in the next CL, but is just tested here.
This CL is part of a series:
(1) Cache browser test
(2) Add new cache check function
(3) Stop cross-origin cache hits
Bug: 1300214
Change-Id: Ic1513c63f0a09a32e3316d3569f0719990be833b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3822854
Reviewed-by: Scott Violet <sky@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1033779}
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
components/favicon/core/favicon_database.cc | 27 +++++++++
components/favicon/core/favicon_database.h | 20 ++++++-
.../favicon/core/favicon_database_unittest.cc | 60 +++++++++++++++++++
3 files changed, 104 insertions(+), 3 deletions(-)
diff --git a/components/favicon/core/favicon_database.cc b/components/favicon/core/favicon_database.cc
--- a/components/favicon/core/favicon_database.cc
+++ b/components/favicon/core/favicon_database.cc
@@ -29,6 +29,7 @@
#include "sql/statement.h"
#include "sql/transaction.h"
#include "third_party/sqlite/sqlite3.h"
+#include "url/origin.h"
#if BUILDFLAG(IS_APPLE)
#include "base/mac/backup_util.h"
@@ -666,6 +667,32 @@ bool FaviconDatabase::GetFaviconLastUpdatedTime(favicon_base::FaviconID icon_id,
return true;
}
+favicon_base::FaviconID FaviconDatabase::GetFaviconIDForFaviconURL(
+ const GURL& icon_url,
+ favicon_base::IconType icon_type,
+ const url::Origin& page_origin) {
+ // Look to see if there even is any relevant cached entry.
+ auto const icon_id = GetFaviconIDForFaviconURL(icon_url, icon_type);
+ if (!icon_id) {
+ return icon_id;
+ }
+
+ // Check existing mappings to see if any are for the same origin.
+ sql::Statement statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT page_url FROM icon_mapping WHERE icon_id=?"));
+ statement.BindInt64(0, icon_id);
+ while (statement.Step()) {
+ const auto candidate_origin =
+ url::Origin::Create(GURL(statement.ColumnString(0)));
+ if (candidate_origin == page_origin) {
+ return icon_id;
+ }
+ }
+
+ // Act as if there is no entry in the cache if no mapping exists.
+ return 0;
+}
+
favicon_base::FaviconID FaviconDatabase::GetFaviconIDForFaviconURL(
const GURL& icon_url,
favicon_base::IconType icon_type) {
diff --git a/components/favicon/core/favicon_database.h b/components/favicon/core/favicon_database.h
--- a/components/favicon/core/favicon_database.h
+++ b/components/favicon/core/favicon_database.h
@@ -22,6 +22,10 @@ class RefCountedMemory;
class Time;
} // namespace base
+namespace url {
+class Origin;
+} // namespace url
+
namespace favicon {
// The minimum number of days after which last_requested field gets updated.
@@ -146,9 +150,19 @@ class FaviconDatabase {
// Returns true if successful.
bool TouchOnDemandFavicon(const GURL& icon_url, base::Time time);
- // Returns the id of the entry in the favicon database with the specified url
- // and icon type.
- // Returns 0 if no entry exists for the specified url.
+ // Returns the id of the entry in the favicon database with the specified
+ // `icon_url` and `icon_type` that has an existing mapping to `page_origin`
+ // (and 0 if no entry exists). See crbug.com/1300214 for more context.
+ favicon_base::FaviconID GetFaviconIDForFaviconURL(
+ const GURL& icon_url,
+ favicon_base::IconType icon_type,
+ const url::Origin& page_origin);
+
+ // Returns the id of the entry in the favicon database with the specified
+ // `icon_url` and `icon_type` (and 0 if no entry exists). This function does
+ // not respect cross-origin partitioning and returns an entry from the cache
+ // without verifying it was stored for the origin requesting it. This can leak
+ // navigation history, see crbug.com/1300214 for more context.
favicon_base::FaviconID GetFaviconIDForFaviconURL(
const GURL& icon_url,
favicon_base::IconType icon_type);
diff --git a/components/favicon/core/favicon_database_unittest.cc b/components/favicon/core/favicon_database_unittest.cc
--- a/components/favicon/core/favicon_database_unittest.cc
+++ b/components/favicon/core/favicon_database_unittest.cc
@@ -25,6 +25,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/sqlite/sqlite3.h"
#include "url/gurl.h"
+#include "url/origin.h"
using testing::AllOf;
using testing::ElementsAre;
@@ -1447,4 +1448,63 @@ TEST_F(FaviconDatabaseTest, SetFaviconsOutOfDateBetween) {
EXPECT_EQ(base::Time(), GetLastUpdated(&db, icon3));
}
+// Test that GetFaviconIDForFaviconURL can filter by origin.
+TEST_F(FaviconDatabaseTest, GetFaviconIDForFaviconURLOriginFilter) {
+ // Setup DB with `kPageUrl1` mapped to `kIconUrl1`.
+ FaviconDatabase db;
+ ASSERT_EQ(sql::INIT_OK, db.Init(file_name_));
+ db.BeginTransaction();
+ scoped_refptr<base::RefCountedStaticMemory> favicon1(
+ new base::RefCountedStaticMemory(kBlob1, sizeof(kBlob1)));
+ const auto icon_id = db.AddFavicon(
+ kIconUrl1, favicon_base::IconType::kFavicon, favicon1,
+ FaviconBitmapType::ON_VISIT, base::Time::Now(), gfx::Size());
+ db.AddIconMapping(kPageUrl1, icon_id);
+ ASSERT_NE(0, icon_id);
+
+ // We should be able to find the `icon_id` via the non-filtered function.
+ auto icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon);
+ ASSERT_EQ(icon_id, icon_id_found);
+
+ // We should be able to find the `icon_id` via a the origin of `kPageUrl1`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl1));
+ ASSERT_EQ(icon_id, icon_id_found);
+
+ // We shouldn't be able to find the `icon_id` via a the origin of `kPageUrl2`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl2));
+ ASSERT_EQ(0, icon_id_found);
+
+ // We shouldn't be able to find the `icon_id` via a the origin of `kPageUrl3`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl3));
+ ASSERT_EQ(0, icon_id_found);
+
+ // If we map `kPageUrl2` then the situation changes.
+ db.AddIconMapping(kPageUrl2, icon_id);
+
+ // We should be able to find the `icon_id` via a the origin of `kPageUrl1`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl1));
+ ASSERT_EQ(icon_id, icon_id_found);
+
+ // We should be able to find the `icon_id` via a the origin of `kPageUrl2`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl2));
+ ASSERT_EQ(icon_id, icon_id_found);
+
+ // We shouldn't be able to find the `icon_id` via a the origin of `kPageUrl3`.
+ icon_id_found =
+ db.GetFaviconIDForFaviconURL(kIconUrl1, favicon_base::IconType::kFavicon,
+ url::Origin::Create(kPageUrl3));
+ ASSERT_EQ(0, icon_id_found);
+}
+
} // namespace favicon
--
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
@@ -372,6 +372,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
@@ -66,6 +66,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
@@ -355,7 +355,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
@@ -1433,6 +1433,12 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_PRIVACY_REVIEW_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 youre 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
@@ -109,22 +109,6 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
public void setToolbar(Toolbar toolbar, boolean isIncognito) {
mToolbar = toolbar;
mToolbarContainer.setToolbar(mToolbar);
-
- 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
@@ -663,7 +663,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_
}
@@ -950,7 +950,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
@@ -34,6 +34,11 @@
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;
@@ -105,6 +107,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);
@@ -153,6 +161,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
@@ -369,6 +369,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
@@ -1,47 +1,42 @@
From: samartnik <artem@brave.com>
Date: Tue, 17 Apr 2018 17:14:00 +0300
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
---
chrome/android/java/res/values/values.xml | 3 +++
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 +++-
.../browser/preferences/privacy/PrivacyPreferences.java | 14 ++++++++++++++
chrome/android/java/strings/android_chrome_strings.grd | 6 ++++++
5 files changed, 31 insertions(+), 1 deletion(-)
.../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/values/values.xml b/chrome/android/java/res/values/values.xml
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -67,6 +67,9 @@
<!-- TODO(peconn): Add help section. -->
<!-- <string name="help_context_suggestions">mobile_content_suggestions</string> -->
+ <string name="close_tabs_on_exit_title">Close tabs on exit</string>
+ <string name="close_tabs_on_exit_summary">Don\'t persist tabs between browsing sessions</string>
+
<!-- Our manage space activity. Default pre-KitKat to be nothing. -->
<string name="manage_space_activity"></string>
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
@@ -13,6 +13,11 @@
android:summary="@string/navigation_error_summary"
android:defaultValue="true" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
@@ -42,6 +42,11 @@
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" />
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="search_suggestions"
android:title="@string/search_suggestions_title"
android:summary="@string/search_suggestions_summary"
<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
@@ -1016,8 +1016,10 @@ public class ChromeTabbedActivity
@@ -38,6 +38,7 @@ import androidx.lifecycle.LifecycleRegistry;
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;
@@ -1317,8 +1318,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
boolean hadCipherData =
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
@@ -52,63 +47,65 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
if (noRestoreState) {
// Clear the state files because they are inconsistent and useless from now on.
mTabModelSelectorImpl.clearState();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.preferences.privacy;
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.preference.CheckBoxPreference;
import android.preference.Preference;
@@ -15,6 +16,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.text.SpannableString;
import android.view.Menu;
@@ -16,6 +17,8 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
+import org.chromium.base.ContextUtils;
import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.base.BuildInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
@@ -42,6 +44,7 @@ public class PrivacyPreferences extends PreferenceFragment
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
private static final String PREF_DO_NOT_TRACK = "do_not_track";
private static final String PREF_USAGE_AND_CRASH_REPORTING = "usage_and_crash_reports";
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
@@ -91,6 +94,11 @@ public class PrivacyPreferences extends PreferenceFragment
preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK_DIVIDER));
preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK));
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
@@ -57,6 +60,8 @@ public class PrivacySettings
private static final String PREF_PRIVACY_REVIEW = "privacy_review";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
+
ChromeBaseCheckBoxPreference networkPredictionPref =
(ChromeBaseCheckBoxPreference) findPreference(PREF_NETWORK_PREDICTIONS);
networkPredictionPref.setChecked(prefServiceBridge.getNetworkPredictionEnabled());
@@ -136,6 +144,12 @@ public class PrivacyPreferences extends PreferenceFragment
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
+ } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
+// PrefServiceBridge.getInstance().setBoolean(
+// Pref.CLOSE_TABS_ON_EXIT_ENABLED, (boolean) newValue);
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
private IncognitoLockSettings mIncognitoLockSettings;
private ViewGroup mDialogContainer;
@@ -128,7 +133,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)) {
@@ -169,6 +178,11 @@ public class PrivacySettings
PreloadPagesSettingsFragment.getPreloadPagesSummaryString(getContext()));
}
return true;
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3853,6 +3853,12 @@ However, you arent invisible. Going private doesnt hide your browsing from
+ 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
@@ -4437,6 +4437,12 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</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>
@@ -121,6 +118,5 @@ diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/and
<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.11.0
--
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
@@ -12,6 +12,11 @@
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;
@@ -297,6 +298,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
@@ -383,6 +383,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
@@ -71,6 +71,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.LOCALE_MANAGER_AUTO_SWITCH,
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
@@ -1248,6 +1248,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
@@ -60,6 +60,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
@@ -373,6 +373,7 @@ extern const char kSettingsShowOSBanner[];
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
@@ -138,6 +138,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"
@@ -8669,6 +8670,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
@@ -3221,6 +3221,11 @@ const char kReduceUserAgentPlatformOsCpuDescription[] =
"The platform and oscpu in the User-Agent string will be reported as "
"<unifiedPlatform>";
+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
@@ -1825,6 +1825,9 @@ extern const char kReduceUserAgentMinorVersionDescription[];
extern const char kReduceUserAgentPlatformOsCpuName[];
extern const char kReduceUserAgentPlatformOsCpuDescription[];
+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
@@ -1,223 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 28 Aug 2018 23:27:23 +0200
Subject: Add site settings option for session-only cookies
---
chrome/android/java/res/values/values.xml | 3 +++
.../android/java/res/xml/website_preferences.xml | 7 ++++++
.../browser/preferences/PrefServiceBridge.java | 10 +++++++++
.../website/SingleCategoryPreferences.java | 21 +++++++++++++++++-
.../java/strings/android_chrome_strings.grd | 6 ++++++
.../android/preferences/pref_service_bridge.cc | 25 ++++++++++++++++++++++
6 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -39,6 +39,9 @@
<integer name="reload_button_level_reload">0</integer>
<integer name="reload_button_level_stop">1</integer>
+ <string name="allow_cookies_session_only_title">Keep cookies only until you quit your browser</string>
+ <string name="allow_cookies_session_only_summary">When enabled, all cookies will be erased when the browsing session is over</string>
+
<!-- Help and Feedback
These constants should be in sync with the context names on go/mobilehelprecs.
If the context ID cannot be found, the default help page will be shown to the user.-->
diff --git a/chrome/android/java/res/xml/website_preferences.xml b/chrome/android/java/res/xml/website_preferences.xml
--- a/chrome/android/java/res/xml/website_preferences.xml
+++ b/chrome/android/java/res/xml/website_preferences.xml
@@ -26,6 +26,13 @@
android:summary="@string/block_third_party_cookies_summary"
android:defaultValue="true"
android:persistent="false" />
+ <!-- A toggle for cookies to be saved only until session exit, only shown for the Cookies category. -->
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
+ android:key="cookies_session_only"
+ android:title="@string/allow_cookies_session_only_title"
+ android:summary="@string/allow_cookies_session_only_summary"
+ android:defaultValue="true"
+ android:persistent="false" />
<!-- A toggle for enabling vibration in notifications. -->
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="notifications_vibrate"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
@@ -245,6 +245,10 @@ public class PrefServiceBridge {
return nativeGetBlockThirdPartyCookiesEnabled();
}
+ public boolean isCookiesSessionOnlyEnabled() {
+ return nativeGetCookiesSessionOnlyEnabled();
+ }
+
/**
* @return Whether third-party cookie blocking is configured by policy
*/
@@ -631,6 +635,10 @@ public class PrefServiceBridge {
nativeSetBlockThirdPartyCookiesEnabled(enabled);
}
+ public void setCookiesSessionOnlyEnabled(boolean enabled) {
+ nativeSetCookiesSessionOnlyEnabled(enabled);
+ }
+
public void setDoNotTrackEnabled(boolean enabled) {
nativeSetDoNotTrackEnabled(enabled);
}
@@ -1079,6 +1087,7 @@ public class PrefServiceBridge {
private native boolean nativeGetAutoplayEnabled();
private native boolean nativeGetBackgroundSyncEnabled();
private native boolean nativeGetBlockThirdPartyCookiesEnabled();
+ private native boolean nativeGetCookiesSessionOnlyEnabled();
private native boolean nativeGetBlockThirdPartyCookiesManaged();
private native boolean nativeGetRememberPasswordsEnabled();
private native boolean nativeGetPasswordManagerAutoSigninEnabled();
@@ -1125,6 +1134,7 @@ public class PrefServiceBridge {
private native void nativeSetAutoplayEnabled(boolean enabled);
private native void nativeSetAllowCookiesEnabled(boolean enabled);
private native void nativeSetBackgroundSyncEnabled(boolean enabled);
+ private native void nativeSetCookiesSessionOnlyEnabled(boolean enabled);
private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled);
private native void nativeSetClipboardEnabled(boolean enabled);
private native void nativeSetDoNotTrackEnabled(boolean enabled);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
@@ -121,6 +121,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
// Keys for category-specific preferences (toggle, link, button etc.), dynamically shown.
public static final String THIRD_PARTY_COOKIES_TOGGLE_KEY = "third_party_cookies";
+ public static final String COOKIES_SESSION_ONLY_TOGGLE_KEY = "cookies_session_only";
public static final String NOTIFICATIONS_VIBRATE_TOGGLE_KEY = "notifications_vibrate";
public static final String EXPLAIN_PROTECTED_MEDIA_KEY = "protected_content_learn_more";
private static final String ADD_EXCEPTION_KEY = "add_exception";
@@ -440,6 +441,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
if (type == SiteSettingsCategory.Type.COOKIES) {
updateThirdPartyCookiesCheckBox();
+ updateCookiesSessionOnlyCheckBox();
} else if (type == SiteSettingsCategory.Type.NOTIFICATIONS) {
updateNotificationsVibrateCheckBox();
}
@@ -478,6 +480,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
prefServiceBridge.setContentSetting(
mCategory.getContentSettingsType(), setting.toInt());
getInfoForOrigins();
+ } else if (COOKIES_SESSION_ONLY_TOGGLE_KEY.equals(preference.getKey())) {
+ prefServiceBridge.setCookiesSessionOnlyEnabled((boolean) newValue);
} else if (THIRD_PARTY_COOKIES_TOGGLE_KEY.equals(preference.getKey())) {
prefServiceBridge.setBlockThirdPartyCookiesEnabled(((boolean) newValue));
} else if (NOTIFICATIONS_VIBRATE_TOGGLE_KEY.equals(preference.getKey())) {
@@ -767,6 +771,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
TriStateSiteSettingsPreference triStateToggle =
(TriStateSiteSettingsPreference) screen.findPreference(TRI_STATE_TOGGLE_KEY);
Preference thirdPartyCookies = screen.findPreference(THIRD_PARTY_COOKIES_TOGGLE_KEY);
+ Preference cookiesSessionOnly = getPreferenceScreen().findPreference(
+ COOKIES_SESSION_ONLY_TOGGLE_KEY);
Preference notificationsVibrate = screen.findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY);
Preference explainProtectedMediaKey = screen.findPreference(EXPLAIN_PROTECTED_MEDIA_KEY);
PreferenceGroup allowedGroup = (PreferenceGroup) screen.findPreference(ALLOWED_GROUP);
@@ -797,6 +803,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
if (hideSecondaryToggles) {
screen.removePreference(thirdPartyCookies);
+ screen.removePreference(cookiesSessionOnly);
screen.removePreference(notificationsVibrate);
screen.removePreference(explainProtectedMediaKey);
screen.removePreference(allowedGroup);
@@ -806,12 +813,15 @@ public class SingleCategoryPreferences extends PreferenceFragment
return;
}
- // Configure/hide the third-party cookie toggle, as needed.
+ // Configure/hide the third-party cookie toggle and session-only cookie toggle, as needed.
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {
thirdPartyCookies.setOnPreferenceChangeListener(this);
updateThirdPartyCookiesCheckBox();
+ cookiesSessionOnly.setOnPreferenceChangeListener(this);
+ updateCookiesSessionOnlyCheckBox();
} else {
screen.removePreference(thirdPartyCookies);
+ screen.removePreference(cookiesSessionOnly);
}
// Configure/hide the notifications vibrate toggle, as needed.
@@ -916,6 +926,15 @@ public class SingleCategoryPreferences extends PreferenceFragment
preference -> PrefServiceBridge.getInstance().isBlockThirdPartyCookiesManaged());
}
+ private void updateCookiesSessionOnlyCheckBox() {
+ ChromeBaseCheckBoxPreference cookiesSessionOnlyPref = (ChromeBaseCheckBoxPreference)
+ getPreferenceScreen().findPreference(COOKIES_SESSION_ONLY_TOGGLE_KEY);
+ cookiesSessionOnlyPref.setChecked(
+ PrefServiceBridge.getInstance().isCookiesSessionOnlyEnabled());
+ cookiesSessionOnlyPref.setEnabled(PrefServiceBridge.getInstance().isCategoryEnabled(
+ ContentSettingsType.CONTENT_SETTINGS_TYPE_COOKIES));
+ }
+
private void updateNotificationsVibrateCheckBox() {
ChromeBaseCheckBoxPreference preference =
(ChromeBaseCheckBoxPreference) getPreferenceScreen().findPreference(
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -879,6 +879,12 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_BLOCK_THIRD_PARTY_COOKIES_SUMMARY" desc="Summary text for Block Third Party Cookies preference">
Prevent third-party websites from saving and reading cookie data
</message>
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_TITLE" desc="Title for Allow Cookies Session Only preference">
+ Keep cookies only until you quit your browser
+ </message>
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_SUMMARY" desc="Summary text for Allow Session Only Cookies preference">
+ When enabled, all cookies will be erased when the browsing session is over
+ </message>
<message name="IDS_JAVASCRIPT_PERMISSION_TITLE" desc="Title of the permission to run javascript [CHAR-LIMIT=32]">
JavaScript
</message>
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -310,6 +310,17 @@ static jboolean JNI_PrefServiceBridge_GetBlockThirdPartyCookiesEnabled(
return GetPrefService()->GetBoolean(prefs::kBlockThirdPartyCookies);
}
+static jboolean JNI_PrefServiceBridge_GetCookiesSessionOnlyEnabled(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ HostContentSettingsMap* host_content_settings_map =
+ HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
+ auto value = host_content_settings_map->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, nullptr);
+ auto enabled = CONTENT_SETTING_SESSION_ONLY == value;
+ LOG(INFO) << "GetCookiesSessionOnly := " << enabled << " (raw_value = " << value << ")";
+ return enabled;
+}
+
static jboolean JNI_PrefServiceBridge_GetBlockThirdPartyCookiesManaged(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
@@ -767,6 +778,20 @@ static void JNI_PrefServiceBridge_SetBlockThirdPartyCookiesEnabled(
GetPrefService()->SetBoolean(prefs::kBlockThirdPartyCookies, enabled);
}
+static void JNI_PrefServiceBridge_SetCookiesSessionOnlyEnabled(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jboolean enabled) {
+ HostContentSettingsMap* host_content_settings_map =
+ HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
+ LOG(INFO) << "SetCookiesSessionOnly -> " << (enabled ? "true" : "false") <<
+ "; false -> setting_allow: " << CONTENT_SETTING_ALLOW <<
+ "; true -> session_only: " << CONTENT_SETTING_SESSION_ONLY;
+ host_content_settings_map->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_COOKIES,
+ enabled ? CONTENT_SETTING_SESSION_ONLY : CONTENT_SETTING_ALLOW);
+}
+
static void JNI_PrefServiceBridge_SetRememberPasswordsEnabled(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
--
2.11.0
@@ -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
@@ -67,6 +67,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;
@@ -333,9 +334,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
+505
View File
@@ -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
@@ -79,6 +79,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">
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="user_scripts/strings/userscripts_strings.grdp" />
+ <part file="browser_ui/strings/android/webgl.grdp" />
<if expr="not is_ios">
<part file="history_clusters_strings.grdp" />
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
@@ -679,6 +679,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::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_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
@@ -155,6 +155,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
@@ -205,7 +205,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(
@@ -217,6 +218,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
@@ -97,6 +97,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
@@ -104,7 +104,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
@@ -280,6 +280,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
@@ -65,6 +65,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
@@ -97,6 +97,7 @@ class SecurityOrigin;
class ScriptState;
class ScriptWrappable;
class TrustedTypePolicyFactory;
+class WebContentSettingsClient;
enum ReasonForCallingCanExecuteScripts {
kAboutToExecuteScript,
@@ -105,6 +106,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
@@ -244,6 +244,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_);
@@ -490,25 +497,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('.');
@@ -576,6 +564,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
@@ -1808,6 +1808,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,393 @@
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 | 5 ++
19 files changed, 160 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
@@ -82,6 +82,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">
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="user_scripts/strings/userscripts_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" />
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
@@ -693,6 +693,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::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_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
@@ -157,6 +157,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
@@ -206,7 +206,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(
@@ -219,6 +220,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
@@ -98,6 +98,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
@@ -105,7 +105,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
@@ -282,6 +282,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
@@ -758,6 +758,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,430 @@
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 ++
.../net/cross_origin_embedder_policy_reporter.cc | 4 +++-
.../net/cross_origin_opener_policy_reporter.cc | 16 +++++++---------
content/browser/net/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, 48 insertions(+), 24 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
@@ -1289,6 +1289,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;
@@ -1306,6 +1307,7 @@ std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
}
return urls;
}
+#endif // BUILDFLAG(ENABLE_REPORTING)
} // namespace
diff --git a/content/browser/net/cross_origin_embedder_policy_reporter.cc b/content/browser/net/cross_origin_embedder_policy_reporter.cc
--- a/content/browser/net/cross_origin_embedder_policy_reporter.cc
+++ b/content/browser/net/cross_origin_embedder_policy_reporter.cc
@@ -4,6 +4,7 @@
#include "content/browser/net/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"
@@ -112,6 +113,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
kType, context_url_, blink::mojom::ReportBody::New(std::move(list))));
}
if (endpoint) {
+#if BUILDFLAG(ENABLE_REPORTING)
base::Value::Dict body_to_pass;
for (const auto& pair : body) {
body_to_pass.Set(pair.first, pair.second);
@@ -123,7 +125,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
kType, *endpoint, context_url_, reporting_source_,
network_isolation_key_,
/*user_agent=*/absl::nullopt, std::move(body_to_pass));
- }
+#endif
}
}
diff --git a/content/browser/net/cross_origin_opener_policy_reporter.cc b/content/browser/net/cross_origin_opener_policy_reporter.cc
--- a/content/browser/net/cross_origin_opener_policy_reporter.cc
+++ b/content/browser/net/cross_origin_opener_policy_reporter.cc
@@ -17,25 +17,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:
@@ -44,6 +36,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:
@@ -61,6 +54,7 @@ std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
return "restrict-properties-plus-coep";
}
}
+#endif
FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {
FrameTreeNode* opener =
@@ -232,6 +226,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)
@@ -279,12 +274,14 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
storage_partition_->GetNetworkContext()->QueueReport(
"coop", endpoint, context_url_, reporting_source_, network_isolation_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,
@@ -292,6 +289,7 @@ void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
storage_partition_->GetNetworkContext()->QueueReport(
"coop", endpoint, context_url_, reporting_source_, network_isolation_key_,
/*user_agent=*/absl::nullopt, std::move(body));
+#endif
}
} // namespace content
diff --git a/content/browser/net/reporting_service_proxy.cc b/content/browser/net/reporting_service_proxy.cc
--- a/content/browser/net/reporting_service_proxy.cc
+++ b/content/browser/net/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_isolation_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
@@ -12081,12 +12081,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_isolation_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
@@ -127,6 +127,7 @@ bool ShouldDowngradeReport(const char* result_string,
void ReportResult(int frame_tree_node_id,
network::mojom::SignedExchangeReportPtr report,
const net::NetworkIsolationKey& network_isolation_key) {
+#if BUILDFLAG(ENABLE_REPORTING)
FrameTreeNode* frame_tree_node =
FrameTreeNode::GloballyFindByID(frame_tree_node_id);
if (!frame_tree_node)
@@ -141,6 +142,7 @@ void ReportResult(int frame_tree_node_id,
DCHECK(partition);
partition->GetNetworkContext()->QueueSignedExchangeReport(
std::move(report), network_isolation_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
@@ -7,6 +7,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
@@ -208,6 +208,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_isolation_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
@@ -454,10 +454,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
const absl::optional<base::UnguessableToken>& reporting_source,
const net::NetworkIsolationKey& network_isolation_key,
const absl::optional<std::string>& user_agent,
- base::Value::Dict body) override;
+ base::Value::Dict body);
void QueueSignedExchangeReport(
mojom::SignedExchangeReportPtr report,
- const net::NetworkIsolationKey& network_isolation_key) override;
+ const net::NetworkIsolationKey& network_isolation_key);
void AddDomainReliabilityContextForTesting(
const GURL& 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
@@ -965,7 +965,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
@@ -1059,6 +1059,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,
@@ -1072,6 +1073,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,
NetworkIsolationKey network_isolation_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"
@@ -2382,9 +2383,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"
@@ -576,9 +576,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
@@ -1,745 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 18 Sep 2018 08:06:14 +0200
Subject: Allow building without safebrowsing for Android
Fix build from scratch (issue found by nikolowry)
---
.../android/java/res/xml/privacy_preferences.xml | 8 -----
.../preferences/privacy/PrivacyPreferences.java | 40 ----------------------
.../chrome_browsing_data_remover_delegate.cc | 10 ------
chrome/browser/chrome_content_browser_client.cc | 14 +-------
.../file_type_policies_component_installer.cc | 2 ++
.../download/chrome_download_manager_delegate.cc | 14 ++++++--
.../download/chrome_download_manager_delegate.h | 6 ++++
chrome/browser/download/download_item_model.cc | 10 ++++++
chrome/browser/download/download_item_model.h | 4 +++
chrome/browser/download/download_prefs.cc | 4 +++
.../browser/download/download_target_determiner.cc | 18 ++++++++++
.../browser/download/download_target_determiner.h | 6 ++++
chrome/browser/download/download_target_info.cc | 4 +++
chrome/browser/download/download_target_info.h | 4 +++
chrome/browser/download/download_ui_model.cc | 4 +++
chrome/browser/download/download_ui_model.h | 4 +++
.../chrome_resource_dispatcher_host_delegate.cc | 4 +++
chrome/browser/net/chrome_network_delegate.cc | 35 ++-----------------
18 files changed, 85 insertions(+), 106 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
@@ -18,14 +18,6 @@
android:summary="@string/search_suggestions_summary"
android:defaultValue="true" />
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
- android:key="safe_browsing_scout_reporting"
- android:title="@string/safe_browsing_scout_reporting_title"
- android:summary="@string/safe_browsing_scout_reporting_summary" />
- <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
- android:key="safe_browsing"
- android:title="@string/safe_browsing_title"
- android:summary="@string/safe_browsing_summary" />
- <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
android:key="network_predictions"
android:title="@string/network_predictions_title"
android:summary="@string/network_predictions_summary"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
@@ -38,9 +38,6 @@ public class PrivacyPreferences extends PreferenceFragment
implements OnPreferenceChangeListener {
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
- private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
- "safe_browsing_scout_reporting";
- private static final String PREF_SAFE_BROWSING = "safe_browsing";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
@@ -74,8 +71,6 @@ public class PrivacyPreferences extends PreferenceFragment
// Remove preferences that were migrated to SyncAndServicesPreferences.
preferenceScreen.removePreference(findPreference(PREF_NAVIGATION_ERROR));
preferenceScreen.removePreference(findPreference(PREF_SEARCH_SUGGESTIONS));
- preferenceScreen.removePreference(findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING));
- preferenceScreen.removePreference(findPreference(PREF_SAFE_BROWSING));
preferenceScreen.removePreference(findPreference(PREF_NETWORK_PREDICTIONS));
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
preferenceScreen.removePreference(findPreference(PREF_USAGE_AND_CRASH_REPORTING));
@@ -115,17 +110,6 @@ public class PrivacyPreferences extends PreferenceFragment
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
}
- // Listen to changes to the Extended Reporting pref.
- ChromeBaseCheckBoxPreference scoutReportingPref =
- (ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
- scoutReportingPref.setOnPreferenceChangeListener(this);
- scoutReportingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
-
- ChromeBaseCheckBoxPreference safeBrowsingPref =
- (ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
- safeBrowsingPref.setOnPreferenceChangeListener(this);
- safeBrowsingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
-
updateSummaries();
}
@@ -134,11 +118,6 @@ public class PrivacyPreferences extends PreferenceFragment
String key = preference.getKey();
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
- } else if (PREF_SAFE_BROWSING.equals(key)) {
- PrefServiceBridge.getInstance().setSafeBrowsingEnabled((boolean) newValue);
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
- (boolean) newValue);
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
recordNetworkPredictionEnablingUMA((boolean) newValue);
@@ -187,19 +166,6 @@ public class PrivacyPreferences extends PreferenceFragment
searchSuggestionsPref.setChecked(prefServiceBridge.isSearchSuggestEnabled());
}
- CheckBoxPreference extendedReportingPref =
- (CheckBoxPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
- if (extendedReportingPref != null) {
- extendedReportingPref.setChecked(
- prefServiceBridge.isSafeBrowsingExtendedReportingEnabled());
- }
-
- CheckBoxPreference safeBrowsingPref =
- (CheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
- if (safeBrowsingPref != null) {
- safeBrowsingPref.setChecked(prefServiceBridge.isSafeBrowsingEnabled());
- }
-
CheckBoxPreference canMakePaymentPref =
(CheckBoxPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
if (canMakePaymentPref != null) {
@@ -236,12 +202,6 @@ public class PrivacyPreferences extends PreferenceFragment
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
return prefs.isSearchSuggestManaged();
}
- if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- return prefs.isSafeBrowsingExtendedReportingManaged();
- }
- if (PREF_SAFE_BROWSING.equals(key)) {
- return prefs.isSafeBrowsingManaged();
- }
if (PREF_NETWORK_PREDICTIONS.equals(key)) {
return prefs.isNetworkPredictionManaged();
}
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -242,16 +242,6 @@ bool DoesOriginMatchEmbedderMask(int origin_type_mask,
return false;
}
-// Callback for when cookies have been deleted. Invokes NotifyIfDone.
-// Receiving |cookie_manager| as a parameter so that the receive pipe is
-// not deleted before the response is received.
-void OnClearedCookies(base::OnceClosure done,
- network::mojom::CookieManagerPtr cookie_manager,
- uint32_t num_deleted) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- std::move(done).Run();
-}
-
} // namespace
ChromeBrowsingDataRemoverDelegate::ChromeBrowsingDataRemoverDelegate(
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
@@ -4990,19 +4990,7 @@ ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate(
content::ResourceContext* resource_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
- if (!io_data->safe_browsing_enabled()->GetValue())
- return nullptr;
-
- // |safe_browsing_service_| may be unavailable in tests.
- if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) {
- safe_browsing_url_checker_delegate_ =
- base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>(
- safe_browsing_service_->database_manager(),
- safe_browsing_service_->ui_manager());
- }
-
- return safe_browsing_url_checker_delegate_.get();
+ return nullptr;
}
base::Optional<std::string>
diff --git a/chrome/browser/component_updater/file_type_policies_component_installer.cc b/chrome/browser/component_updater/file_type_policies_component_installer.cc
--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc
+++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
@@ -18,7 +18,9 @@
#include "base/path_service.h"
#include "base/task/post_task.h"
#include "base/version.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "components/component_updater/component_updater_paths.h"
using component_updater::ComponentUpdateService;
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -38,8 +38,10 @@
#include "chrome/browser/download/save_package_file_picker.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#endif
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
@@ -49,7 +51,9 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/pdf_util.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/download/public/common/download_item.h"
@@ -94,8 +98,10 @@
using content::BrowserThread;
using download::DownloadItem;
using content::DownloadManager;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
using safe_browsing::DownloadProtectionService;
+#endif
namespace {
@@ -744,19 +750,19 @@ ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() const {
return std::string(chrome::kApplicationClientIDStringForAVScanning);
}
+#if defined(FULL_SAFE_BROWSING)
DownloadProtectionService*
ChromeDownloadManagerDelegate::GetDownloadProtectionService() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-#if defined(FULL_SAFE_BROWSING)
safe_browsing::SafeBrowsingService* sb_service =
g_browser_process->safe_browsing_service();
if (sb_service && sb_service->download_protection_service() &&
profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) {
return sb_service->download_protection_service();
}
-#endif
return NULL;
}
+#endif
void ChromeDownloadManagerDelegate::NotifyExtensions(
DownloadItem* download,
@@ -1199,13 +1205,17 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
#endif
+#if defined(FULL_SAFE_BROWSING)
DownloadItemModel(item).SetDangerLevel(target_info->danger_level);
+#endif
}
+#if defined(FULL_SAFE_BROWSING)
if (ShouldBlockFile(target_info->danger_type, item)) {
target_info->result = download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
// A dangerous type would take precendence over the blocking of the file.
target_info->danger_type = download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
}
+#endif
callback.Run(target_info->target_path, target_info->target_disposition,
target_info->danger_type, target_info->intermediate_path,
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h
--- a/chrome/browser/download/chrome_download_manager_delegate.h
+++ b/chrome/browser/download/chrome_download_manager_delegate.h
@@ -22,8 +22,10 @@
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner_delegate.h"
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager_delegate.h"
@@ -131,8 +133,10 @@ class ChromeDownloadManagerDelegate
DownloadPrefs* download_prefs() { return download_prefs_.get(); }
protected:
+#if defined(FULL_SAFE_BROWSING)
virtual safe_browsing::DownloadProtectionService*
GetDownloadProtectionService();
+#endif
// Show file picker for |download|.
virtual void ShowFilePickerForDownload(
@@ -197,9 +201,11 @@ class ChromeDownloadManagerDelegate
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
+#if defined(FULL_SAFE_BROWSING)
// Callback function after the DownloadProtectionService completes.
void CheckClientDownloadDone(uint32_t download_id,
safe_browsing::DownloadCheckResult result);
+#endif
// Internal gateways for ShouldCompleteDownload().
bool IsDownloadReadyForCompletion(
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -22,9 +22,11 @@
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/download/offline_item_utils.h"
#include "chrome/browser/profiles/profile.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
#include "chrome/common/safe_browsing/download_file_types.pb.h"
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_danger_type.h"
@@ -37,7 +39,9 @@
using base::TimeDelta;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
namespace {
@@ -67,9 +71,11 @@ class DownloadItemModelData : public base::SupportsUserData::Data {
// for the file type.
bool should_prefer_opening_in_browser_;
+#if defined(FULL_SAFE_BROWSING)
// Danger level of the file determined based on the file type and whether
// there was a user action associated with the download.
DownloadFileType::DangerLevel danger_level_;
+#endif
// Whether the download is currently being revived.
bool is_being_revived_;
@@ -106,7 +112,9 @@ DownloadItemModelData::DownloadItemModelData()
: should_show_in_shelf_(true),
was_ui_notified_(false),
should_prefer_opening_in_browser_(false),
+#if defined(FULL_SAFE_BROWSING)
danger_level_(DownloadFileType::NOT_DANGEROUS),
+#endif
is_being_revived_(false) {}
} // namespace
@@ -368,6 +376,7 @@ void DownloadItemModel::SetShouldPreferOpeningInBrowser(bool preference) {
data->should_prefer_opening_in_browser_ = preference;
}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS;
@@ -378,6 +387,7 @@ void DownloadItemModel::SetDangerLevel(
DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
data->danger_level_ = danger_level;
}
+#endif
bool DownloadItemModel::IsBeingRevived() const {
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h
--- a/chrome/browser/download/download_item_model.h
+++ b/chrome/browser/download/download_item_model.h
@@ -11,7 +11,9 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/download/download_ui_model.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_item.h"
// Implementation of DownloadUIModel that wrappers around a |DownloadItem*|. As
@@ -48,9 +50,11 @@ class DownloadItemModel : public DownloadUIModel,
void SetWasUINotified(bool should_notify) override;
bool ShouldPreferOpeningInBrowser() const override;
void SetShouldPreferOpeningInBrowser(bool preference) override;
+#if defined(FULL_SAFE_BROWSING)
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel() const override;
void SetDangerLevel(
safe_browsing::DownloadFileType::DangerLevel danger_level) override;
+#endif
void OpenUsingPlatformHandler() override;
bool IsBeingRevived() const override;
void SetIsBeingRevived(bool is_being_revived) override;
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -33,7 +33,9 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "components/download/public/common/download_item.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
@@ -55,7 +57,9 @@
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::FileTypePolicies;
+#endif
namespace {
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -22,7 +22,9 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/history/core/browser/history_service.h"
@@ -56,13 +58,16 @@
using content::BrowserThread;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
namespace {
const base::FilePath::CharType kCrdownloadSuffix[] =
FILE_PATH_LITERAL(".crdownload");
+#if defined(FULL_SAFE_BROWSING)
// Condenses the results from HistoryService::GetVisibleVisitCountToHost() to a
// single bool. A host is considered visited before if prior visible visits were
// found in history and the first such visit was earlier than the most recent
@@ -76,6 +81,7 @@ void VisitCountsToVisitedBefore(
found_visits && count > 0 &&
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
}
+#endif
#if defined(OS_WIN)
// Keeps track of whether Adobe Reader is up to date.
@@ -100,7 +106,9 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
create_target_directory_(false),
conflict_action_(conflict_action),
danger_type_(download->GetDangerType()),
+#if defined(FULL_SAFE_BROWSING)
danger_level_(DownloadFileType::NOT_DANGEROUS),
+#endif
virtual_path_(initial_virtual_path),
is_filetype_handled_safely_(false),
#if defined(OS_ANDROID)
@@ -719,6 +727,7 @@ DownloadTargetDeterminer::Result
return CONTINUE;
}
+#if defined(FULL_SAFE_BROWSING)
// First determine the danger level assuming that the user doesn't have any
// prior visits to the referrer recoreded in history. The resulting danger
// level would be ALLOW_ON_USER_GESTURE if the level depends on the visit
@@ -755,6 +764,7 @@ DownloadTargetDeterminer::Result
// invalid, then assume the referrer has not been visited before.
if (danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
+#endif
return CONTINUE;
}
@@ -762,11 +772,13 @@ void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
bool visited_referrer_before) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
+#if defined(FULL_SAFE_BROWSING)
danger_level_ = GetDangerLevel(
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
+#endif
DoLoop();
}
@@ -861,7 +873,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
<< " Intermediate:" << intermediate_path_.AsUTF8Unsafe()
<< " Confirmation reason:" << static_cast<int>(confirmation_reason_)
<< " Danger type:" << danger_type_
+#if defined(FULL_SAFE_BROWSING)
<< " Danger level:" << danger_level_
+#endif
<< " Result:" << static_cast<int>(result);
std::unique_ptr<DownloadTargetInfo> target_info(new DownloadTargetInfo);
@@ -873,7 +887,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
? DownloadItem::TARGET_DISPOSITION_PROMPT
: DownloadItem::TARGET_DISPOSITION_OVERWRITE);
target_info->danger_type = danger_type_;
+#if defined(FULL_SAFE_BROWSING)
target_info->danger_level = danger_level_;
+#endif
target_info->intermediate_path = intermediate_path_;
target_info->mime_type = mime_type_;
target_info->is_filetype_handled_safely = is_filetype_handled_safely_;
@@ -959,6 +975,7 @@ bool DownloadTargetDeterminer::HasPromptedForPath() const {
DownloadItem::TARGET_DISPOSITION_PROMPT);
}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
PriorVisitsToReferrer visits) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -990,6 +1007,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
return DownloadFileType::NOT_DANGEROUS;
}
+#endif
void DownloadTargetDeterminer::OnDownloadDestroyed(
DownloadItem* download) {
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h
--- a/chrome/browser/download/download_target_determiner.h
+++ b/chrome/browser/download/download_target_determiner.h
@@ -17,7 +17,9 @@
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner_delegate.h"
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager_delegate.h"
@@ -297,6 +299,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
// operation.
bool HasPromptedForPath() const;
+#if defined(FULL_SAFE_BROWSING)
// Returns true if this download should show the "dangerous file" warning.
// Various factors are considered, such as the type of the file, whether a
// user action initiated the download, and whether the user has explicitly
@@ -306,6 +309,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
// to true if the download requires explicit user consent.
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel(
PriorVisitsToReferrer visits) const;
+#endif
// download::DownloadItem::Observer
void OnDownloadDestroyed(download::DownloadItem* download) override;
@@ -317,7 +321,9 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
bool create_target_directory_;
DownloadPathReservationTracker::FilenameConflictAction conflict_action_;
download::DownloadDangerType danger_type_;
+#if defined(FULL_SAFE_BROWSING)
safe_browsing::DownloadFileType::DangerLevel danger_level_;
+#endif
base::FilePath virtual_path_;
base::FilePath local_path_;
base::FilePath intermediate_path_;
diff --git a/chrome/browser/download/download_target_info.cc b/chrome/browser/download/download_target_info.cc
--- a/chrome/browser/download/download_target_info.cc
+++ b/chrome/browser/download/download_target_info.cc
@@ -4,12 +4,16 @@
#include "chrome/browser/download/download_target_info.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/file_type_policies.h"
+#endif
DownloadTargetInfo::DownloadTargetInfo()
: target_disposition(download::DownloadItem::TARGET_DISPOSITION_OVERWRITE),
danger_type(download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
+#if defined(FULL_SAFE_BROWSING)
danger_level(safe_browsing::DownloadFileType::NOT_DANGEROUS),
+#endif
is_filetype_handled_safely(false),
result(download::DOWNLOAD_INTERRUPT_REASON_NONE) {}
diff --git a/chrome/browser/download/download_target_info.h b/chrome/browser/download/download_target_info.h
--- a/chrome/browser/download/download_target_info.h
+++ b/chrome/browser/download/download_target_info.h
@@ -8,7 +8,9 @@
#include <string>
#include "base/files/file_path.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/download/public/common/download_item.h"
@@ -32,6 +34,7 @@ struct DownloadTargetInfo {
// Danger type of the download.
download::DownloadDangerType danger_type;
+#if defined(FULL_SAFE_BROWSING)
// The danger type of the download could be set to MAYBE_DANGEROUS_CONTENT if
// the file type is handled by SafeBrowsing. However, if the SafeBrowsing
// service is unable to verify whether the file is safe or not, we are on our
@@ -57,6 +60,7 @@ struct DownloadTargetInfo {
// SafeBrowsing may flag the file as being malicious, in which case the
// malicious classification should take precedence.
safe_browsing::DownloadFileType::DangerLevel danger_level;
+#endif
// Suggested intermediate path. The downloaded bytes should be written to this
// path until all the bytes are available and the user has accepted a
diff --git a/chrome/browser/download/download_ui_model.cc b/chrome/browser/download/download_ui_model.cc
--- a/chrome/browser/download/download_ui_model.cc
+++ b/chrome/browser/download/download_ui_model.cc
@@ -23,7 +23,9 @@
using base::TimeDelta;
using download::DownloadItem;
+#if defined(FULL_SAFE_BROWSING)
using safe_browsing::DownloadFileType;
+#endif
using offline_items_collection::FailState;
namespace {
@@ -368,12 +370,14 @@ bool DownloadUIModel::ShouldPreferOpeningInBrowser() const {
void DownloadUIModel::SetShouldPreferOpeningInBrowser(bool preference) {}
+#if defined(FULL_SAFE_BROWSING)
DownloadFileType::DangerLevel DownloadUIModel::GetDangerLevel() const {
return DownloadFileType::NOT_DANGEROUS;
}
void DownloadUIModel::SetDangerLevel(
DownloadFileType::DangerLevel danger_level) {}
+#endif
void DownloadUIModel::OpenUsingPlatformHandler() {}
diff --git a/chrome/browser/download/download_ui_model.h b/chrome/browser/download/download_ui_model.h
--- a/chrome/browser/download/download_ui_model.h
+++ b/chrome/browser/download/download_ui_model.h
@@ -14,7 +14,9 @@
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_manager.h"
+#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_browsing/download_file_types.pb.h"
+#endif
#include "components/download/public/common/download_item.h"
#include "components/offline_items_collection/core/offline_item.h"
@@ -172,6 +174,7 @@ class DownloadUIModel {
// Change what's returned by ShouldPreferOpeningInBrowser to |preference|.
virtual void SetShouldPreferOpeningInBrowser(bool preference);
+#if defined(FULL_SAFE_BROWSING)
// Return the danger level determined during download target determination.
// The value returned here is independent of the danger level as determined by
// the Safe Browsing.
@@ -180,6 +183,7 @@ class DownloadUIModel {
// Change what's returned by GetDangerLevel().
virtual void SetDangerLevel(
safe_browsing::DownloadFileType::DangerLevel danger_level);
+#endif
// Open the download using the platform handler for the download. The behavior
// of this method will be different from DownloadItem::OpenDownload() if
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -421,14 +421,18 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
content::ResourceContext* resource_context,
ResourceType resource_type,
std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) {
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
+#endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
// Insert either safe browsing or data reduction proxy throttle at the front
// of the list, so one of them gets to decide if the resource is safe.
content::ResourceThrottle* first_throttle = NULL;
#if defined(OS_ANDROID)
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
first_throttle = DataReductionProxyResourceThrottle::MaybeCreate(
request, resource_context, resource_type, nullptr);
+#endif
#endif // defined(OS_ANDROID)
#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -78,19 +78,6 @@ namespace {
bool g_access_to_all_files_enabled = false;
-// Gets called when the extensions finish work on the URL. If the extensions
-// did not do a redirect (so |new_url| is empty) then we enforce the
-// SafeSearch parameters. Otherwise we will get called again after the
-// redirect and we enforce SafeSearch then.
-void ForceGoogleSafeSearchCallbackWrapper(net::CompletionOnceCallback callback,
- net::URLRequest* request,
- GURL* new_url,
- int rv) {
- if (rv == net::OK && new_url->is_empty())
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
- std::move(callback).Run(rv);
-}
-
bool IsAccessAllowedInternal(const base::FilePath& path,
const base::FilePath& profile_path) {
if (g_access_to_all_files_enabled)
@@ -212,26 +199,8 @@ int ChromeNetworkDelegate::OnBeforeURLRequest(
GURL* new_url) {
extensions_delegate_->ForwardStartRequestStatus(request);
- // The non-redirect case is handled in GoogleURLLoaderThrottle.
- bool force_safe_search =
- (force_google_safe_search_ && force_google_safe_search_->GetValue() &&
- request->is_redirecting());
-
- net::CompletionOnceCallback wrapped_callback = std::move(callback);
-
- if (force_safe_search) {
- wrapped_callback = base::BindOnce(
- &ForceGoogleSafeSearchCallbackWrapper, std::move(wrapped_callback),
- base::Unretained(request), base::Unretained(new_url));
- }
-
- int rv = extensions_delegate_->NotifyBeforeURLRequest(
- request, std::move(wrapped_callback), new_url);
-
- if (force_safe_search && rv == net::OK && new_url->is_empty())
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
-
- return rv;
+ return extensions_delegate_->NotifyBeforeURLRequest(
+ request, std::move(callback), new_url);
}
int ChromeNetworkDelegate::OnBeforeStartTransaction(
--
2.11.0
@@ -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
@@ -2,15 +2,16 @@ 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
---
media/blink/webmediaplayer_impl.cc | 11 ++++++++++-
media/blink/webmediaplayer_impl.h | 2 ++
2 files changed, 12 insertions(+), 1 deletion(-)
.../renderer/platform/media/web_media_player_impl.cc | 12 +++++++++++-
.../renderer/platform/media/web_media_player_impl.h | 3 +++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -917,6 +917,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
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
@@ -1218,6 +1218,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
return pipeline_metadata_.has_audio;
}
@@ -21,32 +22,33 @@ diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_imp
+}
+
void WebMediaPlayerImpl::EnabledAudioTracksChanged(
const blink::WebVector<blink::WebMediaPlayer::TrackId>& enabledTrackIds) {
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -3108,7 +3114,10 @@ bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
// If suspending background video, pause any video that's not remoted or
// not unlocked to play in the background.
if (IsBackgroundSuspendEnabled(delegate_)) {
- if (!HasVideo())
+ //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())
return false;
@@ -3612,7 +3618,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
// Audio only stream is allowed to play when in background.
// TODO: We should check IsBackgroundOptimizationCandidate here. But we need
// to move the logic of checking video frames out of that function.
- if (!HasVideo())
+
+ //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())
return false;
#if defined(OS_ANDROID)
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -162,6 +162,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// True if the loaded media has a playable video/audio track.
if (using_media_player_renderer_ &&
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
@@ -192,6 +192,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 blink::WebVector<blink::WebMediaPlayer::TrackId>& enabledTrackIds)
--
2.11.0
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) override;
void SelectedVideoTrackChanged(
--
2.25.1
@@ -1,24 +0,0 @@
From: xsmile <xsmile@users.noreply.github.com>
Date: Thu, 11 Oct 2018 21:29:35 +0200
Subject: Allow website sign-in without account sign-in
Disable prefs::kSigninAllowedOnNextStartup by default. The setting can be found in chrome://settings
---
chrome/browser/signin/account_consistency_mode_manager.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
@@ -175,7 +175,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kAccountConsistencyMirrorRequired,
false);
#endif
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
}
// static
--
2.11.0
@@ -1,37 +0,0 @@
From: samartnik <artem@brave.com>
Date: Thu, 14 Dec 2017 16:19:50 +0200
Subject: Always allow partner customisation
---
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
@@ -242,14 +242,14 @@ public class PartnerBrowserCustomizations {
@Override
protected Void doInBackground() {
try {
- boolean systemOrPreStable =
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
- || !ChromeVersionInfo.isStableBuild();
- if (!systemOrPreStable) {
- // Only allow partner customization if this browser is a system package, or
- // is in pre-stable channels.
- return null;
- }
+ //boolean systemOrPreStable =
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
+ // || !ChromeVersionInfo.isStableBuild();
+ //if (!systemOrPreStable) {
+ // // Only allow partner customization if this browser is a system package, or
+ // // is in pre-stable channels.
+ // return null;
+ //}
if (isCancelled()) return null;
refreshIncognitoModeDisabled();
--
2.11.0
@@ -1,38 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 5 Jun 2018 13:46:40 +0200
Subject: Always respect async dns flag (regardless of SDK version)
Do not read experiment value for cronet async DNS configuration
---
chrome/browser/net/system_network_context_manager.cc | 2 +-
components/cronet/url_request_context_config.cc | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
--- a/chrome/browser/net/system_network_context_manager.cc
+++ b/chrome/browser/net/system_network_context_manager.cc
@@ -219,7 +219,7 @@ void OnAuthPrefsChanged(PrefService* local_state,
// Android this includes checking the Android version in the field trial.
bool ShouldEnableAsyncDns() {
bool feature_can_be_enabled = true;
-#if defined(OS_ANDROID)
+#if 0
int min_sdk =
base::GetFieldTrialParamByFeatureAsInt(features::kAsyncDns, "min_sdk", 0);
if (base::android::BuildInfo::GetInstance()->sdk_int() < min_sdk)
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
--- a/components/cronet/url_request_context_config.cc
+++ b/components/cronet/url_request_context_config.cc
@@ -517,7 +517,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
effective_experimental_options->Remove(it.key(), nullptr);
continue;
}
- async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
+ bool ignored;
+ async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
} else if (it.key() == kStaleDnsFieldTrialName) {
const base::DictionaryValue* stale_dns_args = nullptr;
if (!it.value().GetAsDictionary(&stale_dns_args)) {
--
2.11.0
@@ -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,25 @@
From: uazo <uazo@users.noreply.github.com>
Date: Sat, 20 Nov 2021 17:42:41 +0000
Subject: Ask user before closing all tabs
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
@@ -496,8 +496,8 @@ const base::Feature kConditionalTabStripAndroid{
const base::Feature kCastDeviceFilter{"CastDeviceFilter",
base::FEATURE_DISABLED_BY_DEFAULT};
-const base::Feature kCloseTabSuggestions{"CloseTabSuggestions",
- base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kCloseTabSuggestions{"CloseTabSuggestions", // Enabled by default in Bromite
+ base::FEATURE_ENABLED_BY_DEFAULT}; // ^
const base::Feature kCriticalPersistedTabData{
"CriticalPersistedTabData", base::FEATURE_DISABLED_BY_DEFAULT};
--
2.25.1
@@ -1,56 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:49:37 +0200
Subject: AudioBuffer, AnalyserNode: fingerprinting mitigations via IDL
Return fixed base latency
---
third_party/blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
third_party/blink/renderer/modules/webaudio/audio_buffer.idl | 4 ++--
third_party/blink/renderer/modules/webaudio/audio_context.cc | 1 +
3 files changed, 7 insertions(+), 6 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
@@ -42,10 +42,10 @@ interface AnalyserNode : AudioNode {
// Copies the current frequency data into the passed array.
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
- void getFloatFrequencyData(Float32Array array);
- void getByteFrequencyData(Uint8Array array);
+ //void getFloatFrequencyData(Float32Array array);
+ //void getByteFrequencyData(Uint8Array array);
// Real-time waveform data
- void getFloatTimeDomainData(Float32Array array);
- void getByteTimeDomainData(Uint8Array array);
+ //void getFloatTimeDomainData(Float32Array array);
+ //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
@@ -38,7 +38,7 @@
// Channel access
readonly attribute unsigned long numberOfChannels;
- [RaisesException] Float32Array getChannelData(unsigned long channelIndex);
- [RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
+ //[RaisesException] Float32Array getChannelData(unsigned long channelIndex);
+ //[RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
};
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
@@ -330,6 +330,7 @@ void AudioContext::StopRendering() {
double AudioContext::baseLatency() const {
DCHECK(IsMainThread());
DCHECK(destination());
+ return 0.04;
// TODO(hongchan): Due to the incompatible constructor between
// AudioDestinationNode and DefaultAudioDestinationNode, casting directly from
--
2.11.0
@@ -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
@@ -497,7 +497,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
+20 -17
View File
@@ -2,51 +2,55 @@ 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
---
.../renderer/modules/battery/battery_manager.cc | 25 ++++------------------
1 file changed, 4 insertions(+), 21 deletions(-)
.../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
@@ -42,45 +42,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
@@ -77,46 +77,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
}
bool BatteryManager::charging() {
- return battery_status_.Charging();
+ return false;
+ return true;
}
double BatteryManager::chargingTime() {
- return battery_status_.charging_time();
+ return 0;
- return battery_status_.charging_time().InSecondsF();
+ return 0.0;
}
double BatteryManager::dischargingTime() {
- return battery_status_.discharging_time();
+ return 0;
- return battery_status_.discharging_time().InSecondsF();
+ return std::numeric_limits<double>::infinity();
}
double BatteryManager::level() {
- return battery_status_.Level();
+ return 1;
+ return 1.0;
}
void BatteryManager::DidUpdateData() {
DCHECK(battery_property_);
- BatteryStatus old_status = battery_status_;
- battery_status_ = *BatteryDispatcher::Instance().LatestData();
- battery_status_ = *battery_dispatcher_->LatestData();
-
if (battery_property_->GetState() == ScriptPromisePropertyBase::kPending) {
if (battery_property_->GetState() == BatteryProperty::kPending) {
battery_property_->Resolve(this);
return;
}
-
- Document* document = To<Document>(GetExecutionContext());
- DCHECK(document);
- if (document->IsContextPaused() || document->IsContextDestroyed())
- DCHECK(GetExecutionContext());
- if (GetExecutionContext()->IsContextPaused() ||
- GetExecutionContext()->IsContextDestroyed()) {
- return;
- }
-
- if (battery_status_.Charging() != old_status.Charging())
- DispatchEvent(*Event::Create(event_type_names::kChargingchange));
@@ -59,6 +63,5 @@ diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/thi
}
void BatteryManager::RegisterWithDispatcher() {
--
2.11.0
--
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
@@ -674,4 +674,20 @@ bool ExecutionContext::RequireTrustedTypes() const {
return require_safe_types_;
}
+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
@@ -386,6 +386,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
@@ -528,6 +528,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
@@ -166,6 +166,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,
const absl::optional<ResourceRequest::RedirectInfo>& redirect_info,
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
@@ -61,6 +61,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,
const absl::optional<ResourceRequest::RedirectInfo>& redirect_info,
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
@@ -101,6 +101,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) {
@@ -220,6 +244,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
@@ -274,6 +274,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
@@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url) {
url.SchemeIs(content::kChromeDevToolsScheme) ||
url.SchemeIs(content::kChromeUIScheme) ||
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);
}
@@ -571,7 +576,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
@@ -562,6 +562,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
@@ -755,6 +755,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
@@ -1020,6 +1020,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"
using base::Time;
using std::string;
@@ -587,6 +589,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
@@ -47,6 +47,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_context_storage.h"
#include "net/url_request/url_request_job_factory.h"
@@ -631,6 +632,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();
storage->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
@@ -45,6 +45,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
@@ -88,6 +89,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
@@ -21,6 +21,13 @@
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
@@ -31,6 +31,7 @@ import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.url.GURL;
import java.util.List;
+import java.util.HashSet;
/**
* Main action bar of bookmark UI. It is responsible for displaying title and buttons
@@ -136,6 +137,17 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
new TabDelegate(true), mDelegate.getModel());
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.";
@@ -145,6 +157,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);
@@ -156,6 +169,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);
@@ -187,6 +201,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
-715
View File
@@ -1,715 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 23 Aug 2018 19:30:15 +0200
Subject: Bromite adblock engine
Original adblock engine ported from NoChromo patch
Make interception testable
Add domain support
Re-land: third-party filters support
Add menu option to toggle global Adblock preference
Allow toggling Chromium's "ads enabled" content settings option together with Bromite adblock engine.
Perform adblock interception in StartJob to address lagging issues
New mechanism for adblocking based on Brave's adblocking hook
---
chrome/android/java/res/menu/custom_tabs_menu.xml | 12 +
chrome/android/java/res/menu/main_menu.xml | 11 +
.../chromium/chrome/browser/ChromeActivity.java | 8 +
.../chrome/browser/ChromeTabbedActivity.java | 8 +
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 +++
.../CustomTabAppMenuPropertiesDelegate.java | 2 +
.../java/strings/android_chrome_strings.grd | 11 +
chrome/browser/net/chrome_network_delegate.cc | 62 ++++
.../subresource_filter_content_settings_manager.cc | 1 +
net/BUILD.gn | 7 +
net/url_request/adblock_intercept.cc | 341 +++++++++++++++++++++
net/url_request/adblock_intercept.h | 41 +++
12 files changed, 542 insertions(+)
create mode 100644 net/url_request/adblock_intercept.cc
create mode 100644 net/url_request/adblock_intercept.h
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
@@ -74,6 +74,18 @@
</menu>
</item>
+ <item android:id="@+id/enable_adblock_row_menu_id"
+ android:title="@null"
+ android:orderInCategory="2">
+ <menu>
+ <item android:id="@+id/enable_adblock_id"
+ android:title="@string/menu_enable_adblock" />
+ <item android:id="@+id/enable_adblock_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<!-- Title is intentionally left blank in xml and will be set in java. -->
<item android:id="@+id/open_in_browser_id"
android:title=""
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
@@ -84,6 +84,17 @@
</menu>
</item>
+ <item android:id="@+id/enable_adblock_row_menu_id"
+ android:title="@null">
+ <menu>
+ <item android:id="@+id/enable_adblock_id"
+ android:title="@string/menu_enable_adblock" />
+ <item android:id="@+id/enable_adblock_check_id"
+ android:title="@null"
+ android:checkable="true" />
+ </menu>
+ </item>
+
<item android:id="@+id/reader_mode_prefs_id"
android:title="@string/menu_reader_mode_prefs"
android:icon="@drawable/reader_mode_prefs_icon" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -2206,6 +2206,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
RecordUserAction.record("MobileMenuRequestEnableJavascript");
} else if (id == R.id.reader_mode_prefs_id) {
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
+ } else if (id == R.id.enable_adblock_id || id == R.id.enable_adblock_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean adblockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS, adblockEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableAdBlock");
} else {
return false;
}
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
@@ -1667,6 +1667,14 @@ public class ChromeTabbedActivity
reportNewTabShortcutUsed(true);
getTabCreator(true).launchNTP();
}
+ } else if (id == R.id.enable_adblock_id || id == R.id.enable_adblock_check_id) {
+ final boolean reloadOnChange = !currentTab.isNativePage();
+ final boolean adblockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS, adblockEnabled);
+ if (reloadOnChange) {
+ currentTab.reload();
+ }
+ RecordUserAction.record("MobileMenuRequestEnableAdBlock");
} else if (id == R.id.all_bookmarks_menu_id) {
if (currentTab != null) {
getCompositorViewHolder().hideKeyboard(() -> {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
@@ -196,6 +196,8 @@ public class AppMenuPropertiesDelegate {
&& !TextUtils.isEmpty(url);
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
+ updateEnableAdBlockMenuItem(menu, currentTab);
+
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
updateEnableJavascriptMenuItem(menu, currentTab);
@@ -488,6 +490,42 @@ public class AppMenuPropertiesDelegate {
}
/**
+ * Updates the enable AdBlock item's state.
+ *
+ * @param menu {@link Menu} for enable adblock
+ * @param currentTab Current tab being displayed.
+ */
+ protected void updateEnableAdBlockMenuItem(
+ Menu menu, Tab currentTab) {
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_adblock_row_menu_id);
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_adblock_id);
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_adblock_check_id);
+
+
+ // Hide enable adblock on all chrome:// pages except for the NTP.
+ String url = currentTab.getUrl();
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
+ // Also hide enable javascsript on Reader Mode.
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
+
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
+ enableMenuRow.setVisible(itemVisible);
+ if (!itemVisible) return;
+
+ boolean adBlockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
+
+ // Mark the checkbox if adblock is globally activate.
+ enableMenuCheck.setChecked(adBlockEnabled);
+
+ // This title doesn't seem to be displayed by Android, but it is used to set up
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
+ enableMenuLabel.setTitleCondensed(adBlockEnabled
+ ? mActivity.getString(R.string.menu_enable_adblock_on)
+ : mActivity.getString(R.string.menu_enable_adblock_off));
+ }
+
+ /**
* A notification that the header view has finished inflating.
* @param view The view that was inflated.
* @param appMenu The menu the view is inside of.
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
@@ -181,6 +181,8 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
}
}
+ updateEnableAdBlockMenuItem(menu, currentTab);
+
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
updateEnableJavascriptMenuItem(menu, currentTab);
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3055,6 +3055,17 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
Turn on Request desktop site
</message>
+
+ <message name="IDS_MENU_ENABLE_ADBLOCK" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable AdBlock engine for the page. [CHAR-LIMIT=27]">
+ Enable AdBlock
+ </message>
+ <message name="IDS_MENU_ENABLE_ADBLOCK_ON" desc="Accessibility description for when Enable AdBlock is selected.">
+ Turn off AdBlock
+ </message>
+ <message name="IDS_MENU_ENABLE_ADBLOCK_OFF" desc="Accessibility description for when Enable AdBlock is unselected.">
+ Turn on AdBlock
+ </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>
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -25,6 +25,7 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/net/chrome_extensions_network_delegate.h"
@@ -59,6 +60,7 @@
#if defined(OS_ANDROID)
#include "base/android/path_utils.h"
#include "chrome/browser/io_thread.h"
+#include "net/url_request/adblock_intercept.h"
#endif
#if defined(OS_CHROMEOS)
@@ -193,16 +195,76 @@ void ChromeNetworkDelegate::set_cookie_settings(
cookie_settings_ = cookie_settings;
}
+#define TRANSPARENT1PXGIF "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
+
int ChromeNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
net::CompletionOnceCallback callback,
GURL* new_url) {
+
+#if defined(OS_ANDROID)
+ if (request) {
+ bool block = false, isValidUrl;
+
+ isValidUrl = request->url().is_valid();
+ std::string scheme = request->url().scheme();
+ if (isValidUrl && scheme.length()) {
+ std::transform(scheme.begin(), scheme.end(), scheme.begin(), ::tolower);
+ if ("http" != scheme && "https" != scheme) {
+ isValidUrl = false;
+ }
+ }
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
+
+ bool adblock_enabled = false;
+ if (isValidUrl && info) {
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter = info->GetWebContentsGetterForRequest();
+ content::WebContents* web_contents = web_contents_getter.Run();
+ if (web_contents) {
+ Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ //FIXME: this should not be called from the IO thread
+ const HostContentSettingsMap* content_settings = HostContentSettingsMapFactory::GetForProfile(profile);
+
+ if (content_settings) {
+ // check global value first
+ adblock_enabled = CONTENT_SETTING_BLOCK == content_settings->GetDefaultContentSetting(ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS, NULL);
+
+ if (!adblock_enabled) {
+ // check per-site value
+ adblock_enabled = CONTENT_SETTING_BLOCK == content_settings->GetContentSetting(request->url(), GURL(), ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS,
+ std::string());
+ }
+ }
+ }
+
+ if (adblock_enabled
+ && content::RESOURCE_TYPE_MAIN_FRAME != info->GetResourceType()
+ && net::adblock_intercept(request->url(),
+ request->initiator()->host(),
+ info->GetResourceType())) {
+ block = true;
+ }
+
+ if (block) {
+ if (content::RESOURCE_TYPE_IMAGE == info->GetResourceType()) {
+ *new_url = GURL(TRANSPARENT1PXGIF);
+ } else {
+ *new_url = GURL("");
+ }
+ return net::ERR_BLOCKED_BY_ADMINISTRATOR;
+ }
+ } // valid URL and info
+ } // request
+#endif // OS_ANDROID
+
extensions_delegate_->ForwardStartRequestStatus(request);
return extensions_delegate_->NotifyBeforeURLRequest(
request, std::move(callback), new_url);
}
+#undef TRANSPARENT1PXGIF
+
int ChromeNetworkDelegate::OnBeforeStartTransaction(
net::URLRequest* request,
net::CompletionOnceCallback callback,
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
--- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
@@ -19,6 +19,7 @@
#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/core/service_access_type.h"
#include "url/gurl.h"
+#include "net/url_request/adblock_intercept.h"
namespace {
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1758,6 +1758,13 @@ component("net") {
"url_request/websocket_handshake_userdata_key.h",
]
+ if (is_android) {
+ sources += [
+ "url_request/adblock_intercept.cc",
+ "url_request/adblock_intercept.h"
+ ]
+ }
+
if (enable_reporting) {
sources += [
"network_error_logging/network_error_logging_delegate.cc",
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.cc
@@ -0,0 +1,341 @@
+/*
+ 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 "url/gurl.h"
+
+#ifdef ADB_TESTER
+#include <cstddef>
+#include <cstdlib>
+#include <string.h>
+
+#include "log.h"
+#include <tld.h>
+
+#else
+
+#include "content/public/common/resource_type.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include <android/log.h>
+
+#endif
+
+#include "net/url_request/adblock_entries.h"
+
+namespace net {
+
+const char *LOG_TAG = "Bromite";
+
+#ifdef ADB_TESTER
+int adblock_rules_count() { return ADBLOCK_ENTRY_COUNT; }
+#endif
+
+// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
+// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
+// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
+// string in |tld|, if specified and the |host| can be parsed.
+static bool is_first_party(char *l_host, char *l_url_host) {
+ size_t tld_length;
+
+#ifdef ADB_TESTER
+ char *found_tld;
+
+ if (TLD_SUCCESS != tld_get_z(l_host, &found_tld))
+ return false;
+ tld_length = strlen(found_tld);
+ if (tld_length == 0)
+ return false;
+#else
+ tld_length = net::registry_controlled_domains::GetCanonicalHostRegistryLength(
+ l_host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
+ if ((tld_length == 0) || (tld_length == std::string::npos))
+ return false;
+#endif
+
+ int len = strlen(l_host);
+ char *tld = l_host + len - tld_length;
+
+ // Removes any subdomain from origin host.
+ int i = len - tld_length - 2, top_i = i;
+ if (i < 0) {
+ return false;
+ }
+ char *domain = l_host;
+ for (; i >= 0; i--) {
+ if (l_host[i] == '.') {
+ int p_len = top_i - i;
+ // skip "co" in "co.uk", "org" in "org.uk"
+ if (p_len <= 3) {
+ tld -= p_len + 1;
+ continue;
+ }
+
+ // segment is long enough, accept it at as a domain
+ domain = l_host + i;
+ len -= i;
+ break;
+ }
+ }
+
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "%s: extracted domain suffix: \"%s\" (TLD=\"%s\")",
+ l_host, domain, tld);
+#endif
+
+ // Check if supplied URL host matches, including the dot.
+ int b_len = strlen(l_url_host);
+ if (b_len < len) {
+ return false;
+ }
+ for (int i = 0; i < len; i++) {
+ if (l_url_host[b_len - 1 - i] != domain[len - 1 - i])
+ return false;
+ }
+
+ // pass with flying colors
+ return true;
+}
+
+static char *strtolower(const char *str) {
+ int len = strlen(str);
+ char *ret = (char *)malloc(len + 1);
+ ret[len] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((65 <= str[i]) && (str[i] <= 90)) {
+ ret[i] = str[i] + 32;
+ } else {
+ ret[i] = str[i];
+ }
+ }
+ return ret;
+}
+
+static char *strtosep(const char *str) {
+ int len = strlen(str);
+ char *ret = (char *)malloc(len + 3);
+ ret[0] = '^';
+ ret[len + 1] = '^';
+ ret[len + 2] = '\0';
+ for (int i = 0; i < len; i++) {
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') ||
+ (str[i] == '&') || (str[i] == '=')) {
+ ret[i + 1] = '^';
+ } else {
+ ret[i + 1] = str[i];
+ }
+ }
+ return ret;
+}
+
+static bool url_matches(const char *c_url, char *c_url_sep, char *c_url_lower,
+ char *c_url_lower_sep, adblock_entry *entry) {
+ bool match = false;
+ // select comparison string based on case and separator presence (separator
+ // takes some shortcuts)
+ bool match_case = ((entry->flags & ADBLOCK_FLAG_MATCH_CASE) != 0);
+ bool match_separator = ((entry->flags & ADBLOCK_FLAG_HAS_SEPARATOR) != 0);
+ const char *match_url =
+ match_case ? (match_separator ? c_url_sep : c_url)
+ : (match_separator ? c_url_lower_sep : c_url_lower);
+
+#ifdef ADBLOCK_LOG_MORE
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[case:%d][sep:%d][%s]",
+ match_case, match_separator, match_url);
+#endif
+ // check for all match parts at >= position of last match
+ const char *last = match_url;
+ for (int m = 0; const char *url_match = entry->matches[m]; m++) {
+ bool is_last_match = entry->matches[m + 1] == NULL;
+ const char *pos = strstr(last, url_match);
+ match = (pos != NULL);
+
+#ifdef ADBLOCK_LOG_MORE
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s][found:%d][match:%d]",
+ entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
+#endif
+ // check if the url starts with the first match part
+ if (match && (m == 0) && ((entry->flags & ADBLOCK_FLAG_MATCH_BEGIN) != 0) &&
+ (pos != match_url))
+ match = false;
+
+ // check if the url ends with the last match part
+ if (match && is_last_match &&
+ ((entry->flags & ADBLOCK_FLAG_MATCH_END) != 0) &&
+ (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])]))
+ match = false;
+
+ // check domain match
+ if (match && (m == 0) &&
+ ((entry->flags & ADBLOCK_FLAG_MATCH_DOMAIN) != 0) &&
+ (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') &&
+ (pos[-1] != '/'))
+ match = false;
+
+ // short circuit
+ if (!match)
+ break;
+ }
+ return match;
+}
+
+bool url_match_domain(adblock_entry *entry, const std::string &origin_host) {
+ bool match_domain = true;
+ // check for a negative domain match
+ if (entry->domains_skip) {
+ if (origin_host.empty()) {
+ // skip this rule, cannot match on domain
+ return false;
+ }
+ for (int d = 0; const char *domain = entry->domains_skip[d]; d++) {
+ if (domain == origin_host) {
+ match_domain = false;
+ break;
+ }
+ }
+ }
+
+ // check for a required positive domain match
+ if (entry->domains) {
+ if (origin_host.empty()) {
+ // skip this rule, cannot match on domain
+ return false;
+ }
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
+ if (domain != origin_host) {
+ match_domain = false;
+ break;
+ }
+ }
+ }
+ return match_domain;
+}
+
+static bool url_match_party(adblock_entry *entry, const GURL &url,
+ const std::string &origin_host, bool &checked_fp,
+ bool &fp) {
+ bool wanted_fp;
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
+ wanted_fp = false;
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
+ wanted_fp = true;
+ } else {
+ // no-op
+ return true;
+ }
+
+ if (origin_host.empty()) {
+ // cannot match this rule, no origin host to determine first/third party
+ return false;
+ }
+
+#ifdef ADB_TESTER
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
+// matchFirstParty, matchThirdParty);
+#endif
+ if (!checked_fp) {
+ // lower-case version
+ char *l_host = strtolower(origin_host.c_str()),
+ *l_url_host = strtolower(url.host().c_str());
+
+ // is the URL a first-party to the current page's host?
+ fp = is_first_party(l_host, l_url_host);
+
+ checked_fp = true;
+#ifdef ADB_TESTER
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
+ l_url_host, fp ? "true" : "false");
+#endif
+ free(l_host);
+ free(l_url_host);
+ }
+
+ return fp == wanted_fp;
+}
+
+int adblock_intercept(const GURL &url, const std::string &origin_host
+#ifndef ADB_TESTER
+, content::ResourceType resource_type
+#endif
+) {
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
+ const char *c_url = url.spec().c_str();
+ char *c_url_lower = strtolower(c_url);
+ char *c_url_sep = strtosep(c_url);
+ char *c_url_lower_sep = strtosep(c_url_lower);
+
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
+ c_url, url.host().c_str(), origin_host.c_str());
+#endif
+
+ bool checked_fp = false, fp = false;
+
+ bool intercept = false;
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
+ adblock_entry *entry = &ADBLOCK_ENTRIES[i];
+
+ // no use checking rules when we're intercepting, or exceptions when not
+ bool check =
+ (!intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) == 0)) ||
+ (intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) != 0));
+ if (!check)
+ continue;
+
+ // first check for domain matches, a quick branch out if matching
+ if (!url_match_domain(entry, origin_host))
+ continue;
+
+ // check on the URL matcher
+ if (!url_matches(c_url, c_url_sep, c_url_lower, c_url_lower_sep, entry))
+ continue;
+
+ // finally check first/third-party
+ if (!url_match_party(entry, url, origin_host, checked_fp, fp))
+ continue;
+
+#ifdef ADBLOCK_LOG
+ if (!intercept) {
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
+ "--> intercept (#%d: \"%s\") (%x)", i,
+ entry->matches[0], entry->flags);
+ } else {
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "--> pass (%d) (#%d)", i,
+ entry->flags);
+ }
+#endif
+ intercept = !intercept;
+ } // for each entry
+
+ free(c_url_sep);
+ free(c_url_lower);
+ free(c_url_lower_sep);
+
+ if (intercept) {
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
+#endif
+ return 1;
+ }
+#ifdef ADBLOCK_LOG
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
+#endif
+ }
+ return 0;
+}
+
+} // namespace net
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
new file mode 100644
--- /dev/null
+++ b/net/url_request/adblock_intercept.h
@@ -0,0 +1,41 @@
+/*
+ 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 NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
+
+#include "url/gurl.h"
+
+#ifndef ADB_TESTER
+#include "content/public/common/resource_type.h"
+#endif
+
+namespace net {
+
+#ifdef ADB_TESTER
+int adblock_rules_count();
+#endif
+
+int adblock_intercept(const GURL &url, const std::string &origin_host
+#ifndef ADB_TESTER
+, content::ResourceType resource_type
+#endif
+);
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
--
2.11.0
File diff suppressed because it is too large Load Diff
+23
View File
@@ -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
@@ -46,7 +46,7 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
assert(current_toolchain != android_secondary_abi_toolchain)
}
-_default_package = "org.chromium.chrome"
+_default_package = "org.bromite.bromite"
if (android_channel != "default" && android_channel != "stable") {
# android-binary-size trybot may checks if an internal Chrome variant's
# AndroidManifest is as expected by ensuring the differences between its
--
2.25.1
@@ -1,293 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 24 Mar 2018 05:18:03 +0100
Subject: Canvas: fingerprinting mitigations for image data and webGL
Disable webGL renderer info and modify the color data returned by ToBlob,
ToDataURL and getImageData so that it will contain randomly manipulated
pixels (maximum 20) that slightly change the color of the R,G,B components
without a visible effect.
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
approach to change color components.
---
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 4 +-
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
third_party/blink/renderer/platform/BUILD.gn | 4 +-
.../platform/graphics/image_data_buffer.cc | 5 +
.../platform/graphics/static_bitmap_image.cc | 156 +++++++++++++++++++++
.../platform/graphics/static_bitmap_image.h | 2 +
6 files changed, 169 insertions(+), 6 deletions(-)
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
@@ -33,8 +33,6 @@
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h"
-#include "base/rand_util.h"
-
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_scroll_into_view_params.h"
@@ -789,7 +787,7 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
GetState().GetTextAlign(), text);
// scale text metrics by 3/1000000th
- auto shuffleFactor = 1 + (base::RandDouble() - 0.5) * 0.000003;
+ auto shuffleFactor = 1 + (canvas()->GetDocument().GetShuffleFactorX() - 0.5) * 0.000003;
textMetrics->Shuffle(shuffleFactor);
return textMetrics;
diff --git a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
--- a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
+++ b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
WebGLRenderingContextBase* context) {
- return MakeGarbageCollected<WebGLDebugRendererInfo>(context);
+ return nullptr;
}
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
- return true;
+ return false;
}
const char* WebGLDebugRendererInfo::ExtensionName() {
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1429,7 +1429,9 @@ jumbo_component("platform") {
"//third_party/blink/renderer:non_test_config",
]
- include_dirs = []
+ include_dirs = [
+ "//third_party/skia/include/private", # For shuffler in graphics/static_bitmap_image.cc
+ ]
public_deps = [
":blink_platform_public_deps",
diff --git a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
--- a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
+++ b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
@@ -35,6 +35,8 @@
#include <memory>
#include "base/memory/ptr_util.h"
+#include "base/rand_util.h"
+#include "base/logging.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/image-encoders/image_encoder.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -128,6 +130,9 @@ bool ImageDataBuffer::EncodeImageInternal(const ImageEncodingMimeType mime_type,
const SkPixmap& pixmap) const {
DCHECK(is_valid_);
+ // shuffle subchannel color data within the pixmap
+ StaticBitmapImage::ShuffleSubchannelColorData(pixmap_.writable_addr(), pixmap_.info(), 0, 0);
+
if (mime_type == kMimeTypeJpeg) {
SkJpegEncoder::Options options;
options.fQuality = ImageEncoder::ComputeJpegQuality(quality);
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
+#include "base/rand_util.h"
+#include "base/logging.h"
#include "base/numerics/checked_math.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
@@ -15,6 +17,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/private/SkColorData.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
@@ -176,10 +179,163 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
DCHECK(read_pixels_successful ||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
rect.X(), rect.Y(), info.width(), info.height())));
+
+ ShuffleSubchannelColorData(result.Data(), info, rect.X(), rect.Y());
+
result.Transfer(dest_contents);
return true;
}
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
+
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
+
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
+ auto w = info.width() - srcX, h = info.height() - srcY;
+
+ // skip tiny images; info.width()/height() can also be 0
+ if ((w < 8) || (h < 8)) {
+ return;
+ }
+
+ // generate the first random number here
+ double shuffleX = base::RandDouble();
+
+ // cap maximum pixels to change
+ auto pixels = (w + h) / 128;
+ if (pixels > 20) {
+ pixels = 20;
+ } else if (pixels < 2) {
+ pixels = 2;
+ }
+
+ auto colorType = info.colorType();
+ auto fRowBytes = info.minRowBytes(); // stride
+
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
+
+ // second random number (for y/height)
+ double shuffleY = base::RandDouble();
+
+ // calculate random coordinates using bisection
+ auto currentW = w, currentH = h;
+ for(;pixels >= 0; pixels--) {
+ int x = currentW * shuffleX, y = currentH * shuffleY;
+
+ // calculate randomisation amounts for each RGB component
+ uint8_t shuffleR = base::RandInt(0, 4);
+ uint8_t shuffleG = (shuffleR + x) % 4;
+ uint8_t shuffleB = (shuffleG + y) % 4;
+
+ // manipulate pixel data to slightly change the R, G, B components
+ switch (colorType) {
+ case kAlpha_8_SkColorType:
+ {
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
+ auto r = SkColorGetR(*pixel), g = SkColorGetG(*pixel), b = SkColorGetB(*pixel), a = SkColorGetA(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = SkColorSetARGB(a, r, g, b);
+ }
+ break;
+ case kGray_8_SkColorType:
+ {
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
+ *pixel = shuffleComponent(*pixel, UINT8_MAX-1, shuffleB);
+ }
+ break;
+ case kRGB_565_SkColorType:
+ {
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
+ unsigned r = SkPacked16ToR32(*pixel);
+ unsigned g = SkPacked16ToG32(*pixel);
+ unsigned b = SkPacked16ToB32(*pixel);
+
+ r = shuffleComponent(r, 31, shuffleR);
+ g = shuffleComponent(g, 63, shuffleG);
+ b = shuffleComponent(b, 31, shuffleB);
+
+ unsigned r16 = (r & SK_R16_MASK) << SK_R16_SHIFT;
+ unsigned g16 = (g & SK_G16_MASK) << SK_G16_SHIFT;
+ unsigned b16 = (b & SK_B16_MASK) << SK_B16_SHIFT;
+
+ *pixel = r16 | g16 | b16;
+ }
+ break;
+ case kARGB_4444_SkColorType:
+ {
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA4444(*pixel), r = SkGetPackedR4444(*pixel), g = SkGetPackedG4444(*pixel), b = SkGetPackedB4444(*pixel);
+
+ r = shuffleComponent(r, 15, shuffleR);
+ g = shuffleComponent(g, 15, shuffleG);
+ b = shuffleComponent(b, 15, shuffleB);
+ // alpha is left unchanged
+
+ unsigned a4 = (a & 0xF) << SK_A4444_SHIFT;
+ unsigned r4 = (r & 0xF) << SK_R4444_SHIFT;
+ unsigned g4 = (g & 0xF) << SK_G4444_SHIFT;
+ unsigned b4 = (b & 0xF) << SK_B4444_SHIFT;
+
+ *pixel = r4 | b4 | g4 | a4;
+ }
+ break;
+ case kRGBA_8888_SkColorType:
+ {
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA32(*pixel), r = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), b = SkGetPackedB32(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
+ (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
+ }
+ break;
+ case kBGRA_8888_SkColorType:
+ {
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
+ auto a = SkGetPackedA32(*pixel), b = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), r = SkGetPackedB32(*pixel);
+
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
+ // alpha is left unchanged
+
+ *pixel = (a << SK_BGRA_A32_SHIFT) | (r << SK_BGRA_R32_SHIFT) |
+ (g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
+ }
+ break;
+ default:
+ // the remaining formats are not expected to be used in Chromium
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
+ return;
+ }
+
+ // keep bisecting or reset current width/height as needed
+ if (x == 0) {
+ currentW = w;
+ } else {
+ currentW = x;
+ }
+ if (y == 0) {
+ currentH = h;
+ } else {
+ currentH = y;
+ }
+ }
+}
+
+#undef writable_addr
+#undef shuffleComponent
+
const gpu::SyncToken& StaticBitmapImage::GetSyncToken() const {
static const gpu::SyncToken sync_token;
return sync_token;
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
@@ -46,6 +46,8 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
static scoped_refptr<StaticBitmapImage> Create(WTF::ArrayBufferContents&,
const SkImageInfo&);
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
+
bool IsStaticBitmapImage() const override { return true; }
// Methods overridden by all sub-classes
--
2.11.0
@@ -1,36 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 27 Jun 2018 11:02:38 +0200
Subject: Change default homepage to new tab page
Disable any partner-provided home page.
---
.../chrome/browser/partnercustomizations/HomepageManager.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
@@ -102,8 +102,7 @@ public class HomepageManager {
* @return Whether or not homepage setting should be shown.
*/
public static boolean shouldShowHomepageSetting() {
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
- || FeatureUtilities.isHomePageButtonForceEnabled();
+ return FeatureUtilities.isHomePageButtonForceEnabled();
}
/**
@@ -124,9 +123,7 @@ public class HomepageManager {
* if the homepage button is force enabled via flag.
*/
public static String getDefaultHomepageUri() {
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
- ? PartnerBrowserCustomizations.getHomePageUrl()
- : UrlConstants.NTP_NON_NATIVE_URL;
+ return UrlConstants.NTP_NON_NATIVE_URL;
}
/**
--
2.11.0
+23
View File
@@ -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
@@ -46,7 +46,7 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
assert(current_toolchain != android_secondary_abi_toolchain)
}
-_default_package = "org.chromium.chrome"
+_default_package = "org.bromite.chromium"
if (android_channel != "default" && android_channel != "stable") {
# android-binary-size trybot may checks if an internal Chrome variant's
# AndroidManifest is as expected by ensuring the differences between its
--
2.25.1
+195
View File
@@ -0,0 +1,195 @@
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
Hard-code model to SAMSUNG SM-G960U
use Google Chrome branding for client hints
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/prefs/browser_prefs.cc | 2 +-
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/common/user_agent.cc | 9 +--------
content/public/common/content_features.cc | 2 +-
services/network/public/cpp/client_hints.cc | 1 +
services/network/public/cpp/features.cc | 4 ++--
third_party/blink/common/client_hints/client_hints.cc | 1 +
.../blink/common/client_hints/enabled_client_hints.cc | 4 +++-
third_party/blink/common/features.cc | 4 ++--
11 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -793,7 +793,7 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
registry->RegisterListPref(prefs::kUsedPolicyCertificates);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
- registry->RegisterBooleanPref(kUserAgentClientHintsEnabled, true);
+ registry->RegisterBooleanPref(kUserAgentClientHintsEnabled, false);
registry->RegisterBooleanPref(kCloudPolicyOverridesPlatformPolicy, false);
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
@@ -253,9 +253,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
@@ -433,7 +433,8 @@ void AddPrefersColorSchemeHeader(net::HttpRequestHeaders* headers,
is_dark_mode ? "dark" : "light");
}
-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
@@ -1034,6 +1034,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/common/user_agent.cc b/content/common/user_agent.cc
--- a/content/common/user_agent.cc
+++ b/content/common/user_agent.cc
@@ -323,14 +323,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
}
std::string BuildModelInfo() {
- std::string model;
-#if BUILDFLAG(IS_ANDROID)
- // Only send the model information if on the release build of Android,
- // matching user agent behaviour.
- if (base::SysInfo::GetAndroidBuildCodename() == "REL")
- model = base::SysInfo::HardwareModelName();
-#endif
- return model;
+ return "SAMSUNG SM-G960U";
}
#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
@@ -233,7 +233,7 @@ const base::Feature kCrashReporting{"CrashReporting",
// Enables support for the `Critical-CH` response header.
// https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
const base::Feature kCriticalClientHint{"CriticalClientHint",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Enable debugging the issue crbug.com/1201355
const 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
@@ -97,6 +97,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
@@ -179,8 +179,8 @@ const 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
-const base::Feature kAcceptCHFrame{"AcceptCHFrame",
- base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kAcceptCHFrame{"AcceptCHFrame", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT}; // in Bromite
const base::Feature kSCTAuditingRetryReports{"SCTAuditingRetryReports",
base::FEATURE_ENABLED_BY_DEFAULT};
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
@@ -111,6 +111,7 @@ const size_t kWebEffectiveConnectionTypeMappingCount =
std::size(kWebEffectiveConnectionTypeMapping);
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:
@@ -127,7 +128,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,
@@ -156,6 +157,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))
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
@@ -162,7 +162,7 @@ const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
// Enables User-Agent Client Hints
const base::Feature kUserAgentClientHint{"UserAgentClientHint",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Handle prefers-color-scheme user preference media feature via client hints.
const base::Feature kPrefersColorSchemeClientHintHeader{
@@ -542,7 +542,7 @@ const base::Feature kAudioWorkletThreadRealtimePriority{
const base::Feature kLightweightNoStatePrefetch {
"LightweightNoStatePrefetch",
#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
+ base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
--
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
@@ -13,5 +13,6 @@
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
@@ -214,8 +214,7 @@ public abstract class UrlBar extends AutocompleteEditText {
// the first draw.
setFocusable(false);
setFocusableInTouchMode(false);
- 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
+317
View File
@@ -0,0 +1,317 @@
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 | 2 +-
.../browser/flags/CachedFeatureFlags.java | 2 +-
chrome/browser/ui/android/omnibox/BUILD.gn | 2 --
.../browser/omnibox/LocationBarMediator.java | 1 -
13 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
@@ -369,7 +369,6 @@ android_library("chrome_java") {
"//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",
@@ -998,7 +997,6 @@ robolectric_binary("chrome_junit_tests") {
"//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",
@@ -1516,7 +1514,6 @@ android_library("chrome_test_java") {
"//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
@@ -42,7 +42,6 @@ import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
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.gsa.GSAState;
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator;
import org.chromium.chrome.browser.profiles.Profile;
@@ -246,8 +245,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";
@@ -477,8 +474,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
@@ -111,10 +111,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;
@@ -370,8 +366,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<>();
@@ -1159,10 +1153,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();
}
@@ -1251,23 +1241,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
FontSizePrefs.getInstance(Profile.getLastUsedRegularProfile())
.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();
- });
- }
}
/**
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;
@@ -997,12 +996,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
@@ -359,14 +359,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
@@ -688,7 +688,7 @@ const base::Feature kDynamicColorButtonsAndroid{
"DynamicColorButtonsAndroid", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kExperimentsForAgsa{"ExperimentsForAgsa",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kExploreSites{"ExploreSites",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -72,7 +72,7 @@ public class CachedFeatureFlags {
.put(ChromeFeatureList.EARLY_LIBRARY_LOAD, true)
.put(ChromeFeatureList.ELASTIC_OVERSCROLL, true)
.put(ChromeFeatureList.ELIDE_PRIORITIZATION_OF_PRE_NATIVE_BOOTSTRAP_TASKS, true)
- .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, true)
+ .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, false)
.put(ChromeFeatureList.FEED_LOADING_PLACEHOLDER, false)
.put(ChromeFeatureList.GRID_TAB_SWITCHER_FOR_TABLETS, false)
.put(ChromeFeatureList.IMMERSIVE_UI_MODE, false)
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
@@ -140,7 +140,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",
@@ -425,7 +424,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
@@ -1494,6 +1494,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
@@ -5,6 +5,11 @@
<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
@@ -947,6 +947,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,32 @@
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 | 8 ++------
1 file changed, 2 insertions(+), 6 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
@@ -81,12 +81,8 @@ const base::Feature kAppShimNewCloseBehavior{"AppShimNewCloseBehavior",
// Enables the built-in DNS resolver.
const base::Feature kAsyncDns {
- "AsyncDns",
-#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ "AsyncDns", // Bromite guard for this feature to be always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT // ^
};
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
--
2.25.1
@@ -0,0 +1,23 @@
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
@@ -748,7 +748,7 @@ const base::Feature kMediaDrmPersistentLicense{
// MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
// which will trigger provisioning process after MediaDrmBridge is created.
const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// 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,263 @@
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 | 22 ------------
.../browser/chrome_content_browser_client.cc | 3 ++
.../history/core/browser/history_backend.cc | 13 +------
.../history/core/browser/history_service.cc | 2 +-
.../privacy_sandbox/privacy_sandbox_prefs.cc | 2 +-
.../privacy_sandbox_settings.cc | 35 +++++++++++--------
.../privacy_sandbox_settings.h | 1 -
8 files changed, 26 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
@@ -65,10 +65,6 @@
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
@@ -61,7 +61,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_REVIEW = "privacy_review";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
@@ -91,21 +90,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 privacyReviewPreference = findPreference(PREF_PRIVACY_REVIEW);
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_REVIEW)) {
getPreferenceScreen().removePreference(privacyReviewPreference);
@@ -233,12 +217,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
@@ -2976,6 +2976,9 @@ bool ChromeContentBrowserClient::IsConversionMeasurementOperationAllowed(
const url::Origin* impression_origin,
const url::Origin* conversion_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
@@ -490,18 +490,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/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc
--- a/components/history/core/browser/history_service.cc
+++ b/components/history/core/browser/history_service.cc
@@ -393,7 +393,7 @@ void HistoryService::AddPage(const GURL& url,
AddPage(HistoryAddPageArgs(
url, time, context_id, nav_entry_id, referrer, redirects, transition,
!ui::PageTransitionIsMainFrame(transition), visit_source,
- did_replace_entry, /*consider_for_ntp_most_visited=*/true, floc_allowed));
+ did_replace_entry, /*consider_for_ntp_most_visited=*/true, /*floc_allowed*/false));
}
void HistoryService::AddPage(const GURL& url,
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
@@ -60,7 +60,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
@@ -67,8 +67,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_);
@@ -88,7 +87,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 =
@@ -113,7 +113,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;
auto* blocked_topics =
pref_service_->GetList(prefs::kPrivacySandboxBlockedTopics);
@@ -181,9 +182,8 @@ base::Time PrivacySandboxSettings::TopicsDataAccessibleSince() const {
bool PrivacySandboxSettings::IsConversionMeasurementAllowed(
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::ShouldSendConversionReport(
@@ -277,7 +277,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;
DictionaryPrefUpdate scoped_pref_update(
pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked);
auto* pref_data = scoped_pref_update.Get();
@@ -328,7 +329,9 @@ bool PrivacySandboxSettings::IsSharedStorageAllowed(
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;
@@ -343,7 +346,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) {
@@ -361,7 +364,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);
@@ -370,7 +374,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))
@@ -424,9 +429,9 @@ bool PrivacySandboxSettings::IsPrivacySandboxEnabledForContext(
top_frame_origin);
}
-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
@@ -215,7 +215,6 @@ class PrivacySandboxSettings : public KeyedService {
scoped_refptr<content_settings::CookieSettings> cookie_settings_;
raw_ptr<PrefService> pref_service_;
PrefChangeRegistrar pref_change_registrar_;
- bool incognito_profile_;
};
} // namespace privacy_sandbox
--
2.25.1
@@ -2,30 +2,46 @@ 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/ntp_snippets/features.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
components/feed/core/shared_prefs/pref_names.cc | 4 ++--
components/ntp_snippets/features.cc | 4 ++--
2 files changed, 4 insertions(+), 4 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
@@ -34,13 +34,13 @@ const base::Feature* const kAllFeatures[] = {
&kRemoteSuggestionsBackendFeature};
@@ -38,7 +38,7 @@ const base::Feature* const kAllFeatures[] = {
&kOptionalImagesEnabledFeature};
const base::Feature kArticleSuggestionsFeature{
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kBookmarkSuggestionsFeature{
- "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "NTPBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kRemoteSuggestionsEmulateM58FetchingSchedule{
"RemoteSuggestionsEmulateM58FetchingSchedule",
@@ -68,7 +68,7 @@ const char kNotificationsDailyLimit[] = "daily_limit";
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kKeepPrefetchedContentSuggestions{
- "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kBreakingNewsPushFeature{"BreakingNewsPush",
base::FEATURE_DISABLED_BY_DEFAULT};
--
2.11.0
const base::Feature kOptionalImagesEnabledFeature{
"NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
--
2.25.1
@@ -1,50 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 26 Nov 2017 23:11:56 +0100
Subject: Disable Omaha update checks
Do not consider Jelly Bean unsupported
---
.../android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java | 2 +-
.../java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java | 2 +-
chrome/browser/android/chrome_feature_list.cc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
@@ -134,7 +134,7 @@ public class OmahaBase {
/** See {@link #sIsDisabled}. */
static boolean isDisabled() {
- return sIsDisabled;
+ return true;
}
/**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
@@ -42,7 +42,7 @@ public class VersionNumberGetter {
private static VersionNumberGetter sInstanceForTests;
/** If false, OmahaClient will never report that a newer version is available. */
- private static boolean sEnableUpdateDetection = true;
+ private static boolean sEnableUpdateDetection = false;
protected VersionNumberGetter() { }
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
--- a/chrome/browser/android/chrome_feature_list.cc
+++ b/chrome/browser/android/chrome_feature_list.cc
@@ -350,7 +350,7 @@ const base::Feature kIntentBlockExternalFormRedirectsNoGesture{
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kJellyBeanSupported{"JellyBeanSupported",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kLanguagesPreference{"LanguagesPreference",
base::FEATURE_ENABLED_BY_DEFAULT};
--
2.11.0
+41
View File
@@ -0,0 +1,41 @@
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 | 12 ++++++------
1 file changed, 6 insertions(+), 6 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
@@ -445,8 +445,8 @@ const base::Feature kHaTSDesktopDevToolsIssuesCSP{
// Enables or disables the Happiness Tracking System for Desktop Privacy Guide.
const 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",
@@ -759,11 +759,11 @@ const base::Feature kPrefixWebAppWindowsWithAppName{
const base::Feature kPrerenderFallbackToPreconnect{
"PrerenderFallbackToPreconnect", base::FEATURE_ENABLED_BY_DEFAULT};
-const base::Feature kPrivacyGuide2{"PrivacyGuide2",
- base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kPrivacyGuide2{"PrivacyGuide2", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT}; // in Bromite
-const base::Feature kPrivacyGuideAndroid{"PrivacyGuideAndroid",
- base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kPrivacyGuideAndroid{"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
+295
View File
@@ -0,0 +1,295 @@
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 | 6 +++
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, 128 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
@@ -4747,6 +4747,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
@@ -1023,6 +1023,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
@@ -586,6 +586,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
@@ -111,6 +111,12 @@ const base::Feature kUseDnsHttpsSvcbAlpn{"UseDnsHttpsSvcbAlpn",
const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kDisableTLSResumption{"DisableTLSResumption",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
+const base::Feature kLogTLSResumption{"LogTLSResumption",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kEncryptedClientHello{"EncryptedClientHello",
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
@@ -174,6 +174,12 @@ NET_EXPORT extern const base::Feature kUseDnsHttpsSvcbAlpn;
// Enables TLS 1.3 early data.
NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
+// Disables TLS resumption.
+NET_EXPORT extern const base::Feature kDisableTLSResumption;
+
+// Log TLS resumption.
+NET_EXPORT extern const base::Feature kLogTLSResumption;
+
// Enables the TLS Encrypted ClientHello feature.
// https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-13
NET_EXPORT extern const base::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
@@ -206,6 +206,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
@@ -73,6 +73,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"
@@ -248,6 +249,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
@@ -2244,7 +2277,7 @@ QuicStreamFactory::CreateCryptoConfigHandle(
sct_auditing_delegate_,
HostsFromOrigins(params_.origins_to_force_quic_on),
actual_network_isolation_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_isolation_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_isolation_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();
}
@@ -787,6 +813,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>(
@@ -1075,6 +1103,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.
@@ -1748,6 +1805,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
@@ -1,28 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 26 Oct 2017 16:59:03 +0200
Subject: Disable WebRTC by default
---
chrome/browser/ui/browser_ui_prefs.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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
@@ -85,10 +85,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
false);
#endif
// TODO(guoweis): Remove next 2 options at M50.
- registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
- registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
+ registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, false);
+ registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, false);
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
- content::kWebRTCIPHandlingDefault);
+ content::kWebRTCIPHandlingDisableNonProxiedUdp);
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
--
2.11.0
@@ -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
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Jul 2018 11:17:53 +0200
Subject: Disable ads metrics by default
---
chrome/common/chrome_features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
@@ -15,7 +15,7 @@ namespace features {
// All features in alphabetical order.
// Enables Ads Metrics.
-const base::Feature kAdsFeature{"AdsMetrics", base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kAdsFeature{"AdsMetrics", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
const base::Feature kAllowAutoplayUnmutedInWebappManifestScope{
--
2.11.0
@@ -0,0 +1,275 @@
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 | 6 ++---
.../optimization_guide/core/hints_fetcher.cc | 1 +
.../optimization_guide/core/hints_manager.cc | 4 ++++
.../core/optimization_guide_features.cc | 24 +++++++++----------
.../core/prediction_model_download_manager.cc | 6 +++--
.../core/prediction_model_fetcher_impl.cc | 1 +
components/optimization_guide/features.gni | 4 +---
components/permissions/features.cc | 2 +-
.../segmentation_platform/public/features.cc | 2 +-
third_party/blink/common/features.cc | 2 +-
12 files changed, 30 insertions(+), 24 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
@@ -29,6 +29,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
@@ -354,7 +354,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
@@ -726,8 +726,8 @@ const base::Feature kPermissionAuditing{"PermissionAuditing",
// 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.
-const base::Feature kPermissionPredictions{"PermissionPredictions",
- base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kPermissionPredictions{"PermissionPredictions", // always disabled
+ base::FEATURE_DISABLED_BY_DEFAULT}; // in Bromite
// The holdback chance is 30% but it can also be configured/updated
// through finch if needed.
@@ -738,7 +738,7 @@ const base::FeatureParam<double> kPermissionPredictionsHoldbackChance(
// Enables using the prediction service for geolocation permission prompts.
const base::Feature kPermissionGeolocationPredictions{
- "PermissionGeolocationPredictions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "PermissionGeolocationPredictions", base::FEATURE_DISABLED_BY_DEFAULT}; // always disabled 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
@@ -175,6 +175,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
@@ -348,6 +348,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:
@@ -1239,6 +1240,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
@@ -77,16 +77,16 @@ 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.
-const base::Feature kOptimizationHints{"OptimizationHints",
- base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kOptimizationHints{"OptimizationHints", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT}; // in Bromite
// Enables fetching from a remote Optimization Guide Service.
const base::Feature kRemoteOptimizationGuideFetching{
- "OptimizationHintsFetching", base::FEATURE_ENABLED_BY_DEFAULT};
+ "OptimizationHintsFetching", base::FEATURE_DISABLED_BY_DEFAULT}; // disabled by default in Bromite
const 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.
@@ -96,15 +96,15 @@ const base::Feature kContextMenuPerformanceInfoAndRemoteHintFetching{
// Enables the prediction of optimization targets.
const base::Feature kOptimizationTargetPrediction{
- "OptimizationTargetPrediction", base::FEATURE_ENABLED_BY_DEFAULT};
+ "OptimizationTargetPrediction", base::FEATURE_DISABLED_BY_DEFAULT}; // disabled by default in Bromite
// Enables the downloading of models.
const 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
+#else // BUILD_WITH_TFLITE_LIB
+ base::FEATURE_DISABLED_BY_DEFAULT // guard this
#endif // !BUILD_WITH_TFLITE_LIB
};
@@ -134,7 +134,7 @@ const base::Feature kPageEntitiesModelResetOnShutdown{
// Enables push notification of hints.
const base::Feature kPushNotifications{"OptimizationGuidePushNotifications",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
// This feature flag does not turn off any behavior, it is only used for
// experiment parameters.
@@ -146,12 +146,12 @@ const base::Feature kOptimizationGuideMetadataValidation{
"OptimizationGuideMetadataValidation", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kPageTopicsBatchAnnotations{
- "PageTopicsBatchAnnotations", base::FEATURE_ENABLED_BY_DEFAULT};
+ "PageTopicsBatchAnnotations", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kPageVisibilityBatchAnnotations{
"PageVisibilityBatchAnnotations", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kUseLocalPageEntitiesMetadataProvider{
- "UseLocalPageEntitiesMetadataProvider", base::FEATURE_DISABLED_BY_DEFAULT};
+ "UseLocalPageEntitiesMetadataProvider", base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
const base::Feature kPageContentAnnotationsValidation{
"PageContentAnnotationsValidation", base::FEATURE_DISABLED_BY_DEFAULT};
@@ -390,7 +390,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
@@ -46,7 +46,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 =
@@ -99,7 +99,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) {}
@@ -114,6 +114,7 @@ base::FilePath::StringType PredictionModelDownloadManager::ModelInfoFileName() {
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;
@@ -250,6 +251,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
@@ -65,7 +65,7 @@ const base::Feature kPermissionPredictionServiceUseUrlOverride{
const base::Feature kPermissionOnDeviceNotificationPredictions{
"PermissionOnDeviceNotificationPredictions",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
#if BUILDFLAG(IS_ANDROID)
diff --git a/components/segmentation_platform/public/features.cc b/components/segmentation_platform/public/features.cc
--- a/components/segmentation_platform/public/features.cc
+++ b/components/segmentation_platform/public/features.cc
@@ -27,7 +27,7 @@ const base::Feature kSegmentationPlatformLowEngagementFeature{
const base::Feature kSegmentationPlatformFeedSegmentFeature{
"SegmentationPlatformFeedSegmentFeature",
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
- base::FEATURE_ENABLED_BY_DEFAULT
+ base::FEATURE_DISABLED_BY_DEFAULT
};
#else
base::FEATURE_DISABLED_BY_DEFAULT
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
@@ -185,7 +185,7 @@ const base::Feature kViewportHeightClientHintHeader{
const base::Feature kNavigationPredictor {
"NavigationPredictor",
#if BUILDFLAG(IS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
+ base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
--
2.25.1

Some files were not shown because too many files have changed in this diff Show More