Compare commits
42
Commits
74.0.3729.162
..
ci
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97ffe2b779 | ||
|
|
a38b47280d | ||
|
|
e0e30eda51 | ||
|
|
b78a5bdafe | ||
|
|
9484a27256 | ||
|
|
9011196bae | ||
|
|
7204ed9bf7 | ||
|
|
9c7592a4a6 | ||
|
|
601be8fbb3 | ||
|
|
6f2d3fc50e | ||
|
|
d2324589c3 | ||
|
|
afd28067c1 | ||
|
|
a47f939a7d | ||
|
|
339a4b70c0 | ||
|
|
af541a77c3 | ||
|
|
e1dcf7a478 | ||
|
|
062e6a0d27 | ||
|
|
172d3b361e | ||
|
|
029c891e1b | ||
|
|
f19eedc9e4 | ||
|
|
0c31cd222c | ||
|
|
585bb059a9 | ||
|
|
527fe50f9f | ||
|
|
19d55cbafe | ||
|
|
20e1016fdd | ||
|
|
b34aa8105c | ||
|
|
5551c6070c | ||
|
|
d9b7ffa145 | ||
|
|
285944dcab | ||
|
|
9113b2fca2 | ||
|
|
fa891eeb82 | ||
|
|
d757d6c066 | ||
|
|
784770e386 | ||
|
|
e0550c0591 | ||
|
|
93cd060c77 | ||
|
|
6b2d290129 | ||
|
|
4dc6db7bcf | ||
|
|
a5f6339d5e | ||
|
|
8b1f11683f | ||
|
|
fff5958814 | ||
|
|
1899895fae | ||
|
|
2d1539e968 |
@@ -1,37 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a Bromite bug report
|
||||
|
||||
---
|
||||
|
||||
**Bromite version**
|
||||
|
||||
Version: `69.0...`
|
||||
Arch: `arm` or `arm64` or `x86`
|
||||
Android version: ... (example: `lollipop`)
|
||||
|
||||
**Is the bug reproducible with latest version?**
|
||||
`Bug must be reproducible with latest version`
|
||||
|
||||
**Can the bug be reproduced with corresponding [Chromium](https://github.com/bromite/chromium/releases) version?**
|
||||
`Bug must NOT be reproducible with Chromium to be qualified as a Bromite bug`
|
||||
If yes then report it upstream on [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first; all Chromium issues reported here will be closed as `invalid`.
|
||||
|
||||
**Is the bug a crash?**
|
||||
If yes then individuate and post the logcat dump (remove privacy sensitive information, if any), otherwise remove this section.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a privacy-related idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to privacy?**
|
||||
Features that are not related to privacy are unlikely to be considered.
|
||||
|
||||
**Is there a patch available for this feature somewhere?**
|
||||
...
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you have considered.
|
||||
@@ -0,0 +1,141 @@
|
||||
name: Check git apply
|
||||
#permissions:
|
||||
# actions: none
|
||||
# checks: none
|
||||
# contents: none
|
||||
# deployments: none
|
||||
# issues: none
|
||||
# packages: none
|
||||
# pull-requests: write
|
||||
# repository-projects: none
|
||||
# security-events: none
|
||||
# statuses: none
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'ci'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
rtag:
|
||||
description: 'uazo/bromite TAG or COMMIT'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
env:
|
||||
RTAG: ${{ github.event.inputs.rtag }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: "Get value from dispatch"
|
||||
run: |
|
||||
if [ -z "${RTAG}" ]; then
|
||||
echo "RTAG=$GITHUB_SHA" >> $GITHUB_ENV
|
||||
echo "RTAG=$RTAG"
|
||||
fi
|
||||
|
||||
- name: Prepare container
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl
|
||||
|
||||
wget https://github.com/uazo/superpatch/releases/latest/download/SuperPatchUtils.tar.gz
|
||||
tar xfz SuperPatchUtils.tar.gz
|
||||
rm SuperPatchUtils.tar.gz
|
||||
|
||||
git clone https://github.com/uazo/bromite-buildtools
|
||||
|
||||
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
|
||||
unzip pup_v0.4.0_linux_amd64.zip
|
||||
rm pup_v0.4.0_linux_amd64.zip
|
||||
|
||||
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$RTAG | ./pup -p li.branch:last-child a text{})
|
||||
if [ -z "${BRANCH}" ]; then
|
||||
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$RTAG a | ./pup -p li.branch:first-child a text{})
|
||||
fi
|
||||
if [ -z "${BRANCH}" ]; then
|
||||
echo "Impossible to recover the base commit"
|
||||
exit 1
|
||||
fi
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout 'uazo/bromite' ${{ env.BRANCH }}
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/bromite'
|
||||
ref: ${{ github.event.inputs.rtag }}
|
||||
path: 'bromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Check chromium version
|
||||
run: |
|
||||
VERSION=$(cat bromite/build/RELEASE)
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Download chromium ${{ env.VERSION }} sources
|
||||
run: |
|
||||
./bin/SuperPatchUtils bromite $RTAG chromium/src
|
||||
cd chromium/src
|
||||
git init
|
||||
git config user.email "you@example.com"
|
||||
git config user.name "Your Name"
|
||||
git add .
|
||||
git commit -m $VERSION
|
||||
git tag -a $VERSION -m $VERSION
|
||||
cd ../..
|
||||
|
||||
- name: Apply patches ${{ github.event.inputs.rtag }}
|
||||
run: |
|
||||
export HOME=$(pwd)
|
||||
cd ~/chromium/src
|
||||
|
||||
export SILENT=true
|
||||
export SKIPAUTOGENERATED=true
|
||||
bash ~/bromite-buildtools/apply-all-patch.sh || exit 1
|
||||
|
||||
rm -rf ~/bromite/build/patches-new/
|
||||
rm ~/bromite/build/bromite_patches_list_new.txt
|
||||
|
||||
- name: Export patches
|
||||
run: |
|
||||
export HOME=$(pwd)
|
||||
|
||||
cd ~/chromium/src
|
||||
bash ~/bromite-buildtools/export-all-patch.sh
|
||||
|
||||
cd ~/bromite
|
||||
rm -rf build/patches/*
|
||||
mv build/patches-new/* build/patches
|
||||
rm -rf build/patches-new/
|
||||
|
||||
- name: Check differences CHANGES=${{ env.CHANGES }}
|
||||
run: |
|
||||
cd bromite
|
||||
CHANGES=0 && git diff --quiet || CHANGES=1
|
||||
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||
|
||||
if [[ CHANGES -eq 1 ]]; then
|
||||
git add build/patches/*.patch
|
||||
git diff --name-only --staged
|
||||
# MESSAGE=$(git diff --name-only --staged)
|
||||
# echo "MESSAGE='$MESSAGE'" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a #v3.12.0
|
||||
if: env.CHANGES == '1'
|
||||
with:
|
||||
path: bromite
|
||||
base: ${{ env.BRANCH }}
|
||||
#push-to-fork: uazo/bromite
|
||||
add-paths: |
|
||||
build/patches/*.patch
|
||||
commit-message: 'AUTOMATED - git apply results'
|
||||
title: Git apply result for ${{ env.BRANCH }} branch
|
||||
body: ${{ env.MESSAGE }}
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
@@ -0,0 +1,7 @@
|
||||
################################################################################
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
*.sqlite
|
||||
/.vs/ProjectSettings.json
|
||||
/.vs
|
||||
-432
@@ -1,432 +0,0 @@
|
||||
# 74.0.3729.154
|
||||
|
||||
# 74.0.3729.141
|
||||
|
||||
# 74.0.3729.122
|
||||
* remove more unnecessary permissions
|
||||
|
||||
# 74.0.3729.106
|
||||
* remove account/sync menu entries (fixes https://github.com/bromite/bromite/issues/285)
|
||||
* fix failed debug builds
|
||||
|
||||
# 74.0.3729.86
|
||||
* enable dark mode settings entry by default
|
||||
* fix permission request for Play services on reboot (fixes https://github.com/bromite/bromite/issues/281)
|
||||
|
||||
# 74.0.3729.80
|
||||
* increase minimum SDK version to 17 (Jelly Bean 4.2)
|
||||
* dropped obsolete patch for hyperlink auditing disable
|
||||
|
||||
# 73.0.3683.107
|
||||
* dropped patch to disable smooth scrolling
|
||||
* fixed custom tab intents issue (fixes https://github.com/bromite/bromite/issues/279)
|
||||
|
||||
# 73.0.3683.105
|
||||
* removed Fanboy's Annoyance List and Peter Lowe's adservers list from filters
|
||||
|
||||
# 73.0.3683.97
|
||||
* dropped redundant patch to hide NTP tiles (use home page + about:blank)
|
||||
|
||||
# 73.0.3683.88
|
||||
* add option to use home page as NTP
|
||||
|
||||
# 73.0.3683.82
|
||||
* remove force home page button flag
|
||||
* enable site per process isolation for devices with memory > 1GB
|
||||
* use 64-bit processes for SystemWebView
|
||||
* disable local field trials seed (redundant)
|
||||
* fix patch for classic new tab page (redundant)
|
||||
|
||||
# 73.0.3683.79
|
||||
* add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
|
||||
* DoH: include upstream patch for DNS secure mode
|
||||
* DoH: enable DNS secure mode by default
|
||||
|
||||
# 73.0.3683.70
|
||||
|
||||
# 73.0.3683.61
|
||||
* drop patches with functionality now available from upstream (DuckDuckGo and Qwant search engines, TLS 1.3 final)
|
||||
* add only DuckDuckGo Lite search engine
|
||||
* provide image URL for Qwant
|
||||
* disable safe browsing subresource filter by default
|
||||
* fix PAC URL support in proxy configuration
|
||||
|
||||
# 72.0.3626.120
|
||||
* add support for resource type in adblock engine (fixes https://github.com/bromite/bromite/issues/115)
|
||||
* adblock engine speed optimizations
|
||||
* use adblock engine also in SystemWebView
|
||||
* add back uBlock Origin and EasyList filters
|
||||
* added Fanboy's Annoyance List
|
||||
|
||||
# 72.0.3626.119
|
||||
* use AdGuard filters
|
||||
* fixes for new tile rows usage
|
||||
* re-introduce patch to hide NTP tiles
|
||||
* disable NTP tile metrics collection
|
||||
|
||||
# 72.0.3626.114
|
||||
* use 4 tile rows instead of 2 in the new tab page
|
||||
* do not grant geolocation permission to default search engine (fixes https://github.com/bromite/bromite/issues/250)
|
||||
|
||||
# 72.0.3626.108
|
||||
|
||||
# 72.0.3626.99
|
||||
|
||||
# 72.0.3626.87
|
||||
* update bookmarks view after import
|
||||
|
||||
# 72.0.3626.81
|
||||
* serve empty content for blocked scripts/images (fixes https://github.com/bromite/bromite/issues/238)
|
||||
* keep support of Jelly Bean (workaround for upstream https://bugs.chromium.org/p/chromium/issues/detail?id=923477)
|
||||
|
||||
# 72.0.3626.73
|
||||
|
||||
# 72.0.3626.68
|
||||
* do not ignore save prompt for users without SD card (workaround for upstream wontfix https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
|
||||
* remove third_party/analytics patch (now fixed upstream in https://chromium.googlesource.com/chromium/src.git/+/64d6a56f094efbab83802c07ad3ddffa014f9903)
|
||||
* AV1 codec support
|
||||
|
||||
# 71.0.3578.132
|
||||
* add patches from AndroidHardening project (fixes https://github.com/bromite/bromite/issues/226)
|
||||
|
||||
# 71.0.3578.123
|
||||
* disable jumbo builds (fixes https://github.com/bromite/bromite/issues/216 and https://github.com/bromite/bromite/issues/219)
|
||||
* disable preview fetching
|
||||
* do not consider Android Jelly Bean unsupported
|
||||
|
||||
# 71.0.3578.120
|
||||
* fix breakage of translate quick answers by anti-AMP (fixes https://github.com/bromite/bromite/issues/210)
|
||||
|
||||
# 71.0.3578.115
|
||||
* add AdGuard DNS-over-HTTPS option
|
||||
* use green icon for SystemWebView
|
||||
|
||||
# 71.0.3578.110
|
||||
|
||||
# 71.0.3578.104
|
||||
* fix AMP links sanitisation; have it working for news as well (fixes https://github.com/bromite/bromite/issues/202)
|
||||
* revert upstream patch responsible for the broken save dialog prompt (upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
|
||||
|
||||
# 71.0.3578.101
|
||||
|
||||
# 71.0.3578.98
|
||||
* do not ask permissions for camera when importing bookmarks (fixes https://github.com/bromite/bromite/issues/200)
|
||||
|
||||
# 71.0.3578.88
|
||||
* add proxy configuration page (see https://github.com/bromite/bromite/wiki/ProxyConfiguration)
|
||||
* use more recent versions in User-Agent (fixes https://github.com/bromite/bromite/issues/156)
|
||||
|
||||
# 71.0.3578.85
|
||||
* fix blurry adaptive icon (fixes https://github.com/bromite/bromite/issues/197)
|
||||
|
||||
# 71.0.3578.76
|
||||
|
||||
# 71.0.3578.72
|
||||
* add flag to disable IPv6 probes
|
||||
|
||||
# 70.0.3538.107
|
||||
* added adaptive icon (fixes https://github.com/bromite/bromite/issues/181)
|
||||
* do not change randomisation at each call (fixes https://github.com/bromite/bromite/issues/177)
|
||||
* do not enable #enable-scroll-anchor-serialization by default
|
||||
|
||||
# 70.0.3538.102
|
||||
* do not grant notifications to default search engine
|
||||
* remove all promos from bookmark manager page
|
||||
* re-introduced various patches to eradicate binary blob dependencies (only Cast left)
|
||||
* remove contacts picker permission
|
||||
|
||||
# 70.0.3538.95
|
||||
* fix crash on bookmark edit activity (fixes https://github.com/bromite/bromite/issues/172)
|
||||
* fix slow chrome://flags (fixes https://github.com/bromite/bromite/issues/173)
|
||||
* enable TLS 1.3 final support by default (fixes https://github.com/bromite/bromite/issues/174)
|
||||
* dropped some patches related to GCM/GMS on suspicion of being related to random crashes
|
||||
|
||||
# 70.0.3538.87
|
||||
* enable history requirement of user gesture (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* enable serialization of scroll position changes while loading (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* remove passwords keyboard accessory option (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* some improvements to bookmark import/export interaction
|
||||
* add flag to disable orientation API, disabled by default
|
||||
* disable device motion API by default (fixes https://github.com/bromite/bromite/issues/171)
|
||||
|
||||
# 70.0.3538.83
|
||||
* fix keep session cookies option showing on all site settings views
|
||||
* fix blank site settings entry showing (fixes https://github.com/bromite/bromite/issues/166)
|
||||
* offer builtin autocomplete for chrome://flags quick access
|
||||
|
||||
# 70.0.3538.80
|
||||
* add flag to disable video resume functionality, allowing to not pause video playback on tab switch (fixes https://github.com/bromite/bromite/issues/108)
|
||||
* prevent "are you there" prompts from appearing when playing videos
|
||||
* completely disable update scheduler checks to fix a related crash
|
||||
|
||||
# 70.0.3538.77
|
||||
* disable generic sensor APIs by default (fixes https://github.com/bromite/bromite/issues/160)
|
||||
* introduce flag to disable device motion API (fixes https://github.com/bromite/bromite/issues/160)
|
||||
* add Quad9 as a DNS-over-HTTPS (DoH) option (fixes https://github.com/bromite/bromite/issues/140)
|
||||
|
||||
# 70.0.3538.71
|
||||
* fix bug with canvas fingerprinting (fixes https://github.com/bromite/bromite/issues/154)
|
||||
|
||||
# 70.0.3538.67
|
||||
* re-enabled DNS-over-HTTPS (DoH) flag (fixes https://github.com/bromite/bromite/issues/139)
|
||||
* dropped GCM removal patch
|
||||
* disable kSigninAllowedOnNextStartup by default
|
||||
* permanently disable query-in-omnibox (fixes https://github.com/bromite/bromite/issues/143)
|
||||
|
||||
# 69.0.3497.113
|
||||
* disabled DNS-over-HTTPS (DoH) flag, not working since 69.0.3497.73 (see https://github.com/bromite/bromite/issues/139)
|
||||
|
||||
# 69.0.3497.109
|
||||
|
||||
# 69.0.3497.102
|
||||
* ungoogled-chromium: disable network time tracker
|
||||
* ungoogled-chromium: remove third-party/analytics
|
||||
* ungoogled-chromium: always use local Devtools instead of remote files
|
||||
* build without safebrowsing
|
||||
* drop "Hide NTP tiles" flag
|
||||
|
||||
# 69.0.3497.91
|
||||
* fixed crash when accessing site settings media preferences (fixes https://github.com/bromite/bromite/issues/122)
|
||||
|
||||
# 69.0.3497.73
|
||||
* enabled WebRTC
|
||||
* drop clear HTTP cache patch
|
||||
|
||||
# 68.0.3440.126
|
||||
* add option to disallow custom tab intents (fixes https://github.com/bromite/bromite/issues/117)
|
||||
* add option to keep local data until browser exit (fixes https://github.com/bromite/bromite/issues/56)
|
||||
* remember preference for tabs persistence option
|
||||
* extend anti-AMP to all search results
|
||||
|
||||
# 68.0.3440.121
|
||||
* add option to not persist tabs across sessions (fixes https://github.com/bromite/bromite/issues/106)
|
||||
* always incognito mode (fixes https://github.com/bromite/bromite/issues/18)
|
||||
* disable domain reliability (ungoogled-chromium)
|
||||
* more efficient adblock interception by using proper handler
|
||||
* fix log message about default maximum connections
|
||||
* improvement for exit menu patch
|
||||
|
||||
# 68.0.3440.110
|
||||
* add import action to Bookmarks activity page
|
||||
* use different user-agent version based on Android OS version
|
||||
|
||||
# 68.0.3440.90
|
||||
* reduce rects randomisation by factor of 100
|
||||
* use a fixed user-agent (fixes https://github.com/bromite/bromite/issues/103)
|
||||
|
||||
# 68.0.3440.87
|
||||
* add export action to Bookmarks activity page
|
||||
|
||||
# 68.0.3440.81
|
||||
* fix issue with filters with an excluded domain option
|
||||
|
||||
# 68.0.3440.72
|
||||
* fix crash during some canvas rendering (fixes https://github.com/bromite/bromite/issues/95)
|
||||
* new approach to adblock filtering (fixes https://github.com/bromite/bromite/issues/90)
|
||||
* add a flag to enable higher maximum connections per host limit (fixes https://github.com/bromite/bromite/issues/61)
|
||||
* add a flag to disable custom tab intents (fixes https://github.com/bromite/bromite/issues/81)
|
||||
* add a flag to have an always-empty new tab page (fixes https://github.com/bromite/bromite/issues/82)
|
||||
* reduced randomization of TextMetrics and ClientRects results
|
||||
* disable ads metrics by default
|
||||
* disable all field trials (fixes https://github.com/bromite/bromite/issues/83)
|
||||
* re-introduced own battery API patch (fixes https://github.com/bromite/bromite/issues/80)
|
||||
|
||||
# 67.0.3396.107
|
||||
* removed patch to use Android Media Player for URLs (fixes https://github.com/bromite/bromite/issues/71)
|
||||
|
||||
# 67.0.3396.101
|
||||
* set home page to new tab page
|
||||
* adjust order of new menu entries, remove help menu item (fixes https://github.com/bromite/bromite/issues/76)
|
||||
* remove some Play Services integrations: Auth, Vision, GCM
|
||||
* remove TOS/metrics and translate
|
||||
* net/cert: increase default key length for newly-generated RSA keys
|
||||
* dns: send IPv6 connectivity probes to RIPE DNS rather than Google
|
||||
* profile-resetter: do not tick send-settings by default
|
||||
* autofill: disable autofill download manager
|
||||
* first_run: deactivate autoupdate globally
|
||||
* safe_browsing: disable incident reporting
|
||||
* safe_browsing: disable reporting of safebrowsing override
|
||||
* safe_browsing: disable cookie transmission
|
||||
* extensions: always show component extensions in the ext list
|
||||
* translate: disable fetching of translate languages from server
|
||||
|
||||
# 67.0.3396.95
|
||||
* reduce headers sent in DoH requests (fixes https://github.com/bromite/bromite/issues/70)
|
||||
* serve DoH requests with maximum priority
|
||||
* `CloudFlare` -> `Cloudflare` (fixes https://github.com/bromite/bromite/issues/73)
|
||||
* fingerprint mitigations: cover also `ConvertToArrayBufferContents`
|
||||
* removed redundant own patch for battery API
|
||||
|
||||
# 67.0.3396.92
|
||||
* improve randomization for each retrieved Canvas data (fixes https://github.com/bromite/bromite/issues/69)
|
||||
|
||||
# 67.0.3396.88
|
||||
* add flag for DNS-over-HTTPS (Google experimental DNS) (fixes https://github.com/bromite/bromite/issues/68)
|
||||
* disable signin, translate and data saver UI/internal components (fixes https://github.com/bromite/bromite/issues/67)
|
||||
* rename `GoogleEN` -> `Google In English` (fixes https://github.com/bromite/bromite/issues/66)
|
||||
* re-enabled text metrics and ToDataURL, ToBlob with randomization of color data (fixes https://github.com/bromite/bromite/issues/52)
|
||||
* open YouTube links in Bromite
|
||||
* use Android Media Player for URLs
|
||||
* add exit menu item
|
||||
* hide "send reports to Google" menu item
|
||||
|
||||
# 67.0.3396.82
|
||||
|
||||
# 67.0.3396.76
|
||||
|
||||
# 67.0.3396.72
|
||||
* add global toggle for adblock engine (https://github.com/bromite/bromite/issues/53)
|
||||
|
||||
# 67.0.3396.67
|
||||
|
||||
# 66.0.3359.202
|
||||
* fix DevTools integration (https://github.com/bromite/bromite/issues/23)
|
||||
* allow toggling of Javascript from New Tab Page (fixes https://github.com/bromite/bromite/issues/60)
|
||||
|
||||
# 66.0.3359.200
|
||||
|
||||
# 66.0.3359.196
|
||||
|
||||
# 66.0.3359.188
|
||||
* increase max (persistent) connections per server from 6 to 15
|
||||
* preliminary work for better canvas fingerprinting mitigations
|
||||
|
||||
# 66.0.3359.161
|
||||
|
||||
# 66.0.3359.148
|
||||
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
|
||||
* reduce randomization for client rects from 5% to 3%
|
||||
|
||||
# 65.0.3325.230
|
||||
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
|
||||
|
||||
# 65.0.3325.218
|
||||
* always set WideVine version
|
||||
|
||||
# 65.0.3325.204
|
||||
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
|
||||
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
|
||||
* set audio latency to fixed number
|
||||
|
||||
# 65.0.3325.198
|
||||
* re-landed support for third-party AdBlock filters
|
||||
* completed patches cleanup
|
||||
|
||||
# 65.0.3325.190
|
||||
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
|
||||
|
||||
# 65.0.3325.176
|
||||
* block plugins enumeration API
|
||||
* block battery API
|
||||
* remove device name and build id from User Agent
|
||||
* added Qwant search engine
|
||||
* disable non-working 3rd-party filters support
|
||||
|
||||
# 64.0.3282.204
|
||||
* use H264 NEON optimizations also for arm64
|
||||
* fix build of Stable channel
|
||||
* started building vanilla Chromium releases as well
|
||||
|
||||
# 64.0.3282.193
|
||||
* disable reporting
|
||||
|
||||
# 64.0.3282.182
|
||||
* add support for domain-based adblock filters
|
||||
* optimized memory allocation for filters
|
||||
|
||||
# 64.0.3282.168
|
||||
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
|
||||
* never fetch most popular sites for new tab initialization, disable logo on new tab page
|
||||
* some improvements to adblock filters
|
||||
* disabled signin (ungoogled-chromium) (https://github.com/bromite/bromite/issues/31 and https://github.com/bromite/bromite/issues/11)
|
||||
* disabled webRTC and crash uploaders (ungoogled-chromium)
|
||||
* disabled translate (ungoogled-chromium)
|
||||
* disabled Gaia & GCM (ungoogled-chromium)
|
||||
* added clear HTTP cache menu item (ungoogled-chromium)
|
||||
* disabled Google host detection (ungoogled-chromium)
|
||||
* disabled profile avatar downloading (ungoogled-chromium)
|
||||
* disabled intranet redirect detector (ungoogled-chromium)
|
||||
* disabled plugin untraceable URLs (ungoogled-chromium)
|
||||
|
||||
# 64.0.3282.149
|
||||
|
||||
# 63.0.3239.150
|
||||
* fixed crash when clicking on address bar lock (page info) or opening site settings (https://github.com/bromite/bromite/issues/28)
|
||||
* build H264 with NEON optimizations for ARMv7
|
||||
* more builds for arm64 architecture
|
||||
|
||||
# 63.0.3239.144
|
||||
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
|
||||
|
||||
# 63.0.3239.129
|
||||
|
||||
# 63.0.3239.122
|
||||
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
|
||||
* hyperlinks sanitization fixed and now accessible from Google logo click
|
||||
* now building and publishing SystemWebView apks
|
||||
|
||||
# 63.0.3239.118
|
||||
* limit impact of AMP-removal to not break tabs (https://github.com/bromite/bromite/issues/20)
|
||||
* fix DuckDuckGo and StartPage suggestions (https://github.com/bromite/bromite/issues/19)
|
||||
* revert /deep/ and ::shadow feature drop to attempt fixing DevTools support (https://github.com/bromite/bromite/issues/23)
|
||||
* remove also ads from search results
|
||||
* add Google search engine with English-only results, no RLZ and field trials
|
||||
* fix build of x86 version (was broken in previous version)
|
||||
|
||||
# 63.0.3239.85
|
||||
* no suggest URL for DuckDuckGo (https://github.com/bromite/bromite/issues/19)
|
||||
* fixed 4chan blocking rule
|
||||
* limit AMP links cleanup to search results only (fixes broken images/news result tabs)
|
||||
|
||||
# 63.0.3239.78
|
||||
* correctly set version and build numbers
|
||||
|
||||
# 63.0.3239.73
|
||||
|
||||
# 63.0.3239.64
|
||||
* fixed an issue with incognito new tab
|
||||
* permanent disable for ToS/metrics and unused auto-updates check
|
||||
|
||||
# 63.0.3239.46
|
||||
* removed search engine geolocation default patch
|
||||
|
||||
# 63.0.3239.38
|
||||
|
||||
# 63.0.3239.27
|
||||
|
||||
# 63.0.3239.24
|
||||
* convert AMP search results to regular search results
|
||||
|
||||
# 63.0.3239.15
|
||||
* remove URL tracking from Google search results
|
||||
* disable webRTC by default (https://github.com/bromite/bromite/issues/9, still not working proper)
|
||||
* do not enable search engine geolocation by default
|
||||
* use own package name (closes https://github.com/bromite/bromite/issues/1)
|
||||
* use 64bit WebView process
|
||||
|
||||
# 63.0.3239.10
|
||||
* attempt enabling API keys (didn't work)
|
||||
* added StartPage search engine (closes https://github.com/bromite/bromite/issues/3)
|
||||
|
||||
# 63.0.3239.6
|
||||
* added Bromite patch for Google search results click-tracking removal
|
||||
* added x86 target CPU
|
||||
* fixed red blink frame
|
||||
|
||||
# 63.0.3235.2
|
||||
* first release with NoChromo adblocking patch
|
||||
* Bromite patch: disable NTP remote suggestions
|
||||
* added some Inox/Iridium/Ungoogled-Chromium patches, namely:
|
||||
* DuckDuckGo search engine
|
||||
* disable battery status service
|
||||
* disable formatting in OmniBox
|
||||
* disable GCM status checks
|
||||
* use local fonts instead of fonts from Google servers
|
||||
* disable updater pings
|
||||
* do not enable Google integrations by default (translation, lookup, etc)
|
||||
* disable the ad promo system
|
||||
* do not store passwords by default
|
||||
* do not fetch Google promotions
|
||||
* restore classic NTP
|
||||
* only keep cookies until exit
|
||||
* block third-party cookies
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,171 +0,0 @@
|
||||
# Bromite - Take back your browser
|
||||
|
||||
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
|
||||
|
||||
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
|
||||
|
||||
Bromite is [Chromium](https://www.chromium.org/Home) plus some patches for ad blocking and enhanced privacy.
|
||||
|
||||
Bromite is only available for Android v4.1 and above.
|
||||
|
||||
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" />
|
||||
|
||||
# Goals
|
||||
|
||||
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
|
||||
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
|
||||
|
||||
# Donate
|
||||
|
||||
Please donate to support development of Bromite and the costs for the build system.
|
||||
|
||||
Support development with a donation of 3 EUR: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
|
||||
|
||||
Support development with a free amount donation: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC7Q6A3UAQPY8)
|
||||
|
||||
<a href="bitcoin:3MkC3idL61npQSCxL1gceksmRTkNkiCPcG">BTC donations address</a>: `3MkC3idL61npQSCxL1gceksmRTkNkiCPcG`
|
||||
|
||||
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
|
||||
|
||||
# F.A.Q.
|
||||
|
||||
## Does Google Sync/Translate/Data saver work?
|
||||
No.
|
||||
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
|
||||
|
||||
Additionally, these features would not be privacy-friendly.
|
||||
|
||||
## Does Bromite require root?
|
||||
No.
|
||||
|
||||
## Is Bromite de-googled?
|
||||
|
||||
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
|
||||
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
|
||||
|
||||
## What is the SystemWebView?
|
||||
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
|
||||
|
||||
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
|
||||
|
||||
## How to enable DNS-over-HTTPS?
|
||||
|
||||
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
|
||||
|
||||
## Can you add dark mode/some cool themes?
|
||||
No.
|
||||
Bromite is about privacy and adblocking.
|
||||
|
||||
## Can you add HTTPS everywhere?
|
||||
No.
|
||||
We cannot add add-ons to Bromite (merely some features).
|
||||
|
||||
## Is Bromite on Play Store?
|
||||
No, and this is unlikely to change. Many limitations apply for submissions there, including which ads are allowed to be blocked.
|
||||
|
||||
Bromite favors user freedom in software choice: the device is yours so you get to choose which software to run on it, end of the story.
|
||||
|
||||
## Is Bromite on F-Droid?
|
||||
It is not on the official F-Droid repository and there are no (more) plans to submit it.
|
||||
|
||||
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
## Does Bromite support WebRTC?
|
||||
Yes, since version 69. While the desktop version of Chromium has an option to disable it (video/audio site settings), the Android version cannot.
|
||||
|
||||
# Features
|
||||
|
||||
* baked-in adblock engine
|
||||
* remove click-tracking and AMP from search results
|
||||
* DNS-over-HTTPS support via Google, Cloudflare, Quad9 and AdGuard servers
|
||||
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
|
||||
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
|
||||
* chrome flags to disable custom intents and clear session on exit
|
||||
* 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
|
||||
* security enhancement patches from [AndroidHardening](https://github.com/AndroidHardening) project
|
||||
|
||||
## 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.)
|
||||
* [AV1 codec support](https://github.com/bromite/bromite/wiki/AV1-support)
|
||||
* built with official speed optimizations
|
||||
|
||||
You can inspect all functionality/privacy changes by reading the patches: https://github.com/bromite/bromite/tree/master/build/patches
|
||||
|
||||
# Privacy limitations
|
||||
|
||||
Bromite's privacy features, including anti-fingerprinting mitigations (which can be easily circumvented), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://2019.www.torproject.org/projects/torbrowser.html.en) in such cases.
|
||||
|
||||
# Releases
|
||||
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically select the one apt for your device (or none otherwise).
|
||||
|
||||
Each tag corresponds to a Chromium Stable release tag.
|
||||
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 16 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
|
||||
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
|
||||
|
||||
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
|
||||
|
||||
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
|
||||
|
||||
The GN args used to build Bromite are available here: [GN_ARGS](./build/GN_ARGS).
|
||||
The patches are to be applied second the order specified in the `patches_list.txt` file (you can use `git am`); the big file `adblock_entries.h` (containing all the AdBlock filters) needs to be copied under `src/net/url_request/`.
|
||||
|
||||
# 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
|
||||
* [AndroidHardening](https://github.com/AndroidHardening) for some patches
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/browser-android-tabs) for some patches
|
||||
* nochromo for the original adblock patch
|
||||
* [Vadim Pleshkov](http://vadimpleshkov.me/) for Bromite's logo
|
||||
|
||||
# Filters credits
|
||||
* [EasyList](https://easylist.to/#easylist)
|
||||
* [EasyPrivacy](https://easylist.to/#easyprivacy)
|
||||
* [uBlock Origin](https://github.com/uBlockOrigin)
|
||||
|
||||
# License
|
||||
|
||||
The patches published as part of the Bromite project are released under [GNU GPL v3](./LICENSE).
|
||||
|
||||
[version-image]: https://img.shields.io/github/release/bromite/bromite.svg?style=flat-square
|
||||
[version-url]: https://github.com/bromite/bromite/releases/latest
|
||||
[license-image]: https://img.shields.io/github/license/bromite/bromite.svg
|
||||
[license-url]: https://github.com/bromite/bromite/blob/master/LICENSE
|
||||
@@ -1,31 +0,0 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
dcheck_always_on=false
|
||||
debuggable_apks=false
|
||||
enable_ac3_eac3_audio_demuxing=true enable_hevc_demuxing=true enable_iterator_debugging=false
|
||||
enable_av1_decoder=true
|
||||
enable_hangout_services_extension=false
|
||||
enable_mdns=false
|
||||
enable_mse_mpeg2ts_stream_parser=true ffmpeg_branding="Chrome" proprietary_codecs=true
|
||||
enable_nacl=false
|
||||
enable_nacl_nonsfi=false
|
||||
enable_remoting=false
|
||||
enable_reporting=false
|
||||
enable_resource_whitelist_generation=false
|
||||
enable_vr=false
|
||||
fieldtrial_testing_like_official_build=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
jumbo_file_merge_limit=60
|
||||
safe_browsing_mode=0
|
||||
strip_absolute_paths_from_debug_symbols=true
|
||||
strip_debug_info=false
|
||||
symbol_level=1
|
||||
target_os="android"
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_jumbo_build=false
|
||||
use_official_google_api_keys=false
|
||||
use_openh264=true chrome_pgo_phase=0 full_wpo_on_official=true
|
||||
use_sysroot=false
|
||||
File diff suppressed because one or more lines are too long
@@ -1,234 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 16 Dec 2018 15:24:19 +0100
|
||||
Subject: AV1 codec support
|
||||
|
||||
libaom build fixes (requires -fPIC)
|
||||
Report AV1 as playable on Android
|
||||
---
|
||||
media/base/mime_util_internal.cc | 6 +++++-
|
||||
third_party/libaom/BUILD.gn | 6 ++++--
|
||||
third_party/libaom/libaom_srcs.gni | 5 +++++
|
||||
.../source/config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
|
||||
.../source/config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
|
||||
.../libaom/source/config/linux/arm-neon/config/aom_config.asm | 2 +-
|
||||
third_party/libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
|
||||
third_party/libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
|
||||
third_party/libaom/source/config/linux/arm/config/aom_config.h | 2 +-
|
||||
third_party/libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
|
||||
third_party/libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
|
||||
.../libaom/source/config/linux/generic/config/aom_config.asm | 2 +-
|
||||
third_party/libaom/source/config/linux/generic/config/aom_config.h | 2 +-
|
||||
third_party/libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
|
||||
third_party/libaom/source/config/linux/x64/config/aom_config.h | 2 +-
|
||||
15 files changed, 26 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc
|
||||
--- a/media/base/mime_util_internal.cc
|
||||
+++ b/media/base/mime_util_internal.cc
|
||||
@@ -539,9 +539,13 @@ bool MimeUtil::IsCodecSupportedOnAndroid(
|
||||
case THEORA:
|
||||
return false;
|
||||
|
||||
- // AV1 is not supported on Android yet.
|
||||
+ // AV1 is supported on Android.
|
||||
case AV1:
|
||||
+#if BUILDFLAG(ENABLE_AV1_DECODER)
|
||||
+ return true;
|
||||
+#else
|
||||
return false;
|
||||
+#endif
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// The remaining codecs may be supported depending on platform abilities.
|
||||
diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
|
||||
--- a/third_party/libaom/BUILD.gn
|
||||
+++ b/third_party/libaom/BUILD.gn
|
||||
@@ -74,7 +74,7 @@ if (enable_libaom_decoder) {
|
||||
sources = aom_dsp_common_asm_sse2
|
||||
sources += aom_dsp_common_asm_ssse3
|
||||
sources += aom_ports_asm_x86
|
||||
- defines = [ "CHROMIUM" ]
|
||||
+ defines = [ "CHROMIUM", "PIC" ]
|
||||
include_dirs = libaom_include_dirs
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ if (enable_libaom_decoder) {
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
if (current_cpu == "arm") {
|
||||
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||
- cflags = [ "-mfpu=neon" ]
|
||||
+ cflags = [ "-mfpu=neon", "-fPIC" ]
|
||||
}
|
||||
configs += [ ":libaom_config" ]
|
||||
|
||||
@@ -203,6 +203,8 @@ if (enable_libaom_decoder) {
|
||||
if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
|
||||
cpu_arch_full == "arm-neon-cpu-detect") {
|
||||
deps += [ ":libaom_intrinsics_neon" ]
|
||||
+ # will detect CPU
|
||||
+ sources += aom_ports_arm_sources
|
||||
}
|
||||
if (is_android) {
|
||||
deps += [ "//third_party/android_tools:cpu_features" ]
|
||||
diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
|
||||
--- a/third_party/libaom/libaom_srcs.gni
|
||||
+++ b/third_party/libaom/libaom_srcs.gni
|
||||
@@ -488,6 +488,11 @@ aom_mem_sources = [
|
||||
|
||||
aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/emms.asm" ]
|
||||
|
||||
+aom_ports_arm_sources = [
|
||||
+ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
|
||||
+ "//third_party/libaom/source/libaom/aom_ports/arm.h",
|
||||
+ ]
|
||||
+
|
||||
aom_rtcd_sources = [
|
||||
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd_defs.pl",
|
||||
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
|
||||
CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_ONE_PASS_SVM equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_RUNTIME_CPU_DETECT equ 1
|
||||
CONFIG_SHARED equ 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 1
|
||||
#define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
|
||||
CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_ONE_PASS_SVM equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_RUNTIME_CPU_DETECT equ 0
|
||||
CONFIG_SHARED equ 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 0
|
||||
#define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
|
||||
CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_ONE_PASS_SVM equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_RUNTIME_CPU_DETECT equ 0
|
||||
CONFIG_SHARED equ 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 0
|
||||
#define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
|
||||
CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_ONE_PASS_SVM equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_RUNTIME_CPU_DETECT equ 0
|
||||
CONFIG_SHARED equ 0
|
||||
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 0
|
||||
#define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
@@ -45,7 +45,7 @@ CONFIG_MULTITHREAD equ 1
|
||||
CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_ONE_PASS_SVM equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_RUNTIME_CPU_DETECT equ 1
|
||||
CONFIG_SHARED equ 0
|
||||
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 1
|
||||
#define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
@@ -35,7 +35,7 @@
|
||||
%define CONFIG_NORMAL_TILE_MODE 1
|
||||
%define CONFIG_ONE_PASS_SVM 0
|
||||
%define CONFIG_OS_SUPPORT 1
|
||||
-%define CONFIG_PIC 0
|
||||
+%define CONFIG_PIC 1
|
||||
%define CONFIG_RD_DEBUG 0
|
||||
%define CONFIG_RUNTIME_CPU_DETECT 1
|
||||
%define CONFIG_SHARED 0
|
||||
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
@@ -47,7 +47,7 @@
|
||||
#define CONFIG_NORMAL_TILE_MODE 1
|
||||
#define CONFIG_ONE_PASS_SVM 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_RUNTIME_CPU_DETECT 1
|
||||
#define CONFIG_SHARED 0
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,625 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 11:06:18 +0200
|
||||
Subject: Add DuckDuckGo Lite search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 10 ++
|
||||
components/search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 129 +++++++++++----------
|
||||
3 files changed, 76 insertions(+), 64 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -95,6 +95,16 @@
|
||||
"id": 68
|
||||
},
|
||||
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
"duckduckgo": {
|
||||
"name": "DuckDuckGo",
|
||||
"keyword": "duckduckgo.com",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -65,6 +65,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_360,
|
||||
SEARCH_ENGINE_COCCOC,
|
||||
SEARCH_ENGINE_DUCKDUCKGO,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_PARSIJOO,
|
||||
SEARCH_ENGINE_QWANT,
|
||||
SEARCH_ENGINE_STARTPAGE,
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -35,6 +35,7 @@ const PrepopulatedEngine* const engines_default[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Note, the below entries are sorted by country code, not the name in comment.
|
||||
@@ -44,7 +45,7 @@ const PrepopulatedEngine* const engines_AE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Albania
|
||||
@@ -60,7 +61,7 @@ const PrepopulatedEngine* const engines_AR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_ar,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Austria
|
||||
@@ -68,7 +69,7 @@ const PrepopulatedEngine* const engines_AT[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_at,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Australia
|
||||
@@ -76,7 +77,7 @@ const PrepopulatedEngine* const engines_AU[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_au,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Bosnia and Herzegovina
|
||||
@@ -92,7 +93,7 @@ const PrepopulatedEngine* const engines_BE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
@@ -124,7 +125,7 @@ const PrepopulatedEngine* const engines_BN[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Bolivia
|
||||
@@ -132,7 +133,7 @@ const PrepopulatedEngine* const engines_BO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Brazil
|
||||
@@ -140,7 +141,7 @@ const PrepopulatedEngine* const engines_BR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_br,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Belarus
|
||||
@@ -156,19 +157,19 @@ const PrepopulatedEngine* const engines_BZ[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Canada
|
||||
const PrepopulatedEngine* const engines_CA[] = {
|
||||
- &googleen, &google, &startpage, &bing, &yahoo_ca, &yahoo_qc, &duckduckgo,
|
||||
+ &googleen, &google, &startpage, &bing, &yahoo_ca, &yahoo_qc, &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Switzerland
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_ch,
|
||||
};
|
||||
|
||||
@@ -177,7 +178,7 @@ const PrepopulatedEngine* const engines_CL[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_cl,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// China
|
||||
@@ -190,7 +191,7 @@ const PrepopulatedEngine* const engines_CO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_co,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
@@ -198,7 +199,7 @@ const PrepopulatedEngine* const engines_CR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Czech Republic
|
||||
@@ -214,7 +215,7 @@ const PrepopulatedEngine* const engines_DE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_de,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Denmark
|
||||
@@ -222,7 +223,7 @@ const PrepopulatedEngine* const engines_DK[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_dk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Dominican Republic
|
||||
@@ -230,7 +231,7 @@ const PrepopulatedEngine* const engines_DO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Algeria
|
||||
@@ -246,7 +247,7 @@ const PrepopulatedEngine* const engines_EC[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
@@ -270,7 +271,7 @@ const PrepopulatedEngine* const engines_ES[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Finland
|
||||
@@ -278,7 +279,7 @@ const PrepopulatedEngine* const engines_FI[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_fi,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Faroe Islands
|
||||
@@ -286,7 +287,7 @@ const PrepopulatedEngine* const engines_FO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// France
|
||||
@@ -302,7 +303,7 @@ const PrepopulatedEngine* const engines_GB[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_uk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Greece
|
||||
@@ -310,7 +311,7 @@ const PrepopulatedEngine* const engines_GR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Guatemala
|
||||
@@ -318,7 +319,7 @@ const PrepopulatedEngine* const engines_GT[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Hong Kong
|
||||
@@ -334,7 +335,7 @@ const PrepopulatedEngine* const engines_HN[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Croatia
|
||||
@@ -342,7 +343,7 @@ const PrepopulatedEngine* const engines_HR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Hungary
|
||||
@@ -350,7 +351,7 @@ const PrepopulatedEngine* const engines_HU[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Indonesia
|
||||
@@ -358,7 +359,7 @@ const PrepopulatedEngine* const engines_ID[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_id,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
@@ -366,7 +367,7 @@ const PrepopulatedEngine* const engines_IE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Israel
|
||||
@@ -382,7 +383,7 @@ const PrepopulatedEngine* const engines_IN[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_in,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Iraq
|
||||
@@ -405,7 +406,7 @@ const PrepopulatedEngine* const engines_IS[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Italy
|
||||
@@ -413,7 +414,7 @@ const PrepopulatedEngine* const engines_IT[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Jamaica
|
||||
@@ -421,7 +422,7 @@ const PrepopulatedEngine* const engines_JM[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Jordan
|
||||
@@ -445,7 +446,7 @@ const PrepopulatedEngine* const engines_KE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// South Korea
|
||||
@@ -477,14 +478,14 @@ const PrepopulatedEngine* const engines_LB[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Liechtenstein
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -500,7 +501,7 @@ const PrepopulatedEngine* const engines_LT[] = {
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -533,7 +534,7 @@ const PrepopulatedEngine* const engines_MC[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Moldova
|
||||
@@ -541,7 +542,7 @@ const PrepopulatedEngine* const engines_MD[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yandex_ru,
|
||||
&mail_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Montenegro
|
||||
@@ -557,7 +558,7 @@ const PrepopulatedEngine* const engines_MK[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Mexico
|
||||
@@ -565,7 +566,7 @@ const PrepopulatedEngine* const engines_MX[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_mx,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Malaysia
|
||||
@@ -581,7 +582,7 @@ const PrepopulatedEngine* const engines_NI[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Netherlands
|
||||
@@ -589,7 +590,7 @@ const PrepopulatedEngine* const engines_NL[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_nl,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Norway
|
||||
@@ -597,14 +598,14 @@ const PrepopulatedEngine* const engines_NO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// New Zealand
|
||||
const PrepopulatedEngine* const engines_NZ[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_nz,
|
||||
};
|
||||
|
||||
@@ -621,7 +622,7 @@ const PrepopulatedEngine* const engines_PA[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Peru
|
||||
@@ -629,7 +630,7 @@ const PrepopulatedEngine* const engines_PE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_pe,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
@@ -637,7 +638,7 @@ const PrepopulatedEngine* const engines_PH[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_ph,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
@@ -653,7 +654,7 @@ const PrepopulatedEngine* const engines_PL[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
@@ -661,7 +662,7 @@ const PrepopulatedEngine* const engines_PR[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Portugal
|
||||
@@ -669,7 +670,7 @@ const PrepopulatedEngine* const engines_PT[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Paraguay
|
||||
@@ -677,7 +678,7 @@ const PrepopulatedEngine* const engines_PY[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Qatar
|
||||
@@ -693,7 +694,7 @@ const PrepopulatedEngine* const engines_RO[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Serbia
|
||||
@@ -701,7 +702,7 @@ const PrepopulatedEngine* const engines_RS[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Russia
|
||||
@@ -733,7 +734,7 @@ const PrepopulatedEngine* const engines_SE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo_se,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Singapore
|
||||
@@ -749,7 +750,7 @@ const PrepopulatedEngine* const engines_SI[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Slovakia
|
||||
@@ -757,7 +758,7 @@ const PrepopulatedEngine* const engines_SK[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// El Salvador
|
||||
@@ -765,7 +766,7 @@ const PrepopulatedEngine* const engines_SV[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Syria
|
||||
@@ -805,7 +806,7 @@ const PrepopulatedEngine* const engines_TT[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Taiwan
|
||||
@@ -837,7 +838,7 @@ const PrepopulatedEngine* const engines_US[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Uruguay
|
||||
@@ -845,7 +846,7 @@ const PrepopulatedEngine* const engines_UY[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Venezuela
|
||||
@@ -853,7 +854,7 @@ const PrepopulatedEngine* const engines_VE[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&yahoo_ve,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Vietnam
|
||||
@@ -877,7 +878,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
|
||||
&googleen, &google, &startpage,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Zimbabwe
|
||||
@@ -897,7 +898,7 @@ const PrepopulatedEngine* const kAllEngines[] = {
|
||||
&bing,
|
||||
&coccoc,
|
||||
&daum,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&googleen, &google, &startpage,
|
||||
&mail_ru,
|
||||
&naver,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,290 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Apr 2018 08:30:26 +0200
|
||||
Subject: Add a flag for DNS-over-HTTPS
|
||||
|
||||
Allow selection between Google and Cloudflare endpoints.
|
||||
Serve DoH requests with maximum priority, remove traffic annotation.
|
||||
Reduce HTTP headers in DoH requests to bare minimum.
|
||||
Add AdGuard (default) endpoint
|
||||
Do not fallback to UDP when using DoH
|
||||
|
||||
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-14.txt
|
||||
---
|
||||
chrome/browser/about_flags.cc | 11 +++++++++
|
||||
chrome/browser/flag_descriptions.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../browser/net/system_network_context_manager.cc | 17 +++++++------
|
||||
.../common/network_features.cc | 7 ++++--
|
||||
.../common/network_features.h | 5 +++-
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
net/base/load_flags_list.h | 6 +++++
|
||||
net/dns/dns_transaction.cc | 27 +++------------------
|
||||
net/url_request/url_request_http_job.cc | 28 +++++++++++++---------
|
||||
10 files changed, 64 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
|
||||
@@ -398,6 +398,14 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
|
||||
base::size(kCCTModuleCache_ThirtyMinutes), nullptr},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kDnsOverHttpsChoices[] = {
|
||||
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
|
||||
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google.com/experimental"},
|
||||
+ {features::kDnsOverHttpsChoiceCloudflare, switches::kDnsOverHttpsServer, "https://1.1.1.1/dns-query"},
|
||||
+ {features::kDnsOverHttpsChoiceQuad9, switches::kDnsOverHttpsServer, "https://9.9.9.9/dns-query"},
|
||||
+ {features::kDnsOverHttpsChoiceAdGuard, switches::kDnsOverHttpsServer, "https://dns.adguard.com/dns-query"}
|
||||
+};
|
||||
+
|
||||
#endif // OS_ANDROID
|
||||
|
||||
const FeatureEntry::Choice kEnableGpuRasterizationChoices[] = {
|
||||
@@ -3400,6 +3408,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_WITH_PARAMS_VALUE_TYPE(chrome::android::kTabSwitcherOnReturn,
|
||||
kTabSwitcherOnReturnVariations,
|
||||
"TabSwitcherOnReturn")},
|
||||
+ {"enable-dns-over-https", flag_descriptions::kDnsOverHttpsName,
|
||||
+ flag_descriptions::kDnsOverHttpsDescription, kOsAndroid,
|
||||
+ MULTI_VALUE_TYPE(kDnsOverHttpsChoices)},
|
||||
#endif
|
||||
|
||||
{"enable-built-in-module-all", flag_descriptions::kBuiltInModuleAllName,
|
||||
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
|
||||
@@ -1306,6 +1306,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
|
||||
@@ -25,6 +25,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"
|
||||
@@ -122,6 +123,7 @@ void GetStubResolverConfig(
|
||||
if (!net::dns_util::IsValidDoHTemplate(
|
||||
doh_server_list[i].GetString(),
|
||||
doh_server_method_list[i].GetString())) {
|
||||
+ LOG(ERROR) << "Invalid DoH template: " << doh_server_list[i].GetString() << " with method " << doh_server_method_list[i].GetString();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -401,15 +403,12 @@ SystemNetworkContextManager::SystemNetworkContextManager(
|
||||
base::Value(ShouldEnableAsyncDns()));
|
||||
base::ListValue default_doh_servers;
|
||||
base::ListValue default_doh_server_methods;
|
||||
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
|
||||
- std::string server(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "server"));
|
||||
- std::string method(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "method"));
|
||||
- if (!server.empty()) {
|
||||
- default_doh_servers.AppendString(server);
|
||||
- default_doh_server_methods.AppendString(method);
|
||||
- }
|
||||
+ std::string server =
|
||||
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
+ switches::kDnsOverHttpsServer);
|
||||
+ if (!server.empty()) {
|
||||
+ default_doh_servers.AppendString(server);
|
||||
+ default_doh_server_methods.AppendString("POST");
|
||||
}
|
||||
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsServers,
|
||||
std::move(default_doh_servers));
|
||||
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -8,7 +8,10 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
-const base::Feature kDnsOverHttps{"dns-over-https",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+const char kDnsOverHttpsChoiceDefault[] = "Disabled",
|
||||
+ kDnsOverHttpsChoiceGoogle[] = "Google",
|
||||
+ kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
|
||||
+ kDnsOverHttpsChoiceQuad9[] = "Quad9",
|
||||
+ kDnsOverHttpsChoiceAdGuard[] = "AdGuard";
|
||||
|
||||
} // namespace features
|
||||
diff --git a/components/network_session_configurator/common/network_features.h b/components/network_session_configurator/common/network_features.h
|
||||
--- a/components/network_session_configurator/common/network_features.h
|
||||
+++ b/components/network_session_configurator/common/network_features.h
|
||||
@@ -10,9 +10,12 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
-// Enabled DNS over HTTPS
|
||||
+// DNS over HTTPS server endpoint choices
|
||||
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).
|
||||
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
|
||||
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kDnsOverHttpsChoiceDefault[],
|
||||
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[],
|
||||
+ kDnsOverHttpsChoiceAdGuard[];
|
||||
|
||||
} // namespace features
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -32,6 +32,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
|
||||
@@ -105,3 +105,9 @@ LOAD_FLAG(SKIP_VARY_CHECK, 1 << 16)
|
||||
// does not complete in 60 seconds, the cache treat the stale resource as
|
||||
// invalid, as it did not specify stale-while-revalidate.
|
||||
LOAD_FLAG(SUPPORT_ASYNC_REVALIDATION, 1 << 17)
|
||||
+
|
||||
+// 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)
|
||||
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,29 +358,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
extra_request_headers.SetHeader("Accept", kDnsOverHttpResponseContentType);
|
||||
|
||||
DCHECK(url_request_context);
|
||||
- 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) {
|
||||
@@ -396,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);
|
||||
}
|
||||
@@ -815,7 +794,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
|
||||
@@ -425,17 +425,21 @@ 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,
|
||||
- referrer.spec());
|
||||
+ 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());
|
||||
+ }
|
||||
}
|
||||
|
||||
- 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();
|
||||
@@ -659,10 +663,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
} else {
|
||||
// Advertise "br" encoding only if transferred data is opaque to proxy.
|
||||
bool advertise_brotli = false;
|
||||
- if (request()->context()->enable_brotli()) {
|
||||
- if (request()->url().SchemeIsCryptographic() ||
|
||||
- IsLocalhost(request()->url())) {
|
||||
- advertise_brotli = true;
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ if (request()->context()->enable_brotli()) {
|
||||
+ if (request()->url().SchemeIsCryptographic() ||
|
||||
+ IsLocalhost(request()->url())) {
|
||||
+ advertise_brotli = true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +686,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
}
|
||||
}
|
||||
|
||||
- if (http_user_agent_settings_) {
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS) && http_user_agent_settings_) {
|
||||
// Only add default Accept-Language if the request didn't have it
|
||||
// specified.
|
||||
std::string accept_language =
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,317 +0,0 @@
|
||||
From: Ryan Archer <ryan.bradley.archer@gmail.com>
|
||||
Date: Wed, 2 Aug 2017 01:41:28 -0400
|
||||
Subject: Add an always-incognito mode
|
||||
|
||||
More specifically, add a preference that causes all new tabs and all
|
||||
clicked links to launch as incognito.
|
||||
---
|
||||
.../android/java/res/xml/privacy_preferences.xml | 5 ++
|
||||
.../browser/AlwaysIncognitoLinkInterceptor.java | 73 ++++++++++++++++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 5 ++
|
||||
.../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, 133 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
|
||||
@@ -39,6 +39,11 @@
|
||||
android:key="usage_and_crash_reports"
|
||||
android:title="@string/usage_and_crash_reports_title_legacy"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.UsageAndCrashReportsPreferenceFragment" />
|
||||
+ <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" />
|
||||
<Preference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.DoNotTrackPreference"
|
||||
android:key="do_not_track"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
|
||||
@@ -0,0 +1,73 @@
|
||||
+/* 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.TabLaunchType;
|
||||
+import org.chromium.chrome.browser.tabmodel.TabModel;
|
||||
+import org.chromium.content_public.browser.LoadUrlParams;
|
||||
+
|
||||
+import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Map;
|
||||
+import java.util.Set;
|
||||
+/**
|
||||
+ * A {@link TabObserver} that implements the always-incognito preference behavior for links. When the preference is set
|
||||
+ * to true, it intercepts links opened within observed {@link Tab}s and opens them in new incognito <code>Tab</code>s instead.
|
||||
+ */
|
||||
+public class AlwaysIncognitoLinkInterceptor extends EmptyTabObserver {
|
||||
+
|
||||
+ 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), 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
|
||||
@@ -217,6 +217,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
|
||||
private static final int RECORD_MULTI_WINDOW_SCREEN_WIDTH_DELAY_MS = 5000;
|
||||
|
||||
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
|
||||
+
|
||||
/**
|
||||
* Timeout in ms for reading PartnerBrowserCustomizations provider.
|
||||
*/
|
||||
@@ -1697,6 +1699,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;
|
||||
@@ -182,6 +186,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, mCircleHighlight,
|
||||
showFromBottom);
|
||||
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.compositor.bottombar.ephemeraltab.EphemeralTabPanel;
|
||||
@@ -44,6 +45,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
|
||||
@@ -252,7 +254,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.IntentHandler;
|
||||
import org.chromium.chrome.browser.ServiceTabLauncher;
|
||||
@@ -16,6 +18,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.TabBuilder;
|
||||
+import org.chromium.chrome.browser.tab.TabObserver;
|
||||
import org.chromium.chrome.browser.tab.TabDelegateFactory;
|
||||
import org.chromium.chrome.browser.tab.TabParentIntent;
|
||||
import org.chromium.chrome.browser.tab.TabRedirectHandler;
|
||||
@@ -35,6 +38,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;
|
||||
@@ -46,6 +50,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
mActivity = activity;
|
||||
mNativeWindow = nativeWindow;
|
||||
mIncognito = incognito;
|
||||
+ if (!mIncognito) {
|
||||
+ mExtraLogic = new AlwaysIncognitoLinkInterceptor(ContextUtils.getAppSharedPreferences());
|
||||
+ } else {
|
||||
+ mExtraLogic = null;
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,6 +179,10 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
tab.getWebContents());
|
||||
}
|
||||
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return tab;
|
||||
} finally {
|
||||
@@ -198,6 +211,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
.setLaunchType(type)
|
||||
.build();
|
||||
tab.initialize(webContents, mTabContentManager, delegateFactory, !openInForeground, false);
|
||||
+
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return true;
|
||||
}
|
||||
@@ -240,7 +258,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
|
||||
@@ -304,6 +321,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
|
||||
@@ -716,6 +716,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
|
||||
@@ -10,6 +10,7 @@ import("//components/offline_pages/buildflags/features.gni")
|
||||
import("//device/vr/buildflags/buildflags.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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,113 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 29 Aug 2018 11:03:44 +0200
|
||||
Subject: Add custom tab intents privacy option
|
||||
|
||||
---
|
||||
chrome/android/java/res/values/values.xml | 3 +++
|
||||
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
|
||||
.../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
|
||||
@@ -42,6 +42,11 @@
|
||||
android:key="contextual_search"
|
||||
android:title="@string/contextual_search_title"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.ContextualSearchPreferenceFragment" />
|
||||
+ <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="clear_browsing_data"
|
||||
android:title="@string/clear_browsing_data_title"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
@@ -41,6 +41,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;
|
||||
@@ -271,6 +272,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
|
||||
@@ -39,6 +39,7 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
implements OnPreferenceChangeListener {
|
||||
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
|
||||
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
|
||||
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
|
||||
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
|
||||
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
|
||||
@@ -100,6 +101,11 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
navigationErrorPref.setOnPreferenceChangeListener(this);
|
||||
navigationErrorPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
|
||||
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
|
||||
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
|
||||
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
ChromeBaseCheckBoxPreference searchSuggestionsPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(PREF_SEARCH_SUGGESTIONS);
|
||||
searchSuggestionsPref.setOnPreferenceChangeListener(this);
|
||||
@@ -122,6 +128,10 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
recordNetworkPredictionEnablingUMA((boolean) newValue);
|
||||
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
|
||||
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setBoolean(
|
||||
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -3998,6 +3998,13 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
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
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 31 Jan 2017 22:12:27 -0500
|
||||
Subject: Add exit menu item
|
||||
|
||||
Corrected Exit functionality
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 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
|
||||
@@ -2116,6 +2116,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
|
||||
@@ -82,7 +82,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
|
||||
|
||||
// Kick off a timer to kill the process after a delay, which fires only if the Activities
|
||||
// take too long to be finished.
|
||||
- mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ if (restart) {
|
||||
+ mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ } else {
|
||||
+ fireBrowserRestartActivityIntent();
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/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
|
||||
@@ -3075,6 +3075,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
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 22:42:04 +0200
|
||||
Subject: Add flag to configure maximum connections per host
|
||||
|
||||
With the introduction of this flag it is possible to increase the maximum
|
||||
allowed connections per host; this can however be detrimental to devices
|
||||
with limited CPU/memory resources and it is disabled by default.
|
||||
---
|
||||
chrome/browser/about_flags.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../common/network_features.cc | 3 +++
|
||||
.../common/network_features.h | 4 ++++
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
net/socket/client_socket_pool_manager.cc | 17 +++++++++++++++++
|
||||
7 files changed, 43 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
|
||||
@@ -740,6 +740,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 ==
|
||||
@@ -2292,6 +2297,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kWebrtcH264WithOpenh264FfmpegDescription, kOsDesktop,
|
||||
FEATURE_VALUE_TYPE(content::kWebRtcH264WithOpenH264FFmpeg)},
|
||||
#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
|
||||
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
|
||||
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
#if defined(OS_ANDROID)
|
||||
{"offlining-recent-pages", flag_descriptions::kOffliningRecentPagesName,
|
||||
flag_descriptions::kOffliningRecentPagesDescription, kOsAndroid,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1245,6 +1245,10 @@ const char kLookalikeUrlNavigationSuggestionsDescription[] =
|
||||
const char kMarkHttpAsName[] = "Mark non-secure origins as non-secure";
|
||||
const char kMarkHttpAsDescription[] = "Change the UI treatment for HTTP pages";
|
||||
|
||||
+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
|
||||
@@ -748,6 +748,9 @@ extern const char kMarkHttpAsWarning[];
|
||||
extern const char kMarkHttpAsWarningAndDangerousOnFormEdits[];
|
||||
extern const char kMarkHttpAsWarningAndDangerousOnPasswordsAndCreditCards[];
|
||||
|
||||
+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 char kDnsOverHttpsChoiceDefault[] = "Disabled",
|
||||
kDnsOverHttpsChoiceGoogle[] = "Google",
|
||||
kDnsOverHttpsChoiceCloudflare[] = "Cloudflare",
|
||||
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[];
|
||||
+
|
||||
// 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;
|
||||
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")
|
||||
+
|
||||
|
||||
// Ignores certificate-related errors.
|
||||
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
|
||||
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
|
||||
@@ -22,6 +22,10 @@
|
||||
#include "net/socket/transport_client_socket_pool.h"
|
||||
#include "net/socket/transport_connect_job.h"
|
||||
#include "net/ssl/ssl_config.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
+
|
||||
+#include "base/command_line.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
|
||||
namespace net {
|
||||
|
||||
@@ -285,6 +289,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
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 25 Oct 2018 23:13:34 +0200
|
||||
Subject: Add flag to control video playback resume feature
|
||||
|
||||
Disable it by default on Android as it is everywhere else
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
media/base/media_switches.cc | 6 +-----
|
||||
4 files changed, 13 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1407,6 +1407,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kVideoPlayerChromecastSupportDescription, kOsCrOS,
|
||||
SINGLE_VALUE_TYPE(
|
||||
chromeos::switches::kEnableVideoPlayerChromecastSupport)},
|
||||
+ {"resume-background-video",
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
{"list-all-display-modes", flag_descriptions::kListAllDisplayModesName,
|
||||
flag_descriptions::kListAllDisplayModesDescription, kOsCrOS,
|
||||
FEATURE_VALUE_TYPE(display::features::kListAllDisplayModes)},
|
||||
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
|
||||
@@ -840,6 +840,11 @@ const char kEnablePictureInPictureDescription[] =
|
||||
"controls. The #enable-surfaces-for-videos flag must be enabled as well "
|
||||
"to use it.";
|
||||
|
||||
+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
|
||||
@@ -495,6 +495,9 @@ extern const char kEnableNewDownloadBackendDescription[];
|
||||
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
|
||||
@@ -205,11 +205,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
|
||||
};
|
||||
|
||||
// Enable Media Capabilities with finch-parameters.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Nov 2018 13:06:49 +0100
|
||||
Subject: Add flag to disable IPv6 probes
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
net/dns/host_resolver_impl.cc | 10 ++++++++--
|
||||
services/network/public/cpp/features.cc | 3 +++
|
||||
services/network/public/cpp/features.h | 2 ++
|
||||
6 files changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -2975,6 +2975,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kHandwritingGesture)},
|
||||
#endif // OS_CHROMEOS
|
||||
|
||||
+ {"ipv6-probing",
|
||||
+ flag_descriptions::kIPv6ProbingName,
|
||||
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
|
||||
+
|
||||
#if !defined(OS_ANDROID)
|
||||
{"enable-picture-in-picture",
|
||||
flag_descriptions::kEnablePictureInPictureName,
|
||||
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
|
||||
@@ -842,6 +842,10 @@ const char kOOPHPStackModeNative[] = "Native";
|
||||
const char kOOPHPStackModeNativeWithThreadNames[] = "Native with thread names";
|
||||
const char kOOPHPStackModePseudo[] = "Trace events";
|
||||
|
||||
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
|
||||
+const char kIPv6ProbingDescription[] =
|
||||
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
|
||||
+
|
||||
const char kEnablePictureInPictureName[] = "Enable Picture-in-Picture.";
|
||||
const char kEnablePictureInPictureDescription[] =
|
||||
"Show Picture-in-Picture in browser context menu and video native "
|
||||
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
|
||||
@@ -498,6 +498,9 @@ extern const char kDownloadAutoResumptionNativeDescription[];
|
||||
extern const char kEnableNewDownloadBackendName[];
|
||||
extern const char kEnableNewDownloadBackendDescription[];
|
||||
|
||||
+extern const char kIPv6ProbingName[];
|
||||
+extern const char kIPv6ProbingDescription[];
|
||||
+
|
||||
extern const char kEnablePictureInPictureName[];
|
||||
extern const char kEnablePictureInPictureDescription[];
|
||||
|
||||
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
|
||||
--- a/net/dns/host_resolver_impl.cc
|
||||
+++ b/net/dns/host_resolver_impl.cc
|
||||
@@ -81,6 +81,7 @@
|
||||
#include "net/log/net_log_with_source.h"
|
||||
#include "net/socket/client_socket_factory.h"
|
||||
#include "net/socket/datagram_client_socket.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
#include "url/url_canon_ip.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_MDNS)
|
||||
@@ -2751,8 +2752,13 @@ bool HostResolverImpl::IsIPv6Reachable(const NetLogWithSource& net_log) {
|
||||
bool cached = true;
|
||||
if ((tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
|
||||
kIPv6ProbePeriodMs) {
|
||||
- last_ipv6_probe_result_ =
|
||||
- IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
|
||||
+ if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
|
||||
+ // pretend IPv6 connectivy probe is successful when probing is disabled
|
||||
+ last_ipv6_probe_result_ = true;
|
||||
+ } else {
|
||||
+ last_ipv6_probe_result_ =
|
||||
+ IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
|
||||
+ }
|
||||
last_ipv6_probe_time_ = tick_clock_->NowTicks();
|
||||
cached = false;
|
||||
}
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -16,6 +16,9 @@ const base::Feature kExpectCTReporting{"ExpectCTReporting",
|
||||
|
||||
const base::Feature kNetworkErrorLogging{"NetworkErrorLogging",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
+const base::Feature kIPv6Probing{"IPv6Probing",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
// Enables the network service.
|
||||
const base::Feature kNetworkService {
|
||||
"NetworkService",
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -18,6 +18,8 @@ extern const base::Feature kNetworkErrorLogging;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kNetworkService;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
+extern const base::Feature kIPv6Probing;
|
||||
+COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kOutOfBlinkCors;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kReporting;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 22 Oct 2018 21:29:53 +0200
|
||||
Subject: Add flags to disable device motion and orientation APIs
|
||||
|
||||
Both flags will be disabled by default and prevent usage of gyroscope and
|
||||
legacy acceleration events.
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.h | 6 ++++++
|
||||
content/child/runtime_features.cc | 3 +++
|
||||
content/public/common/content_features.cc | 10 ++++++++++
|
||||
content/public/common/content_features.h | 2 ++
|
||||
third_party/blink/public/platform/web_runtime_features.h | 2 ++
|
||||
third_party/blink/renderer/modules/modules_initializer.cc | 9 ++++++---
|
||||
.../blink/renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
|
||||
10 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -2473,6 +2473,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
|
||||
@@ -600,6 +600,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
|
||||
@@ -382,6 +382,12 @@ extern const char kEnforceTLS13DowngradeDescription[];
|
||||
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
|
||||
@@ -93,6 +93,9 @@ void SetIndividualRuntimeFeatures(
|
||||
base::FeatureList::IsEnabled(features::kSharedArrayBuffer) ||
|
||||
base::FeatureList::IsEnabled(features::kWebAssemblyThreads));
|
||||
|
||||
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
|
||||
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
|
||||
+
|
||||
if (command_line.HasSwitch(switches::kDisableSharedWorkers))
|
||||
WebRuntimeFeatures::EnableSharedWorker(false);
|
||||
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -596,6 +596,16 @@ const base::Feature kExperimentalProductivityFeatures{
|
||||
// TODO(rouslan): Remove this.
|
||||
const base::Feature kWebPayments{"WebPayments",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+// Enables the device motion API used to track device acceleration;
|
||||
+// no user authorization or notifications happens when in use.
|
||||
+const base::Feature kDeviceMotion{"DeviceMotion",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
+// Enables the device orientation API used to track device orientation;
|
||||
+// no user authorization or notifications happens when in use.
|
||||
+const base::Feature kDeviceOrientation{"DeviceOrientation",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
|
||||
// Makes WebRTC use ECDSA certs by default (i.e., when no cert type was
|
||||
// specified in JS).
|
||||
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
|
||||
@@ -158,6 +158,8 @@ CONTENT_EXPORT extern const base::Feature kWarmUpNetworkProcess;
|
||||
CONTENT_EXPORT extern const base::Feature kWebNfc;
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
|
||||
+
|
||||
#if !defined(OS_ANDROID)
|
||||
CONTENT_EXPORT extern const base::Feature kWebUIPolymer2;
|
||||
#endif // !defined(OS_ANDROID)
|
||||
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -97,6 +97,8 @@ class WebRuntimeFeatures {
|
||||
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableKeyboardFocusableScrollers(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 EnableFallbackCursorMode(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
|
||||
@@ -165,6 +165,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
|
||||
@@ -409,6 +409,14 @@
|
||||
status: "stable",
|
||||
},
|
||||
{
|
||||
+ name: "DeviceMotion",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
+ name: "DeviceOrientation",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
name: "DecodeToYUV",
|
||||
status: "experimental",
|
||||
},
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 18 Oct 2017 21:26:53 +0200
|
||||
Subject: Add menu option to toggle global Javascript preference
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 13 ++++++++
|
||||
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
|
||||
.../java/strings/android_chrome_strings.grd | 11 +++++++
|
||||
7 files changed, 92 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -49,6 +49,7 @@
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:orderInCategory="2" />
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null"
|
||||
android:orderInCategory="2">
|
||||
@@ -61,6 +62,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_javascript_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_javascript_id"
|
||||
+ android:title="@string/menu_enable_javascript" />
|
||||
+ <item android:id="@+id/enable_javascript_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<!-- Title is intentionally left blank in xml and will be set in java. -->
|
||||
<item android:id="@+id/open_in_browser_id"
|
||||
android:title=""
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -61,6 +61,7 @@
|
||||
android:title="@string/menu_add_to_homescreen" />
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk" />
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null">
|
||||
<menu>
|
||||
@@ -71,6 +72,18 @@
|
||||
android:checkable="true" />
|
||||
</menu>
|
||||
</item>
|
||||
+
|
||||
+ <item android:id="@+id/enable_javascript_row_menu_id"
|
||||
+ android:title="@null">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_javascript_id"
|
||||
+ android:title="@string/menu_enable_javascript" />
|
||||
+ <item android:id="@+id/enable_javascript_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/reader_mode_prefs_id"
|
||||
android:title="@string/menu_reader_mode_prefs"
|
||||
android:icon="@drawable/reader_mode_prefs_icon" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -2219,6 +2219,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
currentTab.getWebContents().getNavigationController().setUseDesktopUserAgent(
|
||||
!usingDesktopUserAgent, reloadOnChange);
|
||||
RecordUserAction.record("MobileMenuRequestDesktopSite");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.reader_mode_prefs_id) {
|
||||
DomDistillerUIUtils.openSettings(currentTab.getWebContents());
|
||||
} else {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -1857,6 +1857,14 @@ public class ChromeTabbedActivity
|
||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
|
||||
}
|
||||
RecordUserAction.record("MobileMenuDownloadManager");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+ PrefServiceBridge.getInstance().setCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT, !jsEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.open_recently_closed_tab) {
|
||||
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
|
||||
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -25,6 +25,7 @@ import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeActivity;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.ChromeSwitches;
|
||||
+import org.chromium.chrome.browser.ContentSettingsType;
|
||||
import org.chromium.chrome.browser.ShortcutHelper;
|
||||
import org.chromium.chrome.browser.UrlConstants;
|
||||
import org.chromium.chrome.browser.banners.AppBannerManager;
|
||||
@@ -196,6 +197,8 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
+ updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
+
|
||||
// Only display reader mode settings menu option if the current page is in reader mode.
|
||||
menu.findItem(R.id.reader_mode_prefs_id)
|
||||
.setVisible(DomDistillerUrlUtils.isDistilledPage(currentTab.getUrl()));
|
||||
@@ -450,6 +453,41 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Updates the enable JavaScript item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable javascript
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateEnableJavascriptMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_javascript_row_menu_id);
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_javascript_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_javascript_check_id);
|
||||
+
|
||||
+ // Hide enable javascript on all chrome:// pages except for the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+ // Also hide enable javascsript on Reader Mode.
|
||||
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
|
||||
+
|
||||
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean jsEnabled = PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT);
|
||||
+
|
||||
+ // Mark the checkbox if Javascript is activated on this tab.
|
||||
+ enableMenuCheck.setChecked(jsEnabled);
|
||||
+
|
||||
+ // This title doesn't seem to be displayed by Android, but it is used to set up
|
||||
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
|
||||
+ enableMenuLabel.setTitleCondensed(jsEnabled
|
||||
+ ? mActivity.getString(R.string.menu_enable_javascript_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_javascript_off));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* A notification that the header view has finished inflating.
|
||||
* @param view The view that was inflated.
|
||||
* @param appMenu The menu the view is inside of.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -182,6 +182,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
+ updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -3060,6 +3060,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>
|
||||
+
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable JavaScript support for the page. [CHAR-LIMIT=27]">
|
||||
+ Enable JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_ON" desc="Accessibility description for when Enable JavaScript is selected.">
|
||||
+ Turn off JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_OFF" desc="Accessibility description for when Enable JavaScript is unselected.">
|
||||
+ Turn on JavaScript
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE" desc="Menu item in Chrome's overflow/options menu. By default, when a user navigates to a web page, Chrome shows the mobile site, that is, the version of the site designed for mobile phones. If this menu item is selected, however, Chrome will try to load the 'desktop' site instead, i.e. the site designed for desktop computers or laptop computers, which have larger screens. [CHAR-LIMIT=24]">
|
||||
Desktop site
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
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
|
||||
@@ -67,6 +67,9 @@
|
||||
<!-- TODO(peconn): Add help section. -->
|
||||
<!-- <string name="help_context_suggestions">mobile_content_suggestions</string> -->
|
||||
|
||||
+ <string name="close_tabs_on_exit_title">Close tabs on exit</string>
|
||||
+ <string name="close_tabs_on_exit_summary">Don\'t persist tabs between browsing sessions</string>
|
||||
+
|
||||
<!-- Our manage space activity. Default pre-KitKat to be nothing. -->
|
||||
<string name="manage_space_activity"></string>
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -13,6 +13,11 @@
|
||||
android:summary="@string/navigation_error_summary"
|
||||
android:defaultValue="true" />
|
||||
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ android:key="close_tabs_on_exit"
|
||||
+ android:title="@string/close_tabs_on_exit_title"
|
||||
+ android:summary="@string/close_tabs_on_exit_summary"
|
||||
+ android:defaultValue="false" />
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="search_suggestions"
|
||||
android:title="@string/search_suggestions_title"
|
||||
android:summary="@string/search_suggestions_summary"
|
||||
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
|
||||
@@ -1138,8 +1138,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.BuildInfo;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.R;
|
||||
@@ -43,6 +45,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";
|
||||
@@ -67,6 +70,11 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
(ChromeBaseCheckBoxPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
|
||||
canMakePaymentPref.setOnPreferenceChangeListener(this);
|
||||
|
||||
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
|
||||
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
|
||||
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
ChromeBaseCheckBoxPreference networkPredictionPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(PREF_NETWORK_PREDICTIONS);
|
||||
networkPredictionPref.setChecked(prefServiceBridge.getNetworkPredictionEnabled());
|
||||
@@ -126,6 +134,12 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
|
||||
recordNetworkPredictionEnablingUMA((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();
|
||||
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
|
||||
} else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
|
||||
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
|
||||
@@ -3874,6 +3874,12 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
|
||||
IMAGE
|
||||
</message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_TITLE" desc="Text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Close all open tabs on exit
|
||||
+ </message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Don't persist tabs between browsing sessions
|
||||
+ </message>
|
||||
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
|
||||
LINK
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 18 Mar 2019 21:47:12 +0100
|
||||
Subject: Add option to use home page as NTP
|
||||
|
||||
Use about:blank as default homepage
|
||||
---
|
||||
.../android/java/res/xml/homepage_preferences.xml | 5 +++++
|
||||
.../partnercustomizations/HomepageManager.java | 24 ++++++++++++++++++++--
|
||||
.../browser/preferences/HomepagePreferences.java | 14 ++++++++++++-
|
||||
.../chrome/browser/tabmodel/TabCreatorManager.java | 11 ++++++++--
|
||||
.../java/strings/android_chrome_strings.grd | 3 +++
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 2 ++
|
||||
chrome/common/pref_names.cc | 4 ++++
|
||||
chrome/common/pref_names.h | 1 +
|
||||
8 files changed, 59 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
@@ -16,4 +16,9 @@
|
||||
android:title="@string/options_homepage_edit_label"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.HomepageEditor" />
|
||||
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeSwitchPreference
|
||||
+ android:key="ntp_is_homepage_switch"
|
||||
+ android:summaryOn="@string/options_ntp_is_homepage_label"
|
||||
+ android:summaryOff="@string/options_ntp_is_homepage_label" />
|
||||
+
|
||||
</PreferenceScreen>
|
||||
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
|
||||
@@ -32,6 +32,7 @@ public class HomepageManager {
|
||||
}
|
||||
|
||||
private static final String PREF_HOMEPAGE_ENABLED = "homepage";
|
||||
+ public static final String PREF_NTP_IS_HOMEPAGE = "newtabpage_is_homepage";
|
||||
private static final String PREF_HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
|
||||
private static final String PREF_HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled";
|
||||
|
||||
@@ -91,7 +92,8 @@ public class HomepageManager {
|
||||
*/
|
||||
public static boolean shouldCloseAppWithZeroTabs() {
|
||||
return HomepageManager.isHomepageEnabled()
|
||||
- && !NewTabPage.isNTPUrl(HomepageManager.getHomepageUri());
|
||||
+ && !NewTabPage.isNTPUrl(HomepageManager.getHomepageUri())
|
||||
+ && (HomepageManager.getHomepageUri() != UrlConstants.CHROME_BLANK_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +113,7 @@ public class HomepageManager {
|
||||
* @return The default homepage URI.
|
||||
*/
|
||||
public static String getDefaultHomepageUri() {
|
||||
- return UrlConstants.NTP_NON_NATIVE_URL;
|
||||
+ return UrlConstants.CHROME_BLANK_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,6 +127,14 @@ public class HomepageManager {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Returns the user preference for whether the New Tab Page is the homepage or not.
|
||||
+ *
|
||||
+ */
|
||||
+ public boolean getPrefNTPIsHomepageEnabled() {
|
||||
+ return mSharedPreferences.getBoolean(PREF_NTP_IS_HOMEPAGE, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* Sets the user preference for whether the homepage is enabled.
|
||||
*/
|
||||
public void setPrefHomepageEnabled(boolean enabled) {
|
||||
@@ -138,6 +148,16 @@ public class HomepageManager {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Sets the user preference for whether the new tab page is the homepage or not.
|
||||
+ */
|
||||
+ public void setPrefNTPIsHomepageEnabled(boolean enabled) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_NTP_IS_HOMEPAGE, enabled);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ notifyHomepageUpdated();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* @return User specified homepage custom URI string.
|
||||
*/
|
||||
public String getPrefHomepageCustomUri() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java
|
||||
@@ -19,9 +19,10 @@ import org.chromium.chrome.browser.util.FeatureUtilities;
|
||||
public class HomepagePreferences extends PreferenceFragment {
|
||||
private static final String PREF_HOMEPAGE_SWITCH = "homepage_switch";
|
||||
private static final String PREF_HOMEPAGE_EDIT = "homepage_edit";
|
||||
+ private static final String PREF_NTP_HOMEPAGE_SWITCH = "ntp_is_homepage_switch";
|
||||
|
||||
private HomepageManager mHomepageManager;
|
||||
- private ChromeSwitchPreference mHomepageSwitch;
|
||||
+ private ChromeSwitchPreference mHomepageSwitch, mNTPIsHomepageSwitch;
|
||||
private Preference mHomepageEdit;
|
||||
|
||||
@Override
|
||||
@@ -47,6 +48,17 @@ public class HomepagePreferences extends PreferenceFragment {
|
||||
}
|
||||
});
|
||||
|
||||
+ mNTPIsHomepageSwitch = (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
|
||||
+ boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
|
||||
+ mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
|
||||
+ mNTPIsHomepageSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||
+ @Override
|
||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
+ mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
|
||||
+ return true;
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
mHomepageEdit = findPreference(PREF_HOMEPAGE_EDIT);
|
||||
updateCurrentHomepageUrl();
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
|
||||
@@ -10,6 +10,7 @@ import org.chromium.base.TraceEvent;
|
||||
import org.chromium.chrome.browser.UrlConstants;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabState;
|
||||
+import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
|
||||
import org.chromium.content_public.browser.LoadUrlParams;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
|
||||
@@ -88,12 +89,18 @@ public interface TabCreatorManager {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Creates a new tab and loads the NTP.
|
||||
+ * Creates a new tab and loads the NTP or the homepage, depending on user preferences.
|
||||
*/
|
||||
public final void launchNTP() {
|
||||
try {
|
||||
+ String newTabURL;
|
||||
+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ newTabURL = HomepageManager.getHomepageUri();
|
||||
+ } else {
|
||||
+ newTabURL = UrlConstants.NTP_URL;
|
||||
+ }
|
||||
TraceEvent.begin("TabCreator.launchNTP");
|
||||
- launchUrl(UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI);
|
||||
+ launchUrl(newTabURL, TabLaunchType.FROM_CHROME_UI);
|
||||
} finally {
|
||||
TraceEvent.end("TabCreator.launchNTP");
|
||||
}
|
||||
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
|
||||
@@ -668,6 +668,9 @@ CHAR-LIMIT guidelines:
|
||||
<message name="IDS_OPTIONS_HOMEPAGE_EDIT_LABEL" desc="The label for the edit text field that allows the user to change the URL that is opened when they tap on the home page button in the omnibox.">
|
||||
Open this page
|
||||
</message>
|
||||
+ <message name="IDS_OPTIONS_NTP_IS_HOMEPAGE_LABEL" desc="The label for switch that allows the user to toggle whether opening a new tab leads to the new tab page or the home page.">
|
||||
+ Use for new tabs
|
||||
+ </message>
|
||||
|
||||
<!-- Startup page preferences -->
|
||||
<message name="IDS_OPTIONS_STARTUP_PAGE_TITLE" desc="The title of the setting that allows users to manage the page that opens when they start Chrome.">
|
||||
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
|
||||
@@ -56,6 +56,8 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
+ registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false,
|
||||
+ GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
bool reset_check_default = false;
|
||||
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
|
||||
--- a/chrome/common/pref_names.cc
|
||||
+++ b/chrome/common/pref_names.cc
|
||||
@@ -58,6 +58,10 @@ const char kForceEphemeralProfiles[] = "profile.ephemeral_mode";
|
||||
// A boolean specifying whether the New Tab page is the home page or not.
|
||||
const char kHomePageIsNewTabPage[] = "homepage_is_newtabpage";
|
||||
|
||||
+// A boolean specifying whether opening a new tab should open the Home page
|
||||
+// instead of the New Tab page.
|
||||
+const char kNewTabPageIsHomePage[] = "newtabpage_is_homepage";
|
||||
+
|
||||
// This is the URL of the page to load when opening new tabs.
|
||||
const char kHomePage[] = "homepage";
|
||||
|
||||
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -293,6 +293,7 @@ extern const char kParentAccessCodeConfig[];
|
||||
extern const char kDeviceWallpaperImageFilePath[];
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
extern const char kShowHomeButton[];
|
||||
+extern const char kNewTabPageIsHomePage[];
|
||||
extern const char kSpeechRecognitionFilterProfanities[];
|
||||
extern const char kAllowDeletingBrowserHistory[];
|
||||
#if !defined(OS_ANDROID)
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 28 Aug 2018 23:27:23 +0200
|
||||
Subject: Add site settings option for session-only cookies
|
||||
|
||||
---
|
||||
chrome/android/java/res/values/values.xml | 3 +++
|
||||
.../android/java/res/xml/website_preferences.xml | 7 ++++++
|
||||
.../browser/preferences/PrefServiceBridge.java | 10 +++++++++
|
||||
.../website/SingleCategoryPreferences.java | 21 +++++++++++++++++-
|
||||
.../java/strings/android_chrome_strings.grd | 6 ++++++
|
||||
.../android/preferences/pref_service_bridge.cc | 25 ++++++++++++++++++++++
|
||||
6 files changed, 71 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
|
||||
--- a/chrome/android/java/res/values/values.xml
|
||||
+++ b/chrome/android/java/res/values/values.xml
|
||||
@@ -39,6 +39,9 @@
|
||||
<integer name="reload_button_level_reload">0</integer>
|
||||
<integer name="reload_button_level_stop">1</integer>
|
||||
|
||||
+ <string name="allow_cookies_session_only_title">Keep cookies only until you quit your browser</string>
|
||||
+ <string name="allow_cookies_session_only_summary">When enabled, all cookies will be erased when the browsing session is over</string>
|
||||
+
|
||||
<!-- Help and Feedback
|
||||
These constants should be in sync with the context names on go/mobilehelprecs.
|
||||
If the context ID cannot be found, the default help page will be shown to the user.-->
|
||||
diff --git a/chrome/android/java/res/xml/website_preferences.xml b/chrome/android/java/res/xml/website_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/website_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/website_preferences.xml
|
||||
@@ -26,6 +26,13 @@
|
||||
android:summary="@string/block_third_party_cookies_summary"
|
||||
android:defaultValue="true"
|
||||
android:persistent="false" />
|
||||
+ <!-- A toggle for cookies to be saved only until session exit, only shown for the Cookies category. -->
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ android:key="cookies_session_only"
|
||||
+ android:title="@string/allow_cookies_session_only_title"
|
||||
+ android:summary="@string/allow_cookies_session_only_summary"
|
||||
+ android:defaultValue="true"
|
||||
+ android:persistent="false" />
|
||||
<!-- A toggle for enabling vibration in notifications. -->
|
||||
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="notifications_vibrate"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
|
||||
@@ -240,6 +240,10 @@ public class PrefServiceBridge {
|
||||
return nativeGetBlockThirdPartyCookiesEnabled();
|
||||
}
|
||||
|
||||
+ public boolean isCookiesSessionOnlyEnabled() {
|
||||
+ return nativeGetCookiesSessionOnlyEnabled();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return Whether third-party cookie blocking is configured by policy
|
||||
*/
|
||||
@@ -626,6 +630,10 @@ public class PrefServiceBridge {
|
||||
nativeSetBlockThirdPartyCookiesEnabled(enabled);
|
||||
}
|
||||
|
||||
+ public void setCookiesSessionOnlyEnabled(boolean enabled) {
|
||||
+ nativeSetCookiesSessionOnlyEnabled(enabled);
|
||||
+ }
|
||||
+
|
||||
public void setDoNotTrackEnabled(boolean enabled) {
|
||||
nativeSetDoNotTrackEnabled(enabled);
|
||||
}
|
||||
@@ -1074,6 +1082,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();
|
||||
@@ -1120,6 +1129,7 @@ public class PrefServiceBridge {
|
||||
private native void nativeSetAutoplayEnabled(boolean enabled);
|
||||
private native void nativeSetAllowCookiesEnabled(boolean enabled);
|
||||
private native void nativeSetBackgroundSyncEnabled(boolean enabled);
|
||||
+ private native void nativeSetCookiesSessionOnlyEnabled(boolean enabled);
|
||||
private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled);
|
||||
private native void nativeSetClipboardEnabled(boolean enabled);
|
||||
private native void nativeSetDoNotTrackEnabled(boolean enabled);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
|
||||
@@ -121,6 +121,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
|
||||
// Keys for category-specific preferences (toggle, link, button etc.), dynamically shown.
|
||||
public static final String THIRD_PARTY_COOKIES_TOGGLE_KEY = "third_party_cookies";
|
||||
+ public static final String COOKIES_SESSION_ONLY_TOGGLE_KEY = "cookies_session_only";
|
||||
public static final String NOTIFICATIONS_VIBRATE_TOGGLE_KEY = "notifications_vibrate";
|
||||
public static final String EXPLAIN_PROTECTED_MEDIA_KEY = "protected_content_learn_more";
|
||||
private static final String ADD_EXCEPTION_KEY = "add_exception";
|
||||
@@ -441,6 +442,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
|
||||
if (type == SiteSettingsCategory.Type.COOKIES) {
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else if (type == SiteSettingsCategory.Type.NOTIFICATIONS) {
|
||||
updateNotificationsVibrateCheckBox();
|
||||
}
|
||||
@@ -479,6 +481,8 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
int setting = (int) newValue;
|
||||
prefServiceBridge.setContentSetting(mCategory.getContentSettingsType(), setting);
|
||||
getInfoForOrigins();
|
||||
+ } else if (COOKIES_SESSION_ONLY_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
+ prefServiceBridge.setCookiesSessionOnlyEnabled((boolean) newValue);
|
||||
} else if (THIRD_PARTY_COOKIES_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
prefServiceBridge.setBlockThirdPartyCookiesEnabled(((boolean) newValue));
|
||||
} else if (NOTIFICATIONS_VIBRATE_TOGGLE_KEY.equals(preference.getKey())) {
|
||||
@@ -769,6 +773,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);
|
||||
@@ -799,6 +805,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
|
||||
if (hideSecondaryToggles) {
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
screen.removePreference(notificationsVibrate);
|
||||
screen.removePreference(explainProtectedMediaKey);
|
||||
screen.removePreference(allowedGroup);
|
||||
@@ -808,12 +815,15 @@ public class SingleCategoryPreferences extends PreferenceFragment
|
||||
return;
|
||||
}
|
||||
|
||||
- // Configure/hide the third-party cookie toggle, as needed.
|
||||
+ // Configure/hide the third-party cookie toggle and session-only cookie toggle, as needed.
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) {
|
||||
thirdPartyCookies.setOnPreferenceChangeListener(this);
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ cookiesSessionOnly.setOnPreferenceChangeListener(this);
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else {
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
}
|
||||
|
||||
// Configure/hide the notifications vibrate toggle, as needed.
|
||||
@@ -918,6 +928,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
|
||||
@@ -907,6 +907,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_BLOCK_THIRD_PARTY_COOKIES_SUMMARY" desc="Summary text for Block Third Party Cookies preference">
|
||||
Prevent third-party websites from saving and reading cookie data
|
||||
</message>
|
||||
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_TITLE" desc="Title for Allow Cookies Session Only preference">
|
||||
+ Keep cookies only until you quit your browser
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_COOKIES_SESSION_ONLY_SUMMARY" desc="Summary text for Allow Session Only Cookies preference">
|
||||
+ When enabled, all cookies will be erased when the browsing session is over
|
||||
+ </message>
|
||||
<message name="IDS_JAVASCRIPT_PERMISSION_TITLE" desc="Title of the permission to run javascript [CHAR-LIMIT=32]">
|
||||
JavaScript
|
||||
</message>
|
||||
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
|
||||
@@ -311,6 +311,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) {
|
||||
@@ -768,6 +779,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
|
||||
|
||||
@@ -1,769 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 18 Sep 2018 08:06:14 +0200
|
||||
Subject: Allow building without safebrowsing for Android
|
||||
|
||||
Fix build from scratch (issue found by nikolowry)
|
||||
---
|
||||
.../android/java/res/xml/privacy_preferences.xml | 8 -----
|
||||
.../preferences/privacy/PrivacyPreferences.java | 40 ----------------------
|
||||
.../chrome_browsing_data_remover_delegate.cc | 10 ------
|
||||
chrome/browser/chrome_content_browser_client.cc | 20 +----------
|
||||
.../file_type_policies_component_installer.cc | 2 ++
|
||||
.../download/chrome_download_manager_delegate.cc | 14 ++++++--
|
||||
.../download/chrome_download_manager_delegate.h | 6 ++++
|
||||
chrome/browser/download/download_item_model.cc | 10 ++++++
|
||||
chrome/browser/download/download_item_model.h | 4 +++
|
||||
chrome/browser/download/download_prefs.cc | 4 +++
|
||||
.../browser/download/download_target_determiner.cc | 22 ++++++++++++
|
||||
.../browser/download/download_target_determiner.h | 6 ++++
|
||||
chrome/browser/download/download_target_info.cc | 4 +++
|
||||
chrome/browser/download/download_target_info.h | 4 +++
|
||||
chrome/browser/download/download_ui_model.cc | 4 +++
|
||||
chrome/browser/download/download_ui_model.h | 4 +++
|
||||
.../chrome_resource_dispatcher_host_delegate.cc | 2 ++
|
||||
chrome/browser/net/chrome_network_delegate.cc | 35 ++-----------------
|
||||
18 files changed, 87 insertions(+), 112 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -18,14 +18,6 @@
|
||||
android:summary="@string/search_suggestions_summary"
|
||||
android:defaultValue="true" />
|
||||
<org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
- android:key="safe_browsing_scout_reporting"
|
||||
- android:title="@string/safe_browsing_scout_reporting_title"
|
||||
- android:summary="@string/safe_browsing_scout_reporting_summary" />
|
||||
- <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
- android:key="safe_browsing"
|
||||
- android:title="@string/safe_browsing_title"
|
||||
- android:summary="@string/safe_browsing_summary" />
|
||||
- <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
android:key="network_predictions"
|
||||
android:title="@string/network_predictions_title"
|
||||
android:summary="@string/network_predictions_summary"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferences.java
|
||||
@@ -39,9 +39,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
implements OnPreferenceChangeListener {
|
||||
private static final String PREF_NAVIGATION_ERROR = "navigation_error";
|
||||
private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions";
|
||||
- private static final String PREF_SAFE_BROWSING_SCOUT_REPORTING =
|
||||
- "safe_browsing_scout_reporting";
|
||||
- private static final String PREF_SAFE_BROWSING = "safe_browsing";
|
||||
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
|
||||
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
|
||||
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
|
||||
@@ -79,8 +76,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
// Remove preferences that were migrated to SyncAndServicesPreferences.
|
||||
preferenceScreen.removePreference(findPreference(PREF_NAVIGATION_ERROR));
|
||||
preferenceScreen.removePreference(findPreference(PREF_SEARCH_SUGGESTIONS));
|
||||
- preferenceScreen.removePreference(findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING));
|
||||
- preferenceScreen.removePreference(findPreference(PREF_SAFE_BROWSING));
|
||||
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
|
||||
preferenceScreen.removePreference(findPreference(PREF_USAGE_AND_CRASH_REPORTING));
|
||||
|
||||
@@ -114,17 +109,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
preferenceScreen.removePreference(findPreference(PREF_CONTEXTUAL_SEARCH));
|
||||
}
|
||||
|
||||
- // Listen to changes to the Extended Reporting pref.
|
||||
- ChromeBaseCheckBoxPreference scoutReportingPref =
|
||||
- (ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
|
||||
- scoutReportingPref.setOnPreferenceChangeListener(this);
|
||||
- scoutReportingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
-
|
||||
- ChromeBaseCheckBoxPreference safeBrowsingPref =
|
||||
- (ChromeBaseCheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
|
||||
- safeBrowsingPref.setOnPreferenceChangeListener(this);
|
||||
- safeBrowsingPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
-
|
||||
updateSummaries();
|
||||
}
|
||||
|
||||
@@ -133,11 +117,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
String key = preference.getKey();
|
||||
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
|
||||
- } else if (PREF_SAFE_BROWSING.equals(key)) {
|
||||
- PrefServiceBridge.getInstance().setSafeBrowsingEnabled((boolean) newValue);
|
||||
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
|
||||
- PrefServiceBridge.getInstance().setSafeBrowsingExtendedReportingEnabled(
|
||||
- (boolean) newValue);
|
||||
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
|
||||
recordNetworkPredictionEnablingUMA((boolean) newValue);
|
||||
@@ -189,19 +168,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
searchSuggestionsPref.setChecked(prefServiceBridge.isSearchSuggestEnabled());
|
||||
}
|
||||
|
||||
- CheckBoxPreference extendedReportingPref =
|
||||
- (CheckBoxPreference) findPreference(PREF_SAFE_BROWSING_SCOUT_REPORTING);
|
||||
- if (extendedReportingPref != null) {
|
||||
- extendedReportingPref.setChecked(
|
||||
- prefServiceBridge.isSafeBrowsingExtendedReportingEnabled());
|
||||
- }
|
||||
-
|
||||
- CheckBoxPreference safeBrowsingPref =
|
||||
- (CheckBoxPreference) findPreference(PREF_SAFE_BROWSING);
|
||||
- if (safeBrowsingPref != null) {
|
||||
- safeBrowsingPref.setChecked(prefServiceBridge.isSafeBrowsingEnabled());
|
||||
- }
|
||||
-
|
||||
CheckBoxPreference canMakePaymentPref =
|
||||
(CheckBoxPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
|
||||
if (canMakePaymentPref != null) {
|
||||
@@ -250,12 +216,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
|
||||
return prefs.isSearchSuggestManaged();
|
||||
}
|
||||
- if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
|
||||
- return prefs.isSafeBrowsingExtendedReportingManaged();
|
||||
- }
|
||||
- if (PREF_SAFE_BROWSING.equals(key)) {
|
||||
- return prefs.isSafeBrowsingManaged();
|
||||
- }
|
||||
if (PREF_NETWORK_PREDICTIONS.equals(key)) {
|
||||
return prefs.isNetworkPredictionManaged();
|
||||
}
|
||||
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
|
||||
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
|
||||
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
|
||||
@@ -250,16 +250,6 @@ bool DoesOriginMatchEmbedderMask(int origin_type_mask,
|
||||
return false;
|
||||
}
|
||||
|
||||
-// Callback for when cookies have been deleted. Invokes NotifyIfDone.
|
||||
-// Receiving |cookie_manager| as a parameter so that the receive pipe is
|
||||
-// not deleted before the response is received.
|
||||
-void OnClearedCookies(base::OnceClosure done,
|
||||
- network::mojom::CookieManagerPtr cookie_manager,
|
||||
- uint32_t num_deleted) {
|
||||
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
- std::move(done).Run();
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
|
||||
ChromeBrowsingDataRemoverDelegate::ChromeBrowsingDataRemoverDelegate(
|
||||
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -115,7 +115,6 @@
|
||||
#include "chrome/browser/safe_browsing/certificate_reporting_service.h"
|
||||
#include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h"
|
||||
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
||||
-#include "chrome/browser/safe_browsing/safe_browsing_navigation_throttle.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
#include "chrome/browser/safe_browsing/ui_manager.h"
|
||||
#include "chrome/browser/safe_browsing/url_checker_delegate_impl.h"
|
||||
@@ -4249,11 +4248,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
|
||||
PreviewsLitePageDecider::MaybeCreateThrottleFor(handle);
|
||||
if (previews_lite_page_throttle)
|
||||
throttles.push_back(std::move(previews_lite_page_throttle));
|
||||
- if (base::FeatureList::IsEnabled(safe_browsing::kCommittedSBInterstitials)) {
|
||||
- throttles.push_back(
|
||||
- std::make_unique<safe_browsing::SafeBrowsingNavigationThrottle>(
|
||||
- handle));
|
||||
- }
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX) || \
|
||||
(defined(OS_LINUX) && !defined(OS_CHROMEOS))
|
||||
@@ -5199,19 +5193,7 @@ ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate(
|
||||
content::ResourceContext* resource_context) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
||||
- ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
|
||||
- if (!io_data->safe_browsing_enabled()->GetValue())
|
||||
- return nullptr;
|
||||
-
|
||||
- // |safe_browsing_service_| may be unavailable in tests.
|
||||
- if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) {
|
||||
- safe_browsing_url_checker_delegate_ =
|
||||
- base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>(
|
||||
- safe_browsing_service_->database_manager(),
|
||||
- safe_browsing_service_->ui_manager());
|
||||
- }
|
||||
-
|
||||
- return safe_browsing_url_checker_delegate_.get();
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
base::Optional<std::string>
|
||||
diff --git a/chrome/browser/component_updater/file_type_policies_component_installer.cc b/chrome/browser/component_updater/file_type_policies_component_installer.cc
|
||||
--- a/chrome/browser/component_updater/file_type_policies_component_installer.cc
|
||||
+++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
|
||||
@@ -18,7 +18,9 @@
|
||||
#include "base/stl_util.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/version.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
#include "components/component_updater/component_updater_paths.h"
|
||||
|
||||
using component_updater::ComponentUpdateService;
|
||||
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
|
||||
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
|
||||
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
|
||||
@@ -39,8 +39,10 @@
|
||||
#include "chrome/browser/download/save_package_file_picker.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
+#endif
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/browser_finder.h"
|
||||
#include "chrome/browser/ui/chrome_pages.h"
|
||||
@@ -51,7 +53,9 @@
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/pdf_util.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/download/public/common/download_interrupt_reasons.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
@@ -106,8 +110,10 @@ using content::DownloadManager;
|
||||
using download::DownloadItem;
|
||||
using download::DownloadPathReservationTracker;
|
||||
using download::PathValidationResult;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
using safe_browsing::DownloadFileType;
|
||||
using safe_browsing::DownloadProtectionService;
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -768,19 +774,19 @@ ChromeDownloadManagerDelegate::ApplicationClientIdForFileScanning() const {
|
||||
return std::string(chrome::kApplicationClientIDStringForAVScanning);
|
||||
}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
DownloadProtectionService*
|
||||
ChromeDownloadManagerDelegate::GetDownloadProtectionService() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
-#if defined(FULL_SAFE_BROWSING)
|
||||
safe_browsing::SafeBrowsingService* sb_service =
|
||||
g_browser_process->safe_browsing_service();
|
||||
if (sb_service && sb_service->download_protection_service() &&
|
||||
profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) {
|
||||
return sb_service->download_protection_service();
|
||||
}
|
||||
-#endif
|
||||
return NULL;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void ChromeDownloadManagerDelegate::NotifyExtensions(
|
||||
DownloadItem* download,
|
||||
@@ -1222,13 +1228,17 @@ void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
|
||||
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
|
||||
#endif
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
DownloadItemModel(item).SetDangerLevel(target_info->danger_level);
|
||||
+#endif
|
||||
}
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
if (ShouldBlockFile(target_info->danger_type, item)) {
|
||||
target_info->result = download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
|
||||
// A dangerous type would take precendence over the blocking of the file.
|
||||
target_info->danger_type = download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
|
||||
}
|
||||
+#endif
|
||||
|
||||
callback.Run(target_info->target_path, target_info->target_disposition,
|
||||
target_info->danger_type, target_info->intermediate_path,
|
||||
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h
|
||||
--- a/chrome/browser/download/chrome_download_manager_delegate.h
|
||||
+++ b/chrome/browser/download/chrome_download_manager_delegate.h
|
||||
@@ -21,8 +21,10 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/download/download_target_determiner_delegate.h"
|
||||
#include "chrome/browser/download/download_target_info.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
|
||||
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_danger_type.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/download/public/common/download_path_reservation_tracker.h"
|
||||
@@ -134,8 +136,10 @@ class ChromeDownloadManagerDelegate
|
||||
DownloadPrefs* download_prefs() { return download_prefs_.get(); }
|
||||
|
||||
protected:
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
virtual safe_browsing::DownloadProtectionService*
|
||||
GetDownloadProtectionService();
|
||||
+#endif
|
||||
|
||||
// Show file picker for |download|.
|
||||
virtual void ShowFilePickerForDownload(
|
||||
@@ -201,9 +205,11 @@ class ChromeDownloadManagerDelegate
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// Callback function after the DownloadProtectionService completes.
|
||||
void CheckClientDownloadDone(uint32_t download_id,
|
||||
safe_browsing::DownloadCheckResult result);
|
||||
+#endif
|
||||
|
||||
// Internal gateways for ShouldCompleteDownload().
|
||||
bool IsDownloadReadyForCompletion(
|
||||
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
|
||||
--- a/chrome/browser/download/download_item_model.cc
|
||||
+++ b/chrome/browser/download/download_item_model.cc
|
||||
@@ -22,9 +22,11 @@
|
||||
#include "chrome/browser/download/download_stats.h"
|
||||
#include "chrome/browser/download/offline_item_utils.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/browser/safe_browsing/download_protection/download_feedback_service.h"
|
||||
#include "chrome/common/safe_browsing/download_file_types.pb.h"
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
#include "chrome/grit/chromium_strings.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/download/public/common/download_danger_type.h"
|
||||
@@ -37,7 +39,9 @@
|
||||
|
||||
using base::TimeDelta;
|
||||
using download::DownloadItem;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
using safe_browsing::DownloadFileType;
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -67,9 +71,11 @@ class DownloadItemModelData : public base::SupportsUserData::Data {
|
||||
// for the file type.
|
||||
bool should_prefer_opening_in_browser_;
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// Danger level of the file determined based on the file type and whether
|
||||
// there was a user action associated with the download.
|
||||
DownloadFileType::DangerLevel danger_level_;
|
||||
+#endif
|
||||
|
||||
// Whether the download is currently being revived.
|
||||
bool is_being_revived_;
|
||||
@@ -106,7 +112,9 @@ DownloadItemModelData::DownloadItemModelData()
|
||||
: should_show_in_shelf_(true),
|
||||
was_ui_notified_(false),
|
||||
should_prefer_opening_in_browser_(false),
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
danger_level_(DownloadFileType::NOT_DANGEROUS),
|
||||
+#endif
|
||||
is_being_revived_(false) {}
|
||||
|
||||
} // namespace
|
||||
@@ -368,6 +376,7 @@ void DownloadItemModel::SetShouldPreferOpeningInBrowser(bool preference) {
|
||||
data->should_prefer_opening_in_browser_ = preference;
|
||||
}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const {
|
||||
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
|
||||
return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS;
|
||||
@@ -378,6 +387,7 @@ void DownloadItemModel::SetDangerLevel(
|
||||
DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_);
|
||||
data->danger_level_ = danger_level;
|
||||
}
|
||||
+#endif
|
||||
|
||||
bool DownloadItemModel::IsBeingRevived() const {
|
||||
const DownloadItemModelData* data = DownloadItemModelData::Get(download_);
|
||||
diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h
|
||||
--- a/chrome/browser/download/download_item_model.h
|
||||
+++ b/chrome/browser/download/download_item_model.h
|
||||
@@ -11,7 +11,9 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "chrome/browser/download/download_ui_model.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/download_file_types.pb.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_item.h"
|
||||
|
||||
// Implementation of DownloadUIModel that wrappers around a |DownloadItem*|. As
|
||||
@@ -48,9 +50,11 @@ class DownloadItemModel : public DownloadUIModel,
|
||||
void SetWasUINotified(bool should_notify) override;
|
||||
bool ShouldPreferOpeningInBrowser() const override;
|
||||
void SetShouldPreferOpeningInBrowser(bool preference) override;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel() const override;
|
||||
void SetDangerLevel(
|
||||
safe_browsing::DownloadFileType::DangerLevel danger_level) override;
|
||||
+#endif
|
||||
void OpenUsingPlatformHandler() override;
|
||||
bool IsBeingRevived() const override;
|
||||
void SetIsBeingRevived(bool is_being_revived) override;
|
||||
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
|
||||
--- a/chrome/browser/download/download_prefs.cc
|
||||
+++ b/chrome/browser/download/download_prefs.cc
|
||||
@@ -33,7 +33,9 @@
|
||||
#include "chrome/common/chrome_features.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -55,7 +57,9 @@
|
||||
using content::BrowserContext;
|
||||
using content::BrowserThread;
|
||||
using content::DownloadManager;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
using safe_browsing::FileTypePolicies;
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
|
||||
--- a/chrome/browser/download/download_target_determiner.cc
|
||||
+++ b/chrome/browser/download/download_target_determiner.cc
|
||||
@@ -23,7 +23,9 @@
|
||||
#include "chrome/browser/history/history_service_factory.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/download/public/common/download_interrupt_reasons.h"
|
||||
#include "components/history/core/browser/history_service.h"
|
||||
@@ -59,13 +61,16 @@
|
||||
using content::BrowserThread;
|
||||
using download::DownloadItem;
|
||||
using download::DownloadPathReservationTracker;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
using safe_browsing::DownloadFileType;
|
||||
+#endif
|
||||
|
||||
namespace {
|
||||
|
||||
const base::FilePath::CharType kCrdownloadSuffix[] =
|
||||
FILE_PATH_LITERAL(".crdownload");
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// Condenses the results from HistoryService::GetVisibleVisitCountToHost() to a
|
||||
// single bool. A host is considered visited before if prior visible visits were
|
||||
// found in history and the first such visit was earlier than the most recent
|
||||
@@ -79,6 +84,7 @@ void VisitCountsToVisitedBefore(
|
||||
found_visits && count > 0 &&
|
||||
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
|
||||
}
|
||||
+#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Keeps track of whether Adobe Reader is up to date.
|
||||
@@ -103,7 +109,9 @@ DownloadTargetDeterminer::DownloadTargetDeterminer(
|
||||
create_target_directory_(false),
|
||||
conflict_action_(conflict_action),
|
||||
danger_type_(download->GetDangerType()),
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
danger_level_(DownloadFileType::NOT_DANGEROUS),
|
||||
+#endif
|
||||
virtual_path_(initial_virtual_path),
|
||||
is_filetype_handled_safely_(false),
|
||||
#if defined(OS_ANDROID)
|
||||
@@ -259,8 +267,12 @@ DownloadTargetDeterminer::Result
|
||||
// |suggested_filename| and Content-Disposition header have higher priority
|
||||
// than the URL.
|
||||
bool safe_file_ext =
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
!safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile(
|
||||
generated_filename);
|
||||
+#else
|
||||
+ true;
|
||||
+#endif
|
||||
net::HttpContentDisposition content_disposition_header(
|
||||
download_->GetContentDisposition(), referrer_charset);
|
||||
bool should_replace_extension =
|
||||
@@ -749,6 +761,7 @@ DownloadTargetDeterminer::Result
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// First determine the danger level assuming that the user doesn't have any
|
||||
// prior visits to the referrer recoreded in history. The resulting danger
|
||||
// level would be ALLOW_ON_USER_GESTURE if the level depends on the visit
|
||||
@@ -785,6 +798,7 @@ DownloadTargetDeterminer::Result
|
||||
// invalid, then assume the referrer has not been visited before.
|
||||
if (danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
|
||||
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
|
||||
+#endif
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
@@ -792,11 +806,13 @@ void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
|
||||
bool visited_referrer_before) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
danger_level_ = GetDangerLevel(
|
||||
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
|
||||
if (danger_level_ != DownloadFileType::NOT_DANGEROUS &&
|
||||
danger_type_ == download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
|
||||
danger_type_ = download::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
|
||||
+#endif
|
||||
DoLoop();
|
||||
}
|
||||
|
||||
@@ -901,7 +917,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
|
||||
<< " Intermediate:" << intermediate_path_.AsUTF8Unsafe()
|
||||
<< " Confirmation reason:" << static_cast<int>(confirmation_reason_)
|
||||
<< " Danger type:" << danger_type_
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
<< " Danger level:" << danger_level_
|
||||
+#endif
|
||||
<< " Result:" << static_cast<int>(result);
|
||||
std::unique_ptr<DownloadTargetInfo> target_info(new DownloadTargetInfo);
|
||||
|
||||
@@ -913,7 +931,9 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
|
||||
? DownloadItem::TARGET_DISPOSITION_PROMPT
|
||||
: DownloadItem::TARGET_DISPOSITION_OVERWRITE);
|
||||
target_info->danger_type = danger_type_;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
target_info->danger_level = danger_level_;
|
||||
+#endif
|
||||
target_info->intermediate_path = intermediate_path_;
|
||||
target_info->mime_type = mime_type_;
|
||||
target_info->is_filetype_handled_safely = is_filetype_handled_safely_;
|
||||
@@ -999,6 +1019,7 @@ bool DownloadTargetDeterminer::HasPromptedForPath() const {
|
||||
DownloadItem::TARGET_DISPOSITION_PROMPT);
|
||||
}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
|
||||
PriorVisitsToReferrer visits) const {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
@@ -1030,6 +1051,7 @@ DownloadFileType::DangerLevel DownloadTargetDeterminer::GetDangerLevel(
|
||||
|
||||
return DownloadFileType::NOT_DANGEROUS;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void DownloadTargetDeterminer::OnDownloadDestroyed(
|
||||
DownloadItem* download) {
|
||||
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h
|
||||
--- a/chrome/browser/download/download_target_determiner.h
|
||||
+++ b/chrome/browser/download/download_target_determiner.h
|
||||
@@ -16,7 +16,9 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/download/download_target_determiner_delegate.h"
|
||||
#include "chrome/browser/download/download_target_info.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/download_file_types.pb.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_danger_type.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/download/public/common/download_path_reservation_tracker.h"
|
||||
@@ -300,6 +302,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
|
||||
// operation.
|
||||
bool HasPromptedForPath() const;
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// Returns true if this download should show the "dangerous file" warning.
|
||||
// Various factors are considered, such as the type of the file, whether a
|
||||
// user action initiated the download, and whether the user has explicitly
|
||||
@@ -309,6 +312,7 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
|
||||
// to true if the download requires explicit user consent.
|
||||
safe_browsing::DownloadFileType::DangerLevel GetDangerLevel(
|
||||
PriorVisitsToReferrer visits) const;
|
||||
+#endif
|
||||
|
||||
// download::DownloadItem::Observer
|
||||
void OnDownloadDestroyed(download::DownloadItem* download) override;
|
||||
@@ -321,7 +325,9 @@ class DownloadTargetDeterminer : public download::DownloadItem::Observer {
|
||||
download::DownloadPathReservationTracker::FilenameConflictAction
|
||||
conflict_action_;
|
||||
download::DownloadDangerType danger_type_;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
safe_browsing::DownloadFileType::DangerLevel danger_level_;
|
||||
+#endif
|
||||
base::FilePath virtual_path_;
|
||||
base::FilePath local_path_;
|
||||
base::FilePath intermediate_path_;
|
||||
diff --git a/chrome/browser/download/download_target_info.cc b/chrome/browser/download/download_target_info.cc
|
||||
--- a/chrome/browser/download/download_target_info.cc
|
||||
+++ b/chrome/browser/download/download_target_info.cc
|
||||
@@ -4,12 +4,16 @@
|
||||
|
||||
#include "chrome/browser/download/download_target_info.h"
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/file_type_policies.h"
|
||||
+#endif
|
||||
|
||||
DownloadTargetInfo::DownloadTargetInfo()
|
||||
: target_disposition(download::DownloadItem::TARGET_DISPOSITION_OVERWRITE),
|
||||
danger_type(download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
danger_level(safe_browsing::DownloadFileType::NOT_DANGEROUS),
|
||||
+#endif
|
||||
is_filetype_handled_safely(false),
|
||||
result(download::DOWNLOAD_INTERRUPT_REASON_NONE) {}
|
||||
|
||||
diff --git a/chrome/browser/download/download_target_info.h b/chrome/browser/download/download_target_info.h
|
||||
--- a/chrome/browser/download/download_target_info.h
|
||||
+++ b/chrome/browser/download/download_target_info.h
|
||||
@@ -8,7 +8,9 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/download_file_types.pb.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_danger_type.h"
|
||||
#include "components/download/public/common/download_interrupt_reasons.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
@@ -32,6 +34,7 @@ struct DownloadTargetInfo {
|
||||
// Danger type of the download.
|
||||
download::DownloadDangerType danger_type;
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// The danger type of the download could be set to MAYBE_DANGEROUS_CONTENT if
|
||||
// the file type is handled by SafeBrowsing. However, if the SafeBrowsing
|
||||
// service is unable to verify whether the file is safe or not, we are on our
|
||||
@@ -57,6 +60,7 @@ struct DownloadTargetInfo {
|
||||
// SafeBrowsing may flag the file as being malicious, in which case the
|
||||
// malicious classification should take precedence.
|
||||
safe_browsing::DownloadFileType::DangerLevel danger_level;
|
||||
+#endif
|
||||
|
||||
// Suggested intermediate path. The downloaded bytes should be written to this
|
||||
// path until all the bytes are available and the user has accepted a
|
||||
diff --git a/chrome/browser/download/download_ui_model.cc b/chrome/browser/download/download_ui_model.cc
|
||||
--- a/chrome/browser/download/download_ui_model.cc
|
||||
+++ b/chrome/browser/download/download_ui_model.cc
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
using base::TimeDelta;
|
||||
using download::DownloadItem;
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
using safe_browsing::DownloadFileType;
|
||||
+#endif
|
||||
using offline_items_collection::FailState;
|
||||
|
||||
namespace {
|
||||
@@ -368,12 +370,14 @@ bool DownloadUIModel::ShouldPreferOpeningInBrowser() const {
|
||||
|
||||
void DownloadUIModel::SetShouldPreferOpeningInBrowser(bool preference) {}
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
DownloadFileType::DangerLevel DownloadUIModel::GetDangerLevel() const {
|
||||
return DownloadFileType::NOT_DANGEROUS;
|
||||
}
|
||||
|
||||
void DownloadUIModel::SetDangerLevel(
|
||||
DownloadFileType::DangerLevel danger_level) {}
|
||||
+#endif
|
||||
|
||||
void DownloadUIModel::OpenUsingPlatformHandler() {}
|
||||
|
||||
diff --git a/chrome/browser/download/download_ui_model.h b/chrome/browser/download/download_ui_model.h
|
||||
--- a/chrome/browser/download/download_ui_model.h
|
||||
+++ b/chrome/browser/download/download_ui_model.h
|
||||
@@ -14,7 +14,9 @@
|
||||
#include "base/strings/string16.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/profiles/profile_manager.h"
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
#include "chrome/common/safe_browsing/download_file_types.pb.h"
|
||||
+#endif
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/offline_items_collection/core/offline_item.h"
|
||||
|
||||
@@ -172,6 +174,7 @@ class DownloadUIModel {
|
||||
// Change what's returned by ShouldPreferOpeningInBrowser to |preference|.
|
||||
virtual void SetShouldPreferOpeningInBrowser(bool preference);
|
||||
|
||||
+#if defined(FULL_SAFE_BROWSING)
|
||||
// Return the danger level determined during download target determination.
|
||||
// The value returned here is independent of the danger level as determined by
|
||||
// the Safe Browsing.
|
||||
@@ -180,6 +183,7 @@ class DownloadUIModel {
|
||||
// Change what's returned by GetDangerLevel().
|
||||
virtual void SetDangerLevel(
|
||||
safe_browsing::DownloadFileType::DangerLevel danger_level);
|
||||
+#endif
|
||||
|
||||
// Open the download using the platform handler for the download. The behavior
|
||||
// of this method will be different from DownloadItem::OpenDownload() if
|
||||
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
||||
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
||||
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
||||
@@ -399,7 +399,9 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
|
||||
content::ResourceContext* resource_context,
|
||||
ResourceType resource_type,
|
||||
std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) {
|
||||
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
|
||||
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
|
||||
+#endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
|
||||
|
||||
// Insert safe browsing to decide if the resource is safe.
|
||||
content::ResourceThrottle* first_throttle = NULL;
|
||||
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
|
||||
--- a/chrome/browser/net/chrome_network_delegate.cc
|
||||
+++ b/chrome/browser/net/chrome_network_delegate.cc
|
||||
@@ -78,19 +78,6 @@ namespace {
|
||||
|
||||
bool g_access_to_all_files_enabled = false;
|
||||
|
||||
-// Gets called when the extensions finish work on the URL. If the extensions
|
||||
-// did not do a redirect (so |new_url| is empty) then we enforce the
|
||||
-// SafeSearch parameters. Otherwise we will get called again after the
|
||||
-// redirect and we enforce SafeSearch then.
|
||||
-void ForceGoogleSafeSearchCallbackWrapper(net::CompletionOnceCallback callback,
|
||||
- net::URLRequest* request,
|
||||
- GURL* new_url,
|
||||
- int rv) {
|
||||
- if (rv == net::OK && new_url->is_empty())
|
||||
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
|
||||
- std::move(callback).Run(rv);
|
||||
-}
|
||||
-
|
||||
bool IsAccessAllowedInternal(const base::FilePath& path,
|
||||
const base::FilePath& profile_path) {
|
||||
if (g_access_to_all_files_enabled)
|
||||
@@ -212,26 +199,8 @@ int ChromeNetworkDelegate::OnBeforeURLRequest(
|
||||
GURL* new_url) {
|
||||
extensions_delegate_->ForwardStartRequestStatus(request);
|
||||
|
||||
- // The non-redirect case is handled in GoogleURLLoaderThrottle.
|
||||
- bool force_safe_search =
|
||||
- (force_google_safe_search_ && force_google_safe_search_->GetValue() &&
|
||||
- request->is_redirecting());
|
||||
-
|
||||
- net::CompletionOnceCallback wrapped_callback = std::move(callback);
|
||||
-
|
||||
- if (force_safe_search) {
|
||||
- wrapped_callback = base::BindOnce(
|
||||
- &ForceGoogleSafeSearchCallbackWrapper, std::move(wrapped_callback),
|
||||
- base::Unretained(request), base::Unretained(new_url));
|
||||
- }
|
||||
-
|
||||
- int rv = extensions_delegate_->NotifyBeforeURLRequest(
|
||||
- request, std::move(wrapped_callback), new_url);
|
||||
-
|
||||
- if (force_safe_search && rv == net::OK && new_url->is_empty())
|
||||
- safe_search_util::ForceGoogleSafeSearch(request->url(), new_url);
|
||||
-
|
||||
- return rv;
|
||||
+ return extensions_delegate_->NotifyBeforeURLRequest(
|
||||
+ request, std::move(callback), new_url);
|
||||
}
|
||||
|
||||
int ChromeNetworkDelegate::OnBeforeStartTransaction(
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 2 Nov 2017 18:21:16 +0200
|
||||
Subject: Allow playing audio in background
|
||||
|
||||
---
|
||||
media/blink/webmediaplayer_impl.cc | 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
|
||||
@@ -948,6 +948,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());
|
||||
@@ -3113,7 +3119,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(this)) {
|
||||
- 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
|
||||
@@ -141,6 +141,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,24 +0,0 @@
|
||||
From: xsmile <xsmile@users.noreply.github.com>
|
||||
Date: Thu, 11 Oct 2018 21:29:35 +0200
|
||||
Subject: Allow website sign-in without account sign-in
|
||||
|
||||
Disable prefs::kSigninAllowedOnNextStartup by default. The setting can be found in chrome://settings
|
||||
---
|
||||
chrome/browser/signin/account_consistency_mode_manager.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
@@ -126,7 +126,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
|
||||
registry->RegisterBooleanPref(prefs::kAccountConsistencyMirrorRequired,
|
||||
false);
|
||||
#endif
|
||||
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
From: samartnik <artem@brave.com>
|
||||
Date: Thu, 14 Dec 2017 16:19:50 +0200
|
||||
Subject: Always allow partner customisation
|
||||
|
||||
---
|
||||
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
@@ -244,14 +244,14 @@ public class PartnerBrowserCustomizations {
|
||||
@Override
|
||||
protected Void doInBackground() {
|
||||
try {
|
||||
- boolean systemOrPreStable =
|
||||
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
- || !ChromeVersionInfo.isStableBuild();
|
||||
- if (!systemOrPreStable) {
|
||||
- // Only allow partner customization if this browser is a system package, or
|
||||
- // is in pre-stable channels.
|
||||
- return null;
|
||||
- }
|
||||
+ //boolean systemOrPreStable =
|
||||
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
+ // || !ChromeVersionInfo.isStableBuild();
|
||||
+ //if (!systemOrPreStable) {
|
||||
+ // // Only allow partner customization if this browser is a system package, or
|
||||
+ // // is in pre-stable channels.
|
||||
+ // return null;
|
||||
+ //}
|
||||
|
||||
if (isCancelled()) return null;
|
||||
refreshIncognitoModeDisabled();
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 5 Jun 2018 13:46:40 +0200
|
||||
Subject: Always respect async dns flag (regardless of SDK version)
|
||||
|
||||
Do not read experiment value for cronet async DNS configuration
|
||||
---
|
||||
chrome/browser/net/system_network_context_manager.cc | 2 +-
|
||||
components/cronet/url_request_context_config.cc | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
|
||||
--- a/chrome/browser/net/system_network_context_manager.cc
|
||||
+++ b/chrome/browser/net/system_network_context_manager.cc
|
||||
@@ -226,7 +226,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
|
||||
@@ -544,7 +544,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
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 17 Mar 2019 20:51:11 +0100
|
||||
Subject: Always show home page settings
|
||||
|
||||
Remove the "Force Enable Home Page Button" flag, which was bugged, and always
|
||||
display home page settings.
|
||||
This allows removing the home page button and restoring it from settings.
|
||||
---
|
||||
.../browser/init/ProcessInitializationHandler.java | 12 --------
|
||||
.../partnercustomizations/HomepageManager.java | 17 ++---------
|
||||
.../preferences/ChromePreferenceManager.java | 7 -----
|
||||
.../browser/preferences/MainPreferences.java | 12 +++-----
|
||||
.../chrome/browser/util/FeatureUtilities.java | 34 ----------------------
|
||||
chrome/browser/about_flags.cc | 3 --
|
||||
chrome/browser/android/chrome_feature_list.cc | 4 ---
|
||||
chrome/browser/android/chrome_feature_list.h | 1 -
|
||||
8 files changed, 7 insertions(+), 83 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
|
||||
@@ -338,18 +338,6 @@ public class ProcessInitializationHandler {
|
||||
deferredStartupHandler.addDeferredTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
- if (HomepageManager.shouldShowHomepageSetting()) {
|
||||
- RecordHistogram.recordBooleanHistogram("Settings.ShowHomeButtonPreferenceState",
|
||||
- HomepageManager.isHomepageEnabled());
|
||||
- RecordHistogram.recordBooleanHistogram("Settings.HomePageIsCustomized",
|
||||
- !HomepageManager.getInstance().getPrefHomepageUseDefaultUri());
|
||||
- }
|
||||
- }
|
||||
- });
|
||||
-
|
||||
- deferredStartupHandler.addDeferredTask(new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
// Starts syncing with GSA.
|
||||
AppHooks.get().createGsaHelper().startSync();
|
||||
}
|
||||
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
|
||||
@@ -83,10 +83,7 @@ public class HomepageManager {
|
||||
* @return Whether or not homepage is enabled.
|
||||
*/
|
||||
public static boolean isHomepageEnabled() {
|
||||
- if (FeatureUtilities.isHomePageButtonForceEnabled()) {
|
||||
- return getInstance().getPrefHomepageEnabled();
|
||||
- }
|
||||
- return false;
|
||||
+ return getInstance().getPrefHomepageEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,13 +95,6 @@ public class HomepageManager {
|
||||
}
|
||||
|
||||
/**
|
||||
- * @return Whether or not homepage setting should be shown.
|
||||
- */
|
||||
- public static boolean shouldShowHomepageSetting() {
|
||||
- return FeatureUtilities.isHomePageButtonForceEnabled();
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* @return Homepage URI string, if it's enabled. Null otherwise or uninitialized.
|
||||
*/
|
||||
public static String getHomepageUri() {
|
||||
@@ -118,8 +108,7 @@ public class HomepageManager {
|
||||
}
|
||||
|
||||
/**
|
||||
- * @return The default homepage URI if the homepage is partner provided or the new tab page
|
||||
- * if the homepage button is force enabled via flag.
|
||||
+ * @return The default homepage URI.
|
||||
*/
|
||||
public static String getDefaultHomepageUri() {
|
||||
return UrlConstants.NTP_NON_NATIVE_URL;
|
||||
@@ -132,7 +121,7 @@ public class HomepageManager {
|
||||
* @see #isHomepageEnabled
|
||||
*/
|
||||
public boolean getPrefHomepageEnabled() {
|
||||
- return mSharedPreferences.getBoolean(PREF_HOMEPAGE_ENABLED, true);
|
||||
+ return mSharedPreferences.getBoolean(PREF_HOMEPAGE_ENABLED, false);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
|
||||
@@ -147,13 +147,6 @@ public class ChromePreferenceManager {
|
||||
private static final String CHROME_MODERN_DESIGN_ENABLED_KEY = "chrome_modern_design_enabled";
|
||||
|
||||
/**
|
||||
- * Whether or not the home page button is force enabled.
|
||||
- * Default value is false.
|
||||
- */
|
||||
- public static final String HOME_PAGE_BUTTON_FORCE_ENABLED_KEY =
|
||||
- "home_page_button_force_enabled";
|
||||
-
|
||||
- /**
|
||||
* Whether or not the homepage tile will be shown.
|
||||
* Default value is false.
|
||||
*/
|
||||
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
|
||||
@@ -207,15 +207,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
updateSyncAndServicesPreference();
|
||||
updateSearchEnginePreference();
|
||||
|
||||
- if (HomepageManager.shouldShowHomepageSetting()) {
|
||||
- Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
|
||||
- if (FeatureUtilities.isNewTabPageButtonEnabled()) {
|
||||
- homepagePref.setTitle(R.string.options_startup_page_title);
|
||||
- }
|
||||
- setOnOffSummary(homepagePref, HomepageManager.getInstance().getPrefHomepageEnabled());
|
||||
- } else {
|
||||
- removePreferenceIfPresent(PREF_HOMEPAGE);
|
||||
+ Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
|
||||
+ if (FeatureUtilities.isNewTabPageButtonEnabled()) {
|
||||
+ homepagePref.setTitle(R.string.options_startup_page_title);
|
||||
}
|
||||
+ setOnOffSummary(homepagePref, HomepageManager.getInstance().getPrefHomepageEnabled());
|
||||
|
||||
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)
|
||||
&& FeatureUtilities.areContextualSuggestionsEnabled(getActivity())
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
|
||||
@@ -73,7 +73,6 @@ public class FeatureUtilities {
|
||||
private static Boolean sHasRecognitionIntentHandler;
|
||||
|
||||
private static Boolean sIsSoleEnabled;
|
||||
- private static Boolean sIsHomePageButtonForceEnabled;
|
||||
private static Boolean sIsHomepageTileEnabled;
|
||||
private static Boolean sIsNewTabPageButtonEnabled;
|
||||
private static Boolean sIsBottomToolbarEnabled;
|
||||
@@ -194,7 +193,6 @@ public class FeatureUtilities {
|
||||
cacheSoleEnabled();
|
||||
cacheCommandLineOnNonRootedEnabled();
|
||||
FirstRunUtils.cacheFirstRunPrefs();
|
||||
- cacheHomePageButtonForceEnabled();
|
||||
cacheHomepageTileEnabled();
|
||||
cacheNewTabPageButtonEnabled();
|
||||
cacheBottomToolbarEnabled();
|
||||
@@ -229,38 +227,6 @@ public class FeatureUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Cache whether or not the home page button is force enabled so on next startup, the value can
|
||||
- * be made available immediately.
|
||||
- */
|
||||
- public static void cacheHomePageButtonForceEnabled() {
|
||||
- if (PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()) return;
|
||||
- ChromePreferenceManager.getInstance().writeBoolean(
|
||||
- ChromePreferenceManager.HOME_PAGE_BUTTON_FORCE_ENABLED_KEY,
|
||||
- ChromeFeatureList.isEnabled(ChromeFeatureList.HOME_PAGE_BUTTON_FORCE_ENABLED));
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * @return Whether or not the home page button is force enabled.
|
||||
- */
|
||||
- public static boolean isHomePageButtonForceEnabled() {
|
||||
- if (sIsHomePageButtonForceEnabled == null) {
|
||||
- ChromePreferenceManager prefManager = ChromePreferenceManager.getInstance();
|
||||
-
|
||||
- sIsHomePageButtonForceEnabled = prefManager.readBoolean(
|
||||
- ChromePreferenceManager.HOME_PAGE_BUTTON_FORCE_ENABLED_KEY, false);
|
||||
- }
|
||||
- return sIsHomePageButtonForceEnabled;
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Resets whether the home page button is enabled for tests. After this is called, the next
|
||||
- * call to #isHomePageButtonForceEnabled() will retrieve the value from shared preferences.
|
||||
- */
|
||||
- public static void resetHomePageButtonForceEnabledForTests() {
|
||||
- sIsHomePageButtonForceEnabled = null;
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Cache whether or not the toolbar should be inflated on a background thread so on next
|
||||
* startup, the value can be made available immediately.
|
||||
*/
|
||||
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
|
||||
@@ -1710,9 +1710,6 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-chrome-duet", flag_descriptions::kChromeDuetName,
|
||||
flag_descriptions::kChromeDuetDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kChromeDuetFeature)},
|
||||
- {"force-enable-home-page-button", flag_descriptions::kHomePageButtonName,
|
||||
- flag_descriptions::kHomePageButtonDescription, kOsAndroid,
|
||||
- FEATURE_VALUE_TYPE(chrome::android::kHomePageButtonForceEnabled)},
|
||||
{"enable-ntp-button", flag_descriptions::kNtpButtonName,
|
||||
flag_descriptions::kNtpButtonDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kNTPButton)},
|
||||
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/android/chrome_feature_list.cc
|
||||
@@ -133,7 +133,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
|
||||
&kExploreSites,
|
||||
&kHandleMediaIntents,
|
||||
&kHideUserDataFromIncognitoNotifications,
|
||||
- &kHomePageButtonForceEnabled,
|
||||
&kHomepageTile,
|
||||
&kHorizontalTabSwitcherAndroid,
|
||||
&kImprovedA2HS,
|
||||
@@ -377,9 +376,6 @@ const base::Feature kHandleMediaIntents{"HandleMediaIntents",
|
||||
const base::Feature kHideUserDataFromIncognitoNotifications{
|
||||
"HideUserDataFromIncognitoNotifications", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
-const base::Feature kHomePageButtonForceEnabled{
|
||||
- "HomePageButtonForceEnabled", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
-
|
||||
const base::Feature kHomepageTile{"HomepageTile",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h
|
||||
--- a/chrome/browser/android/chrome_feature_list.h
|
||||
+++ b/chrome/browser/android/chrome_feature_list.h
|
||||
@@ -63,7 +63,6 @@ extern const base::Feature kExploreSites;
|
||||
extern const base::Feature kForegroundNotificationManager;
|
||||
extern const base::Feature kHandleMediaIntents;
|
||||
extern const base::Feature kHideUserDataFromIncognitoNotifications;
|
||||
-extern const base::Feature kHomePageButtonForceEnabled;
|
||||
extern const base::Feature kHomepageTile;
|
||||
extern const base::Feature kHorizontalTabSwitcherAndroid;
|
||||
extern const base::Feature kImprovedA2HS;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 11:02:38 +0200
|
||||
Subject: Always use new tab page for default home page
|
||||
|
||||
Ignore any partner-provided home page.
|
||||
---
|
||||
.../chrome/browser/partnercustomizations/HomepageManager.java | 10 +++-------
|
||||
1 file changed, 3 insertions(+), 7 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
|
||||
@@ -83,8 +83,7 @@ public class HomepageManager {
|
||||
* @return Whether or not homepage is enabled.
|
||||
*/
|
||||
public static boolean isHomepageEnabled() {
|
||||
- if (PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
|
||||
- || FeatureUtilities.isHomePageButtonForceEnabled()) {
|
||||
+ if (FeatureUtilities.isHomePageButtonForceEnabled()) {
|
||||
return getInstance().getPrefHomepageEnabled();
|
||||
}
|
||||
return false;
|
||||
@@ -102,8 +101,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 +122,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
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 25 Mar 2018 21:49:37 +0200
|
||||
Subject: AudioBuffer, AnalyserNode: fingerprinting mitigations via IDL
|
||||
|
||||
Return fixed base latency
|
||||
---
|
||||
third_party/blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
|
||||
third_party/blink/renderer/modules/webaudio/audio_buffer.idl | 4 ++--
|
||||
third_party/blink/renderer/modules/webaudio/audio_context.cc | 1 +
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
@@ -42,10 +42,10 @@ interface AnalyserNode : AudioNode {
|
||||
|
||||
// Copies the current frequency data into the passed array.
|
||||
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
|
||||
- [HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
|
||||
// Real-time waveform data
|
||||
- [HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// Channel access
|
||||
readonly attribute unsigned long numberOfChannels;
|
||||
- [HighEntropy, Measure, RaisesException] Float32Array getChannelData(unsigned long channelIndex);
|
||||
- [HighEntropy, Measure, RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
+ //[HighEntropy, Measure, RaisesException] Float32Array getChannelData(unsigned long channelIndex);
|
||||
+ //[HighEntropy, Measure, RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
@@ -324,6 +324,7 @@ void AudioContext::StopRendering() {
|
||||
double AudioContext::baseLatency() const {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination());
|
||||
+ return 0.04;
|
||||
|
||||
// TODO(hongchan): Due to the incompatible constructor between
|
||||
// AudioDestinationNode and RealtimeAudioDestinationNode, casting directly
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 22 Mar 2018 22:11:57 +0100
|
||||
Subject: Battery API: return nothing
|
||||
|
||||
---
|
||||
.../renderer/modules/battery/battery_manager.cc | 25 ++++------------------
|
||||
1 file changed, 4 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
--- a/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
+++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
|
||||
@@ -44,45 +44,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
|
||||
}
|
||||
|
||||
bool BatteryManager::charging() {
|
||||
- return battery_status_.Charging();
|
||||
+ return false;
|
||||
}
|
||||
|
||||
double BatteryManager::chargingTime() {
|
||||
- return battery_status_.charging_time();
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
double BatteryManager::dischargingTime() {
|
||||
- return battery_status_.discharging_time();
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
double BatteryManager::level() {
|
||||
- return battery_status_.Level();
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
void BatteryManager::DidUpdateData() {
|
||||
DCHECK(battery_property_);
|
||||
|
||||
- BatteryStatus old_status = battery_status_;
|
||||
- battery_status_ = *BatteryDispatcher::Instance().LatestData();
|
||||
-
|
||||
if (battery_property_->GetState() == ScriptPromisePropertyBase::kPending) {
|
||||
battery_property_->Resolve(this);
|
||||
return;
|
||||
}
|
||||
-
|
||||
- Document* document = To<Document>(GetExecutionContext());
|
||||
- DCHECK(document);
|
||||
- if (document->IsContextPaused() || document->IsContextDestroyed())
|
||||
- return;
|
||||
-
|
||||
- if (battery_status_.Charging() != old_status.Charging())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kChargingchange));
|
||||
- if (battery_status_.charging_time() != old_status.charging_time())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kChargingtimechange));
|
||||
- if (battery_status_.discharging_time() != old_status.discharging_time())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange));
|
||||
- if (battery_status_.Level() != old_status.Level())
|
||||
- DispatchEvent(*Event::Create(event_type_names::kLevelchange));
|
||||
}
|
||||
|
||||
void BatteryManager::RegisterWithDispatcher() {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,876 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 23 Aug 2018 19:30:15 +0200
|
||||
Subject: Bromite adblock engine
|
||||
|
||||
Original adblock engine ported from NoChromo patch
|
||||
Make interception testable
|
||||
Add domain support
|
||||
Re-land: third-party filters support
|
||||
Add menu option to toggle global Adblock preference
|
||||
Allow toggling Chromium's "ads enabled" content settings option together with Bromite adblock engine.
|
||||
Perform adblock interception in StartJob to address lagging issues
|
||||
New mechanism for adblocking based on Brave's adblocking hook
|
||||
Add support for Webview content blocking
|
||||
---
|
||||
android_webview/browser/net/aw_network_delegate.cc | 68 ++++
|
||||
android_webview/browser/net/aw_network_delegate.h | 3 +
|
||||
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 | 389 +++++++++++++++++++++
|
||||
net/url_request/adblock_intercept.h | 35 ++
|
||||
14 files changed, 676 insertions(+)
|
||||
create mode 100644 net/url_request/adblock_intercept.cc
|
||||
create mode 100644 net/url_request/adblock_intercept.h
|
||||
|
||||
diff --git a/android_webview/browser/net/aw_network_delegate.cc b/android_webview/browser/net/aw_network_delegate.cc
|
||||
--- a/android_webview/browser/net/aw_network_delegate.cc
|
||||
+++ b/android_webview/browser/net/aw_network_delegate.cc
|
||||
@@ -20,9 +20,11 @@
|
||||
#include "net/base/proxy_server.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/proxy_resolution/proxy_info.h"
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
+using content::ResourceRequestInfo;
|
||||
|
||||
namespace android_webview {
|
||||
|
||||
@@ -49,6 +51,72 @@ AwNetworkDelegate::AwNetworkDelegate() {}
|
||||
AwNetworkDelegate::~AwNetworkDelegate() {
|
||||
}
|
||||
|
||||
+#define TRANSPARENT1PXGIF "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
||||
+#define EMPTYJS "data:text/javascript;base64,Cg=="
|
||||
+#define EMPTYCSS "data:text/css;base64,Cg=="
|
||||
+
|
||||
+static bool requestIntercepted(net::URLRequest* request, GURL* new_url) {
|
||||
+ 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;
|
||||
+ }
|
||||
+ }
|
||||
+ ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
|
||||
+
|
||||
+ // there are no per-site nor global ad/content settings when using the SystemWebView
|
||||
+ bool adblock_enabled = true;
|
||||
+ if (isValidUrl && info) {
|
||||
+ auto resource_type = info->GetResourceType();
|
||||
+
|
||||
+ if (adblock_enabled
|
||||
+ && content::RESOURCE_TYPE_MAIN_FRAME != resource_type
|
||||
+ && net::adblock_intercept(request->url(),
|
||||
+ request->initiator()->host(),
|
||||
+ resource_type)) {
|
||||
+ block = true;
|
||||
+ }
|
||||
+
|
||||
+ if (block) {
|
||||
+ switch (resource_type) {
|
||||
+ case content::RESOURCE_TYPE_IMAGE:
|
||||
+ case content::RESOURCE_TYPE_FAVICON:
|
||||
+ *new_url = GURL(TRANSPARENT1PXGIF);
|
||||
+ break;
|
||||
+ case content::RESOURCE_TYPE_SCRIPT:
|
||||
+ *new_url = GURL(EMPTYJS);
|
||||
+ break;
|
||||
+ case content::RESOURCE_TYPE_STYLESHEET:
|
||||
+ *new_url = GURL(EMPTYCSS);
|
||||
+ break;
|
||||
+ default:
|
||||
+ *new_url = GURL("");
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ } // valid URL and info
|
||||
+ return false;
|
||||
+}
|
||||
+#undef TRANSPARENT1PXGIF
|
||||
+#undef EMPTYJS
|
||||
+#undef EMPTYCSS
|
||||
+
|
||||
+int AwNetworkDelegate::OnBeforeURLRequest(net::URLRequest* request,
|
||||
+ net::CompletionOnceCallback callback,
|
||||
+ GURL* new_url) {
|
||||
+ if (request) {
|
||||
+ // most requests will be modified rather than intercepted
|
||||
+ if (requestIntercepted(request, new_url))
|
||||
+ return net::ERR_BLOCKED_BY_ADMINISTRATOR;
|
||||
+ } // request
|
||||
+
|
||||
+ return net::OK;
|
||||
+}
|
||||
+
|
||||
int AwNetworkDelegate::OnBeforeStartTransaction(
|
||||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
diff --git a/android_webview/browser/net/aw_network_delegate.h b/android_webview/browser/net/aw_network_delegate.h
|
||||
--- a/android_webview/browser/net/aw_network_delegate.h
|
||||
+++ b/android_webview/browser/net/aw_network_delegate.h
|
||||
@@ -22,6 +22,9 @@ class AwNetworkDelegate : public net::NetworkDelegateImpl {
|
||||
|
||||
private:
|
||||
// NetworkDelegate implementation.
|
||||
+ int OnBeforeURLRequest(net::URLRequest* request,
|
||||
+ net::CompletionOnceCallback callback,
|
||||
+ GURL* new_url) override;
|
||||
int OnBeforeStartTransaction(net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
net::HttpRequestHeaders* headers) override;
|
||||
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
|
||||
@@ -2229,6 +2229,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
|
||||
@@ -1815,6 +1815,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
|
||||
@@ -195,6 +195,8 @@ public class AppMenuPropertiesDelegate {
|
||||
&& !TextUtils.isEmpty(url);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
@@ -488,6 +490,42 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Updates the enable AdBlock item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable adblock
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateEnableAdBlockMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_adblock_row_menu_id);
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_adblock_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_adblock_check_id);
|
||||
+
|
||||
+
|
||||
+ // Hide enable adblock on all chrome:// pages except for the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+ // Also hide enable javascsript on Reader Mode.
|
||||
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
|
||||
+
|
||||
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean adBlockEnabled = !PrefServiceBridge.getInstance().isCategoryEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS);
|
||||
+
|
||||
+ // Mark the checkbox if adblock is globally activate.
|
||||
+ enableMenuCheck.setChecked(adBlockEnabled);
|
||||
+
|
||||
+ // This title doesn't seem to be displayed by Android, but it is used to set up
|
||||
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
|
||||
+ enableMenuLabel.setTitleCondensed(adBlockEnabled
|
||||
+ ? mActivity.getString(R.string.menu_enable_adblock_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_adblock_off));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* A notification that the header view has finished inflating.
|
||||
* @param view The view that was inflated.
|
||||
* @param appMenu The menu the view is inside of.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -181,6 +181,8 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
}
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -3080,6 +3080,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"
|
||||
@@ -59,6 +60,7 @@
|
||||
#if defined(OS_ANDROID)
|
||||
#include "base/android/path_utils.h"
|
||||
#include "chrome/browser/io_thread.h"
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -193,10 +195,91 @@ void ChromeNetworkDelegate::set_cookie_settings(
|
||||
cookie_settings_ = cookie_settings;
|
||||
}
|
||||
|
||||
+#define TRANSPARENT1PXGIF "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
||||
+#define EMPTYJS "data:text/javascript;base64,Cg=="
|
||||
+#define EMPTYCSS "data:text/css;base64,Cg=="
|
||||
+
|
||||
+static bool requestIntercepted(net::URLRequest* request, GURL* new_url) {
|
||||
+ 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;
|
||||
+ }
|
||||
+ }
|
||||
+ 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());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ auto resource_type = info->GetResourceType();
|
||||
+
|
||||
+ if (adblock_enabled
|
||||
+ && content::RESOURCE_TYPE_MAIN_FRAME != resource_type
|
||||
+ && net::adblock_intercept(request->url(),
|
||||
+ request->initiator()->host(),
|
||||
+ resource_type)) {
|
||||
+ block = true;
|
||||
+ }
|
||||
+
|
||||
+ if (block) {
|
||||
+ switch (resource_type) {
|
||||
+ case content::RESOURCE_TYPE_IMAGE:
|
||||
+ case content::RESOURCE_TYPE_FAVICON:
|
||||
+ *new_url = GURL(TRANSPARENT1PXGIF);
|
||||
+ break;
|
||||
+ case content::RESOURCE_TYPE_SCRIPT:
|
||||
+ *new_url = GURL(EMPTYJS);
|
||||
+ break;
|
||||
+ case content::RESOURCE_TYPE_STYLESHEET:
|
||||
+ *new_url = GURL(EMPTYCSS);
|
||||
+ break;
|
||||
+ default:
|
||||
+ *new_url = GURL("");
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ } // valid URL and info
|
||||
+ return false;
|
||||
+}
|
||||
+#undef TRANSPARENT1PXGIF
|
||||
+#undef EMPTYJS
|
||||
+#undef EMPTYCSS
|
||||
+
|
||||
int ChromeNetworkDelegate::OnBeforeURLRequest(
|
||||
net::URLRequest* request,
|
||||
net::CompletionOnceCallback callback,
|
||||
GURL* new_url) {
|
||||
+
|
||||
+#if defined(OS_ANDROID)
|
||||
+ if (request) {
|
||||
+ // most requests will be modified rather than intercepted
|
||||
+ if (requestIntercepted(request, new_url))
|
||||
+ return net::ERR_BLOCKED_BY_ADMINISTRATOR;
|
||||
+ } // request
|
||||
+#endif // OS_ANDROID
|
||||
+
|
||||
extensions_delegate_->ForwardStartRequestStatus(request);
|
||||
|
||||
return extensions_delegate_->NotifyBeforeURLRequest(
|
||||
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
|
||||
@@ -1794,6 +1794,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,389 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+#include "adblock_intercept.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(const char *l_host, int len, const char *l_url_host,
|
||||
+ int b_len) {
|
||||
+ 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
|
||||
+
|
||||
+ const 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;
|
||||
+ }
|
||||
+ const 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.
|
||||
+ 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, bool &should_free) {
|
||||
+ char *ret = NULL;
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ // first time a difference is found, allocate buffer and copy previous
|
||||
+ // characters (if any)
|
||||
+ if (ret == NULL) {
|
||||
+ ret = (char *)malloc(len + 1);
|
||||
+ if (i != 0)
|
||||
+ memcpy(ret, str, i);
|
||||
+ }
|
||||
+ // convert character to lower case
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ if (ret != NULL)
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (ret != NULL) {
|
||||
+ ret[len] = '\0';
|
||||
+ should_free = true;
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ // return source, unchanged
|
||||
+ return (char *)str;
|
||||
+}
|
||||
+
|
||||
+static char *strtosep(const char *str, int len) {
|
||||
+ char *ret = (char *)malloc(len + 3);
|
||||
+ ret[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];
|
||||
+ }
|
||||
+ }
|
||||
+ // the index 'len' character is set by the previous loop
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ 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 char *l_origin_host,
|
||||
+ int origin_host_len, const char *l_url_host,
|
||||
+ int url_host_len, 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_len == 0) {
|
||||
+ // cannot match this rule, no origin host to determine first/third party
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (!checked_fp) {
|
||||
+ // is the URL a first-party to the current page's host?
|
||||
+ fp = is_first_party(l_origin_host, origin_host_len, l_url_host,
|
||||
+ url_host_len);
|
||||
+
|
||||
+ checked_fp = true;
|
||||
+#ifdef ADB_TESTER
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "is_first_party(\"%s\", \"%s\") = %s", l_origin_host,
|
||||
+ l_url_host, fp ? "true" : "false");
|
||||
+#endif
|
||||
+ }
|
||||
+
|
||||
+ return fp == wanted_fp;
|
||||
+}
|
||||
+
|
||||
+static bool resource_type_match(adblock_entry *entry,
|
||||
+ content::ResourceType resource_type) {
|
||||
+ bool exclude;
|
||||
+ if ((entry->flags & ADBLOCK_FLAG_RESOURCE_TYPE_IN) != 0) {
|
||||
+ exclude = false;
|
||||
+ } else if ((entry->flags & ADBLOCK_FLAG_RESOURCE_TYPE_NOT_IN) != 0) {
|
||||
+ exclude = true;
|
||||
+ } else {
|
||||
+ // no resource type matching
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ // use a bitwise trick to test for the current resource type
|
||||
+ bool found = (entry->flags & (resource_type << 16));
|
||||
+ if (!exclude)
|
||||
+ return found;
|
||||
+ return !found;
|
||||
+}
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host,
|
||||
+ content::ResourceType resource_type) {
|
||||
+ // these are verified on caller when not testing
|
||||
+#ifdef ADB_TESTER
|
||||
+ if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ bool free1 = false, free2 = false, free3 = false, free4 = false;
|
||||
+ int url_len = url.spec().size();
|
||||
+ const char *c_url = url.spec().c_str();
|
||||
+ char *c_url_lower = strtolower(c_url, url_len, free1);
|
||||
+ char *c_url_sep = strtosep(c_url, url_len);
|
||||
+ char *c_url_lower_sep = strtolower(c_url_sep, url_len + 2, free4);
|
||||
+
|
||||
+ // might be empty in case of no host
|
||||
+ const char *origin_host_cstr = origin_host.c_str();
|
||||
+ int origin_host_len = origin_host.size(), url_host_len = url.host().size();
|
||||
+
|
||||
+ // lower-case version of origin and url hosts
|
||||
+ const char *c_origin_host_lower =
|
||||
+ strtolower(origin_host_cstr, origin_host_len, free2),
|
||||
+ *c_url_host_lower =
|
||||
+ strtolower(url.host().c_str(), url_host_len, free3);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
|
||||
+ c_url, url.host().c_str(), origin_host_cstr);
|
||||
+#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;
|
||||
+
|
||||
+ // check for resource type
|
||||
+ if (!resource_type_match(entry, resource_type))
|
||||
+ continue;
|
||||
+
|
||||
+ // check for domain matches, a quick branch out if not 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, c_origin_host_lower, origin_host_len,
|
||||
+ c_url_host_lower, url_host_len, 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
|
||||
+
|
||||
+ if (free3)
|
||||
+ free((void *)c_url_host_lower);
|
||||
+ if (free2)
|
||||
+ free((void *)c_origin_host_lower);
|
||||
+ free(c_url_sep);
|
||||
+ if (free1)
|
||||
+ free(c_url_lower);
|
||||
+ if (free4)
|
||||
+ 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,35 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite is free software: you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation, either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ Bromite is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+
|
||||
+#include "content/public/common/resource_type.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,
|
||||
+ content::ResourceType resource_type);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,293 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 24 Mar 2018 05:18:03 +0100
|
||||
Subject: Canvas: fingerprinting mitigations for image data and webGL
|
||||
|
||||
Disable webGL renderer info and modify the color data returned by ToBlob,
|
||||
ToDataURL and getImageData so that it will contain randomly manipulated
|
||||
pixels (maximum 20) that slightly change the color of the R,G,B components
|
||||
without a visible effect.
|
||||
|
||||
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
|
||||
approach to change color components.
|
||||
---
|
||||
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 4 +-
|
||||
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
|
||||
third_party/blink/renderer/platform/BUILD.gn | 4 +-
|
||||
.../platform/graphics/image_data_buffer.cc | 5 +
|
||||
.../platform/graphics/static_bitmap_image.cc | 156 +++++++++++++++++++++
|
||||
.../platform/graphics/static_bitmap_image.h | 2 +
|
||||
6 files changed, 169 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
@@ -33,8 +33,6 @@
|
||||
|
||||
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h"
|
||||
|
||||
-#include "base/rand_util.h"
|
||||
-
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
@@ -799,7 +797,7 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
GetState().GetTextAlign(), text);
|
||||
|
||||
// scale text metrics by 3/1000000th
|
||||
- auto shuffleFactor = 1 + (base::RandDouble() - 0.5) * 0.000003;
|
||||
+ auto shuffleFactor = 1 + (canvas()->GetDocument().GetShuffleFactorX() - 0.5) * 0.000003;
|
||||
textMetrics->Shuffle(shuffleFactor);
|
||||
|
||||
return textMetrics;
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {
|
||||
|
||||
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
|
||||
WebGLRenderingContextBase* context) {
|
||||
- return MakeGarbageCollected<WebGLDebugRendererInfo>(context);
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* WebGLDebugRendererInfo::ExtensionName() {
|
||||
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1423,7 +1423,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"
|
||||
@@ -127,6 +129,9 @@ bool ImageDataBuffer::EncodeImageInternal(const ImageEncodingMimeType mime_type,
|
||||
const SkPixmap& pixmap) const {
|
||||
DCHECK(is_valid_);
|
||||
|
||||
+ // shuffle subchannel color data within the pixmap
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(pixmap_.writable_addr(), pixmap_.info(), 0, 0);
|
||||
+
|
||||
if (mime_type == kMimeTypeJpeg) {
|
||||
SkJpegEncoder::Options options;
|
||||
options.fQuality = ImageEncoder::ComputeJpegQuality(quality);
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/logging.h"
|
||||
#include "base/numerics/checked_math.h"
|
||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
|
||||
@@ -15,6 +17,7 @@
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
+#include "third_party/skia/include/private/SkColorData.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrContext.h"
|
||||
|
||||
@@ -151,10 +154,163 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
|
||||
DCHECK(read_pixels_successful ||
|
||||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
|
||||
rect.X(), rect.Y(), info.width(), info.height())));
|
||||
+
|
||||
+ ShuffleSubchannelColorData(result.Data(), info, rect.X(), rect.Y());
|
||||
+
|
||||
result.Transfer(dest_contents);
|
||||
return true;
|
||||
}
|
||||
|
||||
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
|
||||
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
|
||||
+
|
||||
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
|
||||
+
|
||||
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
|
||||
+ auto w = info.width() - srcX, h = info.height() - srcY;
|
||||
+
|
||||
+ // skip tiny images; info.width()/height() can also be 0
|
||||
+ if ((w < 8) || (h < 8)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // generate the first random number here
|
||||
+ double shuffleX = base::RandDouble();
|
||||
+
|
||||
+ // cap maximum pixels to change
|
||||
+ auto pixels = (w + h) / 128;
|
||||
+ if (pixels > 20) {
|
||||
+ pixels = 20;
|
||||
+ } else if (pixels < 2) {
|
||||
+ pixels = 2;
|
||||
+ }
|
||||
+
|
||||
+ auto colorType = info.colorType();
|
||||
+ auto fRowBytes = info.minRowBytes(); // stride
|
||||
+
|
||||
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
|
||||
+
|
||||
+ // second random number (for y/height)
|
||||
+ double shuffleY = base::RandDouble();
|
||||
+
|
||||
+ // calculate random coordinates using bisection
|
||||
+ auto currentW = w, currentH = h;
|
||||
+ for(;pixels >= 0; pixels--) {
|
||||
+ int x = currentW * shuffleX, y = currentH * shuffleY;
|
||||
+
|
||||
+ // calculate randomisation amounts for each RGB component
|
||||
+ uint8_t shuffleR = base::RandInt(0, 4);
|
||||
+ uint8_t shuffleG = (shuffleR + x) % 4;
|
||||
+ uint8_t shuffleB = (shuffleG + y) % 4;
|
||||
+
|
||||
+ // manipulate pixel data to slightly change the R, G, B components
|
||||
+ switch (colorType) {
|
||||
+ case kAlpha_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ auto r = SkColorGetR(*pixel), g = SkColorGetG(*pixel), b = SkColorGetB(*pixel), a = SkColorGetA(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = SkColorSetARGB(a, r, g, b);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kGray_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ *pixel = shuffleComponent(*pixel, UINT8_MAX-1, shuffleB);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGB_565_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ unsigned r = SkPacked16ToR32(*pixel);
|
||||
+ unsigned g = SkPacked16ToG32(*pixel);
|
||||
+ unsigned b = SkPacked16ToB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 31, shuffleR);
|
||||
+ g = shuffleComponent(g, 63, shuffleG);
|
||||
+ b = shuffleComponent(b, 31, shuffleB);
|
||||
+
|
||||
+ unsigned r16 = (r & SK_R16_MASK) << SK_R16_SHIFT;
|
||||
+ unsigned g16 = (g & SK_G16_MASK) << SK_G16_SHIFT;
|
||||
+ unsigned b16 = (b & SK_B16_MASK) << SK_B16_SHIFT;
|
||||
+
|
||||
+ *pixel = r16 | g16 | b16;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kARGB_4444_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA4444(*pixel), r = SkGetPackedR4444(*pixel), g = SkGetPackedG4444(*pixel), b = SkGetPackedB4444(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 15, shuffleR);
|
||||
+ g = shuffleComponent(g, 15, shuffleG);
|
||||
+ b = shuffleComponent(b, 15, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ unsigned a4 = (a & 0xF) << SK_A4444_SHIFT;
|
||||
+ unsigned r4 = (r & 0xF) << SK_R4444_SHIFT;
|
||||
+ unsigned g4 = (g & 0xF) << SK_G4444_SHIFT;
|
||||
+ unsigned b4 = (b & 0xF) << SK_B4444_SHIFT;
|
||||
+
|
||||
+ *pixel = r4 | b4 | g4 | a4;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGBA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), r = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), b = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
|
||||
+ (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kBGRA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), b = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), r = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_BGRA_A32_SHIFT) | (r << SK_BGRA_R32_SHIFT) |
|
||||
+ (g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ // the remaining formats are not expected to be used in Chromium
|
||||
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // keep bisecting or reset current width/height as needed
|
||||
+ if (x == 0) {
|
||||
+ currentW = w;
|
||||
+ } else {
|
||||
+ currentW = x;
|
||||
+ }
|
||||
+ if (y == 0) {
|
||||
+ currentH = h;
|
||||
+ } else {
|
||||
+ currentH = y;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#undef writable_addr
|
||||
+#undef shuffleComponent
|
||||
+
|
||||
const gpu::SyncToken& StaticBitmapImage::GetSyncToken() const {
|
||||
static const gpu::SyncToken sync_token;
|
||||
return sync_token;
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
@@ -46,6 +46,8 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
|
||||
static scoped_refptr<StaticBitmapImage> Create(WTF::ArrayBufferContents&,
|
||||
const SkImageInfo&);
|
||||
|
||||
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
|
||||
+
|
||||
bool IsStaticBitmapImage() const override { return true; }
|
||||
|
||||
// Methods overridden by all sub-classes
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:15:17 +0200
|
||||
Subject: Disable NTP remote suggestions by default
|
||||
|
||||
---
|
||||
components/ntp_snippets/features.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
|
||||
--- a/components/ntp_snippets/features.cc
|
||||
+++ b/components/ntp_snippets/features.cc
|
||||
@@ -34,13 +34,13 @@ const base::Feature* const kAllFeatures[] = {
|
||||
&kRemoteSuggestionsBackendFeature};
|
||||
|
||||
const base::Feature kArticleSuggestionsFeature{
|
||||
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kBookmarkSuggestionsFeature{
|
||||
- "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kBreakingNewsPushFeature{"BreakingNewsPush",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 23:11:56 +0100
|
||||
Subject: Disable Omaha update checks
|
||||
|
||||
Do not consider Jelly Bean unsupported
|
||||
---
|
||||
.../android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java | 2 +-
|
||||
.../java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java | 2 +-
|
||||
chrome/browser/android/chrome_feature_list.cc | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java
|
||||
@@ -134,7 +134,7 @@ public class OmahaBase {
|
||||
|
||||
/** See {@link #sIsDisabled}. */
|
||||
static boolean isDisabled() {
|
||||
- return sIsDisabled;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
|
||||
@@ -42,7 +42,7 @@ public class VersionNumberGetter {
|
||||
private static VersionNumberGetter sInstanceForTests;
|
||||
|
||||
/** If false, OmahaClient will never report that a newer version is available. */
|
||||
- private static boolean sEnableUpdateDetection = true;
|
||||
+ private static boolean sEnableUpdateDetection = false;
|
||||
|
||||
protected VersionNumberGetter() { }
|
||||
|
||||
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/android/chrome_feature_list.cc
|
||||
@@ -400,7 +400,7 @@ const base::Feature kIntentBlockExternalFormRedirectsNoGesture{
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kJellyBeanSupported{"JellyBeanSupported",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kLanguagesPreference{"LanguagesPreference",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 26 Oct 2017 16:59:03 +0200
|
||||
Subject: Disable WebRTC by default
|
||||
|
||||
---
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -85,10 +85,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
false);
|
||||
#endif
|
||||
// TODO(guoweis): Remove next 2 options at M50.
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, false);
|
||||
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
|
||||
- content::kWebRTCIPHandlingDefault);
|
||||
+ content::kWebRTCIPHandlingDisableNonProxiedUdp);
|
||||
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Wed, 23 Nov 2016 09:26:51 -0500
|
||||
Subject: Disable contextual search by default
|
||||
|
||||
---
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -144,7 +144,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
#if defined(OS_ANDROID)
|
||||
registry->RegisterStringPref(
|
||||
prefs::kContextualSearchEnabled,
|
||||
- std::string(),
|
||||
+ "false",
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
#endif // defined(OS_ANDROID)
|
||||
registry->RegisterBooleanPref(prefs::kSessionExitedCleanly, true);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 27 Oct 2017 15:53:37 +0200
|
||||
Subject: Disable data saver
|
||||
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java | 1 -
|
||||
.../chrome/browser/net/spdyproxy/DataReductionProxySettings.java | 2 ++
|
||||
.../browser/preferences/datareduction/DataReductionPromoUtils.java | 2 +-
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -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)) {
|
||||
- mPages.add(new DataReductionProxyFirstRunFragment.Page());
|
||||
mFreProgressStates.add(FRE_PROGRESS_DATA_SAVER_SHOWN);
|
||||
notifyAdapter = true;
|
||||
}
|
||||
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
|
||||
@@ -126,6 +126,7 @@ public class DataReductionProxySettings {
|
||||
// DataReductionProxySettings is a singleton that lives forever and there's no clean
|
||||
// shutdown of Chrome on Android
|
||||
mNativeDataReductionProxySettings = nativeInit();
|
||||
+ nativeSetDataReductionProxyEnabled(mNativeDataReductionProxySettings, false);
|
||||
}
|
||||
|
||||
/** Returns true if the SPDY proxy promo is allowed to be shown. */
|
||||
@@ -148,6 +149,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) {
|
||||
+ enabled = false;
|
||||
if (enabled
|
||||
&& ContextUtils.getAppSharedPreferences().getLong(
|
||||
DATA_REDUCTION_FIRST_ENABLED_TIME, 0)
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
@@ -70,7 +70,7 @@ public class DataReductionPromoUtils {
|
||||
}
|
||||
if (DataReductionProxySettings.getInstance().isDataReductionProxyManaged()) return false;
|
||||
if (DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()) return false;
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 18:16:34 +0200
|
||||
Subject: Disable fetching of all field trials
|
||||
|
||||
---
|
||||
.../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
|
||||
@@ -106,9 +106,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,9 +123,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,9 +140,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
|
||||
@@ -240,17 +240,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
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 20 Feb 2019 21:41:26 +0100
|
||||
Subject: Disable metrics collection for NTP tiles
|
||||
|
||||
---
|
||||
.../android/ntp/most_visited_sites_bridge.cc | 21 ---------------------
|
||||
components/ntp_tiles/BUILD.gn | 3 ---
|
||||
2 files changed, 24 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
||||
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
||||
+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "chrome/browser/profiles/profile_android.h"
|
||||
#include "components/favicon_base/favicon_types.h"
|
||||
#include "components/history/core/browser/history_service.h"
|
||||
-#include "components/ntp_tiles/metrics.h"
|
||||
#include "components/ntp_tiles/most_visited_sites.h"
|
||||
#include "components/ntp_tiles/section_type.h"
|
||||
#include "components/rappor/rappor_service_impl.h"
|
||||
@@ -45,7 +44,6 @@ using ntp_tiles::NTPTilesVector;
|
||||
using ntp_tiles::SectionType;
|
||||
using ntp_tiles::TileTitleSource;
|
||||
using ntp_tiles::TileSource;
|
||||
-using ntp_tiles::TileVisualType;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -240,7 +238,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
jint jtiles_count) {
|
||||
- ntp_tiles::metrics::RecordPageImpression(jtiles_count);
|
||||
}
|
||||
|
||||
void MostVisitedSitesBridge::RecordTileImpression(
|
||||
@@ -253,18 +250,6 @@ void MostVisitedSitesBridge::RecordTileImpression(
|
||||
jint jsource,
|
||||
jlong jdata_generation_time_ms,
|
||||
const JavaParamRef<jstring>& jurl) {
|
||||
- GURL url(ConvertJavaStringToUTF8(env, jurl));
|
||||
- TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
|
||||
- TileSource source = static_cast<TileSource>(jsource);
|
||||
- TileVisualType visual_type = static_cast<TileVisualType>(jvisual_type);
|
||||
- favicon_base::IconType icon_type =
|
||||
- static_cast<favicon_base::IconType>(jicon_type);
|
||||
-
|
||||
- ntp_tiles::metrics::RecordTileImpression(
|
||||
- ntp_tiles::NTPTileImpression(
|
||||
- jindex, source, title_source, visual_type, icon_type,
|
||||
- base::Time::FromJavaTime(jdata_generation_time_ms), url),
|
||||
- g_browser_process->rappor_service());
|
||||
}
|
||||
|
||||
void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
|
||||
@@ -275,12 +260,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
|
||||
jint title_source,
|
||||
jint source,
|
||||
jlong jdata_generation_time_ms) {
|
||||
- ntp_tiles::metrics::RecordTileClick(ntp_tiles::NTPTileImpression(
|
||||
- index, static_cast<TileSource>(source),
|
||||
- static_cast<TileTitleSource>(title_source),
|
||||
- static_cast<TileVisualType>(tile_type), favicon_base::IconType::kInvalid,
|
||||
- base::Time::FromJavaTime(jdata_generation_time_ms),
|
||||
- /*url_for_rappor=*/GURL()));
|
||||
}
|
||||
|
||||
static jlong JNI_MostVisitedSitesBridge_Init(
|
||||
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
|
||||
--- a/components/ntp_tiles/BUILD.gn
|
||||
+++ b/components/ntp_tiles/BUILD.gn
|
||||
@@ -20,8 +20,6 @@ static_library("ntp_tiles") {
|
||||
"icon_cacher.h",
|
||||
"icon_cacher_impl.cc",
|
||||
"icon_cacher_impl.h",
|
||||
- "metrics.cc",
|
||||
- "metrics.h",
|
||||
"most_visited_sites.cc",
|
||||
"most_visited_sites.h",
|
||||
"ntp_tile.cc",
|
||||
@@ -91,7 +89,6 @@ source_set("unit_tests") {
|
||||
"custom_links_manager_impl_unittest.cc",
|
||||
"custom_links_store_unittest.cc",
|
||||
"icon_cacher_impl_unittest.cc",
|
||||
- "metrics_unittest.cc",
|
||||
"most_visited_sites_unittest.cc",
|
||||
"popular_sites_impl_unittest.cc",
|
||||
]
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 25 Apr 2018 10:23:51 +0200
|
||||
Subject: Disable metrics on all I/O threads
|
||||
|
||||
---
|
||||
chrome/browser/browser_process_impl.cc | 2 +-
|
||||
chrome/browser/profiles/profile_io_data.cc | 2 --
|
||||
2 files changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
|
||||
--- a/chrome/browser/browser_process_impl.cc
|
||||
+++ b/chrome/browser/browser_process_impl.cc
|
||||
@@ -947,7 +947,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled,
|
||||
- GoogleUpdateSettings::GetCollectStatsConsent());
|
||||
+ false);
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
registry->RegisterBooleanPref(
|
||||
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
||||
--- a/chrome/browser/profiles/profile_io_data.cc
|
||||
+++ b/chrome/browser/profiles/profile_io_data.cc
|
||||
@@ -55,8 +55,6 @@
|
||||
#include "components/cookie_config/cookie_store_util.h"
|
||||
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
|
||||
#include "components/dom_distiller/core/url_constants.h"
|
||||
-#include "components/metrics/metrics_pref_names.h"
|
||||
-#include "components/metrics/metrics_service.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/policy/core/common/cloud/policy_header_service.h"
|
||||
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 23:24:58 +0200
|
||||
Subject: Disable omission of URL elements in Omnibox
|
||||
|
||||
Disable all omissions because they are used throughout the code without
|
||||
a corresponding user option to individually disable their usage.
|
||||
---
|
||||
components/url_formatter/url_formatter.cc | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
|
||||
--- a/components/url_formatter/url_formatter.cc
|
||||
+++ b/components/url_formatter/url_formatter.cc
|
||||
@@ -410,13 +410,13 @@ IDNConversionStatus IDNToUnicodeOneComponent(const base::char16* comp,
|
||||
} // namespace
|
||||
|
||||
const FormatUrlType kFormatUrlOmitNothing = 0;
|
||||
-const FormatUrlType kFormatUrlOmitUsernamePassword = 1 << 0;
|
||||
-const FormatUrlType kFormatUrlOmitHTTP = 1 << 1;
|
||||
-const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 1 << 2;
|
||||
-const FormatUrlType kFormatUrlOmitHTTPS = 1 << 3;
|
||||
-const FormatUrlType kFormatUrlOmitTrivialSubdomains = 1 << 5;
|
||||
-const FormatUrlType kFormatUrlTrimAfterHost = 1 << 6;
|
||||
-const FormatUrlType kFormatUrlOmitFileScheme = 1 << 7;
|
||||
+const FormatUrlType kFormatUrlOmitUsernamePassword = 0 << 0;
|
||||
+const FormatUrlType kFormatUrlOmitHTTP = 0 << 1;
|
||||
+const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 0 << 2;
|
||||
+const FormatUrlType kFormatUrlOmitHTTPS = 0 << 3;
|
||||
+const FormatUrlType kFormatUrlOmitTrivialSubdomains = 0 << 5;
|
||||
+const FormatUrlType kFormatUrlTrimAfterHost = 0 << 6;
|
||||
+const FormatUrlType kFormatUrlOmitFileScheme = 0 << 7;
|
||||
const FormatUrlType kFormatUrlOmitMailToScheme = 1 << 8;
|
||||
|
||||
const FormatUrlType kFormatUrlOmitDefaults =
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 22 Mar 2018 22:38:00 +0100
|
||||
Subject: Disable plugins enumeration
|
||||
|
||||
---
|
||||
third_party/blink/renderer/core/frame/local_frame.cc | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -1357,10 +1357,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
}
|
||||
|
||||
PluginData* LocalFrame::GetPluginData() const {
|
||||
- if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
|
||||
- return nullptr;
|
||||
- return GetPage()->GetPluginData(
|
||||
- Tree().Top().GetSecurityContext()->GetSecurityOrigin());
|
||||
+ // what about no
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 8 Jan 2019 08:54:50 +0100
|
||||
Subject: Disable previews by default
|
||||
|
||||
---
|
||||
components/previews/core/previews_features.cc | 7 +------
|
||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/components/previews/core/previews_features.cc b/components/previews/core/previews_features.cc
|
||||
--- a/components/previews/core/previews_features.cc
|
||||
+++ b/components/previews/core/previews_features.cc
|
||||
@@ -14,12 +14,7 @@ namespace features {
|
||||
// are enabled are controlled by other features.
|
||||
const base::Feature kPreviews {
|
||||
"Previews",
|
||||
-#if defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
- // Previews allowed for Android (but also allow on Linux for dev/debug).
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else // !defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif // defined(OS_ANDROID) || defined(OS_LINUX)
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT
|
||||
};
|
||||
|
||||
// Enables the Offline previews on android slow connections.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 10 Nov 2018 17:20:21 +0100
|
||||
Subject: Disable promos displayed in bookmarks manager
|
||||
|
||||
Remove personalized signin promo view from
|
||||
bookmarks, never reach signin thresholds.
|
||||
---
|
||||
.../personalized_signin_promo_view_bookmarks.xml | 30 ----------------------
|
||||
.../browser/bookmarks/BookmarkItemsAdapter.java | 23 ++---------------
|
||||
.../browser/signin/SigninPromoController.java | 19 ++------------
|
||||
chrome/android/java_sources.gni | 1 -
|
||||
4 files changed, 4 insertions(+), 69 deletions(-)
|
||||
delete mode 100644 chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml b/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
|
||||
deleted file mode 100644
|
||||
--- a/chrome/android/java/res/layout/personalized_signin_promo_view_bookmarks.xml
|
||||
+++ /dev/null
|
||||
@@ -1,30 +0,0 @@
|
||||
-<?xml version="1.0" encoding="utf-8"?>
|
||||
-<!-- Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
- Use of this source code is governed by a BSD-style license that can be
|
||||
- found in the LICENSE file. -->
|
||||
-
|
||||
-<org.chromium.chrome.browser.signin.PersonalizedSigninPromoView
|
||||
- xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
- android:id="@+id/signin_promo_view_container"
|
||||
- android:layout_width="match_parent"
|
||||
- android:layout_height="wrap_content"
|
||||
- android:layout_margin="16dp"
|
||||
- android:background="@drawable/hairline_border_card_background"
|
||||
- android:gravity="center_horizontal"
|
||||
- android:orientation="vertical"
|
||||
- android:paddingBottom="12dp"
|
||||
- android:paddingTop="14dp">
|
||||
-
|
||||
- <FrameLayout
|
||||
- android:layout_width="match_parent"
|
||||
- android:layout_height="wrap_content"
|
||||
- android:layout_marginBottom="12dp"
|
||||
- android:layout_marginEnd="12dp"
|
||||
- android:layout_marginStart="12dp">
|
||||
-
|
||||
- <include layout="@layout/personalized_signin_promo_view_header"/>
|
||||
- </FrameLayout>
|
||||
-
|
||||
- <include layout="@layout/personalized_signin_promo_view_body"/>
|
||||
-
|
||||
-</org.chromium.chrome.browser.signin.PersonalizedSigninPromoView>
|
||||
\ No newline at end of file
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
|
||||
@@ -57,7 +57,6 @@ class BookmarkItemsAdapter
|
||||
|
||||
private BookmarkDelegate mDelegate;
|
||||
private Context mContext;
|
||||
- private BookmarkPromoHeader mPromoHeaderManager;
|
||||
private String mSearchText;
|
||||
private BookmarkId mCurrentFolder;
|
||||
|
||||
@@ -211,9 +210,9 @@ class BookmarkItemsAdapter
|
||||
|
||||
switch (viewType) {
|
||||
case ViewType.PERSONALIZED_SIGNIN_PROMO:
|
||||
- return mPromoHeaderManager.createPersonalizedSigninPromoHolder(parent);
|
||||
+ return null;
|
||||
case ViewType.SYNC_PROMO:
|
||||
- return mPromoHeaderManager.createSyncPromoHolder(parent);
|
||||
+ return null;
|
||||
case ViewType.FOLDER:
|
||||
BookmarkFolderRow folder = (BookmarkFolderRow) LayoutInflater.from(
|
||||
parent.getContext()).inflate(R.layout.bookmark_folder_row, parent, false);
|
||||
@@ -234,8 +233,6 @@ class BookmarkItemsAdapter
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
switch (holder.getItemViewType()) {
|
||||
case ViewType.PERSONALIZED_SIGNIN_PROMO:
|
||||
- PersonalizedSigninPromoView view = (PersonalizedSigninPromoView) holder.itemView;
|
||||
- mPromoHeaderManager.setupPersonalizedSigninPromo(view);
|
||||
break;
|
||||
case ViewType.SYNC_PROMO:
|
||||
break;
|
||||
@@ -254,7 +251,6 @@ class BookmarkItemsAdapter
|
||||
public void onViewRecycled(ViewHolder holder) {
|
||||
switch (holder.getItemViewType()) {
|
||||
case ViewType.PERSONALIZED_SIGNIN_PROMO:
|
||||
- mPromoHeaderManager.detachPersonalizePromoView();
|
||||
break;
|
||||
default:
|
||||
// Other view holders don't have special recycling code.
|
||||
@@ -289,7 +285,6 @@ class BookmarkItemsAdapter
|
||||
}
|
||||
};
|
||||
|
||||
- mPromoHeaderManager = new BookmarkPromoHeader(mContext, promoHeaderChangeAction);
|
||||
populateTopLevelFoldersList();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -300,7 +295,6 @@ class BookmarkItemsAdapter
|
||||
mDelegate.removeUIObserver(this);
|
||||
mDelegate.getModel().removeObserver(mBookmarkModelObserver);
|
||||
mDelegate = null;
|
||||
- mPromoHeaderManager.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -367,19 +361,6 @@ class BookmarkItemsAdapter
|
||||
if (currentUIState == BookmarkUIState.STATE_SEARCHING) return;
|
||||
|
||||
assert currentUIState == BookmarkUIState.STATE_FOLDER : "Unexpected UI state";
|
||||
-
|
||||
- switch (mPromoHeaderManager.getPromoState()) {
|
||||
- case BookmarkPromoHeader.PromoState.PROMO_NONE:
|
||||
- return;
|
||||
- case BookmarkPromoHeader.PromoState.PROMO_SIGNIN_PERSONALIZED:
|
||||
- mPromoHeaderSection.add(ViewType.PERSONALIZED_SIGNIN_PROMO);
|
||||
- return;
|
||||
- case BookmarkPromoHeader.PromoState.PROMO_SYNC:
|
||||
- mPromoHeaderSection.add(ViewType.SYNC_PROMO);
|
||||
- return;
|
||||
- default:
|
||||
- assert false : "Unexpected value for promo state!";
|
||||
- }
|
||||
}
|
||||
|
||||
private void populateTopLevelFoldersList() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoController.java
|
||||
@@ -77,23 +77,8 @@ public class SigninPromoController {
|
||||
*/
|
||||
public static boolean hasNotReachedImpressionLimit(@AccessPoint int accessPoint) {
|
||||
SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
|
||||
- switch (accessPoint) {
|
||||
- case SigninAccessPoint.BOOKMARK_MANAGER:
|
||||
- return sharedPreferences.getInt(SIGNIN_PROMO_IMPRESSIONS_COUNT_BOOKMARKS, 0)
|
||||
- < MAX_IMPRESSIONS_BOOKMARKS;
|
||||
- case SigninAccessPoint.NTP_CONTENT_SUGGESTIONS:
|
||||
- // There is no impression limit for NTP content suggestions.
|
||||
- return true;
|
||||
- case SigninAccessPoint.RECENT_TABS:
|
||||
- // There is no impression limit for Recent Tabs.
|
||||
- return true;
|
||||
- case SigninAccessPoint.SETTINGS:
|
||||
- return sharedPreferences.getInt(SIGNIN_PROMO_IMPRESSIONS_COUNT_SETTINGS, 0)
|
||||
- < MAX_IMPRESSIONS_SETTINGS;
|
||||
- default:
|
||||
- assert false : "Unexpected value for access point: " + accessPoint;
|
||||
- return false;
|
||||
- }
|
||||
+ // never show anything
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
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
|
||||
@@ -166,7 +166,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java",
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java",
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java",
|
||||
- "java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java",
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java",
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIObserver.java",
|
||||
"java/src/org/chromium/chrome/browser/bookmarks/BookmarkUIState.java",
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 15 Oct 2017 21:45:46 +0200
|
||||
Subject: Disable references to fonts.googleapis.com
|
||||
|
||||
---
|
||||
.../dom_distiller/content/browser/dom_distiller_viewer_source.cc | 2 +-
|
||||
components/dom_distiller/core/html/preview.html | 2 +-
|
||||
components/dom_distiller/core/javascript/dom_distiller_viewer.js | 2 +-
|
||||
third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css | 3 +--
|
||||
4 files changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
|
||||
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
|
||||
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
|
||||
@@ -309,7 +309,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
|
||||
}
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() const {
|
||||
- return "style-src 'self' https://fonts.googleapis.com;";
|
||||
+ return "style-src 'self';";
|
||||
}
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const {
|
||||
diff --git a/components/dom_distiller/core/html/preview.html b/components/dom_distiller/core/html/preview.html
|
||||
--- a/components/dom_distiller/core/html/preview.html
|
||||
+++ b/components/dom_distiller/core/html/preview.html
|
||||
@@ -11,7 +11,7 @@ found in the LICENSE file.
|
||||
<meta name="theme-color" id="theme-color">
|
||||
<title>Title goes here and it could be kind of lengthy - Publisher name</title>
|
||||
<link href="../css/distilledpage.css" rel="stylesheet" type="text/css">
|
||||
- <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
||||
+ <link href='chrome://resources/css/roboto.css' rel='stylesheet' type='text/css'>
|
||||
<style>
|
||||
.english :lang(th) {display: none}
|
||||
.english :lang(zh) {display: none}
|
||||
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
@@ -120,7 +120,7 @@ function maybeSetWebFont() {
|
||||
if (distiller_on_ios) return;
|
||||
|
||||
var e = document.createElement('link');
|
||||
- e.href = 'https://fonts.googleapis.com/css?family=Roboto';
|
||||
+ e.href = 'chrome://resources/css/roboto.css';
|
||||
e.rel = 'stylesheet';
|
||||
e.type = 'text/css';
|
||||
document.head.appendChild(e);
|
||||
diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
--- a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
+++ b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
@@ -12,8 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License. */
|
||||
|
||||
-@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
|
||||
-@import "https://fonts.googleapis.com/css?family=Source+Code+Pro";
|
||||
+@import "chrome://resources/css/roboto.css";
|
||||
|
||||
body,
|
||||
table,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Tue, 25 Dec 2018 16:19:51 -0500
|
||||
Subject: Disable seed-based field trials
|
||||
|
||||
---
|
||||
components/variations/service/variations_field_trial_creator.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
|
||||
--- a/components/variations/service/variations_field_trial_creator.cc
|
||||
+++ b/components/variations/service/variations_field_trial_creator.cc
|
||||
@@ -514,8 +514,10 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
|
||||
#endif // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
|
||||
bool used_seed = false;
|
||||
if (!used_testing_config) {
|
||||
+#if defined(FIELDTRIAL_SEED_ENABLED)
|
||||
used_seed = CreateTrialsFromSeed(std::move(low_entropy_provider),
|
||||
feature_list.get(), safe_seed_manager);
|
||||
+#endif
|
||||
}
|
||||
|
||||
platform_field_trials->SetupFeatureControllingFieldTrials(used_seed,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,340 +0,0 @@
|
||||
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 | 20 -----
|
||||
.../android/java/res/xml/privacy_preferences.xml | 7 --
|
||||
.../browser/preferences/MainPreferences.java | 92 +---------------------
|
||||
.../preferences/privacy/PrivacyPreferences.java | 17 ----
|
||||
.../java/strings/android_chrome_strings.grd | 6 --
|
||||
5 files changed, 1 insertion(+), 141 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
|
||||
@@ -7,21 +7,6 @@
|
||||
android:orderingFromXml="false">
|
||||
|
||||
<PreferenceCategory
|
||||
- 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:key="sync_and_services"
|
||||
- android:order="2"
|
||||
- android:layout="@layout/account_management_account_row"
|
||||
- android:title="@string/prefs_sync_and_services"
|
||||
- android:fragment="org.chromium.chrome.browser.preferences.SyncAndServicesPreferences"/>
|
||||
-
|
||||
- <PreferenceCategory
|
||||
android:key="basics_section"
|
||||
android:order="3"
|
||||
android:title="@string/prefs_section_basics"/>
|
||||
@@ -96,11 +81,6 @@
|
||||
android:key="languages"
|
||||
android:order="17"
|
||||
android:title="@string/prefs_languages"/>
|
||||
- <org.chromium.chrome.browser.preferences.datareduction.DataReductionPreference
|
||||
- android:fragment="org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferenceFragment"
|
||||
- android:key="data_reduction"
|
||||
- android:order="18"
|
||||
- android:title="@string/data_reduction_title"/>
|
||||
<org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.download.DownloadPreferences"
|
||||
android:key="downloads"
|
||||
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,11 +55,4 @@
|
||||
android:title="@string/clear_browsing_data_title"
|
||||
android:summary="@string/clear_browsing_data_summary"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment" />
|
||||
- <Preference
|
||||
- android:key="sync_and_services_link_divider"
|
||||
- android:layout="@layout/divider_preference"
|
||||
- android:selectable="false"/>
|
||||
- <org.chromium.chrome.browser.preferences.TextMessagePreference
|
||||
- android:key="sync_and_services_link"
|
||||
- tools:summary="@string/privacy_sync_and_services_link"/>
|
||||
</PreferenceScreen>
|
||||
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,16 +17,12 @@ 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.partnercustomizations.HomepageManager;
|
||||
import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer;
|
||||
import org.chromium.chrome.browser.preferences.autofill_assistant.AutofillAssistantPreferences;
|
||||
-import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferenceFragment;
|
||||
import org.chromium.chrome.browser.preferences.developer.DeveloperPreferences;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrl;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
||||
-import org.chromium.chrome.browser.signin.SigninManager;
|
||||
-import org.chromium.chrome.browser.sync.ProfileSyncService;
|
||||
import org.chromium.chrome.browser.util.FeatureUtilities;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -36,11 +32,7 @@ import java.util.Map;
|
||||
* The main settings screen, shown when the user first opens Settings.
|
||||
*/
|
||||
public class MainPreferences extends PreferenceFragment
|
||||
- implements TemplateUrlService.LoadListener, ProfileSyncService.SyncStateChangedListener,
|
||||
- SigninManager.SignInStateObserver {
|
||||
- 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";
|
||||
+ implements TemplateUrlService.LoadListener {
|
||||
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";
|
||||
@@ -60,7 +52,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);
|
||||
@@ -76,33 +67,16 @@ public class MainPreferences extends PreferenceFragment
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
- mSignInPreference.onPreferenceFragmentDestroyed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
- if (SigninManager.get().isSigninSupported()) {
|
||||
- SigninManager.get().addSignInStateObserver(this);
|
||||
- mSignInPreference.registerForUpdates();
|
||||
- }
|
||||
- ProfileSyncService syncService = ProfileSyncService.get();
|
||||
- if (syncService != null) {
|
||||
- syncService.addSyncStateChangedListener(this);
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
- if (SigninManager.get().isSigninSupported()) {
|
||||
- SigninManager.get().removeSignInStateObserver(this);
|
||||
- mSignInPreference.unregisterForUpdates();
|
||||
- }
|
||||
- ProfileSyncService syncService = ProfileSyncService.get();
|
||||
- if (syncService != null) {
|
||||
- syncService.removeSyncStateChangedListener(this);
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,17 +89,9 @@ public class MainPreferences extends PreferenceFragment
|
||||
PreferenceUtils.addPreferencesFromResource(this, R.xml.main_preferences);
|
||||
cachePreferences();
|
||||
|
||||
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)) {
|
||||
- mSignInPreference.setOnStateChangedCallback(this::onSignInPreferenceStateChanged);
|
||||
- } else {
|
||||
- getPreferenceScreen().removePreference(findPreference(PREF_ACCOUNT_SECTION));
|
||||
- getPreferenceScreen().removePreference(findPreference(PREF_SYNC_AND_SERVICES));
|
||||
- }
|
||||
-
|
||||
updatePasswordsPreference();
|
||||
|
||||
setManagedPreferenceDelegateForPreference(PREF_SEARCH_ENGINE);
|
||||
- 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
|
||||
@@ -189,7 +155,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
Preference preference = getPreferenceScreen().getPreference(index);
|
||||
mAllPreferences.put(preference.getKey(), preference);
|
||||
}
|
||||
- mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
|
||||
}
|
||||
|
||||
private void setManagedPreferenceDelegateForPreference(String key) {
|
||||
@@ -198,13 +163,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
}
|
||||
|
||||
private void updatePreferences() {
|
||||
- if (SigninManager.get().isSigninSupported()) {
|
||||
- addPreferenceIfAbsent(PREF_SIGN_IN);
|
||||
- } else {
|
||||
- removePreferenceIfPresent(PREF_SIGN_IN);
|
||||
- }
|
||||
-
|
||||
- updateSyncAndServicesPreference();
|
||||
updateSearchEnginePreference();
|
||||
|
||||
Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
|
||||
@@ -234,10 +192,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
} else {
|
||||
removePreferenceIfPresent(PREF_DEVELOPER);
|
||||
}
|
||||
-
|
||||
- ChromeBasePreference dataReduction =
|
||||
- (ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
|
||||
- dataReduction.setSummary(DataReductionPreferenceFragment.generateSummary(getResources()));
|
||||
}
|
||||
|
||||
private Preference addPreferenceIfAbsent(String key) {
|
||||
@@ -251,15 +205,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
if (preference != null) getPreferenceScreen().removePreference(preference);
|
||||
}
|
||||
|
||||
- private void updateSyncAndServicesPreference() {
|
||||
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)) return;
|
||||
-
|
||||
- ChromeBasePreference syncAndServices =
|
||||
- (ChromeBasePreference) findPreference(PREF_SYNC_AND_SERVICES);
|
||||
- syncAndServices.setIcon(SyncPreferenceUtils.getSyncStatusIcon(getActivity()));
|
||||
- syncAndServices.setSummary(SyncPreferenceUtils.getSyncStatusSummary(getActivity()));
|
||||
- }
|
||||
-
|
||||
private void updateSearchEnginePreference() {
|
||||
if (!TemplateUrlService.getInstance().isLoaded()) {
|
||||
ChromeBasePreference searchEnginePref =
|
||||
@@ -291,28 +236,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
pref.setSummary(getResources().getString(isOn ? R.string.text_on : R.string.text_off));
|
||||
}
|
||||
|
||||
- // SigninManager.SignInStateObserver implementation.
|
||||
- @Override
|
||||
- public void onSignedIn() {
|
||||
- // After signing in or out of a managed account, preferences may change or become enabled
|
||||
- // or disabled.
|
||||
- new Handler().post(() -> updatePreferences());
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onSignedOut() {
|
||||
- updatePreferences();
|
||||
- }
|
||||
-
|
||||
- private void onSignInPreferenceStateChanged() {
|
||||
- // Remove "Account" section header if the personalized sign-in promo is shown.
|
||||
- if (mSignInPreference.getState() == SignInPreference.State.PERSONALIZED_PROMO) {
|
||||
- removePreferenceIfPresent(PREF_ACCOUNT_SECTION);
|
||||
- } else {
|
||||
- addPreferenceIfAbsent(PREF_ACCOUNT_SECTION);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
// TemplateUrlService.LoadListener implementation.
|
||||
@Override
|
||||
public void onTemplateUrlServiceLoaded() {
|
||||
@@ -320,11 +243,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
updateSearchEnginePreference();
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public void syncStateChanged() {
|
||||
- updateSyncAndServicesPreference();
|
||||
- }
|
||||
-
|
||||
@VisibleForTesting
|
||||
ManagedPreferenceDelegate getManagedPreferenceDelegateForTest() {
|
||||
return mManagedPreferenceDelegate;
|
||||
@@ -334,9 +252,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
return new ManagedPreferenceDelegate() {
|
||||
@Override
|
||||
public boolean isPreferenceControlledByPolicy(Preference preference) {
|
||||
- if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
|
||||
- return DataReductionProxySettings.getInstance().isDataReductionProxyManaged();
|
||||
- }
|
||||
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
|
||||
return TemplateUrlService.getInstance().isDefaultSearchManaged();
|
||||
}
|
||||
@@ -345,11 +260,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
|
||||
@Override
|
||||
public boolean isPreferenceClickDisabledByPolicy(Preference preference) {
|
||||
- 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();
|
||||
}
|
||||
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
|
||||
@@ -27,7 +27,6 @@ import org.chromium.chrome.browser.preferences.Pref;
|
||||
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
||||
import org.chromium.chrome.browser.preferences.PreferenceUtils;
|
||||
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
|
||||
-import org.chromium.chrome.browser.preferences.SyncAndServicesPreferences;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.usage_stats.UsageStatsConsentDialog;
|
||||
import org.chromium.ui.text.NoUnderlineClickableSpan;
|
||||
@@ -49,9 +48,6 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
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";
|
||||
- private static final String PREF_SYNC_AND_SERVICES_LINK_DIVIDER =
|
||||
- "sync_and_services_link_divider";
|
||||
- private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link";
|
||||
private static final String PREF_USAGE_STATS = "usage_stats_reporting";
|
||||
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
@@ -100,22 +96,9 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
networkPredictionPref.setOrder(canMakePaymentPref.getOrder());
|
||||
preferenceScreen.addPreference(networkPredictionPref);
|
||||
|
||||
- Preference syncAndServicesLink = findPreference(PREF_SYNC_AND_SERVICES_LINK);
|
||||
- NoUnderlineClickableSpan linkSpan =
|
||||
- new NoUnderlineClickableSpan(getResources(), view -> {
|
||||
- PreferencesLauncher.launchSettingsPage(getActivity(),
|
||||
- SyncAndServicesPreferences.class,
|
||||
- SyncAndServicesPreferences.createArguments(false));
|
||||
- });
|
||||
- syncAndServicesLink.setSummary(
|
||||
- SpanApplier.applySpans(getString(R.string.privacy_sync_and_services_link),
|
||||
- new SpanApplier.SpanInfo("<link>", "</link>", linkSpan)));
|
||||
-
|
||||
updateSummaries();
|
||||
return;
|
||||
}
|
||||
- preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK_DIVIDER));
|
||||
- preferenceScreen.removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK));
|
||||
|
||||
ChromeBaseCheckBoxPreference navigationErrorPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(PREF_NAVIGATION_ERROR);
|
||||
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
|
||||
@@ -315,9 +315,6 @@ CHAR-LIMIT guidelines:
|
||||
</message>
|
||||
|
||||
<!-- Sign-in, sync and personalization preferences -->
|
||||
- <message name="IDS_PREFS_SECTION_ACCOUNT" desc="Title for the group of account-related entries in Settings. [CHAR-LIMIT=32]">
|
||||
- Account
|
||||
- </message>
|
||||
<message name="IDS_SIGN_IN_TO_CHROME" desc="Title for the button to sign in to Chrome using one's Google account. [CHAR-LIMIT=27]">
|
||||
Sign in to Chrome
|
||||
</message>
|
||||
@@ -400,9 +397,6 @@ CHAR-LIMIT guidelines:
|
||||
<message name="IDS_URL_KEYED_ANONYMIZED_DATA_SUMMARY" desc="Summary for a checkbox in Settings that controls non-personalized URL collection and informs the user about the data shared by this feature.">
|
||||
Sends URLs of pages you visit to Google
|
||||
</message>
|
||||
- <message name="IDS_PRIVACY_SYNC_AND_SERVICES_LINK" desc="The text for Privacy preferences that is shown after all preference rows.">
|
||||
- For more settings that relate to privacy, security, and data collection, see <ph name="BEGIN_LINK"><link></ph>Sync and Google services<ph name="END_LINK"></link></ph>
|
||||
- </message>
|
||||
<message name="IDS_USAGE_AND_CRASH_REPORTS_TITLE" desc="Title for a preference that enables sending usage statistics and crash reports.">
|
||||
Help improve Chrome's features and performance
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:09:26 +0200
|
||||
Subject: Disable signin/data reduction promos
|
||||
|
||||
---
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 28 ++--------------------
|
||||
1 file changed, 2 insertions(+), 26 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
|
||||
@@ -695,34 +695,10 @@ public class ChromeTabbedActivity
|
||||
}
|
||||
|
||||
ChromePreferenceManager preferenceManager = ChromePreferenceManager.getInstance();
|
||||
- // Promos can only be shown when we start with ACTION_MAIN intent and
|
||||
- // after FRE is complete. Native initialization can finish before the FRE flow is
|
||||
- // complete, and this will only show promos on the second opportunity. This is
|
||||
- // because the FRE is shown on the first opportunity, and we don't want to show such
|
||||
- // content back to back.
|
||||
- //
|
||||
- // 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();
|
||||
- // 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()
|
||||
- && preferenceManager.readBoolean(
|
||||
- ChromePreferenceManager.PROMOS_SKIPPED_ON_FIRST_START, false)
|
||||
- && !VrModuleProvider.getDelegate().isInVr()
|
||||
- // VrModuleProvider.getDelegate().isInVr may not return true at this point even
|
||||
- // though Chrome is about to enter VR, so we need to also check whether we're
|
||||
- // launching into VR.
|
||||
- && !VrModuleProvider.getIntentDelegate().isLaunchingIntoVr(this, getIntent())
|
||||
- && !isLegacyMultiWindow) {
|
||||
- isShowingPromo = maybeShowPromo();
|
||||
- } else {
|
||||
- preferenceManager.writeBoolean(
|
||||
+ preferenceManager.writeBoolean(
|
||||
ChromePreferenceManager.PROMOS_SKIPPED_ON_FIRST_START, true);
|
||||
- }
|
||||
|
||||
- ToolbarButtonInProductHelpController.create(this, isShowingPromo);
|
||||
+ ToolbarButtonInProductHelpController.create(this, false);
|
||||
|
||||
if (ChromeFeatureList.isEnabled(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)) {
|
||||
// We call getFeedAppLifecycle() here to ensure the app lifecycle is created so that
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 22:50:10 +0200
|
||||
Subject: Disable third-party cookies by default
|
||||
|
||||
author: Chad Miller <chad.miller@canonical.com>
|
||||
---
|
||||
components/content_settings/core/browser/cookie_settings.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
|
||||
--- a/components/content_settings/core/browser/cookie_settings.cc
|
||||
+++ b/components/content_settings/core/browser/cookie_settings.cc
|
||||
@@ -50,7 +50,7 @@ void CookieSettings::GetCookieSettings(
|
||||
void CookieSettings::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kBlockThirdPartyCookies, false,
|
||||
+ prefs::kBlockThirdPartyCookies, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,510 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 14 Apr 2019 12:08:27 +0200
|
||||
Subject: Disable unused permissions
|
||||
|
||||
Disable sync adaptive and invalidation services from manifest
|
||||
|
||||
Prevents authorization prompt for Play services on reboot
|
||||
|
||||
Fixes building with debug symbols:
|
||||
|
||||
ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
|
||||
>>> referenced by invalidation_service_util.cc:17 (../../components/invalidation/impl/invalidation_service_util.cc:17)
|
||||
>>> impl/invalidation_service_util.o:(invalidation::ParseNotifierOptions(base::CommandLine const&)) in archive obj/components/invalidation/impl/libimpl.a
|
||||
|
||||
Fixup more permission removal
|
||||
---
|
||||
chrome/android/BUILD.gn | 4 +-
|
||||
chrome/android/java/AndroidManifest.xml | 27 -----
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 34 ------
|
||||
.../invalidation/impl/invalidation_service_util.cc | 21 ----
|
||||
.../invalidation/impl/invalidation_service_util.h | 6 +-
|
||||
.../signin/SystemAccountManagerDelegate.java | 38 +------
|
||||
.../components/sync/AndroidSyncSettings.java | 24 +---
|
||||
.../chromium/net/HttpNegotiateAuthenticator.java | 122 +--------------------
|
||||
.../chromoting/base/OAuthTokenFetcher.java | 2 -
|
||||
9 files changed, 13 insertions(+), 265 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -1023,8 +1023,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",
|
||||
+ "java/res_template/xml/searchable.xml"
|
||||
]
|
||||
res_dir = "java/res_template"
|
||||
variables = [ "manifest_package=$manifest_package" ]
|
||||
@@ -1035,7 +1034,6 @@ jinja_template_resources("chrome_test_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"
|
||||
|
||||
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
|
||||
@@ -44,25 +44,19 @@ by a child template that "extends" this file.
|
||||
{% if target_sdk_version|int > 27 or target_sdk_version == "Q" %}
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
{% endif %}
|
||||
- <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
- <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||
{% if target_sdk_version|int > 28 or target_sdk_version == "Q" %}
|
||||
<uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGES"/>
|
||||
{% endif %}
|
||||
<uses-permission android:name="android.permission.NFC"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
- <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
|
||||
- <uses-permission android:name="android.permission.READ_SYNC_STATS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
- <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
|
||||
<uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
- <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
|
||||
{% set enable_vr = enable_vr|default(0) %}
|
||||
{% if enable_vr == "true" %}
|
||||
<!-- Indicates use of Android's VR-mode, available only on Android N+. -->
|
||||
@@ -100,8 +94,6 @@ by a child template that "extends" this file.
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
|
||||
|
||||
- <uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
|
||||
-
|
||||
{% block extra_uses_permissions %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -925,16 +917,6 @@ by a child template that "extends" this file.
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
- <!-- Sync adapter for browser invalidation. -->
|
||||
- <service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
|
||||
- android:exported="false">
|
||||
- <intent-filter>
|
||||
- <action android:name="android.content.SyncAdapter" />
|
||||
- </intent-filter>
|
||||
- <meta-data android:name="android.content.SyncAdapter"
|
||||
- android:resource="@xml/syncadapter" />
|
||||
- </service>
|
||||
-
|
||||
<!-- Broadcast receiver that will be notified of account changes -->
|
||||
<receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver">
|
||||
<intent-filter>
|
||||
@@ -1040,15 +1022,6 @@ by a child template that "extends" this file.
|
||||
<service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
|
||||
android:exported="false"/>
|
||||
|
||||
- <!-- Notification service for sync. -->
|
||||
- <meta-data android:name="ipc.invalidation.ticl.listener_service_class"
|
||||
- android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
|
||||
- <service android:name="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"
|
||||
- android:exported="false">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.ipc.invalidation.AUTH_TOKEN_REQUEST"/>
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
<service android:name="com.google.ipc.invalidation.ticl.android2.TiclService"
|
||||
android:exported="false"/>
|
||||
<service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"
|
||||
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
|
||||
@@ -127,8 +127,6 @@ import org.chromium.chrome.browser.share.ShareMenuActionHandler;
|
||||
import org.chromium.chrome.browser.snackbar.BottomContainer;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable;
|
||||
-import org.chromium.chrome.browser.sync.ProfileSyncService;
|
||||
-import org.chromium.chrome.browser.sync.SyncController;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabThemeColorHelper;
|
||||
import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager;
|
||||
@@ -259,9 +257,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
@SuppressLint("NewApi")
|
||||
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
||||
|
||||
- // Observes when sync becomes ready to create the mContextReporter.
|
||||
- private ProfileSyncService.SyncStateChangedListener mSyncStateChangedListener;
|
||||
-
|
||||
@Nullable
|
||||
private ChromeFullscreenManager mFullscreenManager;
|
||||
|
||||
@@ -966,28 +961,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
private void createContextReporterIfNeeded() {
|
||||
if (!mStarted) return; // Sync state reporting should work only in started state.
|
||||
if (mContextReporter != null || getActivityTab() == null) return;
|
||||
-
|
||||
- final SyncController syncController = SyncController.get(this);
|
||||
- final ProfileSyncService syncService = ProfileSyncService.get();
|
||||
-
|
||||
- if (syncController != null && syncController.isSyncingUrlsWithKeystorePassphrase()) {
|
||||
- assert syncService != null;
|
||||
- mContextReporter = AppHooks.get().createGsaHelper().getContextReporter(this);
|
||||
-
|
||||
- if (mSyncStateChangedListener != null) {
|
||||
- syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
|
||||
- mSyncStateChangedListener = null;
|
||||
- }
|
||||
-
|
||||
- return;
|
||||
- } else {
|
||||
- ContextReporter.reportSyncStatus(syncService);
|
||||
- }
|
||||
-
|
||||
- if (mSyncStateChangedListener == null && syncService != null) {
|
||||
- mSyncStateChangedListener = () -> createContextReporterIfNeeded();
|
||||
- syncService.addSyncStateChangedListener(mSyncStateChangedListener);
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1056,13 +1029,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
if (GSAState.getInstance(this).isGsaAvailable() && !SysUtils.isLowEndDevice()) {
|
||||
GSAAccountChangeListener.getInstance().disconnect();
|
||||
}
|
||||
- if (mSyncStateChangedListener != null) {
|
||||
- ProfileSyncService syncService = ProfileSyncService.get();
|
||||
- if (syncService != null) {
|
||||
- syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
|
||||
- }
|
||||
- mSyncStateChangedListener = null;
|
||||
- }
|
||||
if (mContextReporter != null) mContextReporter.disable();
|
||||
|
||||
super.onStopWithNative();
|
||||
diff --git a/components/invalidation/impl/invalidation_service_util.cc b/components/invalidation/impl/invalidation_service_util.cc
|
||||
--- a/components/invalidation/impl/invalidation_service_util.cc
|
||||
+++ b/components/invalidation/impl/invalidation_service_util.cc
|
||||
@@ -12,27 +12,6 @@
|
||||
|
||||
namespace invalidation {
|
||||
|
||||
-notifier::NotifierOptions ParseNotifierOptions(
|
||||
- const base::CommandLine& command_line) {
|
||||
- notifier::NotifierOptions notifier_options;
|
||||
-
|
||||
- if (command_line.HasSwitch(switches::kSyncNotificationHostPort)) {
|
||||
- notifier_options.xmpp_host_port =
|
||||
- net::HostPortPair::FromString(
|
||||
- command_line.GetSwitchValueASCII(
|
||||
- switches::kSyncNotificationHostPort));
|
||||
- DVLOG(1) << "Using " << notifier_options.xmpp_host_port.ToString()
|
||||
- << " for test sync notification server.";
|
||||
- }
|
||||
-
|
||||
- notifier_options.allow_insecure_connection =
|
||||
- command_line.HasSwitch(switches::kSyncAllowInsecureXmppConnection);
|
||||
- DVLOG_IF(1, notifier_options.allow_insecure_connection)
|
||||
- << "Allowing insecure XMPP connections.";
|
||||
-
|
||||
- return notifier_options;
|
||||
-}
|
||||
-
|
||||
std::string GenerateInvalidatorClientId() {
|
||||
// Generate a GUID with 128 bits worth of base64-encoded randomness.
|
||||
// This format is similar to that of sync's cache_guid.
|
||||
diff --git a/components/invalidation/impl/invalidation_service_util.h b/components/invalidation/impl/invalidation_service_util.h
|
||||
--- a/components/invalidation/impl/invalidation_service_util.h
|
||||
+++ b/components/invalidation/impl/invalidation_service_util.h
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_UTIL_H_
|
||||
#define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_UTIL_H_
|
||||
|
||||
-#include "jingle/notifier/base/notifier_options.h"
|
||||
+#include <string>
|
||||
|
||||
namespace base {
|
||||
class CommandLine;
|
||||
@@ -13,10 +13,6 @@ class CommandLine;
|
||||
|
||||
namespace invalidation {
|
||||
|
||||
-// Parses the given command line for notifier options.
|
||||
-notifier::NotifierOptions ParseNotifierOptions(
|
||||
- const base::CommandLine& command_line);
|
||||
-
|
||||
// Generates a unique client ID for the invalidator.
|
||||
std::string GenerateInvalidatorClientId();
|
||||
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
@@ -167,16 +167,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
|
||||
@Override
|
||||
public boolean hasFeatures(Account account, String[] features) {
|
||||
- if (!hasGetAccountsPermission()) {
|
||||
- return false;
|
||||
- }
|
||||
- try {
|
||||
- return mAccountManager.hasFeatures(account, features, null, null).getResult();
|
||||
- } catch (AuthenticatorException | IOException e) {
|
||||
- Log.e(TAG, "Error while checking features: ", e);
|
||||
- } catch (OperationCanceledException e) {
|
||||
- Log.e(TAG, "Checking features was cancelled. This should not happen.");
|
||||
- }
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -216,32 +206,10 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
public void updateCredentials(
|
||||
Account account, Activity activity, final Callback<Boolean> callback) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
- if (!hasManageAccountsPermission()) {
|
||||
- if (callback != null) {
|
||||
- ThreadUtils.postOnUiThread(() -> callback.onResult(false));
|
||||
- }
|
||||
- return;
|
||||
+ if (callback != null) {
|
||||
+ ThreadUtils.postOnUiThread(() -> callback.onResult(false));
|
||||
}
|
||||
-
|
||||
- AccountManagerCallback<Bundle> realCallback = future -> {
|
||||
- Bundle bundle = null;
|
||||
- try {
|
||||
- bundle = future.getResult();
|
||||
- } catch (AuthenticatorException | IOException e) {
|
||||
- Log.e(TAG, "Error while update credentials: ", e);
|
||||
- } catch (OperationCanceledException e) {
|
||||
- Log.w(TAG, "Updating credentials was cancelled.");
|
||||
- }
|
||||
- boolean success =
|
||||
- bundle != null && bundle.getString(AccountManager.KEY_ACCOUNT_TYPE) != null;
|
||||
- if (callback != null) {
|
||||
- callback.onResult(success);
|
||||
- }
|
||||
- };
|
||||
- // Android 4.4 throws NullPointerException if null is passed
|
||||
- Bundle emptyOptions = new Bundle();
|
||||
- mAccountManager.updateCredentials(
|
||||
- account, "android", emptyOptions, activity, realCallback, null);
|
||||
+ return;
|
||||
}
|
||||
|
||||
protected boolean hasGetAccountsPermission() {
|
||||
diff --git a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
|
||||
--- a/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
|
||||
+++ b/components/sync/android/java/src/org/chromium/components/sync/AndroidSyncSettings.java
|
||||
@@ -212,13 +212,7 @@ public class AndroidSyncSettings {
|
||||
|
||||
private void setChromeSyncEnabled(boolean value) {
|
||||
synchronized (mLock) {
|
||||
- updateSyncability(null);
|
||||
- if (value == mChromeSyncEnabled || mAccount == null) return;
|
||||
- mChromeSyncEnabled = value;
|
||||
-
|
||||
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
|
||||
- mSyncContentResolverDelegate.setSyncAutomatically(mAccount, mContractAuthority, value);
|
||||
- StrictMode.setThreadPolicy(oldPolicy);
|
||||
+ mChromeSyncEnabled = false;
|
||||
}
|
||||
notifyObservers();
|
||||
}
|
||||
@@ -299,19 +293,9 @@ public class AndroidSyncSettings {
|
||||
boolean oldChromeSyncEnabled = mChromeSyncEnabled;
|
||||
boolean oldMasterSyncEnabled = mMasterSyncEnabled;
|
||||
|
||||
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
|
||||
- if (mAccount != null) {
|
||||
- mIsSyncable =
|
||||
- mSyncContentResolverDelegate.getIsSyncable(mAccount, mContractAuthority)
|
||||
- == 1;
|
||||
- mChromeSyncEnabled = mSyncContentResolverDelegate.getSyncAutomatically(
|
||||
- mAccount, mContractAuthority);
|
||||
- } else {
|
||||
- mIsSyncable = false;
|
||||
- mChromeSyncEnabled = false;
|
||||
- }
|
||||
- mMasterSyncEnabled = mSyncContentResolverDelegate.getMasterSyncAutomatically();
|
||||
- StrictMode.setThreadPolicy(oldPolicy);
|
||||
+ mIsSyncable = false;
|
||||
+ mChromeSyncEnabled = false;
|
||||
+ mMasterSyncEnabled = false;
|
||||
|
||||
return oldChromeSyncEnabled != mChromeSyncEnabled
|
||||
|| oldMasterSyncEnabled != mMasterSyncEnabled;
|
||||
diff --git a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
|
||||
--- a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
|
||||
+++ b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
|
||||
@@ -96,50 +96,7 @@ public class HttpNegotiateAuthenticator {
|
||||
|
||||
@Override
|
||||
public void run(AccountManagerFuture<Account[]> future) {
|
||||
- Account[] accounts;
|
||||
- try {
|
||||
- accounts = future.getResult();
|
||||
- } catch (OperationCanceledException | AuthenticatorException | IOException e) {
|
||||
- Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to retrieve accounts.", e);
|
||||
- nativeSetResult(mRequestData.nativeResultObject, NetError.ERR_UNEXPECTED, null);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (accounts.length == 0) {
|
||||
- Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: No account provided for the kerberos "
|
||||
- + "authentication. Please verify the configuration policies and "
|
||||
- + "that the CONTACTS runtime permission is granted. ");
|
||||
- nativeSetResult(mRequestData.nativeResultObject,
|
||||
- NetError.ERR_MISSING_AUTH_CREDENTIALS, null);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (accounts.length > 1) {
|
||||
- Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: Found %d accounts eligible for the "
|
||||
- + "kerberos authentication. Please fix the configuration by "
|
||||
- + "providing a single account.",
|
||||
- accounts.length);
|
||||
- nativeSetResult(mRequestData.nativeResultObject,
|
||||
- NetError.ERR_MISSING_AUTH_CREDENTIALS, null);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (lacksPermission(ContextUtils.getApplicationContext(),
|
||||
- "android.permission.USE_CREDENTIALS", true)) {
|
||||
- // Protecting the AccountManager#getAuthToken call.
|
||||
- // API < 23 Requires the USE_CREDENTIALS permission or throws an exception.
|
||||
- // API >= 23 USE_CREDENTIALS permission is removed
|
||||
- Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: USE_CREDENTIALS permission not "
|
||||
- + "granted. Aborting authentication.");
|
||||
- nativeSetResult(mRequestData.nativeResultObject,
|
||||
- NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
|
||||
- return;
|
||||
- }
|
||||
- mRequestData.account = accounts[0];
|
||||
- mRequestData.accountManager.getAuthToken(mRequestData.account,
|
||||
- mRequestData.authTokenType, mRequestData.options, true /* notifyAuthFailure */,
|
||||
- new GetTokenCallback(mRequestData),
|
||||
- new Handler(ThreadUtils.getUiThreadLooper()));
|
||||
+ // account-based authentication removed for privacy-violations concerns
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,41 +109,7 @@ public class HttpNegotiateAuthenticator {
|
||||
|
||||
@Override
|
||||
public void run(AccountManagerFuture<Bundle> future) {
|
||||
- Bundle result;
|
||||
- try {
|
||||
- result = future.getResult();
|
||||
- } catch (OperationCanceledException | AuthenticatorException | IOException e) {
|
||||
- Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to obtain a token.", e);
|
||||
- nativeSetResult(mRequestData.nativeResultObject, NetError.ERR_UNEXPECTED, null);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (result.containsKey(AccountManager.KEY_INTENT)) {
|
||||
- final Context appContext = ContextUtils.getApplicationContext();
|
||||
-
|
||||
- // We wait for a broadcast that should be sent once the user is done interacting
|
||||
- // with the notification
|
||||
- // TODO(dgn) We currently hang around if the notification is swiped away, until
|
||||
- // a LOGIN_ACCOUNTS_CHANGED_ACTION filter is received. It might be for something
|
||||
- // unrelated then we would wait again here. Maybe we should limit the number of
|
||||
- // retries in some way?
|
||||
- BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
||||
-
|
||||
- @Override
|
||||
- public void onReceive(Context context, Intent intent) {
|
||||
- appContext.unregisterReceiver(this);
|
||||
- mRequestData.accountManager.getAuthToken(mRequestData.account,
|
||||
- mRequestData.authTokenType, mRequestData.options,
|
||||
- true /* notifyAuthFailure */, new GetTokenCallback(mRequestData),
|
||||
- null);
|
||||
- }
|
||||
-
|
||||
- };
|
||||
- appContext.registerReceiver(broadcastReceiver,
|
||||
- new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION));
|
||||
- } else {
|
||||
- processResult(result, mRequestData);
|
||||
- }
|
||||
+ // ditto
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,22 +222,7 @@ public class HttpNegotiateAuthenticator {
|
||||
*/
|
||||
private void requestTokenWithoutActivity(
|
||||
Context ctx, RequestData requestData, String[] features) {
|
||||
- if (lacksPermission(ctx, Manifest.permission.GET_ACCOUNTS, true /* onlyPreM */)) {
|
||||
- // Protecting the AccountManager#getAccountsByTypeAndFeatures call.
|
||||
- // API < 23 Requires the GET_ACCOUNTS permission or throws an exception.
|
||||
- // API >= 23 Requires the GET_ACCOUNTS permission (CONTACTS permission group) or
|
||||
- // returns only the accounts whose authenticator has a signature that
|
||||
- // matches our app. Working with this restriction and not requesting
|
||||
- // the permission is a valid use case in the context of WebView, so we
|
||||
- // don't require it on M+
|
||||
- Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: GET_ACCOUNTS permission not "
|
||||
- + "granted. Aborting authentication.");
|
||||
- nativeSetResult(requestData.nativeResultObject,
|
||||
- NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
|
||||
- return;
|
||||
- }
|
||||
- requestData.accountManager.getAccountsByTypeAndFeatures(mAccountType, features,
|
||||
- new GetAccountsCallback(requestData), new Handler(ThreadUtils.getUiThreadLooper()));
|
||||
+ // ditto
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,29 +241,7 @@ public class HttpNegotiateAuthenticator {
|
||||
*/
|
||||
private void requestTokenWithActivity(
|
||||
Context ctx, Activity activity, RequestData requestData, String[] features) {
|
||||
- boolean isPreM = Build.VERSION.SDK_INT < Build.VERSION_CODES.M;
|
||||
- String permission = isPreM
|
||||
- ? "android.permission.MANAGE_ACCOUNTS"
|
||||
- : Manifest.permission.GET_ACCOUNTS;
|
||||
-
|
||||
- // Check if the AccountManager#getAuthTokenByFeatures call can be made.
|
||||
- // API < 23 Requires the MANAGE_ACCOUNTS permission.
|
||||
- // API >= 23 Requires the GET_ACCOUNTS permission to behave properly. When it's not granted,
|
||||
- // accounts not managed by the current application can't be retrieved. Depending
|
||||
- // on the authenticator implementation, it might prompt to create an account, but
|
||||
- // that won't be saved. This would be a bad user experience, so we also consider
|
||||
- // it a failure case.
|
||||
- if (lacksPermission(ctx, permission, isPreM)) {
|
||||
- Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: %s permission not granted. "
|
||||
- + "Aborting authentication", permission);
|
||||
- nativeSetResult(requestData.nativeResultObject,
|
||||
- NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- requestData.accountManager.getAuthTokenByFeatures(mAccountType, requestData.authTokenType,
|
||||
- features, activity, null, requestData.options, new GetTokenCallback(requestData),
|
||||
- new Handler(ThreadUtils.getUiThreadLooper()));
|
||||
+ // ditto
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
|
||||
--- a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
|
||||
+++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
|
||||
@@ -93,7 +93,6 @@ public class OAuthTokenFetcher {
|
||||
|
||||
/** Begins fetching a token. Should be called on the main thread. */
|
||||
public void fetch() {
|
||||
- fetchImpl(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +101,6 @@ public class OAuthTokenFetcher {
|
||||
* @param expiredToken A previously-fetched token which has expired.
|
||||
*/
|
||||
public void clearAndFetch(String expiredToken) {
|
||||
- fetchImpl(expiredToken);
|
||||
}
|
||||
|
||||
private void fetchImpl(final String expiredToken) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
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,68 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 10 Nov 2018 19:47:39 +0100
|
||||
Subject: Do not grant notifications to default search engine
|
||||
|
||||
Block gelocation by default instead of granting it for non-enterprise use cases (almost the totality of users)
|
||||
---
|
||||
.../search_permissions/search_permissions_service.cc | 18 +++++-------------
|
||||
chrome/common/chrome_features.cc | 2 +-
|
||||
2 files changed, 6 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/android/search_permissions/search_permissions_service.cc b/chrome/browser/android/search_permissions/search_permissions_service.cc
|
||||
--- a/chrome/browser/android/search_permissions/search_permissions_service.cc
|
||||
+++ b/chrome/browser/android/search_permissions/search_permissions_service.cc
|
||||
@@ -344,11 +344,7 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
|
||||
return;
|
||||
}
|
||||
|
||||
- // If we get to here, the DSE is not disabled by enterprise policy. If it was
|
||||
- // previously enterprise controlled, we initialize the setting to BLOCK since
|
||||
- // we don't know what the user's setting was previously.
|
||||
- bool was_enterprise_controlled =
|
||||
- pref_service_->GetBoolean(prefs::kDSEWasDisabledByPolicy);
|
||||
+ // If we get to here, the DSE is not disabled by enterprise policy.
|
||||
pref_service_->ClearPref(prefs::kDSEWasDisabledByPolicy);
|
||||
|
||||
// Initialize the pref for geolocation if it hasn't been initialized yet.
|
||||
@@ -381,10 +377,8 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
|
||||
pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated);
|
||||
} else if (dse_geolocation_setting == CONTENT_SETTING_ASK) {
|
||||
// If the user hasn't explicitly allowed or blocked geolocation for the
|
||||
- // DSE, initialize it to allowed.
|
||||
- dse_geolocation_setting = was_enterprise_controlled
|
||||
- ? CONTENT_SETTING_BLOCK
|
||||
- : CONTENT_SETTING_ALLOW;
|
||||
+ // DSE, initialize it to disallowed.
|
||||
+ dse_geolocation_setting = CONTENT_SETTING_BLOCK;
|
||||
}
|
||||
|
||||
// Update the content setting with the auto-grants for the DSE.
|
||||
@@ -410,11 +404,9 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
|
||||
GetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
|
||||
ContentSetting dse_notifications_setting = notifications_setting_to_restore;
|
||||
// If the user hasn't explicitly allowed or blocked notifications for the
|
||||
- // DSE, initialize it to allowed.
|
||||
+ // DSE, initialize it to disallowed.
|
||||
if (dse_notifications_setting == CONTENT_SETTING_ASK) {
|
||||
- dse_notifications_setting = was_enterprise_controlled
|
||||
- ? CONTENT_SETTING_BLOCK
|
||||
- : CONTENT_SETTING_ALLOW;
|
||||
+ dse_notifications_setting = CONTENT_SETTING_BLOCK;
|
||||
}
|
||||
|
||||
// Update the content setting with the auto-grants for the DSE.
|
||||
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
|
||||
@@ -329,7 +329,7 @@ const base::Feature kGoogleBrandedContextMenu{
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
const base::Feature kGrantNotificationsToDSE{"GrantNotificationsToDSE",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 20 Jan 2019 06:20:10 +0100
|
||||
Subject: Do not ignore download location prompt setting
|
||||
|
||||
Upstream has decided that it works as intended (https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
|
||||
but users would like to decide where to save a file even when there is no SD card available;
|
||||
do not skip the prompt in such cases.
|
||||
---
|
||||
.../download/DownloadLocationDialogBridge.java | 71 +++++++---------------
|
||||
1 file changed, 21 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
|
||||
@@ -31,9 +31,6 @@ public class DownloadLocationDialogBridge implements ModalDialogProperties.Contr
|
||||
private PropertyModel mDialogModel;
|
||||
private DownloadLocationCustomView mCustomView;
|
||||
private ModalDialogManager mModalDialogManager;
|
||||
- private long mTotalBytes;
|
||||
- private @DownloadLocationDialogType int mDialogType;
|
||||
- private String mSuggestedPath;
|
||||
private Context mContext;
|
||||
|
||||
private DownloadLocationDialogBridge(long nativeDownloadLocationDialogBridge) {
|
||||
@@ -66,12 +63,28 @@ public class DownloadLocationDialogBridge implements ModalDialogProperties.Contr
|
||||
|
||||
mModalDialogManager = activity.getModalDialogManager();
|
||||
mContext = activity;
|
||||
- mTotalBytes = totalBytes;
|
||||
- mDialogType = dialogType;
|
||||
- mSuggestedPath = suggestedPath;
|
||||
|
||||
- DownloadDirectoryProvider.getInstance().getAllDirectoriesOptions(
|
||||
- (ArrayList<DirectoryOption> dirs) -> { onDirectoryOptionsRetrieved(dirs); });
|
||||
+ // Already showing the dialog.
|
||||
+ if (mDialogModel != null) return;
|
||||
+
|
||||
+ // Actually show the dialog.
|
||||
+ mCustomView = (DownloadLocationCustomView) LayoutInflater.from(mContext).inflate(
|
||||
+ R.layout.download_location_dialog, null);
|
||||
+ mCustomView.initialize(dialogType, new File(suggestedPath));
|
||||
+
|
||||
+ Resources resources = mContext.getResources();
|
||||
+ mDialogModel =
|
||||
+ new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
|
||||
+ .with(ModalDialogProperties.CONTROLLER, this)
|
||||
+ .with(ModalDialogProperties.TITLE, getTitle(totalBytes, dialogType))
|
||||
+ .with(ModalDialogProperties.CUSTOM_VIEW, mCustomView)
|
||||
+ .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, resources,
|
||||
+ R.string.duplicate_download_infobar_download_button)
|
||||
+ .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
|
||||
+ R.string.cancel)
|
||||
+ .build();
|
||||
+
|
||||
+ mModalDialogManager.showDialog(mDialogModel, ModalDialogManager.ModalDialogType.APP);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,48 +117,6 @@ public class DownloadLocationDialogBridge implements ModalDialogProperties.Contr
|
||||
mCustomView = null;
|
||||
}
|
||||
|
||||
- /**
|
||||
- * Called after retrieved the download directory options.
|
||||
- * @param dirs An list of available download directories.
|
||||
- */
|
||||
- private void onDirectoryOptionsRetrieved(ArrayList<DirectoryOption> dirs) {
|
||||
- // If there is only one directory available, don't show the default dialog, and set the
|
||||
- // download directory to default. Dialog will still show for other types of dialogs, like
|
||||
- // name conflict or disk error.
|
||||
- if (dirs.size() == 1 && mDialogType == DownloadLocationDialogType.DEFAULT) {
|
||||
- final DirectoryOption dir = dirs.get(0);
|
||||
- if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) {
|
||||
- assert(!TextUtils.isEmpty(dir.location));
|
||||
- PrefServiceBridge.getInstance().setDownloadAndSaveFileDefaultDirectory(
|
||||
- dir.location);
|
||||
- nativeOnComplete(mNativeDownloadLocationDialogBridge, mSuggestedPath);
|
||||
- }
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- // Already showing the dialog.
|
||||
- if (mDialogModel != null) return;
|
||||
-
|
||||
- // Actually show the dialog.
|
||||
- mCustomView = (DownloadLocationCustomView) LayoutInflater.from(mContext).inflate(
|
||||
- R.layout.download_location_dialog, null);
|
||||
- mCustomView.initialize(mDialogType, new File(mSuggestedPath));
|
||||
-
|
||||
- Resources resources = mContext.getResources();
|
||||
- mDialogModel =
|
||||
- new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
|
||||
- .with(ModalDialogProperties.CONTROLLER, this)
|
||||
- .with(ModalDialogProperties.TITLE, getTitle(mTotalBytes, mDialogType))
|
||||
- .with(ModalDialogProperties.CUSTOM_VIEW, mCustomView)
|
||||
- .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, resources,
|
||||
- R.string.duplicate_download_infobar_download_button)
|
||||
- .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
|
||||
- R.string.cancel)
|
||||
- .build();
|
||||
-
|
||||
- mModalDialogManager.showDialog(mDialogModel, ModalDialogManager.ModalDialogType.APP);
|
||||
- }
|
||||
-
|
||||
private String getTitle(long totalBytes, @DownloadLocationDialogType int dialogType) {
|
||||
switch (dialogType) {
|
||||
case DownloadLocationDialogType.LOCATION_FULL:
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 23:17:17 +0200
|
||||
Subject: Do not store passwords by default
|
||||
|
||||
---
|
||||
components/password_manager/core/browser/password_manager.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
|
||||
--- a/components/password_manager/core/browser/password_manager.cc
|
||||
+++ b/components/password_manager/core/browser/password_manager.cc
|
||||
@@ -333,10 +333,10 @@ void RecordParsingOnSavingDifference(
|
||||
void PasswordManager::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kCredentialsEnableService, true,
|
||||
+ prefs::kCredentialsEnableService, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kCredentialsEnableAutosignin, true,
|
||||
+ prefs::kCredentialsEnableAutosignin, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
|
||||
PrefRegistry::NO_REGISTRATION_FLAGS);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Thu, 22 Dec 2016 07:15:34 -0500
|
||||
Subject: Enable -fwrapv in Clang for non-UBSan builds
|
||||
|
||||
Using -fwrapv (notably only when not using signed integer overflow checking -
|
||||
since it will override it and result in not performing checks) is just common
|
||||
sense since it eliminates the chance of security vulnerabilities being
|
||||
introduced by optimizations based on signed overflow being undefined.
|
||||
That has happened before, and those optimizations don't even add up to a 0.1%
|
||||
performance increase for this kind of software. It's not worth having.
|
||||
The Linux kernel passes -fwrapv and also -fno-strict-aliasing to disable those
|
||||
dangerous optimizations (since there is so much incorrect code they can break).
|
||||
In fact, it is easy to point to dozens of known examples of invalid code that
|
||||
could potentially be broken by those optimizations.
|
||||
|
||||
It is not acceptable for projects to be using optimizations that are known to
|
||||
be broken with a bunch of code in their tree.
|
||||
They put barely any effort into even fixing the known cases.
|
||||
Chromium has blacklists for UBSan for 'false positives' (none of which are
|
||||
actually false positives, but rather "undefined, but not a bug beyond
|
||||
potentially being broken by optimizations or even code generation without
|
||||
them") and also for components too full of these bugs for them to currently
|
||||
want to bother with it. That includes a bunch of signed overflow issues
|
||||
(there is sadly no detection for aliasing violations, which are fairly common,
|
||||
but not that common).
|
||||
|
||||
Ideally, -fwrapv could be always passed, but unfortunately the way it is
|
||||
implemented has silly interactions with other switches.
|
||||
The reason it would still make sense to pass it is because due to their UBSan
|
||||
blacklists, they get far from full coverage with it, so -fwrapv would still
|
||||
be better than nothing where it's not being used.
|
||||
|
||||
Since -fwrapv makes signed integer overflow well-defined, Clang will disable
|
||||
the UBSan checks for signed integer overflow, including in the
|
||||
production-oriented trapping mode used for hardening.
|
||||
|
||||
Excerpt from https://github.com/bromite/bromite/issues/226
|
||||
---
|
||||
build/config/compiler/BUILD.gn | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -272,6 +272,10 @@ config("compiler") {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (is_clang && !is_ubsan && !is_ubsan_security) {
|
||||
+ cflags += [ "-fwrapv" ]
|
||||
+ }
|
||||
+
|
||||
# Linker warnings.
|
||||
if (fatal_linker_warnings && !(is_chromeos && current_cpu == "arm") &&
|
||||
!(is_android && use_order_profiling) && !is_mac && !is_ios &&
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 2 Nov 2018 14:06:17 +0100
|
||||
Subject: Enable history requirement of user gesture
|
||||
|
||||
Set #enable-history-entry-requires-user-gesture to enabled by default
|
||||
---
|
||||
chrome/browser/about_flags.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1199,7 +1199,7 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-history-entry-requires-user-gesture",
|
||||
flag_descriptions::kHistoryRequiresUserGestureName,
|
||||
flag_descriptions::kHistoryRequiresUserGestureDescription, kOsAll,
|
||||
- SINGLE_VALUE_TYPE(switches::kHistoryEntryRequiresUserGesture)},
|
||||
+ SINGLE_DISABLE_VALUE_TYPE(switches::kHistoryEntryRequiresUserGesture)},
|
||||
{"enable-history-manipulation-intervention",
|
||||
flag_descriptions::kHistoryManipulationIntervention,
|
||||
flag_descriptions::kHistoryManipulationInterventionDescription, kOsAll,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 14 Apr 2019 12:02:57 +0200
|
||||
Subject: Enable night mode menu entry by default
|
||||
|
||||
---
|
||||
chrome/browser/android/chrome_feature_list.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/android/chrome_feature_list.cc
|
||||
@@ -222,7 +222,7 @@ const base::Feature kAdjustWebApkInstallationSpace = {
|
||||
"AdjustWebApkInstallationSpace", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kAndroidNightMode{"AndroidNightMode",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kAndroidNightModeCCT{"AndroidNightModeCCT",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 15 Mar 2019 10:05:14 +0100
|
||||
Subject: Enable secure DNS mode by default in DnsTransaction.
|
||||
|
||||
---
|
||||
net/dns/host_resolver_impl.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
|
||||
--- a/net/dns/host_resolver_impl.cc
|
||||
+++ b/net/dns/host_resolver_impl.cc
|
||||
@@ -984,7 +984,7 @@ class HostResolverImpl::DnsTask : public base::SupportsWeakPtr<DnsTask> {
|
||||
base::BindOnce(&DnsTask::OnTransactionComplete,
|
||||
base::Unretained(this), tick_clock_->NowTicks(),
|
||||
dns_query_type),
|
||||
- net_log_, SecureDnsMode::AUTOMATIC);
|
||||
+ net_log_, SecureDnsMode::SECURE);
|
||||
trans->SetRequestContext(delegate_->url_request_context());
|
||||
trans->SetRequestPriority(delegate_->priority());
|
||||
return trans;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 17 Mar 2019 19:09:00 +0100
|
||||
Subject: Enable site per process isolation for devices with enough memory
|
||||
|
||||
---
|
||||
chrome/common/chrome_features.cc | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -559,11 +559,7 @@ const base::Feature kShowTrustedPublisherURL{"ShowTrustedPublisherURL",
|
||||
// browser_features, as they are only used on the browser side.
|
||||
const base::Feature kSitePerProcess {
|
||||
"site-per-process",
|
||||
-#if defined(OS_ANDROID)
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#else
|
||||
base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#endif
|
||||
};
|
||||
|
||||
// Controls a mode for dynamically process-isolating sites where the user has
|
||||
@@ -585,7 +581,7 @@ const base::Feature kSiteIsolationForPasswordSites{
|
||||
// base::SysInfo::AmountOfPhysicalMemoryMB().
|
||||
const base::Feature kSitePerProcessOnlyForHighMemoryClients{
|
||||
"site-per-process-only-for-high-memory-clients",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
const char kSitePerProcessOnlyForHighMemoryClientsParamName[] =
|
||||
"site-per-process-low-memory-cutoff-mb";
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 20 Jan 2018 19:44:43 +0100
|
||||
Subject: Fix crash when accessing page info / site settings
|
||||
|
||||
---
|
||||
chrome/browser/permissions/permission_manager.cc | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
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
|
||||
@@ -695,6 +695,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
|
||||
if (status != CONTENT_SETTING_DEFAULT)
|
||||
return PermissionResult(status, PermissionStatusSource::UNSPECIFIED);
|
||||
PermissionContextBase* context = GetPermissionContext(permission);
|
||||
+ if (context == nullptr) {
|
||||
+ return PermissionResult(CONTENT_SETTING_BLOCK, PermissionStatusSource::UNSPECIFIED);
|
||||
+ }
|
||||
PermissionResult result = context->GetPermissionStatus(
|
||||
render_frame_host, canonical_requesting_origin.GetOrigin(),
|
||||
embedding_origin.GetOrigin());
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Sun, 13 Aug 2017 19:33:04 -0400
|
||||
Subject: Hide passwords manager link
|
||||
|
||||
---
|
||||
.../chrome/browser/preferences/password/SavePasswordsPreferences.java | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java
|
||||
@@ -249,7 +249,7 @@ public class SavePasswordsPreferences
|
||||
return;
|
||||
}
|
||||
|
||||
- displayManageAccountLink();
|
||||
+ //displayManageAccountLink();
|
||||
|
||||
PreferenceGroup passwordParent;
|
||||
if (mSearchQuery == null) {
|
||||
@@ -324,7 +324,7 @@ public class SavePasswordsPreferences
|
||||
return;
|
||||
}
|
||||
|
||||
- displayManageAccountLink();
|
||||
+ //displayManageAccountLink();
|
||||
|
||||
PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
|
||||
profileCategory.setKey(PREF_KEY_CATEGORY_EXCEPTIONS);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:03:29 +0200
|
||||
Subject: Hide send reports checkbox
|
||||
|
||||
---
|
||||
chrome/android/java/res/layout/fre_tosanduma.xml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/fre_tosanduma.xml b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
--- a/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
+++ b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.4"
|
||||
android:text="@string/fre_send_report_check"
|
||||
- android:textAppearance="@style/TextAppearance.BlackBodyDefault" />
|
||||
+ android:textAppearance="@style/TextAppearance.BlackBodyDefault" android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,279 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:09:24 +0200
|
||||
Subject: Modify default preferences
|
||||
|
||||
---
|
||||
chrome/browser/background/background_mode_manager.cc | 2 +-
|
||||
chrome/browser/chrome_content_browser_client.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.h | 2 +-
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
.../settings/reset_page/reset_profile_dialog.html | 2 +-
|
||||
chrome/browser/signin/signin_promo.cc | 2 +-
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
|
||||
chrome/browser/ui/navigation_correction_tab_observer.cc | 2 +-
|
||||
.../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 | 14 ++++----------
|
||||
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, 22 insertions(+), 40 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
|
||||
@@ -352,7 +352,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
|
||||
registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
|
||||
#endif
|
||||
- registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
|
||||
}
|
||||
|
||||
void BackgroundModeManager::RegisterProfile(Profile* profile) {
|
||||
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -1122,7 +1122,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
|
||||
void ChromeContentBrowserClient::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
|
||||
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
|
||||
registry->RegisterListPref(prefs::kEnableDeprecatedWebPlatformFeatures);
|
||||
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
|
||||
// user policy in addition to the same named ones in Local State (which are
|
||||
diff --git a/chrome/browser/net/prediction_options.cc b/chrome/browser/net/prediction_options.cc
|
||||
--- a/chrome/browser/net/prediction_options.cc
|
||||
+++ b/chrome/browser/net/prediction_options.cc
|
||||
@@ -32,7 +32,7 @@ NetworkPredictionStatus CanPrefetchAndPrerender(
|
||||
}
|
||||
return NetworkPredictionStatus::DISABLED_DUE_TO_NETWORK;
|
||||
default:
|
||||
- DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
+ //DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
return NetworkPredictionStatus::DISABLED_ALWAYS;
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/net/prediction_options.h b/chrome/browser/net/prediction_options.h
|
||||
--- a/chrome/browser/net/prediction_options.h
|
||||
+++ b/chrome/browser/net/prediction_options.h
|
||||
@@ -23,7 +23,7 @@ enum NetworkPredictionOptions {
|
||||
NETWORK_PREDICTION_ALWAYS,
|
||||
NETWORK_PREDICTION_WIFI_ONLY,
|
||||
NETWORK_PREDICTION_NEVER,
|
||||
- NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_WIFI_ONLY,
|
||||
+ NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_NEVER,
|
||||
};
|
||||
|
||||
enum class NetworkPredictionStatus {
|
||||
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
|
||||
--- a/chrome/browser/profiles/profile.cc
|
||||
+++ b/chrome/browser/profiles/profile.cc
|
||||
@@ -139,7 +139,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
|
||||
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kSearchSuggestEnabled,
|
||||
- true,
|
||||
+ false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
#if defined(OS_ANDROID)
|
||||
registry->RegisterStringPref(
|
||||
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
|
||||
--- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
|
||||
+++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
|
||||
@@ -52,7 +52,7 @@
|
||||
</paper-button>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
- <cr-checkbox id="sendSettings" checked>
|
||||
+ <cr-checkbox id="sendSettings">
|
||||
$i18nRaw{resetPageFeedback}</cr-checkbox>
|
||||
</div>
|
||||
</cr-dialog>
|
||||
diff --git a/chrome/browser/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
|
||||
@@ -172,7 +172,7 @@ bool IsAutoCloseEnabledInEmbeddedURL(const GURL& url) {
|
||||
|
||||
void RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
- registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, false);
|
||||
registry->RegisterBooleanPref(prefs::kSignInPromoShowNTPBubble, false);
|
||||
registry->RegisterIntegerPref(prefs::kDiceSigninUserMenuPromoCount, 0);
|
||||
}
|
||||
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
|
||||
@@ -68,11 +68,11 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kOfferTranslateEnabled, true,
|
||||
+ prefs::kOfferTranslateEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
|
||||
- registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, false);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
|
||||
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
|
||||
diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
--- a/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
+++ b/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
@@ -57,7 +57,7 @@ NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {
|
||||
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* prefs) {
|
||||
prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled,
|
||||
- true,
|
||||
+ false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
@@ -127,10 +127,6 @@ void LocalDiscoveryUI::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kLocalDiscoveryNotificationsEnabled,
|
||||
-#if defined(OS_WIN)
|
||||
false,
|
||||
-#else
|
||||
- true,
|
||||
-#endif
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
||||
diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc
|
||||
--- a/chrome/service/cloud_print/connector_settings.cc
|
||||
+++ b/chrome/service/cloud_print/connector_settings.cc
|
||||
@@ -60,7 +60,7 @@ void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
|
||||
DCHECK(server_url_.is_valid());
|
||||
|
||||
connect_new_printers_ = prefs->GetBoolean(
|
||||
- prefs::kCloudPrintConnectNewPrinters, true);
|
||||
+ prefs::kCloudPrintConnectNewPrinters, false);
|
||||
|
||||
xmpp_ping_enabled_ = prefs->GetBoolean(
|
||||
prefs::kCloudPrintXmppPingEnabled, false);
|
||||
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
|
||||
--- a/components/autofill/core/browser/autofill_manager.cc
|
||||
+++ b/components/autofill/core/browser/autofill_manager.cc
|
||||
@@ -359,10 +359,7 @@ bool AutofillManager::ShouldParseForms(const std::vector<FormData>& forms,
|
||||
bool enabled = IsAutofillEnabled();
|
||||
sync_state_ = personal_data_ ? personal_data_->GetSyncSigninState()
|
||||
: AutofillSyncSigninState::kNumSyncStates;
|
||||
- if (!has_logged_autofill_enabled_) {
|
||||
- AutofillMetrics::LogIsAutofillEnabledAtPageLoad(enabled, sync_state_);
|
||||
- has_logged_autofill_enabled_ = true;
|
||||
- }
|
||||
+ has_logged_autofill_enabled_ = true;
|
||||
|
||||
return enabled;
|
||||
}
|
||||
@@ -625,10 +622,7 @@ void AutofillManager::OnQueryFormFieldAutofillImpl(
|
||||
// suggestions available.
|
||||
// TODO(mathp): Differentiate between number of suggestions available
|
||||
// (current metric) and number shown to the user.
|
||||
- if (!has_logged_address_suggestions_count_) {
|
||||
- AutofillMetrics::LogAddressSuggestionsCount(suggestions.size());
|
||||
- has_logged_address_suggestions_count_ = true;
|
||||
- }
|
||||
+ has_logged_address_suggestions_count_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1234,8 +1228,8 @@ void AutofillManager::Reset() {
|
||||
#if defined(OS_ANDROID) || defined(OS_IOS)
|
||||
autofill_assistant_.Reset();
|
||||
#endif
|
||||
- has_logged_autofill_enabled_ = false;
|
||||
- has_logged_address_suggestions_count_ = false;
|
||||
+ has_logged_autofill_enabled_ = true;
|
||||
+ has_logged_address_suggestions_count_ = true;
|
||||
did_show_suggestions_ = false;
|
||||
user_did_type_ = false;
|
||||
user_did_autofill_ = false;
|
||||
diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc
|
||||
--- a/components/autofill/core/common/autofill_prefs.cc
|
||||
+++ b/components/autofill/core/common/autofill_prefs.cc
|
||||
@@ -137,10 +137,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
prefs::kAutofillBillingCustomerNumber, 0.0,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kAutofillEnabledDeprecated, true,
|
||||
+ prefs::kAutofillEnabledDeprecated, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kAutofillProfileEnabled, true,
|
||||
+ prefs::kAutofillProfileEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kAutofillLastVersionDeduped, 0,
|
||||
@@ -153,7 +153,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
|
||||
@@ -440,12 +440,12 @@ void GetBookmarksMatchingProperties(BookmarkModel* model,
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowBookmarkBar,
|
||||
- false,
|
||||
+ true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, true);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowAppsShortcutInBookmarkBar,
|
||||
- true,
|
||||
+ false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowManagedBookmarksInBookmarkBar,
|
||||
diff --git a/components/safe_browsing/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
|
||||
@@ -149,9 +149,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kSafeBrowsingExtendedReportingOptInAllowed, true);
|
||||
+ prefs::kSafeBrowsingExtendedReportingOptInAllowed, false);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kSafeBrowsingEnabled, true,
|
||||
+ prefs::kSafeBrowsingEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled,
|
||||
false);
|
||||
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
|
||||
--- a/extensions/common/extension.cc
|
||||
+++ b/extensions/common/extension.cc
|
||||
@@ -367,14 +367,6 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
|
||||
if (is_theme())
|
||||
return false;
|
||||
|
||||
- // Hide component extensions because they are only extensions as an
|
||||
- // implementation detail of Chrome.
|
||||
- if (extensions::Manifest::IsComponentLocation(location()) &&
|
||||
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
- switches::kShowComponentExtensionOptions)) {
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
// Unless they are unpacked, never show hosted apps. Note: We intentionally
|
||||
// show packaged apps and platform apps because there are some pieces of
|
||||
// functionality that are only available in chrome://extensions/ but which
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 14 Feb 2018 12:56:01 +0100
|
||||
Subject: Never fetch popular sites
|
||||
|
||||
---
|
||||
components/ntp_tiles/popular_sites_impl.cc | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
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
|
||||
@@ -287,6 +287,12 @@ bool PopularSitesImpl::MaybeStartFetch(bool force_download,
|
||||
DCHECK(!callback_);
|
||||
callback_ = callback;
|
||||
|
||||
+ if (force_download) {
|
||||
+ callback_.Run(true);
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+
|
||||
const base::Time last_download_time = base::Time::FromInternalValue(
|
||||
prefs_->GetInt64(prefs::kPopularSitesLastDownloadPref));
|
||||
const base::TimeDelta time_since_last_download =
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:43:35 +0100
|
||||
Subject: Never send any crash upload data
|
||||
|
||||
---
|
||||
chrome/browser/tracing/crash_service_uploader.cc | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
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
|
||||
@@ -127,6 +127,9 @@ void TraceCrashServiceUploader::DoUpload(
|
||||
std::unique_ptr<const base::DictionaryValue> metadata,
|
||||
const UploadProgressCallback& progress_callback,
|
||||
UploadDoneCallback done_callback) {
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
progress_callback_ = progress_callback;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 28 Oct 2018 14:11:50 +0100
|
||||
Subject: Offer builtin autocomplete for chrome://flags
|
||||
|
||||
---
|
||||
chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
||||
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
||||
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
|
||||
@@ -234,6 +234,8 @@ std::vector<base::string16>
|
||||
ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
|
||||
std::vector<base::string16> builtins_to_provide;
|
||||
builtins_to_provide.push_back(
|
||||
+ base::ASCIIToUTF16(chrome::kChromeUIFlagsURL));
|
||||
+ builtins_to_provide.push_back(
|
||||
base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL));
|
||||
#if !defined(OS_ANDROID)
|
||||
builtins_to_provide.push_back(
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
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
|
||||
@@ -400,6 +400,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
|
||||
|
||||
@@ -1,24 +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 | 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
|
||||
@@ -521,7 +521,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
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 2 Apr 2015 12:44:23 +0200
|
||||
Subject: Remove EV certificates
|
||||
|
||||
The team chose to let EV certificates appear just like normal
|
||||
certificates. The web of trust is considered a failure in itself, so
|
||||
do not give users a false sense of extra security with EV certs.
|
||||
Instead, let them appear just like regular ones.
|
||||
---
|
||||
net/cert/ev_root_ca_metadata.cc | 13 +++++++++----
|
||||
net/cert/ev_root_ca_metadata.h | 6 ++----
|
||||
2 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
|
||||
--- a/net/cert/ev_root_ca_metadata.cc
|
||||
+++ b/net/cert/ev_root_ca_metadata.cc
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "net/cert/ev_root_ca_metadata.h"
|
||||
|
||||
-#if defined(USE_NSS_CERTS)
|
||||
+#if defined(USE_NSS_CERTS) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
#include <cert.h>
|
||||
#include <pkcs11n.h>
|
||||
#include <secerr.h>
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "net/der/input.h"
|
||||
-#if defined(USE_NSS_CERTS)
|
||||
+#if defined(USE_NSS_CERTS) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
#include "crypto/nss_util.h"
|
||||
#elif defined(PLATFORM_USES_CHROMIUM_EV_METADATA) || defined(OS_WIN)
|
||||
#include "third_party/boringssl/src/include/openssl/bytestring.h"
|
||||
@@ -763,7 +763,7 @@ EVRootCAMetadata* EVRootCAMetadata::GetInstance() {
|
||||
return g_ev_root_ca_metadata.Pointer();
|
||||
}
|
||||
|
||||
-#if defined(USE_NSS_CERTS)
|
||||
+#if defined(USE_NSS_CERTS) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
|
||||
namespace {
|
||||
// Converts a DER-encoded OID (without leading tag and length) to a SECOidTag.
|
||||
@@ -1045,6 +1045,11 @@ bool EVRootCAMetadata::RemoveEVCA(const SHA256HashValue& fingerprint) {
|
||||
// metadata.
|
||||
//
|
||||
|
||||
+bool EVRootCAMetadata::IsCaBrowserForumEvOid(PolicyOID policy_oid) {
|
||||
+ LOG(WARNING) << "Not implemented";
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
bool EVRootCAMetadata::IsEVPolicyOID(PolicyOID policy_oid) const {
|
||||
LOG(WARNING) << "Not implemented";
|
||||
return false;
|
||||
@@ -1084,7 +1089,7 @@ bool EVRootCAMetadata::RemoveEVCA(const SHA256HashValue& fingerprint) {
|
||||
|
||||
EVRootCAMetadata::EVRootCAMetadata() {
|
||||
// Constructs the object from the raw metadata in kEvRootCaMetadata.
|
||||
-#if defined(USE_NSS_CERTS)
|
||||
+#if defined(USE_NSS_CERTS) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
crypto::EnsureNSSInit();
|
||||
|
||||
for (const auto& ev_root : kEvRootCaMetadata) {
|
||||
diff --git a/net/cert/ev_root_ca_metadata.h b/net/cert/ev_root_ca_metadata.h
|
||||
--- a/net/cert/ev_root_ca_metadata.h
|
||||
+++ b/net/cert/ev_root_ca_metadata.h
|
||||
@@ -24,7 +24,7 @@
|
||||
defined(OS_FUCHSIA)
|
||||
// When not defined, the EVRootCAMetadata singleton is a dumb placeholder
|
||||
// implementation that will fail all EV lookup operations.
|
||||
-#define PLATFORM_USES_CHROMIUM_EV_METADATA
|
||||
+//#define PLATFORM_USES_CHROMIUM_EV_METADATA
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
@@ -68,12 +68,10 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
|
||||
bool HasEVPolicyOIDGivenBytes(const SHA256HashValue& fingerprint,
|
||||
const der::Input& policy_oid) const;
|
||||
|
||||
-#if defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
// Returns true if |policy_oid| is for 2.23.140.1.1 (CA/Browser Forum's
|
||||
// Extended Validation Policy). This is used as a hack by the
|
||||
// platform-specific CertVerifyProcs when doing EV verification.
|
||||
static bool IsCaBrowserForumEvOid(PolicyOID policy_oid);
|
||||
-#endif
|
||||
|
||||
// AddEVCA adds an EV CA to the list of known EV CAs with the given policy.
|
||||
// |policy| is expressed as a string of dotted numbers. It returns true on
|
||||
@@ -90,7 +88,7 @@ class NET_EXPORT_PRIVATE EVRootCAMetadata {
|
||||
EVRootCAMetadata();
|
||||
~EVRootCAMetadata();
|
||||
|
||||
-#if defined(USE_NSS_CERTS)
|
||||
+#if defined(USE_NSS_CERTS) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
using PolicyOIDMap = std::map<SHA256HashValue, std::vector<PolicyOID>>;
|
||||
|
||||
// RegisterOID registers |policy|, a policy OID in dotted string form, and
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Wed, 22 Mar 2017 19:10:30 -0400
|
||||
Subject: Remove background sync and translate menu options
|
||||
|
||||
---
|
||||
.../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
|
||||
GIT binary patch
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
literal 399
|
||||
zcmV;A0dW3_P)<h;3K|Lk000e1NJLTq001Na001Ni1ONa4O9@aD00042Nkl<ZcwWuc
|
||||
zJxjwt0LJme7er{c_yr2Oml}2V3s~G9aP6!}z(tU5et?4AT-<~%x+sFhO}e^tsU(Y=
|
||||
z0hgddd^pNsLc+Z{l>hP^9KR_C@$!FaVIla45F@WCMg$)o)DW3mQKSdON+{NY%D^rw
|
||||
zQ6|u}ti|NX7$R7iF@)z*9c+qa0?AUm<7d7%a4MD+^aKw>u^zc5))3o43mLu<Vh_0s
|
||||
z^onI1i*NbG31VmP*$I~u^o9@~3%Mjy{|2j}Ph4OPO<b`i*Ms^ERzc?^JnUm8&>5G;
|
||||
z8!SRo0o`C5w_HXQp+hq2?!?{u8c0%8C3Jue>()aulqxVESiz93aydblXyA)AxSXIZ
|
||||
z^u+3MIY49igeSZ=wug@XJ`tWQp%m)~(480Xl-fZ9?!ILEyg9Ig+E_v&p@gTlA*4tf
|
||||
tij`2N2SrL~qywpbE;5V|EcpMCd%u4DGPZTzo=E@z002ovPDHLkV1m$asKNjM
|
||||
|
||||
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
|
||||
GIT binary patch
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
literal 284
|
||||
zcmV+%0ptFOP)<h;3K|Lk000e1NJLTq000;O000;W1ONa4N`Cco0002vNkl<ZcwV*C
|
||||
zy$-=p90hPI21^H{kVr7~0h$;*gq(zkcms==tbG8pC$M2)sTe$f#Kz1feE^(W(wipt
|
||||
z>YqeTIHw=KscAEhFY_CKhZ7#j@Qh~#`t~HT1AWt&iOFYBic(;rl@5Y9UG&&#fH`9r
|
||||
zbqhPT0Nhc-8hg~aB!JnVj0zT9La;<0Ijq#SJr@m*036I22Uj!E;6TtuAD4*o-y97Z
|
||||
ziWuYbs-FagXn-mvsLH_>O?Hzl1RVtIfGq+yWZ%bGZULC0h?xp|DgiD=uf=xl!2Uvo
|
||||
icHkLEh=B&e`~;qlBW{m=6s{@&0000<MNUMnLSTX)y>C|l
|
||||
|
||||
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
|
||||
GIT binary patch
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
literal 547
|
||||
zcmV+;0^I$HP)<h;3K|Lk000e1NJLTq001xm001xu1ONa4{R=S+0005%Nkl<ZcwX(-
|
||||
zziU%b9ER~X&>vK2=pT?4!CJ8B5V|`lSO?MdsRak2|3E2<Ew~ov3nC6K4yBGdHyIT=
|
||||
z*iKQTa&gEaRP2_R<9E1(_FiJ{F<-%<Je=X3K5*}FI12x`^1wNOsFIKphLn;}MY&1<
|
||||
zRa%6SwW!7e2_d2+9!QG-C&)S}0;KUkhyudj0~b#<hpahU{YD2gq>+I}uBO%C0%8~2
|
||||
zqX2{ZjJTXFC*U;?c-ddi5s!R<4~S{LXX_djTCRX~3-JV7yh7Y2cms!wTkrY83}bwB
|
||||
z2dpi`B^D8n3HSqaSVYzpI`{+pWDRAl*>VMX>`+5Y@YI?>wsz=YK)L(kPe6xV>d0E+
|
||||
zF#Fw0h$>%W?u)^|9b`@O%&0zU>qXpsF&Oy9RW@l8a&@DCv<Q46cvb|~;{k3U>t;Ei
|
||||
z!kb9ohzhbQ9F+l#U_I(XZ6fPFVyg@=tm03vA!hhtr^YXT;4QKq66}a~{=i*iH3)XZ
|
||||
zJ#V1R7-E(l!Okq>w0(hXWNl<?1F`K3EFkM3TL*{*PoRnN1<~{aRuPk2Kh<Oqt6sn{
|
||||
zQ;3x_<Vp}z9QyzXvi8mZd)X7f1*jwDbN5@1`5@{JK-uDfGz#d(14$IH9}C1i5_>Gi
|
||||
l0_C5%UG`c2pI-Xsz;EN&!BMZ3jZy#r002ovPDHLkV1l>+@2da+
|
||||
|
||||
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
|
||||
GIT binary patch
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
literal 793
|
||||
zcmV+!1LpjRP)<h;3K|Lk000e1NJLTq002k;002k`1ONa4|Kxkj0008uNkl<ZcwX(=
|
||||
z%}Z2a6vy!qU&7QD6$CjgbzuaFrMYX-gy1F-TYN#>*(&T0P^f5;ixxw==!FDzQOmLj
|
||||
zW)TU|$~Iz9Aez>~5MeSGNzOdU;V@i=JI&0U$NLB~{9rb}%fp9z&%hk!M$92gIe;pl
|
||||
z3Wyj9l9(csBteWw5h(;j9dXi_fJqal&Mqj9DKT-2AY!CT2BnGF10^sPlCTEKJIX71
|
||||
z)JmT5wgxg*K&DJUmwnQupf11mfI$K*D&+>^c2@3W<t}H1aS^@Zph5Z5CZJigaScjR
|
||||
zMTBa$!Uuig{eHe=HE-q67$$tsm>kf|A8$jyfS$PkZE!?L6P{+3Y9btC#|6l6Q$SJA
|
||||
zJsJ|?2*wTQCyfHQr_G#j>iOXcWOyKi8a`n7&M5)i$G8LSaX}DgSmV5K&hghJ$naGk
|
||||
zn|yMVCHFr+W;};YV_bu_81R4w*m4VcMRV41&CGcb!S=Xdpk;b9jBZ}iok8`oEP#^s
|
||||
zxZ*(HxIwJ~nwTJkA;knuN_trO9#=T%BSV6b(8Ic?TcZbSdt70l>n4JR)6DpO>*nq3
|
||||
zafN}FIj#?Cl$~5NU<H)S4chdQct;y?eqjzexj|EYm%9W-*|Z3FLPYa42uQ+JQr19S
|
||||
z8PKI*ASGG4OG`vN`5X|W4{pi=YD6F%bO`8HV30TDOK#3CCj|0{M*=#@u3OM^=^OdI
|
||||
zpGG0Qa0|L3{jfB{0*bi=tx_fZf;0;Ps$$h0XjBJU8y)O1SD-zjI?&qaU`I*00lm%)
|
||||
zv^JT+e&Yso%`?y%9qc|Apbcs~1Fg})u4N;9(71N~84n-S`d?6M*r0iB`k2m2pEmR1
|
||||
zf(Er&%x+lJW-v@pl6q-6F+S;(uAXFgph;~W`+^>8I~g9RU77~AeL>qaNZ%d;C_u^s
|
||||
zlss&pgcZ=5Jy6WbGCgY#WaDr39a`*x^u>dcIQ=590n!A0HN&vZEG?C{V=ABuDD3<L
|
||||
X<=DewY$H`b00000NkvXXu0mjfrJ!K8
|
||||
|
||||
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
|
||||
GIT binary patch
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
literal 1038
|
||||
zcmV+p1o8WcP)<h;3K|Lk000e1NJLTq003YB003YJ1ONa4NRhv@000BkNkl<ZcwX(>
|
||||
zK}Zx)90u@NR77ZDqzI8+I%LtIBq1>CB9(`rB#V~#N{sTXQQ#UFR4mj+L_yL)FVdw5
|
||||
zWziyt2t7o(5K@$fpoFMU*4D8)xU9Pq43Ec~9k(6b`LAza_%8CfJov%x+j;ZfQFNEb
|
||||
z12`KG-~l{<2LKCHgb{}Zy~t>YBMcRaBe4w#ApzaNBoHbkpa(iZdP)TdK_^P66aW<o
|
||||
zGC%?<Js=F7FkyN?+%{m2FFR)&5T^%dqyUW`ppydhRRcUgbKdOZfPML2wf+F5xOe~$
|
||||
za5X2_a&lcrfC1Ws*OwkpL^d<PXBoFq``hX^=<WnOVSo$r0_HGoWCB?$0G$l*T3*0U
|
||||
zRIr6&7Qk=#4L}fCncqTZ7+{YDaF5Y0%Y7~MjxY7x)Mrs=v_5>56u{HU0Q*gCKWkg%
|
||||
zzZ!iHpXGBfgAJ^klo-HsmH{^5htXtkfHkMxaUPh*CPp}jjBvX|#jNB2o*};A4dL$x
|
||||
zZaR^jWPl1(GQd%H9Vr*E#k6n`zua~vj+y|s+;yl=;Uat{fDf0DatmMzyH{Mi0aNk=
|
||||
z7SV+=VZjqPArQ*Yg+(*KsriBvfHVeB1BIss!$v=x(+(m{a9cQ39AFtk*a}5R2a=qY
|
||||
zM2G2rH)-YzYX!{XHtL`Vsl}LuIEGp%Af7L*1<;Mkoc-n;k}EEs#5wq==L@R`yh6DE
|
||||
zXe@BOIf?tU^9B0=>sf0D9wH09K(eHO_}X@%^EiwcGSJsOT46u}y38pI7<D_Kr9^-i
|
||||
zP=vg64xr$P1wcPDKIJ5!8q?%}`J8W;O8jyTpdd(2xC138cbx<%s3v|R?c{)Z)Ej_Z
|
||||
zjsbXDFiNzkzJbCM<!8IM&H##xEx>u<B=-&9*y*m*Er37RzyZxh(`*3z`0Eb9fWRFv
|
||||
zHG}Q|Gzy#Ng3&CnO?9su03QYHao!$h%_sQ*-2z~Qw<D~%AUhz1jU1q2iT6uT*&Xkc
|
||||
z+<->{wR6Q0;bXZ0hXla52{6vu7MTGve7a+uW@Zs&Q??m-0eu3rC-3h{ugD5mMnC|3
|
||||
zumC<VKmZvz0Z(nO@k~y@G24JP83D5>w+*PktbBkdCkD`$Cjm}~$_Loa0g=4O2nTGJ
|
||||
z4KN`LLB8h&d>4i%6LJCCIpB!UT62U0+GPT0sN#Uwe*rNLsDdUBpr7+<3XGr9!nmqm
|
||||
z9zX*J^g=I?UJhtjCjd!2fc<E02gFGMDSAMd6fjK>P)UbW5mEs8p!*B_)Bwsy8PjNj
|
||||
zLJc5zn3UxUnxN1F9DJOYCxvN5;D?e6@Sf=Q03N^tcmNOZ5BbKcjE%x^TL1t607*qo
|
||||
IM6N<$g2Gw1A^-pY
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/site_settings_preferences.xml b/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
--- 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
|
||||
--- 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
|
||||
@@ -38,7 +38,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;
|
||||
@@ -82,11 +81,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.
|
||||
@@ -105,11 +103,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));
|
||||
}
|
||||
@@ -119,10 +112,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) {
|
||||
@@ -139,7 +128,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);
|
||||
@@ -236,11 +225,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
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
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
|
||||
@@ -2143,15 +2143,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
|
||||
@@ -878,7 +878,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
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 15 May 2019 17:08:35 +0200
|
||||
Subject: Remove recent tabs signin
|
||||
|
||||
---
|
||||
.../chrome/browser/ntp/RecentTabsManager.java | 13 +---
|
||||
.../chrome/browser/signin/SigninManager.java | 74 ++--------------------
|
||||
2 files changed, 8 insertions(+), 79 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
|
||||
@@ -357,18 +357,7 @@ public class RecentTabsManager implements AndroidSyncSettingsObserver, SignInSta
|
||||
*/
|
||||
@PromoState
|
||||
int getPromoType() {
|
||||
- if (!ChromeSigninController.get().isSignedIn()) {
|
||||
- if (!SigninManager.get().isSignInAllowed()) {
|
||||
- return PromoState.PROMO_NONE;
|
||||
- }
|
||||
- return PromoState.PROMO_SIGNIN_PERSONALIZED;
|
||||
- }
|
||||
-
|
||||
- if (AndroidSyncSettings.get().isSyncEnabled()
|
||||
- && AndroidSyncSettings.get().isChromeSyncEnabled() && !mForeignSessions.isEmpty()) {
|
||||
- return PromoState.PROMO_NONE;
|
||||
- }
|
||||
- return PromoState.PROMO_SYNC;
|
||||
+ return PromoState.PROMO_NONE;
|
||||
}
|
||||
|
||||
void recordRecentTabMetrics() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
|
||||
@@ -28,11 +28,7 @@ import org.chromium.base.task.PostTask;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
|
||||
import org.chromium.chrome.browser.sync.SyncUserDataWiper;
|
||||
-import org.chromium.components.signin.AccountIdProvider;
|
||||
import org.chromium.components.signin.AccountManagerFacade;
|
||||
-import org.chromium.components.signin.AccountTrackerService;
|
||||
-import org.chromium.components.signin.ChromeSigninController;
|
||||
-import org.chromium.components.sync.AndroidSyncSettings;
|
||||
import org.chromium.content_public.browser.UiThreadTaskTraits;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -48,7 +44,7 @@ import java.util.List;
|
||||
* <p/>
|
||||
* See chrome/browser/signin/signin_manager_android.h for more details.
|
||||
*/
|
||||
-public class SigninManager implements AccountTrackerService.OnSystemAccountsSeededListener {
|
||||
+public class SigninManager {
|
||||
private static final String TAG = "SigninManager";
|
||||
|
||||
/**
|
||||
@@ -181,8 +177,6 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
|
||||
private final long mNativeSigninManagerAndroid;
|
||||
private final Context mContext;
|
||||
- private final AccountTrackerService mAccountTrackerService;
|
||||
- private final AndroidSyncSettings mAndroidSyncSettings;
|
||||
private final ObserverList<SignInStateObserver> mSignInStateObservers = new ObserverList<>();
|
||||
private final ObserverList<SignInAllowedObserver> mSignInAllowedObservers =
|
||||
new ObserverList<>();
|
||||
@@ -226,25 +220,17 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
}
|
||||
|
||||
private SigninManager() {
|
||||
- this(ContextUtils.getApplicationContext(),
|
||||
- IdentityServicesProvider.getAccountTrackerService(), AndroidSyncSettings.get());
|
||||
+ this(ContextUtils.getApplicationContext());
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
- SigninManager(Context context, AccountTrackerService accountTrackerService,
|
||||
- AndroidSyncSettings androidSyncSettings) {
|
||||
+ SigninManager(Context context) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
assert context != null;
|
||||
- assert accountTrackerService != null;
|
||||
- assert androidSyncSettings != null;
|
||||
mContext = context;
|
||||
- mAccountTrackerService = accountTrackerService;
|
||||
- mAndroidSyncSettings = androidSyncSettings;
|
||||
|
||||
mNativeSigninManagerAndroid = nativeInit();
|
||||
mSigninAllowedByPolicy = nativeIsSigninAllowedByPolicy(mNativeSigninManagerAndroid);
|
||||
-
|
||||
- mAccountTrackerService.addSystemAccountsSeededListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,8 +266,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
* Returns true if signin can be started now.
|
||||
*/
|
||||
public boolean isSignInAllowed() {
|
||||
- return !mFirstRunCheckIsPending && mSignInState == null && mSigninAllowedByPolicy
|
||||
- && ChromeSigninController.get().getSignedInUser() == null && isSigninSupported();
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,15 +281,14 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
* Google Play Services installed.
|
||||
*/
|
||||
public boolean isSigninSupported() {
|
||||
- return !ApiCompatibilityUtils.isDemoUser(mContext)
|
||||
- && !ExternalAuthUtils.getInstance().isGooglePlayServicesMissing(mContext);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether force sign-in is enabled by policy.
|
||||
*/
|
||||
public boolean isForceSigninEnabled() {
|
||||
- return nativeIsForceSigninEnabled(mNativeSigninManagerAndroid);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,27 +322,6 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
}
|
||||
|
||||
/**
|
||||
- * Continue pending sign in after system accounts have been seeded into AccountTrackerService.
|
||||
- */
|
||||
- @Override
|
||||
- public void onSystemAccountsSeedingComplete() {
|
||||
- if (mSignInState != null && mSignInState.mBlockedOnAccountSeeding) {
|
||||
- mSignInState.mBlockedOnAccountSeeding = false;
|
||||
- progressSignInFlowCheckPolicy();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Clear pending sign in when system accounts in AccountTrackerService were refreshed.
|
||||
- */
|
||||
- @Override
|
||||
- public void onSystemAccountsChanged() {
|
||||
- if (mSignInState != null) {
|
||||
- abortSignIn();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Starts the sign-in flow, and executes the callback when finished.
|
||||
*
|
||||
* If an activity is provided, it is considered an "interactive" sign-in and the user can be
|
||||
@@ -413,19 +376,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
}
|
||||
|
||||
private void progressSignInFlowSeedSystemAccounts() {
|
||||
- if (mAccountTrackerService.checkAndSeedSystemAccounts()) {
|
||||
- progressSignInFlowCheckPolicy();
|
||||
- } else if (AccountIdProvider.getInstance().canBeUsed()) {
|
||||
- mSignInState.mBlockedOnAccountSeeding = true;
|
||||
- } else {
|
||||
- Activity activity = mSignInState.mActivity;
|
||||
- UserRecoverableErrorHandler errorHandler = activity != null
|
||||
- ? new UserRecoverableErrorHandler.ModalDialog(activity, !isForceSigninEnabled())
|
||||
- : new UserRecoverableErrorHandler.SystemNotification();
|
||||
- ExternalAuthUtils.getInstance().canUseGooglePlayServices(errorHandler);
|
||||
- Log.w(TAG, "Cancelling the sign-in process as Google Play services is unavailable");
|
||||
- abortSignIn();
|
||||
- }
|
||||
+ mSignInState.mBlockedOnAccountSeeding = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -489,12 +440,6 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
// Tell the native side that sign-in has completed.
|
||||
nativeOnSignInCompleted(mNativeSigninManagerAndroid, mSignInState.mAccount.name);
|
||||
|
||||
- // Cache the signed-in account name. This must be done after the native call, otherwise
|
||||
- // sync tries to start without being signed in natively and crashes.
|
||||
- ChromeSigninController.get().setSignedInAccountName(mSignInState.mAccount.name);
|
||||
- mAndroidSyncSettings.updateAccount(mSignInState.mAccount);
|
||||
- mAndroidSyncSettings.enableChromeSync();
|
||||
-
|
||||
if (mSignInState.mCallback != null) {
|
||||
mSignInState.mCallback.onSignInComplete();
|
||||
}
|
||||
@@ -670,16 +615,11 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
|
||||
// Should be set at beginning of sign-out flow.
|
||||
assert mSignOutState != null;
|
||||
|
||||
- ChromeSigninController.get().setSignedInAccountName(null);
|
||||
- mAndroidSyncSettings.updateAccount(null);
|
||||
-
|
||||
if (mSignOutState.mManagementDomain != null) {
|
||||
wipeProfileData();
|
||||
} else {
|
||||
wipeGoogleServiceWorkerCaches();
|
||||
}
|
||||
-
|
||||
- mAccountTrackerService.invalidateAccountSeedStatus(true);
|
||||
}
|
||||
|
||||
private void wipeProfileData() {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 11:40:05 +0100
|
||||
Subject: Restore classic new tab page
|
||||
|
||||
---
|
||||
chrome/browser/search/search.cc | 13 +------------
|
||||
1 file changed, 1 insertion(+), 12 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
||||
--- a/chrome/browser/search/search.cc
|
||||
+++ b/chrome/browser/search/search.cc
|
||||
@@ -154,16 +154,6 @@ bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
-bool ShouldShowLocalNewTab(Profile* profile) {
|
||||
-#if !defined(OS_ANDROID)
|
||||
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
- return command_line->HasSwitch(switches::kForceLocalNtp) ||
|
||||
- (base::FeatureList::IsEnabled(features::kUseGoogleLocalNtp) &&
|
||||
- profile && DefaultSearchProviderIsGoogle(profile));
|
||||
-#endif
|
||||
- return false;
|
||||
-}
|
||||
-
|
||||
bool ShouldDelayRemoteNTP(const GURL& search_provider_url, Profile* profile) {
|
||||
#if defined(OS_CHROMEOS)
|
||||
// On Chrome OS, if the session hasn't merged yet, we need to avoid loading
|
||||
@@ -190,8 +180,7 @@ struct NewTabURLDetails {
|
||||
|
||||
const GURL local_url(chrome::kChromeSearchLocalNtpUrl);
|
||||
|
||||
- if (ShouldShowLocalNewTab(profile))
|
||||
- return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
||||
+ return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
||||
|
||||
const TemplateURL* template_url =
|
||||
GetDefaultSearchProviderTemplateURL(profile);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,386 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 29 Jan 2019 01:02:07 +0100
|
||||
Subject: Rollback android:minSdkVersion from 19 (KitKat) to 16 (JellyBean)
|
||||
|
||||
This reverts commit 9a48587dbd1988cf5066b454e7d09ae35d124366.
|
||||
---
|
||||
.../test/embedded_test_server/java/AndroidManifest.xml | 2 +-
|
||||
android_webview/tools/automated_ui_tests/java/AndroidManifest.xml | 2 +-
|
||||
base/android/jni_generator/AndroidManifest.xml | 2 +-
|
||||
build/android/AndroidManifest.xml | 2 +-
|
||||
build/android/gradle/android.jinja | 2 +-
|
||||
chrome/android/BUILD.gn | 8 ++++----
|
||||
.../test/android/chrome_public_test_support/AndroidManifest.xml | 2 +-
|
||||
components/cronet/android/sample/AndroidManifest.xml | 3 +--
|
||||
components/cronet/android/sample/javatests/AndroidManifest.xml | 3 +--
|
||||
components/cronet/android/test/javaperftests/AndroidManifest.xml | 3 +--
|
||||
components/cronet/android/test/javatests/AndroidManifest.xml | 3 +--
|
||||
.../test/android/browsertests_apk/AndroidManifest.xml.jinja2 | 2 +-
|
||||
content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2 | 2 +-
|
||||
content/shell/android/javatests/AndroidManifest.xml | 2 +-
|
||||
content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2 | 2 +-
|
||||
content/shell/android/shell_apk/AndroidManifest.xml.jinja2 | 2 +-
|
||||
docs/android_build_instructions.md | 2 +-
|
||||
mojo/public/java/system/javatests/AndroidManifest.xml | 2 +-
|
||||
net/android/unittest_support/AndroidManifest.xml | 2 +-
|
||||
net/test/android/javatests/AndroidManifest.xml | 2 +-
|
||||
remoting/android/java/AndroidManifest.xml.jinja2 | 2 +-
|
||||
remoting/android/javatests/AndroidManifest.xml.jinja2 | 2 +-
|
||||
testing/android/driver/java/AndroidManifest.xml | 2 +-
|
||||
testing/android/native_test/java/AndroidManifest.xml.jinja2 | 2 +-
|
||||
tools/android/audio_focus_grabber/java/AndroidManifest.xml | 2 +-
|
||||
tools/android/push_apps_to_background/AndroidManifest.xml | 4 ++--
|
||||
26 files changed, 30 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/android_webview/test/embedded_test_server/java/AndroidManifest.xml b/android_webview/test/embedded_test_server/java/AndroidManifest.xml
|
||||
--- a/android_webview/test/embedded_test_server/java/AndroidManifest.xml
|
||||
+++ b/android_webview/test/embedded_test_server/java/AndroidManifest.xml
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.chromium.android_webview.test.support">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
diff --git a/android_webview/tools/automated_ui_tests/java/AndroidManifest.xml b/android_webview/tools/automated_ui_tests/java/AndroidManifest.xml
|
||||
--- a/android_webview/tools/automated_ui_tests/java/AndroidManifest.xml
|
||||
+++ b/android_webview/tools/automated_ui_tests/java/AndroidManifest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
diff --git a/base/android/jni_generator/AndroidManifest.xml b/base/android/jni_generator/AndroidManifest.xml
|
||||
--- a/base/android/jni_generator/AndroidManifest.xml
|
||||
+++ b/base/android/jni_generator/AndroidManifest.xml
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jni.generator">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="24" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="24" />
|
||||
<application></application>
|
||||
|
||||
</manifest>
|
||||
diff --git a/build/android/AndroidManifest.xml b/build/android/AndroidManifest.xml
|
||||
--- a/build/android/AndroidManifest.xml
|
||||
+++ b/build/android/AndroidManifest.xml
|
||||
@@ -15,6 +15,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.dummy">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="24" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="24" />
|
||||
|
||||
</manifest>
|
||||
diff --git a/build/android/gradle/android.jinja b/build/android/gradle/android.jinja
|
||||
--- a/build/android/gradle/android.jinja
|
||||
+++ b/build/android/gradle/android.jinja
|
||||
@@ -51,7 +51,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
- minSdkVersion 19
|
||||
+ minSdkVersion 17
|
||||
targetSdkVersion {{ target_sdk_version }}
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -65,7 +65,7 @@ jinja_template("chrome_public_android_manifest") {
|
||||
output = chrome_public_android_manifest
|
||||
variables = chrome_public_jinja_variables
|
||||
variables += [
|
||||
- "min_sdk_version=19",
|
||||
+ "min_sdk_version=17",
|
||||
"target_sdk_version=$android_sdk_version",
|
||||
]
|
||||
|
||||
@@ -1554,7 +1554,7 @@ template("chrome_public_apk_or_module_tmpl") {
|
||||
android_manifest = chrome_modern_public_android_manifest
|
||||
android_manifest_dep = ":chrome_modern_public_android_manifest"
|
||||
} else {
|
||||
- min_sdk_version = 19
|
||||
+ min_sdk_version = 17
|
||||
android_manifest = chrome_public_android_manifest
|
||||
android_manifest_dep = ":chrome_public_android_manifest"
|
||||
}
|
||||
@@ -1777,7 +1777,7 @@ jinja_template("chrome_public_test_apk_manifest") {
|
||||
variables = default_chrome_public_jinja_variables
|
||||
variables += [
|
||||
"manifest_package=$test_manifest_package",
|
||||
- "min_sdk_version=19",
|
||||
+ "min_sdk_version=17",
|
||||
"target_sdk_version=$android_sdk_version",
|
||||
]
|
||||
}
|
||||
@@ -1788,7 +1788,7 @@ jinja_template("chrome_public_test_vr_apk_manifest") {
|
||||
output = chrome_public_test_vr_apk_manifest
|
||||
variables = chrome_public_jinja_variables
|
||||
variables += [
|
||||
- "min_sdk_version=19",
|
||||
+ "min_sdk_version=17",
|
||||
"target_sdk_version=$android_sdk_version",
|
||||
]
|
||||
}
|
||||
diff --git a/chrome/test/android/chrome_public_test_support/AndroidManifest.xml b/chrome/test/android/chrome_public_test_support/AndroidManifest.xml
|
||||
--- a/chrome/test/android/chrome_public_test_support/AndroidManifest.xml
|
||||
+++ b/chrome/test/android/chrome_public_test_support/AndroidManifest.xml
|
||||
@@ -5,7 +5,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.chromium.chrome.tests.support">
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="22" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application>
|
||||
<service android:name="org.chromium.chrome.browser.media.TestMediaRouteProviderService"
|
||||
diff --git a/components/cronet/android/sample/AndroidManifest.xml b/components/cronet/android/sample/AndroidManifest.xml
|
||||
--- a/components/cronet/android/sample/AndroidManifest.xml
|
||||
+++ b/components/cronet/android/sample/AndroidManifest.xml
|
||||
@@ -9,8 +9,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.cronet_sample_apk">
|
||||
|
||||
- <!-- //components/cronet still needs to support Jelly Bean. See crbug.com/922656 -->
|
||||
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<application android:name="CronetSampleApplication"
|
||||
diff --git a/components/cronet/android/sample/javatests/AndroidManifest.xml b/components/cronet/android/sample/javatests/AndroidManifest.xml
|
||||
--- a/components/cronet/android/sample/javatests/AndroidManifest.xml
|
||||
+++ b/components/cronet/android/sample/javatests/AndroidManifest.xml
|
||||
@@ -8,8 +8,7 @@
|
||||
doesn't ignore this. -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.cronet_sample_apk.tests">
|
||||
- <!-- //components/cronet still needs to support Jelly Bean. See crbug.com/922656 -->
|
||||
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
|
||||
<!-- We add an application tag here just so that we can indicate that this
|
||||
package needs to link against the android.test library, which is
|
||||
diff --git a/components/cronet/android/test/javaperftests/AndroidManifest.xml b/components/cronet/android/test/javaperftests/AndroidManifest.xml
|
||||
--- a/components/cronet/android/test/javaperftests/AndroidManifest.xml
|
||||
+++ b/components/cronet/android/test/javaperftests/AndroidManifest.xml
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.net">
|
||||
- <!-- //components/cronet still needs to support Jelly Bean. See crbug.com/922656 -->
|
||||
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
diff --git a/components/cronet/android/test/javatests/AndroidManifest.xml b/components/cronet/android/test/javatests/AndroidManifest.xml
|
||||
--- a/components/cronet/android/test/javatests/AndroidManifest.xml
|
||||
+++ b/components/cronet/android/test/javatests/AndroidManifest.xml
|
||||
@@ -6,8 +6,7 @@
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.net.tests">
|
||||
- <!-- //components/cronet still needs to support Jelly Bean. See crbug.com/922656 -->
|
||||
- <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
diff --git a/components/test/android/browsertests_apk/AndroidManifest.xml.jinja2 b/components/test/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
--- a/components/test/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
+++ b/components/test/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
@@ -9,7 +9,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.components_browsertests_apk">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
diff --git a/content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2 b/content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
--- a/content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
+++ b/content/shell/android/browsertests_apk/AndroidManifest.xml.jinja2
|
||||
@@ -9,7 +9,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.content_browsertests_apk">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
diff --git a/content/shell/android/javatests/AndroidManifest.xml b/content/shell/android/javatests/AndroidManifest.xml
|
||||
--- a/content/shell/android/javatests/AndroidManifest.xml
|
||||
+++ b/content/shell/android/javatests/AndroidManifest.xml
|
||||
@@ -6,7 +6,7 @@
|
||||
doesn't ignore this. -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.content_shell_apk.tests">
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
|
||||
<!-- We add an application tag here just so that we can indicate that this
|
||||
package needs to link against the android.test library, which is
|
||||
diff --git a/content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2 b/content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2
|
||||
--- a/content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2
|
||||
+++ b/content/shell/android/linker_test_apk/AndroidManifest.xml.jinja2
|
||||
@@ -9,7 +9,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.chromium_linker_test_apk">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
diff --git a/content/shell/android/shell_apk/AndroidManifest.xml.jinja2 b/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
|
||||
--- a/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
|
||||
+++ b/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
|
||||
@@ -9,7 +9,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.content_shell_apk">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
diff --git a/docs/android_build_instructions.md b/docs/android_build_instructions.md
|
||||
--- a/docs/android_build_instructions.md
|
||||
+++ b/docs/android_build_instructions.md
|
||||
@@ -184,7 +184,7 @@ the version of Android running on a device. Chrome uses this feature to target
|
||||
3 different versions using 3 different ninja targets:
|
||||
|
||||
1. `chrome_public_apk` (ChromePublic.apk)
|
||||
- * `minSdkVersion=19` (KitKat).
|
||||
+ * `minSdkVersion=17` (Jelly Bean).
|
||||
* Stores libchrome.so compressed within the APK.
|
||||
* Uses [Crazy Linker](https://cs.chromium.org/chromium/src/base/android/linker/BUILD.gn?rcl=6bb29391a86f2be58c626170156cbfaa2cbc5c91&l=9).
|
||||
* Shipped only for Android < 21, but still works fine on Android >= 21.
|
||||
diff --git a/mojo/public/java/system/javatests/AndroidManifest.xml b/mojo/public/java/system/javatests/AndroidManifest.xml
|
||||
--- a/mojo/public/java/system/javatests/AndroidManifest.xml
|
||||
+++ b/mojo/public/java/system/javatests/AndroidManifest.xml
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.chromium.mojo.tests">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
|
||||
|
||||
<uses-permission android:name="android.permission.INJECT_EVENTS"
|
||||
tools:ignore="ProtectedPermissions"/>
|
||||
diff --git a/net/android/unittest_support/AndroidManifest.xml b/net/android/unittest_support/AndroidManifest.xml
|
||||
--- a/net/android/unittest_support/AndroidManifest.xml
|
||||
+++ b/net/android/unittest_support/AndroidManifest.xml
|
||||
@@ -10,7 +10,7 @@ found in the LICENSE file.
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
|
||||
diff --git a/net/test/android/javatests/AndroidManifest.xml b/net/test/android/javatests/AndroidManifest.xml
|
||||
--- a/net/test/android/javatests/AndroidManifest.xml
|
||||
+++ b/net/test/android/javatests/AndroidManifest.xml
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.chromium.net.test.support">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
diff --git a/remoting/android/java/AndroidManifest.xml.jinja2 b/remoting/android/java/AndroidManifest.xml.jinja2
|
||||
--- a/remoting/android/java/AndroidManifest.xml.jinja2
|
||||
+++ b/remoting/android/java/AndroidManifest.xml.jinja2
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="{{ APK_PACKAGE_NAME }}">
|
||||
- <uses-sdk android:minSdkVersion="19"
|
||||
+ <uses-sdk android:minSdkVersion="14"
|
||||
android:targetSdkVersion="28"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
|
||||
diff --git a/remoting/android/javatests/AndroidManifest.xml.jinja2 b/remoting/android/javatests/AndroidManifest.xml.jinja2
|
||||
--- a/remoting/android/javatests/AndroidManifest.xml.jinja2
|
||||
+++ b/remoting/android/javatests/AndroidManifest.xml.jinja2
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- We add an application tag here just so that we can indicate that this
|
||||
package needs to link against the android.test library, which is
|
||||
needed when building test cases. -->
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
diff --git a/testing/android/driver/java/AndroidManifest.xml b/testing/android/driver/java/AndroidManifest.xml
|
||||
--- a/testing/android/driver/java/AndroidManifest.xml
|
||||
+++ b/testing/android/driver/java/AndroidManifest.xml
|
||||
@@ -10,7 +10,7 @@ found in the LICENSE file.
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<application android:label="OnDeviceInstrumentationDriver" />
|
||||
diff --git a/testing/android/native_test/java/AndroidManifest.xml.jinja2 b/testing/android/native_test/java/AndroidManifest.xml.jinja2
|
||||
--- a/testing/android/native_test/java/AndroidManifest.xml.jinja2
|
||||
+++ b/testing/android/native_test/java/AndroidManifest.xml.jinja2
|
||||
@@ -10,7 +10,7 @@ found in the LICENSE file.
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
||||
diff --git a/tools/android/audio_focus_grabber/java/AndroidManifest.xml b/tools/android/audio_focus_grabber/java/AndroidManifest.xml
|
||||
--- a/tools/android/audio_focus_grabber/java/AndroidManifest.xml
|
||||
+++ b/tools/android/audio_focus_grabber/java/AndroidManifest.xml
|
||||
@@ -8,7 +8,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.tools.audio_focus_grabber" >
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
|
||||
<application
|
||||
android:label="@string/app_name" >
|
||||
diff --git a/tools/android/push_apps_to_background/AndroidManifest.xml b/tools/android/push_apps_to_background/AndroidManifest.xml
|
||||
--- a/tools/android/push_apps_to_background/AndroidManifest.xml
|
||||
+++ b/tools/android/push_apps_to_background/AndroidManifest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
|
||||
+ <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23" />
|
||||
|
||||
<application
|
||||
android:icon="@drawable/ic_launcher"
|
||||
@@ -26,4 +26,4 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
-</manifest>
|
||||
\ No newline at end of file
|
||||
+</manifest>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 22:51:43 +0100
|
||||
Subject: Skip the first run and metrics
|
||||
|
||||
---
|
||||
.../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
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
@@ -36,11 +36,11 @@ public class FirstRunStatus {
|
||||
* includes ToS and Sign In pages if necessary.
|
||||
*/
|
||||
public static boolean getFirstRunFlowComplete() {
|
||||
- if (ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false)) {
|
||||
- return true;
|
||||
+ boolean complete = ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false);
|
||||
+ if (!complete) {
|
||||
+ setFirstRunFlowComplete(true);
|
||||
}
|
||||
- return CommandLine.getInstance().hasSwitch(
|
||||
- ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
@@ -30,16 +30,12 @@ public class FirstRunUtils {
|
||||
// - checkAnyUserHasSeenToS() may be true which needs to sync its state to the prefs.
|
||||
boolean javaPrefValue = javaPrefs.getBoolean(CACHED_TOS_ACCEPTED_PREF, false);
|
||||
boolean nativePrefValue = prefsBridge.isFirstRunEulaAccepted();
|
||||
- boolean userHasSeenTos =
|
||||
- ToSAckedReceiver.checkAnyUserHasSeenToS();
|
||||
- boolean isFirstRunComplete = FirstRunStatus.getFirstRunFlowComplete();
|
||||
- if (javaPrefValue || nativePrefValue || userHasSeenTos || isFirstRunComplete) {
|
||||
- if (!javaPrefValue) {
|
||||
- javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
|
||||
- }
|
||||
- if (!nativePrefValue) {
|
||||
- prefsBridge.setEulaAccepted();
|
||||
- }
|
||||
+
|
||||
+ if (!javaPrefValue) {
|
||||
+ javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
|
||||
+ }
|
||||
+ if (!nativePrefValue) {
|
||||
+ prefsBridge.setEulaAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -75,7 +75,7 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
|
||||
}
|
||||
});
|
||||
|
||||
- if (ChromeVersionInfo.isOfficialBuild()) {
|
||||
+/* if (ChromeVersionInfo.isOfficialBuild()) {
|
||||
int paddingStart = getResources().getDimensionPixelSize(
|
||||
R.dimen.fre_tos_checkbox_padding);
|
||||
ViewCompat.setPaddingRelative(mSendReportCheckBox,
|
||||
@@ -87,8 +87,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());
|
||||
|
||||
Resources resources = getResources();
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Wed, 26 Dec 2018 10:20:24 -0500
|
||||
Subject: Switch to -fstack-protector-strong
|
||||
|
||||
This compiler option is already used for ChromeOS, but not yet on other
|
||||
platforms because there is push back against enabling an option resulting in
|
||||
~1-2% lower performance and ~2-3% larger binaries.
|
||||
|
||||
The size increase on Android is something they care a lot about since some
|
||||
devices have very little storage space. That also means ever so slightly
|
||||
higher memory/cache usage but not by the full 2-3%.
|
||||
---
|
||||
build/config/compiler/BUILD.gn | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -263,16 +263,12 @@ config("compiler") {
|
||||
cflags += [ "-fstack-protector" ]
|
||||
}
|
||||
} else if ((is_posix && !is_chromeos && !is_nacl) || is_fuchsia) {
|
||||
- # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it.
|
||||
- # See also https://crbug.com/533294
|
||||
- cflags += [ "--param=ssp-buffer-size=4" ]
|
||||
-
|
||||
# The x86 toolchain currently has problems with stack-protector.
|
||||
if (is_android && current_cpu == "x86") {
|
||||
cflags += [ "-fno-stack-protector" ]
|
||||
} else if (current_os != "aix") {
|
||||
# Not available on aix.
|
||||
- cflags += [ "-fstack-protector" ]
|
||||
+ cflags += [ "-fstack-protector-strong" ]
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 21 Feb 2018 00:32:09 +0100
|
||||
Subject: Use 4 tile rows, never show logo
|
||||
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java | 6 +++---
|
||||
.../chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java | 2 +-
|
||||
.../src/org/chromium/chrome/browser/suggestions/SiteSection.java | 2 +-
|
||||
components/history/core/browser/top_sites_impl.h | 2 +-
|
||||
components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc | 2 +-
|
||||
5 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
|
||||
@@ -117,7 +117,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
|
||||
/** Observer for overview mode. */
|
||||
private EmptyOverviewModeObserver mOverviewObserver;
|
||||
|
||||
- private boolean mSearchProviderHasLogo = true;
|
||||
+ private boolean mSearchProviderHasLogo = false;
|
||||
private boolean mSearchProviderIsGoogle;
|
||||
|
||||
private boolean mInitialized;
|
||||
@@ -542,7 +542,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
|
||||
&& mInitialized) {
|
||||
return;
|
||||
}
|
||||
- mSearchProviderHasLogo = hasLogo;
|
||||
+ mSearchProviderHasLogo = false;
|
||||
mSearchProviderIsGoogle = isGoogle;
|
||||
|
||||
updateTileGridPadding();
|
||||
@@ -834,7 +834,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer
|
||||
}
|
||||
|
||||
private static int getMaxTileRows() {
|
||||
- return 2;
|
||||
+ return 4;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/MostVisitedSitesBridge.java
|
||||
@@ -27,7 +27,7 @@ public class MostVisitedSitesBridge
|
||||
* Maximum number of tiles that is explicitly supported. UMA relies on this value, so even if
|
||||
* the UI supports it, getting more can raise unexpected issues.
|
||||
*/
|
||||
- public static final int MAX_TILE_COUNT = 12;
|
||||
+ public static final int MAX_TILE_COUNT = 12 * 2;
|
||||
|
||||
private long mNativeMostVisitedSitesBridge;
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SiteSection.java
|
||||
@@ -110,7 +110,7 @@ public class SiteSection extends OptionalLeaf implements TileGroup.Observer {
|
||||
if (ChromeFeatureList.isEnabled(ChromeFeatureList.EXPLORE_SITES)) {
|
||||
return 1;
|
||||
}
|
||||
- return 2;
|
||||
+ return 4;
|
||||
}
|
||||
|
||||
@LayoutRes
|
||||
diff --git a/components/history/core/browser/top_sites_impl.h b/components/history/core/browser/top_sites_impl.h
|
||||
--- a/components/history/core/browser/top_sites_impl.h
|
||||
+++ b/components/history/core/browser/top_sites_impl.h
|
||||
@@ -55,7 +55,7 @@ class TopSitesImpl : public TopSites, public HistoryServiceObserver {
|
||||
using CanAddURLToHistoryFn = base::Callback<bool(const GURL&)>;
|
||||
|
||||
// How many top sites to store in the cache.
|
||||
- static constexpr size_t kTopSitesNumber = 10;
|
||||
+ static constexpr size_t kTopSitesNumber = 4 * 4 + 2;
|
||||
|
||||
TopSitesImpl(PrefService* pref_service,
|
||||
HistoryService* history_service,
|
||||
diff --git a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
|
||||
--- a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
|
||||
+++ b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
|
||||
@@ -30,7 +30,7 @@ namespace ntp_snippets {
|
||||
|
||||
namespace {
|
||||
|
||||
-const int kMaxBookmarks = 10;
|
||||
+const int kMaxBookmarks = 4 * 4 + 2;
|
||||
const int kMaxBookmarkAgeInDays = 7;
|
||||
|
||||
const char* kMaxBookmarksParamName = "bookmarks_max_count";
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Thu, 26 Jan 2017 01:30:12 -0500
|
||||
Subject: Use 64-bit WebView processes
|
||||
|
||||
64-bit processes introduce 10% or so higher memory consumption.
|
||||
The reason for preferring 64-bit processes is providing substantially better
|
||||
exploit mitigations at the expense of slightly more memory usage.
|
||||
|
||||
In addition to the standard mitigations, it also enables usage of
|
||||
https://github.com/AndroidHardening/hardened_malloc (where available).
|
||||
|
||||
It will provide high entropy ASLR (24-bit to 32-bit depending on whether the
|
||||
kernel uses 3 or 4 level page tables rather than 16-bit for 32-bit processes),
|
||||
high entropy stack canaries (56/64-bit instead of 24/32-bit depending on
|
||||
whether a zero byte is used) and also features like pointer authentication and
|
||||
memory tagging when those are made available in the future.
|
||||
|
||||
The reason why upstream started preferring 32-bit processes is to save memory,
|
||||
particularly since saving memory makes it feasible to use finer-grained
|
||||
sandboxing.
|
||||
---
|
||||
android_webview/apk/java/AndroidManifest.xml | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/android_webview/apk/java/AndroidManifest.xml b/android_webview/apk/java/AndroidManifest.xml
|
||||
--- a/android_webview/apk/java/AndroidManifest.xml
|
||||
+++ b/android_webview/apk/java/AndroidManifest.xml
|
||||
@@ -25,7 +25,6 @@
|
||||
android:icon="@{{manifest_package|default('com.android.webview')}}:drawable/icon_webview"
|
||||
android:name="{{ application_name|default('com.android.webview.chromium.WebViewApplication') }}"
|
||||
android:multiArch="true"
|
||||
- android:use32bitAbi="true"
|
||||
android:extractNativeLibs="{{ trichrome_library is not defined }}">
|
||||
{# This part is shared between stand-alone WebView and Monochrome #}
|
||||
{% macro common(manifest_package, webview_lib) %}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
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 with the goal of not
|
||||
disclosing the specific build of Bromite.
|
||||
---
|
||||
.../browser/ui/android/android_about_app_info.cc | 4 ++-
|
||||
components/version_info/version_info.cc | 13 +++++++-
|
||||
content/common/user_agent.cc | 37 +++++++++++++++++-----
|
||||
content/public/common/user_agent.h | 2 +-
|
||||
4 files changed, 45 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/ui/android/android_about_app_info.cc b/chrome/browser/ui/android/android_about_app_info.cc
|
||||
--- a/chrome/browser/ui/android/android_about_app_info.cc
|
||||
+++ b/chrome/browser/ui/android/android_about_app_info.cc
|
||||
@@ -20,6 +20,8 @@ std::string AndroidAboutAppInfo::GetGmsInfo() {
|
||||
}
|
||||
|
||||
std::string AndroidAboutAppInfo::GetOsInfo() {
|
||||
+ int32_t major_version = 4, minor_version, bugfix_version;
|
||||
+ base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version, &bugfix_version);
|
||||
return base::SysInfo::OperatingSystemVersion() +
|
||||
- content::GetAndroidOSInfo(/*include_android_build_number=*/true);
|
||||
+ content::GetAndroidOSInfo(/*include_android_build_number=*/true, major_version);
|
||||
}
|
||||
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
|
||||
@@ -8,13 +8,24 @@
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/version.h"
|
||||
+#include "base/system/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 4:
|
||||
+ return "Chrome/69.0.3497.100";
|
||||
+ }
|
||||
+
|
||||
+ // version 5 and above
|
||||
+ return "Chrome/71.0.3578.99";
|
||||
}
|
||||
|
||||
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
|
||||
@@ -85,7 +85,7 @@ 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 = GetAndroidOSInfo(include_android_build_number, os_major_version);
|
||||
#elif (defined(OS_POSIX) && !defined(OS_MACOSX)) || defined(OS_FUCHSIA)
|
||||
// Should work on any Posix system.
|
||||
struct utsname unixinfo;
|
||||
@@ -153,18 +153,39 @@ std::string BuildUserAgentFromProductAndExtraOSInfo(
|
||||
return BuildUserAgentFromOSAndProduct(os_info, product);
|
||||
}
|
||||
|
||||
-std::string GetAndroidOSInfo(bool include_android_build_number) {
|
||||
+std::string GetAndroidOSInfo(bool include_android_build_number, int32_t os_major_version) {
|
||||
std::string android_info_str;
|
||||
|
||||
- // Send information about the device.
|
||||
+ // Send spoofed 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 (!android_device_name.empty() && "REL" == android_build_codename) {
|
||||
- android_info_str += "; " + android_device_name;
|
||||
- semicolon_inserted = true;
|
||||
+ std::string android_device_name;
|
||||
+
|
||||
+ // Send information about the device and build ID.
|
||||
+ // Use a common device/build ID based on Android major version.
|
||||
+ switch (os_major_version) {
|
||||
+ default: // version 9 and above
|
||||
+ android_device_name = "ONEPLUS A6000";
|
||||
+ break;
|
||||
+ case 8:
|
||||
+ android_device_name = "FIG-LX3";
|
||||
+ break;
|
||||
+ case 7:
|
||||
+ android_device_name = "SM-G610M";
|
||||
+ break;
|
||||
+ case 6:
|
||||
+ android_device_name = "SM-J700M";
|
||||
+ break;
|
||||
+ case 5:
|
||||
+ android_device_name = "XT1033";
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ android_device_name = "ZTE Blade C370";
|
||||
+ break;
|
||||
}
|
||||
|
||||
+ android_info_str += "; " + android_device_name;
|
||||
+ semicolon_inserted = true;
|
||||
+
|
||||
// Append the build ID.
|
||||
if (base::FeatureList::IsEnabled(kAndroidUserAgentStringContainsBuildId) ||
|
||||
include_android_build_number) {
|
||||
diff --git a/content/public/common/user_agent.h b/content/public/common/user_agent.h
|
||||
--- a/content/public/common/user_agent.h
|
||||
+++ b/content/public/common/user_agent.h
|
||||
@@ -37,7 +37,7 @@ CONTENT_EXPORT std::string BuildUserAgentFromProductAndExtraOSInfo(
|
||||
bool include_android_build_number);
|
||||
|
||||
// Helper function to generate just the OS info.
|
||||
-CONTENT_EXPORT std::string GetAndroidOSInfo(bool include_android_build_number);
|
||||
+CONTENT_EXPORT std::string GetAndroidOSInfo(bool include_android_build_number, int32_t os_major_version);
|
||||
#endif
|
||||
|
||||
// Builds a full user agent string given a string describing the OS and a
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 11 Sep 2014 16:37:32 +0200
|
||||
Subject: autofill: disable autofill download manager
|
||||
|
||||
Disables the autofill download manager (trk:158).
|
||||
---
|
||||
.../autofill/core/browser/autofill_download_manager.cc | 13 ++++++++++++-
|
||||
components/autofill/core/browser/autofill_manager.cc | 18 ------------------
|
||||
2 files changed, 12 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc
|
||||
--- a/components/autofill/core/browser/autofill_download_manager.cc
|
||||
+++ b/components/autofill/core/browser/autofill_download_manager.cc
|
||||
@@ -60,7 +60,6 @@ constexpr std::pair<int, int> kAutofillExperimentRanges[] = {
|
||||
{3314445, 3314448}, {3314854, 3314883},
|
||||
};
|
||||
|
||||
-const size_t kMaxQueryGetSize = 1400; // 1.25KB
|
||||
const size_t kAutofillDownloadManagerMaxFormCacheSize = 16;
|
||||
const size_t kMaxFieldsPerQueryRequest = 100;
|
||||
|
||||
@@ -448,6 +447,7 @@ bool GetUploadPayloadForApi(const AutofillUploadContents& upload,
|
||||
return upload_request.SerializeToString(payload);
|
||||
}
|
||||
|
||||
+/*
|
||||
// Gets an API method URL given its type (query or upload) and an optional
|
||||
// resource ID.
|
||||
// Example usage:
|
||||
@@ -470,6 +470,7 @@ std::string GetAPIMethodUrl(AutofillDownloadManager::RequestType type,
|
||||
}
|
||||
return base::StrCat({api_method_url, "/", resource_id});
|
||||
}
|
||||
+*/
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -643,6 +644,7 @@ void AutofillDownloadManager::ClearUploadHistory(PrefService* pref_service) {
|
||||
|
||||
std::tuple<GURL, std::string> AutofillDownloadManager::GetRequestURLAndMethod(
|
||||
const FormRequestData& request_data) const {
|
||||
+#if 0
|
||||
std::string method("POST");
|
||||
std::string query_str;
|
||||
|
||||
@@ -665,12 +667,17 @@ std::tuple<GURL, std::string> AutofillDownloadManager::GetRequestURLAndMethod(
|
||||
GURL url = autofill_server_url_
|
||||
.Resolve(RequestTypeToString(request_data.request_type))
|
||||
.ReplaceComponents(replacements);
|
||||
+#else
|
||||
+ std::string method("GET");
|
||||
+ GURL url = GURL("about:blank");
|
||||
+#endif
|
||||
return std::make_tuple(std::move(url), std::move(method));
|
||||
}
|
||||
|
||||
std::tuple<GURL, std::string>
|
||||
AutofillDownloadManager::GetRequestURLAndMethodForApi(
|
||||
const FormRequestData& request_data) const {
|
||||
+#if 0
|
||||
// ID of the resource to add to the API request URL. Nothing will be added if
|
||||
// |resource_id| is empty.
|
||||
std::string resource_id;
|
||||
@@ -699,6 +706,10 @@ AutofillDownloadManager::GetRequestURLAndMethodForApi(
|
||||
(request_data.request_type == AutofillDownloadManager::REQUEST_QUERY)
|
||||
? "GET"
|
||||
: "POST";
|
||||
+#else
|
||||
+ std::string method("GET");
|
||||
+ GURL url = GURL("about:blank");
|
||||
+#endif
|
||||
return std::make_tuple(std::move(url), std::move(method));
|
||||
}
|
||||
|
||||
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
|
||||
@@ -175,19 +175,6 @@ void LogDeveloperEngagementUkm(ukm::UkmRecorder* ukm_recorder,
|
||||
}
|
||||
}
|
||||
|
||||
-std::string GetAPIKeyForUrl(version_info::Channel channel) {
|
||||
- // First look if we can get API key from command line flag.
|
||||
- const base::CommandLine& command_line =
|
||||
- *base::CommandLine::ForCurrentProcess();
|
||||
- if (command_line.HasSwitch(switches::kAutofillAPIKey))
|
||||
- return command_line.GetSwitchValueASCII(switches::kAutofillAPIKey);
|
||||
-
|
||||
- // Get the API key from Chrome baked keys.
|
||||
- if (channel == version_info::Channel::STABLE)
|
||||
- return google_apis::GetAPIKey();
|
||||
- return google_apis::GetNonStableAPIKey();
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
|
||||
AutofillManager::FillingContext::FillingContext() = default;
|
||||
@@ -1277,11 +1264,6 @@ AutofillManager::AutofillManager(
|
||||
weak_ptr_factory_(this) {
|
||||
DCHECK(driver);
|
||||
DCHECK(client_);
|
||||
- if (enable_download_manager == ENABLE_AUTOFILL_DOWNLOAD_MANAGER) {
|
||||
- version_info::Channel channel = client_->GetChannel();
|
||||
- download_manager_.reset(
|
||||
- new AutofillDownloadManager(driver, this, GetAPIKeyForUrl(channel)));
|
||||
- }
|
||||
CountryNames::SetLocaleString(app_locale_);
|
||||
// Since we want Downstream to still work in incognito, only overwrite the
|
||||
// PDM's sync service if this is not an incognito AutofillManager. However, if
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From: Joachim Bauch <bauch@struktur.de>
|
||||
Date: Tue, 9 Dec 2014 17:19:41 +0100
|
||||
Subject: browser-ui: disable warning about missing API keys
|
||||
|
||||
We do not want to use the services anyway ;)
|
||||
---
|
||||
chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
--- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
+++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
// static
|
||||
void GoogleApiKeysInfoBarDelegate::Create(InfoBarService* infobar_service) {
|
||||
+ return;
|
||||
infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
|
||||
std::unique_ptr<ConfirmInfoBarDelegate>(
|
||||
new GoogleApiKeysInfoBarDelegate())));
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 15 Sep 2014 10:58:42 +0200
|
||||
Subject: dns: send IPv6 connectivity probes to RIPE DNS
|
||||
|
||||
Short of disabling the code (we may do that in a subsequent patch
|
||||
anyway), avoid sending to Google.
|
||||
---
|
||||
net/dns/host_resolver_impl.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
|
||||
--- a/net/dns/host_resolver_impl.cc
|
||||
+++ b/net/dns/host_resolver_impl.cc
|
||||
@@ -117,10 +117,10 @@ const unsigned kMinimumTTLSeconds = kCacheEntryTTLSeconds;
|
||||
// cached.
|
||||
const int kIPv6ProbePeriodMs = 1000;
|
||||
|
||||
-// Google DNS address used for IPv6 probes.
|
||||
+/* RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted) */
|
||||
const uint8_t kIPv6ProbeAddress[] =
|
||||
- { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
|
||||
+ { 0x20, 0x01, 0x07, 0xfd, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
|
||||
|
||||
enum DnsResolveStatus {
|
||||
RESOLVE_STATUS_DNS_SUCCESS = 0,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Thu, 25 Jun 2015 15:34:10 +0200
|
||||
Subject: extensions: always show component extensions in the ext list
|
||||
|
||||
The attached patch makes sure that component extensions are always
|
||||
shown in "chrome://extensions".
|
||||
|
||||
Currently these are
|
||||
- Bookmark Manager
|
||||
- Chromium PDF Viewer
|
||||
- CryptoTokenExtension
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/28
|
||||
---
|
||||
extensions/common/extension.cc | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
|
||||
--- a/extensions/common/extension.cc
|
||||
+++ b/extensions/common/extension.cc
|
||||
@@ -379,9 +379,12 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
|
||||
}
|
||||
|
||||
bool Extension::ShouldExposeViaManagementAPI() const {
|
||||
+#if 0
|
||||
// Hide component extensions because they are only extensions as an
|
||||
// implementation detail of Chrome.
|
||||
return !extensions::Manifest::IsComponentLocation(location());
|
||||
+#endif
|
||||
+ return false;
|
||||
}
|
||||
|
||||
Extension::ManifestData* Extension::GetManifestData(const std::string& key)
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sat, 13 Sep 2014 17:12:43 +0200
|
||||
Subject: first_run: deactivate autoupdate globally
|
||||
|
||||
We currently do not have any update service infrastructure in place
|
||||
(i.e. on our webserver), and sending update requests to Google also
|
||||
sounds meh (wrong provider, after all).
|
||||
|
||||
Also, there is no tunable in chrome://settings (or similar) yet to
|
||||
turn it back on.
|
||||
---
|
||||
chrome/browser/extensions/extension_system_impl.cc | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
|
||||
--- a/chrome/browser/extensions/extension_system_impl.cc
|
||||
+++ b/chrome/browser/extensions/extension_system_impl.cc
|
||||
@@ -203,8 +203,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
|
||||
// ExtensionService depends on RuntimeData.
|
||||
runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
|
||||
|
||||
- bool autoupdate_enabled = !profile_->IsGuestSession() &&
|
||||
- !profile_->IsSystemProfile();
|
||||
+ bool autoupdate_enabled = false;
|
||||
#if defined(OS_CHROMEOS)
|
||||
if (!extensions_enabled ||
|
||||
chromeos::ProfileHelper::IsLockScreenAppProfile(profile_)) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
-219
@@ -1,219 +0,0 @@
|
||||
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
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
+#include "base/rand_util.h"
|
||||
#include "cc/input/overscroll_behavior.h"
|
||||
#include "cc/input/scroll_snap_data.h"
|
||||
#include "services/metrics/public/cpp/mojo_ukm_recorder.h"
|
||||
@@ -738,6 +739,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
|
||||
@@ -803,6 +808,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
|
||||
@@ -393,6 +393,9 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
|
||||
}
|
||||
|
||||
+ double GetShuffleFactorX();
|
||||
+ double GetShuffleFactorY();
|
||||
+
|
||||
String visibilityState() const;
|
||||
bool IsPageVisible() const;
|
||||
bool hidden() const;
|
||||
@@ -1815,6 +1818,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
|
||||
@@ -1222,6 +1222,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);
|
||||
}
|
||||
|
||||
@@ -1239,6 +1248,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
|
||||
@@ -1642,11 +1642,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
|
||||
@@ -45,6 +45,24 @@ void TextMetrics::Trace(Visitor* visitor) {
|
||||
|
||||
TextMetrics::TextMetrics() : baselines_(Baselines::Create()) {}
|
||||
|
||||
+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
|
||||
@@ -71,6 +71,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
|
||||
|
||||
void Trace(Visitor*) override;
|
||||
|
||||
+ void Shuffle(const double factor);
|
||||
+
|
||||
private:
|
||||
void Update(const Font&,
|
||||
const TextDirection&,
|
||||
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
|
||||
@@ -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/common/features.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
@@ -793,8 +795,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
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
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,161 +0,0 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:06:15 +0200
|
||||
Subject: kill Auth
|
||||
|
||||
---
|
||||
.../chrome/browser/signin/SigninHelper.java | 22 +---------
|
||||
.../components/signin/AccountIdProvider.java | 9 +---
|
||||
.../signin/SystemAccountManagerDelegate.java | 50 ++--------------------
|
||||
3 files changed, 5 insertions(+), 76 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
@@ -10,10 +10,6 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
-import com.google.android.gms.auth.AccountChangeEvent;
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -73,23 +69,7 @@ public class SigninHelper {
|
||||
@Override
|
||||
public List<String> getAccountChangeEvents(
|
||||
Context context, int index, String accountName) {
|
||||
- try {
|
||||
- List<AccountChangeEvent> list = GoogleAuthUtil.getAccountChangeEvents(
|
||||
- context, index, accountName);
|
||||
- List<String> result = new ArrayList<>(list.size());
|
||||
- for (AccountChangeEvent e : list) {
|
||||
- if (e.getChangeType() == GoogleAuthUtil.CHANGE_TYPE_ACCOUNT_RENAMED_TO) {
|
||||
- result.add(e.getChangeData());
|
||||
- } else {
|
||||
- result.add(null);
|
||||
- }
|
||||
- }
|
||||
- return result;
|
||||
- } catch (IOException e) {
|
||||
- Log.w(TAG, "Failed to get change events", e);
|
||||
- } catch (GoogleAuthException e) {
|
||||
- Log.w(TAG, "Failed to get change events", e);
|
||||
- }
|
||||
+
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
}
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
package org.chromium.components.signin;
|
||||
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
@@ -40,12 +38,7 @@ public class AccountIdProvider {
|
||||
* @param accountName The email address of a Google account.
|
||||
*/
|
||||
public String getAccountId(String accountName) {
|
||||
- try {
|
||||
- return GoogleAuthUtil.getAccountId(ContextUtils.getApplicationContext(), accountName);
|
||||
- } catch (IOException | GoogleAuthException ex) {
|
||||
- Log.e("cr.AccountIdProvider", "AccountIdProvider.getAccountId", ex);
|
||||
- return null;
|
||||
- }
|
||||
+ return null;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
@@ -24,9 +24,6 @@ import android.os.PatternMatcher;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
-import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
@@ -116,48 +113,18 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
// so don't report any accounts if Google Play Services are out of date.
|
||||
checkCanUseGooglePlayServices();
|
||||
|
||||
- if (!hasGetAccountsPermission()) {
|
||||
- return new Account[] {};
|
||||
- }
|
||||
- long now = SystemClock.elapsedRealtime();
|
||||
- Account[] accounts = mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
|
||||
- long elapsed = SystemClock.elapsedRealtime() - now;
|
||||
- recordElapsedTimeHistogram("Signin.AndroidGetAccountsTime_AccountManager", elapsed);
|
||||
- if (ThreadUtils.runningOnUiThread()) {
|
||||
- recordElapsedTimeHistogram(
|
||||
- "Signin.AndroidGetAccountsTimeUiThread_AccountManager", elapsed);
|
||||
- }
|
||||
- return accounts;
|
||||
+ return new Account[] {};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthToken(Account account, String authTokenScope) throws AuthException {
|
||||
assert !ThreadUtils.runningOnUiThread();
|
||||
assert AccountManagerFacade.GOOGLE_ACCOUNT_TYPE.equals(account.type);
|
||||
- try {
|
||||
- return GoogleAuthUtil.getTokenWithNotification(
|
||||
- ContextUtils.getApplicationContext(), account, authTokenScope, null);
|
||||
- } catch (GoogleAuthException ex) {
|
||||
- // This case includes a UserRecoverableNotifiedException, but most clients will have
|
||||
- // their own retry mechanism anyway.
|
||||
- throw new AuthException(AuthException.NONTRANSIENT,
|
||||
- "Error while getting token for scope '" + authTokenScope + "'", ex);
|
||||
- } catch (IOException ex) {
|
||||
- throw new AuthException(AuthException.TRANSIENT, ex);
|
||||
- }
|
||||
+ return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void invalidateAuthToken(String authToken) throws AuthException {
|
||||
- try {
|
||||
- GoogleAuthUtil.clearToken(ContextUtils.getApplicationContext(), authToken);
|
||||
- } catch (GooglePlayServicesAvailabilityException ex) {
|
||||
- throw new AuthException(AuthException.NONTRANSIENT, ex);
|
||||
- } catch (GoogleAuthException ex) {
|
||||
- throw new AuthException(AuthException.NONTRANSIENT, ex);
|
||||
- } catch (IOException ex) {
|
||||
- throw new AuthException(AuthException.TRANSIENT, ex);
|
||||
- }
|
||||
+ public void invalidateAuthToken(String authToken) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -187,17 +154,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void createAddAccountIntent(Callback<Intent> callback) {
|
||||
- AccountManagerCallback<Bundle> accountManagerCallback = accountManagerFuture -> {
|
||||
- try {
|
||||
- Bundle bundle = accountManagerFuture.getResult();
|
||||
- callback.onResult(bundle.getParcelable(AccountManager.KEY_INTENT));
|
||||
- } catch (OperationCanceledException | IOException | AuthenticatorException e) {
|
||||
- Log.e(TAG, "Error while creating an intent to add an account: ", e);
|
||||
- callback.onResult(null);
|
||||
- }
|
||||
- };
|
||||
- mAccountManager.addAccount(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE, null, null, null, null,
|
||||
- accountManagerCallback, null);
|
||||
}
|
||||
|
||||
// No permission is needed on 23+ and Chrome always has MANAGE_ACCOUNTS permission on lower APIs
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,977 +0,0 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:11:38 +0200
|
||||
Subject: kill GCM
|
||||
|
||||
---
|
||||
build/secondary/third_party/android_tools/BUILD.gn | 3 -
|
||||
chrome/android/BUILD.gn | 1 -
|
||||
chrome/android/java/AndroidManifest.xml | 62 ---------
|
||||
.../chrome/browser/BackgroundSyncLauncher.java | 97 --------------
|
||||
.../chrome/browser/ChromeBackgroundService.java | 1 -
|
||||
.../invalidation/InvalidationController.java | 8 --
|
||||
.../browser/ntp/snippets/SnippetsLauncher.java | 44 -------
|
||||
.../browser/services/gcm/GCMBackgroundTask.java | 2 +-
|
||||
.../gcm/InvalidationGcmUpstreamSender.java | 15 ---
|
||||
chrome/android/java_sources.gni | 2 -
|
||||
components/background_task_scheduler/BUILD.gn | 1 -
|
||||
.../BackgroundTaskSchedulerGcmNetworkManager.java | 146 +--------------------
|
||||
components/gcm_driver/android/BUILD.gn | 1 -
|
||||
components/gcm_driver/instance_id/android/BUILD.gn | 1 -
|
||||
.../gcm_driver/instance_id/InstanceIDBridge.java | 40 +-----
|
||||
components/sync/android/BUILD.gn | 1 -
|
||||
third_party/cacheinvalidation/BUILD.gn | 6 -
|
||||
.../client/contrib/MultiplexingGcmListener.java | 92 +------------
|
||||
.../android2/channel/AndroidNetworkChannel.java | 18 +--
|
||||
19 files changed, 15 insertions(+), 526 deletions(-)
|
||||
|
||||
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
|
||||
--- a/build/secondary/third_party/android_tools/BUILD.gn
|
||||
+++ b/build/secondary/third_party/android_tools/BUILD.gn
|
||||
@@ -83,9 +83,6 @@ if (enable_java_templates) {
|
||||
testonly = true
|
||||
java_files = [ "//third_party/android_tools/sdk/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java" ]
|
||||
}
|
||||
- android_java_prebuilt("android_gcm_java") {
|
||||
- jar_path = "//third_party/android_tools/sdk/extras/google/gcm/gcm-client/dist/gcm.jar"
|
||||
- }
|
||||
android_java_prebuilt("emma_device_java") {
|
||||
jar_path = "//third_party/android_tools/sdk/tools/lib/emma_device.jar"
|
||||
include_java_resources = true
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -344,7 +344,6 @@ android_library("chrome_java") {
|
||||
"//third_party/android_deps:javax_inject_javax_inject_java",
|
||||
"//third_party/android_media:android_media_java",
|
||||
"//third_party/android_swipe_refresh:android_swipe_refresh_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/blink/public:android_mojo_bindings_java",
|
||||
"//third_party/blink/public:blink_headers_java",
|
||||
"//third_party/blink/public/mojom:android_mojo_bindings_java",
|
||||
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
|
||||
@@ -75,22 +75,17 @@ by a child template that "extends" this file.
|
||||
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
|
||||
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
|
||||
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
|
||||
- <!-- Only chrome can receive the messages and registration result -->
|
||||
- <permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE"
|
||||
- android:protectionLevel="signature" />
|
||||
<permission android:name="{{ manifest_package }}.permission.DEBUG"
|
||||
android:label="Debug web pages"
|
||||
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
- <uses-permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE" />
|
||||
<uses-permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" />
|
||||
<uses-permission android:name="{{ manifest_package }}.TOS_ACKED" />
|
||||
|
||||
<uses-permission android:name="com.chrome.permission.DEVICE_EXTRAS" />
|
||||
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
|
||||
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
|
||||
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
|
||||
|
||||
{% block extra_uses_permissions %}
|
||||
@@ -984,47 +979,8 @@ by a child template that "extends" this file.
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
|
||||
android:hardwareAccelerated="false" />
|
||||
|
||||
- <!-- Receiver for GCM messages. -->
|
||||
- <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
|
||||
- android:exported="true"
|
||||
- android:permission="com.google.android.c2dm.permission.SEND">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
- <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||
- <category android:name="{{ manifest_package }}"/>
|
||||
- </intent-filter>
|
||||
- </receiver>
|
||||
- <!-- GcmTaskService for registration for Invalidations. -->
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.GcmRegistrationTaskService"
|
||||
- android:exported="true"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE" >
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <!-- InstanceIDListenerService for token refresh events from GCM. -->
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidInstanceIDListenerService"
|
||||
- android:exported="false">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.iid.InstanceID"/>
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <!-- GcmListenerService for messages from GCM. -->
|
||||
- <service android:name="org.chromium.chrome.browser.services.gcm.ChromeGcmListenerService"
|
||||
- android:exported="false" >
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <meta-data android:name="ipc.invalidation.ticl.gcm_upstream_service_class"
|
||||
- android:value="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender" />
|
||||
- <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
|
||||
- android:exported="false"/>
|
||||
-
|
||||
<service android:name="com.google.ipc.invalidation.ticl.android2.TiclService"
|
||||
android:exported="false"/>
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"
|
||||
- android:exported="false"/>
|
||||
<receiver android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"
|
||||
android:exported="false"/>
|
||||
<receiver android:name="com.google.ipc.invalidation.external.client.contrib.AndroidListener$AlarmReceiver"
|
||||
@@ -1051,24 +1007,6 @@ by a child template that "extends" this file.
|
||||
android:exported="false"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"/>
|
||||
|
||||
- <!-- Background Task Scheduler GCM task service -->
|
||||
- <service android:name="org.chromium.components.background_task_scheduler.BackgroundTaskGcmTaskService"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
|
||||
- android:exported="true">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
-
|
||||
- <!-- GcmTaskService implementation to wake Chrome on scheduled events -->
|
||||
- <service android:name="org.chromium.chrome.browser.ChromeBackgroundService"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
|
||||
- android:exported="true">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
-
|
||||
<service android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService"
|
||||
android:exported="true"
|
||||
tools:ignore="ExportedService" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
@@ -8,10 +8,6 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.StrictMode;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.OneoffTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -37,8 +33,6 @@ public class BackgroundSyncLauncher {
|
||||
// BackgroundSyncLauncherAndroid, if any. If it is non-null then the browser is running.
|
||||
private static BackgroundSyncLauncher sInstance;
|
||||
|
||||
- private GcmNetworkManager mScheduler;
|
||||
-
|
||||
/**
|
||||
* Disables the automatic use of the GCMNetworkManager. When disabled, the methods which
|
||||
* interact with GCM can still be used, but will not be called automatically on creation, or by
|
||||
@@ -123,30 +117,6 @@ public class BackgroundSyncLauncher {
|
||||
@VisibleForTesting
|
||||
@CalledByNative
|
||||
protected void launchBrowserIfStopped(final boolean shouldLaunch, final long minDelayMs) {
|
||||
- mLaunchBrowserIfStoppedTask = new AsyncTask<Void>() {
|
||||
- @Override
|
||||
- protected Void doInBackground() {
|
||||
- SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
||||
- prefs.edit()
|
||||
- .putBoolean(PREF_BACKGROUND_SYNC_LAUNCH_NEXT_ONLINE, shouldLaunch)
|
||||
- .apply();
|
||||
- return null;
|
||||
- }
|
||||
- @Override
|
||||
- protected void onPostExecute(Void params) {
|
||||
- if (sGCMEnabled) {
|
||||
- if (shouldLaunch) {
|
||||
- RecordHistogram.recordBooleanHistogram(
|
||||
- "BackgroundSync.LaunchTask.ScheduleSuccess",
|
||||
- scheduleLaunchTask(mScheduler, minDelayMs));
|
||||
- } else {
|
||||
- RecordHistogram.recordBooleanHistogram(
|
||||
- "BackgroundSync.LaunchTask.CancelSuccess",
|
||||
- removeScheduledTasks(mScheduler));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,7 +128,6 @@ public class BackgroundSyncLauncher {
|
||||
}
|
||||
|
||||
protected BackgroundSyncLauncher() {
|
||||
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
|
||||
launchBrowserIfStopped(false, 0);
|
||||
}
|
||||
|
||||
@@ -187,72 +156,6 @@ public class BackgroundSyncLauncher {
|
||||
return !sGCMEnabled;
|
||||
}
|
||||
|
||||
- private static boolean scheduleLaunchTask(GcmNetworkManager scheduler, long minDelayMs) {
|
||||
- // Google Play Services may not be up to date, if the application was not installed through
|
||||
- // the Play Store. In this case, scheduling the task will fail silently.
|
||||
- final long minDelaySecs = minDelayMs / 1000;
|
||||
- OneoffTask oneoff = new OneoffTask.Builder()
|
||||
- .setService(ChromeBackgroundService.class)
|
||||
- .setTag(TASK_TAG)
|
||||
- // We have to set a non-zero execution window here
|
||||
- .setExecutionWindow(minDelaySecs, minDelaySecs + 1)
|
||||
- .setRequiredNetwork(Task.NETWORK_STATE_CONNECTED)
|
||||
- .setPersisted(true)
|
||||
- .setUpdateCurrent(true)
|
||||
- .build();
|
||||
- try {
|
||||
- scheduler.schedule(oneoff);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- // Disable GCM for the remainder of this session.
|
||||
- setGCMEnabled(false);
|
||||
- // Return false so that the failure will be logged.
|
||||
- return false;
|
||||
- }
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- private static boolean removeScheduledTasks(GcmNetworkManager scheduler) {
|
||||
- // Third-party code causes broadcast to touch disk. http://crbug.com/614679
|
||||
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
|
||||
- try {
|
||||
- scheduler.cancelTask(TASK_TAG, ChromeBackgroundService.class);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- // This occurs when BackgroundSyncLauncherService is not found in the application
|
||||
- // manifest. This should not happen in code that reaches here, but has been seen in
|
||||
- // the past. See https://crbug.com/548314
|
||||
- // Disable GCM for the remainder of this session.
|
||||
- setGCMEnabled(false);
|
||||
- // Return false so that the failure will be logged.
|
||||
- return false;
|
||||
- } finally {
|
||||
- StrictMode.setThreadPolicy(oldPolicy);
|
||||
- }
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Reschedule any required background sync tasks, if they have been removed due to an
|
||||
- * application upgrade.
|
||||
- *
|
||||
- * This method checks the saved preferences, and reschedules the sync tasks as appropriate
|
||||
- * to match the preferences.
|
||||
- * This method is static so that it can be run without actually instantiating a
|
||||
- * BackgroundSyncLauncher.
|
||||
- */
|
||||
- protected static void rescheduleTasksOnUpgrade(final Context context) {
|
||||
- final GcmNetworkManager scheduler = GcmNetworkManager.getInstance(context);
|
||||
- BackgroundSyncLauncher.ShouldLaunchCallback callback = shouldLaunch -> {
|
||||
- if (shouldLaunch) {
|
||||
- // It's unclear what time the sync event was supposed to fire, so fire
|
||||
- // without delay and let the browser reschedule if necessary.
|
||||
- // TODO(iclelland): If this fails, report the failure via UMA (not now,
|
||||
- // since the browser is not running, but on next startup.)
|
||||
- scheduleLaunchTask(scheduler, 0);
|
||||
- }
|
||||
- };
|
||||
- BackgroundSyncLauncher.shouldLaunchBrowserIfStopped(callback);
|
||||
- }
|
||||
-
|
||||
@VisibleForTesting
|
||||
static void setGCMEnabled(boolean enabled) {
|
||||
sGCMEnabled = enabled;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
|
||||
@@ -115,7 +115,6 @@ public class ChromeBackgroundService extends GcmTaskService {
|
||||
|
||||
@VisibleForTesting
|
||||
protected void rescheduleBackgroundSyncTasksOnUpgrade() {
|
||||
- BackgroundSyncLauncher.rescheduleTasksOnUpgrade(this);
|
||||
}
|
||||
|
||||
private void handleSnippetsOnBrowserUpgraded() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java
|
||||
@@ -10,8 +10,6 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
|
||||
-import com.google.ipc.invalidation.ticl.android2.channel.AndroidGcmController;
|
||||
-
|
||||
import org.chromium.base.ApplicationState;
|
||||
import org.chromium.base.ApplicationStatus;
|
||||
import org.chromium.base.ContextUtils;
|
||||
@@ -193,13 +191,7 @@ public class InvalidationController implements ApplicationStatus.ApplicationStat
|
||||
* Registers for Google Cloud Messaging (GCM) for Invalidations.
|
||||
*/
|
||||
private void ensureGcmIsInitialized() {
|
||||
- if (mGcmInitialized) return;
|
||||
mGcmInitialized = true;
|
||||
- PostTask.postTask(TaskTraits.BEST_EFFORT_MAY_BLOCK, () -> {
|
||||
- boolean useGcmUpstream = true;
|
||||
- AndroidGcmController.get(ContextUtils.getApplicationContext())
|
||||
- .initializeGcm(useGcmUpstream);
|
||||
- });
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
@@ -7,15 +7,10 @@ package org.chromium.chrome.browser.ntp.snippets;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.PeriodicTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
-import org.chromium.chrome.browser.ChromeBackgroundService;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
|
||||
/**
|
||||
@@ -40,8 +35,6 @@ public class SnippetsLauncher {
|
||||
// If it is non-null then the browser is running.
|
||||
private static SnippetsLauncher sInstance;
|
||||
|
||||
- private GcmNetworkManager mScheduler;
|
||||
-
|
||||
private boolean mGCMEnabled = true;
|
||||
|
||||
/**
|
||||
@@ -78,7 +71,6 @@ public class SnippetsLauncher {
|
||||
|
||||
protected SnippetsLauncher() {
|
||||
checkGCM();
|
||||
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
|
||||
}
|
||||
|
||||
private void checkGCM() {
|
||||
@@ -89,32 +81,7 @@ public class SnippetsLauncher {
|
||||
}
|
||||
}
|
||||
|
||||
- private static PeriodicTask buildFetchTask(
|
||||
- String tag, long periodSeconds, int requiredNetwork) {
|
||||
- // Add a bit of "flex" around the target period. This achieves the following:
|
||||
- // - It makes sure the task doesn't run (significantly) before its initial period has
|
||||
- // elapsed. In practice, the scheduler seems to behave like that anyway, but it doesn't
|
||||
- // guarantee that, so we shouldn't rely on it.
|
||||
- // - It gives the scheduler a bit of room to optimize for battery life.
|
||||
- long effectivePeriodSeconds = (long) (periodSeconds * (1.0 + FLEX_FACTOR));
|
||||
- long flexSeconds = (long) (periodSeconds * (2.0 * FLEX_FACTOR));
|
||||
- return new PeriodicTask.Builder()
|
||||
- .setService(ChromeBackgroundService.class)
|
||||
- .setTag(tag)
|
||||
- .setPeriod(effectivePeriodSeconds)
|
||||
- .setFlex(flexSeconds)
|
||||
- .setRequiredNetwork(requiredNetwork)
|
||||
- .setPersisted(true)
|
||||
- .setUpdateCurrent(true)
|
||||
- .build();
|
||||
- }
|
||||
-
|
||||
private void scheduleOrCancelFetchTask(String taskTag, long period, int requiredNetwork) {
|
||||
- if (period > 0) {
|
||||
- mScheduler.schedule(buildFetchTask(taskTag, period, requiredNetwork));
|
||||
- } else {
|
||||
- mScheduler.cancelTask(taskTag, ChromeBackgroundService.class);
|
||||
- }
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
@@ -127,23 +94,12 @@ public class SnippetsLauncher {
|
||||
.edit()
|
||||
.putBoolean(PREF_IS_SCHEDULED, isScheduled)
|
||||
.apply();
|
||||
-
|
||||
- // Google Play Services may not be up to date, if the application was not installed through
|
||||
- // the Play Store. In this case, scheduling the task will fail silently.
|
||||
- try {
|
||||
- scheduleOrCancelFetchTask(
|
||||
- TASK_TAG_WIFI, periodWifiSeconds, Task.NETWORK_STATE_UNMETERED);
|
||||
- scheduleOrCancelFetchTask(
|
||||
- TASK_TAG_FALLBACK, periodFallbackSeconds, Task.NETWORK_STATE_CONNECTED);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
// Disable GCM for the remainder of this session.
|
||||
mGCMEnabled = false;
|
||||
|
||||
ContextUtils.getAppSharedPreferences().edit().remove(PREF_IS_SCHEDULED).apply();
|
||||
// Return false so that the failure will be logged.
|
||||
return false;
|
||||
- }
|
||||
- return true;
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
@@ -41,7 +41,7 @@ public class GCMBackgroundTask implements BackgroundTask {
|
||||
return false;
|
||||
}
|
||||
|
||||
- ChromeGcmListenerService.dispatchMessageToDriver(context, message);
|
||||
+ //ChromeGcmListenerService.dispatchMessageToDriver(context, message);
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
@@ -13,7 +13,6 @@ import android.support.annotation.MainThread;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
-import com.google.android.gms.gcm.GoogleCloudMessaging;
|
||||
import com.google.ipc.invalidation.ticl.android2.channel.GcmUpstreamSenderService;
|
||||
|
||||
import org.chromium.base.ContextUtils;
|
||||
@@ -87,20 +86,6 @@ public class InvalidationGcmUpstreamSender extends GcmUpstreamSenderService {
|
||||
* This function runs on a thread pool executor thread.
|
||||
*/
|
||||
private void sendUpstreamMessage(String to, Bundle data, String token, Context context) {
|
||||
- // Add the OAuth2 token to the bundle. The token should have the prefix Bearer added to it.
|
||||
- data.putString("Authorization", "Bearer " + token);
|
||||
- if (!isMessageWithinLimit(data)) {
|
||||
- GcmUma.recordGcmUpstreamHistogram(context, GcmUma.UMA_UPSTREAM_SIZE_LIMIT_EXCEEDED);
|
||||
- return;
|
||||
- }
|
||||
- String msgId = UUID.randomUUID().toString();
|
||||
- try {
|
||||
- GoogleCloudMessaging.getInstance(ContextUtils.getApplicationContext())
|
||||
- .send(to, msgId, 1, data);
|
||||
- } catch (IOException | IllegalArgumentException exception) {
|
||||
- Log.w(TAG, "Send message failed");
|
||||
- GcmUma.recordGcmUpstreamHistogram(context, GcmUma.UMA_UPSTREAM_SEND_FAILED);
|
||||
- }
|
||||
}
|
||||
|
||||
private boolean isMessageWithinLimit(Bundle data) {
|
||||
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
|
||||
@@ -31,7 +31,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/ChromeActivity.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeApplication.java",
|
||||
- "java/src/org/chromium/chrome/browser/ChromeBackgroundService.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeBackupAgent.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java",
|
||||
@@ -1385,7 +1384,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java",
|
||||
"java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java",
|
||||
"java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java",
|
||||
- "java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java",
|
||||
diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
|
||||
--- a/components/background_task_scheduler/BUILD.gn
|
||||
+++ b/components/background_task_scheduler/BUILD.gn
|
||||
@@ -30,7 +30,6 @@ if (is_android) {
|
||||
android_library("background_task_scheduler_java") {
|
||||
java_files = [
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTask.java",
|
||||
- "android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskReflection.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskScheduler.java",
|
||||
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
@@ -8,14 +8,6 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.OneoffTask;
|
||||
-import com.google.android.gms.gcm.PeriodicTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-import com.google.android.gms.gcm.TaskParams;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -34,104 +26,6 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
@VisibleForTesting
|
||||
static final String BACKGROUND_TASK_EXTRAS_KEY = "_background_task_extras";
|
||||
|
||||
- static BackgroundTask getBackgroundTaskFromTaskParams(@NonNull TaskParams taskParams) {
|
||||
- String backgroundTaskClassName = getBackgroundTaskClassFromTaskParams(taskParams);
|
||||
- return BackgroundTaskReflection.getBackgroundTaskFromClassName(backgroundTaskClassName);
|
||||
- }
|
||||
-
|
||||
- private static String getBackgroundTaskClassFromTaskParams(@NonNull TaskParams taskParams) {
|
||||
- Bundle extras = taskParams.getExtras();
|
||||
- if (extras == null) return null;
|
||||
- return extras.getString(BACKGROUND_TASK_CLASS_KEY);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Retrieves the {@link TaskParameters} from the {@link TaskParams}, which are passed as
|
||||
- * one of the keys. Only values valid for {@link android.os.BaseBundle} are supported, and other
|
||||
- * values are stripped at the time when the task is scheduled.
|
||||
- *
|
||||
- * @param taskParams the {@link TaskParams} to extract the {@link TaskParameters} from.
|
||||
- * @return the {@link TaskParameters} for the current job.
|
||||
- */
|
||||
- static TaskParameters getTaskParametersFromTaskParams(@NonNull TaskParams taskParams) {
|
||||
- int taskId;
|
||||
- try {
|
||||
- taskId = Integer.parseInt(taskParams.getTag());
|
||||
- } catch (NumberFormatException e) {
|
||||
- Log.e(TAG, "Cound not parse task ID from task tag: " + taskParams.getTag());
|
||||
- return null;
|
||||
- }
|
||||
-
|
||||
- TaskParameters.Builder builder = TaskParameters.create(taskId);
|
||||
-
|
||||
- Bundle extras = taskParams.getExtras();
|
||||
- Bundle taskExtras = extras.getBundle(BACKGROUND_TASK_EXTRAS_KEY);
|
||||
- builder.addExtras(taskExtras);
|
||||
-
|
||||
- return builder.build();
|
||||
- }
|
||||
-
|
||||
- @VisibleForTesting
|
||||
- static Task createTaskFromTaskInfo(@NonNull TaskInfo taskInfo) {
|
||||
- Bundle taskExtras = new Bundle();
|
||||
- taskExtras.putString(
|
||||
- BACKGROUND_TASK_CLASS_KEY, taskInfo.getBackgroundTaskClass().getName());
|
||||
- taskExtras.putBundle(BACKGROUND_TASK_EXTRAS_KEY, taskInfo.getExtras());
|
||||
-
|
||||
- Task.Builder builder;
|
||||
- if (taskInfo.isPeriodic()) {
|
||||
- builder = getPeriodicTaskBuilder(taskInfo.getPeriodicInfo());
|
||||
- } else {
|
||||
- builder = getOneOffTaskBuilder(taskInfo.getOneOffInfo());
|
||||
- }
|
||||
-
|
||||
- builder.setExtras(taskExtras)
|
||||
- .setPersisted(taskInfo.isPersisted())
|
||||
- .setRequiredNetwork(getGcmNetworkManagerNetworkTypeFromTypeFromTaskNetworkType(
|
||||
- taskInfo.getRequiredNetworkType()))
|
||||
- .setRequiresCharging(taskInfo.requiresCharging())
|
||||
- .setService(BackgroundTaskGcmTaskService.class)
|
||||
- .setTag(taskIdToTaskTag(taskInfo.getTaskId()))
|
||||
- .setUpdateCurrent(taskInfo.shouldUpdateCurrent());
|
||||
-
|
||||
- return builder.build();
|
||||
- }
|
||||
-
|
||||
- private static Task.Builder getPeriodicTaskBuilder(TaskInfo.PeriodicInfo periodicInfo) {
|
||||
- PeriodicTask.Builder builder = new PeriodicTask.Builder();
|
||||
- builder.setPeriod(TimeUnit.MILLISECONDS.toSeconds(periodicInfo.getIntervalMs()));
|
||||
- if (periodicInfo.hasFlex()) {
|
||||
- builder.setFlex(TimeUnit.MILLISECONDS.toSeconds(periodicInfo.getFlexMs()));
|
||||
- }
|
||||
- return builder;
|
||||
- }
|
||||
-
|
||||
- private static Task.Builder getOneOffTaskBuilder(TaskInfo.OneOffInfo oneOffInfo) {
|
||||
- OneoffTask.Builder builder = new OneoffTask.Builder();
|
||||
- long windowStartSeconds = oneOffInfo.hasWindowStartTimeConstraint()
|
||||
- ? TimeUnit.MILLISECONDS.toSeconds(oneOffInfo.getWindowStartTimeMs())
|
||||
- : 0;
|
||||
- builder.setExecutionWindow(windowStartSeconds,
|
||||
- TimeUnit.MILLISECONDS.toSeconds(oneOffInfo.getWindowEndTimeMs()));
|
||||
- return builder;
|
||||
- }
|
||||
-
|
||||
- private static int getGcmNetworkManagerNetworkTypeFromTypeFromTaskNetworkType(
|
||||
- @TaskInfo.NetworkType int networkType) {
|
||||
- switch (networkType) {
|
||||
- // This is correct: GcmNM ANY means no network is guaranteed.
|
||||
- case TaskInfo.NetworkType.NONE:
|
||||
- return Task.NETWORK_STATE_ANY;
|
||||
- case TaskInfo.NetworkType.ANY:
|
||||
- return Task.NETWORK_STATE_CONNECTED;
|
||||
- case TaskInfo.NetworkType.UNMETERED:
|
||||
- return Task.NETWORK_STATE_UNMETERED;
|
||||
- default:
|
||||
- assert false;
|
||||
- }
|
||||
- return Task.NETWORK_STATE_ANY;
|
||||
- }
|
||||
-
|
||||
@Override
|
||||
public boolean schedule(Context context, @NonNull TaskInfo taskInfo) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
@@ -142,50 +36,12 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
+ " has no parameterless public constructor.");
|
||||
return false;
|
||||
}
|
||||
-
|
||||
- GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
|
||||
- if (gcmNetworkManager == null) {
|
||||
- Log.e(TAG, "GcmNetworkManager is not available.");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- try {
|
||||
- Task task = createTaskFromTaskInfo(taskInfo);
|
||||
- gcmNetworkManager.schedule(task);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- String gcmErrorMessage = e.getMessage() == null ? "null." : e.getMessage();
|
||||
- Log.e(TAG,
|
||||
- "GcmNetworkManager failed to schedule task, gcm message: " + gcmErrorMessage);
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(Context context, int taskId) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
-
|
||||
- GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
|
||||
- if (gcmNetworkManager == null) {
|
||||
- Log.e(TAG, "GcmNetworkManager is not available.");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- try {
|
||||
- gcmNetworkManager.cancelTask(
|
||||
- taskIdToTaskTag(taskId), BackgroundTaskGcmTaskService.class);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- Log.e(TAG, "GcmNetworkManager failed to cancel task.");
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private GcmNetworkManager getGcmNetworkManager(Context context) {
|
||||
- if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
|
||||
- == ConnectionResult.SUCCESS) {
|
||||
- return GcmNetworkManager.getInstance(context);
|
||||
- }
|
||||
- return null;
|
||||
}
|
||||
|
||||
private static String taskIdToTaskTag(int taskId) {
|
||||
diff --git a/components/gcm_driver/android/BUILD.gn b/components/gcm_driver/android/BUILD.gn
|
||||
--- a/components/gcm_driver/android/BUILD.gn
|
||||
+++ b/components/gcm_driver/android/BUILD.gn
|
||||
@@ -15,7 +15,6 @@ android_library("gcm_driver_java") {
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//content/public/android:content_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/jsr-305:jsr_305_javalib",
|
||||
]
|
||||
|
||||
diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
--- a/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
+++ b/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
@@ -27,7 +27,6 @@ android_library("instance_id_driver_java") {
|
||||
|
||||
java_files = [
|
||||
"java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java",
|
||||
- "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java",
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
--- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
+++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
@@ -26,7 +26,6 @@ public class InstanceIDBridge {
|
||||
* Underlying InstanceIDWithSubtype. May be shared by multiple InstanceIDBridges. Must be
|
||||
* initialized on a background thread.
|
||||
*/
|
||||
- private InstanceIDWithSubtype mInstanceID;
|
||||
|
||||
private static boolean sBlockOnAsyncTasksForTesting;
|
||||
|
||||
@@ -71,7 +70,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<String>() {
|
||||
@Override
|
||||
protected String doBackgroundWork() {
|
||||
- return mInstanceID.getId();
|
||||
+ return "";
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(String id) {
|
||||
@@ -86,7 +85,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Long>() {
|
||||
@Override
|
||||
protected Long doBackgroundWork() {
|
||||
- return mInstanceID.getCreationTime();
|
||||
+ return 0L;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Long creationTime) {
|
||||
@@ -111,15 +110,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<String>() {
|
||||
@Override
|
||||
protected String doBackgroundWork() {
|
||||
- try {
|
||||
- LazySubscriptionsManager.storeLazinessInformation(
|
||||
- LazySubscriptionsManager.buildSubscriptionUniqueId(
|
||||
- mSubtype, authorizedEntity),
|
||||
- isLazy);
|
||||
- return mInstanceID.getToken(authorizedEntity, scope, extras);
|
||||
- } catch (IOException ex) {
|
||||
- return "";
|
||||
- }
|
||||
+ return "";
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(String token) {
|
||||
@@ -135,18 +126,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean doBackgroundWork() {
|
||||
- try {
|
||||
- mInstanceID.deleteToken(authorizedEntity, scope);
|
||||
- String subscriptionId = LazySubscriptionsManager.buildSubscriptionUniqueId(
|
||||
- mSubtype, authorizedEntity);
|
||||
- if (LazySubscriptionsManager.isSubscriptionLazy(subscriptionId)) {
|
||||
- LazySubscriptionsManager.deletePersistedMessagesForSubscriptionId(
|
||||
- subscriptionId);
|
||||
- }
|
||||
- return true;
|
||||
- } catch (IOException ex) {
|
||||
- return false;
|
||||
- }
|
||||
+ return false;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Boolean success) {
|
||||
@@ -161,12 +141,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean doBackgroundWork() {
|
||||
- try {
|
||||
- mInstanceID.deleteInstanceID();
|
||||
- return true;
|
||||
- } catch (IOException ex) {
|
||||
- return false;
|
||||
- }
|
||||
+ return true;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Boolean success) {
|
||||
@@ -205,11 +180,6 @@ public class InstanceIDBridge {
|
||||
@Override
|
||||
@SuppressWarnings("NoSynchronizedThisCheck") // Only used/accessible by native.
|
||||
protected Result doInBackground() {
|
||||
- synchronized (InstanceIDBridge.this) {
|
||||
- if (mInstanceID == null) {
|
||||
- mInstanceID = InstanceIDWithSubtype.getInstance(mSubtype);
|
||||
- }
|
||||
- }
|
||||
return doBackgroundWork();
|
||||
}
|
||||
@Override
|
||||
diff --git a/components/sync/android/BUILD.gn b/components/sync/android/BUILD.gn
|
||||
--- a/components/sync/android/BUILD.gn
|
||||
+++ b/components/sync/android/BUILD.gn
|
||||
@@ -11,7 +11,6 @@ android_library("sync_java") {
|
||||
"//components/signin/core/browser/android:java",
|
||||
"//net/android:net_java",
|
||||
"//third_party/android_deps:android_support_annotations_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/cacheinvalidation:cacheinvalidation_javalib",
|
||||
"//third_party/cacheinvalidation:cacheinvalidation_proto_java",
|
||||
"//third_party/jsr-305:jsr_305_javalib",
|
||||
diff --git a/third_party/cacheinvalidation/BUILD.gn b/third_party/cacheinvalidation/BUILD.gn
|
||||
--- a/third_party/cacheinvalidation/BUILD.gn
|
||||
+++ b/third_party/cacheinvalidation/BUILD.gn
|
||||
@@ -141,7 +141,6 @@ if (is_android) {
|
||||
"$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//third_party/android_protobuf:protobuf_nano_javalib",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
]
|
||||
|
||||
java_files = [
|
||||
@@ -207,13 +206,8 @@ if (is_android) {
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/WakeLockManager.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelConstants.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/CommonUtils.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmUpstreamSenderService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/proto/AndroidChannel.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/proto/AndroidListenerProtocol.java",
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package com.google.ipc.invalidation.external.client.contrib;
|
||||
|
||||
-import com.google.android.gcm.GCMBaseIntentService;
|
||||
-import com.google.android.gcm.GCMBroadcastReceiver;
|
||||
-import com.google.android.gcm.GCMRegistrar;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
import com.google.ipc.invalidation.ticl.android2.WakeLockManager;
|
||||
@@ -69,7 +66,7 @@ import android.content.pm.ServiceInfo;
|
||||
* there is nothing to do except log an error (which this class does).
|
||||
*
|
||||
*/
|
||||
-public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
+public class MultiplexingGcmListener {
|
||||
/* This class is public so that it can be instantiated by the Android runtime. */
|
||||
|
||||
/** Constants used in broadcast Intents. */
|
||||
@@ -106,18 +103,6 @@ public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
}
|
||||
|
||||
/**
|
||||
- * {@link GCMBroadcastReceiver} that forwards GCM intents to the {@code MultiplexingGcmListener}
|
||||
- * class.
|
||||
- */
|
||||
- public static class GCMReceiver extends GCMBroadcastReceiver {
|
||||
- /* This class is public so that it can be instantiated by the Android runtime. */
|
||||
- @Override
|
||||
- protected String getGCMIntentServiceClassName(Context context) {
|
||||
- return MultiplexingGcmListener.class.getName();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Convenience base class for client implementations. It provides base classes for a broadcast
|
||||
* receiver and an intent service that work together to handle events from the
|
||||
* {@code MultiplexingGcmListener} while holding a wake lock.
|
||||
@@ -260,85 +245,10 @@ public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
/** Logger. */
|
||||
private static final Logger logger = AndroidLogger.forTag("MplexGcmListener");
|
||||
|
||||
- // All onYYY methods work by constructing an appropriate Intent and broadcasting it.
|
||||
-
|
||||
- @Override
|
||||
- protected void onMessage(Context context, Intent intent) {
|
||||
- Intent newIntent = new Intent();
|
||||
- newIntent.putExtra(Intents.EXTRA_OP_MESSAGE, true);
|
||||
- newIntent.putExtras(intent);
|
||||
- rebroadcast(newIntent);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- protected void onRegistered(Context context, String registrationId) {
|
||||
- Intent intent = new Intent();
|
||||
- intent.putExtra(Intents.EXTRA_OP_REGISTERED, true);
|
||||
- intent.putExtra(Intents.EXTRA_DATA_REG_ID, registrationId);
|
||||
- rebroadcast(intent);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- protected void onUnregistered(Context context, String registrationId) {
|
||||
- Intent intent = new Intent();
|
||||
- intent.putExtra(Intents.EXTRA_OP_UNREGISTERED, true);
|
||||
- intent.putExtra(Intents.EXTRA_DATA_REG_ID, registrationId);
|
||||
- rebroadcast(intent);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- protected void onDeletedMessages(Context context, int total) {
|
||||
- Intent intent = new Intent();
|
||||
- intent.putExtra(Intents.EXTRA_OP_DELETED_MESSAGES, true);
|
||||
- intent.putExtra(Intents.EXTRA_DATA_NUM_DELETED_MSGS, total);
|
||||
- rebroadcast(intent);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- protected void onError(Context context, String errorId) {
|
||||
- // This is called for unrecoverable errors, so just log a warning.
|
||||
- logger.warning("GCM error: %s", errorId);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- protected String[] getSenderIds(Context context) {
|
||||
- return readSenderIdsFromManifestOrDie(this);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Broadcasts {@code intent} with the action set to {@link Intents#ACTION} and the package name
|
||||
- * set to the package name of this service.
|
||||
- */
|
||||
- private void rebroadcast(Intent intent) {
|
||||
- intent.setAction(Intents.ACTION);
|
||||
- intent.setPackage(getPackageName());
|
||||
- sendBroadcast(intent);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Registers with GCM if not already registered. Also verifies that the device supports GCM
|
||||
- * and that the manifest is correctly configured. Returns the existing registration id, if one
|
||||
- * exists, or the empty string if one does not.
|
||||
- *
|
||||
- * @throws UnsupportedOperationException if the device does not have all GCM dependencies
|
||||
- * @throws IllegalStateException if the manifest is not correctly configured
|
||||
- */
|
||||
- public static String initializeGcm(Context context) {
|
||||
- AndroidChannelPreferences.setGcmChannelType(context, GcmChannelType.DEFAULT);
|
||||
- GCMRegistrar.checkDevice(context);
|
||||
- GCMRegistrar.checkManifest(context);
|
||||
- final String regId = GCMRegistrar.getRegistrationId(context);
|
||||
- if (regId.isEmpty()) {
|
||||
- GCMRegistrar.register(context, readSenderIdsFromManifestOrDie(context));
|
||||
- }
|
||||
- return regId;
|
||||
- }
|
||||
-
|
||||
/**
|
||||
* Returns the GCM sender ids from {@link #GCM_SENDER_IDS_METADATA_KEY} or throws a
|
||||
* {@code RuntimeException} if they are not defined.
|
||||
*/
|
||||
-
|
||||
static String[] readSenderIdsFromManifestOrDie(Context context) {
|
||||
try {
|
||||
ServiceInfo serviceInfo = context.getPackageManager().getServiceInfo(
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
@@ -48,16 +48,12 @@ public class AndroidNetworkChannel implements TestableNetworkChannel {
|
||||
Intent intent = ProtocolIntents.newOutboundMessageIntent(outgoingMessage);
|
||||
|
||||
// Select the sender service to use for upstream message.
|
||||
- if (AndroidChannelPreferences.getGcmChannelType(context) == GcmChannelType.GCM_UPSTREAM){
|
||||
- String upstreamServiceClass = new AndroidTiclManifest(context).getGcmUpstreamServiceClass();
|
||||
- if (upstreamServiceClass == null || upstreamServiceClass.isEmpty()) {
|
||||
- logger.warning("GcmUpstreamSenderService class not found.");
|
||||
- return;
|
||||
- }
|
||||
- intent.setClassName(context, upstreamServiceClass);
|
||||
- } else {
|
||||
- intent.setClassName(context, AndroidMessageSenderService.class.getName());
|
||||
- }
|
||||
+ String upstreamServiceClass = new AndroidTiclManifest(context).getGcmUpstreamServiceClass();
|
||||
+ if (upstreamServiceClass == null || upstreamServiceClass.isEmpty()) {
|
||||
+ logger.warning("GcmUpstreamSenderService class not found.");
|
||||
+ return;
|
||||
+ }
|
||||
+ intent.setClassName(context, upstreamServiceClass);
|
||||
try {
|
||||
context.startService(intent);
|
||||
} catch (IllegalStateException exception) {
|
||||
@@ -77,6 +73,6 @@ public class AndroidNetworkChannel implements TestableNetworkChannel {
|
||||
|
||||
@Override
|
||||
public NetworkEndpointId getNetworkIdForTest() {
|
||||
- return AndroidMessageSenderService.getNetworkEndpointId(context, resources.getLogger());
|
||||
+ return null;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:05:17 +0200
|
||||
Subject: kill Location, fall back to system
|
||||
|
||||
---
|
||||
services/device/geolocation/BUILD.gn | 1 -
|
||||
.../chromium/device/geolocation/LocationProviderFactory.java | 10 ++--------
|
||||
2 files changed, 2 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
|
||||
--- a/services/device/geolocation/BUILD.gn
|
||||
+++ b/services/device/geolocation/BUILD.gn
|
||||
@@ -137,7 +137,6 @@ if (is_android) {
|
||||
"android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java",
|
||||
"android/java/src/org/chromium/device/geolocation/LocationProviderAndroid.java",
|
||||
"android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java",
|
||||
- "android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java",
|
||||
]
|
||||
|
||||
deps = [
|
||||
diff --git a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
|
||||
--- a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
|
||||
+++ b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
|
||||
@@ -26,19 +26,13 @@ public class LocationProviderFactory {
|
||||
|
||||
@CalledByNative
|
||||
public static void useGmsCoreLocationProvider() {
|
||||
- sUseGmsCoreLocationProvider = true;
|
||||
+ sUseGmsCoreLocationProvider = false;
|
||||
}
|
||||
|
||||
public static LocationProvider create() {
|
||||
if (sProviderImpl != null) return sProviderImpl;
|
||||
|
||||
- if (sUseGmsCoreLocationProvider
|
||||
- && LocationProviderGmsCore.isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext())) {
|
||||
- sProviderImpl = new LocationProviderGmsCore(ContextUtils.getApplicationContext());
|
||||
- } else {
|
||||
- sProviderImpl = new LocationProviderAndroid();
|
||||
- }
|
||||
+ sProviderImpl = new LocationProviderAndroid();
|
||||
return sProviderImpl;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:16:07 +0200
|
||||
Subject: kill TOS and metrics opt-out
|
||||
|
||||
---
|
||||
chrome/android/java/res/layout/fre_tosanduma.xml | 2 +-
|
||||
chrome/android/java/res/values/dimens.xml | 1 -
|
||||
.../src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java | 2 +-
|
||||
3 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
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
|
||||
@@ -62,7 +62,7 @@
|
||||
android:layout_marginBottom="@dimen/fre_vertical_spacing"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1.4"
|
||||
- android:textAppearance="@style/TextAppearance.BlackBodyDefault" />
|
||||
+ android:textAppearance="@style/TextAppearance.BlackBodyDefault" android:visibility="gone" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/send_report_checkbox"
|
||||
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml
|
||||
--- a/chrome/android/java/res/values/dimens.xml
|
||||
+++ b/chrome/android/java/res/values/dimens.xml
|
||||
@@ -192,7 +192,6 @@
|
||||
<dimen name="fre_button_padding">12dp</dimen>
|
||||
<dimen name="fre_margin">24dp</dimen>
|
||||
<dimen name="fre_image_height">120dp</dimen>
|
||||
- <dimen name="fre_tos_checkbox_padding">12dp</dimen>
|
||||
|
||||
<!-- Account Signin dimensions -->
|
||||
<!-- The Account Signin page appears in the First Run Experience (amongst other places), so uses
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
@@ -38,7 +38,7 @@ public abstract class FirstRunActivityBase extends AsyncInitializationActivity {
|
||||
static final String SHOW_SEARCH_ENGINE_PAGE = "ShowSearchEnginePage";
|
||||
static final String SHOW_SIGNIN_PAGE = "ShowSignIn";
|
||||
|
||||
- public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = true;
|
||||
+ public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = false;
|
||||
|
||||
private boolean mNativeInitialized;
|
||||
|
||||
--
|
||||
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