Compare commits
81
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac44ac738f | ||
|
|
02fad5a01f | ||
|
|
b1c0e45b66 | ||
|
|
1397b5e86a | ||
|
|
171c2f224a | ||
|
|
628ddf9b60 | ||
|
|
8c3fcd08de | ||
|
|
375ac9bf8b | ||
|
|
e1b9f9d68a | ||
|
|
7f7fc80c7a | ||
|
|
aa96e7ce43 | ||
|
|
5c9d69ebcc | ||
|
|
7469dbed21 | ||
|
|
bc1f0b79f5 | ||
|
|
4c2225259f | ||
|
|
2ba0013cc6 | ||
|
|
b92ce6a3a2 | ||
|
|
de80f36496 | ||
|
|
ae8dce366b | ||
|
|
750cafb50c | ||
|
|
5cd90e8326 | ||
|
|
664cd20825 | ||
|
|
aeb31bb4c5 | ||
|
|
87eb08c088 | ||
|
|
e64cbbd005 | ||
|
|
4829eef707 | ||
|
|
32978e4658 | ||
|
|
f109246e47 | ||
|
|
b1bc96bbd9 | ||
|
|
e3176b1868 | ||
|
|
22dae5bff8 | ||
|
|
f21bb8a1d4 | ||
|
|
3624b67e98 | ||
|
|
eb4cbebe2a | ||
|
|
3de200030f | ||
|
|
b35c5b2f0d | ||
|
|
3cf1a58964 | ||
|
|
ef1fa37452 | ||
|
|
7cb31f2c7a | ||
|
|
252be1a850 | ||
|
|
4cef551b01 | ||
|
|
dbc43b5c36 | ||
|
|
92aba62fdf | ||
|
|
d8db805929 | ||
|
|
9ea0219fce | ||
|
|
776d4f859e | ||
|
|
7b7a1a4c75 | ||
|
|
ac218f929b | ||
|
|
efe90584df | ||
|
|
1917072116 | ||
|
|
980053e78f | ||
|
|
ffa2849e2f | ||
|
|
0e797ac643 | ||
|
|
fc14caf48a | ||
|
|
494b396f9e | ||
|
|
f007778846 | ||
|
|
b37f2f7b85 | ||
|
|
10661f0b36 | ||
|
|
ff372ffe53 | ||
|
|
c33f289a21 | ||
|
|
d9a4d2dc88 | ||
|
|
6e86d3db21 | ||
|
|
b11d180a37 | ||
|
|
032d2ef9f2 | ||
|
|
1951b38c64 | ||
|
|
41c5c0f0cf | ||
|
|
d0bab4a8da | ||
|
|
ef0cca39ce | ||
|
|
d94f36a0f7 | ||
|
|
3b1875efed | ||
|
|
acba336f2e | ||
|
|
61b6f9ee1d | ||
|
|
210a14d7ed | ||
|
|
91cc88eb37 | ||
|
|
4fc10e560b | ||
|
|
01ecc5d52f | ||
|
|
7edcab0232 | ||
|
|
b4ada5bd99 | ||
|
|
cfa7aca62a | ||
|
|
9eca1ff0b3 | ||
|
|
aac51e0a5a |
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a Bromite bug report
|
||||
|
||||
---
|
||||
|
||||
**Bromite version**
|
||||
|
||||
Version: `69.0...`
|
||||
Arch: `arm` or `arm64` or `x86`
|
||||
Android version: ... (example: `lollipop`)
|
||||
|
||||
**Is the bug reproducible with latest version?**
|
||||
`Bug must be reproducible with latest version`
|
||||
|
||||
**Can the bug be reproduced with corresponding [Chromium](https://github.com/bromite/chromium/releases) version?**
|
||||
`Bug must NOT be reproducible with Chromium to be qualified as a Bromite bug`
|
||||
If yes then report it upstream on [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first; all Chromium issues reported here will be closed as `invalid`.
|
||||
|
||||
**Is the bug a crash?**
|
||||
If yes then individuate and post the logcat dump (remove privacy sensitive information, if any), otherwise remove this section.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a privacy-related idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to privacy?**
|
||||
Features that are not related to privacy are unlikely to be considered.
|
||||
|
||||
**Is there a patch available for this feature somewhere?**
|
||||
...
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you have considered.
|
||||
+163
-23
@@ -1,67 +1,215 @@
|
||||
# 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
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.196
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.188
|
||||
* updated AdBlock filters
|
||||
* increase max (persistent) connections per server from 6 to 15
|
||||
* preliminary work for better canvas fingerprinting mitigations
|
||||
|
||||
# 66.0.3359.161
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.148
|
||||
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
|
||||
* updated AdBlock filters
|
||||
* reduce randomisation for client rects from 5% to 3%
|
||||
* 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)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.218
|
||||
* always set WideVine version
|
||||
* updated AdBlock filters
|
||||
|
||||
# 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
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.198
|
||||
* re-landed support for third-party AdBlock filters
|
||||
* completed patches cleanup
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.190
|
||||
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.176
|
||||
* block plugins enumeration API
|
||||
* block battery API
|
||||
* remove device name and build id from User Agent
|
||||
* added Qwant search engine
|
||||
* updated AdBlock filters
|
||||
* disable non-working 3rd-party filters support
|
||||
|
||||
# 64.0.3282.204
|
||||
* use H264 NEON optimizations also for arm64
|
||||
* fix build of Stable channel
|
||||
* updated AdBlock filters
|
||||
* started building vanilla Chromium releases as well
|
||||
|
||||
# 64.0.3282.193
|
||||
* updated AdBlock filters
|
||||
* disable reporting
|
||||
|
||||
# 64.0.3282.182
|
||||
* add support for domain-based adblock filters
|
||||
* optimized memory allocation for filters
|
||||
* updated AdBlock filters
|
||||
|
||||
# 64.0.3282.168
|
||||
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
|
||||
@@ -78,20 +226,16 @@
|
||||
* disabled plugin untraceable URLs (ungoogled-chromium)
|
||||
|
||||
# 64.0.3282.149
|
||||
* updated AdBlock filters
|
||||
|
||||
# 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
|
||||
* updated AdBlock filters
|
||||
* more builds for arm64 architecture
|
||||
|
||||
# 63.0.3239.144
|
||||
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 63.0.3239.129
|
||||
* updated AdBlock filters
|
||||
|
||||
# 63.0.3239.122
|
||||
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
|
||||
@@ -104,23 +248,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
|
||||
* updated adBlock filters
|
||||
* 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)
|
||||
* updated adBlock filters
|
||||
|
||||
# 63.0.3239.78
|
||||
* correctly set version and build numbers
|
||||
* updated adBlock filters
|
||||
|
||||
# 63.0.3239.73
|
||||
|
||||
# 63.0.3239.64
|
||||
* updated adblock filters
|
||||
* fixed an issue with incognito new tab
|
||||
* permanent disable for ToS/metrics and unused auto-updates check
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bromite - Take back your browser
|
||||
|
||||
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> [![license][license-image]][license-url]
|
||||
<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" />
|
||||
|
||||
@@ -8,9 +8,7 @@ Bromite is [Chromium](https://www.chromium.org/Home) plus some patches for ad bl
|
||||
|
||||
Bromite is only available for Android v4.1 and above.
|
||||
|
||||
See [open issues](https://github.com/bromite/bromite/issues) for the development in progress.
|
||||
|
||||
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" /> <img src="https://www.bromite.org/bromite_bromite_xda_downloads.svg" alt="downloads on XDA Labs" title="downloads on XDA Labs" />
|
||||
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" />
|
||||
|
||||
# Goals
|
||||
|
||||
@@ -25,7 +23,7 @@ Support development with a donation of 3 EUR: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC7Q6A3UAQPY8)
|
||||
|
||||
BTC donations address: `3MkC3idL61npQSCxL1gceksmRTkNkiCPcG`
|
||||
<a href="bitcoin:3MkC3idL61npQSCxL1gceksmRTkNkiCPcG">BTC donations address</a>: `3MkC3idL61npQSCxL1gceksmRTkNkiCPcG`
|
||||
|
||||
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
|
||||
|
||||
@@ -35,42 +33,99 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
|
||||
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.
|
||||
|
||||
## 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.
|
||||
Additionally, these features would not be privacy-friendly.
|
||||
|
||||
## Does Bromite require root?
|
||||
No.
|
||||
|
||||
## Is Bromite de-googled?
|
||||
|
||||
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
|
||||
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
|
||||
|
||||
## What is the SystemWebView?
|
||||
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
|
||||
|
||||
## How to enable DNS-over-HTTPS?
|
||||
|
||||
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
|
||||
|
||||
## Can you add dark mode/some cool themes?
|
||||
No.
|
||||
Bromite is about adblocking and privacy.
|
||||
Bromite is about privacy and adblocking.
|
||||
|
||||
## Can you add HTTPS everywhere?
|
||||
No.
|
||||
We cannot add add-ons to Bromite (merely some features) and anyway HTTPS everywhere in particular is too invasive to be easily maintained across new releases.
|
||||
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.
|
||||
|
||||
# Features
|
||||
|
||||
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
|
||||
* remove click-tracking and AMP from Google search results
|
||||
* allow videos to play in background
|
||||
* [StartPage](https://startpage.com/) search engine
|
||||
* [DuckDuckGo](https://duckduckgo.com/) search engine
|
||||
* [Qwant](https://www.qwant.com/) search engine
|
||||
* Google search engine English-only with reduced tracking
|
||||
* privacy enhancement patches from Inox patchset, ungoogled-chromium and Iridium projects
|
||||
* webRTC, canvas, audio and other anti-fingerprinting mitigations
|
||||
* remove click-tracking and AMP from search results
|
||||
* DNS-over-HTTPS support via Google, Cloudflare and Quad9 servers
|
||||
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
|
||||
* chrome flags to disable custom intents and clear session on exit
|
||||
* always-incognito mode
|
||||
* completely removed safe browsing and other privacy-unfriendly features
|
||||
* anti-fingerprinting mitigations for canvas, audio, client rects, webGL and sensor APIs
|
||||
* use fixed User-Agent to conceal real model and browser version
|
||||
* 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
|
||||
|
||||
## Features not related to privacy
|
||||
* import/export bookmarks
|
||||
* allow playing videos in background tabs and disable pause on switching tabs
|
||||
* all codecs included (proprietary, open H.264 etc.)
|
||||
* built with official optimizations
|
||||
* built with official speed optimizations
|
||||
|
||||
You can inspect all functionality/privacy changes by reading the patches: https://github.com/bromite/bromite/tree/master/patches
|
||||
|
||||
# Releases
|
||||
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases).
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically select the one apt for your device (or none otherwise).
|
||||
|
||||
Each tag corresponds to a Chromium release tag.
|
||||
Each tag corresponds to a Chromium Stable release tag.
|
||||
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDKs versions 16 and 21
|
||||
Additionally, SystemWebView, Monochrome and the vanilla Chromium builds are provided.
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 16 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
|
||||
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
|
||||
```
|
||||
|
||||
If you prefer an UI-based tool, you might want to look into [GtkHash](https://github.com/tristanheaven/gtkhash).
|
||||
|
||||
You can verify authenticity, e.g. that the author ([csagan5](https://github.com/csagan5)) released the file, by using gpg2:
|
||||
```
|
||||
$ gpg2 --quiet --verify brm_68.0.3440.54.sha256.txt.asc
|
||||
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).
|
||||
|
||||
**NOTE:** releases before v68 did not have published signed hashes files.
|
||||
|
||||
# How to build
|
||||
|
||||
@@ -81,11 +136,13 @@ Please refer to [official Chromium build documentation](https://www.chromium.org
|
||||
# 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
|
||||
* [Iridium project](https://github.com/iridium-browser) for some patches (taken from above ungoogled-chromium)
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (taken from above ungoogled-chromium)
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/browser-android-tabs) for some patches
|
||||
* nochromo for the original adblock patch
|
||||
* AdBlock Plus, uBlock, EasyList and EasyPrivacy for the filters included
|
||||
* [AdBlock Plus](https://adblockplus.org/), [uBlock Origin](https://github.com/uBlockOrigin), [Peter Lowe's adservers list](https://pgl.yoyo.org/adservers/), [EasyList and EasyPrivacy](https://easylist.to/) for the filters included
|
||||
* [Vadim Pleshkov](http://vadimpleshkov.me/) for Bromite's logo
|
||||
|
||||
# License
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v2
|
||||
|
||||
mQENBFphnJwBCAC1qSMaPR5Nq9sEHa9ZePwoGLFafjOBcApz7IYW7dIsQYXVUHlo
|
||||
lbBwwfFUjnnIf/wzZ42ck/QGRKJ18qA9VybWyT8as0Sz26Tmxah31vI7kzlBZCYY
|
||||
/ZER5N3onQFVVVoynYxmep5HdK7enAXOtLBOogbJ/x2Q9ITPuJ+Pv3b4R5E2ui/i
|
||||
hFAruUh+oifPBzh3fjBTTr0uvDqbsnsczQptFghKxYyJiPTblCD51Ou11a3uNt1y
|
||||
PuG1bR5jImgt33T6zjdFac6kQ2Zalxa/URU/FQPiYJ1X2J1jCgdEgRKlK70ha+oN
|
||||
mnVWhFzjecuCw180HCZh1OQho+LPWbtMFyvtABEBAAG0M2NzYWdhbjUgPDMyNjg1
|
||||
Njk2K2NzYWdhbjVAdXNlcnMubm9yZXBseS5naXRodWIuY29tPokBIgQTAQgAFgUC
|
||||
WmGcnAkQZBkKUdhdwMUCGwsCGQEAADpDB/4zlnDg1gToKqtz994jLzUM7PJOPTWa
|
||||
c8xGCj7l8BpGcCOK0fk7fOQ+bDYT0OSHZ1OCR7Gbm6ENu03wNLQ7W9Tr0uf/yDIP
|
||||
mItcFk6nYmMKPnK6bd7QWLMsT9mK6mYb02zt6Ql8D7EsWGxifQVQG85ETObhoSqw
|
||||
EH6zqZvflxJLmN+vh/Orm1ipzEvw7cjvpSloDwypjY6x9MGEE9utFcGySx726gKu
|
||||
Wmz417QZc/TpylCd1p72G9pCqv1Si+y+P9tSEdjWSM6EqEwMr5W+IJ1O6BZQ7A9p
|
||||
0l2FZqYC2WkRDJZqWiYoYltP6z1SEbbVI5rQaaVAesS1Ae8OOR9EmlK8
|
||||
=6Hsd
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
+11038
-1724
File diff suppressed because one or more lines are too long
@@ -1,27 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 22:47:49 +0200
|
||||
Subject: Disable the ad promo system by default
|
||||
|
||||
author: Michael Gilbert <mgilbert@debian.org>
|
||||
bug-debian: http://bugs.debian.org/634101
|
||||
---
|
||||
chrome/browser/ui/app_list/app_list_service.cc | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/ui/app_list/app_list_service.cc b/chrome/browser/ui/app_list/app_list_service.cc
|
||||
--- a/chrome/browser/ui/app_list/app_list_service.cc
|
||||
+++ b/chrome/browser/ui/app_list/app_list_service.cc
|
||||
@@ -142,6 +142,10 @@ void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterIntegerPref(prefs::kAppListEnableMethod,
|
||||
ENABLE_NOT_RECORDED);
|
||||
registry->RegisterInt64Pref(prefs::kAppListEnableTime, 0);
|
||||
+
|
||||
+ // Identifies whether we should show the app launcher promo or not. This
|
||||
+ // becomes false when the user dismisses the promo.
|
||||
+ registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, false);
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ author: Chad Miller <chad.miller@canonical.com>
|
||||
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
|
||||
@@ -100,7 +100,7 @@ void CookieSettings::GetCookieSettings(
|
||||
@@ -50,7 +50,7 @@ void CookieSettings::GetCookieSettings(
|
||||
void CookieSettings::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
@@ -20,5 +20,5 @@ diff --git a/components/content_settings/core/browser/cookie_settings.cc b/compo
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+1
-1
@@ -22,5 +22,5 @@ diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
||||
|
||||
bool ShouldDelayRemoteNTP(const GURL& search_provider_url, Profile* profile) {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Tue, 4 Aug 2015 15:15:53 +0200
|
||||
Subject: battery_status_service: disable more privacy nightmares
|
||||
|
||||
The W3C Battery Status API[1] has quite a laughable statement:
|
||||
|
||||
"The information disclosed has minimal impact on privacy or
|
||||
fingerprinting, and therefore is exposed without permission grants".
|
||||
|
||||
Along comes a paper "The leaking battery, A privacy analysis of the
|
||||
HTML5 Battery Status API."
|
||||
|
||||
Clean up after the W3C and disable the battery status updater which
|
||||
could be used to identity users[2].
|
||||
|
||||
[1] http://www.w3.org/TR/battery-status/
|
||||
[2] https://eprint.iacr.org/2015/616.pdf
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/40
|
||||
---
|
||||
services/device/battery/battery_status_service.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
|
||||
--- a/services/device/battery/battery_status_service.cc
|
||||
+++ b/services/device/battery/battery_status_service.cc
|
||||
@@ -41,6 +41,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
if (!battery_fetcher_)
|
||||
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
|
||||
|
||||
+#if 0
|
||||
if (callback_list_.empty()) {
|
||||
bool success = battery_fetcher_->StartListeningBatteryChange();
|
||||
// On failure pass the default values back.
|
||||
@@ -52,6 +53,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
// Send recent status to the new callback if already available.
|
||||
callback.Run(status_);
|
||||
}
|
||||
+#endif
|
||||
|
||||
return callback_list_.Add(callback);
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+11
-24
@@ -3,25 +3,12 @@ Date: Thu, 22 Mar 2018 22:11:57 +0100
|
||||
Subject: Battery API: return nothing
|
||||
|
||||
---
|
||||
services/device/battery/battery_status_service.cc | 2 +-
|
||||
.../Source/modules/battery/BatteryManager.cpp | 25 ++++------------------
|
||||
2 files changed, 5 insertions(+), 22 deletions(-)
|
||||
.../renderer/modules/battery/battery_manager.cc | 25 ++++------------------
|
||||
1 file changed, 4 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
|
||||
--- a/services/device/battery/battery_status_service.cc
|
||||
+++ b/services/device/battery/battery_status_service.cc
|
||||
@@ -41,7 +41,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
if (!battery_fetcher_)
|
||||
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
|
||||
|
||||
-#if 0
|
||||
+#if !defined(OS_ANDROID)
|
||||
if (callback_list_.empty()) {
|
||||
bool success = battery_fetcher_->StartListeningBatteryChange();
|
||||
// On failure pass the default values back.
|
||||
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
|
||||
--- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
|
||||
diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
--- a/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
+++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
@@ -42,45 +42,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
|
||||
}
|
||||
|
||||
@@ -56,22 +43,22 @@ diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/thir
|
||||
return;
|
||||
}
|
||||
-
|
||||
- Document* document = ToDocument(GetExecutionContext());
|
||||
- Document* document = To<Document>(GetExecutionContext());
|
||||
- DCHECK(document);
|
||||
- if (document->IsContextPaused() || document->IsContextDestroyed())
|
||||
- return;
|
||||
-
|
||||
- if (battery_status_.Charging() != old_status.Charging())
|
||||
- DispatchEvent(Event::Create(EventTypeNames::chargingchange));
|
||||
- DispatchEvent(*Event::Create(EventTypeNames::chargingchange));
|
||||
- if (battery_status_.charging_time() != old_status.charging_time())
|
||||
- DispatchEvent(Event::Create(EventTypeNames::chargingtimechange));
|
||||
- DispatchEvent(*Event::Create(EventTypeNames::chargingtimechange));
|
||||
- if (battery_status_.discharging_time() != old_status.discharging_time())
|
||||
- DispatchEvent(Event::Create(EventTypeNames::dischargingtimechange));
|
||||
- DispatchEvent(*Event::Create(EventTypeNames::dischargingtimechange));
|
||||
- if (battery_status_.Level() != old_status.Level())
|
||||
- DispatchEvent(Event::Create(EventTypeNames::levelchange));
|
||||
- DispatchEvent(*Event::Create(EventTypeNames::levelchange));
|
||||
}
|
||||
|
||||
void BatteryManager::RegisterWithDispatcher() {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 22:57:29 +0200
|
||||
Subject: Disable battery status service
|
||||
|
||||
---
|
||||
services/device/battery/battery_status_service.cc | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
|
||||
--- a/services/device/battery/battery_status_service.cc
|
||||
+++ b/services/device/battery/battery_status_service.cc
|
||||
@@ -41,6 +41,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
if (!battery_fetcher_)
|
||||
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
|
||||
|
||||
+#if 0
|
||||
if (callback_list_.empty()) {
|
||||
bool success = battery_fetcher_->StartListeningBatteryChange();
|
||||
// On failure pass the default values back.
|
||||
@@ -52,6 +53,10 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
// Send recent status to the new callback if already available.
|
||||
callback.Run(status_);
|
||||
}
|
||||
+#else
|
||||
+ // Always pass the default values.
|
||||
+ callback.Run(BatteryStatus());
|
||||
+#endif
|
||||
|
||||
return callback_list_.Add(callback);
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 22:58:52 +0200
|
||||
Subject: Disable GCM status check
|
||||
|
||||
---
|
||||
components/gcm_driver/gcm_channel_status_request.cc | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/components/gcm_driver/gcm_channel_status_request.cc b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
--- a/components/gcm_driver/gcm_channel_status_request.cc
|
||||
+++ b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
@@ -23,8 +23,10 @@ namespace gcm {
|
||||
|
||||
namespace {
|
||||
|
||||
+#if 0
|
||||
const char kRequestContentType[] = "application/octet-stream";
|
||||
const char kGCMChannelTag[] = "gcm_channel";
|
||||
+#endif
|
||||
const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes.
|
||||
const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes.
|
||||
|
||||
@@ -57,6 +59,7 @@ int GCMChannelStatusRequest::min_poll_interval_seconds() {
|
||||
}
|
||||
|
||||
void GCMChannelStatusRequest::Start() {
|
||||
+#if 0
|
||||
DCHECK(!url_fetcher_.get());
|
||||
|
||||
GURL request_url(channel_status_request_url_);
|
||||
@@ -112,6 +115,9 @@ void GCMChannelStatusRequest::Start() {
|
||||
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
|
||||
net::LOAD_DO_NOT_SAVE_COOKIES);
|
||||
url_fetcher_->Start();
|
||||
+#endif
|
||||
+ // Simulate an empty response and disable GCM.
|
||||
+ callback_.Run(false, false, 0);
|
||||
}
|
||||
|
||||
void GCMChannelStatusRequest::OnURLFetchComplete(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Mon, 1 Jun 2015 17:14:34 +0200
|
||||
Subject: google-cloud-messaging: disable experiment status check
|
||||
|
||||
This avoids trk:263 from triggering.
|
||||
---
|
||||
components/gcm_driver/gcm_channel_status_request.cc | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/components/gcm_driver/gcm_channel_status_request.cc b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
--- a/components/gcm_driver/gcm_channel_status_request.cc
|
||||
+++ b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
@@ -24,8 +24,10 @@ namespace gcm {
|
||||
|
||||
namespace {
|
||||
|
||||
+#if 0
|
||||
const char kRequestContentType[] = "application/octet-stream";
|
||||
const char kGCMChannelTag[] = "gcm_channel";
|
||||
+#endif
|
||||
const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes.
|
||||
const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes.
|
||||
|
||||
@@ -58,6 +60,7 @@ int GCMChannelStatusRequest::min_poll_interval_seconds() {
|
||||
|
||||
void GCMChannelStatusRequest::Start() {
|
||||
// url_loader_factory_ can be null for tests.
|
||||
+#if 0
|
||||
if (!url_loader_factory_)
|
||||
return;
|
||||
|
||||
@@ -113,6 +116,9 @@ void GCMChannelStatusRequest::Start() {
|
||||
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
|
||||
resource_request->method = "POST";
|
||||
resource_request->headers.SetHeader(net::HttpRequestHeaders::kUserAgent,
|
||||
+#endif
|
||||
+ // Simulate an empty response and disable GCM.
|
||||
+ callback_.Run(false, false, 0);
|
||||
user_agent_);
|
||||
// TODO(https://crbug.com/808498): Re-add data use measurement once
|
||||
// SimpleURLLoader supports it.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 01:35:53 +0200
|
||||
Subject: Disable updater pings
|
||||
|
||||
---
|
||||
components/component_updater/configurator_impl.cc | 21 +++------------------
|
||||
components/component_updater/configurator_impl.h | 1 -
|
||||
2 files changed, 3 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
|
||||
--- a/components/component_updater/configurator_impl.cc
|
||||
+++ b/components/component_updater/configurator_impl.cc
|
||||
@@ -56,8 +56,10 @@ const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
|
||||
const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads";
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
+#if 0
|
||||
const base::Feature kAlternateComponentUrls{"AlternateComponentUrls",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+#endif
|
||||
|
||||
// If there is an element of |vec| of the form |test|=.*, returns the right-
|
||||
// hand side of that assignment. Otherwise, returns an empty string.
|
||||
@@ -86,8 +88,7 @@ ConfiguratorImpl::ConfiguratorImpl(const base::CommandLine* cmdline,
|
||||
: fast_update_(false),
|
||||
pings_enabled_(false),
|
||||
deltas_enabled_(false),
|
||||
- background_downloads_enabled_(false),
|
||||
- require_encryption_(require_encryption) {
|
||||
+ background_downloads_enabled_(false) {
|
||||
// Parse comma-delimited debug flags.
|
||||
std::vector<std::string> switch_values = base::SplitString(
|
||||
cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",",
|
||||
@@ -135,22 +136,6 @@ int ConfiguratorImpl::UpdateDelay() const {
|
||||
|
||||
std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
|
||||
std::vector<GURL> urls;
|
||||
- if (url_source_override_.is_valid()) {
|
||||
- urls.push_back(GURL(url_source_override_));
|
||||
- return urls;
|
||||
- }
|
||||
-
|
||||
- if (base::FeatureList::IsEnabled(kAlternateComponentUrls)) {
|
||||
- urls.push_back(GURL(kUpdaterDefaultUrlAlt));
|
||||
- urls.push_back(GURL(kUpdaterFallbackUrlAlt));
|
||||
- } else {
|
||||
- urls.push_back(GURL(kUpdaterDefaultUrl));
|
||||
- urls.push_back(GURL(kUpdaterFallbackUrl));
|
||||
- }
|
||||
-
|
||||
- if (require_encryption_)
|
||||
- update_client::RemoveUnsecureUrls(&urls);
|
||||
-
|
||||
return urls;
|
||||
}
|
||||
|
||||
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
|
||||
--- a/components/component_updater/configurator_impl.h
|
||||
+++ b/components/component_updater/configurator_impl.h
|
||||
@@ -89,7 +89,6 @@ class ConfiguratorImpl {
|
||||
bool pings_enabled_;
|
||||
bool deltas_enabled_;
|
||||
bool background_downloads_enabled_;
|
||||
- bool require_encryption_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ConfiguratorImpl);
|
||||
};
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Tue, 2 Jun 2015 11:01:50 +0200
|
||||
Subject: updater: disable updater pings
|
||||
|
||||
Despite auto-updater being arguably disabled (see previous commit),
|
||||
Chromium would still send background requests. Kill it.
|
||||
(trk:170, trk:171)
|
||||
---
|
||||
components/component_updater/component_updater_url_constants.cc | 4 ++--
|
||||
components/component_updater/configurator_impl.cc | 5 +----
|
||||
components/component_updater/configurator_impl.h | 1 -
|
||||
3 files changed, 3 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/components/component_updater/component_updater_url_constants.cc b/components/component_updater/component_updater_url_constants.cc
|
||||
--- a/components/component_updater/component_updater_url_constants.cc
|
||||
+++ b/components/component_updater/component_updater_url_constants.cc
|
||||
@@ -15,9 +15,9 @@ namespace component_updater {
|
||||
// The value of |kDefaultUrlSource| can be overridden with
|
||||
// --component-updater=url-source=someurl.
|
||||
const char kUpdaterDefaultUrl[] =
|
||||
- "https://update.googleapis.com/service/update2";
|
||||
+ "about:blank";
|
||||
|
||||
const char kUpdaterFallbackUrl[] =
|
||||
- "http://update.googleapis.com/service/update2";
|
||||
+ "about:blank";
|
||||
|
||||
} // namespace component_updater
|
||||
diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
|
||||
--- a/components/component_updater/configurator_impl.cc
|
||||
+++ b/components/component_updater/configurator_impl.cc
|
||||
@@ -39,8 +39,7 @@ ConfiguratorImpl::ConfiguratorImpl(
|
||||
: background_downloads_enabled_(config_policy.BackgroundDownloadsEnabled()),
|
||||
deltas_enabled_(config_policy.DeltaUpdatesEnabled()),
|
||||
fast_update_(config_policy.FastUpdate()),
|
||||
- pings_enabled_(config_policy.PingsEnabled()),
|
||||
- require_encryption_(require_encryption),
|
||||
+ pings_enabled_(false),
|
||||
url_source_override_(config_policy.UrlSourceOverride()),
|
||||
initial_delay_(config_policy.InitialDelay()) {
|
||||
if (config_policy.TestRequest())
|
||||
@@ -73,8 +72,6 @@ std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
|
||||
}
|
||||
|
||||
std::vector<GURL> urls{GURL(kUpdaterDefaultUrl), GURL(kUpdaterFallbackUrl)};
|
||||
- if (require_encryption_)
|
||||
- update_client::RemoveUnsecureUrls(&urls);
|
||||
|
||||
return urls;
|
||||
}
|
||||
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
|
||||
--- a/components/component_updater/configurator_impl.h
|
||||
+++ b/components/component_updater/configurator_impl.h
|
||||
@@ -95,7 +95,6 @@ class ConfiguratorImpl {
|
||||
const bool deltas_enabled_;
|
||||
const bool fast_update_;
|
||||
const bool pings_enabled_;
|
||||
- const bool require_encryption_;
|
||||
const GURL url_source_override_;
|
||||
const int initial_delay_;
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sat, 13 Sep 2014 17:25:47 +0200
|
||||
Subject: prefs: only keep cookies until exit
|
||||
|
||||
Out with all those tracking cookies!
|
||||
|
||||
author: Jan Engelhardt <jengelh@inai.de>
|
||||
---
|
||||
components/content_settings/core/browser/content_settings_registry.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
@@ -12,7 +10,7 @@ author: Jan Engelhardt <jengelh@inai.de>
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -117,7 +117,7 @@ void ContentSettingsRegistry::Init() {
|
||||
@@ -118,7 +118,7 @@ void ContentSettingsRegistry::Init() {
|
||||
// WARNING: The string names of the permissions passed in below are used to
|
||||
// generate preference names and should never be changed!
|
||||
|
||||
@@ -22,5 +20,5 @@ diff --git a/components/content_settings/core/browser/content_settings_registry.
|
||||
WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme),
|
||||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 2 Apr 2015 12:44:23 +0200
|
||||
Subject: Remove EV certificates
|
||||
|
||||
@@ -6,8 +6,6 @@ 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.
|
||||
|
||||
author: Jan Engelhardt <jengelh@inai.de>
|
||||
---
|
||||
net/cert/ev_root_ca_metadata.cc | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
@@ -16,9 +14,9 @@ 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
|
||||
@@ -46,6 +46,16 @@ struct EVMetadata {
|
||||
base::StringPiece policy_oids[kMaxOIDsPerCA];
|
||||
};
|
||||
|
||||
// These certificates may be found in net/data/ssl/ev_roots.
|
||||
static const EVMetadata ev_root_ca_metadata[] = {
|
||||
+ // need some dummy thing to make compiler happy, because
|
||||
+ // arraysize() is implemented as a convoluted template rather than
|
||||
+ // the traditional sizeof(x)/sizeof(*x)
|
||||
@@ -29,10 +27,10 @@ diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
|
||||
+ }
|
||||
+ },
|
||||
+#if 0
|
||||
// These certificates may be found in net/data/ssl/ev_roots.
|
||||
static const EVMetadata kEvRootCaMetadata[] = {
|
||||
// AC Camerfirma S.A. Chambers of Commerce Root - 2008
|
||||
// https://www.camerfirma.com
|
||||
{
|
||||
@@ -748,7 +758,9 @@ static const EVMetadata ev_root_ca_metadata[] = {
|
||||
@@ -750,7 +760,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", ""},
|
||||
@@ -42,7 +40,7 @@ diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
|
||||
+};
|
||||
|
||||
#endif // defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
|
||||
} // namespace
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sun, 9 Nov 2014 01:54:27 +0100
|
||||
Subject: promo: disable Google promotion fetching
|
||||
|
||||
@@ -15,8 +15,6 @@ Whatever it is that it downloads, deactivate the one that leads to
|
||||
Google.
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/33
|
||||
|
||||
author: Jan Engelhardt <jengelh@inai.de>
|
||||
---
|
||||
chrome/browser/signin/signin_promo.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
@@ -24,7 +22,7 @@ author: Jan Engelhardt <jengelh@inai.de>
|
||||
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
|
||||
--- a/chrome/browser/signin/signin_promo.cc
|
||||
+++ b/chrome/browser/signin/signin_promo.cc
|
||||
@@ -130,6 +130,7 @@ namespace signin {
|
||||
@@ -130,6 +130,7 @@ const char kSigninPromoLandingURLSuccessPage[] = "success.html";
|
||||
|
||||
bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile) {
|
||||
DCHECK(profile);
|
||||
@@ -33,5 +31,5 @@ diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signi
|
||||
// Don't show if the profile is an incognito.
|
||||
if (profile->IsOffTheRecord())
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Disable all omissions (already shadowed by first flag)
|
||||
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
|
||||
@@ -402,12 +402,12 @@ bool IDNToUnicodeOneComponent(const base::char16* comp,
|
||||
@@ -410,12 +410,12 @@ IDNConversionStatus IDNToUnicodeOneComponent(const base::char16* comp,
|
||||
} // namespace
|
||||
|
||||
const FormatUrlType kFormatUrlOmitNothing = 0;
|
||||
@@ -26,9 +26,9 @@ diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatte
|
||||
+const FormatUrlType kFormatUrlOmitHTTPS = 0 << 3;
|
||||
+const FormatUrlType kFormatUrlExperimentalElideAfterHost = 0 << 4;
|
||||
+const FormatUrlType kFormatUrlOmitTrivialSubdomains = 0 << 5;
|
||||
const FormatUrlType kFormatUrlTrimAfterHost = 1 << 6;
|
||||
|
||||
const FormatUrlType kFormatUrlOmitDefaults =
|
||||
kFormatUrlOmitUsernamePassword | kFormatUrlOmitHTTP |
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ Subject: Modify default preferences
|
||||
---
|
||||
chrome/browser/background/background_mode_manager.cc | 2 +-
|
||||
chrome/browser/chrome_content_browser_client.cc | 2 +-
|
||||
chrome/browser/io_thread.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.h | 2 +-
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
@@ -15,16 +14,17 @@ Subject: Modify default preferences
|
||||
chrome/browser/ui/navigation_correction_tab_observer.cc | 2 +-
|
||||
chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc | 4 ----
|
||||
chrome/service/cloud_print/connector_settings.cc | 2 +-
|
||||
components/autofill/core/browser/autofill_manager.cc | 2 +-
|
||||
components/autofill/core/browser/autofill_manager.cc | 5 +----
|
||||
components/autofill/core/common/autofill_prefs.cc | 6 +++---
|
||||
components/bookmarks/browser/bookmark_utils.cc | 4 ++--
|
||||
components/safe_browsing/common/safe_browsing_prefs.cc | 4 ++--
|
||||
extensions/common/extension.cc | 8 --------
|
||||
16 files changed, 18 insertions(+), 30 deletions(-)
|
||||
16 files changed, 20 insertions(+), 35 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
|
||||
@@ -363,7 +363,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
@@ -351,7 +351,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
|
||||
registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
|
||||
#endif
|
||||
@@ -36,7 +36,7 @@ diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/brows
|
||||
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
|
||||
@@ -880,7 +880,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
|
||||
@@ -1055,7 +1055,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
|
||||
void ChromeContentBrowserClient::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
|
||||
@@ -45,18 +45,6 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch
|
||||
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/io_thread.cc b/chrome/browser/io_thread.cc
|
||||
--- a/chrome/browser/io_thread.cc
|
||||
+++ b/chrome/browser/io_thread.cc
|
||||
@@ -642,7 +642,7 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
std::string());
|
||||
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
|
||||
data_reduction_proxy::RegisterPrefs(registry);
|
||||
- registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false);
|
||||
registry->RegisterListPref(prefs::kDnsOverHttpsServers);
|
||||
registry->RegisterListPref(prefs::kDnsOverHttpsServerMethods);
|
||||
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
|
||||
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
|
||||
@@ -84,7 +72,7 @@ diff --git a/chrome/browser/net/prediction_options.h b/chrome/browser/net/predic
|
||||
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
|
||||
@@ -138,7 +138,7 @@ const char Profile::kNoHostedDomainFound[] = "NO_HOSTED_DOMAIN";
|
||||
@@ -138,7 +138,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
|
||||
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kSearchSuggestEnabled,
|
||||
@@ -100,15 +88,15 @@ diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.h
|
||||
</paper-button>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
- <paper-checkbox id="sendSettings" checked>
|
||||
+ <paper-checkbox id="sendSettings">
|
||||
$i18nRaw{resetPageFeedback}</paper-checkbox>
|
||||
- <cr-checkbox id="sendSettings" checked>
|
||||
+ <cr-checkbox id="sendSettings">
|
||||
$i18nRaw{resetPageFeedback}</cr-checkbox>
|
||||
</div>
|
||||
</dialog>
|
||||
</cr-dialog>
|
||||
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
|
||||
--- a/chrome/browser/signin/signin_promo.cc
|
||||
+++ b/chrome/browser/signin/signin_promo.cc
|
||||
@@ -384,8 +384,8 @@ void ForceWebBasedSigninFlowForTesting(bool force) {
|
||||
@@ -353,8 +353,8 @@ void ForceWebBasedSigninFlowForTesting(bool force) {
|
||||
void RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterIntegerPref(prefs::kSignInPromoStartupCount, 0);
|
||||
@@ -122,7 +110,7 @@ diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signi
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -65,11 +65,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
@@ -68,11 +68,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
|
||||
registry->RegisterBooleanPref(
|
||||
@@ -133,13 +121,13 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u
|
||||
registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
|
||||
- registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false);
|
||||
registry->RegisterBooleanPref(prefs::kDevToolsDisabled, 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
|
||||
@@ -58,7 +58,7 @@ NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {
|
||||
@@ -56,7 +56,7 @@ NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {
|
||||
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* prefs) {
|
||||
prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled,
|
||||
@@ -151,7 +139,7 @@ diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/br
|
||||
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
|
||||
@@ -143,10 +143,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
|
||||
@@ -127,10 +127,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kLocalDiscoveryNotificationsEnabled,
|
||||
@@ -177,19 +165,47 @@ diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/c
|
||||
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
|
||||
@@ -215,7 +215,7 @@ void AutofillManager::RegisterProfilePrefs(
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kAutofillCreditCardSigninPromoImpressionCount, 0);
|
||||
@@ -290,10 +290,7 @@ bool AutofillManager::ShouldShowCreditCardSigninPromo(
|
||||
bool AutofillManager::ShouldParseForms(const std::vector<FormData>& forms,
|
||||
const base::TimeTicks timestamp) {
|
||||
bool enabled = IsAutofillEnabled();
|
||||
- if (!has_logged_autofill_enabled_) {
|
||||
- AutofillMetrics::LogIsAutofillEnabledAtPageLoad(enabled);
|
||||
- has_logged_autofill_enabled_ = true;
|
||||
- }
|
||||
+ has_logged_autofill_enabled_ = true;
|
||||
|
||||
return enabled;
|
||||
}
|
||||
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
|
||||
@@ -91,10 +91,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
prefs::kAutofillBillingCustomerNumber, 0.0,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kAutofillEnabled, true,
|
||||
+ prefs::kAutofillEnabled, false,
|
||||
- prefs::kAutofillEnabledDeprecated, true,
|
||||
+ prefs::kAutofillEnabledDeprecated, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kAutofillProfileUseDatesFixed, false,
|
||||
- prefs::kAutofillProfileEnabled, true,
|
||||
+ prefs::kAutofillProfileEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kAutofillLastVersionDeduped, 0,
|
||||
@@ -103,7 +103,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
|
||||
@@ -442,12 +442,12 @@ void GetBookmarksMatchingProperties(BookmarkModel* model,
|
||||
@@ -441,12 +441,12 @@ void GetBookmarksMatchingProperties(BookmarkModel* model,
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowBookmarkBar,
|
||||
@@ -207,7 +223,7 @@ diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmar
|
||||
diff --git a/components/safe_browsing/common/safe_browsing_prefs.cc b/components/safe_browsing/common/safe_browsing_prefs.cc
|
||||
--- a/components/safe_browsing/common/safe_browsing_prefs.cc
|
||||
+++ b/components/safe_browsing/common/safe_browsing_prefs.cc
|
||||
@@ -370,9 +370,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
@@ -229,9 +229,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
|
||||
registry->RegisterBooleanPref(
|
||||
@@ -222,7 +238,7 @@ diff --git a/components/safe_browsing/common/safe_browsing_prefs.cc b/components
|
||||
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
|
||||
--- a/extensions/common/extension.cc
|
||||
+++ b/extensions/common/extension.cc
|
||||
@@ -330,14 +330,6 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
|
||||
@@ -367,14 +367,6 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
|
||||
if (is_theme())
|
||||
return false;
|
||||
|
||||
@@ -238,5 +254,5 @@ diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
|
||||
// show packaged apps and platform apps because there are some pieces of
|
||||
// functionality that are only available in chrome://extensions/ but which
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Jul 2018 11:17:53 +0200
|
||||
Subject: Disable ads metrics by default
|
||||
|
||||
---
|
||||
chrome/common/chrome_features.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -15,7 +15,7 @@ namespace features {
|
||||
// All features in alphabetical order.
|
||||
|
||||
// Enables Ads Metrics.
|
||||
-const base::Feature kAdsFeature{"AdsMetrics", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+const base::Feature kAdsFeature{"AdsMetrics", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
const base::Feature kAllowAutoplayUnmutedInWebappManifestScope{
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ Subject: Do not store passwords by default
|
||||
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
|
||||
@@ -244,10 +244,10 @@ PasswordFormManager* FindMatchedManager(
|
||||
@@ -363,10 +363,10 @@ void RecordParsingOnSavingDifference(
|
||||
void PasswordManager::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
@@ -20,8 +20,8 @@ diff --git a/components/password_manager/core/browser/password_manager.cc b/comp
|
||||
- prefs::kCredentialsEnableAutosignin, true,
|
||||
+ prefs::kCredentialsEnableAutosignin, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kWasObsoleteHttpDataCleaned, false);
|
||||
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
|
||||
PrefRegistry::NO_REGISTRATION_FLAGS);
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+5
-8
@@ -9,8 +9,8 @@ Subject: Disable NTP remote suggestions by default
|
||||
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
|
||||
@@ -41,16 +41,16 @@ const base::Feature kArticleSuggestionsExpandableHeader{
|
||||
"NTPArticleSuggestionsExpandableHeader", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
@@ -35,13 +35,13 @@ const base::Feature* const kAllFeatures[] = {
|
||||
&kRemoteSuggestionsBackendFeature};
|
||||
|
||||
const base::Feature kArticleSuggestionsFeature{
|
||||
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
@@ -20,15 +20,12 @@ diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/featu
|
||||
- "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kRecentOfflineTabSuggestionsFeature{
|
||||
"NTPOfflinePageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kPhysicalWebPageSuggestionsFeature{
|
||||
"NTPPhysicalWebPageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
const base::Feature kForeignSessionsSuggestionsFeature{
|
||||
"NTPForeignSessionsSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+1
-1
@@ -59,5 +59,5 @@ diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/th
|
||||
body,
|
||||
table,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+4
-4
@@ -9,9 +9,9 @@ Subject: Disable WebRTC by default
|
||||
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
|
||||
@@ -84,10 +84,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
@@ -85,10 +85,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
false);
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_WEBRTC)
|
||||
// TODO(guoweis): Remove next 2 options at M50.
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
|
||||
@@ -21,8 +21,8 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u
|
||||
- content::kWebRTCIPHandlingDefault);
|
||||
+ content::kWebRTCIPHandlingDisableNonProxiedUdp);
|
||||
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
||||
#endif
|
||||
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
|
||||
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -11,7 +11,7 @@ Subject: Disable data saver
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
@@ -140,7 +140,6 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa
|
||||
@@ -141,7 +141,6 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa
|
||||
boolean notifyAdapter = false;
|
||||
// An optional Data Saver page.
|
||||
if (mFreProperties.getBoolean(SHOW_DATA_REDUCTION_PAGE)) {
|
||||
@@ -22,7 +22,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstR
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
@@ -149,6 +149,7 @@ public class DataReductionProxySettings {
|
||||
@@ -131,6 +131,7 @@ public class DataReductionProxySettings {
|
||||
// DataReductionProxySettings is a singleton that lives forever and there's no clean
|
||||
// shutdown of Chrome on Android
|
||||
mNativeDataReductionProxySettings = nativeInit();
|
||||
@@ -30,7 +30,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/D
|
||||
}
|
||||
|
||||
/** Returns true if the SPDY proxy promo is allowed to be shown. */
|
||||
@@ -171,6 +172,7 @@ public class DataReductionProxySettings {
|
||||
@@ -153,6 +154,7 @@ public class DataReductionProxySettings {
|
||||
* data reduction statistics if this is the first time the SPDY proxy has been enabled.
|
||||
*/
|
||||
public void setDataReductionProxyEnabled(Context context, boolean enabled) {
|
||||
@@ -51,5 +51,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/dat
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+17
-23
@@ -3,10 +3,10 @@ Date: Sun, 26 Nov 2017 22:51:43 +0100
|
||||
Subject: Skip the first run and metrics
|
||||
|
||||
---
|
||||
.../chrome/browser/firstrun/FirstRunStatus.java | 8 ++++----
|
||||
.../chrome/browser/firstrun/FirstRunUtils.java | 16 ++++++----------
|
||||
.../browser/firstrun/ToSAndUMAFirstRunFragment.java | 18 ++++++------------
|
||||
3 files changed, 16 insertions(+), 26 deletions(-)
|
||||
.../chromium/chrome/browser/firstrun/FirstRunStatus.java | 8 ++++----
|
||||
.../chromium/chrome/browser/firstrun/FirstRunUtils.java | 16 ++++++----------
|
||||
.../browser/firstrun/ToSAndUMAFirstRunFragment.java | 6 ++++--
|
||||
3 files changed, 14 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
@@ -56,33 +56,27 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstR
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
@@ -73,20 +73,14 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
|
||||
@@ -74,7 +74,7 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
|
||||
}
|
||||
});
|
||||
|
||||
- if (ChromeVersionInfo.isOfficialBuild()) {
|
||||
- int paddingStart = getResources().getDimensionPixelSize(
|
||||
- R.dimen.fre_tos_checkbox_padding);
|
||||
- ApiCompatibilityUtils.setPaddingRelative(mSendReportCheckBox,
|
||||
- ApiCompatibilityUtils.getPaddingStart(mSendReportCheckBox) + paddingStart,
|
||||
- mSendReportCheckBox.getPaddingTop(),
|
||||
- ApiCompatibilityUtils.getPaddingEnd(mSendReportCheckBox),
|
||||
- mSendReportCheckBox.getPaddingBottom());
|
||||
-
|
||||
- mSendReportCheckBox.setChecked(FirstRunActivity.DEFAULT_METRICS_AND_CRASH_REPORTING);
|
||||
- } else {
|
||||
- mSendReportCheckBox.setVisibility(View.GONE);
|
||||
+ int paddingStart = getResources().getDimensionPixelSize(R.dimen.fre_tos_checkbox_padding);
|
||||
+ if (paddingStart != 0) {
|
||||
+ mSendReportCheckBox.setChecked(false);
|
||||
}
|
||||
+/* if (ChromeVersionInfo.isOfficialBuild()) {
|
||||
int paddingStart = getResources().getDimensionPixelSize(
|
||||
R.dimen.fre_tos_checkbox_padding);
|
||||
ViewCompat.setPaddingRelative(mSendReportCheckBox,
|
||||
@@ -86,8 +86,10 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
|
||||
mSendReportCheckBox.setChecked(FirstRunActivity.DEFAULT_METRICS_AND_CRASH_REPORTING);
|
||||
} else {
|
||||
mSendReportCheckBox.setVisibility(View.GONE);
|
||||
- }
|
||||
+ }*/
|
||||
|
||||
+ mSendReportCheckBox.setChecked(false);
|
||||
+ mSendReportCheckBox.setVisibility(View.GONE);
|
||||
+
|
||||
mTosAndPrivacy.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
NoUnderlineClickableSpan clickableTermsSpan = new NoUnderlineClickableSpan() {
|
||||
NoUnderlineClickableSpan clickableTermsSpan = new NoUnderlineClickableSpan((view1) -> {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 14:23:07 +0200
|
||||
Subject: Disable signin and data saver preferences
|
||||
|
||||
Never show the data saver promo snackbar
|
||||
---
|
||||
chrome/android/java/res/xml/main_preferences.xml | 9 -----
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 6 ++--
|
||||
.../browser/preferences/MainPreferences.java | 39 +++++++++++-----------
|
||||
3 files changed, 24 insertions(+), 30 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
|
||||
@@ -10,10 +10,6 @@
|
||||
android:key="account_section"
|
||||
android:order="0"
|
||||
android:title="@string/prefs_section_account"/>
|
||||
- <org.chromium.chrome.browser.preferences.SignInPreference
|
||||
- android:key="sign_in"
|
||||
- android:order="1"
|
||||
- android:title="@string/sign_in_to_chrome"/>
|
||||
<org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.SyncAndServicesPreferences"
|
||||
android:key="sync_and_services"
|
||||
@@ -85,11 +81,6 @@
|
||||
android:order="15"
|
||||
android:title="@string/prefs_languages"/>
|
||||
<org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
- android:fragment="org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences"
|
||||
- android:key="data_reduction"
|
||||
- android:order="16"
|
||||
- android:title="@string/data_reduction_title"/>
|
||||
- <org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.download.DownloadPreferences"
|
||||
android:key="downloads"
|
||||
android:order="17"
|
||||
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
|
||||
@@ -118,7 +118,7 @@ import org.chromium.chrome.browser.printing.TabPrinter;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.share.ShareMenuActionHandler;
|
||||
import org.chromium.chrome.browser.snackbar.BottomContainer;
|
||||
-import org.chromium.chrome.browser.snackbar.DataReductionPromoSnackbarController;
|
||||
+//import org.chromium.chrome.browser.snackbar.DataReductionPromoSnackbarController;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable;
|
||||
import org.chromium.chrome.browser.sync.ProfileSyncService;
|
||||
@@ -263,7 +263,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
protected ReaderModeManager mReaderModeManager;
|
||||
private SnackbarManager mSnackbarManager;
|
||||
private ModalDialogManager mModalDialogManager;
|
||||
- private DataReductionPromoSnackbarController mDataReductionPromoSnackbarController;
|
||||
+ //private DataReductionPromoSnackbarController mDataReductionPromoSnackbarController;
|
||||
private AppMenuPropertiesDelegate mAppMenuPropertiesDelegate;
|
||||
private AppMenuHandler mAppMenuHandler;
|
||||
private ToolbarManager mToolbarManager;
|
||||
@@ -666,6 +666,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) {
|
||||
@Override
|
||||
public void didFirstVisuallyNonEmptyPaint(Tab tab) {
|
||||
+/*
|
||||
// Only alert about data savings once the first paint has happened. It
|
||||
// doesn't make sense to show a snackbar about savings when nothing has been
|
||||
// displayed yet.
|
||||
@@ -679,6 +680,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
DataReductionProxySettings.getInstance()
|
||||
.getTotalHttpContentLengthSaved());
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
@@ -17,9 +17,9 @@ import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.contextual_suggestions.ContextualSuggestionsEnabledStateUtils;
|
||||
-import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
+//import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
|
||||
-import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences;
|
||||
+//import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrl;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
||||
import org.chromium.chrome.browser.signin.SigninManager;
|
||||
@@ -34,13 +34,11 @@ import java.util.Map;
|
||||
public class MainPreferences extends PreferenceFragment
|
||||
implements SigninManager.SignInStateObserver, TemplateUrlService.LoadListener {
|
||||
public static final String PREF_ACCOUNT_SECTION = "account_section";
|
||||
- public static final String PREF_SIGN_IN = "sign_in";
|
||||
public static final String PREF_SYNC_AND_SERVICES = "sync_and_services";
|
||||
public static final String PREF_SEARCH_ENGINE = "search_engine";
|
||||
public static final String PREF_SAVED_PASSWORDS = "saved_passwords";
|
||||
public static final String PREF_CONTEXTUAL_SUGGESTIONS = "contextual_suggestions";
|
||||
public static final String PREF_HOMEPAGE = "homepage";
|
||||
- public static final String PREF_DATA_REDUCTION = "data_reduction";
|
||||
public static final String PREF_NOTIFICATIONS = "notifications";
|
||||
public static final String PREF_LANGUAGES = "languages";
|
||||
public static final String PREF_DOWNLOADS = "downloads";
|
||||
@@ -52,7 +50,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
|
||||
private final ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
private final Map<String, Preference> mAllPreferences = new HashMap<>();
|
||||
- private SignInPreference mSignInPreference;
|
||||
|
||||
public MainPreferences() {
|
||||
setHasOptionsMenu(true);
|
||||
@@ -68,25 +65,29 @@ public class MainPreferences extends PreferenceFragment
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
- mSignInPreference.onPreferenceFragmentDestroyed();
|
||||
+ //mSignInPreference.onPreferenceFragmentDestroyed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
+/*
|
||||
if (SigninManager.get().isSigninSupported()) {
|
||||
SigninManager.get().addSignInStateObserver(this);
|
||||
mSignInPreference.registerForUpdates();
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
+/*
|
||||
if (SigninManager.get().isSigninSupported()) {
|
||||
SigninManager.get().removeSignInStateObserver(this);
|
||||
mSignInPreference.unregisterForUpdates();
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,16 +100,16 @@ public class MainPreferences extends PreferenceFragment
|
||||
PreferenceUtils.addPreferencesFromResource(this, R.xml.main_preferences);
|
||||
cachePreferences();
|
||||
|
||||
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)) {
|
||||
+/* if (ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)) {
|
||||
mSignInPreference.setOnStateChangedCallback(this::onSignInPreferenceStateChanged);
|
||||
- } else {
|
||||
+ } else */{
|
||||
getPreferenceScreen().removePreference(findPreference(PREF_ACCOUNT_SECTION));
|
||||
getPreferenceScreen().removePreference(findPreference(PREF_SYNC_AND_SERVICES));
|
||||
}
|
||||
|
||||
setManagedPreferenceDelegateForPreference(PREF_SEARCH_ENGINE);
|
||||
setManagedPreferenceDelegateForPreference(PREF_SAVED_PASSWORDS);
|
||||
- setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
|
||||
+ //setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// If we are on Android O+ the Notifications preference should lead to the Android
|
||||
@@ -164,7 +165,7 @@ public class MainPreferences extends PreferenceFragment
|
||||
Preference preference = getPreferenceScreen().getPreference(index);
|
||||
mAllPreferences.put(preference.getKey(), preference);
|
||||
}
|
||||
- mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
|
||||
+ //mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
|
||||
}
|
||||
|
||||
private void setManagedPreferenceDelegateForPreference(String key) {
|
||||
@@ -173,12 +174,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
}
|
||||
|
||||
private void updatePreferences() {
|
||||
- if (SigninManager.get().isSigninSupported()) {
|
||||
- addPreferenceIfAbsent(PREF_SIGN_IN);
|
||||
- } else {
|
||||
- removePreferenceIfPresent(PREF_SIGN_IN);
|
||||
- }
|
||||
-
|
||||
updateSearchEnginePreference();
|
||||
|
||||
if (HomepageManager.shouldShowHomepageSetting()) {
|
||||
@@ -201,9 +196,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
removePreferenceIfPresent(PREF_CONTEXTUAL_SUGGESTIONS);
|
||||
}
|
||||
|
||||
+/*
|
||||
ChromeBasePreference dataReduction =
|
||||
(ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
|
||||
dataReduction.setSummary(DataReductionPreferences.generateSummary(getResources()));
|
||||
+*/
|
||||
}
|
||||
|
||||
private Preference addPreferenceIfAbsent(String key) {
|
||||
@@ -254,11 +251,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
|
||||
private void onSignInPreferenceStateChanged() {
|
||||
// Remove "Account" section header if the personalized sign-in promo is shown.
|
||||
- if (mSignInPreference.getState() == SignInPreference.State.PERSONALIZED_PROMO) {
|
||||
+// if (mSignInPreference.getState() == SignInPreference.State.PERSONALIZED_PROMO) {
|
||||
removePreferenceIfPresent(PREF_ACCOUNT_SECTION);
|
||||
- } else {
|
||||
+/* } else {
|
||||
addPreferenceIfAbsent(PREF_ACCOUNT_SECTION);
|
||||
- }
|
||||
+ }*/
|
||||
}
|
||||
|
||||
// TemplateUrlService.LoadListener implementation.
|
||||
@@ -280,9 +277,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
if (PREF_SAVED_PASSWORDS.equals(preference.getKey())) {
|
||||
return PrefServiceBridge.getInstance().isRememberPasswordsManaged();
|
||||
}
|
||||
+/*
|
||||
if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
|
||||
return DataReductionProxySettings.getInstance().isDataReductionProxyManaged();
|
||||
}
|
||||
+*/
|
||||
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
|
||||
return TemplateUrlService.getInstance().isDefaultSearchManaged();
|
||||
}
|
||||
@@ -296,11 +295,13 @@ public class MainPreferences extends PreferenceFragment
|
||||
return prefs.isRememberPasswordsManaged()
|
||||
&& !prefs.isRememberPasswordsEnabled();
|
||||
}
|
||||
+/*
|
||||
if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
|
||||
DataReductionProxySettings settings = DataReductionProxySettings.getInstance();
|
||||
return settings.isDataReductionProxyManaged()
|
||||
&& !settings.isDataReductionProxyEnabled();
|
||||
}
|
||||
+*/
|
||||
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
|
||||
return TemplateUrlService.getInstance().isDefaultSearchManaged();
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:09:26 +0200
|
||||
Subject: Disable signin/data reduction promos
|
||||
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -603,7 +603,7 @@ public class ChromeTabbedActivity
|
||||
// TODO(tedchoc): Unify promo dialog logic as the search engine promo dialog checks
|
||||
// might not have completed at this point and we could show multiple
|
||||
// promos.
|
||||
- boolean isShowingPromo = mLocaleManager.hasShownSearchEnginePromoThisSession();
|
||||
+ /*boolean isShowingPromo = mLocaleManager.hasShownSearchEnginePromoThisSession();
|
||||
// Promo dialogs in multiwindow mode are broken on some devices: http://crbug.com/354696
|
||||
boolean isLegacyMultiWindow = MultiWindowUtils.getInstance().isLegacyMultiWindow(this);
|
||||
if (!isShowingPromo && !mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete()
|
||||
@@ -621,7 +621,7 @@ public class ChromeTabbedActivity
|
||||
ChromePreferenceManager.PROMOS_SKIPPED_ON_FIRST_START, true);
|
||||
}
|
||||
|
||||
- if (!isShowingPromo) {
|
||||
+ if (!isShowingPromo) */ {
|
||||
ToolbarButtonInProductHelpController.maybeShowColdStartIPH(this);
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Wed, 22 Mar 2017 19:10:30 -0400
|
||||
Subject: Remove Sync and Translate menu
|
||||
|
||||
---
|
||||
.../java/res/drawable-hdpi/settings_translate.png | Bin 399 -> 0 bytes
|
||||
.../java/res/drawable-mdpi/settings_translate.png | Bin 284 -> 0 bytes
|
||||
.../java/res/drawable-xhdpi/settings_translate.png | Bin 547 -> 0 bytes
|
||||
.../res/drawable-xxhdpi/settings_translate.png | Bin 793 -> 0 bytes
|
||||
.../res/drawable-xxxhdpi/settings_translate.png | Bin 1038 -> 0 bytes
|
||||
.../java/res/xml/site_settings_preferences.xml | 8 ++++----
|
||||
.../website/SiteSettingsPreferences.java | 22 ++-------------------
|
||||
7 files changed, 6 insertions(+), 24 deletions(-)
|
||||
delete mode 100644 chrome/android/java/res/drawable-hdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-mdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xhdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xxhdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xxxhdpi/settings_translate.png
|
||||
|
||||
diff --git a/chrome/android/java/res/drawable-hdpi/settings_translate.png b/chrome/android/java/res/drawable-hdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 8067680e81c6ffa1a003c579411173827a3a9f96..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-mdpi/settings_translate.png b/chrome/android/java/res/drawable-mdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 3b9b4cd482d36a60d4ff0a110b0bcefabe4c1060..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xhdpi/settings_translate.png b/chrome/android/java/res/drawable-xhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 131a57394ca30dcff4bebcb2471bbbf0e1ac134e..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 55878e697b1afed1b4f039a561dc6212e24fc024..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 058b50b84dd216d983e9dea2ea264b39773ac318..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/xml/site_settings_preferences.xml b/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
index d5ae426f7d7b..a01b1144639c 100644
|
||||
--- a/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
@@ -50,9 +50,9 @@
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
android:key="ads" />
|
||||
<!-- Background sync -->
|
||||
- <org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
+ <!-- org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
- android:key="background_sync" />
|
||||
+ android:key="background_sync" /-->
|
||||
<!-- Automatic Downloads -->
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
@@ -77,11 +77,11 @@
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
android:key="sound" />
|
||||
<!-- Google Translate -->
|
||||
- <Preference
|
||||
+ <!-- Preference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.TranslatePreferences"
|
||||
android:key="translate"
|
||||
android:title="@string/google_translate"
|
||||
- android:icon="@drawable/settings_translate" />
|
||||
+ android:icon="@drawable/settings_translate" /-->
|
||||
<!-- Storage -->
|
||||
<!-- TODO(finnur): Move this over to the new Usage screen, once it exists. -->
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
index 95a1c127a28f..e8b87fcefb3f 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
@@ -39,7 +39,6 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
// are defined in the SiteSettingsCategory, additional keys
|
||||
// are listed here.
|
||||
static final String MEDIA_KEY = "media";
|
||||
- static final String TRANSLATE_KEY = "translate";
|
||||
|
||||
// Whether the Protected Content menu is available for display.
|
||||
boolean mProtectedContentMenuAvailable;
|
||||
@@ -83,11 +82,10 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
// The Media sub-menu only contains Protected Content and Autoplay, so remove all other
|
||||
// menus.
|
||||
for (@Type int i = 0; i < Type.NUM_ENTRIES; i++) {
|
||||
- if (i == Type.AUTOPLAY || i == Type.PROTECTED_MEDIA) continue;
|
||||
+ if (i == Type.AUTOPLAY || i == Type.PROTECTED_MEDIA || i == Type.BACKGROUND_SYNC) continue;
|
||||
getPreferenceScreen().removePreference(findPreference(i));
|
||||
}
|
||||
getPreferenceScreen().removePreference(findPreference(MEDIA_KEY));
|
||||
- getPreferenceScreen().removePreference(findPreference(TRANSLATE_KEY));
|
||||
} else {
|
||||
// If both Autoplay and Protected Content menus are available, they'll be tucked under
|
||||
// the Media key. Otherwise, we can remove the Media menu entry.
|
||||
@@ -109,11 +107,6 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CLIPBOARD_CONTENT_SETTING)) {
|
||||
getPreferenceScreen().removePreference(findPreference(Type.CLIPBOARD));
|
||||
}
|
||||
- // The new Languages Preference *feature* is an advanced version of this translate
|
||||
- // preference. Once Languages Preference is enabled, remove this setting.
|
||||
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.LANGUAGES_PREFERENCE)) {
|
||||
- getPreferenceScreen().removePreference(findPreference(TRANSLATE_KEY));
|
||||
- }
|
||||
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.GENERIC_SENSOR_EXTRA_CLASSES)) {
|
||||
getPreferenceScreen().removePreference(findPreference(Type.SENSORS));
|
||||
}
|
||||
@@ -123,10 +116,6 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
private void updatePreferenceStates() {
|
||||
PrefServiceBridge prefServiceBridge = PrefServiceBridge.getInstance();
|
||||
|
||||
- // Translate preference.
|
||||
- Preference translatePref = findPreference(TRANSLATE_KEY);
|
||||
- if (translatePref != null) setTranslateStateSummary(translatePref);
|
||||
-
|
||||
// Preferences that navigate to Website Settings.
|
||||
List<Integer> websitePrefs = new ArrayList<Integer>();
|
||||
if (mMediaSubMenu) {
|
||||
@@ -143,7 +132,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
if (!mProtectedContentMenuAvailable) {
|
||||
websitePrefs.add(Type.AUTOPLAY);
|
||||
}
|
||||
- websitePrefs.add(Type.BACKGROUND_SYNC);
|
||||
+// websitePrefs.add(Type.BACKGROUND_SYNC);
|
||||
websitePrefs.add(Type.CAMERA);
|
||||
if (ChromeFeatureList.isEnabled(ChromeFeatureList.CLIPBOARD_CONTENT_SETTING)) {
|
||||
websitePrefs.add(Type.CLIPBOARD);
|
||||
@@ -246,11 +235,4 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
preference.getTitle().toString());
|
||||
return false;
|
||||
}
|
||||
-
|
||||
- private void setTranslateStateSummary(Preference translatePref) {
|
||||
- boolean translateEnabled = PrefServiceBridge.getInstance().isTranslateEnabled();
|
||||
- translatePref.setSummary(translateEnabled
|
||||
- ? R.string.website_settings_category_ask
|
||||
- : R.string.website_settings_category_blocked);
|
||||
- }
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+3
-3
@@ -9,10 +9,10 @@ Subject: Never send any crash upload data
|
||||
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
|
||||
@@ -122,6 +122,9 @@ void TraceCrashServiceUploader::DoUpload(
|
||||
@@ -126,6 +126,9 @@ void TraceCrashServiceUploader::DoUpload(
|
||||
std::unique_ptr<const base::DictionaryValue> metadata,
|
||||
const UploadProgressCallback& progress_callback,
|
||||
const UploadDoneCallback& done_callback) {
|
||||
UploadDoneCallback done_callback) {
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
@@ -20,5 +20,5 @@ diff --git a/chrome/browser/tracing/crash_service_uploader.cc b/chrome/browser/t
|
||||
|
||||
progress_callback_ = progress_callback;
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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
|
||||
@@ -71,7 +71,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.4"
|
||||
android:text="@string/fre_send_report_check"
|
||||
- android:textAppearance="@style/BlackBodyDefault" />
|
||||
+ android:textAppearance="@style/BlackBodyDefault" android:visibility = "gone" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ Subject: Never fetch popular sites
|
||||
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
|
||||
@@ -289,6 +289,12 @@ bool PopularSitesImpl::MaybeStartFetch(bool force_download,
|
||||
@@ -291,6 +291,12 @@ bool PopularSitesImpl::MaybeStartFetch(bool force_download,
|
||||
DCHECK(!callback_);
|
||||
callback_ = callback;
|
||||
|
||||
@@ -23,5 +23,5 @@ diff --git a/components/ntp_tiles/popular_sites_impl.cc b/components/ntp_tiles/p
|
||||
prefs_->GetInt64(prefs::kPopularSitesLastDownloadPref));
|
||||
const base::TimeDelta time_since_last_download =
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Oct 2017 10:09:41 +0200
|
||||
Subject: Cure AMP and tracking from search results
|
||||
|
||||
---
|
||||
third_party/WebKit/Source/core/dom/BUILD.gn | 1 +
|
||||
third_party/WebKit/Source/core/dom/Document.cpp | 19 ++++++++++++++++++-
|
||||
.../WebKit/Source/core/dom/extensions/anti_amp_cure.h | 6 ++++++
|
||||
3 files changed, 25 insertions(+), 1 deletion(-)
|
||||
create mode 100644 third_party/WebKit/Source/core/dom/extensions/anti_amp_cure.h
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
@@ -301,6 +301,7 @@ blink_core_sources("dom") {
|
||||
"events/TreeScopeEventContext.h",
|
||||
"events/WindowEventContext.cpp",
|
||||
"events/WindowEventContext.h",
|
||||
+ "extensions/dont-track-me.h",
|
||||
"ng/flat_tree_traversal_ng.cc",
|
||||
"ng/flat_tree_traversal_ng.h",
|
||||
"trustedtypes/TrustedHTML.cpp",
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
--- a/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
@@ -220,6 +220,7 @@
|
||||
#include "core/xml/parser/XMLDocumentParser.h"
|
||||
#include "core/xml_names.h"
|
||||
#include "core/xmlns_names.h"
|
||||
+#include "extensions/anti_amp_cure.h"
|
||||
#include "platform/CrossThreadFunctional.h"
|
||||
#include "platform/DateComponents.h"
|
||||
#include "platform/EventDispatchForbiddenScope.h"
|
||||
@@ -5804,8 +5805,24 @@ void Document::FinishedParsing() {
|
||||
fetcher_->ClearResourcesFromPreviousFetcher();
|
||||
}
|
||||
|
||||
- if (IsPrefetchOnly())
|
||||
+ if (IsPrefetchOnly()) {
|
||||
WebPrerenderingSupport::Current()->PrefetchFinished();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // determine whether this is a Google search results page
|
||||
+ const SecurityOrigin *origin = GetSecurityOrigin();
|
||||
+ if (origin) {
|
||||
+ WTF::String domain = origin->Domain();
|
||||
+ size_t pos = domain.Find(".google.");
|
||||
+ auto* bodyElement = body();
|
||||
+ if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
+ LOG(INFO) << "injecting anti-AMP-cure Javascript payload";
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(ANTI_AMP_CURE_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
|
||||
diff --git a/third_party/WebKit/Source/core/dom/extensions/anti_amp_cure.h b/third_party/WebKit/Source/core/dom/extensions/anti_amp_cure.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/WebKit/Source/core/dom/extensions/anti_amp_cure.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef anti_amp_cure_h
|
||||
+#define anti_amp_cure_h
|
||||
+
|
||||
+#define ANTI_AMP_CURE_JS "/* Bromite click-tracking and AMP removal v0.3.5 */\n\nfunction recreateHyperlink(a) {\n // skip already-sanitized hyperlinks\n if (a.sane) return false;\n\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n // property set when hyperlink has been created by this script\n newA.sane = 1;\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return false;\n }\n // leave original href unchanged\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n return true;\n}\n\nfunction isResult(a) {\n if (a.getAttribute('data-amp-cur'))\n return true;\n var inlineMousedown = a.getAttribute('onmousedown');\n if (!inlineMousedown)\n\treturn false;\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n return /\\ba?rwt\\(/.test(inlineMousedown) || /\\bctpacw\\b/.test(inlineMousedown);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname.indexOf('www.google.') == 0) &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAds() {\n // scan all divs\n var div = document.getElementById('tads');\n if (div) {\n div.style.display = 'none';\n\treturn true;\n }\n return false;\n}\n\nfunction sanitizeAll() {\n console.log(\"ads removed: \", sanitizeAds());\n console.log(\"hyperlinks sanitized: \", sanitizeAllHyperlinks());\n}\n\nfunction setMlogoClick() {\n var mlogo = document.getElementById('mlogo');\n if (mlogo) {\n mlogo.removeAttribute(\"href\");\n mlogo.setAttribute(\"onclick\", \"sanitizeAll()\");\n console.log(\"logo link replaced\");\n } else {\n console.log(\"could not replace logo link\");\n }\n}\n\nfunction sanitizeAllHyperlinks() {\n var saned = 0, total = 0;\n document.querySelectorAll('div[data-hveid]:not([data-hveid=\"\"]) a').forEach(function(a) {\n\ttotal++;\n\tvar res = recreateHyperlink(a);\n\tif (res) saned++;\n });\n console.log(\"sanitized \", saned, \"/\", total, \" hyperlinks\");\n\n return saned;\n}\n\n// avoid running cleanup on non-search pages\nif ((document.location.host.indexOf(\"images.google.\") == -1) && (document.location.host.indexOf(\"news.google.\") == -1)) {\n// document.addEventListener('touchstart', handlePointerPress, true);\n sanitizeAll();\n}\nsetMlogoClick();\n"
|
||||
+
|
||||
+#endif // anti_amp_cure_h
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+9
-9
@@ -10,20 +10,20 @@ Subject: ungoogled-chromium: Disable signin
|
||||
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
|
||||
--- a/chrome/browser/ui/chrome_pages.cc
|
||||
+++ b/chrome/browser/ui/chrome_pages.cc
|
||||
@@ -76,12 +76,6 @@ void OpenBookmarkManagerForNode(Browser* browser, int64_t node_id) {
|
||||
ShowSingletonTabOverwritingNTP(browser, params);
|
||||
@@ -72,12 +72,6 @@ void OpenBookmarkManagerForNode(Browser* browser, int64_t node_id) {
|
||||
ShowSingletonTabOverwritingNTP(browser, std::move(params));
|
||||
}
|
||||
|
||||
-void NavigateToSingletonTab(Browser* browser, const GURL& url) {
|
||||
- NavigateParams params(GetSingletonTabNavigateParams(browser, url));
|
||||
- params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
|
||||
- ShowSingletonTabOverwritingNTP(browser, params);
|
||||
- ShowSingletonTabOverwritingNTP(browser, std::move(params));
|
||||
-}
|
||||
-
|
||||
// Shows either the help app or the appropriate help page for |source|. If
|
||||
// |browser| is NULL and the help page is used (vs the app), the help page is
|
||||
// shown in the last active browser. If there is no such browser, a new browser
|
||||
@@ -396,6 +390,7 @@ void ShowSearchEngineSettings(Browser* browser) {
|
||||
@@ -383,6 +377,7 @@ void ShowSearchEngineSettings(Browser* browser) {
|
||||
#if !defined(OS_ANDROID)
|
||||
void ShowBrowserSignin(Browser* browser,
|
||||
signin_metrics::AccessPoint access_point) {
|
||||
@@ -31,9 +31,9 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.
|
||||
Profile* original_profile = browser->profile()->GetOriginalProfile();
|
||||
SigninManagerBase* manager =
|
||||
SigninManagerFactory::GetForProfile(original_profile);
|
||||
@@ -436,6 +431,7 @@ void ShowBrowserSignin(Browser* browser,
|
||||
false));
|
||||
DCHECK_GT(browser->tab_strip_model()->count(), 0);
|
||||
@@ -434,6 +429,7 @@ void ShowBrowserSignin(Browser* browser,
|
||||
access_point);
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
@@ -42,7 +42,7 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.
|
||||
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc
|
||||
--- a/components/signin/core/browser/signin_manager_base.cc
|
||||
+++ b/components/signin/core/browser/signin_manager_base.cc
|
||||
@@ -158,7 +158,7 @@ void SigninManagerBase::Initialize(PrefService* local_state) {
|
||||
@@ -155,7 +155,7 @@ void SigninManagerBase::Initialize(PrefService* local_state) {
|
||||
bool SigninManagerBase::IsInitialized() const { return initialized_; }
|
||||
|
||||
bool SigninManagerBase::IsSigninAllowed() const {
|
||||
@@ -52,5 +52,5 @@ diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/
|
||||
|
||||
AccountInfo SigninManagerBase::GetAuthenticatedAccountInfo() const {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Feb 2018 22:15:25 +0100
|
||||
Subject: Play videos in background
|
||||
|
||||
Break Page Visibility API and Fullscreen API for youtube.com and vimeo.com
|
||||
Original Javascript code by timdream
|
||||
---
|
||||
third_party/WebKit/Source/core/dom/BUILD.gn | 1 +
|
||||
third_party/WebKit/Source/core/dom/Document.cpp | 17 +++++++++++++----
|
||||
.../WebKit/Source/core/dom/extensions/video_bg_play.h | 6 ++++++
|
||||
3 files changed, 20 insertions(+), 4 deletions(-)
|
||||
create mode 100644 third_party/WebKit/Source/core/dom/extensions/video_bg_play.h
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
--- a/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
+++ b/third_party/WebKit/Source/core/dom/BUILD.gn
|
||||
@@ -302,6 +302,7 @@ blink_core_sources("dom") {
|
||||
"events/WindowEventContext.cpp",
|
||||
"events/WindowEventContext.h",
|
||||
"extensions/dont-track-me.h",
|
||||
+ "extensions/video-bg-play.h",
|
||||
"ng/flat_tree_traversal_ng.cc",
|
||||
"ng/flat_tree_traversal_ng.h",
|
||||
"trustedtypes/TrustedHTML.cpp",
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
--- a/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
@@ -221,6 +221,7 @@
|
||||
#include "core/xml_names.h"
|
||||
#include "core/xmlns_names.h"
|
||||
#include "extensions/anti_amp_cure.h"
|
||||
+#include "extensions/video_bg_play.h"
|
||||
#include "platform/CrossThreadFunctional.h"
|
||||
#include "platform/DateComponents.h"
|
||||
#include "platform/EventDispatchForbiddenScope.h"
|
||||
@@ -5812,17 +5813,25 @@ void Document::FinishedParsing() {
|
||||
|
||||
// determine whether this is a Google search results page
|
||||
const SecurityOrigin *origin = GetSecurityOrigin();
|
||||
- if (origin) {
|
||||
+ auto* bodyElement = body();
|
||||
+ if (origin && bodyElement) {
|
||||
WTF::String domain = origin->Domain();
|
||||
size_t pos = domain.Find(".google.");
|
||||
- auto* bodyElement = body();
|
||||
- if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
+ if ((pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
LOG(INFO) << "injecting anti-AMP-cure Javascript payload";
|
||||
HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
e->setText(ANTI_AMP_CURE_JS);
|
||||
bodyElement->AppendChild(e);
|
||||
}
|
||||
- }
|
||||
+
|
||||
+ // check for eligibility of the video bg fix
|
||||
+ if ((WTF::kNotFound != domain.Find("youtube.com")) || (WTF::kNotFound != domain.Find("vimeo.com"))) {
|
||||
+ LOG(INFO) << "injecting video-bg-play Javascript payload";
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(VIDEO_BG_PLAY_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+ } // has origin and body element
|
||||
}
|
||||
|
||||
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
|
||||
diff --git a/third_party/WebKit/Source/core/dom/extensions/video_bg_play.h b/third_party/WebKit/Source/core/dom/extensions/video_bg_play.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/WebKit/Source/core/dom/extensions/video_bg_play.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef video_bg_play_h
|
||||
+#define video_bg_play_h
|
||||
+
|
||||
+#define VIDEO_BG_PLAY_JS "'use strict';\n\n/* video background play fix - original version by timdream */\ndocument.videoBGFix = {};\n\n// Page Visibility API\nObject.defineProperties(document.videoBGFix,\n { 'hidden': {value: false}, 'visibilityState': {value: 'visible'} });\n\nwindow.addEventListener(\n 'visibilitychange', evt => evt.stopImmediatePropagation(), true);\nwindow.addEventListener(\n 'blur', evt => evt.stopImmediatePropagation(), true);\n\n// Fullscreen API\nwindow.addEventListener('fullscreenchange', evt => {\n Object.defineProperties(document.videoBGFix,\n { 'fullscreenEnabled': {value: true},\n 'fullscreen': {value: true},\n 'fullscreenElement': {value: document.fullscreenElement.videoBGFix}});\n window.addEventListener(\n 'fullscreenchange', evt => evt.stopImmediatePropagation(), true);\n}, { capture: true, once: true });\n"
|
||||
+
|
||||
+#endif // video_bg_play_h
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+6
-6
@@ -9,7 +9,7 @@ Subject: ungoogled-chromium: Disable webRTC log uploader
|
||||
diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
--- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
@@ -115,30 +115,7 @@ void WebRtcLogUploader::LoggingStoppedDoUpload(
|
||||
@@ -119,30 +119,7 @@ void WebRtcLogUploader::LoggingStoppedDoUpload(
|
||||
DCHECK(meta_data.get());
|
||||
DCHECK(!upload_done_data.log_path.empty());
|
||||
|
||||
@@ -28,7 +28,7 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
|
||||
- WriteCompressedLogToFile(compressed_log, log_file_path);
|
||||
-
|
||||
- base::FilePath log_list_path =
|
||||
- webrtc_logging::LogList::GetWebRtcLogListFileForDirectory(
|
||||
- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory(
|
||||
- upload_done_data.log_path);
|
||||
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
|
||||
- }
|
||||
@@ -41,7 +41,7 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
|
||||
}
|
||||
|
||||
void WebRtcLogUploader::PrepareMultipartPostData(
|
||||
@@ -149,6 +126,9 @@ void WebRtcLogUploader::PrepareMultipartPostData(
|
||||
@@ -153,6 +130,9 @@ void WebRtcLogUploader::PrepareMultipartPostData(
|
||||
DCHECK(!compressed_log.empty());
|
||||
DCHECK(meta_data.get());
|
||||
|
||||
@@ -49,8 +49,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser
|
||||
+ return;
|
||||
+
|
||||
std::unique_ptr<std::string> post_data(new std::string());
|
||||
SetupMultipart(post_data.get(),
|
||||
compressed_log,
|
||||
SetupMultipart(post_data.get(), compressed_log,
|
||||
upload_done_data.incoming_rtp_dump,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+19
-19
@@ -16,7 +16,7 @@ Disable additional URLs that are not caught by the "trk" scheme
|
||||
diff --git a/chrome/browser/android/rlz/rlz_ping_handler.cc b/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
--- a/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
+++ b/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
@@ -66,7 +66,7 @@ void RlzPingHandler::Ping(
|
||||
@@ -75,7 +75,7 @@ void RlzPingHandler::Ping(
|
||||
DCHECK_EQ(id.length(), 50u);
|
||||
|
||||
GURL request_url(base::StringPrintf(
|
||||
@@ -28,7 +28,7 @@ diff --git a/chrome/browser/android/rlz/rlz_ping_handler.cc b/chrome/browser/and
|
||||
diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser/plugins/plugins_resource_service.cc
|
||||
--- a/chrome/browser/plugins/plugins_resource_service.cc
|
||||
+++ b/chrome/browser/plugins/plugins_resource_service.cc
|
||||
@@ -52,9 +52,6 @@ const int kStartResourceFetchDelayMs = 60 * 1000;
|
||||
@@ -54,9 +54,6 @@ const int kStartResourceFetchDelayMs = 60 * 1000;
|
||||
// Delay between calls to update the cache 1 day and 2 minutes in testing mode.
|
||||
const int kCacheUpdateDelayMs = 24 * 60 * 60 * 1000;
|
||||
|
||||
@@ -38,7 +38,7 @@ diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser
|
||||
GURL GetPluginsServerURL() {
|
||||
std::string filename;
|
||||
#if defined(OS_WIN)
|
||||
@@ -69,7 +66,7 @@ GURL GetPluginsServerURL() {
|
||||
@@ -71,7 +68,7 @@ GURL GetPluginsServerURL() {
|
||||
#error Unknown platform
|
||||
#endif
|
||||
|
||||
@@ -50,7 +50,7 @@ diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_model_loader.cc b/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
--- a/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
+++ b/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
@@ -34,8 +34,6 @@ namespace safe_browsing {
|
||||
@@ -35,8 +35,6 @@ namespace safe_browsing {
|
||||
// Model Loader strings
|
||||
const size_t ModelLoader::kMaxModelSizeBytes = 150 * 1024;
|
||||
const int ModelLoader::kClientModelFetchIntervalMs = 3600 * 1000;
|
||||
@@ -59,39 +59,39 @@ diff --git a/chrome/browser/safe_browsing/client_side_model_loader.cc b/chrome/b
|
||||
const char ModelLoader::kClientModelNamePattern[] =
|
||||
"client_model_v5%s_variation_%d.pb";
|
||||
const char ModelLoader::kClientModelFinchExperiment[] =
|
||||
@@ -88,7 +86,7 @@ ModelLoader::ModelLoader(base::Closure update_renderers_callback,
|
||||
net::URLRequestContextGetter* request_context_getter,
|
||||
bool is_extended_reporting)
|
||||
@@ -90,7 +88,7 @@ ModelLoader::ModelLoader(
|
||||
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
|
||||
bool is_extended_reporting)
|
||||
: name_(FillInModelName(is_extended_reporting, GetModelNumber())),
|
||||
- url_(kClientModelUrlPrefix + name_),
|
||||
+ url_("about:blank"),
|
||||
update_renderers_callback_(update_renderers_callback),
|
||||
request_context_getter_(request_context_getter),
|
||||
url_loader_factory_(url_loader_factory),
|
||||
weak_factory_(this) {
|
||||
@@ -99,7 +97,7 @@ ModelLoader::ModelLoader(base::Closure update_renderers_callback,
|
||||
ModelLoader::ModelLoader(base::Closure update_renderers_callback,
|
||||
const std::string& model_name)
|
||||
@@ -103,7 +101,7 @@ ModelLoader::ModelLoader(
|
||||
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
|
||||
const std::string& model_name)
|
||||
: name_(model_name),
|
||||
- url_(kClientModelUrlPrefix + name_),
|
||||
+ url_("about:blank"),
|
||||
update_renderers_callback_(update_renderers_callback),
|
||||
request_context_getter_(NULL),
|
||||
url_loader_factory_(url_loader_factory),
|
||||
weak_factory_(this) {
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_model_loader.h b/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
--- a/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
+++ b/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
@@ -43,7 +43,6 @@ class ModelLoader : public net::URLFetcherDelegate {
|
||||
@@ -42,7 +42,6 @@ class ModelLoader {
|
||||
static const int kClientModelFetchIntervalMs;
|
||||
static const char kClientModelFinchExperiment[];
|
||||
static const char kClientModelFinchParam[];
|
||||
- static const char kClientModelUrlPrefix[];
|
||||
static const char kClientModelNamePattern[];
|
||||
|
||||
// Constructs a model loader to fetch a model using |request_context_getter|.
|
||||
// Constructs a model loader to fetch a model using |url_loader_factory|.
|
||||
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
|
||||
--- a/rlz/lib/financial_ping.cc
|
||||
+++ b/rlz/lib/financial_ping.cc
|
||||
@@ -366,7 +366,7 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
|
||||
@@ -339,7 +339,7 @@ FinancialPing::PingResponse FinancialPing::PingServer(const char* request,
|
||||
|
||||
// Open network connection.
|
||||
InternetHandle connection_handle = InternetConnectA(inet_handle,
|
||||
@@ -99,9 +99,9 @@ diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
|
||||
+ "about:blank", kFinancialPort, "", "", INTERNET_SERVICE_HTTP,
|
||||
INTERNET_FLAG_NO_CACHE_WRITE, 0);
|
||||
if (!connection_handle)
|
||||
return false;
|
||||
@@ -410,7 +410,7 @@ bool FinancialPing::PingServer(const char* request, std::string* response) {
|
||||
return true;
|
||||
return PING_FAILURE;
|
||||
@@ -383,7 +383,7 @@ FinancialPing::PingResponse FinancialPing::PingServer(const char* request,
|
||||
return PING_SUCCESSFUL;
|
||||
#else
|
||||
std::string url =
|
||||
- base::StringPrintf("https://%s%s", kFinancialServer, request);
|
||||
@@ -132,5 +132,5 @@ diff --git a/rlz/lib/lib_values.h b/rlz/lib/lib_values.h
|
||||
extern const int kFinancialPort;
|
||||
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+11
-8
@@ -4,9 +4,9 @@ Subject: ungoogled-chromium: Disable translate integration
|
||||
|
||||
---
|
||||
components/translate/content/renderer/translate_helper.cc | 4 +++-
|
||||
components/translate/core/browser/translate_manager.cc | 2 +-
|
||||
components/translate/core/browser/translate_manager.cc | 5 +++--
|
||||
components/translate/core/browser/translate_script.cc | 3 +--
|
||||
3 files changed, 5 insertions(+), 4 deletions(-)
|
||||
3 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/components/translate/content/renderer/translate_helper.cc b/components/translate/content/renderer/translate_helper.cc
|
||||
--- a/components/translate/content/renderer/translate_helper.cc
|
||||
@@ -25,19 +25,22 @@ diff --git a/components/translate/content/renderer/translate_helper.cc b/compone
|
||||
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
|
||||
--- a/components/translate/core/browser/translate_manager.cc
|
||||
+++ b/components/translate/core/browser/translate_manager.cc
|
||||
@@ -102,7 +102,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
|
||||
@@ -134,8 +134,9 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
|
||||
if (net::NetworkChangeNotifier::IsOffline())
|
||||
return;
|
||||
|
||||
- if (!ignore_missing_key_for_testing_ && !::google_apis::HasKeysConfigured()) {
|
||||
+ if (true) {
|
||||
- if (!ignore_missing_key_for_testing_ &&
|
||||
- !::google_apis::HasAPIKeyConfigured()) {
|
||||
+// if (!ignore_missing_key_for_testing_ &&
|
||||
+// !::google_apis::HasAPIKeyConfigured()) {
|
||||
+ if (true) {
|
||||
// Without an API key, translate won't work, so don't offer to translate in
|
||||
// the first place. Leave prefs::kOfferTranslateEnabled on, though, because
|
||||
// that settings syncs and we don't want to turn off translate everywhere
|
||||
diff --git a/components/translate/core/browser/translate_script.cc b/components/translate/core/browser/translate_script.cc
|
||||
--- a/components/translate/core/browser/translate_script.cc
|
||||
+++ b/components/translate/core/browser/translate_script.cc
|
||||
@@ -149,9 +149,8 @@ void TranslateScript::OnScriptFetchComplete(
|
||||
@@ -151,9 +151,8 @@ void TranslateScript::OnScriptFetchComplete(bool success,
|
||||
base::StringAppendF(&data_, "var serverParams = '%s';\n",
|
||||
server_params.c_str());
|
||||
|
||||
@@ -46,8 +49,8 @@ diff --git a/components/translate/core/browser/translate_script.cc b/components/
|
||||
- &data_, "var securityOrigin = '%s';", security_origin.spec().c_str());
|
||||
+ &data_, "var securityOrigin = '';");
|
||||
|
||||
// Append embedded translate.js and a remote element library.
|
||||
// Load embedded translate.js.
|
||||
base::StringPiece str =
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:29:30 +0100
|
||||
Subject: ungoogled-chromium: Disable profile avatar downloading
|
||||
|
||||
Added some Bromite-specific further improvements
|
||||
---
|
||||
chrome/browser/BUILD.gn | 2 --
|
||||
chrome/browser/profiles/profile_attributes_entry.cc | 14 --------------
|
||||
chrome/browser/profiles/profile_avatar_downloader.cc | 8 +-------
|
||||
3 files changed, 1 insertion(+), 23 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -1268,8 +1268,6 @@ jumbo_split_static_library("browser") {
|
||||
"profiles/profile_attributes_entry.h",
|
||||
"profiles/profile_attributes_storage.cc",
|
||||
"profiles/profile_attributes_storage.h",
|
||||
- "profiles/profile_avatar_downloader.cc",
|
||||
- "profiles/profile_avatar_downloader.h",
|
||||
"profiles/profile_avatar_icon_util.cc",
|
||||
"profiles/profile_avatar_icon_util.h",
|
||||
"profiles/profile_destroyer.cc",
|
||||
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
--- a/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
+++ b/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
@@ -83,20 +83,6 @@ base::string16 ProfileAttributesEntry::GetUserName() const {
|
||||
}
|
||||
|
||||
const gfx::Image& ProfileAttributesEntry::GetAvatarIcon() const {
|
||||
- if (IsUsingGAIAPicture()) {
|
||||
- const gfx::Image* image = GetGAIAPicture();
|
||||
- if (image)
|
||||
- return *image;
|
||||
- }
|
||||
-
|
||||
-#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
|
||||
- // Use the high resolution version of the avatar if it exists. Mobile and
|
||||
- // ChromeOS don't need the high resolution version so no need to fetch it.
|
||||
- const gfx::Image* image = GetHighResAvatar();
|
||||
- if (image)
|
||||
- return *image;
|
||||
-#endif
|
||||
-
|
||||
int resource_id =
|
||||
profiles::GetDefaultAvatarIconResourceIDAtIndex(GetAvatarIconIndex());
|
||||
return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
|
||||
diff --git a/chrome/browser/profiles/profile_avatar_downloader.cc b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
--- a/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
+++ b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
@@ -16,19 +16,13 @@
|
||||
#include "net/traffic_annotation/network_traffic_annotation.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
-namespace {
|
||||
-const char kHighResAvatarDownloadUrlPrefix[] =
|
||||
- "https://www.gstatic.com/chrome/profile_avatars/";
|
||||
-}
|
||||
-
|
||||
ProfileAvatarDownloader::ProfileAvatarDownloader(
|
||||
size_t icon_index,
|
||||
const FetchCompleteCallback& callback)
|
||||
: icon_index_(icon_index),
|
||||
callback_(callback) {
|
||||
DCHECK(!callback_.is_null());
|
||||
- GURL url(std::string(kHighResAvatarDownloadUrlPrefix) +
|
||||
- profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index));
|
||||
+ GURL url(std::string("about:blank"));
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
net::DefineNetworkTrafficAnnotation("profile_avatar", R"(
|
||||
semantics {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+4
-4
@@ -12,8 +12,8 @@ See this page for more information: https://mikewest.org/2012/02/chrome-connects
|
||||
diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc
|
||||
--- a/chrome/browser/intranet_redirect_detector.cc
|
||||
+++ b/chrome/browser/intranet_redirect_detector.cc
|
||||
@@ -72,9 +72,7 @@ void IntranetRedirectDetector::FinishSleep() {
|
||||
fetchers_.clear();
|
||||
@@ -76,9 +76,7 @@ void IntranetRedirectDetector::FinishSleep() {
|
||||
simple_loaders_.clear();
|
||||
resulting_origins_.clear();
|
||||
|
||||
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
@@ -21,8 +21,8 @@ diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intra
|
||||
- return;
|
||||
+ return;
|
||||
|
||||
DCHECK(fetchers_.empty() && resulting_origins_.empty());
|
||||
DCHECK(simple_loaders_.empty() && resulting_origins_.empty());
|
||||
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+40
-38
@@ -6,10 +6,10 @@ Disables various detections of Google hosts and functionality specific to them
|
||||
---
|
||||
.../page_load_metrics/page_load_metrics_util.cc | 4 +-
|
||||
.../page_load_metrics/page_load_metrics_util.cc | 33 +---
|
||||
components/google/core/browser/google_util.cc | 193 ++-------------------
|
||||
components/search_engines/template_url.cc | 5 -
|
||||
components/google/core/common/google_util.cc | 194 ++-------------------
|
||||
components/search_engines/template_url.cc | 6 +-
|
||||
net/base/url_util.cc | 22 ---
|
||||
5 files changed, 13 insertions(+), 244 deletions(-)
|
||||
5 files changed, 14 insertions(+), 245 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
||||
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
||||
@@ -68,10 +68,10 @@ diff --git a/chrome/common/page_load_metrics/page_load_metrics_util.cc b/chrome/
|
||||
}
|
||||
|
||||
bool IsGoogleHostname(const GURL& url) {
|
||||
diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc
|
||||
--- a/components/google/core/browser/google_util.cc
|
||||
+++ b/components/google/core/browser/google_util.cc
|
||||
@@ -41,118 +41,16 @@ namespace {
|
||||
diff --git a/components/google/core/common/google_util.cc b/components/google/core/common/google_util.cc
|
||||
--- a/components/google/core/common/google_util.cc
|
||||
+++ b/components/google/core/common/google_util.cc
|
||||
@@ -43,118 +43,16 @@ namespace {
|
||||
|
||||
bool gUseMockLinkDoctorBaseURLForTesting = false;
|
||||
|
||||
@@ -148,9 +148,9 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
- // same page.
|
||||
- StripTrailingDot(&tld);
|
||||
-
|
||||
- CR_DEFINE_STATIC_LOCAL(std::set<std::string>, google_tlds,
|
||||
- ({GOOGLE_TLD_LIST}));
|
||||
- return base::ContainsKey(google_tlds, tld.as_string());
|
||||
- static base::NoDestructor<std::set<std::string>> google_tlds(
|
||||
- {GOOGLE_TLD_LIST});
|
||||
- return base::ContainsKey(*google_tlds, tld.as_string());
|
||||
-}
|
||||
-
|
||||
-// True if |url| is a valid URL with a host that is in the static list of
|
||||
@@ -163,10 +163,10 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
- base::StringPiece host(url.host_piece());
|
||||
- StripTrailingDot(&host);
|
||||
-
|
||||
- CR_DEFINE_STATIC_LOCAL(std::set<std::string>, google_subdomains,
|
||||
- ({"ipv4.google.com", "ipv6.google.com"}));
|
||||
- static base::NoDestructor<std::set<std::string>> google_subdomains(
|
||||
- {"ipv4.google.com", "ipv6.google.com"});
|
||||
-
|
||||
- return base::ContainsKey(google_subdomains, host.as_string());
|
||||
- return base::ContainsKey(*google_subdomains, host.as_string());
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
@@ -191,12 +191,12 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
}
|
||||
|
||||
void SetMockLinkDoctorBaseURLForTesting() {
|
||||
@@ -166,119 +64,50 @@ std::string GetGoogleLocale(const std::string& application_locale) {
|
||||
@@ -168,120 +66,50 @@ std::string GetGoogleLocale(const std::string& application_locale) {
|
||||
|
||||
GURL AppendGoogleLocaleParam(const GURL& url,
|
||||
const std::string& application_locale) {
|
||||
- return net::AppendQueryParameter(
|
||||
- url, "hl", GetGoogleLocale(application_locale));
|
||||
- return net::AppendQueryParameter(url, "hl",
|
||||
- GetGoogleLocale(application_locale));
|
||||
+ return url;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,8 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
- // TODO(igorcov): This needs a fix for case when the host has a trailing dot,
|
||||
- // like "google.com./". https://crbug.com/720295.
|
||||
- const size_t last_dot = google_hostname.find_last_of('.');
|
||||
- DCHECK_NE(std::string::npos, last_dot);
|
||||
- if (last_dot == std::string::npos)
|
||||
- return std::string();
|
||||
- base::StringPiece country_code = google_hostname.substr(last_dot + 1);
|
||||
- // Assume the com TLD implies the US.
|
||||
- if (country_code == "com")
|
||||
@@ -236,19 +237,19 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
- // Unit tests may add command-line flags after the first call to this
|
||||
- // function, so we don't simply initialize a static |base_url| directly and
|
||||
- // then unconditionally return it.
|
||||
- CR_DEFINE_STATIC_LOCAL(std::string, switch_value, ());
|
||||
CR_DEFINE_STATIC_LOCAL(GURL, base_url, ());
|
||||
- static base::NoDestructor<std::string> switch_value;
|
||||
static base::NoDestructor<GURL> base_url;
|
||||
- std::string current_switch_value(
|
||||
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
- switches::kGoogleBaseURL));
|
||||
- if (current_switch_value != switch_value) {
|
||||
- switch_value = current_switch_value;
|
||||
- base_url = url_formatter::FixupURL(switch_value, std::string());
|
||||
- if (!base_url.is_valid() || base_url.has_query() || base_url.has_ref())
|
||||
- base_url = GURL();
|
||||
- if (current_switch_value != *switch_value) {
|
||||
- *switch_value = current_switch_value;
|
||||
- *base_url = url_formatter::FixupURL(*switch_value, std::string());
|
||||
- if (!base_url->is_valid() || base_url->has_query() || base_url->has_ref())
|
||||
- *base_url = GURL();
|
||||
- }
|
||||
+ base_url = GURL();
|
||||
return base_url;
|
||||
+ *base_url = GURL();
|
||||
return *base_url;
|
||||
}
|
||||
|
||||
bool StartsWithCommandLineGoogleBaseURL(const GURL& url) {
|
||||
@@ -307,7 +308,7 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
- // Check for query parameter in URL parameter and hash fragment, depending on
|
||||
- // the path type.
|
||||
- return HasGoogleSearchQueryParam(url.ref_piece()) ||
|
||||
- (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece()));
|
||||
- (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece()));
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@@ -315,8 +316,8 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
SubdomainPermission subdomain_permission,
|
||||
PortPermission port_permission) {
|
||||
- return IsValidURL(url, port_permission) &&
|
||||
- IsValidHostName(url.host_piece(), "youtube", subdomain_permission,
|
||||
- nullptr);
|
||||
- IsValidHostName(url.host_piece(), "youtube", subdomain_permission,
|
||||
- nullptr);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@@ -324,22 +325,23 @@ diff --git a/components/google/core/browser/google_util.cc b/components/google/c
|
||||
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
|
||||
--- a/components/search_engines/template_url.cc
|
||||
+++ b/components/search_engines/template_url.cc
|
||||
@@ -510,11 +510,6 @@ base::string16 TemplateURLRef::SearchTermToString16(
|
||||
@@ -505,11 +505,7 @@ base::string16 TemplateURLRef::SearchTermToString16(
|
||||
bool TemplateURLRef::HasGoogleBaseURLs(
|
||||
const SearchTermsData& search_terms_data) const {
|
||||
ParseIfNecessary(search_terms_data);
|
||||
- for (size_t i = 0; i < replacements_.size(); ++i) {
|
||||
- if ((replacements_[i].type == GOOGLE_BASE_URL) ||
|
||||
- (replacements_[i].type == GOOGLE_BASE_SUGGEST_URL))
|
||||
- return true;
|
||||
- }
|
||||
return false;
|
||||
- return std::any_of(replacements_.begin(), replacements_.end(),
|
||||
- [](const Replacement& replacement) {
|
||||
- return replacement.type == GOOGLE_BASE_URL ||
|
||||
- replacement.type == GOOGLE_BASE_SUGGEST_URL;
|
||||
- });
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool TemplateURLRef::ExtractSearchTermsFromURL(
|
||||
diff --git a/net/base/url_util.cc b/net/base/url_util.cc
|
||||
--- a/net/base/url_util.cc
|
||||
+++ b/net/base/url_util.cc
|
||||
@@ -397,28 +397,6 @@ void GetIdentityFromURL(const GURL& url,
|
||||
@@ -383,28 +383,6 @@ void GetIdentityFromURL(const GURL& url,
|
||||
}
|
||||
|
||||
bool HasGoogleHost(const GURL& url) {
|
||||
@@ -369,5 +371,5 @@ diff --git a/net/base/url_util.cc b/net/base/url_util.cc
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+9
-9
@@ -10,23 +10,23 @@ Disable Google Cloud Messaging (GCM) client
|
||||
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
|
||||
--- a/components/gcm_driver/gcm_client_impl.cc
|
||||
+++ b/components/gcm_driver/gcm_client_impl.cc
|
||||
@@ -502,6 +502,7 @@ void GCMClientImpl::StartGCM() {
|
||||
@@ -493,6 +493,7 @@ void GCMClientImpl::StartGCM() {
|
||||
device_checkin_info_.Reset();
|
||||
StartCheckin();
|
||||
}
|
||||
+ return;
|
||||
|
||||
void GCMClientImpl::InitializeMCSClient() {
|
||||
+ return;
|
||||
std::vector<GURL> endpoints;
|
||||
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
|
||||
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
|
||||
@@ -699,6 +700,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
|
||||
DCHECK(network_connection_tracker_);
|
||||
@@ -685,6 +686,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
|
||||
}
|
||||
|
||||
void GCMClientImpl::StartCheckin() {
|
||||
+ return;
|
||||
// Make sure no checkin is in progress.
|
||||
if (checkin_request_.get())
|
||||
if (checkin_request_)
|
||||
return;
|
||||
@@ -777,6 +779,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
|
||||
@@ -760,6 +762,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
|
||||
}
|
||||
|
||||
void GCMClientImpl::SchedulePeriodicCheckin() {
|
||||
@@ -35,5 +35,5 @@ diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gc
|
||||
if (checkin_request_.get() || !device_checkin_info_.accounts_set)
|
||||
return;
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+45
-58
@@ -7,18 +7,18 @@ Somehow it is still being activated even without being signed-in.
|
||||
|
||||
See also: https://github.com/Eloston/ungoogled-chromium/issues/104
|
||||
---
|
||||
chrome/browser/browser_resources.grd | 2 --
|
||||
.../component_extensions_whitelist/whitelist.cc | 1 -
|
||||
.../signin/gaia_auth_extension_loader.cc | 7 ------
|
||||
.../resources/component_extension_resources.grd | 2 --
|
||||
chrome/browser/ui/webui/signin/inline_login_ui.cc | 1 -
|
||||
google_apis/gaia/gaia_auth_fetcher.cc | 29 ----------------------
|
||||
6 files changed, 42 deletions(-)
|
||||
chrome/browser/browser_resources.grd | 2 --
|
||||
chrome/browser/extensions/component_extensions_whitelist/whitelist.cc | 1 -
|
||||
chrome/browser/extensions/signin/gaia_auth_extension_loader.cc | 3 ++-
|
||||
chrome/browser/resources/component_extension_resources.grd | 2 --
|
||||
chrome/browser/ui/webui/signin/inline_login_ui.cc | 1 -
|
||||
google_apis/gaia/gaia_auth_fetcher.cc | 4 +++-
|
||||
6 files changed, 5 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
|
||||
--- a/chrome/browser/browser_resources.grd
|
||||
+++ b/chrome/browser/browser_resources.grd
|
||||
@@ -299,7 +299,6 @@
|
||||
@@ -348,7 +348,6 @@
|
||||
<include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
||||
<include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" />
|
||||
@@ -26,8 +26,8 @@ diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resou
|
||||
<include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
||||
<include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" />
|
||||
@@ -435,7 +434,6 @@
|
||||
</if>
|
||||
@@ -492,7 +491,6 @@
|
||||
<include name="IDR_WEBRTC_LOGS_JS" file="resources\media\webrtc_logs.js" type="BINDATA" />
|
||||
<include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" />
|
||||
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
|
||||
- <include name="IDR_GAIA_AUTH_MANIFEST" file="resources\gaia_auth\manifest.json" type="BINDATA" />
|
||||
@@ -37,7 +37,7 @@ diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resou
|
||||
diff --git a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
--- a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
+++ b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
@@ -68,7 +68,6 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
|
||||
@@ -67,7 +67,6 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
|
||||
#endif
|
||||
case IDR_CRYPTOTOKEN_MANIFEST:
|
||||
case IDR_FEEDBACK_MANIFEST:
|
||||
@@ -48,30 +48,28 @@ diff --git a/chrome/browser/extensions/component_extensions_whitelist/whitelist.
|
||||
diff --git a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
--- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
+++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
@@ -42,18 +42,11 @@ extensions::ComponentLoader* GetComponentLoader(BrowserContext* context) {
|
||||
@@ -42,7 +42,7 @@ ComponentLoader* GetComponentLoader(BrowserContext* context) {
|
||||
|
||||
void LoadGaiaAuthExtension(BrowserContext* context) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
- extensions::ComponentLoader* component_loader = GetComponentLoader(context);
|
||||
-
|
||||
+/*
|
||||
ComponentLoader* component_loader = GetComponentLoader(context);
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
if (command_line->HasSwitch(switches::kAuthExtensionPath)) {
|
||||
- base::FilePath auth_extension_path =
|
||||
- command_line->GetSwitchValuePath(switches::kAuthExtensionPath);
|
||||
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path);
|
||||
return;
|
||||
}
|
||||
-
|
||||
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST,
|
||||
- base::FilePath(FILE_PATH_LITERAL("gaia_auth")));
|
||||
@@ -55,6 +55,7 @@ void LoadGaiaAuthExtension(BrowserContext* context) {
|
||||
|
||||
component_loader->Add(IDR_GAIA_AUTH_MANIFEST,
|
||||
base::FilePath(FILE_PATH_LITERAL("gaia_auth")));
|
||||
+*/
|
||||
}
|
||||
|
||||
void UnloadGaiaAuthExtension(BrowserContext* context) {
|
||||
diff --git a/chrome/browser/resources/component_extension_resources.grd b/chrome/browser/resources/component_extension_resources.grd
|
||||
--- a/chrome/browser/resources/component_extension_resources.grd
|
||||
+++ b/chrome/browser/resources/component_extension_resources.grd
|
||||
@@ -40,8 +40,6 @@
|
||||
<include name="IDR_BOOKMARK_MANAGER_BOOKMARK_BMM_JS" file="bookmark_manager/js/bmm.js" type="BINDATA" />
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
<!-- Material Design Bookmarks -->
|
||||
<include name="IDR_COMPONENT_MD_BOOKMARKS_BOOKMARKS_HTML" file="md_bookmarks/bookmarks.html" type="BINDATA" />
|
||||
- <!-- Gaia auth extension -->
|
||||
@@ -82,7 +80,7 @@ diff --git a/chrome/browser/resources/component_extension_resources.grd b/chrome
|
||||
diff --git a/chrome/browser/ui/webui/signin/inline_login_ui.cc b/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
--- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
@@ -44,7 +44,6 @@ content::WebUIDataSource* CreateWebUIDataSource() {
|
||||
@@ -49,7 +49,6 @@ content::WebUIDataSource* CreateWebUIDataSource() {
|
||||
|
||||
source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS);
|
||||
source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS);
|
||||
@@ -93,42 +91,31 @@ diff --git a/chrome/browser/ui/webui/signin/inline_login_ui.cc b/chrome/browser/
|
||||
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
--- a/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
@@ -219,35 +219,6 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher(
|
||||
int load_flags,
|
||||
@@ -44,7 +44,7 @@ namespace {
|
||||
const int kLoadFlagsIgnoreCookies = net::LOAD_DO_NOT_SEND_COOKIES |
|
||||
net::LOAD_DO_NOT_SAVE_COOKIES;
|
||||
|
||||
-const size_t kMaxMessageSize = 1024 * 1024; // 1MB
|
||||
+//const size_t kMaxMessageSize = 1024 * 1024; // 1MB
|
||||
|
||||
std::unique_ptr<const GaiaAuthConsumer::ClientOAuthResult>
|
||||
ExtractOAuth2TokenPairResponse(const std::string& data) {
|
||||
@@ -240,6 +240,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher(
|
||||
const net::NetworkTrafficAnnotationTag& traffic_annotation) {
|
||||
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
|
||||
- fetcher_ = net::URLFetcher::Create(
|
||||
- 0, gaia_gurl, body.empty() ? net::URLFetcher::GET : net::URLFetcher::POST,
|
||||
- this, traffic_annotation);
|
||||
- fetcher_->SetRequestContext(getter_);
|
||||
- fetcher_->SetUploadData("application/x-www-form-urlencoded", body);
|
||||
- gaia::MarkURLFetcherAsGaia(fetcher_.get());
|
||||
-
|
||||
- VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec();
|
||||
- VLOG(2) << "Gaia fetcher headers: " << headers;
|
||||
- VLOG(2) << "Gaia fetcher body: " << body;
|
||||
-
|
||||
- // The Gaia token exchange requests do not require any cookie-based
|
||||
- // identification as part of requests. We suppress sending any cookies to
|
||||
- // maintain a separation between the user's browsing and Chrome's internal
|
||||
- // services. Where such mixing is desired (MergeSession or OAuthLogin), it
|
||||
- // will be done explicitly.
|
||||
- fetcher_->SetLoadFlags(load_flags);
|
||||
-
|
||||
- // Fetchers are sometimes cancelled because a network change was detected,
|
||||
- // especially at startup and after sign-in on ChromeOS. Retrying once should
|
||||
- // be enough in those cases; let the fetcher retry up to 3 times just in case.
|
||||
- // http://crbug.com/163710
|
||||
- fetcher_->SetAutomaticallyRetryOnNetworkChanges(3);
|
||||
-
|
||||
- if (!headers.empty())
|
||||
- fetcher_->SetExtraRequestHeaders(headers);
|
||||
-
|
||||
- fetch_pending_ = true;
|
||||
- fetcher_->Start();
|
||||
|
||||
+/*
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = gaia_gurl;
|
||||
original_url_ = gaia_gurl;
|
||||
@@ -294,6 +295,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher(
|
||||
base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete,
|
||||
base::Unretained(this)),
|
||||
kMaxMessageSize);
|
||||
+*/
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:29:30 +0100
|
||||
Subject: ungoogled-chromium: Disable profile avatar downloading
|
||||
|
||||
---
|
||||
chrome/browser/profiles/profile_avatar_downloader.cc | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/profiles/profile_avatar_downloader.cc b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
--- a/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
+++ b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
@@ -16,19 +16,13 @@
|
||||
#include "net/traffic_annotation/network_traffic_annotation.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
-namespace {
|
||||
-const char kHighResAvatarDownloadUrlPrefix[] =
|
||||
- "https://www.gstatic.com/chrome/profile_avatars/";
|
||||
-}
|
||||
-
|
||||
ProfileAvatarDownloader::ProfileAvatarDownloader(
|
||||
size_t icon_index,
|
||||
const FetchCompleteCallback& callback)
|
||||
: icon_index_(icon_index),
|
||||
callback_(callback) {
|
||||
DCHECK(!callback_.is_null());
|
||||
- GURL url(std::string(kHighResAvatarDownloadUrlPrefix) +
|
||||
- profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index));
|
||||
+ GURL url(std::string("about:blank"));
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
net::DefineNetworkTrafficAnnotation("profile_avatar", R"(
|
||||
semantics {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,676 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 25 Aug 2018 22:58:52 +0200
|
||||
Subject: ungoogled-chromium: Disable domain reliability
|
||||
|
||||
---
|
||||
components/domain_reliability/BUILD.gn | 42 +-
|
||||
components/domain_reliability/bake_in_configs.py | 2 +-
|
||||
components/domain_reliability/google_configs.cc | 565 -----------------------
|
||||
components/domain_reliability/uploader.cc | 2 +-
|
||||
4 files changed, 17 insertions(+), 594 deletions(-)
|
||||
|
||||
diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn
|
||||
--- a/components/domain_reliability/BUILD.gn
|
||||
+++ b/components/domain_reliability/BUILD.gn
|
||||
@@ -9,26 +9,6 @@ action("bake_in_configs") {
|
||||
script = "bake_in_configs.py"
|
||||
|
||||
inputs = [
|
||||
- "baked_in_configs/c_android_clients_google_com.json",
|
||||
- "baked_in_configs/c_bigcache_googleapis_com.json",
|
||||
- "baked_in_configs/c_doc-0-0-sj_sj_googleusercontent_com.json",
|
||||
- "baked_in_configs/c_docs_google_com.json",
|
||||
- "baked_in_configs/c_drive_google_com.json",
|
||||
- "baked_in_configs/c_googlesyndication_com.json",
|
||||
- "baked_in_configs/c_pack_google_com.json",
|
||||
- "baked_in_configs/c_play_google_com.json",
|
||||
- "baked_in_configs/c_youtube_com.json",
|
||||
- "baked_in_configs/clients2_google_com.json",
|
||||
- "baked_in_configs/docs_google_com.json",
|
||||
- "baked_in_configs/gcp_gvt2_com.json",
|
||||
- "baked_in_configs/gcp_gvt6_com.json",
|
||||
- "baked_in_configs/google-analytics_com.json",
|
||||
- "baked_in_configs/googlevideo_com.json",
|
||||
- "baked_in_configs/gvt1_com.json",
|
||||
- "baked_in_configs/gvt2_com.json",
|
||||
- "baked_in_configs/gvt6_com.json",
|
||||
- "baked_in_configs/ssl_gstatic_com.json",
|
||||
- "baked_in_configs/www_google_com.json",
|
||||
]
|
||||
|
||||
output_file = "$target_gen_dir/baked_in_configs.cc"
|
||||
@@ -38,13 +18,21 @@ action("bake_in_configs") {
|
||||
|
||||
# The JSON file list is too long for the command line on Windows, so put
|
||||
# them in a response file.
|
||||
- response_file_contents = rebase_path(inputs, root_build_dir)
|
||||
- args = [
|
||||
- "--file-list",
|
||||
- "{{response_file_name}}",
|
||||
- "--output",
|
||||
- rebase_path(output_file, root_build_dir),
|
||||
- ]
|
||||
+ if (is_win) {
|
||||
+ args = [
|
||||
+ "--file-list",
|
||||
+ "nul",
|
||||
+ "--output",
|
||||
+ rebase_path(output_file, root_build_dir),
|
||||
+ ]
|
||||
+ } else {
|
||||
+ args = [
|
||||
+ "--file-list",
|
||||
+ "/dev/null",
|
||||
+ "--output",
|
||||
+ rebase_path(output_file, root_build_dir),
|
||||
+ ]
|
||||
+ }
|
||||
}
|
||||
|
||||
jumbo_component("domain_reliability") {
|
||||
diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py
|
||||
--- a/components/domain_reliability/bake_in_configs.py
|
||||
+++ b/components/domain_reliability/bake_in_configs.py
|
||||
@@ -489,7 +489,7 @@ def origin_is_whitelisted(origin):
|
||||
domain = origin[8:-1]
|
||||
else:
|
||||
return False
|
||||
- return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST)
|
||||
+ return False
|
||||
|
||||
|
||||
def quote_and_wrap_text(text, width=79, prefix=' "', suffix='"'):
|
||||
diff --git a/components/domain_reliability/google_configs.cc b/components/domain_reliability/google_configs.cc
|
||||
--- a/components/domain_reliability/google_configs.cc
|
||||
+++ b/components/domain_reliability/google_configs.cc
|
||||
@@ -13,575 +13,10 @@
|
||||
|
||||
namespace domain_reliability {
|
||||
|
||||
-namespace {
|
||||
-
|
||||
-struct GoogleConfigParams {
|
||||
- const char* hostname;
|
||||
- bool include_subdomains;
|
||||
-
|
||||
- // If true, prepend a collector URL within https://|hostname|/.
|
||||
- bool include_origin_specific_collector;
|
||||
-
|
||||
- // If true, also add a config for www.|hostname|.
|
||||
- //
|
||||
- // |include_subdomains| will be false in the extra config, but
|
||||
- // |include_origin_specific_collector| will be respected, and will use the
|
||||
- // www subdomain as the origin for the collector so it matches the config.
|
||||
- bool duplicate_for_www;
|
||||
-};
|
||||
-
|
||||
-const GoogleConfigParams kGoogleConfigs[] = {
|
||||
- // Origins with subdomains and same-origin collectors. Currently, all
|
||||
- // origins with same-origin collectors also run collectors on their www
|
||||
- // subdomain. (e.g., both foo.com and www.foo.com.)
|
||||
- {"google.ac", true, true, true},
|
||||
- {"google.ad", true, true, true},
|
||||
- {"google.ae", true, true, true},
|
||||
- {"google.af", true, true, true},
|
||||
- {"google.ag", true, true, true},
|
||||
- {"google.al", true, true, true},
|
||||
- {"google.am", true, true, true},
|
||||
- {"google.as", true, true, true},
|
||||
- {"google.at", true, true, true},
|
||||
- {"google.az", true, true, true},
|
||||
- {"google.ba", true, true, true},
|
||||
- {"google.be", true, true, true},
|
||||
- {"google.bf", true, true, true},
|
||||
- {"google.bg", true, true, true},
|
||||
- {"google.bi", true, true, true},
|
||||
- {"google.bj", true, true, true},
|
||||
- {"google.bs", true, true, true},
|
||||
- {"google.bt", true, true, true},
|
||||
- {"google.by", true, true, true},
|
||||
- {"google.ca", true, true, true},
|
||||
- {"google.cc", true, true, true},
|
||||
- {"google.cd", true, true, true},
|
||||
- {"google.cf", true, true, true},
|
||||
- {"google.cg", true, true, true},
|
||||
- {"google.ch", true, true, true},
|
||||
- {"google.ci", true, true, true},
|
||||
- {"google.cl", true, true, true},
|
||||
- {"google.cm", true, true, true},
|
||||
- {"google.cn", true, true, true},
|
||||
- {"google.co.ao", true, true, true},
|
||||
- {"google.co.bw", true, true, true},
|
||||
- {"google.co.ck", true, true, true},
|
||||
- {"google.co.cr", true, true, true},
|
||||
- {"google.co.hu", true, true, true},
|
||||
- {"google.co.id", true, true, true},
|
||||
- {"google.co.il", true, true, true},
|
||||
- {"google.co.im", true, true, true},
|
||||
- {"google.co.in", true, true, true},
|
||||
- {"google.co.je", true, true, true},
|
||||
- {"google.co.jp", true, true, true},
|
||||
- {"google.co.ke", true, true, true},
|
||||
- {"google.co.kr", true, true, true},
|
||||
- {"google.co.ls", true, true, true},
|
||||
- {"google.co.ma", true, true, true},
|
||||
- {"google.co.mz", true, true, true},
|
||||
- {"google.co.nz", true, true, true},
|
||||
- {"google.co.th", true, true, true},
|
||||
- {"google.co.tz", true, true, true},
|
||||
- {"google.co.ug", true, true, true},
|
||||
- {"google.co.uk", true, true, true},
|
||||
- {"google.co.uz", true, true, true},
|
||||
- {"google.co.ve", true, true, true},
|
||||
- {"google.co.vi", true, true, true},
|
||||
- {"google.co.za", true, true, true},
|
||||
- {"google.co.zm", true, true, true},
|
||||
- {"google.co.zw", true, true, true},
|
||||
- {"google.com.af", true, true, true},
|
||||
- {"google.com.ag", true, true, true},
|
||||
- {"google.com.ai", true, true, true},
|
||||
- {"google.com.ar", true, true, true},
|
||||
- {"google.com.au", true, true, true},
|
||||
- {"google.com.bd", true, true, true},
|
||||
- {"google.com.bh", true, true, true},
|
||||
- {"google.com.bn", true, true, true},
|
||||
- {"google.com.bo", true, true, true},
|
||||
- {"google.com.br", true, true, true},
|
||||
- {"google.com.by", true, true, true},
|
||||
- {"google.com.bz", true, true, true},
|
||||
- {"google.com.cn", true, true, true},
|
||||
- {"google.com.co", true, true, true},
|
||||
- {"google.com.cu", true, true, true},
|
||||
- {"google.com.cy", true, true, true},
|
||||
- {"google.com.do", true, true, true},
|
||||
- {"google.com.ec", true, true, true},
|
||||
- {"google.com.eg", true, true, true},
|
||||
- {"google.com.et", true, true, true},
|
||||
- {"google.com.fj", true, true, true},
|
||||
- {"google.com.ge", true, true, true},
|
||||
- {"google.com.gh", true, true, true},
|
||||
- {"google.com.gi", true, true, true},
|
||||
- {"google.com.gr", true, true, true},
|
||||
- {"google.com.gt", true, true, true},
|
||||
- {"google.com.hk", true, true, true},
|
||||
- {"google.com.iq", true, true, true},
|
||||
- {"google.com.jm", true, true, true},
|
||||
- {"google.com.jo", true, true, true},
|
||||
- {"google.com.kh", true, true, true},
|
||||
- {"google.com.kw", true, true, true},
|
||||
- {"google.com.lb", true, true, true},
|
||||
- {"google.com.ly", true, true, true},
|
||||
- {"google.com.mm", true, true, true},
|
||||
- {"google.com.mt", true, true, true},
|
||||
- {"google.com.mx", true, true, true},
|
||||
- {"google.com.my", true, true, true},
|
||||
- {"google.com.na", true, true, true},
|
||||
- {"google.com.nf", true, true, true},
|
||||
- {"google.com.ng", true, true, true},
|
||||
- {"google.com.ni", true, true, true},
|
||||
- {"google.com.np", true, true, true},
|
||||
- {"google.com.nr", true, true, true},
|
||||
- {"google.com.om", true, true, true},
|
||||
- {"google.com.pa", true, true, true},
|
||||
- {"google.com.pe", true, true, true},
|
||||
- {"google.com.pg", true, true, true},
|
||||
- {"google.com.ph", true, true, true},
|
||||
- {"google.com.pk", true, true, true},
|
||||
- {"google.com.pl", true, true, true},
|
||||
- {"google.com.pr", true, true, true},
|
||||
- {"google.com.py", true, true, true},
|
||||
- {"google.com.qa", true, true, true},
|
||||
- {"google.com.ru", true, true, true},
|
||||
- {"google.com.sa", true, true, true},
|
||||
- {"google.com.sb", true, true, true},
|
||||
- {"google.com.sg", true, true, true},
|
||||
- {"google.com.sl", true, true, true},
|
||||
- {"google.com.sv", true, true, true},
|
||||
- {"google.com.tj", true, true, true},
|
||||
- {"google.com.tn", true, true, true},
|
||||
- {"google.com.tr", true, true, true},
|
||||
- {"google.com.tw", true, true, true},
|
||||
- {"google.com.ua", true, true, true},
|
||||
- {"google.com.uy", true, true, true},
|
||||
- {"google.com.vc", true, true, true},
|
||||
- {"google.com.ve", true, true, true},
|
||||
- {"google.com.vn", true, true, true},
|
||||
- {"google.cv", true, true, true},
|
||||
- {"google.cz", true, true, true},
|
||||
- {"google.de", true, true, true},
|
||||
- {"google.dj", true, true, true},
|
||||
- {"google.dk", true, true, true},
|
||||
- {"google.dm", true, true, true},
|
||||
- {"google.dz", true, true, true},
|
||||
- {"google.ee", true, true, true},
|
||||
- {"google.es", true, true, true},
|
||||
- {"google.fi", true, true, true},
|
||||
- {"google.fm", true, true, true},
|
||||
- {"google.fr", true, true, true},
|
||||
- {"google.ga", true, true, true},
|
||||
- {"google.ge", true, true, true},
|
||||
- {"google.gg", true, true, true},
|
||||
- {"google.gl", true, true, true},
|
||||
- {"google.gm", true, true, true},
|
||||
- {"google.gp", true, true, true},
|
||||
- {"google.gr", true, true, true},
|
||||
- {"google.gy", true, true, true},
|
||||
- {"google.hk", true, true, true},
|
||||
- {"google.hn", true, true, true},
|
||||
- {"google.hr", true, true, true},
|
||||
- {"google.ht", true, true, true},
|
||||
- {"google.hu", true, true, true},
|
||||
- {"google.ie", true, true, true},
|
||||
- {"google.im", true, true, true},
|
||||
- {"google.iq", true, true, true},
|
||||
- {"google.ir", true, true, true},
|
||||
- {"google.is", true, true, true},
|
||||
- {"google.it", true, true, true},
|
||||
- {"google.it.ao", true, true, true},
|
||||
- {"google.je", true, true, true},
|
||||
- {"google.jo", true, true, true},
|
||||
- {"google.jp", true, true, true},
|
||||
- {"google.kg", true, true, true},
|
||||
- {"google.ki", true, true, true},
|
||||
- {"google.kz", true, true, true},
|
||||
- {"google.la", true, true, true},
|
||||
- {"google.li", true, true, true},
|
||||
- {"google.lk", true, true, true},
|
||||
- {"google.lt", true, true, true},
|
||||
- {"google.lu", true, true, true},
|
||||
- {"google.lv", true, true, true},
|
||||
- {"google.md", true, true, true},
|
||||
- {"google.me", true, true, true},
|
||||
- {"google.mg", true, true, true},
|
||||
- {"google.mk", true, true, true},
|
||||
- {"google.ml", true, true, true},
|
||||
- {"google.mn", true, true, true},
|
||||
- {"google.ms", true, true, true},
|
||||
- {"google.mu", true, true, true},
|
||||
- {"google.mv", true, true, true},
|
||||
- {"google.mw", true, true, true},
|
||||
- {"google.ne", true, true, true},
|
||||
- {"google.ne.jp", true, true, true},
|
||||
- {"google.ng", true, true, true},
|
||||
- {"google.nl", true, true, true},
|
||||
- {"google.no", true, true, true},
|
||||
- {"google.nr", true, true, true},
|
||||
- {"google.nu", true, true, true},
|
||||
- {"google.off.ai", true, true, true},
|
||||
- {"google.pk", true, true, true},
|
||||
- {"google.pl", true, true, true},
|
||||
- {"google.pn", true, true, true},
|
||||
- {"google.ps", true, true, true},
|
||||
- {"google.pt", true, true, true},
|
||||
- {"google.ro", true, true, true},
|
||||
- {"google.rs", true, true, true},
|
||||
- {"google.ru", true, true, true},
|
||||
- {"google.rw", true, true, true},
|
||||
- {"google.sc", true, true, true},
|
||||
- {"google.se", true, true, true},
|
||||
- {"google.sh", true, true, true},
|
||||
- {"google.si", true, true, true},
|
||||
- {"google.sk", true, true, true},
|
||||
- {"google.sm", true, true, true},
|
||||
- {"google.sn", true, true, true},
|
||||
- {"google.so", true, true, true},
|
||||
- {"google.sr", true, true, true},
|
||||
- {"google.st", true, true, true},
|
||||
- {"google.td", true, true, true},
|
||||
- {"google.tg", true, true, true},
|
||||
- {"google.tk", true, true, true},
|
||||
- {"google.tl", true, true, true},
|
||||
- {"google.tm", true, true, true},
|
||||
- {"google.tn", true, true, true},
|
||||
- {"google.to", true, true, true},
|
||||
- {"google.tt", true, true, true},
|
||||
- {"google.us", true, true, true},
|
||||
- {"google.uz", true, true, true},
|
||||
- {"google.vg", true, true, true},
|
||||
- {"google.vu", true, true, true},
|
||||
- {"google.ws", true, true, true},
|
||||
- {"l.google.com", true, true, true},
|
||||
-
|
||||
- // google.com is a special case. We have a custom config for www.google.com,
|
||||
- // so set generate_config_for_www_subdomain = false.
|
||||
- {"google.com", true, true, false},
|
||||
-
|
||||
- // Origins with subdomains and without same-origin collectors.
|
||||
- {"2mdn.net", true, false, false},
|
||||
- {"adgoogle.net", true, false, false},
|
||||
- {"admeld.com", true, false, false},
|
||||
- {"admob.biz", true, false, false},
|
||||
- {"admob.co.in", true, false, false},
|
||||
- {"admob.co.kr", true, false, false},
|
||||
- {"admob.co.nz", true, false, false},
|
||||
- {"admob.co.uk", true, false, false},
|
||||
- {"admob.co.za", true, false, false},
|
||||
- {"admob.com", true, false, false},
|
||||
- {"admob.com.br", true, false, false},
|
||||
- {"admob.com.es", true, false, false},
|
||||
- {"admob.com.fr", true, false, false},
|
||||
- {"admob.com.mx", true, false, false},
|
||||
- {"admob.com.pt", true, false, false},
|
||||
- {"admob.de", true, false, false},
|
||||
- {"admob.dk", true, false, false},
|
||||
- {"admob.es", true, false, false},
|
||||
- {"admob.fi", true, false, false},
|
||||
- {"admob.fr", true, false, false},
|
||||
- {"admob.gr", true, false, false},
|
||||
- {"admob.hk", true, false, false},
|
||||
- {"admob.ie", true, false, false},
|
||||
- {"admob.in", true, false, false},
|
||||
- {"admob.it", true, false, false},
|
||||
- {"admob.jp", true, false, false},
|
||||
- {"admob.kr", true, false, false},
|
||||
- {"admob.mobi", true, false, false},
|
||||
- {"admob.no", true, false, false},
|
||||
- {"admob.ph", true, false, false},
|
||||
- {"admob.pt", true, false, false},
|
||||
- {"admob.sg", true, false, false},
|
||||
- {"admob.tw", true, false, false},
|
||||
- {"admob.us", true, false, false},
|
||||
- {"admob.vn", true, false, false},
|
||||
- {"adwhirl.com", true, false, false},
|
||||
- {"ampproject.com", true, false, false},
|
||||
- {"ampproject.net", true, false, false},
|
||||
- {"ampproject.org", true, false, false},
|
||||
- {"android.com", true, false, false},
|
||||
- {"anycast-edge.metric.gstatic.com", true, false, false},
|
||||
- {"anycast-stb.metric.gstatic.com", true, false, false},
|
||||
- {"anycast.metric.gstatic.com", true, false, false},
|
||||
- {"cdn.ampproject.org", true, false, false},
|
||||
- {"chromecast.com", true, false, false},
|
||||
- {"chromeexperiments.com", true, false, false},
|
||||
- {"chromestatus.com", true, false, false},
|
||||
- {"chromium.org", true, false, false},
|
||||
- {"clients6.google.com", true, false, false},
|
||||
- {"cloudendpointsapis.com", true, false, false},
|
||||
- {"dartmotif.com", true, false, false},
|
||||
- {"dartsearch.net", true, false, false},
|
||||
- {"doubleclick.com", true, false, false},
|
||||
- {"doubleclick.ne.jp", true, false, false},
|
||||
- {"doubleclick.net", true, false, false},
|
||||
- {"doubleclickusercontent.com", true, false, false},
|
||||
- {"fls.doubleclick.net", true, false, false},
|
||||
- {"g.co", true, false, false},
|
||||
- {"g.doubleclick.net", true, false, false},
|
||||
- {"ggpht.com", true, false, false},
|
||||
- {"gmodules.com", true, false, false},
|
||||
- {"goo.gl", true, false, false},
|
||||
- {"google-syndication.com", true, false, false},
|
||||
- {"google.cat", true, false, false},
|
||||
- {"google.info", true, false, false},
|
||||
- {"google.jobs", true, false, false},
|
||||
- {"google.net", true, false, false},
|
||||
- {"google.org", true, false, false},
|
||||
- {"google.stackdriver.com", true, false, false},
|
||||
- {"googleadapis.com", true, false, false},
|
||||
- {"googleadservices.com", true, false, false},
|
||||
- {"googleadsserving.cn", true, false, false},
|
||||
- {"googlealumni.com", true, false, false},
|
||||
- {"googleapis.cn", true, false, false},
|
||||
- {"googleapis.com", true, false, false},
|
||||
- {"googleapps.com", true, false, false},
|
||||
- {"googlecbs.com", true, false, false},
|
||||
- {"googlecode.com", true, false, false},
|
||||
- {"googlecommerce.com", true, false, false},
|
||||
- {"googledrive.com", true, false, false},
|
||||
- {"googleenterprise.com", true, false, false},
|
||||
- {"googlefiber.com", true, false, false},
|
||||
- {"googlefiber.net", true, false, false},
|
||||
- {"googlegoro.com", true, false, false},
|
||||
- {"googlehosted.com", true, false, false},
|
||||
- {"googlepayments.com", true, false, false},
|
||||
- {"googlesource.com", true, false, false},
|
||||
- {"googlesyndication.com", true, false, false},
|
||||
- {"googletagmanager.com", true, false, false},
|
||||
- {"googletagservices.com", true, false, false},
|
||||
- {"googleusercontent.com", true, false, false},
|
||||
- {"googlezip.net", true, false, false},
|
||||
- {"gstatic.cn", true, false, false},
|
||||
- {"gstatic.com", true, false, false},
|
||||
- {"gvt3.com", true, false, false},
|
||||
- {"gvt9.com", true, false, false},
|
||||
- {"picasa.com", true, false, false},
|
||||
- {"recaptcha.net", true, false, false},
|
||||
- {"stackdriver.com", true, false, false},
|
||||
- {"stbcast-stb.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast2-stb.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast2.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast3-stb.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast3.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast4-stb.metric.gstatic.com", true, false, false},
|
||||
- {"stbcast4.metric.gstatic.com", true, false, false},
|
||||
- {"unicast-edge.metric.gstatic.com", true, false, false},
|
||||
- {"unicast-stb.metric.gstatic.com", true, false, false},
|
||||
- {"unicast.metric.gstatic.com", true, false, false},
|
||||
- {"unicast2-stb.metric.gstatic.com", true, false, false},
|
||||
- {"unicast2.metric.gstatic.com", true, false, false},
|
||||
- {"waze.com", true, false, false},
|
||||
- {"withgoogle.com", true, false, false},
|
||||
- {"youtu.be", true, false, false},
|
||||
- {"youtube-3rd-party.com", true, false, false},
|
||||
- {"youtube-nocookie.com", true, false, false},
|
||||
- {"youtube.ae", true, false, false},
|
||||
- {"youtube.al", true, false, false},
|
||||
- {"youtube.am", true, false, false},
|
||||
- {"youtube.at", true, false, false},
|
||||
- {"youtube.az", true, false, false},
|
||||
- {"youtube.ba", true, false, false},
|
||||
- {"youtube.be", true, false, false},
|
||||
- {"youtube.bg", true, false, false},
|
||||
- {"youtube.bh", true, false, false},
|
||||
- {"youtube.bo", true, false, false},
|
||||
- {"youtube.ca", true, false, false},
|
||||
- {"youtube.cat", true, false, false},
|
||||
- {"youtube.ch", true, false, false},
|
||||
- {"youtube.cl", true, false, false},
|
||||
- {"youtube.co", true, false, false},
|
||||
- {"youtube.co.ae", true, false, false},
|
||||
- {"youtube.co.at", true, false, false},
|
||||
- {"youtube.co.hu", true, false, false},
|
||||
- {"youtube.co.id", true, false, false},
|
||||
- {"youtube.co.il", true, false, false},
|
||||
- {"youtube.co.in", true, false, false},
|
||||
- {"youtube.co.jp", true, false, false},
|
||||
- {"youtube.co.ke", true, false, false},
|
||||
- {"youtube.co.kr", true, false, false},
|
||||
- {"youtube.co.ma", true, false, false},
|
||||
- {"youtube.co.nz", true, false, false},
|
||||
- {"youtube.co.th", true, false, false},
|
||||
- {"youtube.co.ug", true, false, false},
|
||||
- {"youtube.co.uk", true, false, false},
|
||||
- {"youtube.co.ve", true, false, false},
|
||||
- {"youtube.co.za", true, false, false},
|
||||
- {"youtube.com", true, false, false},
|
||||
- {"youtube.com.ar", true, false, false},
|
||||
- {"youtube.com.au", true, false, false},
|
||||
- {"youtube.com.az", true, false, false},
|
||||
- {"youtube.com.bh", true, false, false},
|
||||
- {"youtube.com.bo", true, false, false},
|
||||
- {"youtube.com.br", true, false, false},
|
||||
- {"youtube.com.by", true, false, false},
|
||||
- {"youtube.com.co", true, false, false},
|
||||
- {"youtube.com.do", true, false, false},
|
||||
- {"youtube.com.ee", true, false, false},
|
||||
- {"youtube.com.eg", true, false, false},
|
||||
- {"youtube.com.es", true, false, false},
|
||||
- {"youtube.com.gh", true, false, false},
|
||||
- {"youtube.com.gr", true, false, false},
|
||||
- {"youtube.com.gt", true, false, false},
|
||||
- {"youtube.com.hk", true, false, false},
|
||||
- {"youtube.com.hr", true, false, false},
|
||||
- {"youtube.com.jm", true, false, false},
|
||||
- {"youtube.com.jo", true, false, false},
|
||||
- {"youtube.com.kw", true, false, false},
|
||||
- {"youtube.com.lb", true, false, false},
|
||||
- {"youtube.com.lv", true, false, false},
|
||||
- {"youtube.com.mk", true, false, false},
|
||||
- {"youtube.com.mt", true, false, false},
|
||||
- {"youtube.com.mx", true, false, false},
|
||||
- {"youtube.com.my", true, false, false},
|
||||
- {"youtube.com.ng", true, false, false},
|
||||
- {"youtube.com.om", true, false, false},
|
||||
- {"youtube.com.pe", true, false, false},
|
||||
- {"youtube.com.ph", true, false, false},
|
||||
- {"youtube.com.pk", true, false, false},
|
||||
- {"youtube.com.pt", true, false, false},
|
||||
- {"youtube.com.qa", true, false, false},
|
||||
- {"youtube.com.ro", true, false, false},
|
||||
- {"youtube.com.sa", true, false, false},
|
||||
- {"youtube.com.sg", true, false, false},
|
||||
- {"youtube.com.tn", true, false, false},
|
||||
- {"youtube.com.tr", true, false, false},
|
||||
- {"youtube.com.tw", true, false, false},
|
||||
- {"youtube.com.ua", true, false, false},
|
||||
- {"youtube.com.uy", true, false, false},
|
||||
- {"youtube.com.ve", true, false, false},
|
||||
- {"youtube.cz", true, false, false},
|
||||
- {"youtube.de", true, false, false},
|
||||
- {"youtube.dk", true, false, false},
|
||||
- {"youtube.ee", true, false, false},
|
||||
- {"youtube.es", true, false, false},
|
||||
- {"youtube.fi", true, false, false},
|
||||
- {"youtube.fr", true, false, false},
|
||||
- {"youtube.ge", true, false, false},
|
||||
- {"youtube.gr", true, false, false},
|
||||
- {"youtube.gt", true, false, false},
|
||||
- {"youtube.hk", true, false, false},
|
||||
- {"youtube.hr", true, false, false},
|
||||
- {"youtube.hu", true, false, false},
|
||||
- {"youtube.ie", true, false, false},
|
||||
- {"youtube.in", true, false, false},
|
||||
- {"youtube.is", true, false, false},
|
||||
- {"youtube.it", true, false, false},
|
||||
- {"youtube.jo", true, false, false},
|
||||
- {"youtube.jp", true, false, false},
|
||||
- {"youtube.kr", true, false, false},
|
||||
- {"youtube.lk", true, false, false},
|
||||
- {"youtube.lt", true, false, false},
|
||||
- {"youtube.lv", true, false, false},
|
||||
- {"youtube.ma", true, false, false},
|
||||
- {"youtube.md", true, false, false},
|
||||
- {"youtube.me", true, false, false},
|
||||
- {"youtube.mk", true, false, false},
|
||||
- {"youtube.mx", true, false, false},
|
||||
- {"youtube.my", true, false, false},
|
||||
- {"youtube.ng", true, false, false},
|
||||
- {"youtube.nl", true, false, false},
|
||||
- {"youtube.no", true, false, false},
|
||||
- {"youtube.pe", true, false, false},
|
||||
- {"youtube.ph", true, false, false},
|
||||
- {"youtube.pk", true, false, false},
|
||||
- {"youtube.pl", true, false, false},
|
||||
- {"youtube.pr", true, false, false},
|
||||
- {"youtube.pt", true, false, false},
|
||||
- {"youtube.qa", true, false, false},
|
||||
- {"youtube.ro", true, false, false},
|
||||
- {"youtube.rs", true, false, false},
|
||||
- {"youtube.ru", true, false, false},
|
||||
- {"youtube.sa", true, false, false},
|
||||
- {"youtube.se", true, false, false},
|
||||
- {"youtube.sg", true, false, false},
|
||||
- {"youtube.si", true, false, false},
|
||||
- {"youtube.sk", true, false, false},
|
||||
- {"youtube.sn", true, false, false},
|
||||
- {"youtube.tn", true, false, false},
|
||||
- {"youtube.ua", true, false, false},
|
||||
- {"youtube.ug", true, false, false},
|
||||
- {"youtube.uy", true, false, false},
|
||||
- {"youtube.vn", true, false, false},
|
||||
- {"youtubeeducation.com", true, false, false},
|
||||
- {"youtubemobilesupport.com", true, false, false},
|
||||
- {"ytimg.com", true, false, false},
|
||||
-
|
||||
- // Origins without subdomains and with same-origin collectors.
|
||||
- {"accounts.google.com", false, true, false},
|
||||
- {"apis.google.com", false, true, false},
|
||||
- {"app.google.stackdriver.com", false, true, false},
|
||||
- {"b.mail.google.com", false, true, false},
|
||||
- {"chatenabled.mail.google.com", false, true, false},
|
||||
- {"ddm.google.com", false, true, false},
|
||||
- {"gmail.com", false, true, false},
|
||||
- {"gmail.google.com", false, true, false},
|
||||
- {"mail-attachment.googleusercontent.com", false, true, false},
|
||||
- {"mail.google.com", false, true, false},
|
||||
- {"www.gmail.com", false, true, false},
|
||||
-
|
||||
- // Origins without subdomains or same-origin collectors.
|
||||
- {"ad.doubleclick.net", false, false, false},
|
||||
- {"drive.google.com", false, false, false},
|
||||
- {"redirector.googlevideo.com", false, false, false},
|
||||
-};
|
||||
-
|
||||
-const char* const kGoogleStandardCollectors[] = {
|
||||
- "https://beacons.gcp.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons2.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons3.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons4.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons5.gvt2.com/domainreliability/upload",
|
||||
- "https://beacons5.gvt3.com/domainreliability/upload",
|
||||
- "https://clients2.google.com/domainreliability/upload",
|
||||
-};
|
||||
-
|
||||
-const char* const kGoogleOriginSpecificCollectorPathString =
|
||||
- "/domainreliability/upload";
|
||||
-
|
||||
-static std::unique_ptr<DomainReliabilityConfig> CreateGoogleConfig(
|
||||
- const GoogleConfigParams& params,
|
||||
- bool is_www) {
|
||||
- if (is_www)
|
||||
- DCHECK(params.duplicate_for_www);
|
||||
-
|
||||
- std::string hostname = (is_www ? "www." : "") + std::string(params.hostname);
|
||||
- bool include_subdomains = params.include_subdomains && !is_www;
|
||||
-
|
||||
- std::unique_ptr<DomainReliabilityConfig> config(
|
||||
- new DomainReliabilityConfig());
|
||||
- config->origin = GURL("https://" + hostname + "/");
|
||||
- config->include_subdomains = include_subdomains;
|
||||
- config->collectors.clear();
|
||||
- if (params.include_origin_specific_collector) {
|
||||
- GURL::Replacements replacements;
|
||||
- replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString);
|
||||
- config->collectors.push_back(
|
||||
- std::make_unique<GURL>(config->origin.ReplaceComponents(replacements)));
|
||||
- }
|
||||
- for (size_t i = 0; i < arraysize(kGoogleStandardCollectors); i++)
|
||||
- config->collectors.push_back(
|
||||
- std::make_unique<GURL>(kGoogleStandardCollectors[i]));
|
||||
- config->success_sample_rate = 0.05;
|
||||
- config->failure_sample_rate = 1.00;
|
||||
- config->path_prefixes.clear();
|
||||
- return config;
|
||||
-}
|
||||
-
|
||||
-} // namespace
|
||||
-
|
||||
// static
|
||||
void GetAllGoogleConfigs(
|
||||
std::vector<std::unique_ptr<DomainReliabilityConfig>>* configs_out) {
|
||||
configs_out->clear();
|
||||
-
|
||||
- for (auto& params : kGoogleConfigs) {
|
||||
- configs_out->push_back(CreateGoogleConfig(params, false));
|
||||
- if (params.duplicate_for_www)
|
||||
- configs_out->push_back(CreateGoogleConfig(params, true));
|
||||
- }
|
||||
}
|
||||
|
||||
} // namespace domain_reliability
|
||||
diff --git a/components/domain_reliability/uploader.cc b/components/domain_reliability/uploader.cc
|
||||
--- a/components/domain_reliability/uploader.cc
|
||||
+++ b/components/domain_reliability/uploader.cc
|
||||
@@ -82,7 +82,7 @@ class DomainReliabilityUploaderImpl
|
||||
if (discard_uploads_)
|
||||
discarded_upload_count_++;
|
||||
|
||||
- if (discard_uploads_ || shutdown_) {
|
||||
+ if (true) {
|
||||
VLOG(1) << "Discarding report instead of uploading.";
|
||||
UploadResult result;
|
||||
result.status = UploadResult::SUCCESS;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 17 Sep 2018 21:50:15 +0200
|
||||
Subject: ungoogled-chromium: Disable Network Time Tracker
|
||||
|
||||
This connects to Google to check if the system time is correct when a website certificate
|
||||
date seems incorrect, according to https://bugs.chromium.org/p/chromium/issues/detail?id=725232
|
||||
|
||||
Fixes https://github.com/Eloston/ungoogled-chromium/issues/302
|
||||
---
|
||||
components/network_time/network_time_tracker.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/network_time/network_time_tracker.cc b/components/network_time/network_time_tracker.cc
|
||||
--- a/components/network_time/network_time_tracker.cc
|
||||
+++ b/components/network_time/network_time_tracker.cc
|
||||
@@ -277,7 +277,7 @@ void NetworkTimeTracker::UpdateNetworkTime(base::Time network_time,
|
||||
}
|
||||
|
||||
bool NetworkTimeTracker::AreTimeFetchesEnabled() const {
|
||||
- return base::FeatureList::IsEnabled(kNetworkTimeServiceQuerying);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
NetworkTimeTracker::FetchBehavior NetworkTimeTracker::GetFetchBehavior() const {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 17 Sep 2018 21:55:33 +0200
|
||||
Subject: ungoogled-chromium: Remove third_party/analytics
|
||||
|
||||
---
|
||||
ui/webui/resources/webui_resources.grd | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/ui/webui/resources/webui_resources.grd b/ui/webui/resources/webui_resources.grd
|
||||
--- a/ui/webui/resources/webui_resources.grd
|
||||
+++ b/ui/webui/resources/webui_resources.grd
|
||||
@@ -15,7 +15,6 @@ without changes to the corresponding grd file. -->
|
||||
<includes>
|
||||
<include name="IDR_WEBUI_I18N_TEMPLATE_JS" file="js/i18n_template.js" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_WEBUI_JSTEMPLATE_JS" file="js/jstemplate_compiled.js" flattenhtml="true" type="BINDATA" />
|
||||
- <include name="IDR_WEBUI_ANALYTICS_JS" file="js/analytics.js" flattenhtml="true" type="BINDATA" compress="gzip" />
|
||||
<!-- Roboto Font. Roboto-Regular and Roboto-Light is already available on
|
||||
Android, and Roboto-Medium is not used on Android. All 6 weights of
|
||||
Roboto are available on Chrome OS.-->
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 17 Sep 2018 21:57:19 +0200
|
||||
Subject: ungoogled-chromium: Always use local DevTools files instead of remote
|
||||
files from Google
|
||||
|
||||
NOTE: This can break Remote Debugging
|
||||
This also fixes local debugging with domain substitution
|
||||
Related comment: https://bugs.chromium.org/p/chromium/issues/detail?id=710701#c14
|
||||
---
|
||||
third_party/blink/renderer/devtools/BUILD.gn | 6 ++----
|
||||
third_party/blink/renderer/devtools/front_end/audits2_worker.json | 2 +-
|
||||
third_party/blink/renderer/devtools/front_end/devtools_app.json | 6 +++---
|
||||
third_party/blink/renderer/devtools/front_end/shell.json | 4 ++--
|
||||
third_party/blink/renderer/devtools/front_end/worker_app.json | 2 +-
|
||||
5 files changed, 9 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/devtools/BUILD.gn b/third_party/blink/renderer/devtools/BUILD.gn
|
||||
--- a/third_party/blink/renderer/devtools/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/devtools/BUILD.gn
|
||||
@@ -1162,10 +1162,8 @@ action("generate_devtools_grd") {
|
||||
devtools_embedder_scripts +
|
||||
[ "$resources_out_dir/devtools_extension_api.js" ]
|
||||
|
||||
- # Bundle remote modules in ChromeOS.
|
||||
- if (is_chromeos) {
|
||||
- grd_files += generated_remote_modules + devtools_emulated_devices_images
|
||||
- }
|
||||
+ # Always bundle remote modules.
|
||||
+ grd_files += generated_remote_modules + devtools_emulated_devices_images
|
||||
|
||||
inputs = grd_files + devtools_image_files
|
||||
outfile = "$root_gen_dir/devtools/devtools_resources.grd"
|
||||
diff --git a/third_party/blink/renderer/devtools/front_end/audits2_worker.json b/third_party/blink/renderer/devtools/front_end/audits2_worker.json
|
||||
--- a/third_party/blink/renderer/devtools/front_end/audits2_worker.json
|
||||
+++ b/third_party/blink/renderer/devtools/front_end/audits2_worker.json
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"modules": [
|
||||
{ "name": "worker_service", "type": "autostart" },
|
||||
- { "name": "audits2_worker", "type": "remote" }
|
||||
+ { "name": "audits2_worker" }
|
||||
]
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/devtools/front_end/devtools_app.json b/third_party/blink/renderer/devtools/front_end/devtools_app.json
|
||||
--- a/third_party/blink/renderer/devtools/front_end/devtools_app.json
|
||||
+++ b/third_party/blink/renderer/devtools/front_end/devtools_app.json
|
||||
@@ -4,7 +4,7 @@
|
||||
{ "name": "inspector_main", "type": "autostart" },
|
||||
{ "name": "mobile_throttling", "type": "autostart" },
|
||||
|
||||
- { "name": "accessibility", "type": "remote" },
|
||||
+ { "name": "accessibility" },
|
||||
{ "name": "animation" },
|
||||
{ "name": "audits2" },
|
||||
{ "name": "browser_console" },
|
||||
@@ -12,14 +12,14 @@
|
||||
{ "name": "cookie_table" },
|
||||
{ "name": "devices" },
|
||||
{ "name": "elements" },
|
||||
- { "name": "emulated_devices" , "type": "remote" },
|
||||
+ { "name": "emulated_devices" },
|
||||
{ "name": "har_importer" },
|
||||
{ "name": "help" },
|
||||
{ "name": "layers" },
|
||||
{ "name": "layer_viewer" },
|
||||
{ "name": "network" },
|
||||
{ "name": "performance_monitor" },
|
||||
- { "name": "product_registry_impl", "type": "remote" },
|
||||
+ { "name": "product_registry_impl" },
|
||||
{ "name": "resources" },
|
||||
{ "name": "security" },
|
||||
{ "name": "timeline" },
|
||||
diff --git a/third_party/blink/renderer/devtools/front_end/shell.json b/third_party/blink/renderer/devtools/front_end/shell.json
|
||||
--- a/third_party/blink/renderer/devtools/front_end/shell.json
|
||||
+++ b/third_party/blink/renderer/devtools/front_end/shell.json
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
{ "name": "changes" },
|
||||
{ "name": "cm" },
|
||||
- { "name": "cm_modes", "type": "remote" },
|
||||
+ { "name": "cm_modes" },
|
||||
{ "name": "color_picker" },
|
||||
{ "name": "console" },
|
||||
{ "name": "coverage" },
|
||||
@@ -41,7 +41,7 @@
|
||||
{ "name": "snippets" },
|
||||
{ "name": "source_frame" },
|
||||
{ "name": "sources" },
|
||||
- { "name": "terminal", "type": "remote" },
|
||||
+ { "name": "terminal" },
|
||||
{ "name": "text_editor" },
|
||||
{ "name": "workspace_diff" },
|
||||
{ "name": "protocol_monitor"}
|
||||
diff --git a/third_party/blink/renderer/devtools/front_end/worker_app.json b/third_party/blink/renderer/devtools/front_end/worker_app.json
|
||||
--- a/third_party/blink/renderer/devtools/front_end/worker_app.json
|
||||
+++ b/third_party/blink/renderer/devtools/front_end/worker_app.json
|
||||
@@ -11,7 +11,7 @@
|
||||
{ "name": "help" },
|
||||
{ "name": "layer_viewer" },
|
||||
{ "name": "network" },
|
||||
- { "name": "product_registry_impl", "type": "remote" },
|
||||
+ { "name": "product_registry_impl" },
|
||||
{ "name": "resources" },
|
||||
{ "name": "timeline" },
|
||||
{ "name": "timeline_model" }
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ Subject: Disable Omaha update checks
|
||||
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
|
||||
@@ -122,7 +122,7 @@ public class OmahaBase {
|
||||
@@ -134,7 +134,7 @@ public class OmahaBase {
|
||||
|
||||
/** See {@link #sIsDisabled}. */
|
||||
static boolean isDisabled() {
|
||||
@@ -19,5 +19,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:45:21 +0100
|
||||
Subject: ungoogled-chromium: Clear HTTP cache menu item
|
||||
|
||||
Adds a menu item under "More tools" to clear the HTTP authentication cache on demand
|
||||
---
|
||||
chrome/app/chrome_command_ids.h | 1 +
|
||||
chrome/app/generated_resources.grd | 6 ++++++
|
||||
chrome/browser/ui/browser_command_controller.cc | 7 +++++++
|
||||
chrome/browser/ui/toolbar/app_menu_model.cc | 8 ++++++++
|
||||
chrome/browser/ui/toolbar/app_menu_model.h | 1 +
|
||||
chrome/browser/ui/views/frame/global_menu_bar_x11.cc | 1 +
|
||||
net/http/http_auth_cache.cc | 4 ++++
|
||||
net/http/http_auth_cache.h | 2 ++
|
||||
tools/metrics/histograms/enums.xml | 1 +
|
||||
tools/metrics/histograms/histograms.xml | 1 +
|
||||
10 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -150,6 +150,7 @@
|
||||
#define IDC_DEV_TOOLS_INSPECT 40023
|
||||
#define IDC_UPGRADE_DIALOG 40024
|
||||
#define IDC_VIEW_INCOMPATIBILITIES 40025
|
||||
+#define IDC_CLEAR_HTTP_AUTH_CACHE 40026
|
||||
#define IDC_SHOW_KEYBOARD_OVERLAY 40027
|
||||
#define IDC_PROFILING_ENABLED 40028
|
||||
#define IDC_BOOKMARKS_MENU 40029
|
||||
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
|
||||
@@ -1050,6 +1050,9 @@ are declared in build/common.gypi.
|
||||
<message name="IDS_CLEAR_BROWSING_DATA" desc="The text label for the menu item for clearing of browsing data">
|
||||
&Clear browsing data...
|
||||
</message>
|
||||
+ <message name="IDS_CLEAR_HTTP_AUTH_CACHE" desc="The text label for the menu item for clearing the HTTP authentication cache">
|
||||
+ Clear &HTTP auth cache
|
||||
+ </message>
|
||||
<message name="IDS_SHOW_DOWNLOADS" desc="The show downloads menu in the app menu">
|
||||
&Downloads
|
||||
</message>
|
||||
@@ -1088,6 +1091,9 @@ are declared in build/common.gypi.
|
||||
<message name="IDS_CLEAR_BROWSING_DATA" desc="In Title Case: The text label for the menu item for clearing of browsing data">
|
||||
&Clear Browsing Data...
|
||||
</message>
|
||||
+ <message name="IDS_CLEAR_HTTP_AUTH_CACHE" desc="In Title Case: The text label for the menu item for clearing the HTTP authentication cache">
|
||||
+ Clear &HTTP Auth Cache
|
||||
+ </message>
|
||||
<message name="IDS_SHOW_DOWNLOADS" desc="In Title Case: The show downloads menu in the app menu">
|
||||
&Downloads
|
||||
</message>
|
||||
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -59,6 +59,9 @@
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "printing/features/features.h"
|
||||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
+#include "net/url_request/url_request_context.h"
|
||||
+#include "net/url_request/url_request_context_getter.h"
|
||||
+#include "net/http/http_transaction_factory.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "chrome/browser/ui/browser_commands_mac.h"
|
||||
@@ -624,6 +627,9 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
case IDC_CLEAR_BROWSING_DATA:
|
||||
ShowClearBrowsingDataDialog(browser_);
|
||||
break;
|
||||
+ case IDC_CLEAR_HTTP_AUTH_CACHE:
|
||||
+ profile()->GetRequestContext()->GetURLRequestContext()->http_transaction_factory()->GetSession()->http_auth_cache()->Clear();
|
||||
+ break;
|
||||
case IDC_IMPORT_SETTINGS:
|
||||
ShowImportDialog(browser_);
|
||||
break;
|
||||
@@ -865,6 +871,7 @@ void BrowserCommandController::InitCommandState() {
|
||||
!profile()->IsOffTheRecord());
|
||||
command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA,
|
||||
!guest_session);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_CLEAR_HTTP_AUTH_CACHE, true);
|
||||
#if defined(OS_CHROMEOS)
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true);
|
||||
#else
|
||||
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -215,6 +215,7 @@ void ToolsMenuModel::Build(Browser* browser) {
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA);
|
||||
+ AddItemWithStringId(IDC_CLEAR_HTTP_AUTH_CACHE, IDS_CLEAR_HTTP_AUTH_CACHE);
|
||||
AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS);
|
||||
if (chrome::CanOpenTaskManager())
|
||||
AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
|
||||
@@ -475,6 +476,13 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
|
||||
}
|
||||
LogMenuAction(MENU_ACTION_CLEAR_BROWSING_DATA);
|
||||
break;
|
||||
+ case IDC_CLEAR_HTTP_AUTH_CACHE:
|
||||
+ if (!uma_action_recorded_) {
|
||||
+ UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ClearHttpAuthCache",
|
||||
+ delta);
|
||||
+ }
|
||||
+ LogMenuAction(MENU_ACTION_CLEAR_HTTP_AUTH_CACHE);
|
||||
+ break;
|
||||
case IDC_VIEW_SOURCE:
|
||||
if (!uma_action_recorded_)
|
||||
UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ViewSource", delta);
|
||||
diff --git a/chrome/browser/ui/toolbar/app_menu_model.h b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -76,6 +76,7 @@ enum AppMenuAction {
|
||||
MENU_ACTION_OPEN_IN_CHROME = 48,
|
||||
MENU_ACTION_SITE_SETTINGS = 49,
|
||||
MENU_ACTION_APP_INFO = 50,
|
||||
+ MENU_ACTION_CLEAR_HTTP_AUTH_CACHE = 51,
|
||||
LIMIT_MENU_ACTION
|
||||
};
|
||||
|
||||
diff --git a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
--- a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
+++ b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
@@ -225,6 +225,7 @@ GlobalMenuBarCommand tools_menu[] = {
|
||||
|
||||
{IDS_TASK_MANAGER, IDC_TASK_MANAGER},
|
||||
{IDS_CLEAR_BROWSING_DATA, IDC_CLEAR_BROWSING_DATA},
|
||||
+ {IDS_CLEAR_HTTP_AUTH_CACHE, IDC_CLEAR_HTTP_AUTH_CACHE},
|
||||
|
||||
{MENU_SEPARATOR, MENU_SEPARATOR},
|
||||
|
||||
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc
|
||||
--- a/net/http/http_auth_cache.cc
|
||||
+++ b/net/http/http_auth_cache.cc
|
||||
@@ -250,6 +250,10 @@ bool HttpAuthCache::Remove(const GURL& origin,
|
||||
return false;
|
||||
}
|
||||
|
||||
+void HttpAuthCache::Clear() {
|
||||
+ entries_.clear();
|
||||
+}
|
||||
+
|
||||
void HttpAuthCache::ClearEntriesAddedWithin(base::TimeDelta duration) {
|
||||
base::TimeTicks begin_time = base::TimeTicks::Now() - duration;
|
||||
base::EraseIf(entries_, [begin_time](const Entry& entry) {
|
||||
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
|
||||
--- a/net/http/http_auth_cache.h
|
||||
+++ b/net/http/http_auth_cache.h
|
||||
@@ -166,6 +166,8 @@ class NET_EXPORT HttpAuthCache {
|
||||
HttpAuth::Scheme scheme,
|
||||
const AuthCredentials& credentials);
|
||||
|
||||
+ void Clear();
|
||||
+
|
||||
// Clears cache entries created within |duration| of base::TimeTicks::Now().
|
||||
void ClearEntriesAddedWithin(base::TimeDelta duration);
|
||||
|
||||
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
|
||||
--- a/tools/metrics/histograms/enums.xml
|
||||
+++ b/tools/metrics/histograms/enums.xml
|
||||
@@ -47004,6 +47004,7 @@ Called by update_traffic_annotation_histograms.py.-->
|
||||
<int value="48" label="Open in Chrome"/>
|
||||
<int value="49" label="Site Settings"/>
|
||||
<int value="50" label="App Info"/>
|
||||
+ <int value="51" label="Clear HTTP auth cache"/>
|
||||
</enum>
|
||||
|
||||
<enum name="XFrameOptions">
|
||||
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
|
||||
--- a/tools/metrics/histograms/histograms.xml
|
||||
+++ b/tools/metrics/histograms/histograms.xml
|
||||
@@ -104632,6 +104632,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
|
||||
<suffix name="Overestimate"
|
||||
label="Tracks when the compositor's estimates were too high and by how
|
||||
much."/>
|
||||
+ <suffix name="ClearHttpAuthCache" label="Clear HTTP authentication cache"/>
|
||||
<suffix name="Underestimate"
|
||||
label="Tracks when the compositor's estimates were too low and by how
|
||||
much."/>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 27 Oct 2018 17:54:01 +0200
|
||||
Subject: Disable update scheduler
|
||||
|
||||
---
|
||||
.../chromium/chrome/browser/component_updater/UpdateScheduler.java | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 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
|
||||
@@ -35,10 +35,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) {
|
||||
@@ -108,4 +105,4 @@ public class UpdateScheduler {
|
||||
|
||||
private native void nativeOnStartTask(long nativeBackgroundTaskUpdateScheduler);
|
||||
private native void nativeOnStopTask(long nativeBackgroundTaskUpdateScheduler);
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
From: NoChromo <nochromo@nochromo.com>
|
||||
Date: Sun, 3 Apr 2016 12:44:50 +0800
|
||||
Subject: url_request: hooks and ad url data
|
||||
|
||||
---
|
||||
net/BUILD.gn | 2 +
|
||||
net/url_request/nochromo_intercept.cc | 116 ++++++++++++++++++++++++++++++++++
|
||||
net/url_request/nochromo_intercept.h | 13 ++++
|
||||
net/url_request/url_request.cc | 4 ++
|
||||
4 files changed, 135 insertions(+)
|
||||
create mode 100644 net/url_request/nochromo_intercept.cc
|
||||
create mode 100644 net/url_request/nochromo_intercept.h
|
||||
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1748,6 +1748,8 @@ component("net") {
|
||||
"url_request/url_fetcher_response_writer.h",
|
||||
"url_request/url_range_request_job.cc",
|
||||
"url_request/url_range_request_job.h",
|
||||
+ "url_request/nochromo_intercept.cc",
|
||||
+ "url_request/nochromo_intercept.h",
|
||||
"url_request/url_request.cc",
|
||||
"url_request/url_request.h",
|
||||
"url_request/url_request_context.cc",
|
||||
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/nochromo_intercept.cc
|
||||
@@ -0,0 +1,116 @@
|
||||
+#include "url/gurl.h"
|
||||
+#include "net/url_request/nochromo_entries.h"
|
||||
+
|
||||
+#include <android/log.h>
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+#define NOCHROMO_LOG 0
|
||||
+#define NOCHROMO_LOG_MORE 0
|
||||
+
|
||||
+static char* strtolower(const char* str) {
|
||||
+ int len = strlen(str);
|
||||
+ char* ret = (char*)malloc(len + 1);
|
||||
+ ret[len] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static char* strtosep(const char* str) {
|
||||
+ int len = strlen(str);
|
||||
+ char* ret = (char*)malloc(len + 3);
|
||||
+ ret[0] = '^';
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
|
||||
+ ret[i + 1] = '^';
|
||||
+ } else {
|
||||
+ ret[i + 1] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int nochromo_intercept(const GURL& url) {
|
||||
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ const char* c_url = url.spec().c_str();
|
||||
+ char* c_url_lower = strtolower(c_url);
|
||||
+ char* c_url_sep = strtosep(c_url);
|
||||
+ char* c_url_lower_sep = strtosep(c_url_lower);
|
||||
+
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
|
||||
+
|
||||
+ bool intercept = false;
|
||||
+ for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
|
||||
+ nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
|
||||
+
|
||||
+ // no use checking rules when we're intercepting, or exceptions when not
|
||||
+ bool check =
|
||||
+ (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
|
||||
+ (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
|
||||
+
|
||||
+ if (check) {
|
||||
+ bool match = false;
|
||||
+
|
||||
+ // select comparison string based on case and separator presence (separator takes some shortcuts)
|
||||
+ bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
|
||||
+ bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
|
||||
+ const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
+
|
||||
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
|
||||
+
|
||||
+ // check for all match parts at >= position of last match
|
||||
+ const char* last = match_url;
|
||||
+ for (int m = 0; m < entry->matchcount; m++) {
|
||||
+ const char* pos = strstr(last, entry->matches[m]);
|
||||
+ match = (pos != NULL);
|
||||
+
|
||||
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
+
|
||||
+ // check if the url starts with the first match part
|
||||
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
|
||||
+
|
||||
+ // check if the url ends with the last match part
|
||||
+ if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
|
||||
+
|
||||
+ // check domain match
|
||||
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
|
||||
+
|
||||
+ // short circuit
|
||||
+ if (!match) break;
|
||||
+ }
|
||||
+
|
||||
+ if (match) {
|
||||
+ if (NOCHROMO_LOG) {
|
||||
+ if (!intercept) {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
|
||||
+ } else {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
|
||||
+ }
|
||||
+ }
|
||||
+ intercept = !intercept;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ free(c_url_sep);
|
||||
+ free(c_url_lower);
|
||||
+ free(c_url_lower_sep);
|
||||
+
|
||||
+ if (intercept) {
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
\ No newline at end of file
|
||||
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/nochromo_intercept.h
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
+
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+GURL nochromo_intercepted = GURL("http://127.0.0.1/");
|
||||
+int nochromo_intercept(const GURL& url);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_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
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
+#include "net/url_request/nochromo_intercept.h"
|
||||
+
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
#include "net/network_error_logging/network_error_logging_service.h"
|
||||
#include "net/reporting/reporting_service.h"
|
||||
@@ -581,6 +583,8 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
+ if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
|
||||
+
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(
|
||||
NetLogEventType::REQUEST_ALIVE,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+1
-1
@@ -711,5 +711,5 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,584 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 28 Mar 2018 15:55:11 +0200
|
||||
Subject: Bromite adblock engine
|
||||
|
||||
Ported from NoChromo patch
|
||||
Make interception testable
|
||||
Add domain support
|
||||
Re-land: third-party filters support
|
||||
---
|
||||
net/BUILD.gn | 9 +-
|
||||
net/url_request/adblock_intercept.cc | 324 ++++++++++++++++++++++++++++++++++
|
||||
net/url_request/adblock_intercept.h | 16 ++
|
||||
net/url_request/nochromo_intercept.cc | 116 ------------
|
||||
net/url_request/nochromo_intercept.h | 13 --
|
||||
net/url_request/url_request.cc | 19 +-
|
||||
6 files changed, 364 insertions(+), 133 deletions(-)
|
||||
create mode 100644 net/url_request/adblock_intercept.cc
|
||||
create mode 100644 net/url_request/adblock_intercept.h
|
||||
delete mode 100644 net/url_request/nochromo_intercept.cc
|
||||
delete mode 100644 net/url_request/nochromo_intercept.h
|
||||
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1748,8 +1748,6 @@ component("net") {
|
||||
"url_request/url_fetcher_response_writer.h",
|
||||
"url_request/url_range_request_job.cc",
|
||||
"url_request/url_range_request_job.h",
|
||||
- "url_request/nochromo_intercept.cc",
|
||||
- "url_request/nochromo_intercept.h",
|
||||
"url_request/url_request.cc",
|
||||
"url_request/url_request.h",
|
||||
"url_request/url_request_context.cc",
|
||||
@@ -1810,6 +1808,13 @@ component("net") {
|
||||
"//third_party/zlib",
|
||||
]
|
||||
|
||||
+ if (is_android) {
|
||||
+ sources += [
|
||||
+ "url_request/adblock_intercept.cc",
|
||||
+ "url_request/adblock_intercept.h"
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
if (enable_reporting) {
|
||||
sources += [
|
||||
"network_error_logging/network_error_logging_delegate.cc",
|
||||
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.cc
|
||||
@@ -0,0 +1,324 @@
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+#include <cstddef>
|
||||
+#include <cstdlib>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include "log.h"
|
||||
+#include <tld.h>
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
+#include <android/log.h>
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#include "net/url_request/adblock_entries.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+const char *LOG_TAG = "Bromite";
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count() { return ADBLOCK_ENTRY_COUNT; }
|
||||
+#endif
|
||||
+
|
||||
+// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
|
||||
+// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
|
||||
+// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
|
||||
+// string in |tld|, if specified and the |host| can be parsed.
|
||||
+static bool is_first_party(char *l_host, char *l_url_host) {
|
||||
+ size_t tld_length;
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+ char *found_tld;
|
||||
+
|
||||
+ if (TLD_SUCCESS != tld_get_z(l_host, &found_tld))
|
||||
+ return false;
|
||||
+ tld_length = strlen(found_tld);
|
||||
+ if (tld_length == 0)
|
||||
+ return false;
|
||||
+#else
|
||||
+ tld_length = net::registry_controlled_domains::GetCanonicalHostRegistryLength(
|
||||
+ l_host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
||||
+ net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
||||
+ if ((tld_length == 0) || (tld_length == std::string::npos))
|
||||
+ return false;
|
||||
+#endif
|
||||
+
|
||||
+ int len = strlen(l_host);
|
||||
+ char *tld = l_host + len - tld_length;
|
||||
+
|
||||
+ // Removes any subdomain from origin host.
|
||||
+ int i = len - tld_length - 2, top_i = i;
|
||||
+ if (i < 0) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ char *domain = l_host;
|
||||
+ for (; i >= 0; i--) {
|
||||
+ if (l_host[i] == '.') {
|
||||
+ int p_len = top_i - i;
|
||||
+ // skip "co" in "co.uk", "org" in "org.uk"
|
||||
+ if (p_len <= 3) {
|
||||
+ tld -= p_len + 1;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // segment is long enough, accept it at as a domain
|
||||
+ domain = l_host + i;
|
||||
+ len -= i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "%s: extracted domain suffix: \"%s\" (TLD=\"%s\")",
|
||||
+ l_host, domain, tld);
|
||||
+#endif
|
||||
+
|
||||
+ // Check if supplied URL host matches, including the dot.
|
||||
+ int b_len = strlen(l_url_host);
|
||||
+ if (b_len < len) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if (l_url_host[b_len - 1 - i] != domain[len - 1 - i])
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // pass with flying colors
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static char *strtolower(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 1);
|
||||
+ ret[len] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static char *strtosep(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 3);
|
||||
+ ret[0] = '^';
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') ||
|
||||
+ (str[i] == '&') || (str[i] == '=')) {
|
||||
+ ret[i + 1] = '^';
|
||||
+ } else {
|
||||
+ ret[i + 1] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static bool url_matches(const char *c_url, char *c_url_sep, char *c_url_lower,
|
||||
+ char *c_url_lower_sep, adblock_entry *entry) {
|
||||
+ bool match = false;
|
||||
+ // select comparison string based on case and separator presence (separator
|
||||
+ // takes some shortcuts)
|
||||
+ bool match_case = ((entry->flags & ADBLOCK_FLAG_MATCH_CASE) != 0);
|
||||
+ bool match_separator = ((entry->flags & ADBLOCK_FLAG_HAS_SEPARATOR) != 0);
|
||||
+ const char *match_url =
|
||||
+ match_case ? (match_separator ? c_url_sep : c_url)
|
||||
+ : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[case:%d][sep:%d][%s]",
|
||||
+ match_case, match_separator, match_url);
|
||||
+#endif
|
||||
+ // check for all match parts at >= position of last match
|
||||
+ const char *last = match_url;
|
||||
+ for (int m = 0; const char *url_match = entry->matches[m]; m++) {
|
||||
+ bool is_last_match = entry->matches[m + 1] == NULL;
|
||||
+ const char *pos = strstr(last, url_match);
|
||||
+ match = (pos != NULL);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s][found:%d][match:%d]",
|
||||
+ entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
+#endif
|
||||
+ // check if the url starts with the first match part
|
||||
+ if (match && (m == 0) && ((entry->flags & ADBLOCK_FLAG_MATCH_BEGIN) != 0) &&
|
||||
+ (pos != match_url))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check if the url ends with the last match part
|
||||
+ if (match && is_last_match &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_END) != 0) &&
|
||||
+ (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])]))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check domain match
|
||||
+ if (match && (m == 0) &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_DOMAIN) != 0) &&
|
||||
+ (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') &&
|
||||
+ (pos[-1] != '/'))
|
||||
+ match = false;
|
||||
+
|
||||
+ // short circuit
|
||||
+ if (!match)
|
||||
+ break;
|
||||
+ }
|
||||
+ return match;
|
||||
+}
|
||||
+
|
||||
+bool url_match_domain(adblock_entry *entry, const std::string &origin_host) {
|
||||
+ bool match_domain = true;
|
||||
+ // check for a negative domain match
|
||||
+ if (entry->domains_neg) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains_neg[d]; d++) {
|
||||
+ if (domain == origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // check for a required positive domain match
|
||||
+ if (entry->domains) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
|
||||
+ if (domain != origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return match_domain;
|
||||
+}
|
||||
+
|
||||
+static bool url_match_party(adblock_entry *entry, const GURL &url,
|
||||
+ const std::string &origin_host, bool &checked_fp,
|
||||
+ bool &fp) {
|
||||
+ bool wanted_fp;
|
||||
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
|
||||
+ wanted_fp = false;
|
||||
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
|
||||
+ wanted_fp = true;
|
||||
+ } else {
|
||||
+ // no-op
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (origin_host.empty()) {
|
||||
+ // cannot match this rule, no origin host to determine first/third party
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
|
||||
+// matchFirstParty, matchThirdParty);
|
||||
+#endif
|
||||
+ if (!checked_fp) {
|
||||
+ // lower-case version
|
||||
+ char *l_host = strtolower(origin_host.c_str()),
|
||||
+ *l_url_host = strtolower(url.host().c_str());
|
||||
+
|
||||
+ // is the URL a first-party to the current page's host?
|
||||
+ fp = is_first_party(l_host, l_url_host);
|
||||
+
|
||||
+ checked_fp = true;
|
||||
+#ifdef ADB_TESTER
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
|
||||
+ l_url_host, fp ? "true" : "false");
|
||||
+#endif
|
||||
+ free(l_host);
|
||||
+ free(l_url_host);
|
||||
+ }
|
||||
+
|
||||
+ return fp == wanted_fp;
|
||||
+}
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host) {
|
||||
+ // if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ // return 0;
|
||||
+ // }
|
||||
+
|
||||
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ const char *c_url = url.spec().c_str();
|
||||
+ char *c_url_lower = strtolower(c_url);
|
||||
+ char *c_url_sep = strtosep(c_url);
|
||||
+ char *c_url_lower_sep = strtosep(c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
|
||||
+ c_url, url.host().c_str(), origin_host.c_str());
|
||||
+#endif
|
||||
+
|
||||
+ bool checked_fp = false, fp = false;
|
||||
+
|
||||
+ bool intercept = false;
|
||||
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
|
||||
+ adblock_entry *entry = &ADBLOCK_ENTRIES[i];
|
||||
+
|
||||
+ // no use checking rules when we're intercepting, or exceptions when not
|
||||
+ bool check =
|
||||
+ (!intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) == 0)) ||
|
||||
+ (intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) != 0));
|
||||
+ if (!check)
|
||||
+ continue;
|
||||
+
|
||||
+ // first check for domain matches, a quick branch out if matching
|
||||
+ if (!url_match_domain(entry, origin_host))
|
||||
+ continue;
|
||||
+
|
||||
+ // check on the URL matcher
|
||||
+ if (!url_matches(c_url, c_url_sep, c_url_lower, c_url_lower_sep, entry))
|
||||
+ continue;
|
||||
+
|
||||
+ // finally check first/third-party
|
||||
+ if (!url_match_party(entry, url, origin_host, checked_fp, fp))
|
||||
+ continue;
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ if (!intercept) {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "--> intercept (#%d: \"%s\") (%x)", i,
|
||||
+ entry->matches[0], entry->flags);
|
||||
+ } else {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "--> pass (%d) (#%d)", i,
|
||||
+ entry->flags);
|
||||
+ }
|
||||
+#endif
|
||||
+ intercept = !intercept;
|
||||
+ } // for each entry
|
||||
+
|
||||
+ free(c_url_sep);
|
||||
+ free(c_url_lower);
|
||||
+ free(c_url_lower_sep);
|
||||
+
|
||||
+ if (intercept) {
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
|
||||
+#endif
|
||||
+ return 1;
|
||||
+ }
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
|
||||
+#endif
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.h
|
||||
@@ -0,0 +1,16 @@
|
||||
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count();
|
||||
+#endif
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
|
||||
deleted file mode 100644
|
||||
--- a/net/url_request/nochromo_intercept.cc
|
||||
+++ /dev/null
|
||||
@@ -1,116 +0,0 @@
|
||||
-#include "url/gurl.h"
|
||||
-#include "net/url_request/nochromo_entries.h"
|
||||
-
|
||||
-#include <android/log.h>
|
||||
-
|
||||
-namespace net {
|
||||
-
|
||||
-#define NOCHROMO_LOG 0
|
||||
-#define NOCHROMO_LOG_MORE 0
|
||||
-
|
||||
-static char* strtolower(const char* str) {
|
||||
- int len = strlen(str);
|
||||
- char* ret = (char*)malloc(len + 1);
|
||||
- ret[len] = '\0';
|
||||
- for (int i = 0; i < len; i++) {
|
||||
- if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
- ret[i] = str[i] + 32;
|
||||
- } else {
|
||||
- ret[i] = str[i];
|
||||
- }
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static char* strtosep(const char* str) {
|
||||
- int len = strlen(str);
|
||||
- char* ret = (char*)malloc(len + 3);
|
||||
- ret[0] = '^';
|
||||
- ret[len + 1] = '^';
|
||||
- ret[len + 2] = '\0';
|
||||
- for (int i = 0; i < len; i++) {
|
||||
- if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
|
||||
- ret[i + 1] = '^';
|
||||
- } else {
|
||||
- ret[i + 1] = str[i];
|
||||
- }
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-int nochromo_intercept(const GURL& url) {
|
||||
- if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
- const char* c_url = url.spec().c_str();
|
||||
- char* c_url_lower = strtolower(c_url);
|
||||
- char* c_url_sep = strtosep(c_url);
|
||||
- char* c_url_lower_sep = strtosep(c_url_lower);
|
||||
-
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
|
||||
-
|
||||
- bool intercept = false;
|
||||
- for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
|
||||
- nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
|
||||
-
|
||||
- // no use checking rules when we're intercepting, or exceptions when not
|
||||
- bool check =
|
||||
- (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
|
||||
- (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
|
||||
-
|
||||
- if (check) {
|
||||
- bool match = false;
|
||||
-
|
||||
- // select comparison string based on case and separator presence (separator takes some shortcuts)
|
||||
- bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
|
||||
- bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
|
||||
- const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
-
|
||||
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
|
||||
-
|
||||
- // check for all match parts at >= position of last match
|
||||
- const char* last = match_url;
|
||||
- for (int m = 0; m < entry->matchcount; m++) {
|
||||
- const char* pos = strstr(last, entry->matches[m]);
|
||||
- match = (pos != NULL);
|
||||
-
|
||||
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
-
|
||||
- // check if the url starts with the first match part
|
||||
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
|
||||
-
|
||||
- // check if the url ends with the last match part
|
||||
- if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
|
||||
-
|
||||
- // check domain match
|
||||
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
|
||||
-
|
||||
- // short circuit
|
||||
- if (!match) break;
|
||||
- }
|
||||
-
|
||||
- if (match) {
|
||||
- if (NOCHROMO_LOG) {
|
||||
- if (!intercept) {
|
||||
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
|
||||
- } else {
|
||||
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
|
||||
- }
|
||||
- }
|
||||
- intercept = !intercept;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- free(c_url_sep);
|
||||
- free(c_url_lower);
|
||||
- free(c_url_lower_sep);
|
||||
-
|
||||
- if (intercept) {
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
|
||||
- return 1;
|
||||
- }
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-} // namespace net
|
||||
\ No newline at end of file
|
||||
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
|
||||
deleted file mode 100644
|
||||
--- a/net/url_request/nochromo_intercept.h
|
||||
+++ /dev/null
|
||||
@@ -1,13 +0,0 @@
|
||||
-#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
-#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
-
|
||||
-#include "url/gurl.h"
|
||||
-
|
||||
-namespace net {
|
||||
-
|
||||
-GURL nochromo_intercepted = GURL("http://127.0.0.1/");
|
||||
-int nochromo_intercept(const GURL& url);
|
||||
-
|
||||
-} // namespace net
|
||||
-
|
||||
-#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_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
|
||||
@@ -43,7 +43,9 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
-#include "net/url_request/nochromo_intercept.h"
|
||||
+#if defined(OS_ANDROID)
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
+#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
#include "net/network_error_logging/network_error_logging_service.h"
|
||||
@@ -558,7 +560,9 @@ URLRequest::URLRequest(const GURL& url,
|
||||
: context->network_delegate()),
|
||||
net_log_(NetLogWithSource::Make(context->net_log(),
|
||||
NetLogSourceType::URL_REQUEST)),
|
||||
+#if !defined(OS_ANDROID)
|
||||
url_chain_(1, url),
|
||||
+#endif
|
||||
method_("GET"),
|
||||
referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE),
|
||||
first_party_url_policy_(NEVER_CHANGE_FIRST_PARTY_URL),
|
||||
@@ -583,7 +587,18 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
- if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
|
||||
+#if defined(OS_ANDROID)
|
||||
+ std::string initiatorHost;
|
||||
+ if (initiator_.has_value()) {
|
||||
+ initiatorHost = initiator_.value().host();
|
||||
+ }
|
||||
+
|
||||
+ if (adblock_intercept(url, initiatorHost)) {
|
||||
+ url_chain_ = { url, GURL("http://127.0.0.1") };
|
||||
+ } else {
|
||||
+ url_chain_ = { url };
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+4
-4
@@ -15,12 +15,12 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 100
|
||||
+ "kCurrentDataVersion": 101
|
||||
- "kCurrentDataVersion": 103
|
||||
+ "kCurrentDataVersion": 104
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -232,6 +232,16 @@
|
||||
@@ -247,6 +247,16 @@
|
||||
"id": 56
|
||||
},
|
||||
|
||||
@@ -710,5 +710,5 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 21 Mar 2018 14:15:28 +0100
|
||||
Subject: User Agent: anonymize
|
||||
|
||||
Remove device name and build id
|
||||
---
|
||||
content/common/user_agent.cc | 25 ++-----------------------
|
||||
1 file changed, 2 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
|
||||
--- a/content/common/user_agent.cc
|
||||
+++ b/content/common/user_agent.cc
|
||||
@@ -79,26 +79,6 @@ std::string BuildOSCpuInfo() {
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
std::string android_version_str = base::SysInfo::OperatingSystemVersion();
|
||||
-
|
||||
- std::string android_info_str;
|
||||
-
|
||||
- // Send information about the device.
|
||||
- bool semicolon_inserted = false;
|
||||
- std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename();
|
||||
- std::string android_device_name = base::SysInfo::HardwareModelName();
|
||||
- if ("REL" == android_build_codename && android_device_name.size() > 0) {
|
||||
- android_info_str += "; " + android_device_name;
|
||||
- semicolon_inserted = true;
|
||||
- }
|
||||
-
|
||||
- // Append the build ID.
|
||||
- std::string android_build_id = base::SysInfo::GetAndroidBuildID();
|
||||
- if (android_build_id.size() > 0) {
|
||||
- if (!semicolon_inserted) {
|
||||
- android_info_str += ";";
|
||||
- }
|
||||
- android_info_str += " Build/" + android_build_id;
|
||||
- }
|
||||
#endif
|
||||
|
||||
base::StringAppendF(
|
||||
@@ -121,9 +101,8 @@ std::string BuildOSCpuInfo() {
|
||||
os_minor_version,
|
||||
os_bugfix_version
|
||||
#elif defined(OS_ANDROID)
|
||||
- "Android %s%s",
|
||||
- android_version_str.c_str(),
|
||||
- android_info_str.c_str()
|
||||
+ "Android %s",
|
||||
+ android_version_str.c_str()
|
||||
#else
|
||||
"%s %s",
|
||||
unixinfo.sysname, // e.g. Linux
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 11 Dec 2017 22:42:11 +0100
|
||||
Subject: Added Google English-only engine
|
||||
Subject: Add English-only search engine
|
||||
|
||||
Add a Google search engine that forces languages to English,
|
||||
disable from all its searches RLZ and field experiments querystring parameters.
|
||||
@@ -17,18 +17,18 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 101
|
||||
+ "kCurrentDataVersion": 102
|
||||
- "kCurrentDataVersion": 104
|
||||
+ "kCurrentDataVersion": 105
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -154,6 +154,27 @@
|
||||
@@ -159,6 +159,27 @@
|
||||
"id": 1
|
||||
},
|
||||
|
||||
+ "googleen": {
|
||||
+ "name": "GoogleEN",
|
||||
+ "keyword": "google.co.uk",
|
||||
+ "name": "Google in English",
|
||||
+ "keyword": "googleen",
|
||||
+ "favicon_url": "https://www.google.com/favicon.ico",
|
||||
+ "search_url": "{google:baseURL}search?q={searchTerms}&{google:originalQueryForSuggestion}{google:iOSSearchLanguage}{google:searchClient}{google:contextualSearchVersion}ie={inputEncoding}&hl=en",
|
||||
+ "suggest_url": "{google:baseSuggestURL}search?client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:pageClassification}{google:searchVersion}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}&hl=en",
|
||||
@@ -723,5 +723,5 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+17
-6
@@ -3,10 +3,10 @@ Date: Mon, 12 Mar 2018 20:31:44 +0100
|
||||
Subject: Add Qwant search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 13 +-
|
||||
.../search_engines/prepopulated_engines.json | 24 ++-
|
||||
components/search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
|
||||
3 files changed, 122 insertions(+), 110 deletions(-)
|
||||
3 files changed, 133 insertions(+), 110 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
@@ -15,15 +15,26 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 102
|
||||
+ "kCurrentDataVersion": 103
|
||||
- "kCurrentDataVersion": 105
|
||||
+ "kCurrentDataVersion": 106
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -939,6 +939,17 @@
|
||||
@@ -954,6 +954,28 @@
|
||||
"id": 6
|
||||
},
|
||||
|
||||
+ "qwant": {
|
||||
+ "name": "Qwant",
|
||||
+ "keyword": "qwant.com",
|
||||
+ "favicon_url": "https://www.qwant.com/favicon.ico",
|
||||
+ "search_url": "https://www.qwant.com/?client=opensearch&q={searchTerms}",
|
||||
+ "suggest_url": "https://api.qwant.com/api/suggest/?client=opensearch&q={searchTerms}",
|
||||
+ "image_url": "https://www.qwant.com/?t=images&q={searchTerms}",
|
||||
+ "type": "SEARCH_ENGINE_QWANT",
|
||||
+ "id": 14
|
||||
+ },
|
||||
+
|
||||
+ "qwant": {
|
||||
+ "name": "Qwant",
|
||||
+ "keyword": "qwant.com",
|
||||
@@ -711,5 +722,5 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ Subject: Fix crash when accessing page info / site settings
|
||||
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
|
||||
--- a/chrome/browser/permissions/permission_manager.cc
|
||||
+++ b/chrome/browser/permissions/permission_manager.cc
|
||||
@@ -623,6 +623,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
|
||||
@@ -677,6 +677,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
|
||||
GURL canonical_requesting_origin =
|
||||
GetCanonicalOrigin(requesting_origin, embedding_origin);
|
||||
PermissionContextBase* context = GetPermissionContext(permission);
|
||||
@@ -20,5 +20,5 @@ diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/p
|
||||
render_frame_host, canonical_requesting_origin.GetOrigin(),
|
||||
embedding_origin.GetOrigin());
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+4
-4
@@ -59,7 +59,7 @@ diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
|
||||
# GCC and clang flags. MSVS (is_win && !is_clang) does not use cflags.
|
||||
if (!is_win || is_clang) {
|
||||
cflags += [
|
||||
@@ -128,6 +143,14 @@ source_set("common") {
|
||||
@@ -129,6 +144,14 @@ source_set("common") {
|
||||
}
|
||||
include_dirs = openh264_common_include_dirs
|
||||
|
||||
@@ -74,7 +74,7 @@ diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
@@ -154,6 +177,14 @@ source_set("processing") {
|
||||
@@ -155,6 +178,14 @@ source_set("processing") {
|
||||
}
|
||||
include_dirs = openh264_processing_include_dirs
|
||||
|
||||
@@ -89,7 +89,7 @@ diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
@@ -173,6 +204,14 @@ source_set("encoder") {
|
||||
@@ -174,6 +205,14 @@ source_set("encoder") {
|
||||
}
|
||||
include_dirs = openh264_encoder_include_dirs
|
||||
|
||||
@@ -105,5 +105,5 @@ diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Oct 2017 10:09:41 +0200
|
||||
Subject: Inject scripts for AMP, tracking, ads and video functionality
|
||||
|
||||
Remove AMP, tracking and ads from search results
|
||||
Break Page Visibility API and Fullscreen API for youtube.com and vimeo.com to
|
||||
allow playing videos in background (original Javascript code by timdream)
|
||||
Send a random key press to circumvent idle status detection
|
||||
---
|
||||
third_party/blink/renderer/core/dom/BUILD.gn | 2 ++
|
||||
third_party/blink/renderer/core/dom/document.cc | 28 +++++++++++++++++++++-
|
||||
.../renderer/core/dom/extensions/anti_amp_cure.h | 6 +++++
|
||||
.../renderer/core/dom/extensions/video_bg_play.h | 6 +++++
|
||||
4 files changed, 41 insertions(+), 1 deletion(-)
|
||||
create mode 100644 third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
create mode 100644 third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/BUILD.gn b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
--- a/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
@@ -146,6 +146,8 @@ blink_core_sources("dom") {
|
||||
"global_event_handlers.h",
|
||||
"icon_url.cc",
|
||||
"icon_url.h",
|
||||
+ "extensions/dont-track-me.h",
|
||||
+ "extensions/video-bg-play.h",
|
||||
"id_target_observer.cc",
|
||||
"id_target_observer.h",
|
||||
"id_target_observer_registry.cc",
|
||||
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
|
||||
@@ -233,6 +233,7 @@
|
||||
#include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h"
|
||||
#include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"
|
||||
#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
|
||||
+#include "extensions/video_bg_play.h"
|
||||
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
|
||||
#include "third_party/blink/renderer/core/paint/first_meaningful_paint_detector.h"
|
||||
#include "third_party/blink/renderer/core/paint/paint_layer.h"
|
||||
@@ -291,6 +292,8 @@
|
||||
#include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/time.h"
|
||||
|
||||
+#include "extensions/anti_amp_cure.h"
|
||||
+
|
||||
#ifndef NDEBUG
|
||||
using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>;
|
||||
static WeakDocumentSet& liveDocumentSet();
|
||||
@@ -6088,8 +6091,31 @@ void Document::FinishedParsing() {
|
||||
fetcher_->ClearResourcesFromPreviousFetcher();
|
||||
}
|
||||
|
||||
- if (IsPrefetchOnly())
|
||||
+ if (IsPrefetchOnly()) {
|
||||
WebPrerenderingSupport::Current()->PrefetchFinished();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // determine whether this is a Google search results page
|
||||
+ const WTF::String& host = url_.Host();
|
||||
+ auto* bodyElement = body();
|
||||
+ if (bodyElement) {
|
||||
+ size_t pos = host.Find(".google.");
|
||||
+ if ((pos != WTF::kNotFound) && (host.length() - pos - 8 < 4)) {
|
||||
+ LOG(INFO) << "injecting anti-AMP-cure Javascript payload, URL: " << url_.GetString();
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(ANTI_AMP_CURE_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+
|
||||
+ // check for eligibility of the video bg fix
|
||||
+ if ((WTF::kNotFound != host.Find("youtube.com")) || (WTF::kNotFound != host.Find("vimeo.com"))) {
|
||||
+ LOG(INFO) << "injecting video-bg-play Javascript payload, URL: " << url_.GetString();
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(VIDEO_BG_PLAY_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+ } // has origin and body element
|
||||
}
|
||||
|
||||
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
|
||||
diff --git a/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h b/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef anti_amp_cure_h
|
||||
+#define anti_amp_cure_h
|
||||
+
|
||||
+#define ANTI_AMP_CURE_JS "/* Bromite click-tracking and AMP removal v0.3.5 */\n\nfunction recreateHyperlink(a) {\n // skip already-sanitized hyperlinks\n if (a.sane) return false;\n\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n // property set when hyperlink has been created by this script\n newA.sane = 1;\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return false;\n }\n // leave original href unchanged\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n return true;\n}\n\nfunction isResult(a) {\n if (a.getAttribute('data-amp-cur'))\n return true;\n var inlineMousedown = a.getAttribute('onmousedown');\n if (!inlineMousedown)\n\treturn false;\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n return /\\ba?rwt\\(/.test(inlineMousedown) || /\\bctpacw\\b/.test(inlineMousedown);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname.indexOf('www.google.') == 0) &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAds() {\n // scan all divs\n var div = document.getElementById('tads');\n if (div) {\n div.style.display = 'none';\n\treturn true;\n }\n return false;\n}\n\nfunction sanitizeAll() {\n console.log(\"ads removed: \", sanitizeAds());\n console.log(\"hyperlinks sanitized: \", sanitizeAllHyperlinks(document));\n}\n\nfunction hookMoreResults() {\n var extrares = document.getElementById('extrares');\n if (!extrares) {\n console.log(\"could not hook more results\");\n return;\n }\n // mutation observers are great but they don't work\n extrares.addEventListener(\"DOMNodeInserted\", function(e) {\n var node = e.target;\n if (node.id && node.id.startsWith(\"arc-srp\"))\n console.log(\"hyperlinks sanitized on new result node: \", sanitizeAllHyperlinks(node));\n });\n}\n\nfunction setMlogoClick() {\n var mlogo = document.getElementById('qslc');\n if (mlogo && mlogo.children[0]) {\n mlogo = mlogo.children[0];\n mlogo.removeAttribute(\"href\");\n mlogo.setAttribute(\"onclick\", \"sanitizeAll()\");\n console.log(\"logo link replaced\");\n } else {\n console.log(\"could not replace logo link\");\n }\n}\n\nfunction sanitizeAllHyperlinks(rootNode) {\n var saned = 0, total = 0;\n rootNode.querySelectorAll('div[data-hveid]:not([data-hveid=\"\"]) a').forEach(function(a) {\n\ttotal++;\n\tvar res = recreateHyperlink(a);\n\tif (res) saned++;\n });\n console.log(\"sanitized \", saned, \"/\", total, \" hyperlinks\");\n\n return saned;\n}\n\n// avoid running cleanup on non-search pages\nif ((document.location.host.indexOf(\"images.google.\") == -1) && \n (document.location.host.indexOf(\"accounts.google.\") == -1) &&\n (document.location.host.indexOf(\"news.google.\") == -1)) {\n sanitizeAll();\n}\nsetMlogoClick();\n\nhookMoreResults();\n"
|
||||
+
|
||||
+#endif // anti_amp_cure_h
|
||||
diff --git a/third_party/blink/renderer/core/dom/extensions/video_bg_play.h b/third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef video_bg_play_h
|
||||
+#define video_bg_play_h
|
||||
+
|
||||
+#define VIDEO_BG_PLAY_JS "'use strict';\n\n/* generate a synthetic keypress to circumvent the extremely useful pause-and-prompt beaviour */\nsetInterval(function() {\n document.dispatchEvent(new KeyboardEvent(\"keydown\", {key : \"a\", char : \"a\", shiftKey: false}));\n}, 3 * 60 * 1000);\n\n/* video background play fix - original version by timdream */\ndocument.videoBGFix = {};\n\n// Page Visibility API\nObject.defineProperties(document.videoBGFix,\n { 'hidden': {value: false}, 'visibilityState': {value: 'visible'} });\n\nwindow.addEventListener(\n 'visibilitychange', evt => evt.stopImmediatePropagation(), true);\nwindow.addEventListener(\n 'blur', evt => evt.stopImmediatePropagation(), true);\n\n// Fullscreen API\nwindow.addEventListener('fullscreenchange', evt => {\n Object.defineProperties(document.videoBGFix,\n { 'fullscreenEnabled': {value: true},\n 'fullscreen': {value: true},\n 'fullscreenElement': {value: document.fullscreenElement.videoBGFix}});\n window.addEventListener(\n 'fullscreenchange', evt => evt.stopImmediatePropagation(), true);\n}, { capture: true, once: true });\n"
|
||||
+
|
||||
+#endif // video_bg_play_h
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
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 | 11 ++++++++++-
|
||||
media/blink/webmediaplayer_impl.h | 2 ++
|
||||
2 files changed, 12 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
|
||||
@@ -908,6 +908,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());
|
||||
@@ -3053,7 +3059,10 @@ bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
|
||||
// If suspending background video, pause any video that's not remoted or
|
||||
// not unlocked to play in the background.
|
||||
if (IsBackgroundSuspendEnabled(delegate_)) {
|
||||
- if (!HasVideo())
|
||||
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
|
||||
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
|
||||
+ //streams be played in background.
|
||||
+ if (!HasVideoNonEmptySize())
|
||||
return false;
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
|
||||
--- a/media/blink/webmediaplayer_impl.h
|
||||
+++ b/media/blink/webmediaplayer_impl.h
|
||||
@@ -161,6 +161,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.11.0
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 2 Apr 2018 11:36:02 +0200
|
||||
Subject: Punt the Widevine version string
|
||||
|
||||
Originally from http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.wily.beta/view/head:/debian/patches/fix_building_widevinecdm_with_chromium.patch
|
||||
---
|
||||
chrome/common/chrome_content_client.cc | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
|
||||
--- a/chrome/common/chrome_content_client.cc
|
||||
+++ b/chrome/common/chrome_content_client.cc
|
||||
@@ -238,10 +238,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
|
||||
info.is_out_of_process = true;
|
||||
info.path = adapter_path;
|
||||
info.name = kWidevineCdmDisplayName;
|
||||
- info.description =
|
||||
- base::StringPrintf("%s (version: " WIDEVINE_CDM_VERSION_STRING ")",
|
||||
- kWidevineCdmDescription);
|
||||
- info.version = WIDEVINE_CDM_VERSION_STRING;
|
||||
+ info.description = kWidevineCdmDescription;
|
||||
info.permissions = kWidevineCdmPluginPermissions;
|
||||
|
||||
content::WebPluginMimeType mime_type(kWidevineCdmPluginMimeType,
|
||||
@@ -566,7 +563,7 @@ void ChromeContentClient::AddContentDecryptionModules(
|
||||
// CdmInfo needs |path| to be the actual Widevine library,
|
||||
// not the adapter, so adjust as necessary. It will be in the
|
||||
// same directory as the installed adapter.
|
||||
- const base::Version version(WIDEVINE_CDM_VERSION_STRING);
|
||||
+ const base::Version version("1.0.123.456");
|
||||
DCHECK(version.IsValid());
|
||||
|
||||
cdms->push_back(content::CdmInfo(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
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 | 5 +++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
media/base/media_switches.cc | 6 +-----
|
||||
4 files changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
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
|
||||
@@ -3439,6 +3439,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kUseGoogleLocalNtp)},
|
||||
#endif // !defined(OS_ANDROID)
|
||||
|
||||
+ {"resume-background-video",
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
+
|
||||
#if defined(OS_MACOSX)
|
||||
{"mac-rtl", flag_descriptions::kMacRTLName,
|
||||
flag_descriptions::kMacRTLDescription, kOsMac,
|
||||
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
|
||||
@@ -759,6 +759,11 @@ const char kEnablePictureInPictureName[] = "Enable Picture-in-Picture.";
|
||||
const char kEnablePictureInPictureDescription[] =
|
||||
"Enable the Picture-in-Picture feature for videos.";
|
||||
|
||||
+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
|
||||
@@ -470,6 +470,9 @@ extern const char kOOPHPStackModePseudo[];
|
||||
extern const char kEnablePictureInPictureName[];
|
||||
extern const char kEnablePictureInPictureDescription[];
|
||||
|
||||
+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
|
||||
@@ -221,11 +221,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
|
||||
};
|
||||
|
||||
// Display the Cast overlay button on the media controls.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Apr 2018 08:30:26 +0200
|
||||
Subject: Enable DNS-over-HTTPS by default
|
||||
|
||||
---
|
||||
components/network_session_configurator/common/network_features.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -10,6 +10,6 @@ const base::Feature kTokenBinding{"token-binding",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kDnsOverHttps{"dns-over-https",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
} // namespace features
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 11 Jan 2018 13:27:34 +0200
|
||||
Subject: Open YouTube links in Bromite
|
||||
|
||||
---
|
||||
.../chrome/browser/externalnav/ExternalNavigationHandler.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
@@ -386,6 +386,13 @@ public class ExternalNavigationHandler {
|
||||
return OverrideUrlLoadingResult.NO_OVERRIDE;
|
||||
}
|
||||
|
||||
+ // Force to open YouTube urls in Bromite
|
||||
+ String intentPackageName = intent.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;
|
||||
+ }
|
||||
+
|
||||
// Sanitize the Intent, ensuring web pages can not bypass browser
|
||||
// security (only access to BROWSABLE activities).
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
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 | 2 ++
|
||||
.../java/src/org/chromium/chrome/browser/ChromeActivity.java | 2 ++
|
||||
.../org/chromium/chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 3 +++
|
||||
4 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -80,6 +80,8 @@
|
||||
android:title="@string/menu_help" />
|
||||
<item android:id="@+id/enter_vr_id"
|
||||
android:title="@string/enter_vr" />
|
||||
+ <item android:id="@+id/exit_id"
|
||||
+ android:title="@string/menu_exit" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only in the tab switcher -->
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -2100,6 +2100,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
RecordUserAction.record("MobileMenuSettings");
|
||||
} else if (id == R.id.show_menu) {
|
||||
showAppMenuForKeyboardEvent();
|
||||
+ } else if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
} else if (id == R.id.find_in_page_id) {
|
||||
if (mFindToolbarManager == null) return false;
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
@@ -87,7 +87,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
|
||||
|
||||
// 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/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -2992,6 +2992,9 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_PREFERENCES" desc="Menu item for opening browser preferences. [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.11.0
|
||||
|
||||
-130
@@ -1,130 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 30 Mar 2018 10:09:03 +0200
|
||||
Subject: Add fingerprinting mitigation for getClientRects,
|
||||
getBoundingClientRect
|
||||
|
||||
Scale the result of Range::getClientRects and Element::getBoundingClientRect
|
||||
by a random +/-3% of the original value for each float in the Rect/Quad.
|
||||
The random value is generated once for each Document and re-used for all the
|
||||
attached elements.
|
||||
The rationale is that such value, albeit constant within the rendered Document,
|
||||
is within the same order of magniture of the floating point precision being
|
||||
used for fingerprinting and sufficient to poison the well.
|
||||
|
||||
See also: http://www.gsd.inesc-id.pt/~mpc/pubs/fingerprinting-trustcom2016.pdf
|
||||
---
|
||||
third_party/WebKit/Source/core/dom/Document.cpp | 14 ++++++++++++++
|
||||
third_party/WebKit/Source/core/dom/Document.h | 5 +++++
|
||||
third_party/WebKit/Source/core/dom/Element.cpp | 7 +++++++
|
||||
third_party/WebKit/Source/core/dom/Range.cpp | 8 +++++++-
|
||||
4 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
--- a/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
||||
@@ -272,6 +272,8 @@
|
||||
#include "services/service_manager/public/cpp/interface_provider.h"
|
||||
#include "third_party/WebKit/public/mojom/page/page_visibility_state.mojom-blink.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+
|
||||
#ifndef NDEBUG
|
||||
using WeakDocumentSet =
|
||||
blink::PersistentHeapHashSet<blink::WeakMember<blink::Document>>;
|
||||
@@ -731,6 +733,10 @@ Document::Document(const DocumentInit& initializer,
|
||||
#ifndef NDEBUG
|
||||
liveDocumentSet().insert(this);
|
||||
#endif
|
||||
+
|
||||
+ // add +/- 3% noise against fingerprinting
|
||||
+ shuffleFactorX_ = 1 + (base::RandDouble() - 0.5) * 0.03;
|
||||
+ shuffleFactorY_ = 1 + (base::RandDouble() - 0.5) * 0.03;
|
||||
}
|
||||
|
||||
Document::~Document() {
|
||||
@@ -757,6 +763,14 @@ Range* Document::CreateRangeAdjustedToTreeScope(const TreeScope& tree_scope,
|
||||
Position::BeforeNode(*shadow_host));
|
||||
}
|
||||
|
||||
+double Document::GetShuffleFactorX() {
|
||||
+ return shuffleFactorX_;
|
||||
+}
|
||||
+
|
||||
+double Document::GetShuffleFactorY() {
|
||||
+ return shuffleFactorY_;
|
||||
+}
|
||||
+
|
||||
SelectorQueryCache& Document::GetSelectorQueryCache() {
|
||||
if (!selector_query_cache_)
|
||||
selector_query_cache_ = std::make_unique<SelectorQueryCache>();
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
|
||||
--- a/third_party/WebKit/Source/core/dom/Document.h
|
||||
+++ b/third_party/WebKit/Source/core/dom/Document.h
|
||||
@@ -406,6 +406,9 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
String origin() const;
|
||||
|
||||
+ double GetShuffleFactorX();
|
||||
+ double GetShuffleFactorY();
|
||||
+
|
||||
String visibilityState() const;
|
||||
mojom::PageVisibilityState GetPageVisibilityState() const;
|
||||
bool hidden() const;
|
||||
@@ -1663,6 +1666,8 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
double start_time_;
|
||||
|
||||
+ double shuffleFactorX_, shuffleFactorY_;
|
||||
+
|
||||
TraceWrapperMember<ScriptRunner> script_runner_;
|
||||
|
||||
HeapVector<Member<ScriptElementBase>> current_script_stack_;
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
|
||||
--- a/third_party/WebKit/Source/core/dom/Element.cpp
|
||||
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
|
||||
@@ -1327,6 +1327,11 @@ DOMRectList* Element::getClientRects() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
|
||||
quads, *element_layout_object);
|
||||
+
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
@@ -1344,6 +1349,8 @@ DOMRect* Element::getBoundingClientRect() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
+ result.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
|
||||
+
|
||||
return DOMRect::FromFloatRect(result);
|
||||
}
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
|
||||
--- a/third_party/WebKit/Source/core/dom/Range.cpp
|
||||
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
|
||||
@@ -1589,11 +1589,17 @@ DOMRectList* Range::getClientRects() const {
|
||||
Vector<FloatQuad> quads;
|
||||
GetBorderAndTextQuads(quads);
|
||||
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
DOMRect* Range::getBoundingClientRect() const {
|
||||
- return DOMRect::FromFloatRect(BoundingRect());
|
||||
+ auto rect = BoundingRect();
|
||||
+ rect.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
|
||||
+ return DOMRect::FromFloatRect(rect);
|
||||
}
|
||||
|
||||
// TODO(editing-dev): We should make
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 2 May 2018 01:04:07 +0200
|
||||
Subject: Disable custom tab activities permanently
|
||||
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/LaunchIntentDispatcher.java | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
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
|
||||
@@ -149,9 +149,10 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
recordIntentMetrics();
|
||||
|
||||
mIsVrIntent = VrIntentUtils.isVrIntent(mIntent);
|
||||
- boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
|
||||
- || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
|
||||
- mIsCustomTabIntent = isCustomTabIntent;
|
||||
+ //boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
|
||||
+ // || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
|
||||
+ //mIsCustomTabIntent = isCustomTabIntent;
|
||||
+ mIsCustomTabIntent = false;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 01:32:28 +0200
|
||||
Subject: Remove help menu item
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 2 --
|
||||
.../java/src/org/chromium/chrome/browser/ChromeActivity.java | 9 ---------
|
||||
.../java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 3 ---
|
||||
.../chromium/chrome/browser/customtabs/CustomTabActivity.java | 2 +-
|
||||
4 files changed, 1 insertion(+), 15 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -76,8 +76,6 @@
|
||||
android:icon="@drawable/reader_mode_prefs_icon" />
|
||||
<item android:id="@+id/preferences_id"
|
||||
android:title="@string/menu_preferences" />
|
||||
- <item android:id="@+id/help_id"
|
||||
- android:title="@string/menu_help" />
|
||||
<item android:id="@+id/enter_vr_id"
|
||||
android:title="@string/enter_vr" />
|
||||
<item android:id="@+id/exit_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
|
||||
@@ -2124,15 +2124,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
|
||||
final Tab currentTab = getActivityTab();
|
||||
|
||||
- if (id == R.id.help_id) {
|
||||
- String url = currentTab != null ? currentTab.getUrl() : "";
|
||||
- Profile profile = mTabModelSelector.isIncognitoSelected()
|
||||
- ? Profile.getLastUsedProfile().getOffTheRecordProfile()
|
||||
- : Profile.getLastUsedProfile().getOriginalProfile();
|
||||
- startHelpAndFeedback(url, "MobileMenuFeedback", profile);
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
// All the code below assumes currentTab is not null, so return early if it is null.
|
||||
if (currentTab == null) {
|
||||
return false;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
@@ -341,9 +341,6 @@ public class KeyboardShortcuts {
|
||||
tab = activity.getActivityTab();
|
||||
if (tab != null && tab.canGoForward()) tab.goForward();
|
||||
return true;
|
||||
- case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+?
|
||||
- activity.onMenuOrKeyboardAction(R.id.help_id, false);
|
||||
- return true;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
@@ -1314,7 +1314,7 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
|
||||
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
|
||||
// Disable creating new tabs, bookmark, history, print, help, focus_url, etc.
|
||||
if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id
|
||||
- || id == R.id.help_id || id == R.id.recent_tabs_menu_id
|
||||
+ || id == R.id.recent_tabs_menu_id
|
||||
|| id == R.id.new_incognito_tab_menu_id || id == R.id.new_tab_menu_id
|
||||
|| id == R.id.open_history_menu_id) {
|
||||
return true;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+61
-35
@@ -7,19 +7,26 @@ Subject: Add menu option to toggle global Javascript preference
|
||||
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 35 ++++++++++++++++++++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
|
||||
.../java/strings/android_chrome_strings.grd | 11 +++++++
|
||||
7 files changed, 89 insertions(+)
|
||||
7 files changed, 92 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -49,6 +49,19 @@
|
||||
@@ -49,6 +49,7 @@
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:orderInCategory="2" />
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null"
|
||||
android:orderInCategory="2">
|
||||
@@ -61,6 +62,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_javascript_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
@@ -32,20 +39,27 @@ diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null"
|
||||
android:orderInCategory="2">
|
||||
<!-- Title is intentionally left blank in xml and will be set in java. -->
|
||||
<item android:id="@+id/open_in_browser_id"
|
||||
android:title=""
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -59,6 +59,19 @@
|
||||
@@ -61,6 +61,7 @@
|
||||
android:title="@string/menu_add_to_homescreen" />
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk" />
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null">
|
||||
<menu>
|
||||
@@ -71,6 +72,18 @@
|
||||
android:checkable="true" />
|
||||
</menu>
|
||||
</item>
|
||||
+
|
||||
+ <item android:id="@+id/enable_javascript_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ android:title="@null">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_javascript_id"
|
||||
+ android:title="@string/menu_enable_javascript" />
|
||||
@@ -55,23 +69,23 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null">
|
||||
<menu>
|
||||
<item android:id="@+id/reader_mode_prefs_id"
|
||||
android:title="@string/menu_reader_mode_prefs"
|
||||
android:icon="@drawable/reader_mode_prefs_icon" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -2006,6 +2006,14 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
@@ -2195,6 +2195,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
final boolean usingDesktopUserAgent = currentTab.getUseDesktopUserAgent();
|
||||
currentTab.setUseDesktopUserAgent(!usingDesktopUserAgent, reloadOnChange);
|
||||
RecordUserAction.record("MobileMenuRequestDesktopSite");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
|
||||
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.reader_mode_prefs_id) {
|
||||
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
|
||||
@@ -79,17 +93,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.
|
||||
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
|
||||
@@ -1796,6 +1796,14 @@ public class ChromeTabbedActivity
|
||||
@@ -1718,6 +1718,14 @@ public class ChromeTabbedActivity
|
||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
|
||||
}
|
||||
RecordUserAction.record("MobileMenuDownloadManager");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
|
||||
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.open_recently_closed_tab) {
|
||||
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
|
||||
@@ -97,7 +111,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -213,6 +213,8 @@ public class AppMenuPropertiesDelegate {
|
||||
@@ -25,6 +25,7 @@ import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeActivity;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.ChromeSwitches;
|
||||
+import org.chromium.chrome.browser.ContentSettingsType;
|
||||
import org.chromium.chrome.browser.ShortcutHelper;
|
||||
import org.chromium.chrome.browser.UrlConstants;
|
||||
import org.chromium.chrome.browser.banners.AppBannerManager;
|
||||
@@ -209,6 +210,8 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
@@ -106,12 +128,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu
|
||||
// Only display reader mode settings menu option if the current page is in reader mode.
|
||||
menu.findItem(R.id.reader_mode_prefs_id)
|
||||
.setVisible(DomDistillerUrlUtils.isDistilledPage(currentTab.getUrl()));
|
||||
@@ -468,4 +470,37 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
return chromeHomeMenuItemFlagEnabled && !sHideChromeHomeMenuItems;
|
||||
@@ -448,6 +451,41 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
|
||||
/**
|
||||
+ * Updates the enable JavaScript item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable javascript
|
||||
@@ -123,16 +143,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_javascript_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_javascript_check_id);
|
||||
+
|
||||
+ // Hide enable javascript on all chrome:// pages and the NTP.
|
||||
+ // Hide enable javascript on all chrome:// pages except for the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+ // Also hide enable javascsript on Reader Mode.
|
||||
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
|
||||
+
|
||||
+ boolean itemVisible = !isChromeScheme && !currentTab.isNativePage();
|
||||
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
|
||||
+ boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+
|
||||
+ // Mark the checkbox if Javascript is activated on this tab.
|
||||
+ enableMenuCheck.setChecked(jsEnabled);
|
||||
@@ -143,11 +165,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu
|
||||
+ ? mActivity.getString(R.string.menu_enable_javascript_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_javascript_off));
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
* A notification that the header view has finished inflating.
|
||||
* @param view The view that was inflated.
|
||||
* @param appMenu The menu the view is inside of.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -164,6 +164,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
@@ -182,6 +182,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
@@ -158,7 +184,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -2491,6 +2491,17 @@ To obtain new licenses, connect to the internet and play your downloaded content
|
||||
@@ -2977,6 +2977,17 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_FIND_IN_PAGE" desc="Menu item allowing users to find text within the current page. [CHAR-LIMIT=27]">
|
||||
Find in page
|
||||
</message>
|
||||
@@ -177,5 +203,5 @@ diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/and
|
||||
Desktop site
|
||||
</message>
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 24 Mar 2018 05:18:03 +0100
|
||||
Subject: Canvas: fingerprinting mitigations via IDL
|
||||
|
||||
Disable toDataURL, toBlob, getImageData and webGL renderering info
|
||||
---
|
||||
third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl | 4 ++--
|
||||
.../Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl | 4 ++--
|
||||
third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.idl
|
||||
@@ -37,9 +37,9 @@ interface HTMLCanvasElement : HTMLElement
|
||||
// Note: The arguments argument is variadic in the spec, but not here as
|
||||
// only one extra argument is actually used.
|
||||
// FIXME: type should not have a default value.
|
||||
- [MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments);
|
||||
+ //[MeasureAs=CanvasToDataURL, RaisesException] DOMString toDataURL(optional DOMString type = null, optional any arguments);
|
||||
|
||||
- [MeasureAs=CanvasToBlob, RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments);
|
||||
+ //[MeasureAs=CanvasToBlob, RaisesException] void toBlob(BlobCallback _callback, optional DOMString type = null, optional any arguments);
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#blobcallback
|
||||
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl
|
||||
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl
|
||||
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.idl
|
||||
@@ -110,7 +110,7 @@ interface CanvasRenderingContext2D {
|
||||
// text (see also the CanvasDrawingStyles interface)
|
||||
void fillText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
|
||||
void strokeText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
|
||||
- TextMetrics measureText(DOMString text);
|
||||
+ //TextMetrics measureText(DOMString text);
|
||||
|
||||
// drawing images
|
||||
[CallWith=ScriptState, RaisesException] void drawImage(CanvasImageSource image, unrestricted double x, unrestricted double y);
|
||||
@@ -125,7 +125,7 @@ interface CanvasRenderingContext2D {
|
||||
// pixel manipulation
|
||||
[RaisesException] ImageData createImageData(ImageData imagedata);
|
||||
[RaisesException] ImageData createImageData(long sw, long sh);
|
||||
- [RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh);
|
||||
+ //[RaisesException] ImageData getImageData(long sx, long sy, long sw, long sh);
|
||||
[RaisesException] void putImageData(ImageData imagedata, long dx, long dy);
|
||||
[RaisesException] void putImageData(ImageData imagedata, long dx, long dy, long dirtyX, long dirtyY, long dirtyWidth, long dirtyHeight);
|
||||
|
||||
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
|
||||
--- a/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp
|
||||
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {
|
||||
|
||||
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
|
||||
WebGLRenderingContextBase* context) {
|
||||
- return new WebGLDebugRendererInfo(context);
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* WebGLDebugRendererInfo::ExtensionName() {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,701 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 23 Aug 2018 19:30:15 +0200
|
||||
Subject: Bromite adblock engine
|
||||
|
||||
Original adblock engine ported from NoChromo patch
|
||||
Make interception testable
|
||||
Add domain support
|
||||
Re-land: third-party filters support
|
||||
Add menu option to toggle global Adblock preference
|
||||
Allow toggling Chromium's "ads enabled" content settings option together with Bromite adblock engine.
|
||||
Perform adblock interception in StartJob to address lagging issues
|
||||
New mechanism for adblocking based on Brave's adblocking hook
|
||||
---
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 12 +
|
||||
chrome/android/java/res/menu/main_menu.xml | 11 +
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 +++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 2 +
|
||||
.../java/strings/android_chrome_strings.grd | 11 +
|
||||
chrome/browser/net/chrome_network_delegate.cc | 83 ++++--
|
||||
.../subresource_filter_content_settings_manager.cc | 1 +
|
||||
net/BUILD.gn | 7 +
|
||||
net/url_request/adblock_intercept.cc | 325 +++++++++++++++++++++
|
||||
net/url_request/adblock_intercept.h | 24 ++
|
||||
12 files changed, 510 insertions(+), 20 deletions(-)
|
||||
create mode 100644 net/url_request/adblock_intercept.cc
|
||||
create mode 100644 net/url_request/adblock_intercept.h
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -74,6 +74,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_adblock_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_adblock_id"
|
||||
+ android:title="@string/menu_enable_adblock" />
|
||||
+ <item android:id="@+id/enable_adblock_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<!-- Title is intentionally left blank in xml and will be set in java. -->
|
||||
<item android:id="@+id/open_in_browser_id"
|
||||
android:title=""
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -84,6 +84,17 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_adblock_row_menu_id"
|
||||
+ android:title="@null">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_adblock_id"
|
||||
+ android:title="@string/menu_enable_adblock" />
|
||||
+ <item android:id="@+id/enable_adblock_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/reader_mode_prefs_id"
|
||||
android:title="@string/menu_reader_mode_prefs"
|
||||
android:icon="@drawable/reader_mode_prefs_icon" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -2205,6 +2205,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.reader_mode_prefs_id) {
|
||||
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
|
||||
+ } else if (id == R.id.enable_adblock_id || id == R.id.enable_adblock_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean adblockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS, adblockEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableAdBlock");
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -1676,6 +1676,14 @@ public class ChromeTabbedActivity
|
||||
reportNewTabShortcutUsed(true);
|
||||
getTabCreator(true).launchNTP();
|
||||
}
|
||||
+ } else if (id == R.id.enable_adblock_id || id == R.id.enable_adblock_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean adblockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS, adblockEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableAdBlock");
|
||||
} else if (id == R.id.all_bookmarks_menu_id) {
|
||||
if (currentTab != null) {
|
||||
getCompositorViewHolder().hideKeyboard(() -> {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -208,6 +208,8 @@ public class AppMenuPropertiesDelegate {
|
||||
&& !TextUtils.isEmpty(url);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
@@ -486,6 +488,42 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Updates the enable AdBlock item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable adblock
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateEnableAdBlockMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_adblock_row_menu_id);
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_adblock_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_adblock_check_id);
|
||||
+
|
||||
+
|
||||
+ // Hide enable adblock on all chrome:// pages except for the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+ // Also hide enable javascsript on Reader Mode.
|
||||
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
|
||||
+
|
||||
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean adBlockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
|
||||
+
|
||||
+ // Mark the checkbox if adblock is globally activate.
|
||||
+ enableMenuCheck.setChecked(adBlockEnabled);
|
||||
+
|
||||
+ // This title doesn't seem to be displayed by Android, but it is used to set up
|
||||
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
|
||||
+ enableMenuLabel.setTitleCondensed(adBlockEnabled
|
||||
+ ? mActivity.getString(R.string.menu_enable_adblock_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_adblock_off));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* A notification that the header view has finished inflating.
|
||||
* @param view The view that was inflated.
|
||||
* @param appMenu The menu the view is inside of.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -181,6 +181,8 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
}
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -2997,6 +2997,17 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
|
||||
Turn on Request desktop site
|
||||
</message>
|
||||
+
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable AdBlock engine for the page. [CHAR-LIMIT=27]">
|
||||
+ Enable AdBlock
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_ON" desc="Accessibility description for when Enable AdBlock is selected.">
|
||||
+ Turn off AdBlock
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_OFF" desc="Accessibility description for when Enable AdBlock is unselected.">
|
||||
+ Turn on AdBlock
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR-LIMIT=27]">
|
||||
Appearance
|
||||
</message>
|
||||
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
|
||||
--- a/chrome/browser/net/chrome_network_delegate.cc
|
||||
+++ b/chrome/browser/net/chrome_network_delegate.cc
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/content_settings/cookie_settings_factory.h"
|
||||
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
|
||||
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
|
||||
#include "chrome/browser/net/chrome_extensions_network_delegate.h"
|
||||
@@ -60,6 +61,7 @@
|
||||
#if defined(OS_ANDROID)
|
||||
#include "base/android/path_utils.h"
|
||||
#include "chrome/browser/io_thread.h"
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -207,34 +209,75 @@ void ChromeNetworkDelegate::set_cookie_settings(
|
||||
cookie_settings_ = cookie_settings;
|
||||
}
|
||||
|
||||
+#define TRANSPARENT1PXGIF "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
||||
+
|
||||
int ChromeNetworkDelegate::OnBeforeURLRequest(
|
||||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
GURL* new_url) {
|
||||
- extensions_delegate_->ForwardStartRequestStatus(request);
|
||||
-
|
||||
- // The non-redirect case is handled in GoogleURLLoaderThrottle.
|
||||
- bool force_safe_search =
|
||||
- (force_google_safe_search_ && force_google_safe_search_->GetValue() &&
|
||||
- request->is_redirecting());
|
||||
-
|
||||
- net::CompletionOnceCallback wrapped_callback = std::move(callback);
|
||||
-
|
||||
- if (force_safe_search) {
|
||||
- wrapped_callback = base::BindOnce(
|
||||
- &ForceGoogleSafeSearchCallbackWrapper, std::move(wrapped_callback),
|
||||
- base::Unretained(request), base::Unretained(new_url));
|
||||
- }
|
||||
|
||||
- int rv = extensions_delegate_->NotifyBeforeURLRequest(
|
||||
- request, std::move(wrapped_callback), new_url);
|
||||
-
|
||||
- if (force_safe_search && rv == net::OK && new_url->is_empty())
|
||||
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
|
||||
+#if defined(OS_ANDROID)
|
||||
+ if (request) {
|
||||
+ bool block = false, isValidUrl;
|
||||
+
|
||||
+ isValidUrl = request->url().is_valid();
|
||||
+ std::string scheme = request->url().scheme();
|
||||
+ if (isValidUrl && scheme.length()) {
|
||||
+ std::transform(scheme.begin(), scheme.end(), scheme.begin(), ::tolower);
|
||||
+ if ("http" != scheme && "https" != scheme) {
|
||||
+ isValidUrl = false;
|
||||
+ }
|
||||
+ }
|
||||
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
|
||||
+
|
||||
+ bool adblock_enabled = false;
|
||||
+ if (isValidUrl && info) {
|
||||
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter = info->GetWebContentsGetterForRequest();
|
||||
+ content::WebContents* web_contents = web_contents_getter.Run();
|
||||
+ if (web_contents) {
|
||||
+ Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
||||
+ //FIXME: this should not be called from the IO thread
|
||||
+ const HostContentSettingsMap* content_settings = HostContentSettingsMapFactory::GetForProfile(profile);
|
||||
+
|
||||
+ if (content_settings) {
|
||||
+ // check global value first
|
||||
+ adblock_enabled = CONTENT_SETTING_BLOCK == content_settings->GetDefaultContentSetting(ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS, NULL);
|
||||
+
|
||||
+ if (!adblock_enabled) {
|
||||
+ // check per-site value
|
||||
+ adblock_enabled = CONTENT_SETTING_BLOCK == content_settings->GetContentSetting(request->url(), GURL(), ContentSettingsType::CONTENT_SETTINGS_TYPE_ADS,
|
||||
+ std::string());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (adblock_enabled
|
||||
+ && content::RESOURCE_TYPE_MAIN_FRAME != info->GetResourceType()
|
||||
+ && net::adblock_intercept(request->url(),
|
||||
+ request->initiator()->host(),
|
||||
+ info->GetResourceType())) {
|
||||
+ block = true;
|
||||
+ }
|
||||
+
|
||||
+ if (block) {
|
||||
+ if (content::RESOURCE_TYPE_IMAGE == info->GetResourceType()) {
|
||||
+ *new_url = GURL(TRANSPARENT1PXGIF);
|
||||
+ } else {
|
||||
+ *new_url = GURL("");
|
||||
+ }
|
||||
+ return net::ERR_BLOCKED_BY_ADMINISTRATOR;
|
||||
+ }
|
||||
+ } // valid URL and info
|
||||
+ } // request
|
||||
+#endif // OS_ANDROID
|
||||
|
||||
- return rv;
|
||||
+ extensions_delegate_->ForwardStartRequestStatus(request);
|
||||
+ return extensions_delegate_->NotifyBeforeURLRequest(
|
||||
+ request, std::move(callback), new_url);
|
||||
}
|
||||
|
||||
+#undef TRANSPARENT1PXGIF
|
||||
+
|
||||
int ChromeNetworkDelegate::OnBeforeStartTransaction(
|
||||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
--- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
+++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "components/history/core/browser/history_service.h"
|
||||
#include "components/keyed_service/core/service_access_type.h"
|
||||
#include "url/gurl.h"
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
|
||||
namespace {
|
||||
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1731,6 +1731,13 @@ component("net") {
|
||||
"url_request/websocket_handshake_userdata_key.h",
|
||||
]
|
||||
|
||||
+ if (is_android) {
|
||||
+ sources += [
|
||||
+ "url_request/adblock_intercept.cc",
|
||||
+ "url_request/adblock_intercept.h"
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
if (enable_reporting) {
|
||||
sources += [
|
||||
"network_error_logging/network_error_logging_delegate.cc",
|
||||
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.cc
|
||||
@@ -0,0 +1,325 @@
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+#include <cstddef>
|
||||
+#include <cstdlib>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include "log.h"
|
||||
+#include <tld.h>
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#include "content/public/common/resource_type.h"
|
||||
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
+#include <android/log.h>
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#include "net/url_request/adblock_entries.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+const char *LOG_TAG = "Bromite";
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count() { return ADBLOCK_ENTRY_COUNT; }
|
||||
+#endif
|
||||
+
|
||||
+// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
|
||||
+// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
|
||||
+// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
|
||||
+// string in |tld|, if specified and the |host| can be parsed.
|
||||
+static bool is_first_party(char *l_host, char *l_url_host) {
|
||||
+ size_t tld_length;
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+ char *found_tld;
|
||||
+
|
||||
+ if (TLD_SUCCESS != tld_get_z(l_host, &found_tld))
|
||||
+ return false;
|
||||
+ tld_length = strlen(found_tld);
|
||||
+ if (tld_length == 0)
|
||||
+ return false;
|
||||
+#else
|
||||
+ tld_length = net::registry_controlled_domains::GetCanonicalHostRegistryLength(
|
||||
+ l_host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
||||
+ net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
||||
+ if ((tld_length == 0) || (tld_length == std::string::npos))
|
||||
+ return false;
|
||||
+#endif
|
||||
+
|
||||
+ int len = strlen(l_host);
|
||||
+ char *tld = l_host + len - tld_length;
|
||||
+
|
||||
+ // Removes any subdomain from origin host.
|
||||
+ int i = len - tld_length - 2, top_i = i;
|
||||
+ if (i < 0) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ char *domain = l_host;
|
||||
+ for (; i >= 0; i--) {
|
||||
+ if (l_host[i] == '.') {
|
||||
+ int p_len = top_i - i;
|
||||
+ // skip "co" in "co.uk", "org" in "org.uk"
|
||||
+ if (p_len <= 3) {
|
||||
+ tld -= p_len + 1;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // segment is long enough, accept it at as a domain
|
||||
+ domain = l_host + i;
|
||||
+ len -= i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "%s: extracted domain suffix: \"%s\" (TLD=\"%s\")",
|
||||
+ l_host, domain, tld);
|
||||
+#endif
|
||||
+
|
||||
+ // Check if supplied URL host matches, including the dot.
|
||||
+ int b_len = strlen(l_url_host);
|
||||
+ if (b_len < len) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if (l_url_host[b_len - 1 - i] != domain[len - 1 - i])
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // pass with flying colors
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static char *strtolower(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 1);
|
||||
+ ret[len] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static char *strtosep(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 3);
|
||||
+ ret[0] = '^';
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') ||
|
||||
+ (str[i] == '&') || (str[i] == '=')) {
|
||||
+ ret[i + 1] = '^';
|
||||
+ } else {
|
||||
+ ret[i + 1] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static bool url_matches(const char *c_url, char *c_url_sep, char *c_url_lower,
|
||||
+ char *c_url_lower_sep, adblock_entry *entry) {
|
||||
+ bool match = false;
|
||||
+ // select comparison string based on case and separator presence (separator
|
||||
+ // takes some shortcuts)
|
||||
+ bool match_case = ((entry->flags & ADBLOCK_FLAG_MATCH_CASE) != 0);
|
||||
+ bool match_separator = ((entry->flags & ADBLOCK_FLAG_HAS_SEPARATOR) != 0);
|
||||
+ const char *match_url =
|
||||
+ match_case ? (match_separator ? c_url_sep : c_url)
|
||||
+ : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[case:%d][sep:%d][%s]",
|
||||
+ match_case, match_separator, match_url);
|
||||
+#endif
|
||||
+ // check for all match parts at >= position of last match
|
||||
+ const char *last = match_url;
|
||||
+ for (int m = 0; const char *url_match = entry->matches[m]; m++) {
|
||||
+ bool is_last_match = entry->matches[m + 1] == NULL;
|
||||
+ const char *pos = strstr(last, url_match);
|
||||
+ match = (pos != NULL);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s][found:%d][match:%d]",
|
||||
+ entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
+#endif
|
||||
+ // check if the url starts with the first match part
|
||||
+ if (match && (m == 0) && ((entry->flags & ADBLOCK_FLAG_MATCH_BEGIN) != 0) &&
|
||||
+ (pos != match_url))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check if the url ends with the last match part
|
||||
+ if (match && is_last_match &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_END) != 0) &&
|
||||
+ (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])]))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check domain match
|
||||
+ if (match && (m == 0) &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_DOMAIN) != 0) &&
|
||||
+ (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') &&
|
||||
+ (pos[-1] != '/'))
|
||||
+ match = false;
|
||||
+
|
||||
+ // short circuit
|
||||
+ if (!match)
|
||||
+ break;
|
||||
+ }
|
||||
+ return match;
|
||||
+}
|
||||
+
|
||||
+bool url_match_domain(adblock_entry *entry, const std::string &origin_host) {
|
||||
+ bool match_domain = true;
|
||||
+ // check for a negative domain match
|
||||
+ if (entry->domains_skip) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains_skip[d]; d++) {
|
||||
+ if (domain == origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // check for a required positive domain match
|
||||
+ if (entry->domains) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
|
||||
+ if (domain != origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return match_domain;
|
||||
+}
|
||||
+
|
||||
+static bool url_match_party(adblock_entry *entry, const GURL &url,
|
||||
+ const std::string &origin_host, bool &checked_fp,
|
||||
+ bool &fp) {
|
||||
+ bool wanted_fp;
|
||||
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
|
||||
+ wanted_fp = false;
|
||||
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
|
||||
+ wanted_fp = true;
|
||||
+ } else {
|
||||
+ // no-op
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (origin_host.empty()) {
|
||||
+ // cannot match this rule, no origin host to determine first/third party
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
|
||||
+// matchFirstParty, matchThirdParty);
|
||||
+#endif
|
||||
+ if (!checked_fp) {
|
||||
+ // lower-case version
|
||||
+ char *l_host = strtolower(origin_host.c_str()),
|
||||
+ *l_url_host = strtolower(url.host().c_str());
|
||||
+
|
||||
+ // is the URL a first-party to the current page's host?
|
||||
+ fp = is_first_party(l_host, l_url_host);
|
||||
+
|
||||
+ checked_fp = true;
|
||||
+#ifdef ADB_TESTER
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
|
||||
+ l_url_host, fp ? "true" : "false");
|
||||
+#endif
|
||||
+ free(l_host);
|
||||
+ free(l_url_host);
|
||||
+ }
|
||||
+
|
||||
+ return fp == wanted_fp;
|
||||
+}
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host
|
||||
+#ifndef ADB_TESTER
|
||||
+, content::ResourceType resource_type
|
||||
+#endif
|
||||
+) {
|
||||
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ const char *c_url = url.spec().c_str();
|
||||
+ char *c_url_lower = strtolower(c_url);
|
||||
+ char *c_url_sep = strtosep(c_url);
|
||||
+ char *c_url_lower_sep = strtosep(c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
|
||||
+ c_url, url.host().c_str(), origin_host.c_str());
|
||||
+#endif
|
||||
+
|
||||
+ bool checked_fp = false, fp = false;
|
||||
+
|
||||
+ bool intercept = false;
|
||||
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
|
||||
+ adblock_entry *entry = &ADBLOCK_ENTRIES[i];
|
||||
+
|
||||
+ // no use checking rules when we're intercepting, or exceptions when not
|
||||
+ bool check =
|
||||
+ (!intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) == 0)) ||
|
||||
+ (intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) != 0));
|
||||
+ if (!check)
|
||||
+ continue;
|
||||
+
|
||||
+ // first check for domain matches, a quick branch out if matching
|
||||
+ if (!url_match_domain(entry, origin_host))
|
||||
+ continue;
|
||||
+
|
||||
+ // check on the URL matcher
|
||||
+ if (!url_matches(c_url, c_url_sep, c_url_lower, c_url_lower_sep, entry))
|
||||
+ continue;
|
||||
+
|
||||
+ // finally check first/third-party
|
||||
+ if (!url_match_party(entry, url, origin_host, checked_fp, fp))
|
||||
+ continue;
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ if (!intercept) {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "--> intercept (#%d: \"%s\") (%x)", i,
|
||||
+ entry->matches[0], entry->flags);
|
||||
+ } else {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "--> pass (%d) (#%d)", i,
|
||||
+ entry->flags);
|
||||
+ }
|
||||
+#endif
|
||||
+ intercept = !intercept;
|
||||
+ } // for each entry
|
||||
+
|
||||
+ free(c_url_sep);
|
||||
+ free(c_url_lower);
|
||||
+ free(c_url_lower_sep);
|
||||
+
|
||||
+ if (intercept) {
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
|
||||
+#endif
|
||||
+ return 1;
|
||||
+ }
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
|
||||
+#endif
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.h
|
||||
@@ -0,0 +1,24 @@
|
||||
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+#ifndef ADB_TESTER
|
||||
+#include "content/public/common/resource_type.h"
|
||||
+#endif
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count();
|
||||
+#endif
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host
|
||||
+#ifndef ADB_TESTER
|
||||
+, content::ResourceType resource_type
|
||||
+#endif
|
||||
+);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 30 Apr 2018 15:39:58 +0200
|
||||
Subject: Started work on canvas randomisation
|
||||
|
||||
Add shuffling for TextMetrics
|
||||
---
|
||||
.../Source/core/html/canvas/CanvasAsyncBlobCreator.cpp | 14 +++++++-------
|
||||
.../Source/core/html/canvas/CanvasAsyncBlobCreator.h | 6 +++---
|
||||
.../WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp | 4 ++--
|
||||
third_party/WebKit/Source/core/html/canvas/TextMetrics.cpp | 4 ++++
|
||||
third_party/WebKit/Source/core/html/canvas/TextMetrics.h | 2 ++
|
||||
.../WebKit/Source/core/inspector/InspectorAuditsAgent.cpp | 2 +-
|
||||
.../WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp | 6 +++++-
|
||||
.../WebKit/Source/modules/accessibility/AXLayoutObject.cpp | 2 +-
|
||||
.../modules/canvas/canvas2d/BaseRenderingContext2D.cpp | 3 +++
|
||||
.../modules/canvas/canvas2d/CanvasRenderingContext2D.cpp | 6 +++++-
|
||||
.../WebKit/Source/platform/graphics/ImageDataBuffer.cpp | 6 ++++--
|
||||
.../WebKit/Source/platform/graphics/ImageDataBuffer.h | 3 ++-
|
||||
12 files changed, 39 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
|
||||
@@ -220,14 +220,14 @@ void CanvasAsyncBlobCreator::Dispose() {
|
||||
image_ = nullptr;
|
||||
}
|
||||
|
||||
-bool CanvasAsyncBlobCreator::EncodeImage(const double& quality) {
|
||||
+bool CanvasAsyncBlobCreator::EncodeImage(const double& quality, const double shuffleAmt) {
|
||||
std::unique_ptr<ImageDataBuffer> buffer = ImageDataBuffer::Create(src_data_);
|
||||
if (!buffer)
|
||||
return false;
|
||||
- return buffer->EncodeImage("image/webp", quality, &encoded_image_);
|
||||
+ return buffer->EncodeImage("image/webp", quality, shuffleAmt, &encoded_image_);
|
||||
}
|
||||
|
||||
-void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality) {
|
||||
+void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality, const double shuffleAmt) {
|
||||
if (!static_bitmap_image_loaded_) {
|
||||
context_->GetTaskRunner(TaskType::kCanvasBlobSerialization)
|
||||
->PostTask(FROM_HERE,
|
||||
@@ -241,7 +241,7 @@ void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality) {
|
||||
// When OffscreenCanvas.convertToBlob() occurs on worker thread,
|
||||
// we do not need to use background task runner to reduce load on main.
|
||||
// So we just directly encode images on the worker thread.
|
||||
- if (!EncodeImage(quality)) {
|
||||
+ if (!EncodeImage(quality, shuffleAmt)) {
|
||||
context_->GetTaskRunner(TaskType::kCanvasBlobSerialization)
|
||||
->PostTask(
|
||||
FROM_HERE,
|
||||
@@ -260,7 +260,7 @@ void CanvasAsyncBlobCreator::ScheduleAsyncBlobCreation(const double& quality) {
|
||||
BackgroundTaskRunner::PostOnBackgroundThread(
|
||||
FROM_HERE,
|
||||
CrossThreadBind(&CanvasAsyncBlobCreator::EncodeImageOnEncoderThread,
|
||||
- WrapCrossThreadPersistent(this), quality));
|
||||
+ WrapCrossThreadPersistent(this), quality, shuffleAmt));
|
||||
}
|
||||
} else {
|
||||
idle_task_status_ = kIdleTaskNotStarted;
|
||||
@@ -432,11 +432,11 @@ void CanvasAsyncBlobCreator::CreateNullAndReturnResult() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
-void CanvasAsyncBlobCreator::EncodeImageOnEncoderThread(double quality) {
|
||||
+void CanvasAsyncBlobCreator::EncodeImageOnEncoderThread(double quality, double shuffleAmt) {
|
||||
DCHECK(!IsMainThread());
|
||||
DCHECK(mime_type_ == kMimeTypeWebp);
|
||||
|
||||
- if (!EncodeImage(quality)) {
|
||||
+ if (!EncodeImage(quality, shuffleAmt)) {
|
||||
PostCrossThreadTask(
|
||||
*parent_frame_task_runner_->Get(TaskType::kCanvasBlobSerialization),
|
||||
FROM_HERE,
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
|
||||
@@ -38,7 +38,7 @@ class CORE_EXPORT CanvasAsyncBlobCreator
|
||||
ExecutionContext*,
|
||||
ScriptPromiseResolver*);
|
||||
|
||||
- void ScheduleAsyncBlobCreation(const double& quality);
|
||||
+ void ScheduleAsyncBlobCreation(const double& quality, const double shuffleAmt);
|
||||
virtual ~CanvasAsyncBlobCreator();
|
||||
enum MimeType {
|
||||
kMimeTypePng,
|
||||
@@ -130,7 +130,7 @@ class CORE_EXPORT CanvasAsyncBlobCreator
|
||||
Member<ScriptPromiseResolver> script_promise_resolver_;
|
||||
|
||||
void LoadStaticBitmapImage();
|
||||
- bool EncodeImage(const double&);
|
||||
+ bool EncodeImage(const double&, const double);
|
||||
|
||||
// PNG, JPEG
|
||||
bool InitializeEncoder(double quality);
|
||||
@@ -138,7 +138,7 @@ class CORE_EXPORT CanvasAsyncBlobCreator
|
||||
// without deadline
|
||||
|
||||
// WEBP
|
||||
- void EncodeImageOnEncoderThread(double quality);
|
||||
+ void EncodeImageOnEncoderThread(double quality, double shuffleAmt);
|
||||
|
||||
void IdleTaskStartTimeoutEvent(double quality);
|
||||
void IdleTaskCompleteTimeoutEvent();
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
|
||||
@@ -826,7 +826,7 @@ String HTMLCanvasElement::ToDataURLInternal(
|
||||
std::unique_ptr<ImageDataBuffer> data_buffer =
|
||||
ImageDataBuffer::Create(image_bitmap);
|
||||
if (data_buffer)
|
||||
- return data_buffer->ToDataURL(encoding_mime_type, quality);
|
||||
+ return data_buffer->ToDataURL(encoding_mime_type, quality, GetDocument().GetShuffleFactorX());
|
||||
}
|
||||
return String("data:,");
|
||||
}
|
||||
@@ -892,7 +892,7 @@ void HTMLCanvasElement::toBlob(V8BlobCallback* callback,
|
||||
}
|
||||
|
||||
if (async_creator) {
|
||||
- async_creator->ScheduleAsyncBlobCreation(quality);
|
||||
+ async_creator->ScheduleAsyncBlobCreation(quality, GetDocument().GetShuffleFactorX());
|
||||
} else {
|
||||
GetDocument()
|
||||
.GetTaskRunner(TaskType::kCanvasBlobSerialization)
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/TextMetrics.cpp b/third_party/WebKit/Source/core/html/canvas/TextMetrics.cpp
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/TextMetrics.cpp
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/TextMetrics.cpp
|
||||
@@ -47,6 +47,10 @@ float TextMetrics::GetFontBaseline(const TextBaseline& text_baseline,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+void TextMetrics::Shuffle(const double amt) {
|
||||
+ //TODO: shuffle here
|
||||
+}
|
||||
+
|
||||
void TextMetrics::Update(const Font& font,
|
||||
const TextDirection& direction,
|
||||
const TextBaseline& baseline,
|
||||
diff --git a/third_party/WebKit/Source/core/html/canvas/TextMetrics.h b/third_party/WebKit/Source/core/html/canvas/TextMetrics.h
|
||||
--- a/third_party/WebKit/Source/core/html/canvas/TextMetrics.h
|
||||
+++ b/third_party/WebKit/Source/core/html/canvas/TextMetrics.h
|
||||
@@ -67,6 +67,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
|
||||
|
||||
static float GetFontBaseline(const TextBaseline&, const FontMetrics&);
|
||||
|
||||
+ void Shuffle(const double amt);
|
||||
+
|
||||
private:
|
||||
void Update(const Font&,
|
||||
const TextDirection&,
|
||||
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp
|
||||
--- a/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp
|
||||
+++ b/third_party/WebKit/Source/core/inspector/InspectorAuditsAgent.cpp
|
||||
@@ -56,7 +56,7 @@ bool EncodeAsImage(char* body,
|
||||
|
||||
String mime_type = "image/";
|
||||
mime_type.append(encoding);
|
||||
- return image_to_encode->EncodeImage(mime_type, quality, output);
|
||||
+ return image_to_encode->EncodeImage(mime_type, quality, 0, output);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
||||
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
||||
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "core/offscreencanvas/OffscreenCanvas.h"
|
||||
|
||||
#include <memory>
|
||||
+#include "base/rand_util.h"
|
||||
#include "core/css/CSSFontSelector.h"
|
||||
#include "core/css/OffscreenFontSelector.h"
|
||||
#include "core/css/StyleEngine.h"
|
||||
@@ -398,7 +399,10 @@ ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* script_state,
|
||||
CanvasAsyncBlobCreator* async_creator = CanvasAsyncBlobCreator::Create(
|
||||
snapshot, encoding_mime_type, start_time,
|
||||
ExecutionContext::From(script_state), resolver);
|
||||
- async_creator->ScheduleAsyncBlobCreation(options.quality());
|
||||
+
|
||||
+ // add +/- 3% noise against fingerprinting
|
||||
+ double shuffleAmt = (base::RandDouble() - 0.5) * 0.03;
|
||||
+ async_creator->ScheduleAsyncBlobCreation(options.quality(), shuffleAmt);
|
||||
return resolver->Promise();
|
||||
} else {
|
||||
exception_state.ThrowDOMException(
|
||||
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
||||
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
||||
@@ -1017,7 +1017,7 @@ String AXLayoutObject::ImageDataUrl(const IntSize& max_size) const {
|
||||
if (!buffer)
|
||||
return String();
|
||||
|
||||
- return buffer->ToDataURL("image/png", 1.0);
|
||||
+ return buffer->ToDataURL("image/png", 1.0, document->GetShuffleFactorX());
|
||||
}
|
||||
|
||||
String AXLayoutObject::GetText() const {
|
||||
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
|
||||
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/BaseRenderingContext2D.cpp
|
||||
@@ -1610,6 +1610,9 @@ ImageData* BaseRenderingContext2D::getImageData(
|
||||
const CanvasColorParams& color_params = ColorParams();
|
||||
scoped_refptr<StaticBitmapImage> snapshot = GetImage(kPreferNoAcceleration);
|
||||
|
||||
+ //TODO: calculate some random value and use it to shuffle pixel data in 'snapshot'
|
||||
+ // it should StaticBitmapImage somehow
|
||||
+
|
||||
if (!StaticBitmapImage::ConvertToArrayBufferContents(
|
||||
snapshot, contents, image_data_rect, color_params, IsAccelerated())) {
|
||||
exception_state.ThrowRangeError("Out of memory at ImageData creation");
|
||||
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
|
||||
--- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
|
||||
@@ -779,8 +779,12 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
else
|
||||
direction = ToTextDirection(GetState().GetDirection(), canvas());
|
||||
|
||||
- return TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
+ TextMetrics* textMetrics = TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
GetState().GetTextAlign(), text);
|
||||
+
|
||||
+ textMetrics->Shuffle(canvas()->GetDocument().GetShuffleFactorX());
|
||||
+
|
||||
+ return textMetrics;
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::DrawTextInternal(
|
||||
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.cpp
|
||||
--- a/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.cpp
|
||||
+++ b/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.cpp
|
||||
@@ -124,7 +124,9 @@ const unsigned char* ImageDataBuffer::Pixels() const {
|
||||
|
||||
bool ImageDataBuffer::EncodeImage(const String& mime_type,
|
||||
const double& quality,
|
||||
+ const double shuffleAmt,
|
||||
Vector<unsigned char>* encoded_image) const {
|
||||
+ //TODO: this is the only place where shuffleAmt should be used
|
||||
DCHECK(is_valid_);
|
||||
SkPixmap src;
|
||||
if (uses_pixmap_) {
|
||||
@@ -165,12 +167,12 @@ bool ImageDataBuffer::EncodeImage(const String& mime_type,
|
||||
}
|
||||
|
||||
String ImageDataBuffer::ToDataURL(const String& mime_type,
|
||||
- const double& quality) const {
|
||||
+ const double& quality, const double shuffleAmt) const {
|
||||
DCHECK(is_valid_);
|
||||
DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type));
|
||||
|
||||
Vector<unsigned char> result;
|
||||
- if (!EncodeImage(mime_type, quality, &result))
|
||||
+ if (!EncodeImage(mime_type, quality, shuffleAmt, &result))
|
||||
return "data:,";
|
||||
|
||||
return "data:" + mime_type + ";base64," + Base64Encode(result);
|
||||
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.h b/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.h
|
||||
--- a/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.h
|
||||
+++ b/third_party/WebKit/Source/platform/graphics/ImageDataBuffer.h
|
||||
@@ -51,9 +51,10 @@ class PLATFORM_EXPORT ImageDataBuffer {
|
||||
const CanvasColorParams& = CanvasColorParams());
|
||||
static std::unique_ptr<ImageDataBuffer> Create(const SkPixmap&);
|
||||
|
||||
- String ToDataURL(const String& mime_type, const double& quality) const;
|
||||
+ String ToDataURL(const String& mime_type, const double& quality, const double shuffleAmt) const;
|
||||
bool EncodeImage(const String& mime_type,
|
||||
const double& quality,
|
||||
+ double shuffleAmt,
|
||||
Vector<unsigned char>* encoded_image) const;
|
||||
const unsigned char* Pixels() const;
|
||||
const IntSize& size() const { return size_; }
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 18 May 2018 10:10:00 +0200
|
||||
Subject: Increase maximum connections per host from 6 to 15
|
||||
|
||||
---
|
||||
net/socket/client_socket_pool_manager.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -41,7 +41,7 @@ static_assert(arraysize(g_max_sockets_per_pool) ==
|
||||
// be the same as the limit for ws. Also note that Firefox uses a limit of 200.
|
||||
// See http://crbug.com/486800
|
||||
int g_max_sockets_per_group[] = {
|
||||
- 6, // NORMAL_SOCKET_POOL
|
||||
+ 15, // NORMAL_SOCKET_POOL
|
||||
255 // WEBSOCKET_SOCKET_POOL
|
||||
};
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 21 Mar 2018 14:15:28 +0100
|
||||
Subject: User Agent: anonymize
|
||||
|
||||
Use a fixed device name and Chrome product version.
|
||||
---
|
||||
components/version_info/version_info.cc | 17 +++++++-
|
||||
content/common/user_agent.cc | 73 +++++++++++++++++++++------------
|
||||
2 files changed, 62 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/components/version_info/version_info.cc b/components/version_info/version_info.cc
|
||||
--- a/components/version_info/version_info.cc
|
||||
+++ b/components/version_info/version_info.cc
|
||||
@@ -7,13 +7,28 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/version.h"
|
||||
+#include "base/sys_info.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/version_info/version_info_values.h"
|
||||
|
||||
namespace version_info {
|
||||
|
||||
std::string GetProductNameAndVersionForUserAgent() {
|
||||
- return "Chrome/" + GetVersionNumber();
|
||||
+ int32_t major, minor, bugfix;
|
||||
+ base::SysInfo::OperatingSystemVersionNumbers(&major,
|
||||
+ &minor,
|
||||
+ &bugfix);
|
||||
+ switch (major) {
|
||||
+ case 7:
|
||||
+ return "Chrome/63.0.3239.111";
|
||||
+ case 6:
|
||||
+ return "Chrome/63.0.3239.83";
|
||||
+ case 5:
|
||||
+ case 4:
|
||||
+ return "Chrome/62.0.3202.84";
|
||||
+ }
|
||||
+ // version 8 and above
|
||||
+ return "Chrome/67.0.3396.87";
|
||||
}
|
||||
|
||||
std::string GetProductName() {
|
||||
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
|
||||
--- a/content/common/user_agent.cc
|
||||
+++ b/content/common/user_agent.cc
|
||||
@@ -22,11 +22,6 @@
|
||||
|
||||
namespace content {
|
||||
|
||||
-#if defined(OS_ANDROID)
|
||||
-const base::Feature kAndroidUserAgentStringContainsBuildId{
|
||||
- "AndroidUserAgentStringContainsBuildId", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
-#endif // defined(OS_ANDROID)
|
||||
-
|
||||
std::string GetWebKitVersion() {
|
||||
return base::StringPrintf("%d.%d (%s)",
|
||||
WEBKIT_VERSION_MAJOR,
|
||||
@@ -66,7 +61,33 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
|
||||
}
|
||||
#elif defined(OS_ANDROID)
|
||||
std::string android_version_str = base::SysInfo::OperatingSystemVersion();
|
||||
- std::string android_info_str = GetAndroidOSInfo(include_android_build_number);
|
||||
+ std::string android_info_str;
|
||||
+
|
||||
+ // Send information about the device and build ID.
|
||||
+ // Use a common device/build ID based on Android major version.
|
||||
+ switch (os_major_version) {
|
||||
+ case 7:
|
||||
+ // Chrome/63.0.3239.111
|
||||
+ android_info_str = "SM-J730GM Build/NRD90M";
|
||||
+ break;
|
||||
+ case 6:
|
||||
+ // Chrome/63.0.3239.83
|
||||
+ android_info_str = "SM-G532G Build/MMB29T";
|
||||
+ break;
|
||||
+ case 5:
|
||||
+ // Chrome/62.0.3202.84
|
||||
+ android_info_str = "A37fw Build/LMY47V";
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ // Chrome/62.0.3202.84
|
||||
+ android_info_str = "SM-G7102 Build/KOT49H";
|
||||
+ break;
|
||||
+ default: // version 8 and above
|
||||
+ android_info_str = "SM-G950U Build/R16NW";
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ android_info_str = " " + android_info_str;
|
||||
#elif (defined(OS_POSIX) && !defined(OS_MACOSX)) || defined(OS_FUCHSIA)
|
||||
// Should work on any Posix system.
|
||||
struct utsname unixinfo;
|
||||
@@ -102,7 +123,7 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
|
||||
os_minor_version,
|
||||
os_bugfix_version
|
||||
#elif defined(OS_ANDROID)
|
||||
- "Android %s%s",
|
||||
+ "Android %s;%s",
|
||||
android_version_str.c_str(),
|
||||
android_info_str.c_str()
|
||||
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||
@@ -137,18 +158,6 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
|
||||
return BuildUserAgentFromOSAndProduct(os_info, product);
|
||||
}
|
||||
|
||||
-#if defined(OS_ANDROID)
|
||||
-std::string BuildUserAgentFromProductAndExtraOSInfo(
|
||||
- const std::string& product,
|
||||
- const std::string& extra_os_info,
|
||||
- bool include_android_build_number) {
|
||||
- std::string os_info;
|
||||
- base::StringAppendF(&os_info, "%s%s%s", getUserAgentPlatform().c_str(),
|
||||
- BuildOSCpuInfo(include_android_build_number).c_str(),
|
||||
- extra_os_info.c_str());
|
||||
- return BuildUserAgentFromOSAndProduct(os_info, product);
|
||||
-}
|
||||
-
|
||||
std::string GetAndroidOSInfo(bool include_android_build_number) {
|
||||
std::string android_info_str;
|
||||
|
||||
@@ -162,18 +171,28 @@ std::string GetAndroidOSInfo(bool include_android_build_number) {
|
||||
}
|
||||
|
||||
// Append the build ID.
|
||||
- if (base::FeatureList::IsEnabled(kAndroidUserAgentStringContainsBuildId) ||
|
||||
- include_android_build_number) {
|
||||
- std::string android_build_id = base::SysInfo::GetAndroidBuildID();
|
||||
- if (!android_build_id.empty()) {
|
||||
- if (!semicolon_inserted)
|
||||
- android_info_str += ";";
|
||||
- android_info_str += " Build/" + android_build_id;
|
||||
- }
|
||||
+ std::string android_build_id = base::SysInfo::GetAndroidBuildID();
|
||||
+ if (!android_build_id.empty()) {
|
||||
+ if (!semicolon_inserted)
|
||||
+ android_info_str += ";";
|
||||
+ android_info_str += " Build/" + android_build_id;
|
||||
}
|
||||
|
||||
return android_info_str;
|
||||
}
|
||||
+
|
||||
+#if defined(OS_ANDROID)
|
||||
+std::string BuildUserAgentFromProductAndExtraOSInfo(
|
||||
+ const std::string& product,
|
||||
+ const std::string& extra_os_info,
|
||||
+ bool include_android_build_number) {
|
||||
+ std::string os_info;
|
||||
+ base::StringAppendF(&os_info, "%s%s%s", getUserAgentPlatform().c_str(),
|
||||
+ BuildOSCpuInfo(include_android_build_number).c_str(),
|
||||
+ extra_os_info.c_str());
|
||||
+ return BuildUserAgentFromOSAndProduct(os_info, product);
|
||||
+}
|
||||
+
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+19
-20
@@ -4,14 +4,14 @@ Subject: AudioBuffer, AnalyserNode: fingerprinting mitigations via IDL
|
||||
|
||||
Return fixed base latency
|
||||
---
|
||||
third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl | 8 ++++----
|
||||
third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl | 4 ++--
|
||||
third_party/WebKit/Source/modules/webaudio/AudioContext.cpp | 2 +-
|
||||
3 files changed, 7 insertions(+), 7 deletions(-)
|
||||
third_party/blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
|
||||
third_party/blink/renderer/modules/webaudio/audio_buffer.idl | 4 ++--
|
||||
third_party/blink/renderer/modules/webaudio/audio_context.cc | 1 +
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
|
||||
--- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
|
||||
+++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
@@ -42,10 +42,10 @@ interface AnalyserNode : AudioNode {
|
||||
|
||||
// Copies the current frequency data into the passed array.
|
||||
@@ -27,9 +27,9 @@ diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl b/third
|
||||
+ //void getFloatTimeDomainData(Float32Array array);
|
||||
+ //void getByteTimeDomainData(Uint8Array array);
|
||||
};
|
||||
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
|
||||
--- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
|
||||
+++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// Channel access
|
||||
@@ -40,18 +40,17 @@ diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl b/third_
|
||||
+ //[RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
};
|
||||
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
|
||||
--- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
|
||||
+++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
|
||||
@@ -261,7 +261,7 @@ void AudioContext::StopRendering() {
|
||||
}
|
||||
|
||||
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
|
||||
@@ -320,6 +320,7 @@ void AudioContext::StopRendering() {
|
||||
double AudioContext::baseLatency() const {
|
||||
- return FramesPerBuffer() / static_cast<double>(sampleRate());
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination());
|
||||
+ return 0.04;
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
// TODO(hongchan): Due to the incompatible constructor between
|
||||
// AudioDestinationNode and DefaultAudioDestinationNode, casting directly from
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+219
@@ -0,0 +1,219 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 30 Mar 2018 10:09:03 +0200
|
||||
Subject: 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.
|
||||
|
||||
Rationale is that the returned values are within the same order of magnitude
|
||||
of the floating point precision being used for fingerprinting and sufficient
|
||||
to poison the well.
|
||||
|
||||
See also: http://www.gsd.inesc-id.pt/~mpc/pubs/fingerprinting-trustcom2016.pdf
|
||||
---
|
||||
third_party/blink/renderer/core/dom/document.cc | 13 +++++++++++++
|
||||
third_party/blink/renderer/core/dom/document.h | 5 +++++
|
||||
third_party/blink/renderer/core/dom/element.cc | 16 ++++++++++++++++
|
||||
third_party/blink/renderer/core/dom/range.cc | 18 +++++++++++++++++-
|
||||
.../blink/renderer/core/html/canvas/text_metrics.cc | 18 ++++++++++++++++++
|
||||
.../blink/renderer/core/html/canvas/text_metrics.h | 2 ++
|
||||
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 10 +++++++++-
|
||||
7 files changed, 80 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/optional.h"
|
||||
+#include "base/rand_util.h"
|
||||
#include "services/metrics/public/cpp/mojo_ukm_recorder.h"
|
||||
#include "services/metrics/public/cpp/ukm_builders.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
@@ -725,6 +726,10 @@ Document::Document(const DocumentInit& initializer,
|
||||
}
|
||||
DCHECK(fetcher_);
|
||||
|
||||
+ // add X/Y noise factors that will be used to mitigate fingerprinting
|
||||
+ shuffleFactorX_ = base::RandDouble();
|
||||
+ shuffleFactorY_ = base::RandDouble();
|
||||
+
|
||||
root_scroller_controller_ = RootScrollerController::Create(*this);
|
||||
|
||||
// We depend on the url getting immediately set in subframes, but we
|
||||
@@ -790,6 +795,14 @@ Range* Document::CreateRangeAdjustedToTreeScope(const TreeScope& tree_scope,
|
||||
Position::BeforeNode(*shadow_host));
|
||||
}
|
||||
|
||||
+double Document::GetShuffleFactorX() {
|
||||
+ return shuffleFactorX_;
|
||||
+}
|
||||
+
|
||||
+double Document::GetShuffleFactorY() {
|
||||
+ return shuffleFactorY_;
|
||||
+}
|
||||
+
|
||||
SelectorQueryCache& Document::GetSelectorQueryCache() {
|
||||
if (!selector_query_cache_)
|
||||
selector_query_cache_ = std::make_unique<SelectorQueryCache>();
|
||||
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
|
||||
@@ -427,6 +427,9 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
|
||||
}
|
||||
|
||||
+ double GetShuffleFactorX();
|
||||
+ double GetShuffleFactorY();
|
||||
+
|
||||
String visibilityState() const;
|
||||
mojom::PageVisibilityState GetPageVisibilityState() const;
|
||||
bool hidden() const;
|
||||
@@ -1780,6 +1783,8 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
double start_time_;
|
||||
|
||||
+ double shuffleFactorX_, shuffleFactorY_;
|
||||
+
|
||||
TraceWrapperMember<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
|
||||
@@ -1363,6 +1363,15 @@ DOMRectList* Element::getClientRects() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
|
||||
quads, *element_layout_object);
|
||||
+
|
||||
+ // scale all quads
|
||||
+ auto shuffleX = 1 + (GetDocument().GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
+ auto shuffleY = 1 + (GetDocument().GetShuffleFactorY() - 0.5) * 0.000003;
|
||||
+
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(shuffleX, shuffleY);
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
@@ -1380,6 +1389,13 @@ DOMRect* Element::getBoundingClientRect() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
+
|
||||
+ // scale rect by 3/1000000th
|
||||
+ auto shuffleX = 1 + (GetDocument().GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
+ auto shuffleY = 1 + (GetDocument().GetShuffleFactorY() - 0.5) * 0.000003;
|
||||
+
|
||||
+ result.Scale(shuffleX, shuffleY);
|
||||
+
|
||||
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
|
||||
@@ -1606,11 +1606,27 @@ DOMRectList* Range::getClientRects() const {
|
||||
Vector<FloatQuad> quads;
|
||||
GetBorderAndTextQuads(quads);
|
||||
|
||||
+ // scale all quads by 3/1000000th
|
||||
+ auto shuffleX = 1 + (owner_document_->GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
+ auto shuffleY = 1 + (owner_document_->GetShuffleFactorY() - 0.5) * 0.000003;
|
||||
+
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(shuffleX, shuffleY);
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
DOMRect* Range::getBoundingClientRect() const {
|
||||
- return DOMRect::FromFloatRect(BoundingRect());
|
||||
+ auto rect = BoundingRect();
|
||||
+
|
||||
+ // scale rect by 3/1000000th
|
||||
+ auto shuffleX = 1 + (owner_document_->GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
+ auto shuffleY = 1 + (owner_document_->GetShuffleFactorY() - 0.5) * 0.000003;
|
||||
+
|
||||
+ rect.Scale(shuffleX, shuffleY);
|
||||
+
|
||||
+ return DOMRect::FromFloatRect(rect);
|
||||
}
|
||||
|
||||
// TODO(editing-dev): We should make
|
||||
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
|
||||
@@ -38,6 +38,24 @@ float TextMetrics::GetFontBaseline(const TextBaseline& text_baseline,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+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
|
||||
@@ -68,6 +68,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
|
||||
|
||||
static float GetFontBaseline(const TextBaseline&, const SimpleFontData&);
|
||||
|
||||
+ 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
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
#include "third_party/blink/public/platform/web_scroll_into_view_params.h"
|
||||
@@ -782,8 +784,14 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
else
|
||||
direction = ToTextDirection(GetState().GetDirection(), canvas());
|
||||
|
||||
- return TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
+ TextMetrics* textMetrics = TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
GetState().GetTextAlign(), text);
|
||||
+
|
||||
+ // scale text metrics by 3/1000000th
|
||||
+ auto shuffleFactor = 1 + (base::RandDouble() - 0.5) * 0.000003;
|
||||
+ textMetrics->Shuffle(shuffleFactor);
|
||||
+
|
||||
+ return textMetrics;
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::DrawTextInternal(
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 24 Mar 2018 05:18:03 +0100
|
||||
Subject: Canvas: fingerprinting mitigations for image data and webGL
|
||||
|
||||
Disable webGL renderer info and modify the color data returned by ToBlob,
|
||||
ToDataURL and getImageData so that it will contain randomly manipulated
|
||||
pixels (maximum 20) that slightly change the color of the R,G,B components
|
||||
without a visible effect.
|
||||
|
||||
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
|
||||
approach to change color components.
|
||||
---
|
||||
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 4 +-
|
||||
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
|
||||
third_party/blink/renderer/platform/BUILD.gn | 4 +-
|
||||
.../platform/graphics/image_data_buffer.cc | 5 +
|
||||
.../platform/graphics/static_bitmap_image.cc | 156 +++++++++++++++++++++
|
||||
.../platform/graphics/static_bitmap_image.h | 2 +
|
||||
6 files changed, 169 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
@@ -33,8 +33,6 @@
|
||||
|
||||
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h"
|
||||
|
||||
-#include "base/rand_util.h"
|
||||
-
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
#include "third_party/blink/public/platform/web_scroll_into_view_params.h"
|
||||
@@ -788,7 +786,7 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
GetState().GetTextAlign(), text);
|
||||
|
||||
// scale text metrics by 3/1000000th
|
||||
- auto shuffleFactor = 1 + (base::RandDouble() - 0.5) * 0.000003;
|
||||
+ auto shuffleFactor = 1 + (canvas()->GetDocument().GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
textMetrics->Shuffle(shuffleFactor);
|
||||
|
||||
return textMetrics;
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {
|
||||
|
||||
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
|
||||
WebGLRenderingContextBase* context) {
|
||||
- return new WebGLDebugRendererInfo(context);
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* WebGLDebugRendererInfo::ExtensionName() {
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1432,7 +1432,9 @@ jumbo_component("platform") {
|
||||
"//third_party/blink/renderer:non_test_config",
|
||||
]
|
||||
|
||||
- include_dirs = []
|
||||
+ include_dirs = [
|
||||
+ "//third_party/skia/include/private", # For shuffler in graphics/static_bitmap_image.cc
|
||||
+ ]
|
||||
|
||||
public_deps = [
|
||||
":blink_platform_public_deps",
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
--- a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
@@ -35,6 +35,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/logging.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
#include "third_party/blink/renderer/platform/image-encoders/image_encoder.h"
|
||||
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
@@ -128,6 +130,9 @@ bool ImageDataBuffer::EncodeImageInternal(const ImageEncodingMimeType mime_type,
|
||||
const SkPixmap& pixmap) const {
|
||||
DCHECK(is_valid_);
|
||||
|
||||
+ // shuffle subchannel color data within the pixmap
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(pixmap_.writable_addr(), pixmap_.info(), 0, 0);
|
||||
+
|
||||
if (mime_type == kMimeTypeJpeg) {
|
||||
SkJpegEncoder::Options options;
|
||||
options.fQuality = ImageEncoder::ComputeJpegQuality(quality);
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/logging.h"
|
||||
#include "base/numerics/checked_math.h"
|
||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
|
||||
@@ -15,6 +17,7 @@
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
+#include "third_party/skia/src/core/SkColorData.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrContext.h"
|
||||
|
||||
@@ -176,10 +179,163 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
|
||||
DCHECK(read_pixels_successful ||
|
||||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
|
||||
rect.X(), rect.Y(), info.width(), info.height())));
|
||||
+
|
||||
+ ShuffleSubchannelColorData(result.Data(), info, rect.X(), rect.Y());
|
||||
+
|
||||
result.Transfer(dest_contents);
|
||||
return true;
|
||||
}
|
||||
|
||||
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
|
||||
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
|
||||
+
|
||||
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
|
||||
+
|
||||
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
|
||||
+ auto w = info.width() - srcX, h = info.height() - srcY;
|
||||
+
|
||||
+ // skip tiny images; info.width()/height() can also be 0
|
||||
+ if ((w < 8) || (h < 8)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // generate the first random number here
|
||||
+ double shuffleX = base::RandDouble();
|
||||
+
|
||||
+ // cap maximum pixels to change
|
||||
+ auto pixels = (w + h) / 128;
|
||||
+ if (pixels > 20) {
|
||||
+ pixels = 20;
|
||||
+ } else if (pixels < 2) {
|
||||
+ pixels = 2;
|
||||
+ }
|
||||
+
|
||||
+ auto colorType = info.colorType();
|
||||
+ auto fRowBytes = info.minRowBytes(); // stride
|
||||
+
|
||||
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
|
||||
+
|
||||
+ // second random number (for y/height)
|
||||
+ double shuffleY = base::RandDouble();
|
||||
+
|
||||
+ // calculate random coordinates using bisection
|
||||
+ auto currentW = w, currentH = h;
|
||||
+ for(;pixels >= 0; pixels--) {
|
||||
+ int x = currentW * shuffleX, y = currentH * shuffleY;
|
||||
+
|
||||
+ // calculate randomisation amounts for each RGB component
|
||||
+ uint8_t shuffleR = base::RandInt(0, 4);
|
||||
+ uint8_t shuffleG = (shuffleR + x) % 4;
|
||||
+ uint8_t shuffleB = (shuffleG + y) % 4;
|
||||
+
|
||||
+ // manipulate pixel data to slightly change the R, G, B components
|
||||
+ switch (colorType) {
|
||||
+ case kAlpha_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ auto r = SkColorGetR(*pixel), g = SkColorGetG(*pixel), b = SkColorGetB(*pixel), a = SkColorGetA(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = SkColorSetARGB(a, r, g, b);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kGray_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ *pixel = shuffleComponent(*pixel, UINT8_MAX-1, shuffleB);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGB_565_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ unsigned r = SkPacked16ToR32(*pixel);
|
||||
+ unsigned g = SkPacked16ToG32(*pixel);
|
||||
+ unsigned b = SkPacked16ToB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 31, shuffleR);
|
||||
+ g = shuffleComponent(g, 63, shuffleG);
|
||||
+ b = shuffleComponent(b, 31, shuffleB);
|
||||
+
|
||||
+ unsigned r16 = (r & SK_R16_MASK) << SK_R16_SHIFT;
|
||||
+ unsigned g16 = (g & SK_G16_MASK) << SK_G16_SHIFT;
|
||||
+ unsigned b16 = (b & SK_B16_MASK) << SK_B16_SHIFT;
|
||||
+
|
||||
+ *pixel = r16 | g16 | b16;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kARGB_4444_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA4444(*pixel), r = SkGetPackedR4444(*pixel), g = SkGetPackedG4444(*pixel), b = SkGetPackedB4444(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 15, shuffleR);
|
||||
+ g = shuffleComponent(g, 15, shuffleG);
|
||||
+ b = shuffleComponent(b, 15, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ unsigned a4 = (a & 0xF) << SK_A4444_SHIFT;
|
||||
+ unsigned r4 = (r & 0xF) << SK_R4444_SHIFT;
|
||||
+ unsigned g4 = (g & 0xF) << SK_G4444_SHIFT;
|
||||
+ unsigned b4 = (b & 0xF) << SK_B4444_SHIFT;
|
||||
+
|
||||
+ *pixel = r4 | b4 | g4 | a4;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGBA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), r = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), b = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
|
||||
+ (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kBGRA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), b = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), r = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_BGRA_A32_SHIFT) | (r << SK_BGRA_R32_SHIFT) |
|
||||
+ (g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ // the remaining formats are not expected to be used in Chromium
|
||||
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // keep bisecting or reset current width/height as needed
|
||||
+ if (x == 0) {
|
||||
+ currentW = w;
|
||||
+ } else {
|
||||
+ currentW = x;
|
||||
+ }
|
||||
+ if (y == 0) {
|
||||
+ currentH = h;
|
||||
+ } else {
|
||||
+ currentH = y;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#undef writable_addr
|
||||
+#undef shuffleComponent
|
||||
+
|
||||
const gpu::SyncToken& StaticBitmapImage::GetSyncToken() const {
|
||||
static const gpu::SyncToken sync_token;
|
||||
return sync_token;
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
@@ -46,6 +46,8 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
|
||||
static scoped_refptr<StaticBitmapImage> Create(WTF::ArrayBufferContents&,
|
||||
const SkImageInfo&);
|
||||
|
||||
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
|
||||
+
|
||||
bool IsStaticBitmapImage() const override { return true; }
|
||||
|
||||
// Methods overridden by all sub-classes
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 22 Oct 2018 21:14:57 +0200
|
||||
Subject: Disable generic sensor API by default
|
||||
|
||||
---
|
||||
services/device/public/cpp/device_features.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/device/public/cpp/device_features.cc b/services/device/public/cpp/device_features.cc
|
||||
--- a/services/device/public/cpp/device_features.cc
|
||||
+++ b/services/device/public/cpp/device_features.cc
|
||||
@@ -9,7 +9,7 @@ namespace features {
|
||||
// Enables sensors based on Generic Sensor API:
|
||||
// https://w3c.github.io/sensors/
|
||||
const base::Feature kGenericSensor{"GenericSensor",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
// Enables an extra set of concrete sensors classes based on Generic Sensor API,
|
||||
// which expose previously unexposed platform features, e.g. ALS or Magnetometer
|
||||
const base::Feature kGenericSensorExtraClasses{
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 22 Oct 2018 21:29:53 +0200
|
||||
Subject: Add flags to disable device motion and orientation APIs
|
||||
|
||||
Both flags will be disabled by default and prevent usage of gyroscope and
|
||||
legacy acceleration events.
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.h | 6 ++++++
|
||||
content/child/runtime_features.cc | 3 +++
|
||||
content/public/common/content_features.cc | 10 ++++++++++
|
||||
content/public/common/content_features.h | 2 ++
|
||||
third_party/blink/public/platform/web_runtime_features.h | 2 ++
|
||||
third_party/blink/renderer/modules/modules_initializer.cc | 9 ++++++---
|
||||
.../blink/renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
|
||||
10 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -3005,6 +3005,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-generic-sensor", flag_descriptions::kEnableGenericSensorName,
|
||||
flag_descriptions::kEnableGenericSensorDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kGenericSensor)},
|
||||
+ {"enable-device-motion", flag_descriptions::kEnableDeviceMotionName,
|
||||
+ flag_descriptions::kEnableDeviceMotionDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kDeviceMotion)},
|
||||
+ {"enable-device-orientation", flag_descriptions::kEnableDeviceOrientationName,
|
||||
+ flag_descriptions::kEnableDeviceOrientationDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kDeviceOrientation)},
|
||||
{"enable-generic-sensor-extra-classes",
|
||||
flag_descriptions::kEnableGenericSensorExtraClassesName,
|
||||
flag_descriptions::kEnableGenericSensorExtraClassesDescription, kOsAll,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -551,6 +551,14 @@ const char kEnableGenericSensorDescription[] =
|
||||
"Accelerometer, LinearAccelerationSensor, Gyroscope, "
|
||||
"AbsoluteOrientationSensor and RelativeOrientationSensor interfaces.";
|
||||
|
||||
+const char kEnableDeviceMotionName[] = "Enable device motion";
|
||||
+const char kEnableDeviceMotionDescription[] =
|
||||
+ "Enable device motion API which is used to detect changes in acceleration";
|
||||
+
|
||||
+const char kEnableDeviceOrientationName[] = "Enable device orientation";
|
||||
+const char kEnableDeviceOrientationDescription[] =
|
||||
+ "Enable device orientation API which is used to detect changes in orientation";
|
||||
+
|
||||
const char kEnableGenericSensorExtraClassesName[] =
|
||||
"Generic Sensor Extra Classes";
|
||||
const char kEnableGenericSensorExtraClassesDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -362,6 +362,12 @@ extern const char kEnableEnumeratingAudioDevicesDescription[];
|
||||
extern const char kEnableGenericSensorName[];
|
||||
extern const char kEnableGenericSensorDescription[];
|
||||
|
||||
+extern const char kEnableDeviceMotionName[];
|
||||
+extern const char kEnableDeviceMotionDescription[];
|
||||
+
|
||||
+extern const char kEnableDeviceOrientationName[];
|
||||
+extern const char kEnableDeviceOrientationDescription[];
|
||||
+
|
||||
extern const char kEnableGenericSensorExtraClassesName[];
|
||||
extern const char kEnableGenericSensorExtraClassesDescription[];
|
||||
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -143,6 +143,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
|
||||
if (command_line.HasSwitch(switches::kDisableSharedWorkers))
|
||||
WebRuntimeFeatures::EnableSharedWorker(false);
|
||||
|
||||
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
|
||||
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
|
||||
+
|
||||
if (command_line.HasSwitch(switches::kDisableSpeechAPI))
|
||||
WebRuntimeFeatures::EnableScriptedSpeech(false);
|
||||
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -570,6 +570,16 @@ const base::Feature kWebRtcHideLocalIpsWithMdns{
|
||||
// https://wicg.github.io/webusb
|
||||
const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
+// Enables the device motion API used to track device acceleration;
|
||||
+// no user authorization or notifications happens when in use.
|
||||
+const base::Feature kDeviceMotion{"DeviceMotion",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
+// Enables the device orientation API used to track device orientation;
|
||||
+// no user authorization or notifications happens when in use.
|
||||
+const base::Feature kDeviceOrientation{"DeviceOrientation",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
// Controls whether WebVR VSync-aligned render loop timing is enabled.
|
||||
const base::Feature kWebVrVsyncAlign{"WebVrVsyncAlign",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
|
||||
--- a/content/public/common/content_features.h
|
||||
+++ b/content/public/common/content_features.h
|
||||
@@ -152,6 +152,8 @@ CONTENT_EXPORT extern const char kWebXrRenderPathParamValueGpuFence[];
|
||||
CONTENT_EXPORT extern const char kWebXrRenderPathParamValueSharedBuffer[];
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
|
||||
+
|
||||
#if !defined(OS_ANDROID)
|
||||
CONTENT_EXPORT extern const base::Feature kWebUIPolymer2;
|
||||
#endif // !defined(OS_ANDROID)
|
||||
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -85,6 +85,8 @@ class WebRuntimeFeatures {
|
||||
BLINK_PLATFORM_EXPORT static void EnableCSSFragmentIdentifiers(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableDatabase(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableDecodeToYUV(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableDisplayCutoutAPI(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableFastMobileScrolling(bool);
|
||||
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
--- a/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
@@ -233,9 +233,12 @@ void ModulesInitializer::InitInspectorAgentSession(
|
||||
void ModulesInitializer::OnClearWindowObjectInMainWorld(
|
||||
Document& document,
|
||||
const Settings& settings) const {
|
||||
- DeviceMotionController::From(document);
|
||||
- DeviceOrientationController::From(document);
|
||||
- DeviceOrientationAbsoluteController::From(document);
|
||||
+ if (RuntimeEnabledFeatures::DeviceMotionEnabled())
|
||||
+ DeviceMotionController::From(document);
|
||||
+ if (RuntimeEnabledFeatures::DeviceOrientationEnabled()) {
|
||||
+ DeviceOrientationController::From(document);
|
||||
+ DeviceOrientationAbsoluteController::From(document);
|
||||
+ }
|
||||
NavigatorGamepad::From(document);
|
||||
NavigatorServiceWorker::From(document);
|
||||
DOMWindowStorageController::From(document);
|
||||
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
@@ -136,6 +136,14 @@ void WebRuntimeFeatures::EnableDatabase(bool enable) {
|
||||
RuntimeEnabledFeatures::SetDatabaseEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
|
||||
+}
|
||||
+
|
||||
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
|
||||
+}
|
||||
+
|
||||
void WebRuntimeFeatures::EnableDecodeToYUV(bool enable) {
|
||||
RuntimeEnabledFeatures::SetDecodeToYUVEnabled(enable);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -357,6 +357,14 @@
|
||||
status: "stable",
|
||||
},
|
||||
{
|
||||
+ name: "DeviceMotion",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
+ name: "DeviceOrientation",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
name: "DecodeToYUV",
|
||||
status: "experimental",
|
||||
},
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 2 Apr 2018 11:36:02 +0200
|
||||
Subject: Punt the Widevine version string
|
||||
|
||||
Originally from http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.wily.beta/view/head:/debian/patches/fix_building_widevinecdm_with_chromium.patch
|
||||
---
|
||||
chrome/common/chrome_content_client.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
|
||||
--- a/chrome/common/chrome_content_client.cc
|
||||
+++ b/chrome/common/chrome_content_client.cc
|
||||
@@ -538,7 +538,7 @@ void ChromeContentClient::AddContentDecryptionModules(
|
||||
base::FilePath cdm_path;
|
||||
content::CdmCapability capability;
|
||||
if (IsWidevineAvailable(&cdm_path, &capability)) {
|
||||
- const base::Version version(WIDEVINE_CDM_VERSION_STRING);
|
||||
+ const base::Version version("1.0.123.456");
|
||||
DCHECK(version.IsValid());
|
||||
|
||||
cdms->push_back(
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ Subject: Disable metrics on all I/O threads
|
||||
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
|
||||
@@ -971,7 +971,7 @@ void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
|
||||
@@ -873,7 +873,7 @@ void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
|
||||
|
||||
bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
@@ -19,5 +19,5 @@ diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profile
|
||||
|
||||
chrome_browser_net::Predictor* ProfileIOData::GetPredictor() {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Apr 2018 08:30:26 +0200
|
||||
Subject: Add a flag for DNS-over-HTTPS
|
||||
|
||||
Allow selection between Google and Cloudflare endpoints.
|
||||
Serve DoH requests with maximum priority, remove traffic annotation.
|
||||
Reduce HTTP headers in DoH requests to bare minimum.
|
||||
|
||||
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt
|
||||
---
|
||||
chrome/browser/about_flags.cc | 13 ++++++++++
|
||||
chrome/browser/flag_descriptions.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../browser/net/system_network_context_manager.cc | 16 ++++++-------
|
||||
.../common/network_features.cc | 6 +++--
|
||||
.../common/network_features.h | 4 +++-
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
net/base/load_flags_list.h | 6 +++++
|
||||
net/dns/dns_transaction.cc | 28 +++-------------------
|
||||
net/url_request/url_request_http_job.cc | 26 ++++++++++++--------
|
||||
10 files changed, 62 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -461,6 +461,13 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
|
||||
base::size(kCCTModuleCache_ThirtyMinutes), nullptr},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kDnsOverHttpsChoices[] = {
|
||||
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
|
||||
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google.com/experimental"},
|
||||
+ {features::kDnsOverHttpsChoiceCloudflare, switches::kDnsOverHttpsServer, "https://1.1.1.1/dns-query"},
|
||||
+ {features::kDnsOverHttpsChoiceQuad9, switches::kDnsOverHttpsServer, "https://9.9.9.9/dns-query"}
|
||||
+};
|
||||
+
|
||||
#endif // OS_ANDROID
|
||||
|
||||
const FeatureEntry::Choice kNumRasterThreadsChoices[] = {
|
||||
@@ -3659,6 +3666,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kAsyncDns)},
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+#if defined(OS_ANDROID)
|
||||
+ {"enable-dns-over-https", flag_descriptions::kDnsOverHttpsName,
|
||||
+ flag_descriptions::kDnsOverHttpsDescription, kOsAndroid,
|
||||
+ MULTI_VALUE_TYPE(kDnsOverHttpsChoices)},
|
||||
+#endif // defined(OS_ANDROID)
|
||||
+
|
||||
{"enable-overflow-icons-for-media-controls",
|
||||
flag_descriptions::kOverflowIconsForMediaControlsName,
|
||||
flag_descriptions::kOverflowIconsForMediaControlsDescription, kOsAll,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -2209,6 +2209,9 @@ const char kAutoFetchOnNetErrorPageDescription[] =
|
||||
"When enabled, and navigation fails with an offline error, schedule a "
|
||||
"fetch of the page when online again.";
|
||||
|
||||
+const char kDnsOverHttpsName[] = "DNS over HTTPS";
|
||||
+const char kDnsOverHttpsDescription[] = "Enables DNS-over-HTTPS (experimental).";
|
||||
+
|
||||
const char kAutofillAccessoryViewName[] =
|
||||
"Autofill suggestions as keyboard accessory view";
|
||||
const char kAutofillAccessoryViewDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1343,6 +1343,9 @@ extern const char kAsyncDnsDescription[];
|
||||
extern const char kAutoFetchOnNetErrorPageName[];
|
||||
extern const char kAutoFetchOnNetErrorPageDescription[];
|
||||
|
||||
+extern const char kDnsOverHttpsName[];
|
||||
+extern const char kDnsOverHttpsDescription[];
|
||||
+
|
||||
extern const char kAutofillAccessoryViewName[];
|
||||
extern const char kAutofillAccessoryViewDescription[];
|
||||
|
||||
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
|
||||
--- a/chrome/browser/net/system_network_context_manager.cc
|
||||
+++ b/chrome/browser/net/system_network_context_manager.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "chrome/browser/component_updater/sth_set_component_installer.h"
|
||||
#include "chrome/browser/io_thread.h"
|
||||
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
#include "chrome/browser/ssl/ssl_config_service_manager.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
@@ -389,15 +390,12 @@ SystemNetworkContextManager::SystemNetworkContextManager(
|
||||
base::Value(ShouldEnableAsyncDns()));
|
||||
base::ListValue default_doh_servers;
|
||||
base::ListValue default_doh_server_methods;
|
||||
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
|
||||
- std::string server(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "server"));
|
||||
- std::string method(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "method"));
|
||||
- if (!server.empty()) {
|
||||
- default_doh_servers.AppendString(server);
|
||||
- default_doh_server_methods.AppendString(method);
|
||||
- }
|
||||
+ std::string server =
|
||||
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
+ switches::kDnsOverHttpsServer);
|
||||
+ if (!server.empty()) {
|
||||
+ default_doh_servers.AppendString(server);
|
||||
+ default_doh_server_methods.AppendString("POST");
|
||||
}
|
||||
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsServers,
|
||||
std::move(default_doh_servers));
|
||||
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -10,7 +10,9 @@ namespace features {
|
||||
|
||||
const base::Feature kChannelID{"channel-id", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
-const base::Feature kDnsOverHttps{"dns-over-https",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+const char kDnsOverHttpsChoiceDefault[] = "Disabled",
|
||||
+ kDnsOverHttpsChoiceGoogle[] = "Google",
|
||||
+ kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
|
||||
+ kDnsOverHttpsChoiceQuad9[] = "Quad9";
|
||||
|
||||
} // 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
|
||||
@@ -13,9 +13,11 @@ namespace features {
|
||||
// Enables Channel ID.
|
||||
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kChannelID;
|
||||
|
||||
-// Enabled DNS over HTTPS
|
||||
+// DNS over HTTPS server endpoint choices
|
||||
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).
|
||||
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
|
||||
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kDnsOverHttpsChoiceDefault[],
|
||||
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[];
|
||||
|
||||
} // namespace features
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -35,6 +35,10 @@ NETWORK_SWITCH(kOriginToForceQuicOn, "origin-to-force-quic-on")
|
||||
// the server.
|
||||
NETWORK_SWITCH(kQuicConnectionOptions, "quic-connection-options")
|
||||
|
||||
+// Specifies an IETF DNS-over-HTTPS server endpoint
|
||||
+// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-02.txt).
|
||||
+NETWORK_SWITCH(kDnsOverHttpsServer, "dns-over-https-server")
|
||||
+
|
||||
// Specifies the maximum length for a QUIC packet.
|
||||
NETWORK_SWITCH(kQuicMaxPacketLength, "quic-max-packet-length")
|
||||
|
||||
diff --git a/net/base/load_flags_list.h b/net/base/load_flags_list.h
|
||||
--- a/net/base/load_flags_list.h
|
||||
+++ b/net/base/load_flags_list.h
|
||||
@@ -92,6 +92,12 @@ LOAD_FLAG(MAYBE_USER_GESTURE, 1 << 14)
|
||||
LOAD_FLAG(DO_NOT_USE_EMBEDDED_IDENTITY, 1 << 15)
|
||||
|
||||
// Indicates that this request is not to be migrated to a cellular network when
|
||||
+
|
||||
+// This load will not send Accept-Language or User-Agent headers, and not
|
||||
+// advertise brotli encoding.
|
||||
+// Used to comply with IETF (draft) DNS-over-HTTPS:
|
||||
+// "Implementors SHOULD NOT set non-essential HTTP headers in DoH client requests."
|
||||
+LOAD_FLAG(MINIMAL_HEADERS, 1 << 18)
|
||||
// QUIC connection migration is enabled.
|
||||
LOAD_FLAG(DISABLE_CONNECTION_MIGRATION_TO_CELLULAR, 1 << 16)
|
||||
|
||||
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
|
||||
--- a/net/dns/dns_transaction.cc
|
||||
+++ b/net/dns/dns_transaction.cc
|
||||
@@ -358,30 +358,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
|
||||
HttpRequestHeaders extra_request_headers;
|
||||
extra_request_headers.SetHeader("Accept", kDnsOverHttpResponseContentType);
|
||||
-
|
||||
- request_ = url_request_context->CreateRequest(
|
||||
- url, request_priority_, this,
|
||||
- net::DefineNetworkTrafficAnnotation("dns_over_https", R"(
|
||||
- semantics {
|
||||
- sender: "DNS over HTTPS"
|
||||
- description: "Domain name resolution over HTTPS"
|
||||
- trigger: "User enters a navigates to a domain or Chrome otherwise "
|
||||
- "makes a connection to a domain whose IP address isn't cached"
|
||||
- data: "The domain name that is being requested"
|
||||
- destination: OTHER
|
||||
- destination_other: "The user configured DNS over HTTPS server, which"
|
||||
- "may be dns.google.com"
|
||||
- }
|
||||
- policy {
|
||||
- cookies_allowed: NO
|
||||
- setting:
|
||||
- "You can configure this feature via that 'dns_over_https_servers' and"
|
||||
- "'dns_over_https.method' prefs. Empty lists imply this feature is"
|
||||
- "disabled"
|
||||
- policy_exception_justification: "Experimental feature that"
|
||||
- "is disabled by default"
|
||||
- }
|
||||
- )"));
|
||||
+ request_ = url_request_context->CreateRequest(url, request_priority_, this);
|
||||
net_log_ = request_->net_log();
|
||||
|
||||
if (use_post) {
|
||||
@@ -397,6 +374,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
|
||||
request_->SetExtraRequestHeaders(extra_request_headers);
|
||||
request_->SetLoadFlags(request_->load_flags() | LOAD_DISABLE_CACHE |
|
||||
+ LOAD_IGNORE_LIMITS | LOAD_MINIMAL_HEADERS |
|
||||
LOAD_BYPASS_PROXY);
|
||||
request_->set_allow_credentials(false);
|
||||
}
|
||||
@@ -819,7 +797,7 @@ class DnsTransactionImpl : public DnsTransaction,
|
||||
had_tcp_attempt_(false),
|
||||
doh_attempt_(false),
|
||||
first_server_index_(0),
|
||||
- request_priority_(DEFAULT_PRIORITY) {
|
||||
+ request_priority_(MAXIMUM_PRIORITY) {
|
||||
DCHECK(session_.get());
|
||||
DCHECK(!hostname_.empty());
|
||||
DCHECK(!callback_.is_null());
|
||||
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
||||
--- a/net/url_request/url_request_http_job.cc
|
||||
+++ b/net/url_request/url_request_http_job.cc
|
||||
@@ -434,19 +434,23 @@ void URLRequestHttpJob::Start() {
|
||||
// plugin could set a referrer although sending the referrer is inhibited.
|
||||
request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer);
|
||||
|
||||
- // Our consumer should have made sure that this is a safe referrer. See for
|
||||
- // instance WebCore::FrameLoader::HideReferrer.
|
||||
- if (referrer.is_valid()) {
|
||||
- request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ // Our consumer should have made sure that this is a safe referrer. See for
|
||||
+ // instance WebCore::FrameLoader::HideReferrer.
|
||||
+ if (referrer.is_valid()) {
|
||||
+ request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
|
||||
referrer.spec());
|
||||
+ }
|
||||
}
|
||||
|
||||
// This should be kept in sync with the corresponding code in
|
||||
// URLRequest::GetUserAgent.
|
||||
- request_info_.extra_headers.SetHeaderIfMissing(
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ request_info_.extra_headers.SetHeaderIfMissing(
|
||||
HttpRequestHeaders::kUserAgent,
|
||||
http_user_agent_settings_ ?
|
||||
http_user_agent_settings_->GetUserAgent() : std::string());
|
||||
+ }
|
||||
|
||||
AddExtraHeaders();
|
||||
AddCookieHeaderAndStart();
|
||||
@@ -664,10 +668,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
HttpRequestHeaders::kAcceptEncoding)) {
|
||||
// Advertise "br" encoding only if transferred data is opaque to proxy.
|
||||
bool advertise_brotli = false;
|
||||
- if (request()->context()->enable_brotli()) {
|
||||
- if (request()->url().SchemeIsCryptographic() ||
|
||||
- IsLocalhost(request()->url())) {
|
||||
- advertise_brotli = true;
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ if (request()->context()->enable_brotli()) {
|
||||
+ if (request()->url().SchemeIsCryptographic() ||
|
||||
+ IsLocalhost(request()->url())) {
|
||||
+ advertise_brotli = true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,7 +690,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
advertised_encodings);
|
||||
}
|
||||
|
||||
- if (http_user_agent_settings_) {
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS) && http_user_agent_settings_) {
|
||||
// Only add default Accept-Language if the request didn't have it
|
||||
// specified.
|
||||
std::string accept_language =
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
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
|
||||
@@ -216,7 +216,7 @@ void OnAuthPrefsChanged(PrefService* local_state,
|
||||
// Android this includes checking the Android version in the field trial.
|
||||
bool ShouldEnableAsyncDns() {
|
||||
bool feature_can_be_enabled = true;
|
||||
-#if defined(OS_ANDROID)
|
||||
+#if 0
|
||||
int min_sdk =
|
||||
base::GetFieldTrialParamByFeatureAsInt(features::kAsyncDns, "min_sdk", 0);
|
||||
if (base::android::BuildInfo::GetInstance()->sdk_int() < min_sdk)
|
||||
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
|
||||
--- a/components/cronet/url_request_context_config.cc
|
||||
+++ b/components/cronet/url_request_context_config.cc
|
||||
@@ -476,7 +476,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
|
||||
effective_experimental_options->Remove(it.key(), nullptr);
|
||||
continue;
|
||||
}
|
||||
- async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
|
||||
+ bool ignored;
|
||||
+ async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
|
||||
} else if (it.key() == kStaleDnsFieldTrialName) {
|
||||
const base::DictionaryValue* stale_dns_args = nullptr;
|
||||
if (!it.value().GetAsDictionary(&stale_dns_args)) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
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 ++++
|
||||
net/socket/client_socket_pool_manager.cc | 16 ++++++++++++++++
|
||||
7 files changed, 42 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
|
||||
@@ -963,6 +963,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 ==
|
||||
@@ -2606,6 +2611,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kMaterialDesignIncognitoNTPName,
|
||||
flag_descriptions::kMaterialDesignIncognitoNTPDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(features::kMaterialDesignIncognitoNTP)},
|
||||
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
|
||||
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
{"safe-search-url-reporting",
|
||||
flag_descriptions::kSafeSearchUrlReportingName,
|
||||
flag_descriptions::kSafeSearchUrlReportingDescription, kOsAll,
|
||||
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
|
||||
@@ -1142,6 +1142,10 @@ const char kMaterialDesignIncognitoNTPDescription[] =
|
||||
"If enabled, the Incognito New Tab page uses the new material design with "
|
||||
"a better readable text.";
|
||||
|
||||
+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
|
||||
@@ -710,6 +710,9 @@ extern const char kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards[];
|
||||
extern const char kMaterialDesignIncognitoNTPName[];
|
||||
extern const char kMaterialDesignIncognitoNTPDescription[];
|
||||
|
||||
+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,6 +8,9 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
|
||||
+ kMaxConnectionsPerHostChoice15[] = "15";
|
||||
+
|
||||
const base::Feature kChannelID{"channel-id", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const char kDnsOverHttpsChoiceDefault[] = "Disabled",
|
||||
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[];
|
||||
+
|
||||
// Enables Channel ID.
|
||||
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kChannelID;
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -21,6 +21,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
|
||||
// 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")
|
||||
+
|
||||
// Enable use of experimental TCP sockets API for sending data in the
|
||||
// SYN packet.
|
||||
NETWORK_SWITCH(kEnableTcpFastOpen, "enable-tcp-fastopen")
|
||||
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
|
||||
--- a/net/socket/client_socket_pool_manager.cc
|
||||
+++ b/net/socket/client_socket_pool_manager.cc
|
||||
@@ -6,8 +6,10 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "net/http/http_proxy_client_socket_pool.h"
|
||||
#include "net/http/http_request_info.h"
|
||||
@@ -19,6 +21,7 @@
|
||||
#include "net/socket/ssl_client_socket_pool.h"
|
||||
#include "net/socket/transport_client_socket_pool.h"
|
||||
#include "net/ssl/ssl_config.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
|
||||
namespace net {
|
||||
|
||||
@@ -316,6 +319,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.11.0
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 29 Aug 2018 11:03:44 +0200
|
||||
Subject: Add custom tab intents privacy option
|
||||
|
||||
---
|
||||
chrome/android/java/res/values/values.xml | 3 +++
|
||||
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
|
||||
.../org/chromium/chrome/browser/LaunchIntentDispatcher.java | 2 ++
|
||||
.../chrome/browser/preferences/privacy/PrivacyPreferences.java | 10 ++++++++++
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 7 +++++++
|
||||
5 files changed, 27 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
|
||||
--- a/chrome/android/java/res/values/values.xml
|
||||
+++ b/chrome/android/java/res/values/values.xml
|
||||
@@ -18,6 +18,9 @@
|
||||
<item name="top_controls_show_threshold" format="float" type="dimen">0.5</item>
|
||||
<item name="top_controls_hide_threshold" format="float" type="dimen">0.5</item>
|
||||
|
||||
+ <string name="allow_custom_tab_intents_title">Allow custom tab intents from applications</string>
|
||||
+ <string name="allow_custom_tab_intents_summary">When disabled, all custom tab intents will be processed as regular navigation instead</string>
|
||||
+
|
||||
<!-- The number of thumbnails that the thumbnail cache can hold. -->
|
||||
<integer name="default_thumbnail_cache_size">5</integer>
|
||||
<!-- The number of approximation thumbnails that the approximation cache can hold. -->
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -55,6 +55,11 @@
|
||||
android:title="@string/clear_browsing_data_title"
|
||||
android:summary="@string/clear_browsing_data_summary"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment" />
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ 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" />
|
||||
<Preference
|
||||
android:key="sync_and_services_link_divider"
|
||||
android:layout="@layout/divider_preference"
|
||||
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
|
||||
@@ -38,6 +38,7 @@ import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
|
||||
import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
|
||||
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
+import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferences;
|
||||
import org.chromium.chrome.browser.searchwidget.SearchActivity;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin;
|
||||
@@ -272,6 +273,7 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
*/
|
||||
public static boolean isCustomTabIntent(Intent intent) {
|
||||
if (intent == null) return false;
|
||||
+ if (!ContextUtils.getAppSharedPreferences().getBoolean(PrivacyPreferences.PREF_ALLOW_CUSTOM_TAB_INTENTS, false)) return false;
|
||||
if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
|
||||
|| !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
|
||||
return false;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
@@ -42,6 +42,7 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
"safe_browsing_extended_reporting";
|
||||
private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
|
||||
"safe_browsing_scout_reporting";
|
||||
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
private static final String PREF_SAFE_BROWSING = "safe_browsing";
|
||||
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
|
||||
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
|
||||
@@ -135,6 +136,11 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
? PREF_SAFE_BROWSING_EXTENDED_REPORTING : PREF_SAFE_BROWSING_SCOUT_REPORTING;
|
||||
preferenceScreen.removePreference(findPreference(extended_reporting_pref_to_remove));
|
||||
|
||||
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
|
||||
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
|
||||
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
ChromeBaseCheckBoxPreference safeBrowsingPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
|
||||
safeBrowsingPref.setOnPreferenceChangeListener(this);
|
||||
@@ -154,6 +160,10 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
|| PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
|
||||
(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_NETWORK_PREDICTIONS.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
|
||||
recordNetworkPredictionEnablingUMA((boolean) newValue);
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -3875,6 +3875,13 @@ However, you aren’t invisible. Going private doesn’t hide your browsing from
|
||||
Browse
|
||||
</message>
|
||||
|
||||
+ <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>
|
||||
+
|
||||
<!-- Migration strings -->
|
||||
<message name="IDS_UPDATING_CHROME" desc="String that indicates that Chrome is updating">
|
||||
Updating Chrome...
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 28 Aug 2018 23:27:23 +0200
|
||||
Subject: Add site settings option for session-only cookies
|
||||
|
||||
---
|
||||
chrome/android/java/res/values/values.xml | 3 +++
|
||||
.../android/java/res/xml/website_preferences.xml | 7 ++++++
|
||||
.../browser/preferences/PrefServiceBridge.java | 10 +++++++++
|
||||
.../website/SingleCategoryPreferences.java | 21 +++++++++++++++++-
|
||||
.../java/strings/android_chrome_strings.grd | 6 ++++++
|
||||
.../android/preferences/pref_service_bridge.cc | 25 ++++++++++++++++++++++
|
||||
6 files changed, 71 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
|
||||
--- a/chrome/android/java/res/values/values.xml
|
||||
+++ b/chrome/android/java/res/values/values.xml
|
||||
@@ -39,6 +39,9 @@
|
||||
<integer name="reload_button_level_reload">0</integer>
|
||||
<integer name="reload_button_level_stop">1</integer>
|
||||
|
||||
+ <string name="allow_cookies_session_only_title">Keep cookies only until you quit your browser</string>
|
||||
+ <string name="allow_cookies_session_only_summary">When enabled, all cookies will be erased when the browsing session is over</string>
|
||||
+
|
||||
<!-- Help and Feedback
|
||||
These constants should be in sync with the context names on go/mobilehelprecs.
|
||||
If the context ID cannot be found, the default help page will be shown to the user.-->
|
||||
diff --git a/chrome/android/java/res/xml/website_preferences.xml b/chrome/android/java/res/xml/website_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/website_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/website_preferences.xml
|
||||
@@ -26,6 +26,13 @@
|
||||
android:summary="@string/allow_third_party_cookies_summary"
|
||||
android:defaultValue="true"
|
||||
android:persistent="false" />
|
||||
+ <!-- A toggle for cookies to be saved only until session exit, only shown for the Cookies category. -->
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ android:key="cookies_session_only"
|
||||
+ android:title="@string/allow_cookies_session_only_title"
|
||||
+ android:summary="@string/allow_cookies_session_only_summary"
|
||||
+ android:defaultValue="true"
|
||||
+ android:persistent="false" />
|
||||
<!-- A toggle for enabling vibration in notifications. -->
|
||||
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="notifications_vibrate"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
@@ -245,6 +245,10 @@ public class PrefServiceBridge {
|
||||
return nativeGetBlockThirdPartyCookiesEnabled();
|
||||
}
|
||||
|
||||
+ public boolean isCookiesSessionOnlyEnabled() {
|
||||
+ return nativeGetCookiesSessionOnlyEnabled();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return Whether third-party cookie blocking is configured by policy
|
||||
*/
|
||||
@@ -638,6 +642,10 @@ public class PrefServiceBridge {
|
||||
nativeSetBlockThirdPartyCookiesEnabled(enabled);
|
||||
}
|
||||
|
||||
+ public void setCookiesSessionOnlyEnabled(boolean enabled) {
|
||||
+ nativeSetCookiesSessionOnlyEnabled(enabled);
|
||||
+ }
|
||||
+
|
||||
public void setDoNotTrackEnabled(boolean enabled) {
|
||||
nativeSetDoNotTrackEnabled(enabled);
|
||||
}
|
||||
@@ -1086,6 +1094,7 @@ public class PrefServiceBridge {
|
||||
private native boolean nativeGetAutoplayEnabled();
|
||||
private native boolean nativeGetBackgroundSyncEnabled();
|
||||
private native boolean nativeGetBlockThirdPartyCookiesEnabled();
|
||||
+ private native boolean nativeGetCookiesSessionOnlyEnabled();
|
||||
private native boolean nativeGetBlockThirdPartyCookiesManaged();
|
||||
private native boolean nativeGetRememberPasswordsEnabled();
|
||||
private native boolean nativeGetPasswordManagerAutoSigninEnabled();
|
||||
@@ -1132,6 +1141,7 @@ public class PrefServiceBridge {
|
||||
private native void nativeSetAutoplayEnabled(boolean enabled);
|
||||
private native void nativeSetAllowCookiesEnabled(boolean enabled);
|
||||
private native void nativeSetBackgroundSyncEnabled(boolean enabled);
|
||||
+ private native void nativeSetCookiesSessionOnlyEnabled(boolean enabled);
|
||||
private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled);
|
||||
private native void nativeSetClipboardEnabled(boolean enabled);
|
||||
private native void nativeSetDoNotTrackEnabled(boolean enabled);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
@@ -110,6 +110,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
|
||||
// Keys for category-specific preferences (toggle, link, button etc.), dynamically shown.
|
||||
public static final String THIRD_PARTY_COOKIES_TOGGLE_KEY = "third_party_cookies";
|
||||
+ public static final String COOKIES_SESSION_ONLY_TOGGLE_KEY = "cookies_session_only";
|
||||
public static final String NOTIFICATIONS_VIBRATE_TOGGLE_KEY = "notifications_vibrate";
|
||||
public static final String EXPLAIN_PROTECTED_MEDIA_KEY = "protected_content_learn_more";
|
||||
private static final String ADD_EXCEPTION_KEY = "add_exception";
|
||||
@@ -438,6 +439,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
|
||||
if (type == SiteSettingsCategory.Type.COOKIES) {
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else if (type == SiteSettingsCategory.Type.NOTIFICATIONS) {
|
||||
updateNotificationsVibrateCheckBox();
|
||||
}
|
||||
@@ -476,6 +478,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
getInfoForOrigins();
|
||||
} else if (THIRD_PARTY_COOKIES_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
prefServiceBridge.setBlockThirdPartyCookiesEnabled(!((boolean) newValue));
|
||||
+ } else if (COOKIES_SESSION_ONLY_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
+ prefServiceBridge.setCookiesSessionOnlyEnabled((boolean) newValue);
|
||||
} else if (NOTIFICATIONS_VIBRATE_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
prefServiceBridge.setNotificationsVibrateEnabled((boolean) newValue);
|
||||
}
|
||||
@@ -738,6 +742,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
TriStateSiteSettingsPreference triStateToggle =
|
||||
(TriStateSiteSettingsPreference) screen.findPreference(TRI_STATE_TOGGLE_KEY);
|
||||
Preference thirdPartyCookies = screen.findPreference(THIRD_PARTY_COOKIES_TOGGLE_KEY);
|
||||
+ Preference cookiesSessionOnly = getPreferenceScreen().findPreference(
|
||||
+ COOKIES_SESSION_ONLY_TOGGLE_KEY);
|
||||
Preference notificationsVibrate = screen.findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY);
|
||||
Preference explainProtectedMediaKey = screen.findPreference(EXPLAIN_PROTECTED_MEDIA_KEY);
|
||||
PreferenceGroup allowedGroup = (PreferenceGroup) screen.findPreference(ALLOWED_GROUP);
|
||||
@@ -752,6 +758,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
screen.removePreference(binaryToggle);
|
||||
screen.removePreference(triStateToggle);
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
screen.removePreference(notificationsVibrate);
|
||||
screen.removePreference(explainProtectedMediaKey);
|
||||
screen.removePreference(allowedGroup);
|
||||
@@ -787,12 +794,15 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
configureBinaryToggle(binaryToggle, contentType);
|
||||
}
|
||||
|
||||
- // Configure/hide the third-party cookie toggle, as needed.
|
||||
+ // Configure/hide the third-party cookie toggle and session-only cookie toggle, as needed.
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {
|
||||
thirdPartyCookies.setOnPreferenceChangeListener(this);
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ cookiesSessionOnly.setOnPreferenceChangeListener(this);
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else {
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
}
|
||||
|
||||
// Configure/hide the notifications vibrate toggle, as needed.
|
||||
@@ -878,6 +888,15 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
preference -> PrefServiceBridge.getInstance().isBlockThirdPartyCookiesManaged());
|
||||
}
|
||||
|
||||
+ private void updateCookiesSessionOnlyCheckBox() {
|
||||
+ ChromeBaseCheckBoxPreference cookiesSessionOnlyPref = (ChromeBaseCheckBoxPreference)
|
||||
+ getPreferenceScreen().findPreference(COOKIES_SESSION_ONLY_TOGGLE_KEY);
|
||||
+ cookiesSessionOnlyPref.setChecked(
|
||||
+ PrefServiceBridge.getInstance().isCookiesSessionOnlyEnabled());
|
||||
+ cookiesSessionOnlyPref.setEnabled(PrefServiceBridge.getInstance().isCategoryEnabled(
|
||||
+ ContentSettingsType.CONTENT_SETTINGS_TYPE_COOKIES));
|
||||
+ }
|
||||
+
|
||||
private void updateNotificationsVibrateCheckBox() {
|
||||
ChromeBaseCheckBoxPreference preference =
|
||||
(ChromeBaseCheckBoxPreference) getPreferenceScreen().findPreference(
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -882,6 +882,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_ALLOW_THIRD_PARTY_COOKIES_SUMMARY" desc="Summary text for Allow Third Party Cookies preference">
|
||||
Third-party websites can save and read cookie data
|
||||
</message>
|
||||
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_TITLE" desc="Title for Allow Cookies Session Only preference">
|
||||
+ Keep cookies only until you quit your browser
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_SUMMARY" desc="Summary text for Allow Session Only Cookies preference">
|
||||
+ When enabled, all cookies will be erased when the browsing session is over
|
||||
+ </message>
|
||||
<message name="IDS_JAVASCRIPT_PERMISSION_TITLE" desc="Title of the permission to run javascript [CHAR-LIMIT=32]">
|
||||
JavaScript
|
||||
</message>
|
||||
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
@@ -310,6 +310,17 @@ static jboolean JNI_PrefServiceBridge_GetBlockThirdPartyCookiesEnabled(
|
||||
return GetPrefService()->GetBoolean(prefs::kBlockThirdPartyCookies);
|
||||
}
|
||||
|
||||
+static jboolean JNI_PrefServiceBridge_GetCookiesSessionOnlyEnabled(
|
||||
+ JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj) {
|
||||
+ HostContentSettingsMap* host_content_settings_map =
|
||||
+ HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
|
||||
+ auto value = host_content_settings_map->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, nullptr);
|
||||
+ auto enabled = CONTENT_SETTING_SESSION_ONLY == value;
|
||||
+ LOG(INFO) << "GetCookiesSessionOnly := " << enabled << " (raw_value = " << value << ")";
|
||||
+ return enabled;
|
||||
+}
|
||||
+
|
||||
static jboolean JNI_PrefServiceBridge_GetBlockThirdPartyCookiesManaged(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj) {
|
||||
@@ -774,6 +785,20 @@ static void JNI_PrefServiceBridge_SetBlockThirdPartyCookiesEnabled(
|
||||
GetPrefService()->SetBoolean(prefs::kBlockThirdPartyCookies, enabled);
|
||||
}
|
||||
|
||||
+static void JNI_PrefServiceBridge_SetCookiesSessionOnlyEnabled(
|
||||
+ JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj,
|
||||
+ jboolean enabled) {
|
||||
+ HostContentSettingsMap* host_content_settings_map =
|
||||
+ HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
|
||||
+ LOG(INFO) << "SetCookiesSessionOnly -> " << (enabled ? "true" : "false") <<
|
||||
+ "; false -> setting_allow: " << CONTENT_SETTING_ALLOW <<
|
||||
+ "; true -> session_only: " << CONTENT_SETTING_SESSION_ONLY;
|
||||
+ host_content_settings_map->SetDefaultContentSetting(
|
||||
+ CONTENT_SETTINGS_TYPE_COOKIES,
|
||||
+ enabled ? CONTENT_SETTING_SESSION_ONLY : CONTENT_SETTING_ALLOW);
|
||||
+}
|
||||
+
|
||||
static void JNI_PrefServiceBridge_SetRememberPasswordsEnabled(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From: samartnik <artem@brave.com>
|
||||
Date: Thu, 14 Dec 2017 16:19:50 +0200
|
||||
Subject: Always allow partner customisation
|
||||
|
||||
---
|
||||
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
@@ -242,14 +242,14 @@ public class PartnerBrowserCustomizations {
|
||||
@Override
|
||||
protected Void doInBackground() {
|
||||
try {
|
||||
- boolean systemOrPreStable =
|
||||
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
- || !ChromeVersionInfo.isStableBuild();
|
||||
- if (!systemOrPreStable) {
|
||||
- // Only allow partner customization if this browser is a system package, or
|
||||
- // is in pre-stable channels.
|
||||
- return null;
|
||||
- }
|
||||
+ //boolean systemOrPreStable =
|
||||
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
+ // || !ChromeVersionInfo.isStableBuild();
|
||||
+ //if (!systemOrPreStable) {
|
||||
+ // // Only allow partner customization if this browser is a system package, or
|
||||
+ // // is in pre-stable channels.
|
||||
+ // return null;
|
||||
+ //}
|
||||
|
||||
if (isCancelled()) return null;
|
||||
refreshIncognitoModeDisabled();
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 11:02:38 +0200
|
||||
Subject: Change default homepage to new tab page
|
||||
|
||||
Disable any partner-provided home page.
|
||||
---
|
||||
.../chrome/browser/partnercustomizations/HomepageManager.java | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
@@ -102,8 +102,7 @@ public class HomepageManager {
|
||||
* @return Whether or not homepage setting should be shown.
|
||||
*/
|
||||
public static boolean shouldShowHomepageSetting() {
|
||||
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
|
||||
- || FeatureUtilities.isHomePageButtonForceEnabled();
|
||||
+ return FeatureUtilities.isHomePageButtonForceEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,9 +123,7 @@ public class HomepageManager {
|
||||
* if the homepage button is force enabled via flag.
|
||||
*/
|
||||
public static String getDefaultHomepageUri() {
|
||||
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
|
||||
- ? PartnerBrowserCustomizations.getHomePageUrl()
|
||||
- : UrlConstants.NTP_NON_NATIVE_URL;
|
||||
+ return UrlConstants.NTP_NON_NATIVE_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+876
@@ -0,0 +1,876 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 1 Aug 2018 09:19:40 +0200
|
||||
Subject: Add bookmark import/export actions in bookmarks activity and page
|
||||
|
||||
Thanks to Arnaud for the snippet on how to add toast notifications
|
||||
---
|
||||
.../java/res/menu/bookmark_action_bar_menu.xml | 14 ++
|
||||
.../browser/bookmarks/BookmarkActionBar.java | 12 ++
|
||||
.../chrome/browser/bookmarks/BookmarkActivity.java | 19 ++
|
||||
.../chrome/browser/bookmarks/BookmarkBridge.java | 56 ++++++
|
||||
.../chrome/browser/bookmarks/BookmarkDelegate.java | 10 +
|
||||
.../chrome/browser/bookmarks/BookmarkManager.java | 20 ++
|
||||
.../chrome/browser/bookmarks/BookmarkPage.java | 1 +
|
||||
.../java/strings/android_chrome_strings.grd | 6 +
|
||||
chrome/browser/BUILD.gn | 8 +-
|
||||
.../browser/android/bookmarks/bookmark_bridge.cc | 215 +++++++++++++++++++++
|
||||
chrome/browser/android/bookmarks/bookmark_bridge.h | 20 +-
|
||||
chrome/browser/importer/profile_writer.cc | 2 +
|
||||
chrome/common/BUILD.gn | 3 +
|
||||
chrome/utility/BUILD.gn | 7 +-
|
||||
chrome/utility/importer/bookmark_html_reader.cc | 27 ++-
|
||||
chrome/utility/importer/bookmark_html_reader.h | 9 +
|
||||
16 files changed, 419 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/bookmark_action_bar_menu.xml b/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
--- a/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
|
||||
@@ -22,6 +22,20 @@
|
||||
app:showAsAction="ifRoom"
|
||||
app:iconTint="@color/dark_mode_tint" />
|
||||
<item
|
||||
+ android:id="@+id/import_menu_id"
|
||||
+ android:icon="@drawable/add_circle_blue"
|
||||
+ android:title="@string/import_bookmarks"
|
||||
+ android:visible="true"
|
||||
+ app:showAsAction="ifRoom"
|
||||
+ app:iconTint="@color/dark_mode_tint" />
|
||||
+ <item
|
||||
+ android:id="@+id/export_menu_id"
|
||||
+ android:icon="@drawable/ic_file_download_white_24dp"
|
||||
+ android:title="@string/export_bookmarks"
|
||||
+ android:visible="true"
|
||||
+ app:showAsAction="ifRoom"
|
||||
+ app:iconTint="@color/dark_mode_tint" />
|
||||
+ <item
|
||||
android:id="@+id/close_menu_id"
|
||||
android:icon="@drawable/btn_close"
|
||||
android:title="@string/bookmark_action_bar_close"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
|
||||
@@ -89,6 +89,12 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
} else if (menuItem.getItemId() == R.id.search_menu_id) {
|
||||
mDelegate.openSearchUI();
|
||||
return true;
|
||||
+ } else if (menuItem.getItemId() == R.id.import_menu_id) {
|
||||
+ mDelegate.importBookmarks();
|
||||
+ return true;
|
||||
+ } else if (menuItem.getItemId() == R.id.export_menu_id) {
|
||||
+ mDelegate.exportBookmarks();
|
||||
+ return true;
|
||||
}
|
||||
|
||||
SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
|
||||
@@ -132,6 +138,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
void showLoadingUi() {
|
||||
setTitle(null);
|
||||
setNavigationButton(NAVIGATION_BUTTON_NONE);
|
||||
+ getMenu().findItem(R.id.import_menu_id).setVisible(false);
|
||||
+ getMenu().findItem(R.id.export_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.edit_menu_id).setVisible(false);
|
||||
}
|
||||
@@ -141,6 +149,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
super.showNormalView();
|
||||
|
||||
if (mDelegate == null) {
|
||||
+ getMenu().findItem(R.id.import_menu_id).setVisible(false);
|
||||
+ getMenu().findItem(R.id.export_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(false);
|
||||
getMenu().findItem(R.id.edit_menu_id).setVisible(false);
|
||||
}
|
||||
@@ -173,6 +183,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
|
||||
public void onFolderStateSet(BookmarkId folder) {
|
||||
mCurrentFolder = mDelegate.getModel().getBookmarkById(folder);
|
||||
|
||||
+ getMenu().findItem(R.id.import_menu_id).setVisible(true);
|
||||
+ getMenu().findItem(R.id.export_menu_id).setVisible(true);
|
||||
getMenu().findItem(R.id.search_menu_id).setVisible(true);
|
||||
getMenu().findItem(R.id.edit_menu_id).setVisible(mCurrentFolder.isEditable());
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java
|
||||
@@ -12,6 +12,7 @@ import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.chrome.browser.SnackbarActivity;
|
||||
import org.chromium.chrome.browser.UrlConstants;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
+import org.chromium.ui.base.ActivityWindowAndroid;
|
||||
|
||||
/**
|
||||
* The activity that displays the bookmark UI on the phone. It keeps a {@link BookmarkManager}
|
||||
@@ -21,6 +22,7 @@ import org.chromium.components.bookmarks.BookmarkId;
|
||||
public class BookmarkActivity extends SnackbarActivity {
|
||||
|
||||
private BookmarkManager mBookmarkManager;
|
||||
+ private ActivityWindowAndroid mWindowAndroid;
|
||||
static final int EDIT_BOOKMARK_REQUEST_CODE = 14;
|
||||
public static final String INTENT_VISIT_BOOKMARK_ID = "BookmarkEditActivity.VisitBookmarkId";
|
||||
|
||||
@@ -32,6 +34,22 @@ public class BookmarkActivity extends SnackbarActivity {
|
||||
if (TextUtils.isEmpty(url)) url = UrlConstants.BOOKMARKS_URL;
|
||||
mBookmarkManager.updateForUrl(url);
|
||||
setContentView(mBookmarkManager.getView());
|
||||
+
|
||||
+ final boolean listenToActivityState = true;
|
||||
+ mWindowAndroid = new ActivityWindowAndroid(this, listenToActivityState);
|
||||
+ mWindowAndroid.restoreInstanceState(savedInstanceState);
|
||||
+ mBookmarkManager.setWindow(mWindowAndroid);
|
||||
+ // Set up the animation placeholder to be the SurfaceView. This disables the
|
||||
+ // SurfaceView's 'hole' clipping during animations that are notified to the window.
|
||||
+// mWindowAndroid.setAnimationPlaceholderView(
|
||||
+// mBookmarkManager.getContentViewRenderView().getSurfaceView());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onSaveInstanceState(Bundle outState) {
|
||||
+ super.onSaveInstanceState(outState);
|
||||
+
|
||||
+ mWindowAndroid.saveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,6 +66,7 @@ public class BookmarkActivity extends SnackbarActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
+ mWindowAndroid.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == EDIT_BOOKMARK_REQUEST_CODE && resultCode == RESULT_OK) {
|
||||
BookmarkId bookmarkId = BookmarkId.getBookmarkIdFromString(data.getStringExtra(
|
||||
INTENT_VISIT_BOOKMARK_ID));
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
package org.chromium.chrome.browser.bookmarks;
|
||||
|
||||
+import android.content.Intent;
|
||||
+import android.content.Context;
|
||||
+import android.net.Uri;
|
||||
import android.os.SystemClock;
|
||||
+import android.provider.Browser;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Pair;
|
||||
|
||||
@@ -13,11 +17,16 @@ import org.chromium.base.ObserverList;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
+import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
||||
+import org.chromium.chrome.browser.IntentHandler;
|
||||
import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
import org.chromium.components.bookmarks.BookmarkType;
|
||||
import org.chromium.components.url_formatter.UrlFormatter;
|
||||
+import org.chromium.ui.base.PageTransition;
|
||||
+import org.chromium.ui.base.WindowAndroid;
|
||||
+import org.chromium.ui.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -508,6 +517,24 @@ public class BookmarkBridge {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Import bookmarks from a selected file.
|
||||
+ * @param window The current window of the bookmarks activity or page.
|
||||
+ */
|
||||
+ public void importBookmarks(WindowAndroid window) {
|
||||
+ assert mIsNativeBookmarkModelLoaded;
|
||||
+ nativeImportBookmarks(mNativeBookmarkBridge, window);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Export bookmarks to a path selected by the user.
|
||||
+ * @param window The current window of the bookmarks activity or page.
|
||||
+ */
|
||||
+ public void exportBookmarks() {
|
||||
+ assert mIsNativeBookmarkModelLoaded;
|
||||
+ nativeExportBookmarks(mNativeBookmarkBridge);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* Synchronously gets a list of bookmarks that match the specified search query.
|
||||
* @param query Keyword used for searching bookmarks.
|
||||
* @param maxNumberOfResult Maximum number of result to fetch.
|
||||
@@ -840,6 +867,33 @@ public class BookmarkBridge {
|
||||
depthList.add(depth);
|
||||
}
|
||||
|
||||
+
|
||||
+ @CalledByNative
|
||||
+ public void bookmarksImported() {
|
||||
+ Context context = ContextUtils.getApplicationContext();
|
||||
+
|
||||
+ //TODO: call this after actual import
|
||||
+ //Toast.makeText(ContextUtils.getApplicationContext(), "Bookmarks imported", Toast.LENGTH_LONG).show();
|
||||
+ }
|
||||
+
|
||||
+ @CalledByNative
|
||||
+ public void bookmarksExported(String bookmarksPath) {
|
||||
+ Context context = ContextUtils.getApplicationContext();
|
||||
+
|
||||
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("file://" + bookmarksPath));
|
||||
+ intent.putExtra(Browser.EXTRA_APPLICATION_ID,
|
||||
+ context.getPackageName());
|
||||
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
+ intent.putExtra(IntentHandler.EXTRA_PAGE_TRANSITION_TYPE, PageTransition.AUTO_BOOKMARK);
|
||||
+
|
||||
+ // If the bookmark manager is shown in a tab on a phone (rather than in a separate
|
||||
+ // activity) the component name may be null. Send the intent through
|
||||
+ // ChromeLauncherActivity instead to avoid crashing. See crbug.com/615012.
|
||||
+ intent.setClass(context, ChromeLauncherActivity.class);
|
||||
+
|
||||
+ IntentHandler.startActivityForTrustedIntent(intent);
|
||||
+ }
|
||||
+
|
||||
private static List<Pair<Integer, Integer>> createPairsList(int[] left, int[] right) {
|
||||
List<Pair<Integer, Integer>> pairList = new ArrayList<Pair<Integer, Integer>>();
|
||||
for (int i = 0; i < left.length; i++) {
|
||||
@@ -906,6 +960,8 @@ public class BookmarkBridge {
|
||||
boolean getFolders, boolean getBookmarks, List<BookmarkId> bookmarksList);
|
||||
private native BookmarkId nativeGetChildAt(long nativeBookmarkBridge, long id, int type,
|
||||
int index);
|
||||
+ private native void nativeImportBookmarks(long nativeBookmarkBridge, WindowAndroid window);
|
||||
+ private native void nativeExportBookmarks(long nativeBookmarkBridge);
|
||||
private native int nativeGetTotalBookmarkCount(long nativeBookmarkBridge, long id, int type);
|
||||
private native void nativeSetBookmarkTitle(long nativeBookmarkBridge, long id, int type,
|
||||
String title);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java
|
||||
@@ -69,6 +69,16 @@ interface BookmarkDelegate {
|
||||
void openSearchUI();
|
||||
|
||||
/**
|
||||
+ * Imports bookmarks from user-selected file.
|
||||
+ */
|
||||
+ void importBookmarks();
|
||||
+
|
||||
+ /**
|
||||
+ * Exports bookmarks to downloads directory.
|
||||
+ */
|
||||
+ void exportBookmarks();
|
||||
+
|
||||
+ /**
|
||||
* Dismisses the search UI.
|
||||
*/
|
||||
void closeSearchUI();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
|
||||
@@ -21,6 +21,7 @@ import org.chromium.base.metrics.RecordUserAction;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem;
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkModelObserver;
|
||||
+import org.chromium.chrome.browser.ChromeActivity;
|
||||
import org.chromium.chrome.browser.favicon.LargeIconBridge;
|
||||
import org.chromium.chrome.browser.native_page.BasicNativePage;
|
||||
import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksReader;
|
||||
@@ -31,6 +32,7 @@ import org.chromium.chrome.browser.widget.selection.SelectableListLayout;
|
||||
import org.chromium.chrome.browser.widget.selection.SelectableListToolbar.SearchDelegate;
|
||||
import org.chromium.chrome.browser.widget.selection.SelectionDelegate;
|
||||
import org.chromium.components.bookmarks.BookmarkId;
|
||||
+import org.chromium.ui.base.ActivityWindowAndroid;
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -55,6 +57,7 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
|
||||
private Activity mActivity;
|
||||
private ViewGroup mMainView;
|
||||
private BookmarkModel mBookmarkModel;
|
||||
+ private ActivityWindowAndroid mWindowAndroid;
|
||||
private BookmarkUndoController mUndoController;
|
||||
private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
|
||||
private BasicNativePage mNativePage;
|
||||
@@ -267,6 +270,13 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Sets the Android window that is used by further intents created by the bookmark activity.
|
||||
+ */
|
||||
+ public void setWindow(ActivityWindowAndroid window) {
|
||||
+ mWindowAndroid = window;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* @return Current URL representing the UI state of bookmark manager. If no state has been shown
|
||||
* yet in this session, on phone return last used state stored in preference; on tablet
|
||||
* return the url previously set by {@link #updateForUrl(String)}.
|
||||
@@ -414,6 +424,16 @@ public class BookmarkManager implements BookmarkDelegate, SearchDelegate,
|
||||
}
|
||||
|
||||
@Override
|
||||
+ public void importBookmarks() {
|
||||
+ mBookmarkModel.importBookmarks(mWindowAndroid);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void exportBookmarks() {
|
||||
+ mBookmarkModel.exportBookmarks();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
public void openSearchUI() {
|
||||
setState(BookmarkUIState.createSearchState());
|
||||
mSelectableListLayout.onStartSearch();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java
|
||||
@@ -35,6 +35,7 @@ public class BookmarkPage extends BasicNativePage {
|
||||
mManager = new BookmarkManager(
|
||||
activity, false, ((SnackbarManageable) activity).getSnackbarManager());
|
||||
mManager.setBasicNativePage(this);
|
||||
+ mManager.setWindow(activity.getWindowAndroid());
|
||||
mTitle = activity.getString(R.string.bookmarks);
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -224,6 +224,12 @@ CHAR-LIMIT guidelines:
|
||||
<message name="IDS_SEARCH" desc="The label for a search button.">
|
||||
Search
|
||||
</message>
|
||||
+ <message name="IDS_IMPORT_BOOKMARKS" desc="The label for the import bookmarks button.">
|
||||
+ Import
|
||||
+ </message>
|
||||
+ <message name="IDS_EXPORT_BOOKMARKS" desc="The label for an export bookmarks button.">
|
||||
+ Export
|
||||
+ </message>
|
||||
<message name="IDS_SHOW_INFO" desc="The label for a info button to show info.">
|
||||
Show Info
|
||||
</message>
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -149,6 +149,10 @@ jumbo_split_static_library("browser") {
|
||||
"bitmap_fetcher/bitmap_fetcher_service.h",
|
||||
"bitmap_fetcher/bitmap_fetcher_service_factory.cc",
|
||||
"bitmap_fetcher/bitmap_fetcher_service_factory.h",
|
||||
+ "importer/profile_writer.cc",
|
||||
+ "importer/profile_writer.h",
|
||||
+ "bookmarks/bookmark_html_writer.cc",
|
||||
+ "bookmarks/bookmark_html_writer.h",
|
||||
"bookmarks/bookmark_model_factory.cc",
|
||||
"bookmarks/bookmark_model_factory.h",
|
||||
"bookmarks/bookmark_stats.cc",
|
||||
@@ -2586,8 +2590,6 @@ jumbo_split_static_library("browser") {
|
||||
"banners/app_banner_infobar_delegate_desktop.h",
|
||||
"banners/app_banner_manager_desktop.cc",
|
||||
"banners/app_banner_manager_desktop.h",
|
||||
- "bookmarks/bookmark_html_writer.cc",
|
||||
- "bookmarks/bookmark_html_writer.h",
|
||||
"certificate_viewer.h",
|
||||
"chrome_browser_field_trials_desktop.cc",
|
||||
"chrome_browser_field_trials_desktop.h",
|
||||
@@ -2678,8 +2680,6 @@ jumbo_split_static_library("browser") {
|
||||
"importer/importer_uma.h",
|
||||
"importer/in_process_importer_bridge.cc",
|
||||
"importer/in_process_importer_bridge.h",
|
||||
- "importer/profile_writer.cc",
|
||||
- "importer/profile_writer.h",
|
||||
"lifetime/browser_close_manager.cc",
|
||||
"lifetime/browser_close_manager.h",
|
||||
"lifetime/termination_notification.cc",
|
||||
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
|
||||
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
|
||||
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
|
||||
@@ -9,18 +9,29 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
+#include "base/android/content_uri_utils.h"
|
||||
#include "base/android/jni_array.h"
|
||||
#include "base/android/jni_string.h"
|
||||
+#include "base/android/path_utils.h"
|
||||
#include "base/containers/stack.h"
|
||||
#include "base/containers/stack_container.h"
|
||||
#include "base/i18n/string_compare.h"
|
||||
+#include "base/strings/utf_string_conversions.h"
|
||||
+#include "chrome/utility/importer/bookmark_html_reader.h"
|
||||
+#include "chrome/browser/bookmarks/bookmark_html_writer.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
||||
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
|
||||
+#include "chrome/browser/importer/profile_writer.h"
|
||||
+#include "chrome/browser/platform_util.h"
|
||||
+#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
#include "chrome/browser/profiles/incognito_helpers.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/profiles/profile_android.h"
|
||||
#include "chrome/browser/signin/signin_manager_factory.h"
|
||||
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
|
||||
+#include "chrome/common/importer/imported_bookmark_entry.h"
|
||||
+#include "chrome/common/importer/importer_data_types.h"
|
||||
+#include "chrome/common/url_constants.h"
|
||||
#include "components/bookmarks/browser/bookmark_model.h"
|
||||
#include "components/bookmarks/browser/bookmark_utils.h"
|
||||
#include "components/bookmarks/browser/scoped_group_bookmark_actions.h"
|
||||
@@ -30,11 +41,14 @@
|
||||
#include "components/bookmarks/managed/managed_bookmark_service.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/query_parser/query_parser.h"
|
||||
+#include "components/search_engines/template_url.h"
|
||||
#include "components/signin/core/browser/signin_manager.h"
|
||||
#include "components/undo/bookmark_undo_service.h"
|
||||
#include "components/undo/undo_manager.h"
|
||||
+#include "components/url_formatter/url_fixer.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "jni/BookmarkBridge_jni.h"
|
||||
+#include "ui/android/window_android.h"
|
||||
|
||||
using base::android::AttachCurrentThread;
|
||||
using base::android::ConvertUTF8ToJavaString;
|
||||
@@ -53,6 +67,57 @@ using bookmarks::BookmarkPermanentNode;
|
||||
using bookmarks::BookmarkType;
|
||||
using content::BrowserThread;
|
||||
|
||||
+namespace internal {
|
||||
+
|
||||
+// Returns true if |url| has a valid scheme that we allow to import. We
|
||||
+// filter out the URL with a unsupported scheme.
|
||||
+bool CanImportURL(const GURL& url) {
|
||||
+ // The URL is not valid.
|
||||
+ if (!url.is_valid())
|
||||
+ return false;
|
||||
+
|
||||
+ // Filter out the URLs with unsupported schemes.
|
||||
+ const char* const kInvalidSchemes[] = {"wyciwyg", "place"};
|
||||
+ for (size_t i = 0; i < arraysize(kInvalidSchemes); ++i) {
|
||||
+ if (url.SchemeIs(kInvalidSchemes[i]))
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Check if |url| is about:blank.
|
||||
+ if (url == url::kAboutBlankURL)
|
||||
+ return true;
|
||||
+
|
||||
+ // If |url| starts with chrome:// or about:, check if it's one of the URLs
|
||||
+ // that we support.
|
||||
+ if (url.SchemeIs(content::kChromeUIScheme) ||
|
||||
+ url.SchemeIs(url::kAboutScheme)) {
|
||||
+ if (url.host_piece() == chrome::kChromeUIUberHost ||
|
||||
+ url.host_piece() == chrome::kChromeUIAboutHost)
|
||||
+ return true;
|
||||
+
|
||||
+ GURL fixed_url(url_formatter::FixupURL(url.spec(), std::string()));
|
||||
+ for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) {
|
||||
+ if (fixed_url.DomainIs(chrome::kChromeHostURLs[i]))
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ for (size_t i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) {
|
||||
+ if (fixed_url == chrome::kChromeDebugURLs[i])
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ // If url has either chrome:// or about: schemes but wasn't found in the
|
||||
+ // above lists, it means we don't support it, so we don't allow the user
|
||||
+ // to import it.
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Otherwise, we assume the url has a valid (importable) scheme.
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+} // internal
|
||||
+
|
||||
namespace {
|
||||
|
||||
class BookmarkTitleComparer {
|
||||
@@ -129,6 +194,10 @@ BookmarkBridge::~BookmarkBridge() {
|
||||
bookmark_model_->RemoveObserver(this);
|
||||
if (partner_bookmarks_shim_)
|
||||
partner_bookmarks_shim_->RemoveObserver(this);
|
||||
+ // There may be pending file dialogs, we need to tell them that we've gone
|
||||
+ // away so they don't try and call back to us.
|
||||
+ if (select_file_dialog_)
|
||||
+ select_file_dialog_->ListenerDestroyed();
|
||||
}
|
||||
|
||||
void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
|
||||
@@ -470,6 +539,152 @@ jint BookmarkBridge::GetTotalBookmarkCount(
|
||||
return count;
|
||||
}
|
||||
|
||||
+void BookmarkBridge::ImportBookmarks(JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj,
|
||||
+ const JavaParamRef<jobject>& java_window) {
|
||||
+ DCHECK(IsLoaded());
|
||||
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
+
|
||||
+ ui::WindowAndroid* window =
|
||||
+ ui::WindowAndroid::FromJavaWindowAndroid(java_window);
|
||||
+ CHECK(window);
|
||||
+
|
||||
+ select_file_dialog_ = ui::SelectFileDialog::Create(
|
||||
+ this, std::make_unique<ChromeSelectFilePolicy>(nullptr));
|
||||
+
|
||||
+ //NOTE: extension and description are not used on Android
|
||||
+ ui::SelectFileDialog::FileTypeInfo file_type_info;
|
||||
+ file_type_info.extensions.resize(1);
|
||||
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html"));
|
||||
+ file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("htm"));
|
||||
+ file_type_info.extension_description_overrides.push_back(base::ASCIIToUTF16("Netscape Bookmark"));
|
||||
+ file_type_info.allowed_paths =
|
||||
+ ui::SelectFileDialog::FileTypeInfo::NATIVE_OR_DRIVE_PATH;
|
||||
+
|
||||
+ select_file_dialog_->SelectFile(
|
||||
+ ui::SelectFileDialog::SELECT_OPEN_FILE,
|
||||
+ base::string16(),
|
||||
+ import_path_,
|
||||
+ &file_type_info,
|
||||
+ 0,
|
||||
+ base::FilePath::StringType(),
|
||||
+ window,
|
||||
+ NULL);
|
||||
+
|
||||
+ //NOTE: this should be called after the actual import
|
||||
+ Java_BookmarkBridge_bookmarksImported(env, obj);
|
||||
+}
|
||||
+
|
||||
+void BookmarkBridge::ExportBookmarks(JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj) {
|
||||
+ DCHECK(IsLoaded());
|
||||
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
+
|
||||
+ if (import_path_.empty()) {
|
||||
+ if (!base::android::GetDownloadsDirectory(&import_path_)) {
|
||||
+ LOG(ERROR) << "Could not retrieve downloads directory for bookmarks export";
|
||||
+ return;
|
||||
+ }
|
||||
+ import_path_ = import_path_.Append(FILE_PATH_LITERAL("bookmarks.html"));
|
||||
+ }
|
||||
+
|
||||
+ bookmark_html_writer::WriteBookmarks(profile_, import_path_, NULL);
|
||||
+
|
||||
+ //NOTE: nothing will be written if write permission has not been granted before
|
||||
+ LOG(INFO) << "Bookmarks exported successfully in " << import_path_;
|
||||
+
|
||||
+ Java_BookmarkBridge_bookmarksExported(env, obj, ConvertUTF8ToJavaString(env, import_path_.MaybeAsASCII()));
|
||||
+}
|
||||
+
|
||||
+// Attempts to create a TemplateURL from the provided data. |title| is optional.
|
||||
+// If TemplateURL creation fails, returns null.
|
||||
+std::unique_ptr<TemplateURL> CreateTemplateURL(const base::string16& url,
|
||||
+ const base::string16& keyword,
|
||||
+ const base::string16& title) {
|
||||
+ if (url.empty() || keyword.empty())
|
||||
+ return nullptr;
|
||||
+ TemplateURLData data;
|
||||
+ data.SetKeyword(keyword);
|
||||
+ // We set short name by using the title if it exists.
|
||||
+ // Otherwise, we use the shortcut.
|
||||
+ data.SetShortName(title.empty() ? keyword : title);
|
||||
+ data.SetURL(TemplateURLRef::DisplayURLToURLRef(url));
|
||||
+ return std::make_unique<TemplateURL>(data);
|
||||
+}
|
||||
+
|
||||
+void BookmarkBridge::FileSelected(const base::FilePath& path, int index,
|
||||
+ void* params) {
|
||||
+ base::File file;
|
||||
+ if (path.IsContentUri()) {
|
||||
+ file = base::OpenContentUriForRead(path);
|
||||
+ } else {
|
||||
+ file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
||||
+ }
|
||||
+ if (!file.IsValid()) {
|
||||
+ LOG(ERROR) << "Cannot open bookmarks file for import";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto fileLength = file.GetLength();
|
||||
+ if (-1 == fileLength) {
|
||||
+ LOG(ERROR) << "Cannot read bookmarks file length";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (fileLength > 10 * 1024 * 1024) {
|
||||
+ LOG(ERROR) << "Bookmarks file is too big";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::vector<char> buffer(fileLength);
|
||||
+ if (-1 == file.ReadAtCurrentPos(buffer.data(), fileLength)) {
|
||||
+ LOG(ERROR) << "Could not read bookmarks file";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (buffer.empty()) {
|
||||
+ LOG(ERROR) << "Empty bookmarks file";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::string contents(buffer.begin(), buffer.end());
|
||||
+
|
||||
+ // the following import logic comes from BookmarksFileImporter class
|
||||
+ std::vector<ImportedBookmarkEntry> bookmarks;
|
||||
+ std::vector<importer::SearchEngineInfo> search_engines;
|
||||
+
|
||||
+ bookmark_html_reader::ImportBookmarksFile(
|
||||
+ base::Callback<bool(void)>(),
|
||||
+ base::Bind(internal::CanImportURL),
|
||||
+ contents,
|
||||
+ &bookmarks,
|
||||
+ &search_engines,
|
||||
+ nullptr);
|
||||
+
|
||||
+ // writing to profile will begin extensive changes and use the same bookmarks model for persisting changes
|
||||
+ auto *writer = new ProfileWriter(profile_);
|
||||
+
|
||||
+ if (!bookmarks.empty()) {
|
||||
+ writer->AddBookmarks(bookmarks, base::ASCIIToUTF16("Imported"));
|
||||
+ }
|
||||
+ if (!search_engines.empty()) {
|
||||
+ TemplateURLService::OwnedTemplateURLVector owned_template_urls;
|
||||
+ for (const auto& search_engine : search_engines) {
|
||||
+ std::unique_ptr<TemplateURL> owned_template_url = CreateTemplateURL(
|
||||
+ search_engine.url, search_engine.keyword, search_engine.display_name);
|
||||
+ if (owned_template_url)
|
||||
+ owned_template_urls.push_back(std::move(owned_template_url));
|
||||
+ }
|
||||
+ writer->AddKeywords(std::move(owned_template_urls), false);
|
||||
+ }
|
||||
+
|
||||
+ LOG(INFO) << "Imported " << bookmarks.size() << " bookmarks and " <<
|
||||
+ search_engines.size() << " search engines from " << import_path_;
|
||||
+}
|
||||
+
|
||||
+void BookmarkBridge::FileSelectionCanceled(void* params) {
|
||||
+}
|
||||
+
|
||||
void BookmarkBridge::SetBookmarkTitle(JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
jlong id,
|
||||
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser/android/bookmarks/bookmark_bridge.h
|
||||
--- a/chrome/browser/android/bookmarks/bookmark_bridge.h
|
||||
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "components/bookmarks/browser/base_bookmark_model_observer.h"
|
||||
#include "components/bookmarks/common/android/bookmark_id.h"
|
||||
#include "components/prefs/pref_change_registrar.h"
|
||||
+#include "components/search_engines/template_url.h"
|
||||
+#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
|
||||
namespace bookmarks {
|
||||
class BookmarkModel;
|
||||
@@ -26,7 +28,8 @@ class Profile;
|
||||
// bookmark page. This fetches the bookmarks, title, urls, folder
|
||||
// hierarchy.
|
||||
class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
|
||||
- public PartnerBookmarksShim::Observer {
|
||||
+ public PartnerBookmarksShim::Observer,
|
||||
+ public ui::SelectFileDialog::Listener {
|
||||
public:
|
||||
BookmarkBridge(JNIEnv* env,
|
||||
const base::android::JavaRef<jobject>& obj,
|
||||
@@ -36,6 +39,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
|
||||
bool IsDoingExtensiveChanges(JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& obj);
|
||||
|
||||
+ // SelectFileDialog::Listener implementation.
|
||||
+ void FileSelected(const base::FilePath& path,
|
||||
+ int index,
|
||||
+ void* params) override;
|
||||
+ void FileSelectionCanceled(void* params) override;
|
||||
+
|
||||
jboolean IsEditBookmarksEnabled(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& obj);
|
||||
@@ -116,6 +125,13 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
|
||||
jlong id,
|
||||
jint type);
|
||||
|
||||
+ void ImportBookmarks(JNIEnv* env,
|
||||
+ const base::android::JavaParamRef<jobject>& obj,
|
||||
+ const base::android::JavaParamRef<jobject>& java_window);
|
||||
+
|
||||
+ void ExportBookmarks(JNIEnv* env,
|
||||
+ const base::android::JavaParamRef<jobject>& obj);
|
||||
+
|
||||
void SetBookmarkTitle(JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& obj,
|
||||
jlong id,
|
||||
@@ -261,12 +277,14 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
|
||||
void ShimBeingDeleted(PartnerBookmarksShim* shim) override;
|
||||
|
||||
Profile* profile_;
|
||||
+ base::FilePath import_path_;
|
||||
JavaObjectWeakGlobalRef weak_java_ref_;
|
||||
bookmarks::BookmarkModel* bookmark_model_; // weak
|
||||
bookmarks::ManagedBookmarkService* managed_bookmark_service_; // weak
|
||||
std::unique_ptr<bookmarks::ScopedGroupBookmarkActions>
|
||||
grouped_bookmark_actions_;
|
||||
PrefChangeRegistrar pref_change_registrar_;
|
||||
+ scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
||||
|
||||
// Information about the Partner bookmarks (must check for IsLoaded()).
|
||||
// This is owned by profile.
|
||||
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
|
||||
--- a/chrome/browser/importer/profile_writer.cc
|
||||
+++ b/chrome/browser/importer/profile_writer.cc
|
||||
@@ -97,12 +97,14 @@ void ProfileWriter::AddHistoryPage(const history::URLRows& page,
|
||||
HistoryServiceFactory::GetForProfile(profile_,
|
||||
ServiceAccessType::EXPLICIT_ACCESS)
|
||||
->AddPagesWithDetails(page, visit_source);
|
||||
+#if !defined(OS_ANDROID)
|
||||
// Measure the size of the history page after Auto Import on first run.
|
||||
if (first_run::IsChromeFirstRun() &&
|
||||
visit_source == history::SOURCE_IE_IMPORTED) {
|
||||
UMA_HISTOGRAM_COUNTS_1M("Import.ImportedHistorySize.AutoImportFromIE",
|
||||
page.size());
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ProfileWriter::AddHomepage(const GURL& home_page) {
|
||||
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
|
||||
--- a/chrome/common/BUILD.gn
|
||||
+++ b/chrome/common/BUILD.gn
|
||||
@@ -442,6 +442,9 @@ static_library("common") {
|
||||
sources += [
|
||||
"media/chrome_media_drm_bridge_client.cc",
|
||||
"media/chrome_media_drm_bridge_client.h",
|
||||
+ ## Bromite dependencies for bookmark import functionality
|
||||
+ "importer/imported_bookmark_entry.cc",
|
||||
+ "importer/imported_bookmark_entry.h",
|
||||
]
|
||||
} else {
|
||||
# Non-Android.
|
||||
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
|
||||
--- a/chrome/utility/BUILD.gn
|
||||
+++ b/chrome/utility/BUILD.gn
|
||||
@@ -58,8 +58,6 @@ static_library("utility") {
|
||||
|
||||
if (!is_android) {
|
||||
sources += [
|
||||
- "importer/bookmark_html_reader.cc",
|
||||
- "importer/bookmark_html_reader.h",
|
||||
"importer/bookmarks_file_importer.cc",
|
||||
"importer/bookmarks_file_importer.h",
|
||||
"importer/edge_database_reader_win.cc",
|
||||
@@ -162,6 +160,11 @@ static_library("utility") {
|
||||
]
|
||||
}
|
||||
|
||||
+ sources += [
|
||||
+ "importer/bookmark_html_reader.cc",
|
||||
+ "importer/bookmark_html_reader.h",
|
||||
+ ]
|
||||
+
|
||||
if (use_nss_certs) {
|
||||
sources += [
|
||||
"importer/nss_decryptor_system_nss.cc",
|
||||
diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc
|
||||
--- a/chrome/utility/importer/bookmark_html_reader.cc
|
||||
+++ b/chrome/utility/importer/bookmark_html_reader.cc
|
||||
@@ -17,7 +17,9 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "chrome/common/importer/imported_bookmark_entry.h"
|
||||
+#if !defined(OS_ANDROID)
|
||||
#include "chrome/utility/importer/favicon_reencode.h"
|
||||
+#endif
|
||||
#include "components/search_engines/search_terms_data.h"
|
||||
#include "components/search_engines/template_url.h"
|
||||
#include "net/base/data_url.h"
|
||||
@@ -56,6 +58,7 @@ bool GetAttribute(const std::string& attribute_list,
|
||||
return true;
|
||||
}
|
||||
|
||||
+#if !defined(OS_ANDROID)
|
||||
// Given the URL of a page and a favicon data URL, adds an appropriate record
|
||||
// to the given favicon usage vector.
|
||||
void DataURLToFaviconUsage(const GURL& link_url,
|
||||
@@ -86,6 +89,7 @@ void DataURLToFaviconUsage(const GURL& link_url,
|
||||
|
||||
favicons->push_back(usage);
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -108,12 +112,10 @@ static std::string stripDt(const std::string& lineDt) {
|
||||
void ImportBookmarksFile(
|
||||
const base::Callback<bool(void)>& cancellation_callback,
|
||||
const base::Callback<bool(const GURL&)>& valid_url_callback,
|
||||
- const base::FilePath& file_path,
|
||||
+ const std::string& content,
|
||||
std::vector<ImportedBookmarkEntry>* bookmarks,
|
||||
std::vector<importer::SearchEngineInfo>* search_engines,
|
||||
favicon_base::FaviconUsageDataList* favicons) {
|
||||
- std::string content;
|
||||
- base::ReadFileToString(file_path, &content);
|
||||
std::vector<std::string> lines = base::SplitString(
|
||||
content, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
||||
|
||||
@@ -126,6 +128,7 @@ void ImportBookmarksFile(
|
||||
std::vector<base::string16> path;
|
||||
size_t toolbar_folder_index = 0;
|
||||
std::string charset = "UTF-8"; // If no charset is specified, assume utf-8.
|
||||
+
|
||||
for (size_t i = 0;
|
||||
i < lines.size() &&
|
||||
(cancellation_callback.is_null() || !cancellation_callback.Run());
|
||||
@@ -218,10 +221,12 @@ void ImportBookmarksFile(
|
||||
}
|
||||
bookmarks->push_back(entry);
|
||||
|
||||
+#if !defined(OS_ANDROID)
|
||||
// Save the favicon. DataURLToFaviconUsage will handle the case where
|
||||
// there is no favicon.
|
||||
if (favicons)
|
||||
DataURLToFaviconUsage(url, favicon, favicons);
|
||||
+#endif
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -278,6 +283,22 @@ void ImportBookmarksFile(
|
||||
}
|
||||
}
|
||||
|
||||
+void ImportBookmarksFile(
|
||||
+ const base::Callback<bool(void)>& cancellation_callback,
|
||||
+ const base::Callback<bool(const GURL&)>& valid_url_callback,
|
||||
+ const base::FilePath& file_path,
|
||||
+ std::vector<ImportedBookmarkEntry>* bookmarks,
|
||||
+ std::vector<importer::SearchEngineInfo>* search_engines,
|
||||
+ favicon_base::FaviconUsageDataList* favicons) {
|
||||
+ std::string content;
|
||||
+ if (!base::ReadFileToString(file_path, &content)) {
|
||||
+ LOG(ERROR) << "Could not directly read bookmarks import file";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ImportBookmarksFile(cancellation_callback, valid_url_callback, content, bookmarks, search_engines, favicons);
|
||||
+}
|
||||
+
|
||||
bool CanImportURLAsSearchEngine(const GURL& url,
|
||||
std::string* search_engine_url) {
|
||||
std::string url_spec = url.possibly_invalid_spec();
|
||||
diff --git a/chrome/utility/importer/bookmark_html_reader.h b/chrome/utility/importer/bookmark_html_reader.h
|
||||
--- a/chrome/utility/importer/bookmark_html_reader.h
|
||||
+++ b/chrome/utility/importer/bookmark_html_reader.h
|
||||
@@ -51,6 +51,15 @@ void ImportBookmarksFile(
|
||||
std::vector<importer::SearchEngineInfo>* search_engines,
|
||||
favicon_base::FaviconUsageDataList* favicons);
|
||||
|
||||
+void ImportBookmarksFile(
|
||||
+ const base::Callback<bool(void)>& cancellation_callback,
|
||||
+ const base::Callback<bool(const GURL&)>& valid_url_callback,
|
||||
+ const std::string& content,
|
||||
+ std::vector<ImportedBookmarkEntry>* bookmarks,
|
||||
+ std::vector<importer::SearchEngineInfo>* search_engines,
|
||||
+ favicon_base::FaviconUsageDataList* favicons);
|
||||
+
|
||||
+
|
||||
// Returns true if |url| should be imported as a search engine, i.e. because it
|
||||
// has replacement terms. Chrome treats such bookmarks as search engines rather
|
||||
// than true bookmarks.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
From: samartnik <artem@brave.com>
|
||||
Date: Tue, 17 Apr 2018 17:14:00 +0300
|
||||
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 +++++
|
||||
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 +++-
|
||||
.../browser/preferences/privacy/PrivacyPreferences.java | 14 ++++++++++++++
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 6 ++++++
|
||||
5 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
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,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
|
||||
@@ -18,6 +18,11 @@
|
||||
android:summary="@string/search_suggestions_summary"
|
||||
android:defaultValue="true" />
|
||||
<org.chromium.chrome.browser.preferences.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" />
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="safe_browsing_extended_reporting"
|
||||
android:title="@string/safe_browsing_extended_reporting_title"
|
||||
android:summary="@string/safe_browsing_extended_reporting_summary" />
|
||||
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
|
||||
@@ -1030,8 +1030,10 @@ public class ChromeTabbedActivity
|
||||
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/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package org.chromium.chrome.browser.preferences.privacy;
|
||||
|
||||
+import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
@@ -15,6 +16,7 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
@@ -47,6 +49,7 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
|
||||
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
|
||||
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
|
||||
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
|
||||
private static final String PREF_DO_NOT_TRACK = "do_not_track";
|
||||
private static final String PREF_USAGE_AND_CRASH_REPORTING = "usage_and_crash_reports";
|
||||
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
|
||||
@@ -146,6 +149,11 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
safeBrowsingPref.setOnPreferenceChangeListener(this);
|
||||
safeBrowsingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
|
||||
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
|
||||
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
|
||||
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
updateSummaries();
|
||||
}
|
||||
|
||||
@@ -172,6 +180,12 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setBoolean(
|
||||
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
|
||||
+ } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
|
||||
+// PrefServiceBridge.getInstance().setBoolean(
|
||||
+// Pref.CLOSE_TABS_ON_EXIT_ENABLED, (boolean) newValue);
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
}
|
||||
|
||||
return true;
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -3765,6 +3765,12 @@ However, you aren’t invisible. Going private doesn’t hide your browsing from
|
||||
<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.11.0
|
||||
|
||||
@@ -0,0 +1,315 @@
|
||||
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.
|
||||
---
|
||||
.../android/java/res/xml/privacy_preferences.xml | 5 ++
|
||||
.../browser/AlwaysIncognitoLinkInterceptor.java | 72 ++++++++++++++++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 4 ++
|
||||
.../chrome/browser/appmenu/AppMenuHandler.java | 12 ++++
|
||||
.../contextmenu/ChromeContextMenuPopulator.java | 9 ++-
|
||||
.../chrome/browser/tabmodel/ChromeTabCreator.java | 24 +++++++-
|
||||
.../java/strings/android_chrome_strings.grd | 6 ++
|
||||
chrome/android/java_sources.gni | 1 +
|
||||
8 files changed, 131 insertions(+), 2 deletions(-)
|
||||
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.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
|
||||
@@ -23,6 +23,11 @@
|
||||
android:summary="@string/close_tabs_on_exit_summary"
|
||||
android:defaultValue="false" />
|
||||
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ android:key="always_incognito"
|
||||
+ android:title="@string/always_incognito_title"
|
||||
+ android:summary="@string/always_incognito_summary"
|
||||
+ android:defaultValue="false" />
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="safe_browsing_extended_reporting"
|
||||
android:title="@string/safe_browsing_extended_reporting_title"
|
||||
android:summary="@string/safe_browsing_extended_reporting_summary" />
|
||||
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,72 @@
|
||||
+/* 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.tabmodel.TabCreatorManager;
|
||||
+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 {
|
||||
+
|
||||
+ private 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;
|
||||
+ }
|
||||
+
|
||||
+ tab.getActivity().getTabCreator(true).createNewTab(new LoadUrlParams(url), TabModel.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
|
||||
@@ -249,6 +249,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
||||
|
||||
// Observes when sync becomes ready to create the mContextReporter.
|
||||
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
|
||||
private ProfileSyncService.SyncStateChangedListener mSyncStateChangedListener;
|
||||
|
||||
private ChromeFullscreenManager mFullscreenManager;
|
||||
@@ -1707,6 +1708,9 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
throw new IllegalStateException(
|
||||
"Attempting to access TabCreator before initialization");
|
||||
}
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(PREF_ALWAYS_INCOGNITO, false)) {
|
||||
+ return mIncognitoTabCreator;
|
||||
+ }
|
||||
return incognito ? mIncognitoTabCreator : mRegularTabCreator;
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandler.java
|
||||
@@ -17,6 +17,7 @@ import android.view.View;
|
||||
import android.widget.PopupMenu;
|
||||
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.chrome.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,6 +27,9 @@ import java.util.ArrayList;
|
||||
* AppMenuObservers about these actions.
|
||||
*/
|
||||
public class AppMenuHandler {
|
||||
+
|
||||
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
|
||||
+
|
||||
private AppMenu mAppMenu;
|
||||
private AppMenuDragHelper mAppMenuDragHelper;
|
||||
private Menu mMenu;
|
||||
@@ -167,6 +171,14 @@ public class AppMenuHandler {
|
||||
if (mDelegate.shouldShowHeader(appRect.height())) {
|
||||
headerResourceId = mDelegate.getHeaderResourceId();
|
||||
}
|
||||
+
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(PREF_ALWAYS_INCOGNITO, false)) {
|
||||
+ final MenuItem newTabOption = mAppMenu.getMenu().findItem(R.id.new_tab_menu_id);
|
||||
+ if (newTabOption != null) {
|
||||
+ newTabOption.setVisible(false);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
mAppMenu.show(wrapper, anchorView, isByPermanentButton, rotation, appRect, pt.y,
|
||||
footerResourceId, headerResourceId, mHighlightMenuId, showFromBottom);
|
||||
mAppMenuDragHelper.onShow(startDragging);
|
||||
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
|
||||
@@ -14,6 +14,7 @@ import android.webkit.MimeTypeMap;
|
||||
|
||||
import org.chromium.base.library_loader.LibraryProcessType;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item;
|
||||
@@ -43,6 +44,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
||||
private static final String TAG = "CCMenuPopulator";
|
||||
private final ContextMenuItemDelegate mDelegate;
|
||||
private final @ContextMenuMode int mMode;
|
||||
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
|
||||
|
||||
/**
|
||||
* Defines the Groups of each Context Menu Item
|
||||
@@ -246,7 +248,12 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
||||
if (FirstRunStatus.getFirstRunFlowComplete() && mMode == ContextMenuMode.NORMAL
|
||||
&& !isEmptyUrl(params.getUrl())
|
||||
&& UrlUtilities.isAcceptedScheme(params.getUrl())) {
|
||||
- linkTab.add(new ChromeContextMenuItem(Item.OPEN_IN_NEW_TAB));
|
||||
+ if (ContextUtils.getAppSharedPreferences().getBoolean(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/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
|
||||
@@ -7,8 +7,10 @@ package org.chromium.chrome.browser.tabmodel;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.SysUtils;
|
||||
import org.chromium.base.TraceEvent;
|
||||
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
|
||||
import org.chromium.chrome.browser.ChromeActivity;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.IntentHandler;
|
||||
@@ -19,6 +21,7 @@ import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager;
|
||||
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabDelegateFactory;
|
||||
+import org.chromium.chrome.browser.tab.TabObserver;
|
||||
import org.chromium.chrome.browser.tab.TabRedirectHandler;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType;
|
||||
@@ -37,6 +40,7 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
|
||||
private final ChromeActivity mActivity;
|
||||
private final boolean mIncognito;
|
||||
+ private final TabObserver mExtraLogic;
|
||||
|
||||
private WindowAndroid mNativeWindow;
|
||||
private TabModel mTabModel;
|
||||
@@ -48,6 +52,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
mActivity = activity;
|
||||
mNativeWindow = nativeWindow;
|
||||
mIncognito = incognito;
|
||||
+ if (!mIncognito) {
|
||||
+ mExtraLogic = new AlwaysIncognitoLinkInterceptor(ContextUtils.getAppSharedPreferences());
|
||||
+ } else {
|
||||
+ mExtraLogic = null;
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,6 +169,10 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
tab.getWebContents());
|
||||
}
|
||||
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return tab;
|
||||
} finally {
|
||||
@@ -200,6 +213,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
Tab tab = Tab.createLiveTab(
|
||||
Tab.INVALID_TAB_ID, mIncognito, mNativeWindow, type, parentId, !openInForeground);
|
||||
tab.initialize(webContents, mTabContentManager, delegateFactory, !openInForeground, false);
|
||||
+
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return true;
|
||||
}
|
||||
@@ -243,7 +261,6 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
*/
|
||||
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 an external app sends an intent for a Weblite URL and the Data Reduction Proxy is
|
||||
@@ -303,6 +320,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
tab.initialize(
|
||||
null, mTabContentManager, createDefaultTabDelegateFactory(), !selectTab, false);
|
||||
assert state.isIncognito() == mIncognito;
|
||||
+
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, index, TabLaunchType.FROM_RESTORE);
|
||||
return tab;
|
||||
}
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -691,6 +691,12 @@ CHAR-LIMIT guidelines:
|
||||
<message name="IDS_SAFE_BROWSING_SCOUT_REPORTING_SUMMARY" desc="Body text for Chrome setting under 'Help Improve Safe Browsing'. This feature sends small amounts of data to Google about potentially-dangerous pages to help Safe Browsing improve Chrome's protection against malware and phishing.">
|
||||
Sends some system information and page content to Google
|
||||
</message>
|
||||
+ <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_SAFE_BROWSING_TITLE" desc="Title for safe browsing.">
|
||||
Safe Browsing
|
||||
</message>
|
||||
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
|
||||
--- a/chrome/android/java_sources.gni
|
||||
+++ b/chrome/android/java_sources.gni
|
||||
@@ -8,6 +8,7 @@ import("//device/vr/buildflags/buildflags.gni")
|
||||
import("//chrome/android/feed/feed_java_sources.gni")
|
||||
|
||||
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/ActivityTabTaskDescriptionHelper.java",
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 18:16:34 +0200
|
||||
Subject: Disable fetching of all field trials
|
||||
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/ChromeFeatureList.java | 12 +++---------
|
||||
components/variations/service/variations_service.cc | 12 +-----------
|
||||
2 files changed, 4 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
@@ -103,9 +103,7 @@ public abstract class ChromeFeatureList {
|
||||
*/
|
||||
public static int getFieldTrialParamByFeatureAsInt(
|
||||
String featureName, String paramName, int defaultValue) {
|
||||
- if (sTestFeatures != null) return defaultValue;
|
||||
- assert isInitialized();
|
||||
- return nativeGetFieldTrialParamByFeatureAsInt(featureName, paramName, defaultValue);
|
||||
+ return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,9 +120,7 @@ public abstract class ChromeFeatureList {
|
||||
*/
|
||||
public static double getFieldTrialParamByFeatureAsDouble(
|
||||
String featureName, String paramName, double defaultValue) {
|
||||
- if (sTestFeatures != null) return defaultValue;
|
||||
- assert isInitialized();
|
||||
- return nativeGetFieldTrialParamByFeatureAsDouble(featureName, paramName, defaultValue);
|
||||
+ return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,9 +137,7 @@ public abstract class ChromeFeatureList {
|
||||
*/
|
||||
public static boolean getFieldTrialParamByFeatureAsBoolean(
|
||||
String featureName, String paramName, boolean defaultValue) {
|
||||
- if (sTestFeatures != null) return defaultValue;
|
||||
- assert isInitialized();
|
||||
- return nativeGetFieldTrialParamByFeatureAsBoolean(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
|
||||
@@ -232,17 +232,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 !defined(GOOGLE_CHROME_BUILD)
|
||||
- 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.11.0
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 24 Apr 2017 16:11:53 +0200
|
||||
Subject: Disable smooth scrolling on Linux
|
||||
|
||||
Smooth scrolling (while using mousewheel or arrow keys) is a really
|
||||
dumb idea. Text naturally appears as a blur while it moves, and the
|
||||
animation takes that-many milliseconds to finish, so it's a time
|
||||
waster too.
|
||||
|
||||
Only the fallback setting, which is used on Linux, is changed; on
|
||||
Windows/MacOS, smooth scrolling remains controlled by a system
|
||||
setting.
|
||||
---
|
||||
ui/gfx/animation/animation.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ui/gfx/animation/animation.cc b/ui/gfx/animation/animation.cc
|
||||
--- a/ui/gfx/animation/animation.cc
|
||||
+++ b/ui/gfx/animation/animation.cc
|
||||
@@ -111,7 +111,7 @@ bool Animation::ShouldRenderRichAnimationImpl() {
|
||||
// static
|
||||
bool Animation::ScrollAnimationsEnabledBySystem() {
|
||||
// Defined in platform specific files for Windows and OSX.
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+7
-7
@@ -3,13 +3,13 @@ Date: Thu, 22 Mar 2018 22:38:00 +0100
|
||||
Subject: Disable plugins enumeration
|
||||
|
||||
---
|
||||
third_party/WebKit/Source/core/frame/LocalFrame.cpp | 6 ++----
|
||||
third_party/blink/renderer/core/frame/local_frame.cc | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
||||
@@ -1134,10 +1134,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
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
|
||||
@@ -1294,10 +1294,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
}
|
||||
|
||||
PluginData* LocalFrame::GetPluginData() const {
|
||||
@@ -21,7 +21,7 @@ diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/W
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
|
||||
void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+15
-7
@@ -1,18 +1,18 @@
|
||||
From: SergeyZhukovsky <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 15 Aug 2017 15:33:16 -0400
|
||||
Subject: Remove google account access permission on reboot
|
||||
Subject: Remove request for account access permission on reboot
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 3 +--
|
||||
chrome/android/BUILD.gn | 4 +---
|
||||
chrome/android/java/AndroidManifest.xml | 4 ++--
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -726,8 +726,7 @@ android_assets("chrome_public_locale_pak_assets") {
|
||||
jinja_template_resources("chrome_public_apk_template_resources") {
|
||||
@@ -943,8 +943,7 @@ jinja_template_resources("chrome_public_apk_template_resources") {
|
||||
resources = [
|
||||
"java/res_template/xml/file_paths.xml",
|
||||
"java/res_template/xml/launchershortcuts.xml",
|
||||
- "java/res_template/xml/searchable.xml",
|
||||
- "java/res_template/xml/syncadapter.xml",
|
||||
@@ -20,10 +20,18 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
]
|
||||
res_dir = "java/res_template"
|
||||
variables = chrome_public_jinja_variables
|
||||
@@ -955,7 +954,6 @@ jinja_template_resources("chrome_sync_shell_apk_template_resources") {
|
||||
"java/res_template/xml/file_paths.xml",
|
||||
"java/res_template/xml/launchershortcuts.xml",
|
||||
"java/res_template/xml/searchable.xml",
|
||||
- "java/res_template/xml/syncadapter.xml",
|
||||
]
|
||||
res_dir = "java/res_template"
|
||||
variables = chrome_sync_shell_jinja_variables
|
||||
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
|
||||
@@ -822,14 +822,14 @@ by a child template that "extends" this file.
|
||||
@@ -830,14 +830,14 @@ by a child template that "extends" this file.
|
||||
</provider>
|
||||
|
||||
<!-- Sync adapter for browser invalidation. -->
|
||||
@@ -41,5 +49,5 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
|
||||
<!-- Broadcast receiver that will be notified of account changes -->
|
||||
<receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver">
|
||||
--
|
||||
2.7.4
|
||||
2.11.0
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 15 Sep 2014 10:52:32 +0200
|
||||
Subject: net/cert: increase default key length for newly-generated RSA keys
|
||||
|
||||
Should we add something for chrome://settings, or just leave
|
||||
it as hidden as it was before?
|
||||
---
|
||||
net/cert/x509_util.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/cert/x509_util.cc b/net/cert/x509_util.cc
|
||||
--- a/net/cert/x509_util.cc
|
||||
+++ b/net/cert/x509_util.cc
|
||||
@@ -191,7 +191,7 @@ bool GetTLSServerEndPointChannelBinding(const X509Certificate& certificate,
|
||||
}
|
||||
|
||||
// RSA keys created by CreateKeyAndSelfSignedCert will be of this length.
|
||||
-static const uint16_t kRSAKeyLength = 1024;
|
||||
+static const uint16_t kRSAKeyLength = 2048;
|
||||
|
||||
// Certificates made by CreateKeyAndSelfSignedCert will be signed using this
|
||||
// digest algorithm.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user