Compare commits

..
22 Commits
Author SHA1 Message Date
github-actions 17d09d1035 Update filters (Sun Jul 5 06:37:59 UTC 2026) 2026-07-05 06:37:59 +00:00
github-actions 786abea8ea Update filters (Fri Jul 3 06:28:33 UTC 2026) 2026-07-03 06:28:33 +00:00
github-actions 76cb65fa21 Update filters (Wed Jul 1 07:08:57 UTC 2026) 2026-07-01 07:08:57 +00:00
github-actions 38fddbac5f Update filters (Mon Jun 29 07:27:54 UTC 2026) 2026-06-29 07:27:54 +00:00
github-actions 0b4f3aab21 Update filters (Sat Jun 27 06:27:42 UTC 2026) 2026-06-27 06:27:42 +00:00
github-actions 187b5a2a95 Update filters (Thu Jun 25 06:46:18 UTC 2026) 2026-06-25 06:46:18 +00:00
github-actions e07d86fff8 Update filters (Tue Jun 23 06:48:25 UTC 2026) 2026-06-23 06:48:25 +00:00
github-actions 515cd6db5e Update filters (Sun Jun 21 07:57:43 UTC 2026) 2026-06-21 07:57:43 +00:00
github-actions c410db57dc Update filters (Fri Jun 19 08:30:58 UTC 2026) 2026-06-19 08:30:58 +00:00
github-actions 24a3291958 Update filters (Wed Jun 17 08:27:26 UTC 2026) 2026-06-17 08:27:26 +00:00
github-actions 71343434e7 Update filters (Mon Jun 15 09:00:09 UTC 2026) 2026-06-15 09:00:09 +00:00
github-actions 6eb66207f6 Update filters (Sat Jun 13 06:58:18 UTC 2026) 2026-06-13 06:58:18 +00:00
github-actions 4b6b44778c Update filters (Thu Jun 11 07:28:17 UTC 2026) 2026-06-11 07:28:17 +00:00
github-actions 50ba9fb149 Update filters (Tue Jun 9 06:47:09 UTC 2026) 2026-06-09 06:47:09 +00:00
github-actions 87b9ed8e51 Update filters (Sun Jun 7 07:04:34 UTC 2026) 2026-06-07 07:04:34 +00:00
github-actions 29c40a8340 Update filters (Fri Jun 5 11:54:18 UTC 2026) 2026-06-05 11:54:18 +00:00
uazo 0e799979a5 Update fonts url 2026-06-05 12:53:59 +02:00
uazo ba79b21b5b Add components 2026-06-05 12:51:33 +02:00
uazo 821a713cc0 add gitattributes 2026-06-05 12:51:08 +02:00
uazoandGitHub 22368088ac Add README.md for components folder 2026-06-05 12:48:29 +02:00
github-actions 27ef89e662 Update filters (Fri Jun 5 10:34:30 UTC 2026) 2026-06-05 10:34:30 +00:00
uazo e6171a93d7 create .gitignore 2026-06-05 10:04:16 +02:00
225 changed files with 2342996 additions and 51587 deletions
+2
View File
@@ -0,0 +1,2 @@
*.zip binary
*.pdf binary
-4
View File
@@ -1,4 +0,0 @@
# These are supported funding model platforms
liberapay: csagan5
custom: https://www.bromite.org/#donate
-61
View File
@@ -1,61 +0,0 @@
---
name: Bug report
about: Create a Bromite bug report
---
<!-- Welcome! Thanks for taking time to submit a bug report.
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
Are you sure this is not a Chromium bug? You have to test with Chromium before submitting a bug.
Are you using the latest version of Bromite?
-->
### Bromite version
Version: `83.0...`
Arch: `arm` or `arm64` or `x86`
Android version: (example: `9.0`)
Device model: (example: `SM-G960UZKABST`)
### Is this bug about the SystemWebView?
Yes/No
<!-- No support for SystemWebView installations is provided. -->
### Is the bug reproducible with latest version?
<!-- Do not report bugs which are not reproducible with latest version. -->
### Can the bug be reproduced with corresponding Chromium version?
<!--
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.
-->
### 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
<!-- Write here a clear and concise description of the bug. -->
### Steps to reproduce the bug
Steps to reproduce the bug:
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. Otherwise remove this section. -->
-32
View File
@@ -1,32 +0,0 @@
---
name: Feature request
about: Suggest a privacy-related idea for this project
---
<!-- Welcome! Thanks for taking time to submit a feature request.
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
Have you read the F.A.Q.s? https://github.com/bromite/bromite/blob/master/FAQ.md
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
Have you read the Wiki? https://github.com/bromite/bromite/wiki
-->
<!-- Do not submit feature requests for extensions support or adding a search engine. -->
### Is your feature request related to privacy?
<!-- Features that are not related to privacy are not considered. -->
### Is there a patch available for this feature somewhere?
<!-- If yes then provide URL and license information. -->
### Describe the solution you would like
<!-- A clear and concise description of what you want to happen.
Do not ask "I would like feature X which is available in browser Y"; such issues are closed immediately. -->
### Describe alternatives you have considered
<!-- A clear and concise description of any alternative solutions or features you have considered. -->
+5
View File
@@ -0,0 +1,5 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################
/.vs
-712
View File
@@ -1,712 +0,0 @@
# 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)
# 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)
* AV1 codec support
# 71.0.3578.132
* add patches from AndroidHardening project (fixes https://github.com/bromite/bromite/issues/226)
# 71.0.3578.123
* disable jumbo builds (fixes https://github.com/bromite/bromite/issues/216 and https://github.com/bromite/bromite/issues/219)
* disable preview fetching
* do not consider Android Jelly Bean unsupported
# 71.0.3578.120
* fix breakage of translate quick answers by anti-AMP (fixes https://github.com/bromite/bromite/issues/210)
# 71.0.3578.115
* add AdGuard DNS-over-HTTPS option
* use green icon for SystemWebView
# 71.0.3578.110
# 71.0.3578.104
* fix AMP links sanitisation; have it working for news as well (fixes https://github.com/bromite/bromite/issues/202)
* revert upstream patch responsible for the broken save dialog prompt (upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
# 71.0.3578.101
# 71.0.3578.98
* do not ask permissions for camera when importing bookmarks (fixes https://github.com/bromite/bromite/issues/200)
# 71.0.3578.88
* add proxy configuration page (see https://github.com/bromite/bromite/wiki/ProxyConfiguration)
* use more recent versions in User-Agent (fixes https://github.com/bromite/bromite/issues/156)
# 71.0.3578.85
* fix blurry adaptive icon (fixes https://github.com/bromite/bromite/issues/197)
# 71.0.3578.76
# 71.0.3578.72
* add flag to disable IPv6 probes
# 70.0.3538.107
* added adaptive icon (fixes https://github.com/bromite/bromite/issues/181)
* do not change randomisation at each call (fixes https://github.com/bromite/bromite/issues/177)
* do not enable #enable-scroll-anchor-serialization by default
# 70.0.3538.102
* do not grant notifications to default search engine
* remove all promos from bookmark manager page
* re-introduced various patches to eradicate binary blob dependencies (only Cast left)
* remove contacts picker permission
# 70.0.3538.95
* fix crash on bookmark edit activity (fixes https://github.com/bromite/bromite/issues/172)
* fix slow chrome://flags (fixes https://github.com/bromite/bromite/issues/173)
* enable TLS 1.3 final support by default (fixes https://github.com/bromite/bromite/issues/174)
* dropped some patches related to GCM/GMS on suspicion of being related to random crashes
# 70.0.3538.87
* enable history requirement of user gesture (fixes https://github.com/bromite/bromite/issues/171)
* enable serialization of scroll position changes while loading (fixes https://github.com/bromite/bromite/issues/171)
* remove passwords keyboard accessory option (fixes https://github.com/bromite/bromite/issues/171)
* some improvements to bookmark import/export interaction
* add flag to disable orientation API, disabled by default
* disable device motion API by default (fixes https://github.com/bromite/bromite/issues/171)
# 70.0.3538.83
* fix keep session cookies option showing on all site settings views
* fix blank site settings entry showing (fixes https://github.com/bromite/bromite/issues/166)
* offer builtin autocomplete for chrome://flags quick access
# 70.0.3538.80
* add flag to disable video resume functionality, allowing to not pause video playback on tab switch (fixes https://github.com/bromite/bromite/issues/108)
* prevent "are you there" prompts from appearing when playing videos
* completely disable update scheduler checks to fix a related crash
# 70.0.3538.77
* disable generic sensor APIs by default (fixes https://github.com/bromite/bromite/issues/160)
* introduce flag to disable device motion API (fixes https://github.com/bromite/bromite/issues/160)
* add Quad9 as a DNS-over-HTTPS (DoH) option (fixes https://github.com/bromite/bromite/issues/140)
# 70.0.3538.71
* fix bug with canvas fingerprinting (fixes https://github.com/bromite/bromite/issues/154)
# 70.0.3538.67
* re-enabled DNS-over-HTTPS (DoH) flag (fixes https://github.com/bromite/bromite/issues/139)
* dropped GCM removal patch
* disable kSigninAllowedOnNextStartup by default
* permanently disable query-in-omnibox (fixes https://github.com/bromite/bromite/issues/143)
# 69.0.3497.113
* disabled DNS-over-HTTPS (DoH) flag, not working since 69.0.3497.73 (see https://github.com/bromite/bromite/issues/139)
# 69.0.3497.109
# 69.0.3497.102
* ungoogled-chromium: disable network time tracker
* ungoogled-chromium: remove third-party/analytics
* ungoogled-chromium: always use local Devtools instead of remote files
* build without safebrowsing
* drop "Hide NTP tiles" flag
# 69.0.3497.91
* fixed crash when accessing site settings media preferences (fixes https://github.com/bromite/bromite/issues/122)
# 69.0.3497.73
* enabled WebRTC
* drop clear HTTP cache patch
# 68.0.3440.126
* add option to disallow custom tab intents (fixes https://github.com/bromite/bromite/issues/117)
* add option to keep local data until browser exit (fixes https://github.com/bromite/bromite/issues/56)
* remember preference for tabs persistence option
* extend anti-AMP to all search results
# 68.0.3440.121
* add option to not persist tabs across sessions (fixes https://github.com/bromite/bromite/issues/106)
* always incognito mode (fixes https://github.com/bromite/bromite/issues/18)
* disable domain reliability (ungoogled-chromium)
* more efficient adblock interception by using proper handler
* fix log message about default maximum connections
* improvement for exit menu patch
# 68.0.3440.110
* add import action to Bookmarks activity page
* use different user-agent version based on Android OS version
# 68.0.3440.90
* reduce rects randomisation by factor of 100
* use a fixed user-agent (fixes https://github.com/bromite/bromite/issues/103)
# 68.0.3440.87
* add export action to Bookmarks activity page
# 68.0.3440.81
* fix issue with filters with an excluded domain option
# 68.0.3440.72
* fix crash during some canvas rendering (fixes https://github.com/bromite/bromite/issues/95)
* new approach to adblock filtering (fixes https://github.com/bromite/bromite/issues/90)
* add a flag to enable higher maximum connections per host limit (fixes https://github.com/bromite/bromite/issues/61)
* add a flag to disable custom tab intents (fixes https://github.com/bromite/bromite/issues/81)
* add a flag to have an always-empty new tab page (fixes https://github.com/bromite/bromite/issues/82)
* reduced randomization of TextMetrics and ClientRects results
* disable ads metrics by default
* disable all field trials (fixes https://github.com/bromite/bromite/issues/83)
* re-introduced own battery API patch (fixes https://github.com/bromite/bromite/issues/80)
# 67.0.3396.107
* removed patch to use Android Media Player for URLs (fixes https://github.com/bromite/bromite/issues/71)
# 67.0.3396.101
* set home page to new tab page
* adjust order of new menu entries, remove help menu item (fixes https://github.com/bromite/bromite/issues/76)
* remove some Play Services integrations: Auth, Vision, GCM
* remove TOS/metrics and translate
* net/cert: increase default key length for newly-generated RSA keys
* dns: send IPv6 connectivity probes to RIPE DNS rather than Google
* profile-resetter: do not tick send-settings by default
* autofill: disable autofill download manager
* first_run: deactivate autoupdate globally
* safe_browsing: disable incident reporting
* safe_browsing: disable reporting of safebrowsing override
* safe_browsing: disable cookie transmission
* extensions: always show component extensions in the ext list
* translate: disable fetching of translate languages from server
# 67.0.3396.95
* reduce headers sent in DoH requests (fixes https://github.com/bromite/bromite/issues/70)
* serve DoH requests with maximum priority
* `CloudFlare` -> `Cloudflare` (fixes https://github.com/bromite/bromite/issues/73)
* fingerprint mitigations: cover also `ConvertToArrayBufferContents`
* removed redundant own patch for battery API
# 67.0.3396.92
* improve randomization for each retrieved Canvas data (fixes https://github.com/bromite/bromite/issues/69)
# 67.0.3396.88
* add flag for DNS-over-HTTPS (Google experimental DNS) (fixes https://github.com/bromite/bromite/issues/68)
* disable signin, translate and data saver UI/internal components (fixes https://github.com/bromite/bromite/issues/67)
* rename `GoogleEN` -> `Google In English` (fixes https://github.com/bromite/bromite/issues/66)
* re-enabled text metrics and ToDataURL, ToBlob with randomization of color data (fixes https://github.com/bromite/bromite/issues/52)
* open YouTube links in Bromite
* use Android Media Player for URLs
* add exit menu item
* hide "send reports to Google" menu item
# 67.0.3396.82
# 67.0.3396.76
# 67.0.3396.72
* add global toggle for adblock engine (https://github.com/bromite/bromite/issues/53)
# 67.0.3396.67
# 66.0.3359.202
* fix DevTools integration (https://github.com/bromite/bromite/issues/23)
* allow toggling of Javascript from New Tab Page (fixes https://github.com/bromite/bromite/issues/60)
# 66.0.3359.200
# 66.0.3359.196
# 66.0.3359.188
* increase max (persistent) connections per server from 6 to 15
* preliminary work for better canvas fingerprinting mitigations
# 66.0.3359.161
# 66.0.3359.148
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
* reduce randomization for client rects from 5% to 3%
# 65.0.3325.230
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
# 65.0.3325.218
* always set WideVine version
# 65.0.3325.204
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
* set audio latency to fixed number
# 65.0.3325.198
* re-landed support for third-party AdBlock filters
* completed patches cleanup
# 65.0.3325.190
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
# 65.0.3325.176
* block plugins enumeration API
* block battery API
* remove device name and build id from User Agent
* added Qwant search engine
* disable non-working 3rd-party filters support
# 64.0.3282.204
* use H264 NEON optimizations also for arm64
* fix build of Stable channel
* started building vanilla Chromium releases as well
# 64.0.3282.193
* disable reporting
# 64.0.3282.182
* add support for domain-based adblock filters
* optimized memory allocation for filters
# 64.0.3282.168
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
* never fetch most popular sites for new tab initialization, disable logo on new tab page
* some improvements to adblock filters
* disabled signin (ungoogled-chromium) (https://github.com/bromite/bromite/issues/31 and https://github.com/bromite/bromite/issues/11)
* disabled webRTC and crash uploaders (ungoogled-chromium)
* disabled translate (ungoogled-chromium)
* disabled Gaia & GCM (ungoogled-chromium)
* added clear HTTP cache menu item (ungoogled-chromium)
* disabled Google host detection (ungoogled-chromium)
* disabled profile avatar downloading (ungoogled-chromium)
* disabled intranet redirect detector (ungoogled-chromium)
* disabled plugin untraceable URLs (ungoogled-chromium)
# 64.0.3282.149
# 63.0.3239.150
* fixed crash when clicking on address bar lock (page info) or opening site settings (https://github.com/bromite/bromite/issues/28)
* build H264 with NEON optimizations for ARMv7
* more builds for arm64 architecture
# 63.0.3239.144
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
# 63.0.3239.129
# 63.0.3239.122
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
* hyperlinks sanitization fixed and now accessible from Google logo click
* now building and publishing SystemWebView apks
# 63.0.3239.118
* limit impact of AMP-removal to not break tabs (https://github.com/bromite/bromite/issues/20)
* fix DuckDuckGo and StartPage suggestions (https://github.com/bromite/bromite/issues/19)
* revert /deep/ and ::shadow feature drop to attempt fixing DevTools support (https://github.com/bromite/bromite/issues/23)
* remove also ads from search results
* add Google search engine with English-only results, no RLZ and field trials
* fix build of x86 version (was broken in previous version)
# 63.0.3239.85
* no suggest URL for DuckDuckGo (https://github.com/bromite/bromite/issues/19)
* fixed 4chan blocking rule
* limit AMP links cleanup to search results only (fixes broken images/news result tabs)
# 63.0.3239.78
* correctly set version and build numbers
# 63.0.3239.73
# 63.0.3239.64
* fixed an issue with incognito new tab
* permanent disable for ToS/metrics and unused auto-updates check
# 63.0.3239.46
* removed search engine geolocation default patch
# 63.0.3239.38
# 63.0.3239.27
# 63.0.3239.24
* convert AMP search results to regular search results
# 63.0.3239.15
* remove URL tracking from Google search results
* disable webRTC by default (https://github.com/bromite/bromite/issues/9, still not working proper)
* do not enable search engine geolocation by default
* use own package name (closes https://github.com/bromite/bromite/issues/1)
* use 64bit WebView process
# 63.0.3239.10
* attempt enabling API keys (didn't work)
* added StartPage search engine (closes https://github.com/bromite/bromite/issues/3)
# 63.0.3239.6
* added Bromite patch for Google search results click-tracking removal
* added x86 target CPU
* fixed red blink frame
# 63.0.3235.2
* first release with NoChromo adblocking patch
* Bromite patch: disable NTP remote suggestions
* added some Inox/Iridium/Ungoogled-Chromium patches, namely:
* DuckDuckGo search engine
* disable battery status service
* disable formatting in OmniBox
* disable GCM status checks
* use local fonts instead of fonts from Google servers
* disable updater pings
* do not enable Google integrations by default (translation, lookup, etc)
* disable the ad promo system
* do not store passwords by default
* do not fetch Google promotions
* restore classic NTP
* only keep cookies until exit
* block third-party cookies
-78
View File
@@ -1,78 +0,0 @@
# 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 -> Multimedia.
## 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 wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
## 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.
The WebRTC functionality has always been using safe defaults to prevent leaks (disabled multiple routes and non-proxied UDP).
## 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?
No; the only autofill available in Chromium browsers requires integration with the Play Store binary blobs.
Some apps use accessibility services as a workaround.
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-166
View File
@@ -1,166 +0,0 @@
# Bromite - Take back your browser
<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" />
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
Bromite is only available for Android Lollipop (v5.0, API level 21) and above.
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" />
For the Frequently Asked Questions see [F.A.Q.](./FAQ.md).
For documentation see the [wiki](https://github.com/bromite/bromite/wiki).
# Goals
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
# Donate
Please donate to support development of Bromite and the costs for the build system.
[&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)
<a href="bitcoin:bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel">BTC donations address</a>: `bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel`
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
# Features
* customizable adblock filters via user-provided URL (see https://www.bromite.org/custom-filters)
* remove click-tracking and AMP from search results
* DNS-over-HTTPS support with any valid IETF DoH endpoint
* always-incognito mode
* disable all field trials permanently
* disable smart search by default, allow web search from incognito mode
* always-visible cookies, javascript and ads site settings
* remove Play integration binary blobs
* use [CFI](https://en.wikipedia.org/wiki/Control-flow_integrity) on all architectures except x86
* 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
## Features not related to privacy
* import/export bookmarks
* flag to allow screenshots of incognito tabs
* 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
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.
* `#enable-horizontal-tab-switcher`
* `#pull-to-refresh`
* `#enable-search-ready-omnibox`
* `#darken-websites-checkbox-in-themes-setting`
New flags:
* `#enable-incognito-snapshots-in-android-recents`
* `#max-connections-per-host`
* `#resume-background-video`
* `#ipv6-probing`
* `#disable-webgl`
* `#enable-device-motion` and `#enable-device-orientation`
* `#show-legacy-tls-warnings`
# Privacy limitations
Bromite's privacy features, including anti-fingerprinting mitigations (which are not comprehensive), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://www.torproject.org/download/) in such cases.
# Releases
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically highlight the one apt for your device (or none otherwise).
Each tag corresponds to a Chromium Stable release tag.
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 19 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
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.
All official releases are also available through the [official third-party F-Droid repository](https://www.bromite.org/fdroid).
## Integrity and authenticity
You can verify the integrity of a downloaded APK file from this project with any `sha256sum`-compatible tool by downloading the corresponding `brm_X.Y.Z.sha256.txt` or `chr_X.Y.Z.sha256.txt` file, where X.Y.Z is the release version number. Example:
```
$ sha256sum --check brm_68.0.3440.54.sha256.txt
arm64_SystemWebView.apk: OK
arm64_ChromePublic.apk: OK
arm64_ChromeModernPublic.apk: OK
```
You can verify authenticity, e.g. that the author ([csagan5](https://github.com/csagan5)) released the file, by using gpg2:
```
$ gpg2 --quiet --verify brm_68.0.3440.54.sha256.txt.asc
gpg: assuming signed data in 'brm_68.0.3440.54.sha256.txt'
gpg: Signature made Sun 08 Jul 2018 04:22:52 PM CEST using RSA key ID D85DC0C5
gpg: Good signature from "csagan5 <32685696+csagan5@users.noreply.github.com>"
```
You can download csagan5's public GnuPG key from here: [csagan5.asc](./csagan5.asc).
# How to build
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
The Chromium version tag used as base for the patches is available here: [RELEASE](./build/RELEASE); this is always corresponding to the git tag for every release.
The GN args used to build Bromite are available here: [GN_ARGS](./build/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
# 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
* [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/)
# License
The patches published as part of the Bromite project are released under [GNU GPL v3](./LICENSE).
[version-image]: https://img.shields.io/github/release/bromite/bromite.svg?style=flat-square
[version-url]: https://github.com/bromite/bromite/releases/latest
[license-image]: https://img.shields.io/github/license/bromite/bromite.svg
[license-url]: https://github.com/bromite/bromite/blob/master/LICENSE
-38
View File
@@ -1,38 +0,0 @@
android_channel="stable"
blink_symbol_level=1
dcheck_always_on=false
debuggable_apks=false
dfmify_dev_ui=false
disable_android_lint=true
disable_autofill_assistant_dfm=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 ffmpeg_branding="Chrome" proprietary_codecs=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_platform_dolby_vision=true
enable_platform_hevc=true
enable_remoting=false
enable_reporting=true
enable_resource_whitelist_generation=false
enable_vr=false
fieldtrial_testing_like_official_build=true
icu_use_data_file=true
is_component_build=false
is_debug=false
is_official_build=true
rtc_build_examples=false
safe_browsing_mode=0
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
use_sysroot=false
-1
View File
@@ -1 +0,0 @@
85.0.4183.94
-153
View File
@@ -1,153 +0,0 @@
Disable-third-party-cookies-by-default.patch
Revert-Remove-pre-unified-consent-code.patch
Restore-classic-new-tab-page.patch
Always-use-new-tab-page-for-default-home-page.patch
Always-allow-partner-customisation.patch
battery_status_service-disable-more-privacy-nightmares.patch
Battery-API-return-nothing.patch
updater-disable-updater-pings.patch
Remove-EV-certificates.patch
promo-disable-Google-promotion-fetching.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
Change-default-webRTC-policy-to-not-use-any-address.patch
Never-send-any-crash-upload-data.patch
Hide-send-reports-checkbox.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-redirect-detector.patch
ungoogled-chromium-Disable-Google-host-detection.patch
ungoogled-chromium-Disable-GCM.patch
ungoogled-chromium-Disable-Gaia.patch
ungoogled-chromium-Disable-domain-reliability.patch
ungoogled-chromium-Disable-Network-Time-Tracker.patch
Disable-safe-browsing.patch
Skip-the-first-run-and-metrics.patch
Disable-all-promo-dialogs.patch
Disable-sync-services-menu-entry.patch
Remove-signin-and-data-saver-integrations.patch
Hide-passwords-manager-link.patch
Disable-Omaha-update-checks.patch
Disable-update-scheduler.patch
Add-English-only-search-engine.patch
Add-DuckDuckGo-Lite-search-engine.patch
Fix-crash-when-accessing-page-info-site-settings.patch
openH264-enable-ARM-ARM64-optimizations.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
build-remove-calling-untrusted-hooks.patch
AV1-codec-support.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
Open-YouTube-links-in-Bromite.patch
Add-exit-menu-item.patch
Remove-help-menu-item.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Multiple-fingerprinting-mitigations-for-canvas-text-and-client-rectangles.patch
Add-flags-to-disable-device-motion-orientation-APIs.patch
Disable-metrics-on-all-I-O-threads.patch
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
Add-flag-to-configure-maximum-connections-per-host.patch
Add-bookmark-import-export-actions.patch
Disable-promos-displayed-in-bookmarks-manager.patch
Add-an-always-incognito-mode.patch
Add-custom-tab-intents-privacy-option.patch
Add-option-to-not-persist-tabs-across-sessions.patch
Disable-fetching-of-all-field-trials.patch
Disable-seed-based-field-trials.patch
Disable-plugins-enumeration.patch
net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
profile-resetter-do-not-tick-send-settings-by-default.patch
browser-ui-disable-warning-about-missing-API-keys.patch
autofill-disable-autofill-download-manager.patch
first_run-deactivate-autoupdate-globally.patch
translate-disable-fetching-of-translate-languages-from-server.patch
kill-TOS-and-metrics-opt-out.patch
kill-Translate.patch
kill-Vision.patch
kill-Location-fall-back-to-system.patch
kill-Auth.patch
Remove-dependency-on-com.google.android.gms.auth.patch
kill-GCM.patch
Remove-dependency-on-com.google.android.gcm.patch
Remove-dependency-on-com.google.android.gms.gcm.patch
Remove-dependency-on-com.google.android.play.patch
Remove-dependency-on-vision-clearcut-and-phenotype.patch
Remove-dependency-on-flags-places-and-stats.patch
Remove-dependency-on-fido-iid-instantapps-location.patch
Remove-dependency-on-com.google.android.gms.cast.patch
Remove-dependency-on-auth-signin-dynamic-and-tasks.patch
Remove-google_services_gcm.patch
Remove-SMS-integration.patch
Do-not-compile-QR-code-sharing.patch
Allow-website-sign-in-without-account-sign-in.patch
Offer-builtin-autocomplete-for-chrome-flags.patch
Do-not-grant-notifications-to-default-search-engine.patch
Add-flag-to-disable-IPv6-probes.patch
Add-a-proxy-configuration-page.patch
Do-not-ignore-download-location-prompt-setting.patch
Disable-previews-by-default.patch
Use-4-tile-rows-never-show-logo.patch
Disable-metrics-collection-for-NTP-tiles.patch
Enable-SPPI-for-devices-with-enough-memory.patch
prefs-disable-signinallowed-by-default.patch
prefs-always-prompt-for-download-directory-by-default.patch
Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
disable-payment-support-by-default.patch
disable-background-sync-by-default.patch
disable-sensors-access-site-setting-by-default.patch
Disable-media-router-and-remoting-by-default.patch
Restore-Search-Ready-Omnibox-flag.patch
disable-AdsBlockedInfoBar.patch
Bromite-AdBlockUpdaterService.patch
Add-option-to-configure-the-ad-blocker-filters-URL.patch
Replace-DoH-probe-domain-with-RIPE-domain.patch
Increase-number-of-autocomplete-matches-from-5-to-10.patch
Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
Disable-some-signed-exchange-features.patch
Add-flag-to-disable-WebGL.patch
Add-user-setting-for-DNS-over-HTTPS-DoH-custom-URL.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-password-reuse-detection-on-android.patch
Disable-feeds-support-by-default.patch
Disable-autofill-assistant-by-default.patch
Show-site-settings-for-cookies-javascript-and-ads.patch
Restore-enable-horizontal-tab-switcher-flag.patch
Disable-DRM-media-origin-IDs-preprovisioning.patch
Disable-smart-selection-by-default.patch
Enable-user-agent-freeze-by-default.patch
disable-browser-autologin-by-default.patch
Revert-gpu-android-Remove-setup-for-disabling-AImageReader.patch
Revert-Remove-flags-to-enable-disable-AImageReader.patch
Disable-AImageReader-for-ARM64-P-and-ARM64-Q.patch
Restore-GPU-bug-blacklist-for-AImageReader-on-ARM-CPUs.patch
Update-i18n-zh_CN-support.patch
Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
Add-menu-item-to-view-source.patch
Enable-legacy-TLS-interstitital-warning.patch
Block-gateway-attacks-via-websockets.patch
Enable-prefetch-privacy-changes-by-default.patch
Enable-reduced-referrer-granularity-by-default.patch
Disable-support-for-RAR-files-inspection.patch
Enable-improved-cookie-controls-by-default.patch
Add-history-support-in-incognito-mode.patch
Enable-darken-websites-checkbox-in-themes.patch
Remove-blocklisted-URLs-upon-bookmark-creation.patch
Disable-scroll-to-text-fragment.patch
Rollback-dav1d-upgrades-that-break-x86.patch
Disable-the-DIAL-repeating-discovery.patch
Timezone-customization.patch
Block-all-connection-requests-with-qjz9zk-in-the-domain-name-or-with-a-trk-scheme.patch
Automated-domain-substitution.patch
Remove-some-params-from-search-url.patch
-7
View File
@@ -1,7 +0,0 @@
Revert-Remove-pre-unified-consent-code.patch
AV1-codec-support.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
Disable-password-reuse-detection-on-android.patch
Disable-feeds-support-by-default.patch
Rollback-dav1d-upgrades-that-break-x86.patch
-234
View File
@@ -1,234 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 16 Dec 2018 15:24:19 +0100
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 +++++
.../config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
.../config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
.../source/config/linux/arm-neon/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
.../libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm/config/aom_config.h | 2 +-
.../libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
.../source/config/linux/generic/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/generic/config/aom_config.h | 2 +-
.../libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/x64/config/aom_config.h | 2 +-
15 files changed, 26 insertions(+), 15 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
@@ -563,9 +563,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.
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
@@ -81,7 +81,7 @@ if (enable_libaom) {
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
}
@@ -184,7 +184,7 @@ if (enable_libaom) {
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" ]
@@ -233,6 +233,8 @@ if (enable_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
@@ -656,6 +656,11 @@ aom_mem_sources = [
aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/emms.asm" ]
+aom_ports_arm_sources = [
+ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
+ "//third_party/libaom/source/libaom/aom_ports/arm.h",
+ ]
+
aom_rtcd_sources = [
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
"//third_party/libaom/source/libaom/aom_scale/aom_scale_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
@@ -44,7 +44,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NN_V2 equ 0
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 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
@@ -44,7 +44,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NN_V2 equ 0
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 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
@@ -44,7 +44,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NN_V2 equ 0
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 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
@@ -44,7 +44,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NN_V2 equ 0
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 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
@@ -44,7 +44,7 @@ CONFIG_MULTITHREAD equ 1
CONFIG_NN_V2 equ 0
CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OS_SUPPORT equ 1
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 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
@@ -34,7 +34,7 @@
%define CONFIG_NN_V2 0
%define CONFIG_NORMAL_TILE_MODE 1
%define CONFIG_OS_SUPPORT 1
-%define CONFIG_PIC 0
+%define CONFIG_PIC 1
%define CONFIG_RD_DEBUG 0
%define CONFIG_REALTIME_ONLY 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
@@ -46,7 +46,7 @@
#define CONFIG_NN_V2 0
#define CONFIG_NORMAL_TILE_MODE 1
#define CONFIG_OS_SUPPORT 1
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 0
#define CONFIG_RUNTIME_CPU_DETECT 1
--
2.17.1
@@ -1,902 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 11:06:18 +0200
Subject: Add DuckDuckGo Lite search engine
---
.../search_engines/prepopulated_engines.json | 10 +
.../search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 190 +++++++++---------
3 files changed, 107 insertions(+), 94 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
@@ -91,6 +91,16 @@
"id": 68
},
+ "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
+ },
+
"duckduckgo": {
"name": "DuckDuckGo",
"keyword": "duckduckgo.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
@@ -65,6 +65,7 @@ enum SearchEngineType {
SEARCH_ENGINE_360,
SEARCH_ENGINE_COCCOC,
SEARCH_ENGINE_DUCKDUCKGO,
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
SEARCH_ENGINE_PARSIJOO,
SEARCH_ENGINE_QWANT,
SEARCH_ENGINE_GIVERO,
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
@@ -35,6 +35,7 @@ const PrepopulatedEngine* const engines_default[] = {
&googleen, &google,
&bing,
&yahoo,
+ &duckduckgo, &duckduckgo_light,
};
// Note, the below entries are sorted by country code, not the name in comment.
@@ -44,7 +45,7 @@ const PrepopulatedEngine* const engines_AE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -53,7 +54,7 @@ const PrepopulatedEngine* const engines_AL[] = {
&googleen, &google,
&yahoo,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -62,7 +63,7 @@ const PrepopulatedEngine* const engines_AR[] = {
&googleen, &google,
&bing,
&yahoo_ar,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -70,7 +71,7 @@ const PrepopulatedEngine* const engines_AR[] = {
const PrepopulatedEngine* const engines_AT[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_at,
&ecosia,
};
@@ -79,7 +80,7 @@ const PrepopulatedEngine* const engines_AT[] = {
const PrepopulatedEngine* const engines_AU[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_au,
&ecosia,
};
@@ -89,7 +90,7 @@ const PrepopulatedEngine* const engines_BA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -99,7 +100,7 @@ const PrepopulatedEngine* const engines_BE[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Bulgaria
@@ -107,7 +108,7 @@ const PrepopulatedEngine* const engines_BG[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -116,7 +117,7 @@ const PrepopulatedEngine* const engines_BH[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -125,7 +126,7 @@ const PrepopulatedEngine* const engines_BI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -134,7 +135,7 @@ const PrepopulatedEngine* const engines_BN[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -143,7 +144,7 @@ const PrepopulatedEngine* const engines_BO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -152,7 +153,7 @@ const PrepopulatedEngine* const engines_BR[] = {
&googleen, &google,
&bing,
&yahoo_br,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -170,7 +171,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -179,7 +180,7 @@ const PrepopulatedEngine* const engines_CA[] = {
&googleen, &google,
&bing,
&yahoo_ca,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -187,7 +188,7 @@ const PrepopulatedEngine* const engines_CA[] = {
const PrepopulatedEngine* const engines_CH[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_ch,
&ecosia,
};
@@ -197,7 +198,7 @@ const PrepopulatedEngine* const engines_CL[] = {
&googleen, &google,
&bing,
&yahoo_cl,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -216,7 +217,7 @@ const PrepopulatedEngine* const engines_CO[] = {
&bing,
&yahoo_co,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Costa Rica
@@ -224,7 +225,7 @@ const PrepopulatedEngine* const engines_CR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -234,7 +235,7 @@ const PrepopulatedEngine* const engines_CZ[] = {
&seznam_cz,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Germany
@@ -242,7 +243,7 @@ const PrepopulatedEngine* const engines_DE[] = {
&googleen, &google,
&bing,
&yahoo_de,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -251,7 +252,7 @@ const PrepopulatedEngine* const engines_DK[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -260,7 +261,7 @@ const PrepopulatedEngine* const engines_DO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -270,7 +271,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
&yahoo,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Ecuador
@@ -279,7 +280,7 @@ const PrepopulatedEngine* const engines_EC[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Estonia
@@ -297,7 +298,7 @@ const PrepopulatedEngine* const engines_EG[] = {
&yahoo,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Spain
@@ -305,7 +306,7 @@ const PrepopulatedEngine* const engines_ES[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -314,7 +315,7 @@ const PrepopulatedEngine* const engines_FI[] = {
&googleen, &google,
&bing,
&yahoo_fi,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -323,7 +324,7 @@ const PrepopulatedEngine* const engines_FO[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -341,7 +342,7 @@ const PrepopulatedEngine* const engines_GB[] = {
&googleen, &google,
&bing,
&yahoo_uk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -350,7 +351,7 @@ const PrepopulatedEngine* const engines_GR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -360,7 +361,7 @@ const PrepopulatedEngine* const engines_GT[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Hong Kong
@@ -378,7 +379,7 @@ const PrepopulatedEngine* const engines_HN[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Croatia
@@ -386,7 +387,7 @@ const PrepopulatedEngine* const engines_HR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -395,7 +396,7 @@ const PrepopulatedEngine* const engines_HU[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -404,7 +405,7 @@ const PrepopulatedEngine* const engines_ID[] = {
&googleen, &google,
&yahoo_id,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -413,7 +414,7 @@ const PrepopulatedEngine* const engines_IE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -423,7 +424,7 @@ const PrepopulatedEngine* const engines_IL[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// India
@@ -431,7 +432,7 @@ const PrepopulatedEngine* const engines_IN[] = {
&googleen, &google,
&yahoo_in,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -441,7 +442,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
&yahoo,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Iran
@@ -457,7 +458,7 @@ const PrepopulatedEngine* const engines_IR[] = {
const PrepopulatedEngine* const engines_IS[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -467,7 +468,7 @@ const PrepopulatedEngine* const engines_IT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -476,7 +477,7 @@ const PrepopulatedEngine* const engines_JM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -485,7 +486,7 @@ const PrepopulatedEngine* const engines_JO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -495,7 +496,7 @@ const PrepopulatedEngine* const engines_JP[] = {
&yahoo_jp,
&bing,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Kenya
@@ -503,7 +504,7 @@ const PrepopulatedEngine* const engines_KE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -521,7 +522,7 @@ const PrepopulatedEngine* const engines_KW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -539,7 +540,7 @@ const PrepopulatedEngine* const engines_LB[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -547,7 +548,7 @@ const PrepopulatedEngine* const engines_LB[] = {
const PrepopulatedEngine* const engines_LI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -558,14 +559,14 @@ const PrepopulatedEngine* const engines_LT[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -576,7 +577,7 @@ const PrepopulatedEngine* const engines_LV[] = {
&yandex_ru,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Libya
@@ -585,7 +586,7 @@ const PrepopulatedEngine* const engines_LY[] = {
&yahoo,
&bing,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Morocco
@@ -593,7 +594,7 @@ const PrepopulatedEngine* const engines_MA[] = {
&googleen, &google,
&yahoo,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -601,7 +602,7 @@ const PrepopulatedEngine* const engines_MA[] = {
const PrepopulatedEngine* const engines_MC[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&qwant,
};
@@ -611,7 +612,7 @@ const PrepopulatedEngine* const engines_MD[] = {
&googleen, &google,
&yandex_ru,
&mail_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&bing,
};
@@ -621,7 +622,7 @@ const PrepopulatedEngine* const engines_ME[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Macedonia
@@ -629,7 +630,7 @@ const PrepopulatedEngine* const engines_MK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -639,7 +640,7 @@ const PrepopulatedEngine* const engines_MX[] = {
&bing,
&yahoo_mx,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Malaysia
@@ -647,7 +648,7 @@ const PrepopulatedEngine* const engines_MY[] = {
&googleen, &google,
&bing,
&yahoo_my,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -656,8 +657,9 @@ const PrepopulatedEngine* const engines_NI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
+ &duckduckgo_light,
};
// Netherlands
@@ -665,7 +667,7 @@ const PrepopulatedEngine* const engines_NL[] = {
&googleen, &google,
&bing,
&yahoo_nl,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -674,7 +676,7 @@ const PrepopulatedEngine* const engines_NO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -682,7 +684,7 @@ const PrepopulatedEngine* const engines_NO[] = {
const PrepopulatedEngine* const engines_NZ[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_nz,
&ecosia,
};
@@ -692,7 +694,7 @@ const PrepopulatedEngine* const engines_OM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -701,7 +703,7 @@ const PrepopulatedEngine* const engines_PA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -711,7 +713,7 @@ const PrepopulatedEngine* const engines_PE[] = {
&bing,
&yahoo_pe,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Philippines
@@ -720,7 +722,7 @@ const PrepopulatedEngine* const engines_PH[] = {
&yahoo_ph,
&bing,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Pakistan
@@ -728,7 +730,7 @@ const PrepopulatedEngine* const engines_PK[] = {
&googleen, &google,
&yahoo,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -737,7 +739,7 @@ const PrepopulatedEngine* const engines_PL[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -746,7 +748,7 @@ const PrepopulatedEngine* const engines_PR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -755,7 +757,7 @@ const PrepopulatedEngine* const engines_PT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -764,7 +766,7 @@ const PrepopulatedEngine* const engines_PY[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -773,7 +775,7 @@ const PrepopulatedEngine* const engines_QA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -782,7 +784,7 @@ const PrepopulatedEngine* const engines_RO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -791,7 +793,7 @@ const PrepopulatedEngine* const engines_RS[] = {
&googleen, &google,
&yahoo,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -809,7 +811,7 @@ const PrepopulatedEngine* const engines_RW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&mail_ru,
};
@@ -819,7 +821,7 @@ const PrepopulatedEngine* const engines_SA[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Sweden
@@ -827,7 +829,7 @@ const PrepopulatedEngine* const engines_SE[] = {
&googleen, &google,
&bing,
&yahoo_se,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -844,7 +846,7 @@ const PrepopulatedEngine* const engines_SG[] = {
const PrepopulatedEngine* const engines_SI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&yandex_ru,
};
@@ -854,7 +856,7 @@ const PrepopulatedEngine* const engines_SK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&seznam_cz,
};
@@ -863,7 +865,7 @@ const PrepopulatedEngine* const engines_SV[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -873,7 +875,7 @@ const PrepopulatedEngine* const engines_SY[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Thailand
@@ -881,7 +883,7 @@ const PrepopulatedEngine* const engines_TH[] = {
&googleen, &google,
&yahoo_th,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -891,7 +893,7 @@ const PrepopulatedEngine* const engines_TN[] = {
&yahoo,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Turkey
@@ -900,7 +902,7 @@ const PrepopulatedEngine* const engines_TR[] = {
&yandex_tr,
&yahoo_tr,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Trinidad and Tobago
@@ -908,7 +910,7 @@ const PrepopulatedEngine* const engines_TT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -926,7 +928,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -944,7 +946,7 @@ const PrepopulatedEngine* const engines_US[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -953,7 +955,7 @@ const PrepopulatedEngine* const engines_UY[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -962,7 +964,7 @@ const PrepopulatedEngine* const engines_VE[] = {
&googleen, &google,
&yahoo_ve,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -981,7 +983,7 @@ const PrepopulatedEngine* const engines_YE[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// South Africa
@@ -989,7 +991,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -999,7 +1001,7 @@ const PrepopulatedEngine* const engines_ZW[] = {
&bing,
&yahoo,
&ask,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// ----------------------------------------------------------------------------
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,101 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 9 May 2020 08:33:15 +0200
Subject: Add a flag to allow screenshots in Incognito mode
See also:
* https://github.com/bromite/bromite/issues/551
* https://bugs.chromium.org/p/chromium/issues/detail?id=920762
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
.../flags/android/java_templates/ChromeSwitches.java.tmpl | 4 ----
chrome/common/chrome_switches.cc | 3 +++
chrome/common/chrome_switches.h | 1 +
6 files changed, 18 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
@@ -4499,6 +4499,12 @@ const FeatureEntry kFeatureEntries[] = {
kOsAll,
FEATURE_VALUE_TYPE(features::kEnableAmbientAuthenticationInIncognito)},
+#if defined(OS_ANDROID)
+ {switches::kEnableIncognitoSnapshotsInAndroidRecents, flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsName,
+ flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsDescription, kOsAndroid,
+ SINGLE_VALUE_TYPE(switches::kEnableIncognitoSnapshotsInAndroidRecents)},
+#endif
+
{"enable-ambient-authentication-in-guest-session",
flag_descriptions::kEnableAmbientAuthenticationInGuestSessionName,
flag_descriptions::kEnableAmbientAuthenticationInGuestSessionDescription,
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
@@ -515,6 +515,11 @@ const char kEnableAmbientAuthenticationInIncognitoDescription[] =
"Enables ambient authentication in Incognito mode. This flag may be "
"overriden by policies.";
+const char kEnableIncognitoSnapshotsInAndroidRecentsName[] =
+ "Enable Incognito snapshots in Android Recents";
+const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[] =
+ "Enable the secure flag for Incognito tabs which prevent taking screenshots and seeing snapshots in Android Recents.";
+
const char kEnableAmbientAuthenticationInGuestSessionName[] =
"Enable Ambient Authentication in Guest session.";
const char kEnableAmbientAuthenticationInGuestSessionDescription[] =
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
@@ -316,6 +316,9 @@ extern const char kEnableAccessibilityObjectModelDescription[];
extern const char kEnableAmbientAuthenticationInIncognitoName[];
extern const char kEnableAmbientAuthenticationInIncognitoDescription[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsName[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[];
+
extern const char kEnableAmbientAuthenticationInGuestSessionName[];
extern const char kEnableAmbientAuthenticationInGuestSessionDescription[];
diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
--- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
+++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
@@ -144,10 +144,6 @@ public abstract class ChromeSwitches {{
/** Switch for enabling the Chrome Survey. */
public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey";
- /** Switch to enable incognito tabs to be seen in Android Recents. */
- public static final String ENABLE_INCOGNITO_SNAPSHOTS_IN_ANDROID_RECENTS =
- "enable-incognito-snapshots-in-android-recents";
-
/** Open all custom tabs in a new task. Used only for experimental purposes. */
public static final String OPEN_CUSTOM_TABS_IN_NEW_TASK = "open-custom-tabs-in-new-task";
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -339,6 +339,9 @@ const char kHomePage[] = "homepage";
// Causes the browser to launch directly in incognito mode.
const char kIncognito[] = "incognito";
+// Allows incognito tabs to be seen in Android Recents and thus user screenshots.
+const char kEnableIncognitoSnapshotsInAndroidRecents[] = "enable-incognito-snapshots-in-android-recents";
+
// Installs an autogenerated theme based on the given RGB value.
// The format is "r,g,b", where r, g, b are a numeric values from 0 to 255.
const char kInstallAutogeneratedTheme[] = "install-autogenerated-theme";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -107,6 +107,7 @@ extern const char kForceFirstRun[];
extern const char kForceStackedTabStripLayout[];
extern const char kHomePage[];
extern const char kIncognito[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecents[];
extern const char kInstallAutogeneratedTheme[];
extern const char kInstallChromeApp[];
extern const char kInstallSupervisedUserWhitelists[];
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,421 +0,0 @@
From: Ryan Archer <ryan.bradley.archer@gmail.com>
Date: Wed, 2 Aug 2017 01:41:28 -0400
Subject: Add an always-incognito mode
More specifically, add a preference that causes all new tabs and all
clicked links to launch as incognito.
Make sure initial incognito status is correctly recognized.
Enable incognito custom tabs and fix crashes for incognito/custom tab intents (credits to @uazo)
---
chrome/android/chrome_java_sources.gni | 1 +
.../java/res/xml/privacy_preferences.xml | 5 ++
.../AlwaysIncognitoLinkInterceptor.java | 74 +++++++++++++++++++
.../chrome/browser/ChromeActivity.java | 4 +
.../chrome/browser/ChromeTabbedActivity.java | 6 +-
.../AppMenuPropertiesDelegateImpl.java | 6 ++
.../ChromeContextMenuPopulator.java | 8 +-
.../CustomTabIntentDataProvider.java | 6 ++
.../browser/init/StartupTabPreloader.java | 11 ++-
.../browser/tabmodel/ChromeTabCreator.java | 16 +++-
.../tabmodel/TabModelSelectorBase.java | 8 ++
.../browser/tabmodel/TabPersistentStore.java | 9 +++
.../flags/android/chrome_feature_list.cc | 2 +-
.../strings/android_chrome_strings.grd | 7 ++
14 files changed, 155 insertions(+), 8 deletions(-)
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -3,6 +3,7 @@
# found in the LICENSE file.
chrome_java_sources = [
+ "java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java",
"java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java",
"java/src/org/chromium/chrome/browser/ActivityTabProvider.java",
"java/src/org/chromium/chrome/browser/AfterStartupTaskUtils.java",
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
@@ -20,6 +20,11 @@
android:title="@string/preload_pages_title"
android:summary="@string/preload_pages_summary"
android:persistent="false" />
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
+ android:key="always_incognito"
+ android:title="@string/always_incognito_title"
+ android:summary="@string/always_incognito_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
@@ -0,0 +1,74 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.chromium.chrome.browser;
+
+import android.content.SharedPreferences;
+
+import org.chromium.chrome.browser.tab.EmptyTabObserver;
+import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.tab.TabImpl;
+import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
+import org.chromium.chrome.browser.tab.TabLaunchType;
+import org.chromium.chrome.browser.tabmodel.TabModel;
+import org.chromium.content_public.browser.LoadUrlParams;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+/**
+ * A {@link TabObserver} that implements the always-incognito preference behavior for links. When the preference is set
+ * to true, it intercepts links opened within observed {@link Tab}s and opens them in new incognito <code>Tab</code>s instead.
+ */
+public class AlwaysIncognitoLinkInterceptor extends EmptyTabObserver {
+
+ public static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
+
+ private final SharedPreferences alwaysIncognitoContainer;
+ private final Map<Tab, String> lastUrls;
+ private final Set<Tab> revertingTabs;
+
+ public AlwaysIncognitoLinkInterceptor(final SharedPreferences alwaysIncognitoContainer) {
+
+ assert alwaysIncognitoContainer != null;
+
+ this.alwaysIncognitoContainer = alwaysIncognitoContainer;
+ lastUrls = new HashMap<Tab, String>();
+ revertingTabs = new HashSet<Tab>();
+ }
+
+ @Override
+ public void onDestroyed(final Tab tab)
+ {
+ lastUrls.remove(tab);
+ revertingTabs.remove(tab);
+ }
+
+ @Override
+ public void onUpdateUrl(final Tab tab, final String url) {
+
+ if (tab == null) return;
+ if (url == null) return;
+ if (tab.isIncognito()) return;
+ if (alwaysIncognitoContainer == null) return;
+
+ final String lastUrl = lastUrls.put(tab, url);
+
+ if (!alwaysIncognitoContainer.getBoolean(PREF_ALWAYS_INCOGNITO, false)) return;
+ if (revertingTabs.contains(tab)) {
+ revertingTabs.remove(tab);
+ return;
+ }
+
+ ((ChromeTabbedActivity)tab.getWindowAndroid().getActivity().get()).getTabCreator(true).createNewTab(new LoadUrlParams(url), TabLaunchType.FROM_LINK, tab);
+
+ if ((url.equals(lastUrl)) || (!tab.canGoBack())) {
+ // this call was triggered by a reload
+ } else {
+ revertingTabs.add(tab);
+ tab.goBack();
+ }
+ }
+}
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
@@ -51,6 +51,7 @@ import org.chromium.base.metrics.RecordUserAction;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.supplier.ObservableSupplierImpl;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
import org.chromium.chrome.browser.app.appmenu.AppMenuPropertiesDelegateImpl;
@@ -1509,6 +1510,9 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
throw new IllegalStateException(
"Attempting to access TabCreator before initialization");
}
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return mIncognitoTabCreator;
+ }
return incognito ? mIncognitoTabCreator : mRegularTabCreator;
}
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
@@ -51,6 +51,7 @@ import org.chromium.base.supplier.OneShotCallback;
import org.chromium.base.supplier.Supplier;
import org.chromium.base.task.PostTask;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout;
@@ -1664,8 +1665,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
Bundle savedInstanceState = getSavedInstanceState();
// We determine the model as soon as possible so every systems get initialized coherently.
- boolean startIncognito = savedInstanceState != null
- && savedInstanceState.getBoolean("is_incognito_selected", false);
+ boolean startIncognito = ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)
+ || (savedInstanceState != null
+ && savedInstanceState.getBoolean("is_incognito_selected", false));
int index = savedInstanceState != null ? savedInstanceState.getInt(WINDOW_INDEX, 0) : 0;
NextTabPolicySupplier nextTabPolicySupplier =
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
@@ -296,6 +296,12 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
}
private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
+ if (ContextUtils.getAppSharedPreferences().getBoolean("always_incognito", false)) {
+ final MenuItem newTabOption = menu.findItem(R.id.new_tab_menu_id);
+ if (newTabOption != null)
+ newTabOption.setVisible(false);
+ }
+
// We have to iterate all menu items since same menu item ID may be associated with more
// than one menu items.
boolean isMenuGroupTabsVisible = TabUiFeatureUtilities.isTabGroupsAndroidEnabled()
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
@@ -27,7 +27,9 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.supplier.Supplier;
+import org.chromium.base.ContextUtils;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator;
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item;
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
@@ -399,7 +401,11 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
if (FirstRunStatus.getFirstRunFlowComplete() && !isEmptyUrl(params.getUrl())
&& UrlUtilities.isAcceptedScheme(params.getUrl())) {
if (mMode == ContextMenuMode.NORMAL) {
- linkTab.add(new ChromeContextMenuItem(Item.OPEN_IN_NEW_TAB));
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)
+ && !mDelegate.isIncognito()) {
+ // disallow open in new tab
+ } else
+ linkTab.add(new ChromeContextMenuItem(Item.OPEN_IN_NEW_TAB));
if (!mDelegate.isIncognito() && mDelegate.isIncognitoSupported()) {
linkTab.add(new ChromeContextMenuItem(Item.OPEN_IN_INCOGNITO_TAB));
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -50,6 +50,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.ui.util.ColorUtils;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -409,6 +412,9 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
// TODO(https://crbug.com/1023759): Remove this function and enable
// incognito CCT request for all apps.
private boolean isValidIncognitoIntent(Intent intent) {
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ return true;
+ }
if (!isIncognitoRequested(intent)) return false;
// Incognito requests for payments flow are supported without
// INCOGNITO_CCT flag as an exceptional case that can use Chrome
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
@@ -36,6 +36,9 @@ import org.chromium.ui.base.PageTransition;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.url.GURL;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
/**
* This class attempts to preload the tab if the url is known from the intent when the profile
* is created. This is done to improve startup latency.
@@ -187,9 +190,11 @@ public class StartupTabPreloader implements ProfileManager.Observer, Destroyable
Intent intent = mIntentSupplier.get();
GURL url = UrlFormatter.fixupUrl(getUrlFromIntent(intent));
+ boolean isIncognito = ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
+
ChromeTabCreator chromeTabCreator =
- (ChromeTabCreator) mTabCreatorManager.getTabCreator(false);
- WebContents webContents = WebContentsFactory.createWebContents(false, false);
+ (ChromeTabCreator) mTabCreatorManager.getTabCreator(isIncognito);
+ WebContents webContents = WebContentsFactory.createWebContents(isIncognito, false);
mLoadUrlParams = new LoadUrlParams(url.getValidSpecOrEmpty());
String referrer = IntentHandler.getReferrerUrlIncludingExtraHeaders(intent);
@@ -203,7 +208,7 @@ public class StartupTabPreloader implements ProfileManager.Observer, Destroyable
// Create a detached tab, but don't add it to the tab model yet. We'll do that
// later if the loadUrlParams etc... match.
mTab = TabBuilder.createLiveTab(false)
- .setIncognito(false)
+ .setIncognito(isIncognito)
.setLaunchType(TabLaunchType.FROM_EXTERNAL_APP)
.setWindow(mWindowAndroid)
.setWebContents(webContents)
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
@@ -39,6 +39,10 @@ import org.chromium.ui.base.PageTransition;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.url.GURL;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+import org.chromium.chrome.browser.tab.TabObserver;
+
/**
* This class creates various kinds of new tabs and adds them to the right {@link TabModel}.
*/
@@ -59,6 +63,7 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
private final ChromeActivity mActivity;
private final StartupTabPreloader mStartupTabPreloader;
private final boolean mIncognito;
+ private final TabObserver mExtraLogic;
private WindowAndroid mNativeWindow;
private TabModel mTabModel;
@@ -76,6 +81,10 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
mNativeWindow = nativeWindow;
mTabDelegateFactorySupplier = tabDelegateFactory;
mIncognito = incognito;
+ if (!mIncognito)
+ mExtraLogic = new AlwaysIncognitoLinkInterceptor(ContextUtils.getAppSharedPreferences());
+ else
+ mExtraLogic = null;
mOverviewNTPCreator = overviewNTPCreator;
}
@@ -228,6 +237,8 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
if (creationState == TabCreationState.LIVE_IN_FOREGROUND && !openInForeground) {
creationState = TabCreationState.LIVE_IN_BACKGROUND;
}
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
mTabModel.addTab(tab, position, type, creationState);
return tab;
} finally {
@@ -262,6 +273,8 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
@TabCreationState
int creationState = openInForeground ? TabCreationState.LIVE_IN_FOREGROUND
: TabCreationState.LIVE_IN_BACKGROUND;
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
mTabModel.addTab(tab, position, type, creationState);
return true;
}
@@ -305,7 +318,6 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
// TODO(crbug.com/1081924): Clean up the launches from SearchActivity/Chrome.
public Tab launchUrlFromExternalApp(String url, String referer, String headers, String appId,
boolean forceNewTab, Intent intent, long intentTimestamp) {
- assert !mIncognito;
boolean isLaunchedFromChrome = TextUtils.equals(appId, mActivity.getPackageName());
if (forceNewTab && !isLaunchedFromChrome) {
@@ -412,6 +424,8 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
.setTabState(state)
.build();
}
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
if (state.isIncognito() != mIncognito) {
throw new IllegalStateException("Incognito state mismatch. TabState: "
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
@@ -247,7 +247,15 @@ public abstract class TabModelSelectorBase implements TabModelSelector {
public void markTabStateInitialized() {
if (mTabStateInitialized) return;
mTabStateInitialized = true;
+
for (TabModelSelectorObserver listener : mObservers) listener.onTabStateInitialized();
+
+ if (mStartIncognito) {
+ // profile is not set in always-incognito mode in TabModelSelectorProfileSupplier
+ // so force it
+ selectModel(false); // restore model so next call always set incognito mode
+ selectModel(true);
+ }
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
@@ -47,6 +47,8 @@ import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.UiThreadTaskTraits;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -599,6 +601,13 @@ public class TabPersistentStore extends TabPersister {
}
}
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ if (!isIncognito) {
+ Log.w(TAG, "Failed to restore tab: not in incognito mode.");
+ return;
+ }
+ }
+
TabModel model = mTabModelSelector.getModel(isIncognito);
if (model.isIncognito() != isIncognito) {
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
@@ -333,7 +333,7 @@ const base::Feature kCCTExternalLinkHandling{"CCTExternalLinkHandling",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTIncognito{"CCTIncognito",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTPostMessageAPI{"CCTPostMessageAPI",
base::FEATURE_ENABLED_BY_DEFAULT};
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
@@ -773,6 +773,13 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY" desc="A text for the basic tab explaining browsing history.">
Clears history and autocompletions in the address bar.
</message>
+ <!-- always incognito -->
+ <message name="IDS_ALWAYS_INCOGNITO_TITLE" desc="Title for always incognito mode">
+ Open links in incognito tabs always
+ </message>
+ <message name="IDS_ALWAYS_INCOGNITO_SUMMARY" desc="Summary for always incognito mode">
+ Opens links in incognito tabs when you click on new tab or on a link
+ </message>
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SIGNED_IN" desc="A text explaining other forms of activity for signed in users.">
Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <ph name="BEGIN_LINK">&lt;link&gt;</ph>myactivity.google.com<ph name="END_LINK">&lt;/link&gt;</ph>.
</message>
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,116 +0,0 @@
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 +++++
.../chrome/browser/LaunchIntentDispatcher.java | 4 ++++
.../browser/privacy/settings/PrivacySettings.java | 11 +++++++++++
.../ui/android/strings/android_chrome_strings.grd | 7 +++++++
5 files changed, 30 insertions(+)
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
@@ -14,6 +14,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
@@ -29,6 +29,11 @@
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.ChromeBaseCheckBoxPreference
+ 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.ChromeBasePreference
android:key="secure_dns"
android:title="@string/settings_secure_dns_title"
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
@@ -54,6 +54,8 @@ import org.chromium.url.Origin;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
+
/**
* Dispatches incoming intents to the appropriate activity based on the current configuration and
* Intent fired.
@@ -243,6 +245,8 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
*/
public static boolean isCustomTabIntent(Intent intent) {
if (intent == null) return false;
+ if (!ContextUtils.getAppSharedPreferences().getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+ return false;
if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
|| !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
return false;
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
@@ -50,6 +50,8 @@ public class PrivacySettings
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
+
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
PrivacyPreferencesManager privacyPrefManager = PrivacyPreferencesManager.getInstance();
@@ -90,6 +92,10 @@ public class PrivacySettings
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((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_SEARCH_SUGGESTIONS.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
}
@@ -125,6 +131,11 @@ public class PrivacySettings
prefServiceBridge.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
}
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
if (doNotTrackPref != null) {
doNotTrackPref.setSummary(prefServiceBridge.getBoolean(Pref.ENABLE_DO_NOT_TRACK)
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
@@ -3585,6 +3585,13 @@ 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>
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
+ Allow applications to open custom tab intents, similar to webview.
+ </message>
<!-- Autofill Assistant preferences -->
<message name="IDS_PREFS_AUTOFILL_ASSISTANT_TITLE" desc="Title for the Autofill Assistant preferences screen. [CHAR-LIMIT=32]">
--
2.17.1
-80
View File
@@ -1,80 +0,0 @@
From: Serg <serg.zhukovsky@gmail.com>
Date: Tue, 31 Jan 2017 22:12:27 -0500
Subject: Add exit menu item
Corrected Exit functionality
---
chrome/android/java/res/menu/main_menu.xml | 4 ++++
.../src/org/chromium/chrome/browser/ChromeActivity.java | 5 +++++
.../chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
.../browser/ui/android/strings/android_chrome_strings.grd | 3 +++
4 files changed, 17 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
@@ -87,6 +87,8 @@
android:title="@string/menu_help" />
<item android:id="@+id/enter_vr_id"
android:title="@string/enter_vr" />
+ <item android:id="@+id/exit_id"
+ android:title="@string/menu_exit" />
</group>
<!-- Items shown only in the tab switcher -->
@@ -104,6 +106,8 @@
android:title="@string/menu_group_tabs" />
<item android:id="@id/preferences_id"
android:title="@string/menu_settings" />
+ <item android:id="@+id/exit_id"
+ android:title="@string/menu_exit" />
</group>
<!-- Items shown only in the tab switcher when start surface is enabled -->
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
@@ -1896,6 +1896,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
RecordUserAction.record("MobileMenuSettings");
}
+ if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
+ return true;
+ }
+
if (id == R.id.update_menu_id) {
UpdateMenuItemHelper.getInstance().onMenuItemClicked(this);
return true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
@@ -82,7 +82,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
// Kick off a timer to kill the process after a delay, which fires only if the Activities
// take too long to be finished.
- mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
+ if (restart) {
+ mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
+ } else {
+ fireBrowserRestartActivityIntent();
+ }
}
@Override
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -2551,6 +2551,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_SETTINGS" desc="Menu item for opening browser settings. [CHAR-LIMIT=27]">
Settings
</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>
--
2.17.1
@@ -1,157 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 8 Jul 2018 22:42:04 +0200
Subject: Add flag to configure maximum connections per host
With the introduction of this flag it is possible to increase the maximum
allowed connections per host; this can however be detrimental to devices
with limited CPU/memory resources and it is disabled by default.
---
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
@@ -701,6 +701,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
net::kEffectiveConnectionType4G},
};
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
+ {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 ==
@@ -2953,6 +2958,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAndroidPictureInPictureAPIName,
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
{"reengagement-notification",
flag_descriptions::kReengagementNotificationName,
flag_descriptions::kReengagementNotificationDescription, kOsAndroid,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1298,6 +1298,10 @@ const char kMediaHistoryDescription[] =
"Enables Media History which records data around media playbacks on "
"websites.";
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
+const char kMaxConnectionsPerHostDescription[] =
+ "Customize maximum allowed connections per host.";
+
const char kMediaRouterCastAllowAllIPsName[] =
"Connect to Cast devices on all IP addresses";
const char kMediaRouterCastAllowAllIPsDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -770,6 +770,9 @@ extern const char kMarkHttpAsWarningAndDangerousOnFormEdits[];
extern const char kMediaHistoryName[];
extern const char kMediaHistoryDescription[];
+extern const char kMaxConnectionsPerHostName[];
+extern const char kMaxConnectionsPerHostDescription[];
+
extern const char kMediaRouterCastAllowAllIPsName[];
extern const char kMediaRouterCastAllowAllIPsDescription[];
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
--- a/components/network_session_configurator/common/network_features.cc
+++ b/components/network_session_configurator/common/network_features.cc
@@ -8,4 +8,7 @@
namespace features {
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
+ kMaxConnectionsPerHostChoice15[] = "15";
+
} // namespace features
diff --git a/components/network_session_configurator/common/network_features.h b/components/network_session_configurator/common/network_features.h
--- a/components/network_session_configurator/common/network_features.h
+++ b/components/network_session_configurator/common/network_features.h
@@ -10,6 +10,10 @@
namespace features {
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kMaxConnectionsPerHostChoiceDefault[],
+ kMaxConnectionsPerHostChoice6[],
+ kMaxConnectionsPerHostChoice15[];
+
} // namespace features
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
--- a/components/network_session_configurator/common/network_switch_list.h
+++ b/components/network_session_configurator/common/network_switch_list.h
@@ -22,6 +22,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
// Enables the QUIC protocol. This is a temporary testing flag.
NETWORK_SWITCH(kEnableQuic, "enable-quic")
+// Allows specifying a higher number of maximum connections per host
+// (15 instead of 6, mirroring the value Mozilla uses).
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
+
// Ignores certificate-related errors.
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
@@ -72,6 +72,7 @@ executable("make_top_domain_list_variables") {
"//base",
"//base:i18n",
"//third_party/icu",
+ "//components/network_session_configurator/common"
]
if (is_ios) {
libs = [ "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
@@ -20,6 +20,10 @@
#include "net/socket/client_socket_pool.h"
#include "net/socket/connect_job.h"
#include "net/ssl/ssl_config.h"
+#include "components/network_session_configurator/common/network_switches.h"
+
+#include "base/command_line.h"
+#include "base/strings/string_number_conversions.h"
namespace net {
@@ -187,6 +191,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
int ClientSocketPoolManager::max_sockets_per_group(
HttpNetworkSession::SocketPoolType pool_type) {
DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES);
+
+ if (pool_type == HttpNetworkSession::NORMAL_SOCKET_POOL) {
+ int maxConnectionsPerHost = 0;
+ auto value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kMaxConnectionsPerHost);
+ if (!value.empty() && !base::StringToInt(value, &maxConnectionsPerHost)) {
+ LOG(DFATAL) << "--" << switches::kMaxConnectionsPerHost << " only accepts integers as arguments (\"" << value << "\" is invalid)";
+ }
+ if (maxConnectionsPerHost != 0) {
+ return maxConnectionsPerHost;
+ }
+ // fallthrough for default value
+ }
+
return g_max_sockets_per_group[pool_type];
}
--
2.17.1
@@ -1,73 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 25 Oct 2018 23:13:34 +0200
Subject: Add flag to control video playback resume feature
Disable it by default on Android as it is everywhere else
---
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, 13 insertions(+), 5 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
@@ -2146,6 +2146,10 @@ const FeatureEntry kFeatureEntries[] = {
kOsAura,
FEATURE_VALUE_TYPE(features::kOverlayScrollbarFlashWhenMouseEnter)},
#endif // USE_AURA
+ {"resume-background-video",
+ flag_descriptions::kResumeBackgroundVideoName,
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
{"enable-quic", flag_descriptions::kQuicName,
flag_descriptions::kQuicDescription, kOsAll,
ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic, switches::kDisableQuic)},
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
@@ -912,6 +912,11 @@ const char kMemlogStackModeNative[] = "Native";
const char kMemlogStackModeNativeWithThreadNames[] = "Native with thread names";
const char kMemlogStackModePseudo[] = "Trace events";
+const char kResumeBackgroundVideoName[] = "Resume background video.";
+const char kResumeBackgroundVideoDescription[] =
+ "Resume background video playback when tab re-gains focus; additionally, "
+ "it will pause video playback every single time you switch tabs.";
+
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
const char kEnablePixelCanvasRecordingDescription[] =
"Pixel canvas recording allows the compositor to raster contents aligned "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -518,6 +518,9 @@ extern const char kEnablePortalsDescription[];
extern const char kEnablePortalsCrossOriginName[];
extern const char kEnablePortalsCrossOriginDescription[];
+extern const char kResumeBackgroundVideoName[];
+extern const char kResumeBackgroundVideoDescription[];
+
extern const char kEnablePixelCanvasRecordingName[];
extern const char kEnablePixelCanvasRecordingDescription[];
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -232,11 +232,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
// when in background.
const base::Feature kResumeBackgroundVideo {
"resume-background-video",
-#if defined(OS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ base::FEATURE_DISABLED_BY_DEFAULT
};
// When enabled, MediaCapabilities will check with GPU Video Accelerator
--
2.17.1
@@ -1,156 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 18 Nov 2018 13:06:49 +0100
Subject: Add flag to disable IPv6 probes
---
chrome/browser/about_flags.cc | 5 +++++
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, 34 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
@@ -3770,6 +3770,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kDirectManipulationStylus)},
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
+ {"ipv6-probing",
+ flag_descriptions::kIPv6ProbingName,
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
+
#if !defined(OS_ANDROID)
{"ntp-confirm-suggestion-removals",
flag_descriptions::kNtpConfirmSuggestionRemovalsName,
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
@@ -2561,6 +2561,10 @@ const char kContextualSearchRankerQueryDescription[] =
const char kContextualSearchSecondTapName[] =
"Contextual Search second tap triggering";
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
+const char kIPv6ProbingDescription[] =
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
+
const char kContextualSearchSecondTapDescription[] =
"Enables triggering on a second tap gesture even when Ranker would "
"normally suppress that tap.";
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
@@ -584,6 +584,9 @@ extern const char kEnableWasmThreadsName[];
extern const char kEnableWasmThreadsDescription[];
extern const char kEnableWasmTieringName[];
+extern const char kIPv6ProbingName[];
+extern const char kIPv6ProbingDescription[];
+
extern const char kEnableWasmTieringDescription[];
extern const char kEvDetailsInPageInfoName[];
diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
--- a/components/subresource_filter/tools/BUILD.gn
+++ b/components/subresource_filter/tools/BUILD.gn
@@ -50,6 +50,8 @@ if (!is_ios) {
deps = [
":tools_lib",
"//base",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp"
]
}
@@ -61,6 +63,8 @@ if (!is_ios) {
":tools_lib",
"../core/common",
"//base",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp",
]
}
@@ -70,6 +74,8 @@ if (!is_ios) {
"ruleset_converter:support",
"//base",
"//third_party/protobuf:protobuf_lite",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp"
]
}
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
@@ -72,7 +72,8 @@ executable("make_top_domain_list_variables") {
"//base",
"//base:i18n",
"//third_party/icu",
- "//components/network_session_configurator/common"
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp",
]
if (is_ios) {
libs = [ "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
@@ -93,6 +93,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"
@@ -3583,8 +3584,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
if (last_ipv6_probe_time_.is_null() ||
(tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
kIPv6ProbePeriodMs) {
- SetLastIPv6ProbeResult(
+
+ if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
+ // pretend IPv6 connectivy probe is successful when probing is disabled
+ SetLastIPv6ProbeResult(true);
+ } else {
+ SetLastIPv6ProbeResult(
IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
+ }
cached = false;
}
net_log.AddEvent(
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -47,6 +47,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kThrottleDelayable{"ThrottleDelayable",
base::FEATURE_ENABLED_BY_DEFAULT};
+// Enable IPv6 ping probes to RIPE DNS.
+const base::Feature kIPv6Probing{"IPv6Probing",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kNetworkService;
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.17.1
@@ -1,53 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 16 Nov 2019 11:18:09 +0100
Subject: Add flag to disable WebGL
---
chrome/browser/about_flags.cc | 3 +++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
3 files changed, 10 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
@@ -1975,6 +1975,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAccelerated2dCanvasName,
flag_descriptions::kAccelerated2dCanvasDescription, kOsAll,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)},
+ {switches::kDisableWebGL, flag_descriptions::kDisableWebGLName,
+ flag_descriptions::kDisableWebGLDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebGL)},
{"composited-layer-borders", flag_descriptions::kCompositedLayerBordersName,
flag_descriptions::kCompositedLayerBordersDescription, kOsAll,
SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)},
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
@@ -484,6 +484,10 @@ const char kDeviceDiscoveryNotificationsName[] =
const char kDeviceDiscoveryNotificationsDescription[] =
"Device discovery notifications on local network.";
+const char kDisableWebGLName[] = "Disable all versions of WebGL";
+
+const char kDisableWebGLDescription[] = "Disable all versions of WebGL";
+
const char kDisableBestEffortTasksName[] = "Skip best effort tasks";
const char kDisableBestEffortTasksDescription[] =
"With this flag on, tasks of the lowest priority will not be executed "
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
@@ -301,6 +301,9 @@ extern const char kDebugShortcutsDescription[];
extern const char kDeviceDiscoveryNotificationsName[];
extern const char kDeviceDiscoveryNotificationsDescription[];
+extern const char kDisableWebGLName[];
+extern const char kDisableWebGLDescription[];
+
extern const char kDisableBestEffortTasksName[];
extern const char kDisableBestEffortTasksDescription[];
--
2.17.1
@@ -1,185 +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/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 ++
.../blink/public/platform/web_runtime_features.h | 2 ++
.../blink/renderer/modules/modules_initializer.cc | 10 +++++++---
.../renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
.../renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
10 files changed, 60 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
@@ -2199,6 +2199,12 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-gpu-rasterization", flag_descriptions::kGpuRasterizationName,
flag_descriptions::kGpuRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)},
+ {"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-oop-rasterization", flag_descriptions::kOopRasterizationName,
flag_descriptions::kOopRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableOopRasterizationChoices)},
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
@@ -705,6 +705,14 @@ const char kWinrtSensorsImplementationDescription[] =
"Enables usage of the Windows.Devices.Sensors WinRT APIs on Windows for "
"sensors";
+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
@@ -422,6 +422,12 @@ extern const char kWinrtGeolocationImplementationDescription[];
extern const char kWinrtSensorsImplementationName[];
extern const char kWinrtSensorsImplementationDescription[];
+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
@@ -92,6 +92,9 @@ void SetRuntimeFeatureDefaultsForPlatform(
command_line.HasSwitch(
blink::switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisableWebGLImageChromium) &&
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
+
!command_line.HasSwitch(switches::kDisableGpu) &&
base::FeatureList::IsEnabled(features::kWebGLImageChromium);
#else
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
@@ -801,6 +801,16 @@ const base::Feature kWebOtpBackend{"kWebOtpBackend",
// TODO(rouslan): Remove this.
const base::Feature kWebPayments{"WebPayments",
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};
+
// Minimal user interface experience for payments on the web.
const base::Feature kWebPaymentsMinimalUI{"WebPaymentsMinimalUI",
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
@@ -175,6 +175,8 @@ CONTENT_EXPORT extern const base::Feature kWebXrHitTest;
CONTENT_EXPORT extern const base::Feature kWebXrIncubations;
CONTENT_EXPORT extern const base::Feature kWebXrPermissionsApi;
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
+
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const base::Feature kAndroidAutofillAccessibility;
CONTENT_EXPORT extern const base::Feature
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
@@ -99,6 +99,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableCSSHexAlphaColor(bool);
BLINK_PLATFORM_EXPORT static void EnableSameSiteByDefaultCookies(bool);
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
BLINK_PLATFORM_EXPORT static void EnableKeyboardFocusableScrollers(bool);
BLINK_PLATFORM_EXPORT static void EnableDatabase(bool);
BLINK_PLATFORM_EXPORT static void EnableDecodeJpeg420ImagesToYUV(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
@@ -224,9 +224,13 @@ void ModulesInitializer::OnClearWindowObjectInMainWorld(
Document& document,
const Settings& settings) const {
LocalDOMWindow& window = *document.domWindow();
- DeviceMotionController::From(window);
- DeviceOrientationController::From(window);
- DeviceOrientationAbsoluteController::From(window);
+ if (RuntimeEnabledFeatures::DeviceMotionEnabled())
+ DeviceMotionController::From(window);
+ if (RuntimeEnabledFeatures::DeviceOrientationEnabled()) {
+ DeviceOrientationController::From(window);
+ DeviceOrientationAbsoluteController::From(window);
+ }
+
NavigatorGamepad::From(*window.navigator());
// TODO(nhiroki): Figure out why ServiceWorkerContainer needs to be eagerly
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
@@ -189,6 +189,14 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
}
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableKeyboardFocusableScrollers(bool enable) {
RuntimeEnabledFeatures::SetKeyboardFocusableScrollersEnabled(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
@@ -1256,6 +1256,14 @@
name: "OffscreenCanvasCommit",
status: "experimental",
},
+ {
+ name: "DeviceMotion",
+ status: "stable",
+ },
+ {
+ name: "DeviceOrientation",
+ status: "stable",
+ },
{
name: "OnDeviceChange",
// Android does not yet support SystemMonitor.
--
2.17.1
@@ -1,250 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Fri, 7 Aug 2020 16:33:47 +0000
Subject: Add history support in incognito mode
---
.../java/res/xml/privacy_preferences.xml | 5 +++++
.../privacy/settings/PrivacySettings.java | 18 ++++++++++++++++++
chrome/browser/history/history_tab_helper.cc | 16 ++++++++++++++++
chrome/browser/history/history_tab_helper.h | 4 ++++
chrome/browser/prefs/browser_prefs.cc | 2 ++
.../android/strings/android_chrome_strings.grd | 6 ++++++
.../translations/android_chrome_strings_it.xtb | 2 ++
chrome/common/pref_names.cc | 5 +++++
chrome/common/pref_names.h | 4 ++++
9 files changed, 62 insertions(+)
mode change 100644 => 100755 chrome/android/java/res/xml/privacy_preferences.xml
mode change 100644 => 100755 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
mode change 100644 => 100755 chrome/browser/history/history_tab_helper.cc
mode change 100644 => 100755 chrome/browser/history/history_tab_helper.h
mode change 100644 => 100755 chrome/browser/prefs/browser_prefs.cc
mode change 100644 => 100755 chrome/browser/ui/android/strings/android_chrome_strings.grd
mode change 100644 => 100755 chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb
mode change 100644 => 100755 chrome/common/pref_names.cc
mode change 100644 => 100755 chrome/common/pref_names.h
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
old mode 100644
new mode 100755
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -39,6 +39,11 @@
android:title="@string/close_tabs_on_exit_title"
android:summary="@string/close_tabs_on_exit_summary"
android:defaultValue="false" />
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
+ android:key="incognito_history_enabled"
+ android:title="@string/incognito_history_enabled_title"
+ android:summary="@string/incognito_history_enabled_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
old mode 100644
new mode 100755
--- 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
@@ -38,6 +38,8 @@ import org.chromium.ui.text.SpanApplier;
import java.util.List;
+import org.chromium.base.Log;
+
/**
* Fragment to keep track of the all the privacy related preferences.
*/
@@ -54,6 +56,7 @@ public class PrivacySettings
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
+ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled";
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
@@ -84,6 +87,11 @@ public class PrivacySettings
searchSuggestionsPref.setOnPreferenceChangeListener(this);
searchSuggestionsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+ ChromeBaseCheckBoxPreference historyInIncognitoPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_INCOGNITO_TAB_HISTORY_ENABLED);
+ historyInIncognitoPref.setOnPreferenceChangeListener(this);
+ historyInIncognitoPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
updateSummaries();
}
@@ -105,6 +113,9 @@ public class PrivacySettings
SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
sharedPreferencesEditor.apply();
+ } else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
+ PrefServiceBridge.getInstance().setBoolean(
+ Pref.INCOGNITO_TAB_HISTORY_ENABLED, (boolean) newValue);
}
return true;
@@ -179,6 +190,13 @@ public class PrivacySettings
(ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
closeTabsOnExitPref.setOnPreferenceChangeListener(this);
closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
+ CheckBoxPreference historyInIncognitoPref =
+ (CheckBoxPreference) findPreference(PREF_INCOGNITO_TAB_HISTORY_ENABLED);
+ if (historyInIncognitoPref != null) {
+ historyInIncognitoPref.setChecked(
+ prefServiceBridge.getBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED));
+ }
}
private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
old mode 100644
new mode 100755
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -29,6 +29,9 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/background_tab_manager.h"
+#include "chrome/common/pref_names.h"
+#include "components/prefs/pref_registry_simple.h"
+#include "components/prefs/pref_service.h"
#else
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -242,6 +245,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) {
history::HistoryService* HistoryTabHelper::GetHistoryService() {
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
+
+#if defined(OS_ANDROID)
+ if(profile->GetOriginalProfile()->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled)) {
+ return HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS);
+ }
+#endif
+
if (profile->IsOffTheRecord())
return NULL;
@@ -249,6 +259,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() {
profile, ServiceAccessType::IMPLICIT_ACCESS);
}
+// static
+void HistoryTabHelper::RegisterProfilePrefs(PrefRegistrySimple* registry) {
+ registry->RegisterBooleanPref(prefs::kIncognitoTabHistoryEnabled,
+ /*default_value=*/false);
+}
+
void HistoryTabHelper::WebContentsDestroyed() {
// We update the history for this URL.
WebContents* tab = web_contents();
diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h
old mode 100644
new mode 100755
--- a/chrome/browser/history/history_tab_helper.h
+++ b/chrome/browser/history/history_tab_helper.h
@@ -10,6 +10,8 @@
#include "base/time/time.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
+#include "components/prefs/pref_registry_simple.h"
+#include "components/prefs/pref_service.h"
namespace history {
struct HistoryAddPageArgs;
@@ -34,6 +36,8 @@ class HistoryTabHelper : public content::WebContentsObserver,
int nav_entry_id,
content::NavigationHandle* navigation_handle);
+ static void RegisterProfilePrefs(PrefRegistrySimple* registry);
+
private:
explicit HistoryTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<HistoryTabHelper>;
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
old mode 100644
new mode 100755
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -233,6 +233,7 @@
#include "components/ntp_tiles/popular_sites_impl.h"
#include "components/permissions/contexts/geolocation_permission_context_android.h"
#include "components/query_tiles/tile_service_prefs.h"
+#include "chrome/browser/history/history_tab_helper.h"
#if BUILDFLAG(ENABLE_FEED_IN_CHROME)
#include "components/feed/core/common/pref_names.h"
#endif // BUILDFLAG(ENABLE_FEED_IN_CHROME)
@@ -999,6 +1000,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry);
variations::VariationsService::RegisterProfilePrefs(registry);
feed::prefs::RegisterFeedSharedProfilePrefs(registry);
+ HistoryTabHelper::RegisterProfilePrefs(registry);
#if BUILDFLAG(ENABLE_FEED_IN_CHROME)
feed::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(ENABLE_FEED_IN_CHROME)
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
old mode 100644
new mode 100755
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -794,6 +794,12 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_ALWAYS_INCOGNITO_SUMMARY" desc="Summary for always incognito mode">
Opens links in incognito tabs when you click on new tab or on a link
</message>
+ <message name="IDS_INCOGNITO_HISTORY_ENABLED_TITLE" desc="Title for always enable history in incognito mode">
+ Enable history in incognito tabs
+ </message>
+ <message name="IDS_INCOGNITO_HISTORY_ENABLED_SUMMARY" desc="Summary for always enable history in incognito mode">
+ Record history even in incognito mode
+ </message>
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SIGNED_IN" desc="A text explaining other forms of activity for signed in users.">
Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <ph name="BEGIN_LINK">&lt;link&gt;</ph>myactivity.google.com<ph name="END_LINK">&lt;/link&gt;</ph>.
</message>
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb
old mode 100644
new mode 100755
--- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb
+++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb
@@ -1062,4 +1062,6 @@ Ad esempio, alcuni siti web potrebbero rispondere alla richiesta mostrando annun
<translation id="666268767214822976">Utilizza un servizio di previsione per visualizzare query correlate e siti web popolari durante la digitazione nella barra degli indirizzi</translation>
<translation id="8283853025636624853">Sincronizzazione con <ph name="SYNC_ACCOUNT_USER_NAME" /></translation>
<translation id="8981454092730389528">Gestione attività di Google</translation>
+<translation id="7889537574758531583">Abilita la cronologia nelle sessioni in incognito</translation>
+<translation id="5713583121562162330">Abilita la registrazione della navigazione nella cronologia anche per le sessioni in incognito</translation>
</translationbundle>
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
old mode 100644
new mode 100755
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -3038,4 +3038,9 @@ const char kMediaFeedsSafeSearchEnabled[] = "media_feeds_safe_search_enabled";
// TODO(enne): Remove this once AppCache has been removed.
const char kAppCacheForceEnabled[] = "app_cache_force_enabled";
+#if defined(OS_ANDROID)
+const char kIncognitoTabHistoryEnabled[] =
+ "incognito_tab_history_enabled";
+#endif
+
} // namespace prefs
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
old mode 100644
new mode 100755
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -1074,6 +1074,10 @@ extern const char kMediaFeedsSafeSearchEnabled[];
extern const char kAppCacheForceEnabled[];
+#if defined(OS_ANDROID)
+extern const char kIncognitoTabHistoryEnabled[];
+#endif
+
} // namespace prefs
#endif // CHROME_COMMON_PREF_NAMES_H_
--
2.17.1
@@ -1,121 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 13 Jul 2020 00:37:06 +0200
Subject: Add menu item to view source
---
chrome/android/java/res/menu/custom_tabs_menu.xml | 3 +++
chrome/android/java/res/menu/main_menu.xml | 2 ++
.../chromium/chrome/browser/ChromeActivity.java | 2 ++
.../chrome/browser/ChromeTabbedActivity.java | 2 ++
.../app/appmenu/AppMenuPropertiesDelegateImpl.java | 14 ++++++++++++++
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
.../ui/android/strings/android_chrome_strings.grd | 3 +++
7 files changed, 27 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
@@ -66,6 +66,8 @@
android:title="@string/menu_find_in_page" />
<item android:id="@+id/add_to_homescreen_id"
android:title="@string/menu_add_to_homescreen" />
+ <item android:id="@+id/view_source_id"
+ android:title="@string/view_source" />
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk" />
<item android:id="@+id/request_desktop_site_row_menu_id"
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
@@ -1984,6 +1984,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
} catch (ActivityNotFoundException e) {
Toast.makeText(context, R.string.open_webapk_failed, Toast.LENGTH_SHORT).show();
}
+ } else if (id == R.id.view_source_id) {
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrlString()));
} else if (id == R.id.request_desktop_site_id || id == R.id.request_desktop_site_check_id) {
final boolean reloadOnChange = !currentTab.isNativePage();
final boolean usingDesktopUserAgent =
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
@@ -1866,6 +1866,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.getUrlString()));
} 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/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
@@ -287,6 +287,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
isChromeScheme, isFileScheme, isContentScheme, isIncognito, url));
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
+ updateViewSourceMenuItem(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(shouldShowReaderModePrefs(currentTab));
@@ -622,6 +623,19 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
}
}
+ /**
+ * 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.getUrlString();
+ 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);
+ 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
@@ -307,6 +307,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_SERVICES_CATEGORY_TITLE" desc="Title for the group of preferences that control non-personalized Google services. This group contains preferences for data that is not tied to user's Google Account.">
Other Google services
</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>
<message name="IDS_PREFS_GOOGLE_SERVICES" desc="Title for the group of preferences that control non-personalized Google services. This group contains preferences for data that is not tied to user's Google Account. [CHAR-LIMIT=40]">
Google services
</message>
--
2.17.1
@@ -1,533 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 5 Dec 2019 22:41:25 +0100
Subject: Add option to configure the ad blocker filters URL
---
chrome/android/chrome_java_resources.gni | 2 +
chrome/android/chrome_java_sources.gni | 2 +
.../java/res/layout/adblock_editor.xml | 67 ++++++++++++++
chrome/android/java/res/values/values.xml | 2 +
.../java/res/xml/adblock_preferences.xml | 25 +++++
.../android/java/res/xml/main_preferences.xml | 5 +
.../browser/settings/AdBlockEditor.java | 92 +++++++++++++++++++
.../browser/settings/AdBlockPreferences.java | 61 ++++++++++++
chrome/app/generated_resources.grd | 10 ++
chrome/browser/browser_process_impl.cc | 3 +-
.../flags/android/cached_feature_flags.cc | 8 ++
.../browser/flags/CachedFeatureFlags.java | 10 ++
.../net/system_network_context_manager.cc | 4 +
.../strings/android_chrome_strings.grd | 14 +++
chrome/common/pref_names.cc | 3 +
chrome/common/pref_names.h | 1 +
.../adblock_updater_service.cc | 6 +-
.../adblock_updater_service.h | 3 +-
18 files changed, 313 insertions(+), 5 deletions(-)
create mode 100644 chrome/android/java/res/layout/adblock_editor.xml
create mode 100644 chrome/android/java/res/xml/adblock_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -815,6 +815,7 @@ chrome_java_resources = [
"java/res/layout/account_picker_new_account_row_legacy.xml",
"java/res/layout/account_picker_row.xml",
"java/res/layout/account_picker_row_legacy.xml",
+ "java/res/layout/adblock_editor.xml",
"java/res/layout/add_languages_main.xml",
"java/res/layout/add_to_homescreen_dialog.xml",
"java/res/layout/auto_sign_in_first_run_dialog.xml",
@@ -1102,6 +1103,7 @@ chrome_java_resources = [
"java/res/xml/about_chrome_preferences.xml",
"java/res/xml/accessibility_preferences.xml",
"java/res/xml/account_management_preferences.xml",
+ "java/res/xml/adblock_preferences.xml",
"java/res/xml/autofill_server_profile_preferences.xml",
"java/res/xml/bookmark_widget_info.xml",
"java/res/xml/clear_browsing_data_preferences_tab.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1318,6 +1318,8 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/photo_picker/DecodeVideoTask.java",
"java/src/org/chromium/chrome/browser/photo_picker/DecoderService.java",
"java/src/org/chromium/chrome/browser/photo_picker/DecoderServiceHost.java",
+ "java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java",
+ "java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java",
"java/src/org/chromium/chrome/browser/photo_picker/FileEnumWorkerTask.java",
"java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerDialog.java",
"java/src/org/chromium/chrome/browser/photo_picker/PhotoPickerToolbar.java",
diff --git a/chrome/android/java/res/layout/adblock_editor.xml b/chrome/android/java/res/layout/adblock_editor.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/layout/adblock_editor.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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. -->
+
+<FrameLayout
+ 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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scroll_view"
+ android:fillViewport="true" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:focusableInTouchMode="true" >
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/adblock_url"
+ android:paddingTop="16dp"
+ android:paddingStart="@dimen/pref_autofill_content_spacing"
+ android:paddingEnd="@dimen/pref_autofill_content_spacing"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+ <!-- TODO(crbug.com/900912): Fix and remove lint ignore -->
+ <EditText
+ tools:ignore="Autofill"
+ android:id="@+id/adblock_url_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textUri"
+ android:singleLine="true"
+ android:hint="@string/options_adblock_edit_label" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <Space style="@style/ButtonBarTopSpacer" />
+ <View style="@style/ButtonBarTopDivider" />
+
+ <LinearLayout style="@style/ButtonBar" >
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/adblock_reset"
+ style="@style/ButtonBarButton"
+ android:text="@string/reset" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/adblock_cancel"
+ style="@style/ButtonBarButton"
+ android:text="@string/cancel" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/adblock_save"
+ style="@style/ButtonBarButton"
+ android:text="@string/save" />
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+
+ <include layout="@layout/settings_action_bar_shadow"/>
+
+</FrameLayout>
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
@@ -66,6 +66,8 @@
<!-- Our manage space activity. Default pre-KitKat to be nothing. -->
<string name="manage_space_activity"></string>
+ <string name="adblock_help_url">https://www.bromite.org/custom-filters</string>
+
<string name="proxy_title">Proxy configuration</string>
<string name="proxy_url">chrome://proxy</string>
diff --git a/chrome/android/java/res/xml/adblock_preferences.xml b/chrome/android/java/res/xml/adblock_preferences.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/xml/adblock_preferences.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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. -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="adblock_switch"
+ android:summaryOn="@string/text_on"
+ android:summaryOff="@string/text_off" />
+
+ <org.chromium.chrome.browser.about_settings.HyperlinkPreference
+ android:key="adblock_help"
+ android:title="@string/adblock_help"
+ app:url="@string/adblock_help_url" />
+
+ <Preference
+ android:key="adblock_edit"
+ android:title="@string/options_adblock_edit_label"
+ android:fragment="org.chromium.chrome.browser.settings.AdBlockEditor" />
+
+</PreferenceScreen>
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
--- a/chrome/android/java/res/xml/main_preferences.xml
+++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -61,6 +61,11 @@
android:key="privacy"
android:order="14"
android:title="@string/prefs_privacy"/>
+ <Preference
+ android:fragment="org.chromium.chrome.browser.settings.AdBlockPreferences"
+ android:key="adblock"
+ android:order="13"
+ android:title="@string/prefs_adblock"/>
<Preference
android:fragment="org.chromium.chrome.browser.accessibility.settings.AccessibilitySettings"
android:key="accessibility"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java
@@ -0,0 +1,92 @@
+// 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.settings;
+
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+
+import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.CachedFeatureFlags;
+import org.chromium.chrome.R;
+import org.chromium.components.url_formatter.UrlFormatter;
+
+/**
+ * Provides the Java-UI for editing AdBlock preferences.
+ */
+public class AdBlockEditor extends Fragment implements TextWatcher {
+ private EditText mAdBlockFiltersUrlEdit;
+ private Button mSaveButton;
+ private Button mResetButton;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getActivity().setTitle(R.string.options_adblock_edit_title);
+
+ View v = inflater.inflate(R.layout.adblock_editor, container, false);
+ View scrollView = v.findViewById(R.id.scroll_view);
+ scrollView.getViewTreeObserver().addOnScrollChangedListener(
+ SettingsUtils.getShowShadowOnScrollListener(v, v.findViewById(R.id.shadow)));
+ mAdBlockFiltersUrlEdit = (EditText) v.findViewById(R.id.adblock_url_edit);
+ mAdBlockFiltersUrlEdit.setText(CachedFeatureFlags.getAdBlockFiltersURL());
+ mAdBlockFiltersUrlEdit.addTextChangedListener(this);
+ mAdBlockFiltersUrlEdit.requestFocus();
+
+ initializeSaveCancelResetButtons(v);
+ return v;
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ mSaveButton.setEnabled(s.length() != 0);
+ mResetButton.setEnabled(true);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+
+ private void initializeSaveCancelResetButtons(View v) {
+ mResetButton = (Button) v.findViewById(R.id.adblock_reset);
+ mResetButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mAdBlockFiltersUrlEdit.setText(CachedFeatureFlags.getAdBlockFiltersURL());
+ getActivity().finish();
+ }
+ });
+
+ mSaveButton = (Button) v.findViewById(R.id.adblock_save);
+ mSaveButton.setEnabled(false);
+ mSaveButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CachedFeatureFlags.setAdBlockFiltersURL(
+ UrlFormatter.fixupUrl(mAdBlockFiltersUrlEdit.getText().toString()).getSpec());
+ getActivity().finish();
+ }
+ });
+
+ Button button = (Button) v.findViewById(R.id.adblock_cancel);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().finish();
+ }
+ });
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java
@@ -0,0 +1,61 @@
+// 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.settings;
+
+import android.os.Bundle;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
+
+import org.chromium.components.embedder_support.browser_context.BrowserContextHandle;
+import org.chromium.components.browser_ui.site_settings.SiteSettingsPreferenceFragment;
+import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge;
+import org.chromium.components.content_settings.ContentSettingsType;
+import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.CachedFeatureFlags;
+import androidx.annotation.VisibleForTesting;
+import org.chromium.chrome.R;
+
+/**
+ * Fragment that allows the user to configure AdBlock related preferences.
+ */
+public class AdBlockPreferences extends SiteSettingsPreferenceFragment {
+ @VisibleForTesting
+ public static final String PREF_ADBLOCK_SWITCH = "adblock_switch";
+ private static final String PREF_ADBLOCK_EDIT = "adblock_edit";
+
+ private Preference mAdBlockEdit;
+
+ @Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+ getActivity().setTitle(R.string.options_adblock_title);
+ SettingsUtils.addPreferencesFromResource(this, R.xml.adblock_preferences);
+
+ BrowserContextHandle browserContextHandle =
+ getSiteSettingsClient().getBrowserContextHandle();
+
+ ChromeSwitchPreference mAdBlockSwitch =
+ (ChromeSwitchPreference) findPreference(PREF_ADBLOCK_SWITCH);
+ boolean isAdBlockEnabled = !WebsitePreferenceBridge.isCategoryEnabled(browserContextHandle, ContentSettingsType.ADS);
+ mAdBlockSwitch.setChecked(isAdBlockEnabled);
+ mAdBlockSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
+ WebsitePreferenceBridge.setCategoryEnabled(browserContextHandle, ContentSettingsType.ADS, !(boolean) newValue);
+ return true;
+ });
+
+ mAdBlockEdit = findPreference(PREF_ADBLOCK_EDIT);
+ updateCurrentAdBlockUrl();
+ }
+
+ private void updateCurrentAdBlockUrl() {
+ mAdBlockEdit.setSummary(CachedFeatureFlags.getAdBlockFiltersURL());
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ updateCurrentAdBlockUrl();
+ }
+}
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -9883,6 +9883,16 @@ Please help our engineers fix this problem. Tell us what happened right before y
Never show this again.
</message>
+ <!-- Ad Blocking preferences -->
+ <if expr="is_android">
+ <message name="IDS_OPTIONS_ADBLOCK_TITLE" desc="The title of the Ad Blocking option on Android" formatter_data="android_java">
+ Ad Blocking
+ </message>
+ <message name="IDS_OPTIONS_ADBLOCK_SUMMARY" desc="The title of the Ad Blocking summary on Android" formatter_data="android_java">
+ Configure Ad Blocking and filters URL
+ </message>
+ </if>
+
<!-- Ad Blocking UI strings. -->
<message name="IDS_ALWAYS_ALLOW_ADS" desc="Explanation associated with a toggle to allow ads after ads have been blocked on the page. To be used on pages where the ad blocking UI is governed by a persistent permissions-based whitelist.">
Always allow ads on this site
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -1075,7 +1075,8 @@ BrowserProcessImpl::adblock_updater() {
adblock_updater_ = std::make_unique<adblock_updater::AdBlockUpdaterService>(
g_browser_process->system_network_context_manager()->GetSharedURLLoaderFactory(),
std::move(scheduler),
- g_browser_process->subresource_filter_ruleset_service());
+ g_browser_process->subresource_filter_ruleset_service(),
+ local_state()->GetString(prefs::kAdBlockFiltersURL));
return adblock_updater_.get();
}
diff --git a/chrome/browser/flags/android/cached_feature_flags.cc b/chrome/browser/flags/android/cached_feature_flags.cc
--- a/chrome/browser/flags/android/cached_feature_flags.cc
+++ b/chrome/browser/flags/android/cached_feature_flags.cc
@@ -36,6 +36,14 @@ std::string GetReachedCodeProfilerTrialGroup() {
} // namespace android
} // namespace chrome
+static ScopedJavaLocalRef<jstring> JNI_CachedFeatureFlags_GetAdBlockFiltersURL(JNIEnv* env) {
+ return base::android::ConvertUTF8ToJavaString(env, g_browser_process->local_state()->GetString(prefs::kAdBlockFiltersURL));
+}
+
+static void JNI_CachedFeatureFlags_SetAdBlockFiltersURL(JNIEnv* env, const JavaParamRef<jstring>& url) {
+ g_browser_process->local_state()->SetString(prefs::kAdBlockFiltersURL, base::android::ConvertJavaStringToUTF8(env, url));
+}
+
static jboolean JNI_CachedFeatureFlags_IsNetworkServiceWarmUpEnabled(
JNIEnv* env) {
return content::IsOutOfProcessNetworkService() &&
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
@@ -253,6 +253,14 @@ public class CachedFeatureFlags {
ChromeFeatureList.REACHED_CODE_PROFILER, "sampling_interval_us", 0));
}
+ public static void setAdBlockFiltersURL(String url) {
+ CachedFeatureFlagsJni.get().setAdBlockFiltersURL(url);
+ }
+
+ public static String getAdBlockFiltersURL() {
+ return CachedFeatureFlagsJni.get().getAdBlockFiltersURL();
+ }
+
/**
* Caches flags that must take effect on startup but are set via native code.
*/
@@ -405,5 +413,7 @@ public class CachedFeatureFlags {
@NativeMethods
interface Natives {
boolean isNetworkServiceWarmUpEnabled();
+ void setAdBlockFiltersURL(String url);
+ String getAdBlockFiltersURL();
}
}
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
@@ -331,6 +331,8 @@ SystemNetworkContextManager::SystemNetworkContextManager(
SSLConfigServiceManager::CreateDefaultManager(local_state_)),
proxy_config_monitor_(local_state_),
stub_resolver_config_reader_(local_state_) {
+ local_state_->SetDefaultPrefValue(prefs::kAdBlockFiltersURL,
+ base::Value("https://www.bromite.org/filters/filters.dat"));
#if !defined(OS_ANDROID)
// QuicAllowed was not part of Android policy.
const base::Value* value =
@@ -392,6 +394,8 @@ SystemNetworkContextManager::~SystemNetworkContextManager() {
void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) {
StubResolverConfigReader::RegisterPrefs(registry);
+ registry->RegisterStringPref(prefs::kAdBlockFiltersURL, std::string());
+
// Static auth params
registry->RegisterStringPref(prefs::kAuthSchemes,
"basic,digest,ntlm,negotiate");
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
@@ -1958,6 +1958,20 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Work profile
</message>
+ <!-- AdBlock settings -->
+ <message name="IDS_PREFS_ADBLOCK" desc="Title of the AdBlock Settings screen. [CHAR-LIMIT=32]">
+ AdBlock settings
+ </message>
+ <message name="IDS_OPTIONS_ADBLOCK_EDIT_TITLE" desc="The title of the screen that allows users to change the URL that is used to fetch the ad blocker filters.">
+ Edit filters URL
+ </message>
+ <message name="IDS_OPTIONS_ADBLOCK_EDIT_LABEL" desc="The label for the edit text field that allows the user to change the URL that is used to fetch the ad blocker filters.">
+ Filters URL
+ </message>
+ <message name="IDS_ADBLOCK_HELP" desc="The title of the hyperlink that allows users to visit the web page with instructions for custom ad blocker filters.">
+ Visit help page
+ </message>
+
<!-- Fullscreen -->
<message name="IDS_IMMERSIVE_FULLSCREEN_API_NOTIFICATION" desc="Notification message when a site has entered immersive fullscreen and the directions of how to exit.">
Drag from top and touch the back button to exit full screen.
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
@@ -2069,6 +2069,9 @@ const char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled";
// capture devices without prompt.
const char kAudioCaptureAllowedUrls[] = "hardware.audio_capture_allowed_urls";
+// Holds the URL to an indexed subresource filters file.
+const char kAdBlockFiltersURL[] = "adblock.filters_url";
+
// A pref holding the value of the policy used to explicitly allow or deny
// access to video capture devices. When enabled or not set, the user is
// prompted for device access. When disabled, access to video capture devices
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
@@ -30,6 +30,7 @@ extern const char kDownloadRestrictions[];
extern const char kForceEphemeralProfiles[];
extern const char kHomePageIsNewTabPage[];
extern const char kHomePage[];
+extern const char kAdBlockFiltersURL[];
extern const char kImportantSitesDialogHistory[];
extern const char kProfileCreationTime[];
#if defined(OS_WIN)
diff --git a/components/component_updater/adblock_updater_service.cc b/components/component_updater/adblock_updater_service.cc
--- a/components/component_updater/adblock_updater_service.cc
+++ b/components/component_updater/adblock_updater_service.cc
@@ -46,12 +46,12 @@ const int initial_check_delay = 5,
next_check_delay = 60*60*24*7, // 1 week
on_demand_check_delay = 60; // minimum 1 minute between each on-demand check
-AdBlockUpdaterService::AdBlockUpdaterService(scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory, std::unique_ptr<component_updater::UpdateScheduler> scheduler, subresource_filter::RulesetService* ruleset_service)
+AdBlockUpdaterService::AdBlockUpdaterService(scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory, std::unique_ptr<component_updater::UpdateScheduler> scheduler,
+ subresource_filter::RulesetService* ruleset_service, std::string filters_url)
: ruleset_service_(ruleset_service), shared_url_network_factory_(shared_url_network_factory), scheduler_(std::move(scheduler)) {
DCHECK(ruleset_service);
- //TODO: retrieve filters URL from config/prefs
- filters_url_ = "https://www.bromite.org/filters/filters.dat";
+ filters_url_ = filters_url;
}
AdBlockUpdaterService::~AdBlockUpdaterService() {
diff --git a/components/component_updater/adblock_updater_service.h b/components/component_updater/adblock_updater_service.h
--- a/components/component_updater/adblock_updater_service.h
+++ b/components/component_updater/adblock_updater_service.h
@@ -54,7 +54,8 @@ class Observer {
// All methods are safe to call ONLY from the browser's main thread.
class AdBlockUpdaterService {
public:
- AdBlockUpdaterService(scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory, std::unique_ptr<component_updater::UpdateScheduler> scheduler, subresource_filter::RulesetService* ruleset_service);
+ AdBlockUpdaterService(scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory, std::unique_ptr<component_updater::UpdateScheduler> scheduler,
+ subresource_filter::RulesetService* ruleset_service, std::string filters_url);
~AdBlockUpdaterService();
// Adds an observer for this class. An observer should not be added more
--
2.17.1
@@ -1,124 +0,0 @@
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
---
chrome/android/java/res/values/values.xml | 3 +++
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
.../chrome/browser/ChromeTabbedActivity.java | 4 +++-
.../browser/privacy/settings/PrivacySettings.java | 12 ++++++++++++
.../ui/android/strings/android_chrome_strings.grd | 6 ++++++
5 files changed, 29 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
@@ -60,6 +60,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
@@ -25,6 +25,11 @@
android:title="@string/always_incognito_title"
android:summary="@string/always_incognito_summary"
android:defaultValue="false" />
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
+ android:key="close_tabs_on_exit"
+ android:title="@string/close_tabs_on_exit_title"
+ android:summary="@string/close_tabs_on_exit_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -1182,8 +1182,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
boolean hadCipherData =
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
+ String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
boolean noRestoreState =
- CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE);
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE) ||
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
if (noRestoreState) {
// Clear the state files because they are inconsistent and useless from now on.
mTabModelSelectorImpl.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
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.privacy.settings;
+import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
@@ -14,6 +15,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
+import org.chromium.base.ContextUtils;
import org.chromium.base.BuildInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
@@ -41,6 +43,7 @@ import java.util.List;
*/
public class PrivacySettings
extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_NETWORK_PREDICTIONS = "preload_pages";
@@ -98,6 +101,10 @@ public class PrivacySettings
sharedPreferencesEditor.apply();
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
PrefServiceBridge.getInstance().setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
+ } else 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();
}
return true;
@@ -167,6 +174,11 @@ public class PrivacySettings
String.format("%s - %s", getString(R.string.text_on), serverName));
}
}
+
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
}
private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
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
@@ -3334,6 +3334,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>
+ <message name="IDS_CLOSE_TABS_ON_EXIT_TITLE" desc="Text for 'Close tabs on exit' settings-privacy option.">
+ Close all open tabs on exit
+ </message>
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
+ Don't persist tabs between browsing sessions
+ </message>
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
LINK
</message>
--
2.17.1
@@ -1,540 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 23 Nov 2019 10:55:16 +0100
Subject: Add user setting for DNS-over-HTTPS (DoH) custom URL
---
chrome/android/chrome_java_resources.gni | 2 +
chrome/android/chrome_java_sources.gni | 2 +
chrome/android/java/res/layout/doh_editor.xml | 67 ++++++++++++++
chrome/android/java/res/values/values.xml | 2 +
.../android/java/res/xml/doh_preferences.xml | 25 +++++
.../java/res/xml/privacy_preferences.xml | 5 +
.../chrome/browser/settings/DoHEditor.java | 92 +++++++++++++++++++
.../browser/settings/DoHPreferences.java | 54 +++++++++++
chrome/app/generated_resources.grd | 6 ++
.../flags/android/cached_feature_flags.cc | 25 +++++
.../browser/flags/CachedFeatureFlags.java | 24 +++++
.../net/stub_resolver_config_reader.cc | 36 ++------
.../strings/android_chrome_strings.grd | 11 +++
chrome/common/chrome_features.cc | 4 +-
14 files changed, 324 insertions(+), 31 deletions(-)
create mode 100644 chrome/android/java/res/layout/doh_editor.xml
create mode 100644 chrome/android/java/res/xml/doh_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -881,6 +881,7 @@ chrome_java_resources = [
"java/res/layout/date_view.xml",
"java/res/layout/default_search_engine_first_run_fragment.xml",
"java/res/layout/device_item_list.xml",
+ "java/res/layout/doh_editor.xml",
"java/res/layout/distilled_page_font_family_spinner.xml",
"java/res/layout/distilled_page_prefs_view.xml",
"java/res/layout/editable_option_editor_footer.xml",
@@ -1112,6 +1113,7 @@ chrome_java_resources = [
"java/res/xml/data_reduction_preferences.xml",
"java/res/xml/data_reduction_preferences_off_lite_mode.xml",
"java/res/xml/developer_preferences.xml",
+ "java/res/xml/doh_preferences.xml",
"java/res/xml/do_not_track_preferences.xml",
"java/res/xml/google_services_preferences.xml",
"java/res/xml/homepage_preferences.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1373,6 +1373,8 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetAdapter.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetContent.java",
+ "java/src/org/chromium/chrome/browser/settings/DoHEditor.java",
+ "java/src/org/chromium/chrome/browser/settings/DoHPreferences.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/NotificationManager.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/NotificationSharedPrefManager.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfAndroidBridge.java",
diff --git a/chrome/android/java/res/layout/doh_editor.xml b/chrome/android/java/res/layout/doh_editor.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/layout/doh_editor.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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. -->
+
+<FrameLayout
+ 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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scroll_view"
+ android:fillViewport="true" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:focusableInTouchMode="true" >
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/doh_url"
+ android:paddingTop="16dp"
+ android:paddingStart="@dimen/pref_autofill_content_spacing"
+ android:paddingEnd="@dimen/pref_autofill_content_spacing"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+ <!-- TODO(crbug.com/900912): Fix and remove lint ignore -->
+ <EditText
+ tools:ignore="Autofill"
+ android:id="@+id/doh_url_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textUri"
+ android:singleLine="true"
+ android:hint="@string/options_doh_edit_label" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <Space style="@style/ButtonBarTopSpacer" />
+ <View style="@style/ButtonBarTopDivider" />
+
+ <LinearLayout style="@style/ButtonBar" >
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_reset"
+ style="@style/ButtonBarButton"
+ android:text="@string/reset" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_cancel"
+ style="@style/ButtonBarButton"
+ android:text="@string/cancel" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_save"
+ style="@style/ButtonBarButton"
+ android:text="@string/save" />
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+
+ <include layout="@layout/settings_action_bar_shadow"/>
+
+</FrameLayout>
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
@@ -80,6 +80,8 @@
<integer name="download_infobar_bar_fill_in_delay">400</integer>
<integer name="download_infobar_bar_fill_out_delay">200</integer>
+ <string name="doh_help_url">https://www.bromite.org/doh</string>
+
<!-- Bottom navigation bar styling. -->
<bool name="window_light_navigation_bar">true</bool>
diff --git a/chrome/android/java/res/xml/doh_preferences.xml b/chrome/android/java/res/xml/doh_preferences.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/xml/doh_preferences.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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. -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="doh_switch"
+ android:summaryOn="@string/text_on"
+ android:summaryOff="@string/text_off" />
+
+ <org.chromium.chrome.browser.about_settings.HyperlinkPreference
+ android:key="doh_help"
+ android:title="@string/doh_help"
+ app:url="@string/doh_help_url" />
+
+ <Preference
+ android:key="doh_edit"
+ android:title="@string/options_doh_edit_label"
+ android:fragment="org.chromium.chrome.browser.settings.DoHEditor" />
+
+</PreferenceScreen>
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
@@ -19,6 +19,11 @@
android:key="can_make_payment"
android:title="@string/can_make_payment_title"
android:summary="@string/settings_can_make_payment_toggle_label" />
+ <Preference
+ android:fragment="org.chromium.chrome.browser.settings.DoHPreferences"
+ android:key="doh"
+ android:title="@string/options_doh_title"
+ android:summary="@string/options_doh_summary" />
<org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
android:key="preload_pages"
android:title="@string/preload_pages_title"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java
@@ -0,0 +1,92 @@
+// 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.settings;
+
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+
+import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.CachedFeatureFlags;
+import org.chromium.chrome.R;
+import org.chromium.components.url_formatter.UrlFormatter;
+
+/**
+ * Provides the Java-UI for editing the DNS-over-HTTPS (DoH) preference.
+ */
+public class DoHEditor extends Fragment implements TextWatcher {
+ private EditText mDoHUrlEdit;
+ private Button mSaveButton;
+ private Button mResetButton;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getActivity().setTitle(R.string.options_doh_edit_title);
+
+ View v = inflater.inflate(R.layout.doh_editor, container, false);
+ View scrollView = v.findViewById(R.id.scroll_view);
+ scrollView.getViewTreeObserver().addOnScrollChangedListener(
+ SettingsUtils.getShowShadowOnScrollListener(v, v.findViewById(R.id.shadow)));
+ mDoHUrlEdit = (EditText) v.findViewById(R.id.doh_url_edit);
+ mDoHUrlEdit.setText(CachedFeatureFlags.getDoHTemplates());
+ mDoHUrlEdit.addTextChangedListener(this);
+ mDoHUrlEdit.requestFocus();
+
+ initializeSaveCancelResetButtons(v);
+ return v;
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ mSaveButton.setEnabled(s.length() != 0);
+ mResetButton.setEnabled(true);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+
+ private void initializeSaveCancelResetButtons(View v) {
+ mResetButton = (Button) v.findViewById(R.id.doh_reset);
+ mResetButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mDoHUrlEdit.setText(CachedFeatureFlags.getDoHTemplates());
+ getActivity().finish();
+ }
+ });
+
+ mSaveButton = (Button) v.findViewById(R.id.doh_save);
+ mSaveButton.setEnabled(false);
+ mSaveButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CachedFeatureFlags.setDoHTemplates(
+ mDoHUrlEdit.getText().toString());
+ getActivity().finish();
+ }
+ });
+
+ Button button = (Button) v.findViewById(R.id.doh_cancel);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().finish();
+ }
+ });
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java
@@ -0,0 +1,54 @@
+// 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.settings;
+
+import android.os.Bundle;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
+
+import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.CachedFeatureFlags;
+import androidx.annotation.VisibleForTesting;
+import org.chromium.chrome.R;
+
+/**
+ * Fragment that allows the user to configure DoH related preferences.
+ */
+public class DoHPreferences extends PreferenceFragmentCompat {
+ @VisibleForTesting
+ public static final String PREF_DOH_SWITCH = "doh_switch";
+ private static final String PREF_DOH_EDIT = "doh_edit";
+
+ private Preference mDoHEdit;
+
+ @Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+ getActivity().setTitle(R.string.options_doh_title);
+ SettingsUtils.addPreferencesFromResource(this, R.xml.doh_preferences);
+
+ ChromeSwitchPreference mDoHSwitch =
+ (ChromeSwitchPreference) findPreference(PREF_DOH_SWITCH);
+ boolean isDoHEnabled = CachedFeatureFlags.getDoHEnabled();
+ mDoHSwitch.setChecked(isDoHEnabled);
+ mDoHSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
+ CachedFeatureFlags.setDoHEnabled((boolean) newValue);
+ return true;
+ });
+
+ mDoHEdit = findPreference(PREF_DOH_EDIT);
+ updateCurrentDoHUrl();
+ }
+
+ private void updateCurrentDoHUrl() {
+ mDoHEdit.setSummary(CachedFeatureFlags.getDoHTemplates());
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ updateCurrentDoHUrl();
+ }
+}
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6977,6 +6977,12 @@ the Bookmarks menu.">
</if>
<if expr="is_android">
+ <message name="IDS_OPTIONS_DOH_TITLE" desc="The title of the DNS-over-HTTPS option on Android" formatter_data="android_java">
+ Secure DNS
+ </message>
+ <message name="IDS_OPTIONS_DOH_SUMMARY" desc="The title of the DNS-over-HTTPS summary on Android" formatter_data="android_java">
+ Configure DNS-over-HTTPS (DoH) secure DNS
+ </message>
<message name="IDS_OPTIONS_HOMEPAGE_TITLE" desc="The title of Chrome's homepage setting screen on Android. " formatter_data="android_java">
Homepage
</message>
diff --git a/chrome/browser/flags/android/cached_feature_flags.cc b/chrome/browser/flags/android/cached_feature_flags.cc
--- a/chrome/browser/flags/android/cached_feature_flags.cc
+++ b/chrome/browser/flags/android/cached_feature_flags.cc
@@ -11,6 +11,10 @@
#include "content/public/common/content_features.h"
#include "content/public/common/network_service_util.h"
+#include "chrome/browser/browser_process.h"
+#include "components/prefs/pref_service.h"
+#include "chrome/common/pref_names.h"
+
using base::android::ConvertJavaStringToUTF8;
using base::android::ConvertUTF8ToJavaString;
using base::android::JavaParamRef;
@@ -49,3 +53,24 @@ static jboolean JNI_CachedFeatureFlags_IsNetworkServiceWarmUpEnabled(
return content::IsOutOfProcessNetworkService() &&
base::FeatureList::IsEnabled(features::kWarmUpNetworkProcess);
}
+
+static jboolean JNI_CachedFeatureFlags_GetDoHEnabled(JNIEnv* env) {
+ std::string doh_mode = g_browser_process->local_state()->GetString(prefs::kDnsOverHttpsMode);
+ return ((doh_mode == "secure") || (doh_mode == "auto"))
+ && !g_browser_process->local_state()->GetString(prefs::kDnsOverHttpsTemplates).empty();
+}
+
+static void JNI_CachedFeatureFlags_SetDoHEnabled(JNIEnv* env, jboolean enabled) {
+ if (enabled)
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsMode, "secure");
+ else
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsMode, "off");
+}
+
+static ScopedJavaLocalRef<jstring> JNI_CachedFeatureFlags_GetDoHTemplates(JNIEnv* env) {
+ return base::android::ConvertUTF8ToJavaString(env, g_browser_process->local_state()->GetString(prefs::kDnsOverHttpsTemplates));
+}
+
+static void JNI_CachedFeatureFlags_SetDoHTemplates(JNIEnv* env, const JavaParamRef<jstring>& templates) {
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsTemplates, base::android::ConvertJavaStringToUTF8(env, templates));
+}
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
@@ -128,6 +128,26 @@ public class CachedFeatureFlags {
private static Map<String, String> sOverridesTestFeatures;
private static String sReachedCodeProfilerTrialGroup;
+ /**
+ * Records whether custom URL for DoH is enabled with native-side feature utilities.
+ * @param url Whether custom URL is enabled or not.
+ */
+ public static void setDoHEnabled(boolean enabled) {
+ CachedFeatureFlagsJni.get().setDoHEnabled(enabled);
+ }
+
+ public static boolean getDoHEnabled() {
+ return CachedFeatureFlagsJni.get().getDoHEnabled();
+ }
+
+ public static void setDoHTemplates(String t) {
+ CachedFeatureFlagsJni.get().setDoHTemplates(t);
+ }
+
+ public static String getDoHTemplates() {
+ return CachedFeatureFlagsJni.get().getDoHTemplates();
+ }
+
/**
* Checks if a cached feature flag is enabled.
*
@@ -412,6 +432,10 @@ public class CachedFeatureFlags {
@NativeMethods
interface Natives {
+ void setDoHEnabled(boolean enabled);
+ boolean getDoHEnabled();
+ void setDoHTemplates(String templates);
+ String getDoHTemplates();
boolean isNetworkServiceWarmUpEnabled();
void setAdBlockFiltersURL(String url);
String getAdBlockFiltersURL();
diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/net/stub_resolver_config_reader.cc
--- a/chrome/browser/net/stub_resolver_config_reader.cc
+++ b/chrome/browser/net/stub_resolver_config_reader.cc
@@ -141,28 +141,6 @@ StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state,
base::Value(SecureDnsConfig::ModeToString(default_secure_dns_mode)));
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsTemplates,
base::Value(default_doh_templates));
-
- // If the user has explicitly enabled or disabled the DoH experiment in
- // chrome://flags and the DoH UI setting is not visible, store that choice
- // in the user prefs so that it can be persisted after the experiment ends.
- // Also make sure to remove the stored prefs value if the user has changed
- // their chrome://flags selection to the default.
- if (!features::kDnsOverHttpsShowUiParam.Get()) {
- flags_ui::PrefServiceFlagsStorage flags_storage(local_state_);
- std::set<std::string> entries = flags_storage.GetFlags();
- if (entries.count("dns-over-https@1")) {
- // The user has "Enabled" selected.
- local_state_->SetString(prefs::kDnsOverHttpsMode,
- SecureDnsConfig::kModeAutomatic);
- } else if (entries.count("dns-over-https@2")) {
- // The user has "Disabled" selected.
- local_state_->SetString(prefs::kDnsOverHttpsMode,
- SecureDnsConfig::kModeOff);
- } else {
- // The user has "Default" selected.
- local_state_->ClearPref(prefs::kDnsOverHttpsMode);
- }
- }
}
pref_change_registrar_.Add(prefs::kBuiltInDnsClientEnabled, pref_callback);
@@ -346,21 +324,21 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration(
parental_controls_checked_ = true;
}
- if (record_metrics) {
- UMA_HISTOGRAM_ENUMERATION("Net.DNS.DnsConfig.SecureDnsMode", mode_details);
- }
-
std::string doh_templates =
local_state_->GetString(prefs::kDnsOverHttpsTemplates);
- std::string server_method;
+ if (doh_templates.empty()) {
+ secure_dns_mode = net::DnsConfig::SecureDnsMode::OFF;
+ }
+ LOG(INFO) << "DoH templates: '" << doh_templates << "' with mode " << SecureDnsConfig::ModeToString(secure_dns_mode);
std::vector<net::DnsOverHttpsServerConfig> dns_over_https_servers;
base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>>
servers_mojo;
- if (!doh_templates.empty() &&
- secure_dns_mode != net::DnsConfig::SecureDnsMode::OFF) {
+ if (secure_dns_mode != net::DnsConfig::SecureDnsMode::OFF) {
+ std::string server_method;
for (base::StringPiece server_template :
chrome_browser_net::secure_dns::SplitGroup(doh_templates)) {
if (!net::dns_util::IsValidDohTemplate(server_template, &server_method)) {
+ LOG(WARNING) << "DoH templates: skipping invalid: '" << server_template << "'";
continue;
}
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
@@ -590,6 +590,17 @@ CHAR-LIMIT guidelines:
Chrome Passwords
</message>
+ <!-- DoH preferences -->
+ <message name="IDS_OPTIONS_DOH_EDIT_TITLE" desc="The title of the screen that allows users to change the URL that is used for DNS-over-HTTPS queries.">
+ Edit DoH template URLs
+ </message>
+ <message name="IDS_OPTIONS_DOH_EDIT_LABEL" desc="The label for the edit text field that allows the user to change the URL that is used for DNS-over-HTTPS queries.">
+ DoH template URLs
+ </message>
+ <message name="IDS_DOH_HELP" desc="The title of the hyperlink that allows users to visit the wiki page with instructions for DNS-over-HTTPS configuration.">
+ Visit help page
+ </message>
+
<!-- Homepage preferences -->
<message name="IDS_OPTIONS_HOMEPAGE_EDIT_HINT" desc="Hint for the text edit on Homepage Preference setting, guiding user to enter their customized homepage setting">
Enter custom web address
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
@@ -281,12 +281,12 @@ const base::Feature kDesktopPWAsRunOnOsLogin{"DesktopPWAsRunOnOsLogin",
// Enable DNS over HTTPS (DoH).
const base::Feature kDnsOverHttps{"DnsOverHttps",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Set whether fallback to insecure DNS is allowed by default. This setting may
// be overridden for individual transactions.
const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
- "Fallback", true};
+ "Fallback", false};
// Supply one or more space-separated DoH server URI templates to use when this
// feature is enabled. If no templates are specified, then a hardcoded mapping
--
2.17.1
@@ -1,53 +0,0 @@
From: AlexeyBarabash <alexey@brave.com>
Date: Thu, 2 Nov 2017 18:21:16 +0200
Subject: Allow playing audio in background
---
media/blink/webmediaplayer_impl.cc | 12 +++++++++++-
media/blink/webmediaplayer_impl.h | 2 ++
2 files changed, 13 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
@@ -1053,6 +1053,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
return pipeline_metadata_.has_audio;
}
+bool WebMediaPlayerImpl::HasVideoNonEmptySize() const {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+
+ return pipeline_metadata_.has_video && pipeline_metadata_.natural_size.width() != 0 && pipeline_metadata_.natural_size.height() != 0;
+}
+
void WebMediaPlayerImpl::EnabledAudioTracksChanged(
const blink::WebVector<blink::WebMediaPlayer::TrackId>& enabledTrackIds) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -3469,7 +3475,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 (using_media_player_renderer_ &&
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
@@ -153,6 +153,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// True if the loaded media has a playable video/audio track.
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.17.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
@@ -97,7 +97,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
registry->RegisterBooleanPref(kDiceMigrationCompletePref, false);
#endif
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
}
// static
--
2.17.1
@@ -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
@@ -325,14 +325,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;
Provider provider = AppHooks.get().getCustomizationProvider();
--
2.17.1
@@ -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
@@ -150,7 +150,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams(
local_state->GetBoolean(prefs::kNtlmV2Enabled);
#endif // defined(OS_POSIX)
-#if defined(OS_ANDROID)
+#if 0
auth_dynamic_params->android_negotiate_account_type =
local_state->GetString(prefs::kAuthAndroidNegotiateAccountType);
#endif // defined(OS_ANDROID)
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
@@ -533,7 +533,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.17.1
@@ -1,25 +0,0 @@
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.
---
.../org/chromium/chrome/browser/homepage/HomepageManager.java | 3 ---
1 file changed, 3 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
@@ -135,9 +135,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();
- }
return UrlConstants.NTP_NON_NATIVE_URL;
}
--
2.17.1
@@ -1,64 +0,0 @@
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
---
.../blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
.../blink/renderer/modules/webaudio/audio_buffer.idl | 4 ++--
.../blink/renderer/modules/webaudio/audio_context.cc | 4 +++-
3 files changed, 9 insertions(+), 7 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,12 @@
// Channel access
readonly attribute unsigned long numberOfChannels;
- [HighEntropy, Measure, RaisesException] Float32Array getChannelData(
+ /*[HighEntropy, Measure, RaisesException] Float32Array getChannelData(
unsigned long channelIndex);
[HighEntropy, Measure, RaisesException] void copyFromChannel(
Float32Array destination,
unsigned long channelNumber,
- optional unsigned long bufferOffset = 0);
+ 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
@@ -398,7 +398,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;
}
MediaElementAudioSourceNode* AudioContext::createMediaElementSource(
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,66 +0,0 @@
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
---
.../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
@@ -45,46 +45,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
}
bool BatteryManager::charging() {
- return battery_status_.Charging();
+ return true;
}
double BatteryManager::chargingTime() {
- return battery_status_.charging_time();
+ return 0.0;
}
double BatteryManager::dischargingTime() {
- return battery_status_.discharging_time();
+ return std::numeric_limits<double>::infinity();
}
double BatteryManager::level() {
- return battery_status_.Level();
+ return 1.0;
}
void BatteryManager::DidUpdateData() {
DCHECK(battery_property_);
- BatteryStatus old_status = battery_status_;
- battery_status_ = *BatteryDispatcher::Instance().LatestData();
-
if (battery_property_->GetState() == BatteryProperty::kPending) {
battery_property_->Resolve(this);
return;
}
-
- DCHECK(GetExecutionContext());
- if (GetExecutionContext()->IsContextPaused() ||
- GetExecutionContext()->IsContextDestroyed()) {
- return;
- }
-
- if (battery_status_.Charging() != old_status.Charging())
- DispatchEvent(*Event::Create(event_type_names::kChargingchange));
- if (battery_status_.charging_time() != old_status.charging_time())
- DispatchEvent(*Event::Create(event_type_names::kChargingtimechange));
- if (battery_status_.discharging_time() != old_status.discharging_time())
- DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange));
- if (battery_status_.Level() != old_status.Level())
- DispatchEvent(*Event::Create(event_type_names::kLevelchange));
}
void BatteryManager::RegisterWithDispatcher() {
--
2.17.1
@@ -1,287 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 30 Oct 2019 11:50:13 +0100
Subject: Block all connection requests with 'qjz9zk' in the domain name or
with a 'trk:' scheme.
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'
---
.../chrome_autocomplete_scheme_classifier.cc | 1 +
chrome/browser/history/history_utils.cc | 1 +
chrome/browser/ui/singleton_tabs.cc | 3 +-
.../omnibox/browser/autocomplete_input.cc | 7 ++--
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 | 26 +++++++++++++++
net/url_request/trk_protocol_handler.h | 33 +++++++++++++++++++
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, 90 insertions(+), 3 deletions(-)
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
@@ -55,6 +55,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
if (base::IsStringASCII(scheme) &&
(ProfileIOData::IsHandledProtocol(scheme) ||
base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) ||
+ base::LowerCaseEqualsASCII(scheme, url::kTraceScheme) ||
base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) ||
base::LowerCaseEqualsASCII(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
@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
// Skip view-source tabs. This is needed because RewriteURLIfNecessary
// removes the "view-source:" scheme which leads to incorrect matching.
- if (tab_url.SchemeIs(content::kViewSourceScheme))
+ if (tab_url.SchemeIs(content::kViewSourceScheme) ||
+ tab_url.SchemeIs(url::kTraceScheme))
continue;
GURL rewritten_tab_url = tab_url;
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
@@ -488,7 +488,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::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) ||
- base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme)) &&
+ base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme) ||
+ base::LowerCaseEqualsASCII(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.
base::string16 real_url(text.substr(after_scheme_and_colon));
@@ -561,7 +562,9 @@ int AutocompleteInput::NumNonHostComponents(const url::Parsed& parts) {
bool AutocompleteInput::HasHTTPScheme(const base::string16& input) {
std::string utf8_input(base::UTF16ToUTF8(input));
url::Component scheme;
- if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme, &scheme)) {
+ if (url::FindAndCompareScheme(utf8_input, url::kTraceScheme, &scheme)) {
+ return false;
+ } else if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme, &scheme)) {
utf8_input.erase(0, scheme.end() + 1);
}
return url::FindAndCompareScheme(utf8_input, url::kHttpScheme, nullptr);
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
@@ -557,6 +557,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
@@ -634,6 +634,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() {
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
RegisterWebSafeScheme(url::kFtpScheme);
RegisterWebSafeScheme(url::kDataScheme);
+ RegisterWebSafeScheme(url::kTraceScheme);
RegisterWebSafeScheme("feed");
// TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1083,6 +1083,8 @@ component("net") {
"url_request/report_sender.h",
"url_request/static_http_user_agent_settings.cc",
"url_request/static_http_user_agent_settings.h",
+ "url_request/trk_protocol_handler.cc",
+ "url_request/trk_protocol_handler.h",
"url_request/url_fetcher.cc",
"url_request/url_fetcher.h",
"url_request/url_fetcher_core.cc",
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,26 @@
+// 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;
+
+URLRequestJob* TrkProtocolHandler::MaybeCreateJob(
+ URLRequest* request, NetworkDelegate* network_delegate) const {
+ LOG(ERROR) << "Blocked URL in TrkProtocolHandler: " << request->original_url();
+ return new URLRequestErrorJob(
+ request, network_delegate, 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,33 @@
+// 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 "base/macros.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();
+ URLRequestJob* MaybeCreateJob(
+ URLRequest* request,
+ NetworkDelegate* network_delegate) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
+};
+
+} // 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/stl_util.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -40,6 +41,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;
@@ -562,6 +564,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
@@ -43,6 +43,7 @@
#include "net/quic/quic_stream_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_impl.h"
@@ -602,6 +603,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();
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
diff --git a/url/url_constants.cc b/url/url_constants.cc
--- a/url/url_constants.cc
+++ b/url/url_constants.cc
@@ -28,6 +28,7 @@ const char kMailToScheme[] = "mailto";
// See also: https://www.iana.org/assignments/uri-schemes/prov/quic-transport
const char kQuicTransportScheme[] = "quic-transport";
const char kTelScheme[] = "tel";
+const char kTraceScheme[] = "trk";
const char kWsScheme[] = "ws";
const char kWssScheme[] = "wss";
diff --git a/url/url_constants.h b/url/url_constants.h
--- a/url/url_constants.h
+++ b/url/url_constants.h
@@ -32,6 +32,7 @@ COMPONENT_EXPORT(URL) extern const char kJavaScriptScheme[];
COMPONENT_EXPORT(URL) extern const char kMailToScheme[];
COMPONENT_EXPORT(URL) extern const char kQuicTransportScheme[];
COMPONENT_EXPORT(URL) extern const char kTelScheme[];
+COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
COMPONENT_EXPORT(URL) extern const char kWsScheme[];
COMPONENT_EXPORT(URL) extern const char kWssScheme[];
diff --git a/url/url_util.cc b/url/url_util.cc
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -34,6 +34,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
@@ -77,6 +78,7 @@ struct SchemeRegistry {
kAboutScheme,
kJavaScriptScheme,
kDataScheme,
+ kTraceScheme,
};
// Schemes that can be sent CORS requests.
--
2.17.1
@@ -1,253 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 28 Jul 2020 12:28:58 +0200
Subject: Block gateway attacks via websockets
---
services/network/public/cpp/features.cc | 2 +-
.../renderer/core/loader/base_fetch_context.h | 1 +
.../core/loader/frame_fetch_context.cc | 18 ++++++++++
.../core/loader/frame_fetch_context.h | 1 +
.../core/loader/worker_fetch_context.cc | 19 +++++++++++
.../core/loader/worker_fetch_context.h | 1 +
.../background_fetch_manager.cc | 34 +++++++++----------
.../websockets/websocket_channel_impl.cc | 5 +++
.../modules/websockets/websocket_common.cc | 27 +++++++++++++++
.../modules/websockets/websocket_common.h | 4 +++
10 files changed, 93 insertions(+), 19 deletions(-)
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
@@ -123,7 +123,7 @@ const base::Feature kCrossOriginEmbedderPolicy{
//
// https://wicg.github.io/cors-rfc1918/#integration-fetch
const base::Feature kBlockNonSecureExternalRequests{
- "BlockNonSecureExternalRequests", base::FEATURE_DISABLED_BY_DEFAULT};
+ "BlockNonSecureExternalRequests", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or defaults splittup up server (not proxy) entries in the
// HttpAuthCache.
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
@@ -65,6 +65,7 @@ class CORE_EXPORT BaseFetchContext : public FetchContext {
virtual PreviewsResourceLoadingHints* GetPreviewsResourceLoadingHints()
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
@@ -755,6 +755,24 @@ 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).
+ 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 FetchInitiatorInfo& fetch_initiator_info,
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
@@ -150,6 +150,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 base::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"
@@ -95,6 +96,24 @@ 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).
+ 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 FetchInitiatorInfo& fetch_initiator_info,
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
@@ -59,6 +59,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 base::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
@@ -106,24 +106,22 @@ bool ShouldBlockDanglingMarkup(const KURL& request_url) {
bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
const KURL& request_url) {
- if (RuntimeEnabledFeatures::CorsRFC1918Enabled()) {
- network::mojom::IPAddressSpace requestor_space =
- execution_context->GetSecurityContext().AddressSpace();
-
- // 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;
- }
+ network::mojom::IPAddressSpace requestor_space =
+ execution_context->GetSecurityContext().AddressSpace();
+
+ // 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;
}
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
@@ -233,6 +233,11 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) {
return false;
}
+ if (GetBaseFetchContext()->ShouldBlockGateWayAttacks(execution_context_->GetSecurityContext().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
@@ -87,6 +87,15 @@ WebSocketCommon::ConnectResult WebSocketCommon::Connect(
return ConnectResult::kException;
}
+ network::mojom::IPAddressSpace requestor_space =
+ execution_context->GetSecurityContext().AddressSpace();
+ if (ShouldBlockGateWayAttacks(requestor_space, url_)) {
+ state_ = kClosed;
+ exception_state.ThrowSecurityError(
+ "Access to this address is not allowed.");
+ return ConnectResult::kException;
+ }
+
if (!execution_context->GetContentSecurityPolicyForWorld()
->AllowConnectToSource(url_, url_, RedirectStatus::kNoRedirect)) {
state_ = kClosed;
@@ -135,6 +144,24 @@ WebSocketCommon::ConnectResult WebSocketCommon::Connect(
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).
+ 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
@@ -10,6 +10,8 @@
#include <memory>
#include "base/macros.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"
@@ -53,6 +55,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.17.1
File diff suppressed because it is too large Load Diff
@@ -1,49 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 9 May 2020 14:42:37 +0200
Subject: Change default webRTC policy to not use any address
This prevents leakage of the local IP address.
See also: https://github.com/bromite/bromite/issues/553
---
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
.../peerconnection/peer_connection_dependency_factory.cc | 7 ++++---
2 files changed, 6 insertions(+), 5 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
@@ -87,8 +87,8 @@ 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,
blink::kWebRTCIPHandlingDefault);
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
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
@@ -421,12 +421,13 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
port_config.enable_nonproxied_udp = false;
break;
case DEFAULT:
- port_config.enable_multiple_routes = true;
- port_config.enable_nonproxied_udp = true;
+ port_config.enable_multiple_routes = false;
+ port_config.enable_nonproxied_udp = false;
+ port_config.enable_default_local_candidate = false;
break;
}
- VLOG(3) << "WebRTC routing preferences: "
+ LOG(INFO) << "WebRTC routing preferences: "
<< "policy: " << policy
<< ", multiple_routes: " << port_config.enable_multiple_routes
<< ", nonproxied_udp: " << port_config.enable_nonproxied_udp
--
2.17.1
@@ -1,42 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 20 Feb 2020 22:44:06 +0100
Subject: Disable AImageReader for ARM64/P and ARM64/Q
---
gpu/config/gpu_finch_features.cc | 4 ++++
media/base/media_switches.cc | 4 ++++
2 files changed, 8 insertions(+)
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
@@ -15,7 +15,11 @@ namespace features {
#if defined(OS_ANDROID)
// Use android AImageReader when playing videos with MediaPlayer.
const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
+#ifdef ARCH_CPU_ARM64
+ base::FEATURE_DISABLED_BY_DEFAULT};
+#else
base::FEATURE_ENABLED_BY_DEFAULT};
+#endif
// Used only by webview to disable SurfaceControl.
const base::Feature kDisableSurfaceControlForWebview{
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
@@ -544,7 +544,11 @@ const base::Feature kMediaDrmPreprovisioningAtStartup{
// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
+#ifdef ARCH_CPU_ARM64
+ base::FEATURE_DISABLED_BY_DEFAULT};
+#else
base::FEATURE_ENABLED_BY_DEFAULT};
+#endif
// Prevents using SurfaceLayer for videos. This is meant to be used by embedders
// that cannot support SurfaceLayer at the moment.
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 24 Jan 2020 09:46:48 +0100
Subject: Disable DRM media origin IDs preprovisioning
---
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
@@ -533,7 +533,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.17.1
@@ -1,54 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Oct 2019 10:21:19 +0100
Subject: Disable HEAD requests for single-word Omnibar searches
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727
---
.../ui/omnibox/chrome_omnibox_navigation_observer.cc | 8 ++++----
.../ui/omnibox/chrome_omnibox_navigation_observer.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
@@ -86,8 +86,8 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
load_state_(LOAD_NOT_SEEN),
fetch_state_(FETCH_NOT_COMPLETE) {
- if (alternate_nav_match_.destination_url.is_valid())
- CreateLoader(alternate_nav_match_.destination_url);
+// if (alternate_nav_match_.destination_url.is_valid())
+// CreateLoader(alternate_nav_match_.destination_url);
// We need to start by listening to AllSources, since we don't know which tab
// the navigation might occur in.
@@ -287,7 +287,7 @@ void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() {
delete this;
}
-void ChromeOmniboxNavigationObserver::CreateLoader(
+/*void ChromeOmniboxNavigationObserver::CreateLoader(
const GURL& destination_url) {
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("omnibox_navigation_observer", R"(
@@ -328,4 +328,4 @@ void ChromeOmniboxNavigationObserver::CreateLoader(
loader_->SetAllowHttpErrorResults(true);
loader_->SetOnRedirectCallback(base::BindRepeating(
&ChromeOmniboxNavigationObserver::OnURLRedirect, base::Unretained(this)));
-}
+}*/
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
@@ -127,7 +127,7 @@ class ChromeOmniboxNavigationObserver : public OmniboxNavigationObserver,
// Creates a URL loader for |destination_url| and stores it in |loader_|.
// Does not start the loader.
- void CreateLoader(const GURL& destination_url);
+ //void CreateLoader(const GURL& destination_url);
const base::string16 text_;
const AutocompleteMatch match_;
--
2.17.1
@@ -1,47 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 08:15:17 +0200
Subject: Disable NTP remote suggestions by default
---
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
@@ -19,8 +19,8 @@ const char kEnableSnippets[] = "ntp_snippets.enable";
const char kArticlesListVisible[] = "ntp_snippets.list_visible";
void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(kEnableSnippets, true);
- registry->RegisterBooleanPref(kArticlesListVisible, true);
+ registry->RegisterBooleanPref(kEnableSnippets, false);
+ registry->RegisterBooleanPref(kArticlesListVisible, false);
}
} // namespace prefs
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -39,7 +39,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 kRemoteSuggestionsEmulateM58FetchingSchedule{
"RemoteSuggestionsEmulateM58FetchingSchedule",
@@ -69,7 +69,7 @@ const char kNotificationsDailyLimit[] = "daily_limit";
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
const base::Feature kKeepPrefetchedContentSuggestions{
- "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOptionalImagesEnabledFeature{
"NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
--
2.17.1
@@ -1,37 +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
---
.../java/src/org/chromium/chrome/browser/omaha/OmahaBase.java | 2 +-
.../org/chromium/chrome/browser/omaha/VersionNumberGetter.java | 2 +-
2 files changed, 2 insertions(+), 2 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
@@ -157,7 +157,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
@@ -43,7 +43,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() { }
--
2.17.1
@@ -1,34 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 12 Jun 2018 15:09:26 +0200
Subject: Disable all promo dialogs
---
.../chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -307,7 +307,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator implements Native
* displayed.
*/
private boolean triggerPromo(boolean intentWithEffect) {
- try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
+ /*try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
SharedPreferencesManager preferenceManager = SharedPreferencesManager.getInstance();
// Promos can only be shown when we start with ACTION_MAIN intent and
// after FRE is complete. Native initialization can finish before the FRE flow is
@@ -338,8 +338,8 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator implements Native
preferenceManager.writeBoolean(
ChromePreferenceKeys.PROMOS_SKIPPED_ON_FIRST_START, true);
}
- return isShowingPromo;
- }
+ return isShowingPromo; } */
+ return false;
}
private boolean maybeShowPromo() {
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 19 Dec 2019 21:46:10 +0100
Subject: Disable autofill assistant by default
---
.../autofill_assistant/AutofillAssistantPreferencesUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
--- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
+++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
@@ -15,7 +15,7 @@ class AutofillAssistantPreferencesUtil {
/** Checks whether the Autofill Assistant switch preference in settings is on. */
static boolean isAutofillAssistantSwitchOn() {
return SharedPreferencesManager.getInstance().readBoolean(
- ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, true);
+ ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, false);
}
/** Checks whether the Autofill Assistant onboarding has been accepted. */
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 19 Dec 2019 22:52:53 +0100
Subject: Disable feeds support by default
---
components/feed/feed_feature_list.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc
--- a/components/feed/feed_feature_list.cc
+++ b/components/feed/feed_feature_list.cc
@@ -7,7 +7,7 @@
namespace feed {
const base::Feature kInterestFeedContentSuggestions{
- "InterestFeedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "InterestFeedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
// InterestFeedV2 takes precedence over InterestFeedContentSuggestions.
const base::Feature kInterestFeedV2{"InterestFeedV2",
base::FEATURE_DISABLED_BY_DEFAULT};
--
2.17.1
@@ -1,84 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 8 Jul 2018 18:16:34 +0200
Subject: Disable fetching of all field trials
---
.../browser/flags/ChromeFeatureList.java | 19 ++++---------------
.../variations/service/variations_service.cc | 12 +-----------
2 files changed, 5 insertions(+), 26 deletions(-)
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
@@ -122,9 +122,7 @@ public abstract class ChromeFeatureList {
* the specified parameter does not exist.
*/
public static String getFieldTrialParamByFeature(String featureName, String paramName) {
- if (FeatureList.hasTestFeatures()) return "";
- assert FeatureList.isInitialized();
- return ChromeFeatureListJni.get().getFieldTrialParamByFeature(featureName, paramName);
+ return "";
}
/**
@@ -141,10 +139,7 @@ public abstract class ChromeFeatureList {
*/
public static int getFieldTrialParamByFeatureAsInt(
String featureName, String paramName, int defaultValue) {
- if (FeatureList.hasTestFeatures()) return defaultValue;
- assert FeatureList.isInitialized();
- return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsInt(
- featureName, paramName, defaultValue);
+ return defaultValue;
}
/**
@@ -161,10 +156,7 @@ public abstract class ChromeFeatureList {
*/
public static double getFieldTrialParamByFeatureAsDouble(
String featureName, String paramName, double defaultValue) {
- if (FeatureList.hasTestFeatures()) return defaultValue;
- assert FeatureList.isInitialized();
- return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsDouble(
- featureName, paramName, defaultValue);
+ return defaultValue;
}
/**
@@ -181,10 +173,7 @@ public abstract class ChromeFeatureList {
*/
public static boolean getFieldTrialParamByFeatureAsBoolean(
String featureName, String paramName, boolean defaultValue) {
- if (FeatureList.hasTestFeatures()) return defaultValue;
- assert FeatureList.isInitialized();
- return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsBoolean(
- featureName, paramName, defaultValue);
+ return defaultValue;
}
/** Alphabetical: */
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -243,17 +243,7 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers,
// Variations seed fetching is only enabled in official Chrome builds, if a URL
// is specified on the command line, and for testing.
bool IsFetchingEnabled() {
-#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kVariationsServerURL) &&
- !g_should_fetch_for_testing) {
- DVLOG(1)
- << "Not performing repeated fetching in unofficial build without --"
- << switches::kVariationsServerURL << " specified.";
- return false;
- }
-#endif
- return true;
+ return false;
}
std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(
--
2.17.1
@@ -1,66 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: Disable media router and remoting by default
---
.../media/router/media_router_feature.cc | 17 ++++++++---------
chrome/browser/profiles/profile.cc | 2 +-
chrome/browser/profiles/profile_impl.cc | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -50,17 +50,16 @@ const PrefService::Preference* GetMediaRouterPref(
bool MediaRouterEnabled(content::BrowserContext* context) {
#if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
- const PrefService::Preference* pref = GetMediaRouterPref(context);
- // Only use the pref value if it set from a mandatory policy.
- if (pref->IsManaged() && !pref->IsDefaultValue()) {
- bool allowed = false;
- CHECK(pref->GetValue()->GetAsBoolean(&allowed));
- return allowed;
- }
-
// The component extension cannot be loaded in guest sessions.
// TODO(crbug.com/756243): Figure out why.
- return !Profile::FromBrowserContext(context)->IsGuestSession();
+ if (Profile::FromBrowserContext(context)->IsGuestSession()) {
+ return false;
+ }
+
+ const PrefService::Preference* pref = GetMediaRouterPref(context);
+ bool allowed = false;
+ pref->GetValue()->GetAsBoolean(&allowed);
+ return allowed;
#else // !(defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS))
return false;
#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -345,7 +345,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kMediaRouterFirstRunFlowAcknowledged,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, true);
+ registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, false);
registry->RegisterListPref(prefs::kMediaRouterTabMirroringSources);
registry->RegisterDictionaryPref(prefs::kWebShareVisitedTargets);
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -412,7 +412,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if defined(OS_CHROMEOS)
registry->RegisterBooleanPref(
prefs::kOobeMarketingOptInScreenFinished, false,
--
2.17.1
@@ -1,88 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 20 Feb 2019 21:41:26 +0100
Subject: Disable metrics collection for NTP tiles
---
.../browser/android/ntp/most_visited_sites_bridge.cc | 11 ++---------
components/ntp_tiles/BUILD.gn | 3 ---
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/profiles/profile_android.h"
#include "components/favicon_base/favicon_types.h"
#include "components/history/core/browser/history_service.h"
-#include "components/ntp_tiles/metrics.h"
#include "components/ntp_tiles/most_visited_sites.h"
#include "components/ntp_tiles/section_type.h"
#include "ui/gfx/android/java_bitmap.h"
@@ -44,7 +43,6 @@ using ntp_tiles::NTPTilesVector;
using ntp_tiles::SectionType;
using ntp_tiles::TileTitleSource;
using ntp_tiles::TileSource;
-using ntp_tiles::TileVisualType;
namespace {
@@ -235,7 +233,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
jint jtiles_count) {
- ntp_tiles::metrics::RecordPageImpression(jtiles_count);
}
void MostVisitedSitesBridge::RecordTileImpression(
@@ -248,6 +245,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
jint jsource,
jlong jdata_generation_time_ms,
const JavaParamRef<jstring>& jurl) {
+#if 0
GURL url(ConvertJavaStringToUTF8(env, jurl));
TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
TileSource source = static_cast<TileSource>(jsource);
@@ -258,6 +256,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
ntp_tiles::metrics::RecordTileImpression(ntp_tiles::NTPTileImpression(
jindex, source, title_source, visual_type, icon_type,
base::Time::FromJavaTime(jdata_generation_time_ms), url));
+#endif
}
void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
@@ -268,12 +267,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
jint title_source,
jint source,
jlong jdata_generation_time_ms) {
- ntp_tiles::metrics::RecordTileClick(ntp_tiles::NTPTileImpression(
- index, static_cast<TileSource>(source),
- static_cast<TileTitleSource>(title_source),
- static_cast<TileVisualType>(tile_type), favicon_base::IconType::kInvalid,
- base::Time::FromJavaTime(jdata_generation_time_ms),
- /*url_for_rappor=*/GURL()));
}
static jlong JNI_MostVisitedSitesBridge_Init(
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
--- a/components/ntp_tiles/BUILD.gn
+++ b/components/ntp_tiles/BUILD.gn
@@ -22,8 +22,6 @@ static_library("ntp_tiles") {
"icon_cacher.h",
"icon_cacher_impl.cc",
"icon_cacher_impl.h",
- "metrics.cc",
- "metrics.h",
"most_visited_sites.cc",
"most_visited_sites.h",
"ntp_tile.cc",
@@ -79,7 +77,6 @@ source_set("unit_tests") {
"custom_links_manager_impl_unittest.cc",
"custom_links_store_unittest.cc",
"icon_cacher_impl_unittest.cc",
- "metrics_unittest.cc",
"most_visited_sites_unittest.cc",
"popular_sites_impl_unittest.cc",
]
--
2.17.1
@@ -1,36 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 25 Apr 2018 10:23:51 +0200
Subject: Disable metrics on all I/O threads
---
chrome/browser/browser_process_impl.cc | 2 +-
chrome/browser/profiles/profile_io_data.cc | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -944,7 +944,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
#endif // defined(OS_CHROMEOS)
registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled,
- GoogleUpdateSettings::GetCollectStatsConsent());
+ false);
#if defined(OS_ANDROID)
registry->RegisterBooleanPref(
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -45,8 +45,6 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/cookie_config/cookie_store_util.h"
#include "components/dom_distiller/core/url_constants.h"
-#include "components/metrics/metrics_pref_names.h"
-#include "components/metrics/metrics_service.h"
#include "components/net_log/chrome_net_log.h"
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
#include "components/signin/public/base/signin_pref_names.h"
--
2.17.1
@@ -1,24 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 30 May 2019 03:37:45 +0200
Subject: Disable offline pages in the downloads home to be opened in CCT by
default
---
components/offline_pages/core/offline_page_feature.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc
--- a/components/offline_pages/core/offline_page_feature.cc
+++ b/components/offline_pages/core/offline_page_feature.cc
@@ -51,7 +51,7 @@ const base::Feature kOfflinePagesDescriptivePendingStatusFeature{
"OfflinePagesDescriptivePendingStatus", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{
- "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_ENABLED_BY_DEFAULT};
+ "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOfflinePagesCTSuppressNotificationsFeature{
"OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT};
--
2.17.1
@@ -1,37 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 23:24:58 +0200
Subject: Disable omission of URL elements in Omnibox
Disable all omissions because they are used throughout the code without
a corresponding user option to individually disable their usage.
---
components/url_formatter/url_formatter.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
--- a/components/url_formatter/url_formatter.cc
+++ b/components/url_formatter/url_formatter.cc
@@ -479,13 +479,13 @@ ComponentResult IDNToUnicodeOneComponent(
} // namespace
const FormatUrlType kFormatUrlOmitNothing = 0;
-const FormatUrlType kFormatUrlOmitUsernamePassword = 1 << 0;
-const FormatUrlType kFormatUrlOmitHTTP = 1 << 1;
-const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 1 << 2;
-const FormatUrlType kFormatUrlOmitHTTPS = 1 << 3;
-const FormatUrlType kFormatUrlOmitTrivialSubdomains = 1 << 5;
-const FormatUrlType kFormatUrlTrimAfterHost = 1 << 6;
-const FormatUrlType kFormatUrlOmitFileScheme = 1 << 7;
+const FormatUrlType kFormatUrlOmitUsernamePassword = 0 << 0;
+const FormatUrlType kFormatUrlOmitHTTP = 0 << 1;
+const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 0 << 2;
+const FormatUrlType kFormatUrlOmitHTTPS = 0 << 3;
+const FormatUrlType kFormatUrlOmitTrivialSubdomains = 0 << 5;
+const FormatUrlType kFormatUrlTrimAfterHost = 0 << 6;
+const FormatUrlType kFormatUrlOmitFileScheme = 0 << 7;
const FormatUrlType kFormatUrlOmitMailToScheme = 1 << 8;
const FormatUrlType kFormatUrlOmitDefaults =
--
2.17.1
@@ -1,117 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 15 Dec 2019 22:39:56 +0100
Subject: Disable password reuse detection on android
---
.../android/password_reuse_controller_android.cc | 12 ++++++++++++
.../password_reuse_dialog_view_android.cc | 11 +++++++++--
components/password_manager/core/browser/BUILD.gn | 6 +++---
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/chrome/browser/safe_browsing/android/password_reuse_controller_android.cc b/chrome/browser/safe_browsing/android/password_reuse_controller_android.cc
--- a/chrome/browser/safe_browsing/android/password_reuse_controller_android.cc
+++ b/chrome/browser/safe_browsing/android/password_reuse_controller_android.cc
@@ -17,17 +17,25 @@ PasswordReuseControllerAndroid::PasswordReuseControllerAndroid(
ChromePasswordProtectionService* service,
ReusedPasswordAccountType password_type,
OnWarningDone done_callback)
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
: service_(service),
+#else
+ :
+#endif
url_(web_contents->GetLastCommittedURL()),
password_type_(password_type),
window_android_(web_contents->GetTopLevelNativeWindow()),
done_callback_(std::move(done_callback)) {
modal_construction_start_time_ = base::TimeTicks::Now();
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
service_->AddObserver(this);
+#endif
}
PasswordReuseControllerAndroid::~PasswordReuseControllerAndroid() {
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
service_->RemoveObserver(this);
+#endif
dialog_view_.reset();
LogModalWarningDialogLifetime(modal_construction_start_time_);
}
@@ -48,20 +56,24 @@ base::string16 PasswordReuseControllerAndroid::GetButtonText() const {
return l10n_util::GetStringUTF16(IDS_CLOSE);
}
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
base::string16 PasswordReuseControllerAndroid::GetWarningDetailText(
std::vector<size_t>* placeholder_offsets) const {
return service_->GetWarningDetailText(password_type_, placeholder_offsets);
}
+#endif
base::string16 PasswordReuseControllerAndroid::GetTitle() const {
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_SUMMARY);
}
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
const std::vector<base::string16>
PasswordReuseControllerAndroid::GetPlaceholdersForSavedPasswordWarningText()
const {
return service_->GetPlaceholdersForSavedPasswordWarningText();
}
+#endif
void PasswordReuseControllerAndroid::OnGaiaPasswordChanged() {
delete this;
diff --git a/chrome/browser/ui/android/safe_browsing/password_reuse_dialog_view_android.cc b/chrome/browser/ui/android/safe_browsing/password_reuse_dialog_view_android.cc
--- a/chrome/browser/ui/android/safe_browsing/password_reuse_dialog_view_android.cc
+++ b/chrome/browser/ui/android/safe_browsing/password_reuse_dialog_view_android.cc
@@ -29,6 +29,7 @@ void PasswordReuseDialogViewAndroid::Show(ui::WindowAndroid* window_android) {
java_object_.Reset(Java_SafeBrowsingPasswordReuseDialogBridge_create(
env, window_android->GetJavaObject(), reinterpret_cast<intptr_t>(this)));
+#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED)
std::vector<size_t> placeholder_offsets;
base::string16 warning_detail_text =
controller_->GetWarningDetailText(&placeholder_offsets);
@@ -50,14 +51,20 @@ void PasswordReuseDialogViewAndroid::Show(ui::WindowAndroid* window_android) {
base::android::ToJavaIntArray(env, start_ranges, len);
base::android::ScopedJavaLocalRef<jintArray> j_end_ranges =
base::android::ToJavaIntArray(env, end_ranges, len);
-
+#else
+ int start_ranges[0], end_ranges[0];
+ base::android::ScopedJavaLocalRef<jintArray> j_start_ranges =
+ base::android::ToJavaIntArray(env, start_ranges, 0);
+ base::android::ScopedJavaLocalRef<jintArray> j_end_ranges =
+ base::android::ToJavaIntArray(env, end_ranges, 0);
Java_SafeBrowsingPasswordReuseDialogBridge_showDialog(
env, java_object_,
base::android::ConvertUTF16ToJavaString(env, controller_->GetTitle()),
- base::android::ConvertUTF16ToJavaString(env, warning_detail_text),
+ base::android::ConvertUTF16ToJavaString(env, controller_->GetTitle()),
base::android::ConvertUTF16ToJavaString(env,
controller_->GetButtonText()),
j_start_ranges, j_end_ranges);
+#endif
}
void PasswordReuseDialogViewAndroid::Close(
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn
--- a/components/password_manager/core/browser/BUILD.gn
+++ b/components/password_manager/core/browser/BUILD.gn
@@ -12,9 +12,9 @@ if (is_android) {
# TODO(crbug.com/1006430): Fix password reuse detection not fully functional on
# Android.
-password_reuse_detection_support = !is_ios
-password_reuse_warning_support = !is_ios
-password_on_focus_ping_support = !is_ios
+password_reuse_detection_support = !is_ios && !is_android
+password_reuse_warning_support = !is_ios && !is_android
+password_on_focus_ping_support = !is_ios && !is_android
config("password_reuse_detection_config") {
defines = []
--
2.17.1
@@ -1,27 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 22 Mar 2018 22:38:00 +0100
Subject: Disable plugins enumeration
---
third_party/blink/renderer/core/frame/local_frame.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
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
@@ -1482,10 +1482,8 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
}
PluginData* LocalFrame::GetPluginData() const {
- if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
- return nullptr;
- return GetPage()->GetPluginData(
- Tree().Top().GetSecurityContext()->GetSecurityOrigin());
+ // what about no
+ return nullptr;
}
void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
--
2.17.1
@@ -1,28 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 8 Jan 2019 08:54:50 +0100
Subject: Disable previews by default
---
components/previews/core/previews_features.cc | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/components/previews/core/previews_features.cc b/components/previews/core/previews_features.cc
--- a/components/previews/core/previews_features.cc
+++ b/components/previews/core/previews_features.cc
@@ -14,12 +14,7 @@ namespace features {
// are enabled are controlled by other features.
const base::Feature kPreviews {
"Previews",
-#if defined(OS_ANDROID) || defined(OS_LINUX)
- // Previews allowed for Android (but also allow on Linux for dev/debug).
- base::FEATURE_ENABLED_BY_DEFAULT
-#else // !defined(OS_ANDROID) || defined(OS_LINUX)
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
+ base::FEATURE_DISABLED_BY_DEFAULT
};
// Enables the Offline previews on android slow connections.
--
2.17.1
@@ -1,395 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 10 Nov 2018 17:20:21 +0100
Subject: Disable promos displayed in bookmarks manager
Remove personalized signin promo view from
bookmarks, never reach signin thresholds.
---
chrome/android/chrome_java_resources.gni | 1 -
...rsonalized_signin_promo_view_bookmarks.xml | 30 -----
.../bookmarks/BookmarkItemsAdapter.java | 30 +----
.../bookmarks/BookmarkPromoHeader.java | 125 +-----------------
.../browser/signin/SigninPromoController.java | 19 +--
5 files changed, 5 insertions(+), 200 deletions(-)
delete mode 100644 chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -977,7 +977,6 @@ chrome_java_resources = [
"java/res/layout/payment_request_spinny.xml",
"java/res/layout/payments_request_editor_textview.xml",
"java/res/layout/personalized_signin_promo_view_body.xml",
- "java/res/layout/personalized_signin_promo_view_bookmarks.xml",
"java/res/layout/personalized_signin_promo_view_header.xml",
"java/res/layout/personalized_signin_promo_view_modern_content_suggestions.xml",
"java/res/layout/personalized_signin_promo_view_recent_tabs.xml",
diff --git a/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml b/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
deleted file mode 100644
--- a/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 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. -->
-
-<org.chromium.chrome.browser.signin.PersonalizedSigninPromoView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/signin_promo_view_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:background="@drawable/hairline_border_card_background"
- android:gravity="center_horizontal"
- android:orientation="vertical"
- android:paddingBottom="12dp"
- android:paddingTop="14dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp">
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="12dp">
-
- <include layout="@layout/personalized_signin_promo_view_header"/>
- </FrameLayout>
-
- <include layout="@layout/personalized_signin_promo_view_body"/>
-
-</org.chromium.chrome.browser.signin.PersonalizedSigninPromoView>
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
@@ -22,7 +22,6 @@ 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.bookmarks.BookmarkRow.Location;
-import org.chromium.chrome.browser.signin.PersonalizedSigninPromoView;
import org.chromium.chrome.browser.sync.ProfileSyncService;
import org.chromium.components.bookmarks.BookmarkId;
import org.chromium.components.bookmarks.BookmarkType;
@@ -63,7 +62,6 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
// ViewType.PERSONALIZED_SIGNIN_PROMO, ViewType.SYNC_PROMO, or ViewType.INVALID_PROMO
private int mPromoHeaderType = ViewType.INVALID_PROMO;
private BookmarkDelegate mDelegate;
- private BookmarkPromoHeader mPromoHeaderManager;
private String mSearchText;
private BookmarkId mCurrentFolder;
private ProfileSyncService mProfileSyncService;
@@ -190,9 +188,9 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
case ViewType.PERSONALIZED_SIGNIN_PROMO:
// fall through
case ViewType.PERSONALIZED_SYNC_PROMO:
- return mPromoHeaderManager.createPersonalizedSigninAndSyncPromoHolder(parent);
+ return null;
case ViewType.SYNC_PROMO:
- return mPromoHeaderManager.createSyncPromoHolder(parent);
+ return null;
case ViewType.FOLDER:
return createViewHolderHelper(parent, R.layout.bookmark_folder_row);
case ViewType.BOOKMARK:
@@ -206,11 +204,7 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
if (holder.getItemViewType() == ViewType.PERSONALIZED_SIGNIN_PROMO) {
- PersonalizedSigninPromoView view = (PersonalizedSigninPromoView) holder.itemView;
- mPromoHeaderManager.setupPersonalizedSigninPromo(view);
} else if (holder.getItemViewType() == ViewType.PERSONALIZED_SYNC_PROMO) {
- PersonalizedSigninPromoView view = (PersonalizedSigninPromoView) holder.itemView;
- mPromoHeaderManager.setupPersonalizedSyncPromo(view);
} else if (!(holder.getItemViewType() == ViewType.SYNC_PROMO)) {
BookmarkRow row = ((BookmarkRow) holder.itemView);
BookmarkId id = getIdByPosition(position);
@@ -239,7 +233,6 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
case ViewType.PERSONALIZED_SIGNIN_PROMO:
// fall through
case ViewType.PERSONALIZED_SYNC_PROMO:
- mPromoHeaderManager.detachPersonalizePromoView();
break;
default:
// Other view holders don't have special recycling code.
@@ -265,7 +258,6 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
updateHeader(!topLevelFoldersShowing());
};
- mPromoHeaderManager = new BookmarkPromoHeader(mContext, promoHeaderChangeAction);
populateTopLevelFoldersList();
mElements = new ArrayList<>();
@@ -281,7 +273,6 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
mDelegate.getModel().removeObserver(mBookmarkModelObserver);
mDelegate.getSelectionDelegate().removeObserver(this);
mDelegate = null;
- mPromoHeaderManager.destroy();
mProfileSyncService.removeSyncStateChangedListener(this);
}
@@ -407,23 +398,6 @@ class BookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkItem>
return;
} else if (currentUIState == BookmarkUIState.STATE_SEARCHING) {
mPromoHeaderType = ViewType.INVALID_PROMO;
- } else {
- switch (mPromoHeaderManager.getPromoState()) {
- case BookmarkPromoHeader.PromoState.PROMO_NONE:
- mPromoHeaderType = ViewType.INVALID_PROMO;
- break;
- case BookmarkPromoHeader.PromoState.PROMO_SIGNIN_PERSONALIZED:
- mPromoHeaderType = ViewType.PERSONALIZED_SIGNIN_PROMO;
- break;
- case BookmarkPromoHeader.PromoState.PROMO_SYNC_PERSONALIZED:
- mPromoHeaderType = ViewType.PERSONALIZED_SYNC_PROMO;
- break;
- case BookmarkPromoHeader.PromoState.PROMO_SYNC:
- mPromoHeaderType = ViewType.SYNC_PROMO;
- break;
- default:
- assert false : "Unexpected value for promo state!";
- }
}
boolean willShowPromo = hasPromoHeader();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
@@ -21,15 +21,9 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
-import org.chromium.chrome.browser.signin.PersonalizedSigninPromoView;
import org.chromium.chrome.browser.signin.ProfileDataCache;
-import org.chromium.chrome.browser.signin.SigninManager;
-import org.chromium.chrome.browser.signin.SigninManager.SignInStateObserver;
import org.chromium.chrome.browser.signin.SigninPromoController;
-import org.chromium.chrome.browser.signin.SigninPromoUtil;
import org.chromium.chrome.browser.signin.SyncPromoView;
-import org.chromium.chrome.browser.sync.AndroidSyncSettings;
-import org.chromium.chrome.browser.sync.AndroidSyncSettings.AndroidSyncSettingsObserver;
import org.chromium.components.signin.AccountManagerFacadeProvider;
import org.chromium.components.signin.AccountsChangeObserver;
import org.chromium.components.signin.base.CoreAccountInfo;
@@ -44,7 +38,7 @@ import java.lang.annotation.RetentionPolicy;
* Class that manages all the logic and UI behind the signin promo header in the bookmark
* content UI. The header is shown only on certain situations, (e.g., not signed in).
*/
-class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObserver,
+class BookmarkPromoHeader implements
ProfileDataCache.Observer, AccountsChangeObserver {
/**
* Specifies the various states in which the Bookmarks promo can be.
@@ -65,7 +59,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
private static @Nullable @PromoState Integer sPromoStateForTests;
private final Context mContext;
- private final SigninManager mSignInManager;
private final Runnable mPromoHeaderChangeAction;
private @Nullable ProfileDataCache mProfileDataCache;
@@ -80,11 +73,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
mContext = context;
mPromoHeaderChangeAction = promoHeaderChangeAction;
- AndroidSyncSettings.get().registerObserver(this);
-
- mSignInManager = IdentityServicesProvider.get().getSigninManager();
- mSignInManager.addSignInStateObserver(this);
-
mPromoState = calculatePromoState();
if (mPromoState == PromoState.PROMO_SYNC) {
SharedPreferencesManager.getInstance().incrementInt(
@@ -110,15 +98,11 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
* Clean ups the class. Must be called once done using this class.
*/
void destroy() {
- AndroidSyncSettings.get().unregisterObserver(this);
-
if (mSigninPromoController != null) {
AccountManagerFacadeProvider.getInstance().removeObserver(this);
mProfileDataCache.removeObserver(this);
mSigninPromoController.onPromoDestroyed();
}
-
- mSignInManager.removeSignInStateObserver(this);
}
/**
@@ -129,18 +113,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
return mPromoState;
}
- /**
- * @return Personalized signin promo header {@link ViewHolder} instance that can be used with
- * {@link RecyclerView}.
- */
- ViewHolder createPersonalizedSigninAndSyncPromoHolder(ViewGroup parent) {
- View view = LayoutInflater.from(mContext).inflate(
- R.layout.personalized_signin_promo_view_bookmarks, parent, false);
-
- // ViewHolder is abstract and it cannot be instantiated directly.
- return new ViewHolder(view) {};
- }
-
/**
* @return Sync promo header {@link ViewHolder} instance that can be used with
* {@link RecyclerView}.
@@ -152,56 +124,11 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
return new ViewHolder(view) {};
}
- /**
- * Configures the personalized signin promo and records promo impressions.
- * @param view The view to be configured.
- */
- void setupPersonalizedSigninPromo(PersonalizedSigninPromoView view) {
- SigninPromoUtil.setupPromoViewFromCache(mSigninPromoController, mProfileDataCache, view,
- this::setPersonalizedSigninPromoDeclined);
- }
-
- void setupPersonalizedSyncPromo(PersonalizedSigninPromoView view) {
- setupPersonalizedSigninPromo(view);
- view.getStatusMessage().setVisibility(View.VISIBLE);
- view.getChooseAccountButton().setVisibility(View.GONE);
- view.getSigninButton().setText(R.string.sync_promo_turn_on_sync);
- }
-
- /**
- * Detaches the previously configured {@link PersonalizedSigninPromoView}.
- */
- void detachPersonalizePromoView() {
- if (mSigninPromoController != null) mSigninPromoController.detach();
- }
-
- /**
- * Saves that the personalized signin promo was declined and updates the UI.
- */
- private void setPersonalizedSigninPromoDeclined() {
- SharedPreferencesManager.getInstance().writeBoolean(
- ChromePreferenceKeys.SIGNIN_PROMO_PERSONALIZED_DECLINED, true);
- updatePromoState();
- triggerPromoUpdate();
- }
-
- /**
- * @return Whether the user declined the personalized signin promo.
- */
- @VisibleForTesting
- static boolean wasPersonalizedSigninPromoDeclined() {
- return SharedPreferencesManager.getInstance().readBoolean(
- ChromePreferenceKeys.SIGNIN_PROMO_PERSONALIZED_DECLINED, false);
- }
-
/**
* @return Whether the personalized signin promo should be shown to user.
*/
private boolean shouldShowBookmarkSigninPromo() {
- return mSignInManager.isSignInAllowed()
- && SigninPromoController.hasNotReachedImpressionLimit(
- SigninAccessPoint.BOOKMARK_MANAGER)
- && !wasPersonalizedSigninPromoDeclined();
+ return false;
}
private @PromoState int calculatePromoState() {
@@ -209,30 +136,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
return sPromoStateForTests;
}
- if (!AndroidSyncSettings.get().isMasterSyncEnabled()) {
- return PromoState.PROMO_NONE;
- }
-
- if (!mSignInManager.getIdentityManager().hasPrimaryAccount()) {
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
- CoreAccountInfo primaryAccount =
- mSignInManager.getIdentityManager().getPrimaryAccountInfo(
- ConsentLevel.NOT_REQUIRED);
- if (primaryAccount != null && !wasPersonalizedSigninPromoDeclined()) {
- return PromoState.PROMO_SYNC_PERSONALIZED;
- }
- }
- return shouldShowBookmarkSigninPromo() ? PromoState.PROMO_SIGNIN_PERSONALIZED
- : PromoState.PROMO_NONE;
- }
-
- boolean impressionLimitNotReached =
- SharedPreferencesManager.getInstance().readInt(
- ChromePreferenceKeys.SIGNIN_AND_SYNC_PROMO_SHOW_COUNT)
- < MAX_SIGNIN_AND_SYNC_PROMO_SHOW_COUNT;
- if (!AndroidSyncSettings.get().isChromeSyncEnabled() && impressionLimitNotReached) {
- return PromoState.PROMO_SYNC;
- }
return PromoState.PROMO_NONE;
}
@@ -254,29 +157,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
mProfileDataCache.addObserver(this);
}
- // AndroidSyncSettingsObserver implementation.
- @Override
- public void androidSyncSettingsChanged() {
- // AndroidSyncSettings calls this method from non-UI threads.
- PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> {
- updatePromoState();
- triggerPromoUpdate();
- });
- }
-
- // SignInStateObserver implementation.
- @Override
- public void onSignedIn() {
- updatePromoState();
- triggerPromoUpdate();
- }
-
- @Override
- public void onSignedOut() {
- updatePromoState();
- triggerPromoUpdate();
- }
-
// ProfileDataCache.Observer implementation.
@Override
public void onProfileDataUpdated(String accountId) {
@@ -290,7 +170,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
}
private void triggerPromoUpdate() {
- detachPersonalizePromoView();
mPromoHeaderChangeAction.run();
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
@@ -69,24 +69,7 @@ public class SigninPromoController {
* @param accessPoint The access point for which the impression limit is being checked.
*/
public static boolean hasNotReachedImpressionLimit(@AccessPoint int accessPoint) {
- SharedPreferencesManager preferencesManager = SharedPreferencesManager.getInstance();
- switch (accessPoint) {
- case SigninAccessPoint.BOOKMARK_MANAGER:
- return getSigninPromoImpressionsCountBookmarks() < MAX_IMPRESSIONS_BOOKMARKS;
- case SigninAccessPoint.NTP_CONTENT_SUGGESTIONS:
- // There is no impression limit for NTP content suggestions.
- return true;
- case SigninAccessPoint.RECENT_TABS:
- // There is no impression limit for Recent Tabs.
- return true;
- case SigninAccessPoint.SETTINGS:
- return preferencesManager.readInt(
- ChromePreferenceKeys.SIGNIN_PROMO_IMPRESSIONS_COUNT_SETTINGS)
- < MAX_IMPRESSIONS_SETTINGS;
- default:
- assert false : "Unexpected value for access point: " + accessPoint;
- return false;
- }
+ return false;
}
/**
--
2.17.1
@@ -1,63 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 15 Oct 2017 21:45:46 +0200
Subject: Disable references to fonts.googleapis.com
---
.../content/browser/dom_distiller_viewer_source.cc | 2 +-
components/dom_distiller/core/html/preview.html | 2 +-
.../dom_distiller/core/javascript/dom_distiller_viewer.js | 2 +-
third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css | 3 +--
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -337,7 +337,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
std::string DomDistillerViewerSource::GetContentSecurityPolicy(
network::mojom::CSPDirectiveName directive) {
if (directive == network::mojom::CSPDirectiveName::StyleSrc) {
- return "style-src 'self' https://fonts.googleapis.com;";
+ return "style-src 'self';";
} else if (directive == network::mojom::CSPDirectiveName::ChildSrc) {
return "child-src *;";
}
diff --git a/components/dom_distiller/core/html/preview.html b/components/dom_distiller/core/html/preview.html
--- a/components/dom_distiller/core/html/preview.html
+++ b/components/dom_distiller/core/html/preview.html
@@ -11,7 +11,7 @@ found in the LICENSE file.
<meta name="theme-color" id="theme-color">
<title>Title goes here and it could be kind of lengthy - Publisher name</title>
<link href="../css/distilledpage.css" rel="stylesheet" type="text/css">
- <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
+ <link href='chrome://resources/css/roboto.css' rel='stylesheet' type='text/css'>
<style>
.english :lang(th) {display: none}
.english :lang(zh) {display: none}
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -116,7 +116,7 @@ function maybeSetWebFont() {
}
const e = document.createElement('link');
- e.href = 'https://fonts.googleapis.com/css?family=Roboto';
+ e.href = 'chrome://resources/css/roboto.css';
e.rel = 'stylesheet';
e.type = 'text/css';
document.head.appendChild(e);
diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
--- a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
+++ b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
@@ -12,8 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License. */
-@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
-@import "https://fonts.googleapis.com/css?family=Source+Code+Pro";
+@import "chrome://resources/css/roboto.css";
body,
table,
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,36 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 22 Aug 2020 12:46:20 +0200
Subject: Disable scroll-to-text-fragment
---
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +-
content/child/runtime_features.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -357,7 +357,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
prefs::kEnableReferrers,
!base::FeatureList::IsEnabled(features::kNoReferrers));
registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
- registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, true);
+ registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, false);
#if defined(OS_ANDROID)
registry->RegisterDoublePref(prefs::kWebKitFontScaleFactor, 1.0);
registry->RegisterBooleanPref(prefs::kWebKitForceEnableZoom,
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
@@ -461,7 +461,7 @@ void SetRuntimeFeaturesFromCommandLine(const base::CommandLine& command_line) {
{wrf::EnableWebGPU, switches::kEnableUnsafeWebGPU, true},
{wrf::EnablePresentationAPI, switches::kDisablePresentationAPI, false},
{wrf::EnableTextFragmentAnchor, switches::kDisableScrollToTextFragment,
- false},
+ true},
{wrf::EnableRemotePlaybackAPI, switches::kDisableRemotePlaybackAPI,
false},
{wrf::EnableTimerThrottlingForBackgroundTabs,
--
2.17.1
@@ -1,25 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Tue, 25 Dec 2018 16:19:51 -0500
Subject: Disable seed-based field trials
---
components/variations/service/variations_field_trial_creator.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
--- a/components/variations/service/variations_field_trial_creator.cc
+++ b/components/variations/service/variations_field_trial_creator.cc
@@ -536,8 +536,10 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
#endif // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
bool used_seed = false;
if (!used_testing_config) {
+#if defined(FIELDTRIAL_SEED_ENABLED)
used_seed = CreateTrialsFromSeed(std::move(low_entropy_provider),
feature_list.get(), safe_seed_manager);
+#endif
}
platform_field_trials->SetupFeatureControllingFieldTrials(used_seed,
--
2.17.1
@@ -1,41 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 24 Jan 2020 19:17:22 +0100
Subject: Disable smart selection by default
Allow web search in incognito mode (reverts
commit 48d4ae54f7565c429bf29cd63806aee5d7e93e69)
Notice that re-enabling smart selection would make incognito mode potentially
leak information through the TextClassifier set by OEM, if any
---
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
.../content/browser/selection/SelectionPopupControllerImpl.java | 2 +-
2 files 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
@@ -376,7 +376,7 @@ const base::Feature kChromeSharingHubV15{"ChromeSharingHubV15",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kChromeSmartSelection{"ChromeSmartSelection",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kCommandLineOnNonRooted{"CommandLineOnNonRooted",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
--- a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
@@ -815,7 +815,7 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper
menu.removeItem(R.id.select_action_menu_share);
}
- if (isFocusedNodeEditable() || isIncognito()
+ if (isFocusedNodeEditable()
|| !isSelectActionModeAllowed(MENU_ITEM_WEB_SEARCH)) {
menu.removeItem(R.id.select_action_menu_web_search);
}
--
2.17.1
@@ -1,32 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:22:56 +0100
Subject: Disable some signed exchange features
---
content/public/common/content_features.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -562,7 +562,7 @@ const base::Feature kSignedExchangePrefetchCacheForNavigations{
// Signed Exchange Reporting for distributors
// https://www.chromestatus.com/features/5687904902840320
const base::Feature kSignedExchangeReportingForDistributors{
- "SignedExchangeReportingForDistributors", base::FEATURE_ENABLED_BY_DEFAULT};
+ "SignedExchangeReportingForDistributors", base::FEATURE_DISABLED_BY_DEFAULT};
// Subresource prefetching+loading via Signed HTTP Exchange
// https://www.chromestatus.com/features/5126805474246656
@@ -572,7 +572,7 @@ const base::Feature kSignedExchangeSubresourcePrefetch{
// Origin-Signed HTTP Exchanges (for WebPackage Loading)
// https://www.chromestatus.com/features/5745285984681984
const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Whether to send a ping to the inner URL upon navigation or not.
const base::Feature kSignedHTTPExchangePingValidity{
--
2.17.1
@@ -1,96 +0,0 @@
From: Michael Gilbert <mgilbert@debian.org>
Date: Wed, 21 Nov 2018 02:37:35 +0000
Subject: Disable support for RAR files inspection
---
.../download_protection/file_analyzer.cc | 2 +-
chrome/common/safe_browsing/BUILD.gn | 33 -------------------
.../file_util/safe_archive_analyzer.cc | 4 +--
3 files changed, 2 insertions(+), 37 deletions(-)
diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
--- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
+++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
@@ -87,7 +87,7 @@ void FileAnalyzer::Start(const base::FilePath& target_path,
if (inspection_type == DownloadFileType::ZIP) {
StartExtractZipFeatures();
} else if (inspection_type == DownloadFileType::RAR) {
- StartExtractRarFeatures();
+ LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build";
#if defined(OS_MACOSX)
} else if (inspection_type == DownloadFileType::DMG) {
StartExtractDmgFeatures();
diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
--- a/chrome/common/safe_browsing/BUILD.gn
+++ b/chrome/common/safe_browsing/BUILD.gn
@@ -52,38 +52,6 @@ if (safe_browsing_mode == 1) {
public_deps = [ "//components/safe_browsing/core:csd_proto" ]
}
- source_set("rar_analyzer") {
- sources = [
- "rar_analyzer.cc",
- "rar_analyzer.h",
- ]
-
- deps = [
- ":archive_analyzer_results",
- ":download_type_util",
- "//base",
- "//base:i18n",
- "//components/safe_browsing/core:features",
- "//third_party/unrar:unrar",
- ]
-
- defines = [
- "_FILE_OFFSET_BITS=64",
- "LARGEFILE_SOURCE",
- "RAR_SMP",
- "SILENT",
-
- # The following is set to disable certain macro definitions in the unrar
- # source code.
- "CHROMIUM_UNRAR",
-
- # Disables exceptions in unrar, replaces them with process termination.
- "UNRAR_NO_EXCEPTIONS",
- ]
-
- public_deps = [ "//components/safe_browsing/core:csd_proto" ]
- }
-
source_set("disk_image_type_sniffer_mac") {
sources = [
"disk_image_type_sniffer_mac.cc",
@@ -150,7 +118,6 @@ source_set("safe_browsing") {
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
- ":rar_analyzer",
"//components/safe_browsing/core:features",
]
diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
--- a/chrome/services/file_util/safe_archive_analyzer.cc
+++ b/chrome/services/file_util/safe_archive_analyzer.cc
@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -48,8 +47,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
AnalyzeRarFileCallback callback) {
DCHECK(rar_file.IsValid());
+ LOG(FATAL) << "AnalyzeRarFile is disabled in this build";
safe_browsing::ArchiveAnalyzerResults results;
- safe_browsing::rar_analyzer::AnalyzeRarFile(
- std::move(rar_file), std::move(temporary_file), &results);
std::move(callback).Run(results);
}
--
2.17.1
@@ -1,44 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 11 Nov 2019 23:09:48 +0100
Subject: Disable sync services menu entry
---
chrome/android/java/res/xml/main_preferences.xml | 6 ------
chrome/android/java/res/xml/privacy_preferences.xml | 8 --------
2 files changed, 14 deletions(-)
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
--- a/chrome/android/java/res/xml/main_preferences.xml
+++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -14,12 +14,6 @@
android:key="sign_in"
android:order="1"
android:title="@string/sign_in_to_chrome"/>
- <org.chromium.components.browser_ui.settings.ChromeBasePreference
- android:key="sync_and_services"
- android:order="2"
- android:layout="@layout/account_management_account_row"
- android:title="@string/prefs_sync_and_services"
- android:fragment="org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings"/>
<PreferenceCategory
android:key="basics_section"
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
@@ -33,12 +33,4 @@
android:title="@string/clear_browsing_data_title"
android:summary="@string/clear_browsing_data_summary"
android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTabsFragment" />
- <Preference
- android:key="sync_and_services_link_divider"
- android:layout="@layout/divider_preference"
- android:selectable="false"/>
- <org.chromium.components.browser_ui.settings.TextMessagePreference
- android:key="sync_and_services_link"
- android:summary="@string/privacy_sync_and_services_link"
- app:allowDividerBelow="false" />
</PreferenceScreen>
--
2.17.1
@@ -1,26 +0,0 @@
From: Blaise <BlaiseD@GMail.com>
Date: Sun, 23 Aug 2020 14:32:55 -0500
Subject: Disable the DIAL repeating discovery
This causes unnecessary SSDP network spam
---
chrome/browser/media/router/discovery/dial/dial_registry.cc | 4 ----
1 file changed, 4 deletions(-)
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrome/browser/media/router/discovery/dial/dial_registry.cc
--- a/chrome/browser/media/router/discovery/dial/dial_registry.cc
+++ b/chrome/browser/media/router/discovery/dial/dial_registry.cc
@@ -192,10 +192,6 @@ void DialRegistry::StartPeriodicDiscovery() {
dial_ = CreateDialService();
dial_->AddObserver(this);
- DoDiscovery();
- repeating_timer_.reset(new base::RepeatingTimer());
- repeating_timer_->Start(FROM_HERE, refresh_interval_delta_, this,
- &DialRegistry::DoDiscovery);
}
void DialRegistry::DoDiscovery() {
--
2.17.1
@@ -1,24 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 22:50:10 +0200
Subject: Disable third-party cookies by default
author: Chad Miller <chad.miller@canonical.com>
---
components/content_settings/core/browser/cookie_settings.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -63,7 +63,7 @@ void CookieSettings::GetCookieSettings(
void CookieSettings::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kBlockThirdPartyCookies, false,
+ prefs::kBlockThirdPartyCookies, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kCookieControlsMode,
--
2.17.1
@@ -1,26 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 27 Oct 2018 17:54:01 +0200
Subject: Disable update scheduler
---
.../chrome/browser/component_updater/UpdateScheduler.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java b/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
@@ -36,10 +36,7 @@ public class UpdateScheduler {
@CalledByNative
/* package */ static boolean isAvailable() {
- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
- || GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext())
- == ConnectionResult.SUCCESS;
+ return false;
}
/* package */ void onStartTaskBeforeNativeLoaded(TaskFinishedCallback callback) {
--
2.17.1
@@ -1,116 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 27 Feb 2020 23:23:59 +0100
Subject: Do not compile QR code sharing
---
chrome/android/java/AndroidManifest.xml | 16 ------------
.../ChromeProvidedSharingOptionsProvider.java | 25 -------------------
chrome/browser/share/android/java_sources.gni | 18 -------------
3 files changed, 59 deletions(-)
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -729,22 +729,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
- <activity
- android:name="org.chromium.chrome.browser.share.qrcode.QrCodeShareActivity"
- android:icon="@drawable/ic_launcher"
- android:label="@string/qr_code_share_icon_label"
- android:enabled="false"
- android:excludeFromRecents="true"
- android:exported="true"
- android:noHistory="true"
- android:theme="@android:style/Theme.NoDisplay"
- android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" >
- <intent-filter>
- <action android:name="android.intent.action.SEND" />
- <category android:name="android.intent.category.DEFAULT" />
- <data android:mimeType="text/plain" />
- </intent-filter>
- </activity>
<activity
android:name="org.chromium.chrome.browser.vr.VrCancelAnimationActivity"
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
--- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
+++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
@@ -22,7 +22,6 @@ import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.send_tab_to_self.SendTabToSelfShareActivity;
import org.chromium.chrome.browser.share.ChromeShareExtras;
-import org.chromium.chrome.browser.share.qrcode.QrCodeCoordinator;
import org.chromium.chrome.browser.share.screenshot.ScreenshotCoordinator;
import org.chromium.chrome.browser.share.share_sheet.ShareSheetPropertyModelBuilder.ContentType;
import org.chromium.chrome.browser.tab.Tab;
@@ -145,10 +144,6 @@ class ChromeProvidedSharingOptionsProvider {
mOrderedFirstPartyOptions.add(createCopyTextFirstPartyOption());
}
mOrderedFirstPartyOptions.add(createSendTabToSelfFirstPartyOption());
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_SHARE_QRCODE)
- && !mTabProvider.get().getWebContents().isIncognito()) {
- mOrderedFirstPartyOptions.add(createQrCodeFirstPartyOption());
- }
if (mPrefServiceBridge.getBoolean(Pref.PRINTING_ENABLED)) {
mOrderedFirstPartyOptions.add(createPrintingFirstPartyOption());
}
@@ -261,26 +256,6 @@ class ChromeProvidedSharingOptionsProvider {
ContentType.IMAGE));
}
- private FirstPartyOption createQrCodeFirstPartyOption() {
- PropertyModel propertyModel = ShareSheetPropertyModelBuilder.createPropertyModel(
- AppCompatResources.getDrawable(mActivity, R.drawable.qr_code),
- mActivity.getResources().getString(R.string.qr_code_share_icon_label),
- (currentActivity)
- -> {
- RecordUserAction.record("SharingHubAndroid.QRCodeSelected");
- RecordHistogram.recordMediumTimesHistogram(
- "Sharing.SharingHubAndroid.TimeToShare",
- System.currentTimeMillis() - mShareStartTime);
- mBottomSheetController.hideContent(mBottomSheetContent, true);
- QrCodeCoordinator qrCodeCoordinator = new QrCodeCoordinator(mActivity, mUrl);
- qrCodeCoordinator.show();
- },
- /*isFirstParty=*/true);
- return new FirstPartyOption(propertyModel,
- Arrays.asList(ContentType.LINK_PAGE_VISIBLE, ContentType.LINK_PAGE_NOT_VISIBLE,
- ContentType.IMAGE));
- }
-
private FirstPartyOption createPrintingFirstPartyOption() {
PropertyModel propertyModel = ShareSheetPropertyModelBuilder.createPropertyModel(
AppCompatResources.getDrawable(mActivity, R.drawable.sharing_print),
diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/share/android/java_sources.gni
--- a/chrome/browser/share/android/java_sources.gni
+++ b/chrome/browser/share/android/java_sources.gni
@@ -8,24 +8,6 @@ share_java_sources = [
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/BitmapDownloadRequest.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/BitmapUriRequest.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/clipboard/ClipboardImageFileProvider.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QRCodeGenerationRequest.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeDialog.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeDialogTab.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodePageAdapter.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/TabLayoutPageListener.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/CameraPreview.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/CameraPreviewOverlay.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanMediator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanView.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanViewBinder.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanViewProperties.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareMediator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareView.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareViewBinder.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareViewProperties.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/ScreenshotCoordinator.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/ScreenshotShareSheetCoordinator.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/ScreenshotShareSheetDialog.java",
--
2.17.1
@@ -1,64 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 10 Nov 2018 19:47:39 +0100
Subject: Do not grant notifications to default search engine
Block gelocation by default instead of granting it for non-enterprise use cases (almost the totality of users)
---
.../search_permissions_service.cc | 20 ++++++-------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/chrome/browser/android/search_permissions/search_permissions_service.cc b/chrome/browser/android/search_permissions/search_permissions_service.cc
--- a/chrome/browser/android/search_permissions/search_permissions_service.cc
+++ b/chrome/browser/android/search_permissions/search_permissions_service.cc
@@ -191,7 +191,7 @@ void SearchPermissionsService::ResetDSEPermission(ContentSettingsType type) {
DCHECK(dse_url.is_empty() || IsPermissionControlledByDSE(type, dse_origin));
if (!dse_url.is_empty())
- SetContentSetting(dse_url, type, CONTENT_SETTING_ALLOW);
+ SetContentSetting(dse_url, type, CONTENT_SETTING_BLOCK);
}
void SearchPermissionsService::ResetDSEPermissions() {
@@ -334,11 +334,7 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
return;
}
- // If we get to here, the DSE is not disabled by enterprise policy. If it was
- // previously enterprise controlled, we initialize the setting to BLOCK since
- // we don't know what the user's setting was previously.
- bool was_enterprise_controlled =
- pref_service_->GetBoolean(prefs::kDSEWasDisabledByPolicy);
+ // If this line is reached then DSE is not disabled by enterprise policy.
pref_service_->ClearPref(prefs::kDSEWasDisabledByPolicy);
// Initialize the pref for geolocation if it hasn't been initialized yet.
@@ -371,10 +367,8 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated);
} else if (dse_geolocation_setting == CONTENT_SETTING_ASK) {
// If the user hasn't explicitly allowed or blocked geolocation for the
- // DSE, initialize it to allowed.
- dse_geolocation_setting = was_enterprise_controlled
- ? CONTENT_SETTING_BLOCK
- : CONTENT_SETTING_ALLOW;
+ // DSE, initialize it to blocked.
+ dse_geolocation_setting = CONTENT_SETTING_BLOCK;
}
// Update the content setting with the auto-grants for the DSE.
@@ -399,11 +393,9 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
GetContentSetting(dse_origin, ContentSettingsType::NOTIFICATIONS);
ContentSetting dse_notifications_setting = notifications_setting_to_restore;
// If the user hasn't explicitly allowed or blocked notifications for the
- // DSE, initialize it to allowed.
+ // DSE, initialize it to blocked.
if (dse_notifications_setting == CONTENT_SETTING_ASK) {
- dse_notifications_setting = was_enterprise_controlled
- ? CONTENT_SETTING_BLOCK
- : CONTENT_SETTING_ALLOW;
+ dse_notifications_setting = CONTENT_SETTING_BLOCK;
}
// Update the content setting with the auto-grants for the DSE.
--
2.17.1
@@ -1,26 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 08:09:24 +0200
Subject: Do not hide component extensions
---
extensions/common/extension.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -361,9 +361,8 @@ bool Extension::ShouldDisplayInNewTabPage() const {
}
bool Extension::ShouldExposeViaManagementAPI() const {
- // Hide component extensions because they are only extensions as an
- // implementation detail of Chrome.
- return !extensions::Manifest::IsComponentLocation(location());
+ // do not hide component extensions
+ return true;
}
Extension::ManifestData* Extension::GetManifestData(const std::string& key)
--
2.17.1
@@ -1,54 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 20 Jan 2019 06:20:10 +0100
Subject: Do not ignore download location prompt setting
Upstream has decided that it works as intended (https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
but users would like to decide where to save a file even when there is no SD card available;
do not skip the prompt in such cases.
Do not tick "Don't show again" by default
---
.../dialogs/DownloadLocationCustomView.java | 4 ----
.../dialogs/DownloadLocationDialogCoordinator.java | 13 -------------
2 files changed, 17 deletions(-)
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
@@ -63,10 +63,6 @@ public class DownloadLocationCustomView
CharSequence title) {
mDialogType = dialogType;
- // Automatically check "don't show again" the first time the user is seeing the dialog.
- boolean isInitial = DownloadDialogBridge.getPromptForDownloadAndroid()
- == DownloadPromptStatus.SHOW_INITIAL;
- mDontShowAgain.setChecked(isInitial);
mDontShowAgain.setOnCheckedChangeListener(this);
mFileName.setText(suggestedPath.getName());
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
@@ -120,19 +120,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
* @param dirs An list of available download directories.
*/
private void onDirectoryOptionsRetrieved(ArrayList<DirectoryOption> dirs) {
- // If there is only one directory available, don't show the default dialog, and set the
- // download directory to default. Dialog will still show for other types of dialogs, like
- // name conflict or disk error.
- if (dirs.size() == 1 && mDialogType == DownloadLocationDialogType.DEFAULT) {
- final DirectoryOption dir = dirs.get(0);
- if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) {
- assert (!TextUtils.isEmpty(dir.location));
- DownloadDialogBridge.setDownloadAndSaveFileDefaultDirectory(dir.location);
- mController.onDownloadLocationDialogComplete(mSuggestedPath);
- }
- return;
- }
-
// Already showing the dialog.
if (mDialogModel != null) return;
--
2.17.1
@@ -1,27 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 23:17:17 +0200
Subject: Do not store passwords by default
---
components/password_manager/core/browser/password_manager.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -206,10 +206,10 @@ FormData SimplifiedFormDataFromFormStructure(
void PasswordManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableService, true,
+ prefs::kCredentialsEnableService, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableAutosignin, true,
+ prefs::kCredentialsEnableAutosignin, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
PrefRegistry::NO_REGISTRATION_FLAGS);
--
2.17.1
@@ -1,39 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 17 Mar 2019 19:09:00 +0100
Subject: Enable SPPI for devices with enough memory
---
chrome/common/chrome_features.cc | 4 ----
components/site_isolation/features.cc | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -637,11 +637,7 @@ const base::Feature kShowTrustedPublisherURL{"ShowTrustedPublisherURL",
// browser_features, as they are only used on the browser side.
const base::Feature kSitePerProcess {
"site-per-process",
-#if defined(OS_ANDROID)
- base::FEATURE_DISABLED_BY_DEFAULT
-#else
base::FEATURE_ENABLED_BY_DEFAULT
-#endif
};
#if defined(OS_CHROMEOS)
diff --git a/components/site_isolation/features.cc b/components/site_isolation/features.cc
--- a/components/site_isolation/features.cc
+++ b/components/site_isolation/features.cc
@@ -36,7 +36,7 @@ const base::Feature kSiteIsolationForPasswordSites {
// base::SysInfo::AmountOfPhysicalMemoryMB().
const base::Feature kSitePerProcessOnlyForHighMemoryClients{
"site-per-process-only-for-high-memory-clients",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const char kSitePerProcessOnlyForHighMemoryClientsParamName[] =
"site-per-process-low-memory-cutoff-mb";
--
2.17.1
@@ -1,37 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 20 Aug 2020 20:15:34 +0200
Subject: Enable darken websites checkbox in themes
Unexpire #darken-websites-checkbox-in-themes-setting
---
chrome/browser/flag-metadata.json | 2 +-
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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
@@ -783,7 +783,7 @@
{
"name": "darken-websites-checkbox-in-themes-setting",
"owners": [ "lazzzis@google.com", "twellington" ],
- "expiry_milestone": 83
+ "expiry_milestone": -1
},
{
"name": "data-saver-server-previews",
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
@@ -432,7 +432,7 @@ const base::Feature kContextualSearchTranslations{
"ContextualSearchTranslations", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDarkenWebsitesCheckboxInThemesSetting{
- "DarkenWebsitesCheckboxInThemesSetting", base::FEATURE_DISABLED_BY_DEFAULT};
+ "DarkenWebsitesCheckboxInThemesSetting", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kDirectActions{"DirectActions",
base::FEATURE_ENABLED_BY_DEFAULT};
--
2.17.1
@@ -1,58 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 22 Dec 2016 07:15:34 -0500
Subject: Enable -fwrapv in Clang for non-UBSan builds
Using -fwrapv (notably only when not using signed integer overflow checking -
since it will override it and result in not performing checks) is just common
sense since it eliminates the chance of security vulnerabilities being
introduced by optimizations based on signed overflow being undefined.
That has happened before, and those optimizations don't even add up to a 0.1%
performance increase for this kind of software. It's not worth having.
The Linux kernel passes -fwrapv and also -fno-strict-aliasing to disable those
dangerous optimizations (since there is so much incorrect code they can break).
In fact, it is easy to point to dozens of known examples of invalid code that
could potentially be broken by those optimizations.
It is not acceptable for projects to be using optimizations that are known to
be broken with a bunch of code in their tree.
They put barely any effort into even fixing the known cases.
Chromium has blacklists for UBSan for 'false positives' (none of which are
actually false positives, but rather "undefined, but not a bug beyond
potentially being broken by optimizations or even code generation without
them") and also for components too full of these bugs for them to currently
want to bother with it. That includes a bunch of signed overflow issues
(there is sadly no detection for aliasing violations, which are fairly common,
but not that common).
Ideally, -fwrapv could be always passed, but unfortunately the way it is
implemented has silly interactions with other switches.
The reason it would still make sense to pass it is because due to their UBSan
blacklists, they get far from full coverage with it, so -fwrapv would still
be better than nothing where it's not being used.
Since -fwrapv makes signed integer overflow well-defined, Clang will disable
the UBSan checks for signed integer overflow, including in the
production-oriented trapping mode used for hardening.
Excerpt from https://github.com/bromite/bromite/issues/226
---
build/config/compiler/BUILD.gn | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -288,6 +288,10 @@ config("compiler") {
}
}
+ if (is_clang && !is_ubsan && !is_ubsan_security) {
+ cflags += [ "-fwrapv" ]
+ }
+
# Linker warnings.
if (fatal_linker_warnings && !is_mac && !is_ios && current_os != "aix") {
ldflags += [ "-Wl,--fatal-warnings" ]
--
2.17.1
@@ -1,37 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 7 Aug 2020 13:41:21 +0200
Subject: Enable improved cookie controls by default
---
components/content_settings/core/common/features.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc
--- a/components/content_settings/core/common/features.cc
+++ b/components/content_settings/core/common/features.cc
@@ -11,7 +11,7 @@ namespace content_settings {
// Enables an improved UI for third-party cookie blocking in incognito mode.
const base::Feature kImprovedCookieControls{"ImprovedCookieControls",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Default setting for improved cookie controls.
const base::FeatureParam<bool> kImprovedCookieControlsDefaultInIncognito{
@@ -20,10 +20,10 @@ const base::FeatureParam<bool> kImprovedCookieControlsDefaultInIncognito{
// Enables an improved UI for existing third-party cookie blocking users.
const base::Feature kImprovedCookieControlsForThirdPartyCookieBlocking{
"ImprovedCookieControlsForThirdPartyCookieBlocking",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kDisallowWildcardsInPluginContentSettings{
"DisallowWildcardsInPluginContentSettings",
base::FEATURE_ENABLED_BY_DEFAULT};
-} // namespace content_settings
\ No newline at end of file
+} // namespace content_settings
--
2.17.1
@@ -1,136 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 17 Jul 2020 09:28:36 +0200
Subject: Enable legacy TLS interstitital warning
Expose show-legacy-tls-warnings flag on Android as well
---
chrome/browser/about_flags.cc | 2 --
chrome/browser/ssl/tls_deprecation_config.cc | 22 +------------------
components/security_state/core/features.cc | 2 +-
net/base/features.cc | 2 +-
.../network/legacy_tls_config_distributor.cc | 21 +-----------------
services/network/ssl_config_service_mojo.cc | 7 ++----
6 files changed, 6 insertions(+), 50 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
@@ -5366,11 +5366,9 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kElasticOverscrollWin)},
#endif
-#if !defined(OS_ANDROID)
{"show-legacy-tls-warnings", flag_descriptions::kLegacyTLSWarningsName,
flag_descriptions::kLegacyTLSWarningsDescription, kOsDesktop,
FEATURE_VALUE_TYPE(security_state::features::kLegacyTLSWarnings)},
-#endif
#if defined(OS_CHROMEOS)
{"enable-assistant-aec", flag_descriptions::kEnableGoogleAssistantAecName,
diff --git a/chrome/browser/ssl/tls_deprecation_config.cc b/chrome/browser/ssl/tls_deprecation_config.cc
--- a/chrome/browser/ssl/tls_deprecation_config.cc
+++ b/chrome/browser/ssl/tls_deprecation_config.cc
@@ -58,27 +58,7 @@ void SetRemoteTLSDeprecationConfig(const std::string& binary_config) {
}
bool ShouldSuppressLegacyTLSWarning(const GURL& url) {
- if (!url.has_host() || !url.SchemeIsCryptographic())
- return false;
-
- auto* proto = TLSDeprecationConfigSingleton::GetInstance().GetProto();
- // If the config is not yet loaded, we err on the side of not showing warnings
- // for any sites.
- if (!proto)
- return true;
-
- // Convert bytes from crypto::SHA256 so we can compare to the proto contents.
- std::string host_hash_bytes = crypto::SHA256HashString(url.host_piece());
- std::string host_hash = base::ToLowerASCII(
- base::HexEncode(host_hash_bytes.c_str(), host_hash_bytes.size()));
- const auto& control_site_hashes = proto->control_site_hashes();
-
- // Perform binary search on the sorted list of control site hashes to check
- // if the input URL's hostname is included.
- auto lower = std::lower_bound(control_site_hashes.begin(),
- control_site_hashes.end(), host_hash);
-
- return lower != control_site_hashes.end() && *lower == host_hash;
+ return false;
}
void ResetTLSDeprecationConfigForTesting() {
diff --git a/components/security_state/core/features.cc b/components/security_state/core/features.cc
--- a/components/security_state/core/features.cc
+++ b/components/security_state/core/features.cc
@@ -16,7 +16,7 @@ const char kMarkHttpAsParameterWarningAndDangerousOnFormEdits[] =
const char kMarkHttpAsParameterDangerWarning[] = "danger-warning";
const base::Feature kLegacyTLSWarnings{"LegacyTLSWarnings",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSafetyTipUI{"SafetyTip",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/net/base/features.cc b/net/base/features.cc
--- a/net/base/features.cc
+++ b/net/base/features.cc
@@ -153,7 +153,7 @@ const base::Feature kTurnOffStreamingMediaCaching{
"TurnOffStreamingMediaCaching", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kLegacyTLSEnforced{"LegacyTLSEnforced",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSchemefulSameSite{"SchemefulSameSite",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/services/network/legacy_tls_config_distributor.cc b/services/network/legacy_tls_config_distributor.cc
--- a/services/network/legacy_tls_config_distributor.cc
+++ b/services/network/legacy_tls_config_distributor.cc
@@ -51,26 +51,7 @@ scoped_refptr<LegacyTLSExperimentConfig> LegacyTLSExperimentConfig::Parse(
bool LegacyTLSExperimentConfig::ShouldSuppressLegacyTLSWarning(
const std::string& hostname) const {
- // Match on eTLD+1 rather than full hostname (to account for subdomains and
- // redirects). If no registrable domain is found, default to using the
- // hostname as-is.
- auto domain = net::registry_controlled_domains::GetDomainAndRegistry(
- hostname, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- if (domain.empty())
- domain = hostname;
-
- // Convert bytes from crypto::SHA256 so we can compare to the proto contents.
- std::string host_hash_bytes = crypto::SHA256HashString(domain);
- std::string host_hash = base::ToLowerASCII(
- base::HexEncode(host_hash_bytes.data(), host_hash_bytes.size()));
- const auto& control_site_hashes = proto_.control_site_hashes();
-
- // Perform binary search on the sorted list of control site hashes to check
- // if the input URL's hostname is included.
- auto lower = std::lower_bound(control_site_hashes.begin(),
- control_site_hashes.end(), host_hash);
-
- return lower != control_site_hashes.end() && *lower == host_hash;
+ return false;
}
LegacyTLSConfigDistributor::LegacyTLSConfigDistributor() = default;
diff --git a/services/network/ssl_config_service_mojo.cc b/services/network/ssl_config_service_mojo.cc
--- a/services/network/ssl_config_service_mojo.cc
+++ b/services/network/ssl_config_service_mojo.cc
@@ -120,11 +120,8 @@ bool SSLConfigServiceMojo::CanShareConnectionWithClientCerts(
bool SSLConfigServiceMojo::ShouldSuppressLegacyTLSWarning(
const std::string& hostname) const {
- // If the config is not yet loaded, we err on the side of not showing warnings
- // for any sites.
- if (!legacy_tls_config_)
- return true;
- return legacy_tls_config_->ShouldSuppressLegacyTLSWarning(hostname);
+ // never suppress any warning
+ return false;
}
void SSLConfigServiceMojo::OnNewCRLSet(scoped_refptr<net::CRLSet> crl_set) {
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 31 Jul 2020 08:27:26 +0200
Subject: Enable prefetch-privacy-changes by default
---
third_party/blink/common/features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
@@ -283,7 +283,7 @@ const base::Feature kFontAccess{"FontAccess",
// Prefetch request properties are updated to be privacy-preserving. See
// crbug.com/988956.
const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const char kMixedContentAutoupgradeModeParamName[] = "mode";
const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 31 Jul 2020 08:28:35 +0200
Subject: Enable reduced-referrer-granularity by default
---
content/public/common/content_features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -456,7 +456,7 @@ const base::Feature kProactivelySwapBrowsingInstance{
// Reduce the amount of information in the default 'referer' header for
// cross-origin requests.
const base::Feature kReducedReferrerGranularity{
- "ReducedReferrerGranularity", base::FEATURE_DISABLED_BY_DEFAULT};
+ "ReducedReferrerGranularity", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether FileURLLoaderFactory can fetch additional files based on the
// isolated world's origin. This feature is disabled by default because we want
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 10 Feb 2020 23:13:13 +0100
Subject: Enable user-agent freeze by default
---
third_party/blink/common/features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
@@ -52,7 +52,7 @@ const base::Feature kFreezePurgeMemoryAllPagesFrozen{
// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
const base::Feature kFreezeUserAgent{"FreezeUserAgent",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// When enabled, use the maximum possible bounds in compositing overlap testing
// for fixed position elements.
--
2.17.1
@@ -1,25 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 20 Jan 2018 19:44:43 +0100
Subject: Fix crash when accessing page info / site settings
---
components/permissions/permission_manager.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/permissions/permission_manager.cc b/components/permissions/permission_manager.cc
--- a/components/permissions/permission_manager.cc
+++ b/components/permissions/permission_manager.cc
@@ -682,6 +682,10 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
if (status != CONTENT_SETTING_DEFAULT)
return PermissionResult(status, PermissionStatusSource::UNSPECIFIED);
PermissionContextBase* context = GetPermissionContext(permission);
+ if (context == nullptr) {
+ return PermissionResult(CONTENT_SETTING_BLOCK, PermissionStatusSource::UNSPECIFIED);
+ }
+
PermissionResult result = context->GetPermissionStatus(
render_frame_host, canonical_requesting_origin.GetOrigin(),
embedding_origin.GetOrigin());
--
2.17.1
@@ -1,32 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Sun, 13 Aug 2017 19:33:04 -0400
Subject: Hide passwords manager link
---
.../browser/password_manager/settings/PasswordSettings.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
@@ -284,7 +284,7 @@ public class PasswordSettings
return;
}
- displayManageAccountLink();
+ //displayManageAccountLink();
PreferenceGroup passwordParent;
if (mSearchQuery == null) {
@@ -360,7 +360,7 @@ public class PasswordSettings
return;
}
- displayManageAccountLink();
+ //displayManageAccountLink();
PreferenceCategory profileCategory = new PreferenceCategory(getStyledContext());
profileCategory.setKey(PREF_KEY_CATEGORY_EXCEPTIONS);
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 12 Jun 2018 15:03:29 +0200
Subject: Hide send reports checkbox
---
chrome/android/java/res/layout/fre_tosanduma.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/android/java/res/layout/fre_tosanduma.xml b/chrome/android/java/res/layout/fre_tosanduma.xml
--- a/chrome/android/java/res/layout/fre_tosanduma.xml
+++ b/chrome/android/java/res/layout/fre_tosanduma.xml
@@ -70,7 +70,7 @@
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.4"
android:text="@string/fre_send_report_check"
- android:textAppearance="@style/TextAppearance.TextMedium.Primary" />
+ android:textAppearance="@style/TextAppearance.TextMedium.Primary" android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
--
2.17.1
@@ -1,52 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Oct 2019 10:18:39 +0100
Subject: Increase number of autocomplete matches from 5 to 10
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526874703
---
components/omnibox/browser/autocomplete_result.cc | 3 ++-
components/omnibox/browser/omnibox_field_trial.cc | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc
--- a/components/omnibox/browser/autocomplete_result.cc
+++ b/components/omnibox/browser/autocomplete_result.cc
@@ -76,7 +76,8 @@ struct MatchGURLHash {
// static
size_t AutocompleteResult::GetMaxMatches(bool input_from_omnibox_focus) {
#if (defined(OS_ANDROID))
- constexpr size_t kDefaultMaxAutocompleteMatches = 5;
+ // changed from 6, this needs to be double the value of default_max_matches_per_provider from components/omnibox/browser/omnibox_field_trial.cc
+ constexpr size_t kDefaultMaxAutocompleteMatches = 10;
#elif defined(OS_IOS) // !defined(OS_ANDROID)
constexpr size_t kDefaultMaxAutocompleteMatches = 6;
#else // !defined(OS_ANDROID) && !defined(OS_IOS)
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -361,11 +361,11 @@ void OmniboxFieldTrial::GetDemotionsByType(
size_t OmniboxFieldTrial::GetProviderMaxMatches(
AutocompleteProvider::Type provider) {
- size_t default_max_matches_per_provider = 3;
+ size_t default_max_matches_per_provider = 5; // was 3; this needs to be half the value of kDefaultMaxAutocompleteMatches from components/omnibox/browser/autocomplete_result.cc
// If new search features are disabled, ignore the parameter and use the
// default value.
- if (!base::FeatureList::IsEnabled(omnibox::kNewSearchFeatures))
+ /*if (!base::FeatureList::IsEnabled(omnibox::kNewSearchFeatures))
return default_max_matches_per_provider;
std::string param_value = base::GetFieldTrialParamValueByFeature(
@@ -392,7 +392,7 @@ size_t OmniboxFieldTrial::GetProviderMaxMatches(
else if (k == provider)
return v;
}
- }
+ }*/
return default_max_matches_per_provider;
}
--
2.17.1
File diff suppressed because one or more lines are too long
@@ -1,222 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 2 May 2020 00:25:25 +0200
Subject: Modify default preferences
---
chrome/browser/background/background_mode_manager.cc | 2 +-
chrome/browser/chrome_content_browser_client.cc | 2 +-
chrome/browser/net/prediction_options.cc | 2 +-
chrome/browser/net/prediction_options.h | 2 +-
chrome/browser/profiles/profile.cc | 2 +-
.../settings/reset_page/reset_profile_dialog.html | 2 +-
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
chrome/browser/ui/navigation_correction_tab_observer.cc | 2 +-
.../ui/webui/local_discovery/local_discovery_ui.cc | 4 ----
chrome/service/cloud_print/connector_settings.cc | 2 +-
components/autofill/core/browser/autofill_manager.cc | 9 +++------
components/autofill/core/common/autofill_prefs.cc | 2 +-
components/bookmarks/browser/bookmark_utils.cc | 4 ++--
.../safe_browsing/core/common/safe_browsing_prefs.cc | 4 ++--
14 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -339,7 +339,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
#endif
- registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
+ registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
}
void BackgroundModeManager::RegisterProfile(Profile* profile) {
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
@@ -1277,7 +1277,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
registry->RegisterListPref(prefs::kEnableDeprecatedWebPlatformFeatures);
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
// user policy in addition to the same named ones in Local State (which are
diff --git a/chrome/browser/net/prediction_options.cc b/chrome/browser/net/prediction_options.cc
--- a/chrome/browser/net/prediction_options.cc
+++ b/chrome/browser/net/prediction_options.cc
@@ -31,7 +31,7 @@ NetworkPredictionStatus CanPrefetchAndPrerender(
}
return NetworkPredictionStatus::DISABLED_DUE_TO_NETWORK;
default:
- DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
+ //DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
return NetworkPredictionStatus::DISABLED_ALWAYS;
}
}
diff --git a/chrome/browser/net/prediction_options.h b/chrome/browser/net/prediction_options.h
--- a/chrome/browser/net/prediction_options.h
+++ b/chrome/browser/net/prediction_options.h
@@ -22,7 +22,7 @@ enum NetworkPredictionOptions {
NETWORK_PREDICTION_ALWAYS,
NETWORK_PREDICTION_WIFI_ONLY,
NETWORK_PREDICTION_NEVER,
- NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_WIFI_ONLY,
+ NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_NEVER,
};
enum class NetworkPredictionStatus {
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -262,7 +262,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kSearchSuggestEnabled,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if defined(OS_ANDROID)
registry->RegisterStringPref(
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
--- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
+++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
@@ -34,7 +34,7 @@
</cr-button>
</div>
<div slot="footer">
- <cr-checkbox id="sendSettings" checked>
+ <cr-checkbox id="sendSettings">
$i18nRaw{resetPageFeedback}</cr-checkbox>
</div>
</cr-dialog>
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
@@ -71,11 +71,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
registry->RegisterBooleanPref(
- prefs::kOfferTranslateEnabled, true,
+ prefs::kOfferTranslateEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
- registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
+ registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/browser/ui/navigation_correction_tab_observer.cc
--- a/chrome/browser/ui/navigation_correction_tab_observer.cc
+++ b/chrome/browser/ui/navigation_correction_tab_observer.cc
@@ -59,7 +59,7 @@ void NavigationCorrectionTabObserver::SetAllowEnableCorrectionsForTesting(
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* prefs) {
prefs->RegisterBooleanPref(embedder_support::kAlternateErrorPagesEnabled,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
@@ -109,10 +109,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kLocalDiscoveryEnabled, true);
registry->RegisterBooleanPref(
prefs::kLocalDiscoveryNotificationsEnabled,
-#if defined(OS_WIN)
false,
-#else
- true,
-#endif
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc
--- a/chrome/service/cloud_print/connector_settings.cc
+++ b/chrome/service/cloud_print/connector_settings.cc
@@ -60,7 +60,7 @@ void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
DCHECK(server_url_.is_valid());
connect_new_printers_ = prefs->GetBoolean(
- prefs::kCloudPrintConnectNewPrinters, true);
+ prefs::kCloudPrintConnectNewPrinters, false);
xmpp_ping_enabled_ = prefs->GetBoolean(
prefs::kCloudPrintXmppPingEnabled, false);
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -948,10 +948,7 @@ void AutofillManager::OnQueryFormFieldAutofillImpl(
// suggestions available.
// TODO(mathp): Differentiate between number of suggestions available
// (current metric) and number shown to the user.
- if (!has_logged_address_suggestions_count_) {
- AutofillMetrics::LogAddressSuggestionsCount(suggestions.size());
- has_logged_address_suggestions_count_ = true;
- }
+ has_logged_address_suggestions_count_ = true;
}
}
@@ -1587,8 +1584,8 @@ void AutofillManager::Reset() {
#if defined(OS_ANDROID) || defined(OS_IOS)
autofill_assistant_.Reset();
#endif
- has_logged_autofill_enabled_ = false;
- has_logged_address_suggestions_count_ = false;
+ has_logged_autofill_enabled_ = true;
+ has_logged_address_suggestions_count_ = true;
did_show_suggestions_ = false;
user_did_type_ = false;
user_did_autofill_ = false;
diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc
--- a/components/autofill/core/common/autofill_prefs.cc
+++ b/components/autofill/core/common/autofill_prefs.cc
@@ -150,7 +150,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kAutofillLastVersionDisusedAddressesDeleted, 0,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
- prefs::kAutofillCreditCardEnabled, true,
+ prefs::kAutofillCreditCardEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(
prefs::kAutofillProfileValidity, "",
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -439,12 +439,12 @@ bool DoesBookmarkContainWords(const base::string16& title,
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kShowBookmarkBar,
- false,
+ true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, true);
registry->RegisterBooleanPref(
prefs::kShowAppsShortcutInBookmarkBar,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kShowManagedBookmarksInBookmarkBar,
diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc
--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc
@@ -189,9 +189,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingExtendedReportingOptInAllowed, true);
+ prefs::kSafeBrowsingExtendedReportingOptInAllowed, false);
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingEnabled, true,
+ prefs::kSafeBrowsingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kSafeBrowsingEnhanced, false);
registry->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled,
--
2.17.1
@@ -1,706 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 30 Mar 2018 10:09:03 +0200
Subject: Multiple fingerprinting mitigations for canvas, text and client
rectangles
1. getClientRects, getBoundingClientRect, measureText: add fingerprinting mitigation
Scale the result of Range::getClientRects, Element::getBoundingClientRect and
Canvas::measureText by a random +/-3/1000000th of the original value for each
float in the returned Rect/Quad.
It contains improvements from ungoogled-chromium which add two flags:
1. --fingerprinting-client-rects-noise to enable fingerprinting deception for Range::getClientRects and Element::getBoundingClientRect
2. --fingerprinting-canvas-measuretext-noise to enable fingerprinting deception for Canvas::measureText
2. 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.
Added flag --fingerprinting-canvas-image-data-noise to disable Canvas image data fingerprinting deception
---
chrome/browser/BUILD.gn | 1 +
chrome/browser/about_flags.cc | 13 ++
content/browser/BUILD.gn | 1 +
.../renderer_host/render_process_host_impl.cc | 4 +
content/child/BUILD.gn | 1 +
content/child/runtime_features.cc | 8 +
.../public/platform/web_runtime_features.h | 3 +
.../blink/renderer/core/dom/document.cc | 18 ++
.../blink/renderer/core/dom/document.h | 7 +
.../blink/renderer/core/dom/element.cc | 8 +
third_party/blink/renderer/core/dom/range.cc | 12 +-
.../renderer/core/html/canvas/text_metrics.cc | 18 ++
.../renderer/core/html/canvas/text_metrics.h | 2 +
.../canvas2d/canvas_rendering_context_2d.cc | 8 +-
third_party/blink/renderer/platform/BUILD.gn | 5 +-
.../platform/exported/web_runtime_features.cc | 12 ++
.../platform/graphics/image_data_buffer.cc | 7 +
.../platform/graphics/static_bitmap_image.cc | 159 ++++++++++++++++++
.../platform/graphics/static_bitmap_image.h | 2 +
.../platform/runtime_enabled_features.json5 | 9 +
third_party/ungoogled/BUILD.gn | 10 ++
third_party/ungoogled/ungoogled_switches.cc | 18 ++
third_party/ungoogled/ungoogled_switches.h | 18 ++
23 files changed, 341 insertions(+), 3 deletions(-)
create mode 100644 third_party/ungoogled/BUILD.gn
create mode 100644 third_party/ungoogled/ungoogled_switches.cc
create mode 100644 third_party/ungoogled/ungoogled_switches.h
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2098,6 +2098,7 @@ static_library("browser") {
"//services/data_decoder/public/cpp",
"//services/device/public/cpp:device_features",
"//services/device/public/cpp/usb",
+ "//third_party/ungoogled:switches",
"//services/device/public/mojom",
"//services/device/public/mojom:usb",
"//services/image_annotation:service",
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
@@ -164,6 +164,7 @@
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/service_manager/sandbox/features.h"
+#include "third_party/ungoogled/ungoogled_switches.h"
#include "services/service_manager/sandbox/switches.h"
#include "third_party/blink/public/common/experiments/memory_ablation_experiment.h"
#include "third_party/blink/public/common/features.h"
@@ -2017,12 +2018,24 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-webrtc-srtp-aes-gcm", flag_descriptions::kWebrtcSrtpAesGcmName,
flag_descriptions::kWebrtcSrtpAesGcmDescription, kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableWebRtcSrtpAesGcm)},
+ {"fingerprinting-canvas-image-data-noise",
+ "Disable Canvas image data fingerprint deception",
+ "Slightly modifies at most 20 pixels in Canvas image data extracted via JS APIs",
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingCanvasImageDataNoise)},
{"enable-webrtc-stun-origin", flag_descriptions::kWebrtcStunOriginName,
flag_descriptions::kWebrtcStunOriginDescription, kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin)},
{"enable-webrtc-hybrid-agc", flag_descriptions::kWebrtcHybridAgcName,
flag_descriptions::kWebrtcHybridAgcDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kWebRtcHybridAgc)},
+ {"fingerprinting-client-rects-noise",
+ "Disable get*ClientRects() fingerprint deception",
+ "Scale the output values of Range::getClientRects() and Element::getBoundingClientRect() with a randomly selected factor in the range -0.0003% to 0.0003%, which are recomputed on every document initialization.",
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingClientRectsNoise)},
+ {"fingerprinting-canvas-measuretext-noise",
+ "Disable Canvas::measureText() fingerprint deception",
+ "Scale the output values of Canvas::measureText() with a randomly selected factor in the range -0.0003% to 0.0003%, which are recomputed on every document initialization.",
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingCanvasMeasureTextNoise)},
{"enable-webrtc-new-encode-cpu-load-estimator",
flag_descriptions::kWebrtcNewEncodeCpuLoadEstimatorName,
flag_descriptions::kWebrtcNewEncodeCpuLoadEstimatorDescription, kOsAll,
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -216,6 +216,7 @@ jumbo_source_set("browser") {
"//third_party/libyuv",
"//third_party/re2",
"//third_party/sqlite",
+ "//third_party/ungoogled:switches",
"//third_party/webrtc_overrides:webrtc_component",
"//third_party/zlib",
"//third_party/zlib/google:zip",
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -223,6 +223,7 @@
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
#include "third_party/blink/public/mojom/disk_allocator.mojom.h"
#include "third_party/blink/public/public_buildflags.h"
+#include "third_party/ungoogled/ungoogled_switches.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/accessibility/accessibility_switches.h"
#include "ui/base/ui_base_switches.h"
@@ -3292,6 +3293,9 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisablePreferCompositingToLCDText,
switches::kDisableDatabases,
switches::kDisableFileSystem,
+ switches::kFingerprintingClientRectsNoise,
+ switches::kFingerprintingCanvasMeasureTextNoise,
+ switches::kFingerprintingCanvasImageDataNoise,
switches::kDisableFrameRateLimit,
switches::kDisableGpuMemoryBufferVideoFrames,
switches::kDisableHistogramCustomizer,
diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn
--- a/content/child/BUILD.gn
+++ b/content/child/BUILD.gn
@@ -123,6 +123,7 @@ target(link_target_type, "child") {
"//third_party/blink/public/common",
"//third_party/blink/public/strings",
"//third_party/ced",
+ "//third_party/ungoogled:switches",
"//third_party/zlib/google:compression_utils",
"//ui/base",
"//ui/events/blink",
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
@@ -26,6 +26,7 @@
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "third_party/blink/public/common/features.h"
+#include "third_party/ungoogled/ungoogled_switches.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "ui/accessibility/accessibility_features.h"
@@ -535,6 +536,13 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs(
// They're moved here to distinguish them from actual base checks
WebRuntimeFeatures::EnableOverlayScrollbars(ui::IsOverlayScrollbarEnabled());
+ WebRuntimeFeatures::EnableFingerprintingClientRectsNoise(
+ !command_line.HasSwitch(switches::kFingerprintingClientRectsNoise));
+ WebRuntimeFeatures::EnableFingerprintingCanvasMeasureTextNoise(
+ !command_line.HasSwitch(switches::kFingerprintingCanvasMeasureTextNoise));
+ WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(
+ !command_line.HasSwitch(switches::kFingerprintingCanvasImageDataNoise));
+
if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine(
blink::features::kNativeFileSystemAPI.name,
base::FeatureList::OVERRIDE_ENABLE_FEATURE)) {
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
@@ -223,6 +223,9 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableTranslateService(bool);
BLINK_PLATFORM_EXPORT static void EnableGetDisplayMedia(bool);
BLINK_PLATFORM_EXPORT static void EnableAllowSyncXHRInPageDismissal(bool);
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingClientRectsNoise(bool);
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingCanvasMeasureTextNoise(bool);
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingCanvasImageDataNoise(bool);
BLINK_PLATFORM_EXPORT static void EnableShadowDOMV0(bool);
BLINK_PLATFORM_EXPORT static void EnableCustomElementsV0(bool);
BLINK_PLATFORM_EXPORT static void EnableHTMLImports(bool);
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -35,6 +35,7 @@
#include "base/auto_reset.h"
#include "base/macros.h"
#include "base/optional.h"
+#include "base/rand_util.h"
#include "base/time/time.h"
#include "cc/input/overscroll_behavior.h"
#include "cc/input/scroll_snap_data.h"
@@ -2513,6 +2514,23 @@ void Document::UpdateStyleAndLayoutTree() {
#if DCHECK_IS_ON()
AssertLayoutTreeUpdated(*this);
#endif
+
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ // Precompute -0.0003% to 0.0003% noise factor for get*ClientRect*() fingerprinting
+ noise_factor_x_ = 1 + (base::RandDouble() - 0.5) * 0.000003;
+ noise_factor_y_ = 1 + (base::RandDouble() - 0.5) * 0.000003;
+ } else {
+ noise_factor_x_ = 1;
+ noise_factor_y_ = 1;
+ }
+}
+
+double Document::GetNoiseFactorX() {
+ return noise_factor_x_;
+}
+
+double Document::GetNoiseFactorY() {
+ return noise_factor_y_;
}
void Document::UpdateActiveStyle() {
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h
--- a/third_party/blink/renderer/core/dom/document.h
+++ b/third_party/blink/renderer/core/dom/document.h
@@ -451,6 +451,10 @@ class CORE_EXPORT Document : public ContainerNode,
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
}
+ // Values for get*ClientRect fingerprint deception
+ double GetNoiseFactorX();
+ double GetNoiseFactorY();
+
String visibilityState() const;
bool IsPageVisible() const;
bool hidden() const;
@@ -1974,6 +1978,9 @@ class CORE_EXPORT Document : public ContainerNode,
base::ElapsedTimer start_time_;
+ double noise_factor_x_;
+ double noise_factor_y_;
+
Member<ScriptRunner> script_runner_;
HeapVector<Member<ScriptElementBase>> current_script_stack_;
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc
--- a/third_party/blink/renderer/core/dom/element.cc
+++ b/third_party/blink/renderer/core/dom/element.cc
@@ -2031,6 +2031,11 @@ DOMRectList* Element::getClientRects() {
DCHECK(element_layout_object);
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
quads, *element_layout_object);
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ for (FloatQuad& quad : quads) {
+ quad.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
+ }
+ }
return MakeGarbageCollected<DOMRectList>(quads);
}
@@ -2048,6 +2053,9 @@ DOMRect* Element::getBoundingClientRect() {
DCHECK(element_layout_object);
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
*element_layout_object);
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ result.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
+ }
return DOMRect::FromFloatRect(result);
}
diff --git a/third_party/blink/renderer/core/dom/range.cc b/third_party/blink/renderer/core/dom/range.cc
--- a/third_party/blink/renderer/core/dom/range.cc
+++ b/third_party/blink/renderer/core/dom/range.cc
@@ -1614,6 +1614,12 @@ DOMRectList* Range::getClientRects() const {
Vector<FloatQuad> quads;
GetBorderAndTextQuads(quads);
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ for (FloatQuad& quad : quads) {
+ quad.Scale(owner_document_->GetNoiseFactorX(), owner_document_->GetNoiseFactorY());
+ }
+ }
+
return MakeGarbageCollected<DOMRectList>(quads);
}
@@ -1741,7 +1747,11 @@ FloatRect Range::BoundingRect() const {
// If all rects are empty, return the first rect.
if (result.IsEmpty() && !quads.IsEmpty())
- return quads.front().BoundingBox();
+ result = quads.front().BoundingBox();
+
+ if (!result.IsEmpty() && RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
+ result.Scale(owner_document_->GetNoiseFactorX(), owner_document_->GetNoiseFactorY());
+ }
return result;
}
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.cc b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
@@ -55,6 +55,24 @@ TextMetrics::TextMetrics(const Font& font,
Update(font, direction, baseline, align, text);
}
+void TextMetrics::Shuffle(const double factor) {
+ // x-direction
+ width_ *= factor;
+ actual_bounding_box_left_ *= factor;
+ actual_bounding_box_right_ *= factor;
+
+ // y-direction
+ font_bounding_box_ascent_ *= factor;
+ font_bounding_box_descent_ *= factor;
+ actual_bounding_box_ascent_ *= factor;
+ actual_bounding_box_descent_ *= factor;
+ em_height_ascent_ *= factor;
+ em_height_descent_ *= factor;
+ baselines_->setAlphabetic(baselines_->alphabetic() * factor);
+ baselines_->setHanging(baselines_->hanging() * factor);
+ baselines_->setIdeographic(baselines_->ideographic() * factor);
+}
+
void TextMetrics::Update(const Font& font,
const TextDirection& direction,
const TextBaseline& baseline,
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.h b/third_party/blink/renderer/core/html/canvas/text_metrics.h
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.h
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.h
@@ -64,6 +64,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
void Trace(Visitor*) const override;
+ void Shuffle(const double factor);
+
private:
void Update(const Font&,
const TextDirection&,
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
@@ -835,9 +835,15 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
else
direction = ToTextDirection(GetState().GetDirection(), canvas());
- return MakeGarbageCollected<TextMetrics>(font, direction,
+ TextMetrics* text_metrics = MakeGarbageCollected<TextMetrics>(font, direction,
GetState().GetTextBaseline(),
GetState().GetTextAlign(), text);
+
+ // Scale text metrics if enabled
+ if (RuntimeEnabledFeatures::FingerprintingCanvasMeasureTextNoiseEnabled()) {
+ text_metrics->Shuffle(canvas()->GetDocument().GetNoiseFactorX());
+ }
+ return text_metrics;
}
void CanvasRenderingContext2D::DrawTextInternal(
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
@@ -1552,7 +1552,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",
@@ -1593,6 +1595,7 @@ jumbo_component("platform") {
"//third_party/blink/public/strings",
"//third_party/blink/renderer/platform/wtf",
"//third_party/ced",
+ "//third_party/ungoogled:switches",
"//third_party/emoji-segmenter",
"//third_party/harfbuzz-ng:hb_scoped_util",
"//third_party/icu",
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
@@ -709,4 +709,16 @@ void WebRuntimeFeatures::EnableContentIndex(bool enable) {
RuntimeEnabledFeatures::SetContentIndexEnabled(enable);
}
+void WebRuntimeFeatures::EnableFingerprintingClientRectsNoise(bool enable) {
+ RuntimeEnabledFeatures::SetFingerprintingClientRectsNoiseEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableFingerprintingCanvasMeasureTextNoise(bool enable) {
+ RuntimeEnabledFeatures::SetFingerprintingCanvasMeasureTextNoiseEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(bool enable) {
+ RuntimeEnabledFeatures::SetFingerprintingCanvasImageDataNoiseEnabled(enable);
+}
+
} // namespace blink
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
@@ -36,6 +36,8 @@
#include "base/compiler_specific.h"
#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"
@@ -137,6 +139,11 @@ bool ImageDataBuffer::EncodeImageInternal(const ImageEncodingMimeType mime_type,
const SkPixmap& pixmap) const {
DCHECK(is_valid_);
+ if (RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
+ // 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"
@@ -11,11 +13,13 @@
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#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/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/private/SkColorData.h"
#include "v8/include/v8.h"
namespace blink {
@@ -128,7 +132,162 @@ bool StaticBitmapImage::CopyToByteArray(
DCHECK(read_pixels_successful ||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
rect.X(), rect.Y(), info.width(), info.height())));
+
+ if (read_pixels_successful && RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
+ ShuffleSubchannelColorData(dst.data(), info, rect.X(), rect.Y());
+ }
+
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
+
} // namespace blink
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
@@ -35,6 +35,8 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
StaticBitmapImage(ImageOrientation orientation) : orientation_(orientation) {}
+ 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
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
@@ -752,6 +752,15 @@
origin_trial_feature_name: "FeaturePolicyReporting",
status: "experimental"
},
+ {
+ name: "FingerprintingClientRectsNoise",
+ },
+ {
+ name: "FingerprintingCanvasMeasureTextNoise",
+ },
+ {
+ name: "FingerprintingCanvasImageDataNoise",
+ },
{
name: "FeaturePolicyVibrateFeature"
},
diff --git a/third_party/ungoogled/BUILD.gn b/third_party/ungoogled/BUILD.gn
new file mode 100644
--- /dev/null
+++ b/third_party/ungoogled/BUILD.gn
@@ -0,0 +1,10 @@
+# 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.
+
+component("switches") {
+ sources = [
+ "ungoogled_switches.h",
+ "ungoogled_switches.cc",
+ ]
+}
diff --git a/third_party/ungoogled/ungoogled_switches.cc b/third_party/ungoogled/ungoogled_switches.cc
new file mode 100644
--- /dev/null
+++ b/third_party/ungoogled/ungoogled_switches.cc
@@ -0,0 +1,18 @@
+// 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 "third_party/ungoogled/ungoogled_switches.h"
+
+namespace switches {
+
+// Enable fingerprinting deception for getClientRects and getBoundingClientRect
+const char kFingerprintingClientRectsNoise[] = "fingerprinting-client-rects-noise";
+
+// Enable fingerprinting deception for measureText
+const char kFingerprintingCanvasMeasureTextNoise[] = "fingerprinting-canvas-measuretext-noise";
+
+// Enable fingerprinting deception for Canvas image data
+const char kFingerprintingCanvasImageDataNoise[] = "fingerprinting-canvas-image-data-noise";
+
+} // namespace switches
diff --git a/third_party/ungoogled/ungoogled_switches.h b/third_party/ungoogled/ungoogled_switches.h
new file mode 100644
--- /dev/null
+++ b/third_party/ungoogled/ungoogled_switches.h
@@ -0,0 +1,18 @@
+// 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.
+
+// Defines all the fingerprinting command-line switches.
+
+#ifndef THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
+#define THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
+
+namespace switches {
+
+extern const char kFingerprintingClientRectsNoise[];
+extern const char kFingerprintingCanvasMeasureTextNoise[];
+extern const char kFingerprintingCanvasImageDataNoise[];
+
+}
+
+#endif // THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
--
2.17.1
@@ -1,45 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 14 Feb 2018 12:56:01 +0100
Subject: Never fetch popular sites
---
components/ntp_tiles/popular_sites_impl.cc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/components/ntp_tiles/popular_sites_impl.cc b/components/ntp_tiles/popular_sites_impl.cc
--- a/components/ntp_tiles/popular_sites_impl.cc
+++ b/components/ntp_tiles/popular_sites_impl.cc
@@ -61,7 +61,6 @@ const char kPopularSitesDefaultDirectory[] = "chrome/ntp/";
const char kPopularSitesDefaultCountryCode[] = "DEFAULT";
const char kPopularSitesDefaultVersion[] = "5";
const int kSitesExplorationStartVersion = 6;
-const int kPopularSitesRedownloadIntervalHours = 24;
GURL GetPopularSitesURL(const std::string& directory,
const std::string& country,
@@ -275,7 +274,12 @@ bool PopularSitesImpl::MaybeStartFetch(bool force_download,
DCHECK(!callback_);
callback_ = std::move(callback);
- const base::Time last_download_time = base::Time::FromInternalValue(
+ if (force_download) {
+ std::move(callback_).Run(true);
+ return true;
+ }
+
+/* const base::Time last_download_time = base::Time::FromInternalValue(
prefs_->GetInt64(prefs::kPopularSitesLastDownloadPref));
const base::TimeDelta time_since_last_download =
base::Time::Now() - last_download_time;
@@ -292,7 +296,7 @@ bool PopularSitesImpl::MaybeStartFetch(bool force_download,
(time_since_last_download > redownload_interval) || url_changed) {
FetchPopularSites();
return true;
- }
+ }*/
return false;
}
--
2.17.1
@@ -1,33 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 12 Feb 2018 21:43:35 +0100
Subject: Never send any crash upload data
---
chrome/browser/tracing/crash_service_uploader.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/tracing/crash_service_uploader.cc b/chrome/browser/tracing/crash_service_uploader.cc
--- a/chrome/browser/tracing/crash_service_uploader.cc
+++ b/chrome/browser/tracing/crash_service_uploader.cc
@@ -126,14 +126,16 @@ void TraceCrashServiceUploader::DoUpload(
UploadDoneCallback done_callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- progress_callback_ = progress_callback;
+ std::move(done_callback).Run(false, "crash uploads are disabled");
+
+/* progress_callback_ = progress_callback;
done_callback_ = std::move(done_callback);
base::ThreadPool::PostTask(
FROM_HERE, {base::TaskPriority::BEST_EFFORT},
base::BindOnce(&TraceCrashServiceUploader::DoCompressOnBackgroundThread,
base::Unretained(this), file_contents, upload_mode,
- upload_url_, std::move(metadata)));
+ upload_url_, std::move(metadata)));*/
}
void TraceCrashServiceUploader::DoCompressOnBackgroundThread(
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 28 Oct 2018 14:11:50 +0100
Subject: Offer builtin autocomplete for chrome://flags
---
.../browser/autocomplete/chrome_autocomplete_provider_client.cc | 2 ++
1 file changed, 2 insertions(+)
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
@@ -243,6 +243,8 @@ std::vector<base::string16> ChromeAutocompleteProviderClient::GetBuiltinURLs() {
std::vector<base::string16>
ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
std::vector<base::string16> builtins_to_provide;
+ builtins_to_provide.push_back(
+ base::ASCIIToUTF16(chrome::kChromeUIFlagsURL));
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL));
#if !defined(OS_ANDROID)
--
2.17.1
@@ -1,36 +0,0 @@
From: AlexeyBarabash <alexey@brave.com>
Date: Thu, 11 Jan 2018 13:27:34 +0200
Subject: Open YouTube links in Bromite
---
.../external_intents/ExternalNavigationHandler.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
--- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
+++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
@@ -493,6 +493,7 @@ public class ExternalNavigationHandler {
startActivity(intent, false, mDelegate);
return OverrideUrlLoadingResult.OVERRIDE_WITH_EXTERNAL_INTENT;
}
+
}
private static void loadUrlWithReferrer(
@@ -1060,6 +1061,13 @@ public class ExternalNavigationHandler {
return OverrideUrlLoadingResult.OVERRIDE_WITH_ASYNC_ACTION;
}
+ // force to open YouTube urls in Bromite
+ String intentPackageName = targetIntent.getPackage();
+ if (intentPackageName != null && intentPackageName.equals("com.google.android.youtube")) {
+ if (DEBUG) Log.i(TAG, "NO_OVERRIDE: YouTube URL for YouTube app");
+ return OverrideUrlLoadingResult.NO_OVERRIDE;
+ }
+
// This should come after file intents, but before any returns of
// OVERRIDE_WITH_EXTERNAL_INTENT.
if (externalIntentRequestsDisabledForUrl(params)) {
--
2.17.1
@@ -1,93 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 28 Apr 2018 08:30:26 +0200
Subject: Reduce HTTP headers in DoH requests to bare minimum
---
net/base/load_flags_list.h | 9 +++++++++
net/dns/dns_transaction.cc | 2 +-
net/url_request/url_request_http_job.cc | 16 +++++++++++-----
3 files changed, 21 insertions(+), 6 deletions(-)
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
@@ -112,3 +112,12 @@ LOAD_FLAG(RESTRICTED_PREFETCH, 1 << 17)
// is considered privileged, and therefore this flag must only be set from a
// trusted process.
LOAD_FLAG(CAN_USE_RESTRICTED_PREFETCH, 1 << 18)
+
+
+
+
+// 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 << 19)
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
@@ -419,7 +419,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
// Disable secure DNS for any DoH server hostname lookups to avoid deadlock.
request_->SetDisableSecureDns(true);
request_->SetLoadFlags(request_->load_flags() | LOAD_DISABLE_CACHE |
- LOAD_BYPASS_PROXY);
+ LOAD_MINIMAL_HEADERS | LOAD_BYPASS_PROXY);
request_->set_allow_credentials(false);
request_->set_isolation_info(isolation_info);
}
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
@@ -331,6 +331,7 @@ void URLRequestHttpJob::Start() {
// plugin could set a referrer although sending the referrer is inhibited.
request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer);
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
// Our consumer should have made sure that this is a safe referrer (e.g. via
// URLRequestJob::ComputeReferrerForPolicy).
if (referrer.is_valid()) {
@@ -338,11 +339,14 @@ void URLRequestHttpJob::Start() {
request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
referer_value);
}
+ }
+ 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();
@@ -532,10 +536,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
} else {
// 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;
+ }
}
}
@@ -553,7 +559,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
}
}
- 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.17.1
@@ -1,84 +0,0 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 2 Apr 2015 12:44:23 +0200
Subject: Remove EV certificates
The team chose to let EV certificates appear just like normal
certificates. The web of trust is considered a failure in itself, so
do not give users a false sense of extra security with EV certs.
Instead, let them appear just like regular ones.
---
net/cert/ev_root_ca_metadata.cc | 19 ++++++++++++++++++-
net/cert/ev_root_ca_metadata.h | 4 +---
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
--- a/net/cert/ev_root_ca_metadata.cc
+++ b/net/cert/ev_root_ca_metadata.cc
@@ -44,6 +44,16 @@ static const EVMetadata kEvRootCaMetadata[] = {
// AC Camerfirma S.A. Chambers of Commerce Root - 2008
// https://www.camerfirma.com
{
+ // need some dummy thing to make compiler happy, because
+ // arraysize() is implemented as a convoluted template rather than
+ // the traditional sizeof(x)/sizeof(*x)
+ { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } },
+ {
+ "0",
+ }
+ },
+#if 0
{{0x06, 0x3e, 0x4a, 0xfa, 0xc4, 0x91, 0xdf, 0xd3, 0x32, 0xf3, 0x08,
0x9b, 0x85, 0x42, 0xe9, 0x46, 0x17, 0xd8, 0x93, 0xd7, 0xfe, 0x94,
0x4e, 0x10, 0xa7, 0x93, 0x7e, 0xe2, 0x9d, 0x96, 0x93, 0xc0}},
@@ -590,7 +600,9 @@ static const EVMetadata kEvRootCaMetadata[] = {
0xd2, 0x09, 0xb7, 0x37, 0xcb, 0xe2, 0xc1, 0x8c, 0xfb, 0x2c, 0x10,
0xc0, 0xff, 0x0b, 0xcf, 0x0d, 0x32, 0x86, 0xfc, 0x1a, 0xa2}},
{"2.16.840.1.114404.1.1.2.4.1", ""},
- }};
+ }
+#endif
+};
#endif // defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
} // namespace
@@ -779,6 +791,11 @@ bool EVRootCAMetadata::RemoveEVCA(const SHA256HashValue& fingerprint) {
// metadata.
//
+bool EVRootCAMetadata::IsCaBrowserForumEvOid(PolicyOID policy_oid) {
+ LOG(WARNING) << "Not implemented";
+ return false;
+}
+
bool EVRootCAMetadata::IsEVPolicyOID(PolicyOID policy_oid) const {
LOG(WARNING) << "Not implemented";
return false;
diff --git a/net/cert/ev_root_ca_metadata.h b/net/cert/ev_root_ca_metadata.h
--- a/net/cert/ev_root_ca_metadata.h
+++ b/net/cert/ev_root_ca_metadata.h
@@ -20,7 +20,7 @@
defined(OS_FUCHSIA)
// When not defined, the EVRootCAMetadata singleton is a dumb placeholder
// implementation that will fail all EV lookup operations.
-#define PLATFORM_USES_CHROMIUM_EV_METADATA
+//#define PLATFORM_USES_CHROMIUM_EV_METADATA
#endif
namespace base {
@@ -62,12 +62,10 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
bool HasEVPolicyOIDGivenBytes(const SHA256HashValue& fingerprint,
const der::Input& policy_oid) const;
-#if defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
// Returns true if |policy_oid| is for 2.23.140.1.1 (CA/Browser Forum's
// Extended Validation Policy). This is used as a hack by the
// platform-specific CertVerifyProcs when doing EV verification.
static bool IsCaBrowserForumEvOid(PolicyOID policy_oid);
-#endif
// AddEVCA adds an EV CA to the list of known EV CAs with the given policy.
// |policy| is expressed as a string of dotted numbers. It returns true on
--
2.17.1
-210
View File
@@ -1,210 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 3 Nov 2019 08:22:29 +0100
Subject: Remove SMS integration
---
.../browser/sms/SmsUserConsentReceiver.java | 33 ++-----------------
.../browser/sms/SmsVerificationReceiver.java | 30 ++---------------
.../content/browser/sms/Wrappers.java | 14 +-------
3 files changed, 6 insertions(+), 71 deletions(-)
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/SmsUserConsentReceiver.java b/content/public/android/java/src/org/chromium/content/browser/sms/SmsUserConsentReceiver.java
--- a/content/public/android/java/src/org/chromium/content/browser/sms/SmsUserConsentReceiver.java
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/SmsUserConsentReceiver.java
@@ -12,11 +12,6 @@ import android.content.IntentFilter;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.auth.api.phone.SmsRetriever;
-import com.google.android.gms.common.api.CommonStatusCodes;
-import com.google.android.gms.common.api.Status;
-import com.google.android.gms.tasks.Task;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative;
@@ -45,18 +40,6 @@ public class SmsUserConsentReceiver extends BroadcastReceiver {
mSmsProviderAndroid = smsProviderAndroid;
mContext = new Wrappers.SmsReceiverContext(ContextUtils.getApplicationContext());
-
- // A broadcast receiver is registered upon the creation of this class
- // which happens when the SMS Retriever API is used for the first time
- // since chrome last restarted (which, on android, happens frequently).
- // The broadcast receiver is fairly lightweight (e.g. it responds
- // quickly without much computation).
- // If this broadcast receiver becomes more heavyweight, we should make
- // this registration expire after the SMS message is received.
- if (DEBUG) Log.d(TAG, "Registering intent filters.");
- IntentFilter filter = new IntentFilter();
- filter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
- mContext.registerReceiver(this, filter);
}
@CalledByNative
@@ -69,7 +52,6 @@ public class SmsUserConsentReceiver extends BroadcastReceiver {
private void destroy() {
if (DEBUG) Log.d(TAG, "Destroying SmsUserConsentReceiver.");
mDestroyed = true;
- mContext.unregisterReceiver(this);
}
@Override
@@ -82,7 +64,7 @@ public class SmsUserConsentReceiver extends BroadcastReceiver {
return;
}
- if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
+ /*if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
return;
}
@@ -114,28 +96,19 @@ public class SmsUserConsentReceiver extends BroadcastReceiver {
if (DEBUG) Log.d(TAG, "Timeout");
SmsUserConsentReceiverJni.get().onTimeout(mSmsProviderAndroid);
break;
- }
+ }*/
}
void onConsentResult(int resultCode, Intent data) {
- if (resultCode == Activity.RESULT_OK) {
- String message = data.getStringExtra(SmsRetriever.EXTRA_SMS_MESSAGE);
- SmsUserConsentReceiverJni.get().onReceive(mSmsProviderAndroid, message);
- } else if (resultCode == Activity.RESULT_CANCELED) {
- if (DEBUG) Log.d(TAG, "Activity result cancelled.");
- }
+ Log.d(TAG, "Activity result discarded.");
}
@CalledByNative
private void listen(WindowAndroid windowAndroid) {
mWindowAndroid = windowAndroid;
- Task<Void> task = getClient().startSmsUserConsent(null);
- if (DEBUG) Log.d(TAG, "Installed task");
}
private Wrappers.SmsRetrieverClientWrapper getClient() {
- if (mClient != null) return mClient;
- mClient = new Wrappers.SmsRetrieverClientWrapper(SmsRetriever.getClient(mContext));
return mClient;
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/SmsVerificationReceiver.java b/content/public/android/java/src/org/chromium/content/browser/sms/SmsVerificationReceiver.java
--- a/content/public/android/java/src/org/chromium/content/browser/sms/SmsVerificationReceiver.java
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/SmsVerificationReceiver.java
@@ -11,11 +11,6 @@ import android.content.IntentFilter;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.auth.api.phone.SmsRetriever;
-import com.google.android.gms.common.api.CommonStatusCodes;
-import com.google.android.gms.common.api.Status;
-import com.google.android.gms.tasks.Task;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative;
@@ -42,18 +37,6 @@ public class SmsVerificationReceiver extends BroadcastReceiver {
mSmsProviderAndroid = smsProviderAndroid;
mContext = new Wrappers.SmsReceiverContext(ContextUtils.getApplicationContext());
-
- // A broadcast receiver is registered upon the creation of this class
- // which happens when the SMS Retriever API is used for the first time
- // since chrome last restarted (which, on android, happens frequently).
- // The broadcast receiver is fairly lightweight (e.g. it responds
- // quickly without much computation).
- // If this broadcast receiver becomes more heavyweight, we should make
- // this registration expire after the SMS message is received.
- if (DEBUG) Log.d(TAG, "Registering intent filters.");
- IntentFilter filter = new IntentFilter();
- filter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
- mContext.registerReceiver(this, filter);
}
@CalledByNative
@@ -66,7 +49,6 @@ public class SmsVerificationReceiver extends BroadcastReceiver {
private void destroy() {
if (DEBUG) Log.d(TAG, "Destroying SmsVerificationReceiver.");
mDestroyed = true;
- mContext.unregisterReceiver(this);
}
@Override
@@ -77,7 +59,7 @@ public class SmsVerificationReceiver extends BroadcastReceiver {
return;
}
- if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
+/* if (!SmsRetriever.SMS_RETRIEVED_ACTION.equals(intent.getAction())) {
return;
}
@@ -104,22 +86,14 @@ public class SmsVerificationReceiver extends BroadcastReceiver {
if (DEBUG) Log.d(TAG, "Timeout");
SmsVerificationReceiverJni.get().onTimeout(mSmsProviderAndroid);
break;
- }
+ }*/
}
@CalledByNative
private void listen() {
- Wrappers.SmsRetrieverClientWrapper client = getClient();
- Task<Void> task = client.startSmsRetriever();
-
- if (DEBUG) Log.d(TAG, "Installed task");
}
private Wrappers.SmsRetrieverClientWrapper getClient() {
- if (mClient != null) {
- return mClient;
- }
- mClient = new Wrappers.SmsRetrieverClientWrapper(SmsRetriever.getClient(mContext));
return mClient;
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
--- a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
@@ -10,9 +10,6 @@ import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
-import com.google.android.gms.tasks.Task;
-
class Wrappers {
// Prevent instantiation.
private Wrappers() {}
@@ -21,11 +18,9 @@ class Wrappers {
* Wraps com.google.android.gms.auth.api.phone.SmsRetrieverClient.
*/
static class SmsRetrieverClientWrapper {
- private final SmsRetrieverClient mSmsRetrieverClient;
private SmsReceiverContext mContext;
- public SmsRetrieverClientWrapper(SmsRetrieverClient smsRetrieverClient) {
- mSmsRetrieverClient = smsRetrieverClient;
+ public SmsRetrieverClientWrapper() {
}
public void setContext(SmsReceiverContext context) {
@@ -36,13 +31,6 @@ class Wrappers {
return mContext;
}
- public Task<Void> startSmsRetriever() {
- return mSmsRetrieverClient.startSmsRetriever();
- }
-
- public Task<Void> startSmsUserConsent(String senderAddress) {
- return mSmsRetrieverClient.startSmsUserConsent(senderAddress);
- }
}
/**
--
2.17.1

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