Compare commits
291
Commits
ci
..
78.0.3904.105
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f62bd97771 | ||
|
|
11ec80bed4 | ||
|
|
b52188adfa | ||
|
|
290ac541a5 | ||
|
|
a237a5ce1b | ||
|
|
764cf585dd | ||
|
|
bbaf497fc7 | ||
|
|
2a03789061 | ||
|
|
c2ab0f4667 | ||
|
|
b692f721a3 | ||
|
|
28e950d9be | ||
|
|
6a9e562dde | ||
|
|
158d782db4 | ||
|
|
8d494540e2 | ||
|
|
74cb09ea83 | ||
|
|
3f19511574 | ||
|
|
e866631846 | ||
|
|
00c28793f4 | ||
|
|
932d5c680f | ||
|
|
aa408e6d21 | ||
|
|
5330cb879f | ||
|
|
d86fcd1c5f | ||
|
|
ec98e6e11c | ||
|
|
528c999cbb | ||
|
|
65c5722a09 | ||
|
|
35f447cf0c | ||
|
|
a5b818c8ab | ||
|
|
21ef4d1c37 | ||
|
|
b05d50bcad | ||
|
|
07985cf503 | ||
|
|
323864669b | ||
|
|
50b0961a8d | ||
|
|
8eb36db315 | ||
|
|
a2efd643de | ||
|
|
c611bc0855 | ||
|
|
028c1567bd | ||
|
|
bd0b93cb3e | ||
|
|
84d6403e06 | ||
|
|
73b524f627 | ||
|
|
232dd7f970 | ||
|
|
ca366d39b9 | ||
|
|
5cf852d97d | ||
|
|
f2977bac96 | ||
|
|
a162d5820e | ||
|
|
95c717eb59 | ||
|
|
873c245f6e | ||
|
|
56fa92cbff | ||
|
|
acc8cbb1e9 | ||
|
|
c4bce0f449 | ||
|
|
cf3313d156 | ||
|
|
a6ffa85a0e | ||
|
|
e940ac0998 | ||
|
|
d1069ed023 | ||
|
|
3a9775c5c0 | ||
|
|
d1c1ce61ff | ||
|
|
525243125d | ||
|
|
c15c433631 | ||
|
|
e7e7afdc2d | ||
|
|
a600d36a56 | ||
|
|
e012e0aa9f | ||
|
|
a320e83fa1 | ||
|
|
5d3367398f | ||
|
|
a34b285160 | ||
|
|
a672f8d057 | ||
|
|
503e4b8f27 | ||
|
|
b615a77f51 | ||
|
|
7f6cc79541 | ||
|
|
2951298a6b | ||
|
|
d5b09217ef | ||
|
|
28d274b712 | ||
|
|
c800e61cc3 | ||
|
|
d66be65985 | ||
|
|
30b0e61732 | ||
|
|
a7c33014b6 | ||
|
|
abfa65cd17 | ||
|
|
fedd7572d7 | ||
|
|
d5dede3dfa | ||
|
|
a75b452332 | ||
|
|
d22dbd7b38 | ||
|
|
79eae0ab09 | ||
|
|
532c9c5c8b | ||
|
|
f5278822bb | ||
|
|
a8d215db86 | ||
|
|
2e921bffd8 | ||
|
|
fb225cf638 | ||
|
|
9c88a30ac3 | ||
|
|
0c9047e26d | ||
|
|
0d37a542ff | ||
|
|
34b616ba9f | ||
|
|
2e6d2a5c75 | ||
|
|
f963a09239 | ||
|
|
fcbca7eb8c | ||
|
|
65c50e3ec9 | ||
|
|
6cf627f9d4 | ||
|
|
0f2a48662d | ||
|
|
ac44ac738f | ||
|
|
02fad5a01f | ||
|
|
b1c0e45b66 | ||
|
|
1397b5e86a | ||
|
|
171c2f224a | ||
|
|
628ddf9b60 | ||
|
|
8c3fcd08de | ||
|
|
375ac9bf8b | ||
|
|
e1b9f9d68a | ||
|
|
7f7fc80c7a | ||
|
|
aa96e7ce43 | ||
|
|
5c9d69ebcc | ||
|
|
7469dbed21 | ||
|
|
bc1f0b79f5 | ||
|
|
4c2225259f | ||
|
|
2ba0013cc6 | ||
|
|
b92ce6a3a2 | ||
|
|
de80f36496 | ||
|
|
ae8dce366b | ||
|
|
750cafb50c | ||
|
|
5cd90e8326 | ||
|
|
664cd20825 | ||
|
|
aeb31bb4c5 | ||
|
|
87eb08c088 | ||
|
|
e64cbbd005 | ||
|
|
4829eef707 | ||
|
|
32978e4658 | ||
|
|
f109246e47 | ||
|
|
b1bc96bbd9 | ||
|
|
e3176b1868 | ||
|
|
22dae5bff8 | ||
|
|
f21bb8a1d4 | ||
|
|
3624b67e98 | ||
|
|
eb4cbebe2a | ||
|
|
3de200030f | ||
|
|
b35c5b2f0d | ||
|
|
3cf1a58964 | ||
|
|
ef1fa37452 | ||
|
|
7cb31f2c7a | ||
|
|
252be1a850 | ||
|
|
4cef551b01 | ||
|
|
dbc43b5c36 | ||
|
|
92aba62fdf | ||
|
|
d8db805929 | ||
|
|
9ea0219fce | ||
|
|
776d4f859e | ||
|
|
7b7a1a4c75 | ||
|
|
ac218f929b | ||
|
|
efe90584df | ||
|
|
1917072116 | ||
|
|
980053e78f | ||
|
|
ffa2849e2f | ||
|
|
0e797ac643 | ||
|
|
fc14caf48a | ||
|
|
494b396f9e | ||
|
|
f007778846 | ||
|
|
b37f2f7b85 | ||
|
|
10661f0b36 | ||
|
|
ff372ffe53 | ||
|
|
c33f289a21 | ||
|
|
d9a4d2dc88 | ||
|
|
6e86d3db21 | ||
|
|
b11d180a37 | ||
|
|
032d2ef9f2 | ||
|
|
1951b38c64 | ||
|
|
41c5c0f0cf | ||
|
|
d0bab4a8da | ||
|
|
ef0cca39ce | ||
|
|
d94f36a0f7 | ||
|
|
3b1875efed | ||
|
|
acba336f2e | ||
|
|
61b6f9ee1d | ||
|
|
210a14d7ed | ||
|
|
91cc88eb37 | ||
|
|
4fc10e560b | ||
|
|
01ecc5d52f | ||
|
|
7edcab0232 | ||
|
|
b4ada5bd99 | ||
|
|
cfa7aca62a | ||
|
|
9eca1ff0b3 | ||
|
|
aac51e0a5a | ||
|
|
ea53ed1889 | ||
|
|
780bb60137 | ||
|
|
0fd859a0a6 | ||
|
|
03645239a9 | ||
|
|
ec5be6c048 | ||
|
|
67651fbd75 | ||
|
|
6b758bfe0c | ||
|
|
49ae827092 | ||
|
|
01ad976b53 | ||
|
|
38a672a1ca | ||
|
|
a723e0e77d | ||
|
|
3abb1ad2a3 | ||
|
|
d7e8ac9d86 | ||
|
|
284c419d01 | ||
|
|
2dca759091 | ||
|
|
11cebfadc5 | ||
|
|
e4e56ed69c | ||
|
|
7dcc27cb5e | ||
|
|
8b494263c3 | ||
|
|
4029e8843d | ||
|
|
85a9737c16 | ||
|
|
247247a8ae | ||
|
|
4bfb168982 | ||
|
|
1652ef39b1 | ||
|
|
190ee08724 | ||
|
|
367a2521a0 | ||
|
|
6b1cbc612a | ||
|
|
d0f89298b8 | ||
|
|
9adbcaf262 | ||
|
|
ef067cd35d | ||
|
|
e08ef39d4e | ||
|
|
33f1df4d26 | ||
|
|
29e6c35657 | ||
|
|
148f920a06 | ||
|
|
c5e38e8077 | ||
|
|
94a0637fb1 | ||
|
|
db00f3e4f4 | ||
|
|
e664528479 | ||
|
|
83a16596e6 | ||
|
|
7c6a4374f5 | ||
|
|
5b2034ff45 | ||
|
|
6807e7b388 | ||
|
|
71b5dc1b0b | ||
|
|
2bda9e45f6 | ||
|
|
530626fd21 | ||
|
|
4e8b70cb64 | ||
|
|
f4b6592dbc | ||
|
|
0d6534d9eb | ||
|
|
b869bb5b7b | ||
|
|
a6603ca827 | ||
|
|
881b4199f4 | ||
|
|
8f418f10d5 | ||
|
|
7a436cad38 | ||
|
|
ba521c5412 | ||
|
|
23623ffc1f | ||
|
|
ca0a121f19 | ||
|
|
65554f30c6 | ||
|
|
4f1fa500e3 | ||
|
|
00ad417ff8 | ||
|
|
af04dfea67 | ||
|
|
b26461b55f | ||
|
|
39f5761729 | ||
|
|
10cc8c8310 | ||
|
|
4c844ba92d | ||
|
|
d855bc2f8f | ||
|
|
bffc981dca | ||
|
|
fc970af553 | ||
|
|
fb79f25139 | ||
|
|
3f68ef470d | ||
|
|
ce004bc49a | ||
|
|
a99533f633 | ||
|
|
a300522aed | ||
|
|
1da96f0fca | ||
|
|
11994a352c | ||
|
|
4e39f7c900 | ||
|
|
eca32f09e9 | ||
|
|
a452a9356e | ||
|
|
0645ccf03a | ||
|
|
b81a196c71 | ||
|
|
8589334b98 | ||
|
|
df91ed0407 | ||
|
|
250ae9ffad | ||
|
|
cd354c6786 | ||
|
|
6d337a4945 | ||
|
|
2f1e3c26e1 | ||
|
|
be7e413b7a | ||
|
|
83e140c4f6 | ||
|
|
f8d7135ac8 | ||
|
|
4676d9b2ec | ||
|
|
256fe0ec37 | ||
|
|
415a0ea9e5 | ||
|
|
f5e5472dd4 | ||
|
|
b1b989dac9 | ||
|
|
1d039eb656 | ||
|
|
905432882c | ||
|
|
61ee5cb055 | ||
|
|
33f6df6958 | ||
|
|
82e9d2d28e | ||
|
|
2c679f5ff7 | ||
|
|
36827a2b1e | ||
|
|
d1ca11e008 | ||
|
|
18377261b0 | ||
|
|
a772e67318 | ||
|
|
02dfbb43dc | ||
|
|
e9a7ef7933 | ||
|
|
b8d531f546 | ||
|
|
5268ec2716 | ||
|
|
2a7bde2570 | ||
|
|
c94b463e4f | ||
|
|
a5367f7345 | ||
|
|
90c88fdce4 | ||
|
|
169509d3a9 | ||
|
|
1345e65a98 | ||
|
|
1a56155bee | ||
|
|
d425b41589 |
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
liberapay: csagan5
|
||||
custom: https://www.bromite.org/#donate
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a Bromite bug report
|
||||
|
||||
---
|
||||
|
||||
### Bromite version
|
||||
|
||||
Version: `76.0...`
|
||||
Arch: `arm` or `arm64` or `x86`
|
||||
Android version: (example: `9.0`)
|
||||
Device model: (example: `SM-G960UZKABST`)
|
||||
|
||||
### Is this bug about the SystemWebView?
|
||||
Yes/No
|
||||
|
||||
No support for SystemWebView installations is provided.
|
||||
|
||||
### Is the bug reproducible with latest version?
|
||||
|
||||
Do not report bugs which are not reproducible with latest version
|
||||
|
||||
### Can the bug be reproduced with corresponding Chromium version?
|
||||
|
||||
Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
|
||||
If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
|
||||
|
||||
### Is the bug a crash?
|
||||
|
||||
If yes then individuate and post the logcat dump (remove privacy sensitive information, if any), otherwise remove this section.
|
||||
|
||||
### Describe the bug
|
||||
|
||||
Write here a clear and concise description of the bug.
|
||||
|
||||
### Steps to reproduce the bug
|
||||
|
||||
Steps to reproduce the 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. Otherwise remove this section.
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
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?**
|
||||
If yes then provide URL and license information.
|
||||
|
||||
**Describe the solution you would like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
Do not ask "I would like feature X which is available in browser Y"; such issues are closed immediately.
|
||||
|
||||
**Describe alternatives you have considered**
|
||||
A clear and concise description of any alternative solutions or features you have considered.
|
||||
@@ -1,141 +0,0 @@
|
||||
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
|
||||
@@ -1,7 +0,0 @@
|
||||
################################################################################
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
*.sqlite
|
||||
/.vs/ProjectSettings.json
|
||||
/.vs
|
||||
+536
@@ -0,0 +1,536 @@
|
||||
# 78.0.3904.105
|
||||
* add flag to disable WebGL (fixes https://github.com/bromite/bromite/issues/411)
|
||||
* more selective AMP sanitization (fixes https://github.com/bromite/bromite/issues/410)
|
||||
* build optimizations to disable debug information
|
||||
|
||||
# 78.0.3904.93
|
||||
* introduce flags to disable browser fingerprinting capabilities (fixes https://github.com/bromite/bromite/issues/402)
|
||||
* major enhancements to AMP sanitization for news/images
|
||||
* remove duplicate network predictions privacy setting
|
||||
* disable some signed exchanges features
|
||||
* ungoogled-chromium-android: patches to block all GCM/GMS/PlayServices integrations
|
||||
* ungoogled-chromium: block all connection requests to substituted domains
|
||||
* disable GVR services build flag
|
||||
* disable HEAD requests for single words typed and clicked in Omnibar
|
||||
* increase number of autocomplete matches from 5 to 10
|
||||
* replace DoH probe domain with RIPE domain
|
||||
* merged fixes for adblock/javascript menu text (https://github.com/bromite/bromite/pull/398)
|
||||
* updated User-agent phone model and version
|
||||
|
||||
# 78.0.3904.72
|
||||
* updated User-agent phone model and version
|
||||
* fix network predictions bug (fixes https://github.com/bromite/bromite/issues/387)
|
||||
* fix crash in settings (fixes https://github.com/bromite/bromite/issues/388)
|
||||
|
||||
# 78.0.3904.63
|
||||
* replace Beta DoH service URL for Google (https://developers.google.com/speed/public-dns/docs/doh/migration)
|
||||
* disable AImageReaderMediaPlayer until upstream bug is fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=977583)
|
||||
* disabled face detection provider
|
||||
* removed non-working SystemWebView adblock patch (not working since v77)
|
||||
* bring back some privacy options which upstream moved to Sync settings (fixes https://github.com/bromite/bromite/issues/383)
|
||||
|
||||
# 77.0.3865.104
|
||||
* revert upstream commit for search privacy options and related translations removal (fixes https://github.com/bromite/bromite/issues/375)
|
||||
* remove unused patch for enabling subresource filter on all sites
|
||||
|
||||
# 77.0.3865.95
|
||||
|
||||
# 77.0.3865.81
|
||||
* use native subresource filtering instead of Bromite engine
|
||||
* introduce Bromite AdBlockUpdate service
|
||||
* keep using Bromite engine for SystemWebView
|
||||
* enable subresource filter for all sites
|
||||
* disable subresource filter popup
|
||||
* enable IPv6 probing by default
|
||||
* drop DnsTransaction default security level patch
|
||||
* drop patch to visualize all type of extensions
|
||||
* drop patches for Network Service
|
||||
* enable CFI for all architectures except x86
|
||||
|
||||
# 76.0.3809.129
|
||||
* disable CFI to fix x86 crashes (fixes https://github.com/bromite/bromite/issues/357)
|
||||
|
||||
# 76.0.3809.115
|
||||
* disable search-ready omnibox by default
|
||||
* disable unified consent
|
||||
|
||||
# 76.0.3809.100
|
||||
* use default feature flags for autofill (fixes https://github.com/bromite/bromite/issues/348)
|
||||
|
||||
# 76.0.3809.91
|
||||
|
||||
# 76.0.3809.85
|
||||
* add flag to toggle Network Service
|
||||
* disable Network Service by default
|
||||
* do not record UMA for network errors
|
||||
* use fixed User Agent and Android OS version
|
||||
* dropped patch for history requirement of user gesture
|
||||
|
||||
# 75.0.3770.139
|
||||
* disable media router and remoting by default (fixes https://github.com/bromite/bromite/issues/281)
|
||||
* enable CFI in GN build flags
|
||||
|
||||
# 75.0.3770.132
|
||||
|
||||
# 75.0.3770.109
|
||||
* disable payment support by default
|
||||
* disable background sync by default
|
||||
* better patch from GrapheneOS/Vanadium for disabling sensors access (fixes https://github.com/bromite/bromite/issues/319)
|
||||
* use new patch for content settings sensors allow/block (fixes https://github.com/bromite/bromite/issues/319)
|
||||
* fix impossible values in Battery Status API (fixes https://github.com/bromite/bromite/issues/322)
|
||||
|
||||
# 75.0.3770.86
|
||||
|
||||
# 75.0.3770.82
|
||||
|
||||
# 75.0.3770.70
|
||||
* enable changing default downloads storage location by default
|
||||
* enable download rename option by default
|
||||
* disable offline pages in the downloads home to be opened in CCT by default
|
||||
* increase minimum SDK from 17 to 19 (fixes https://github.com/bromite/bromite/issues/310)
|
||||
* prefs: disable SigninAllowed by default
|
||||
* prefs: always prompt for download directory by default
|
||||
* build: remove calling untrusted hooks
|
||||
|
||||
# 75.0.3770.53
|
||||
* fix crash when downloading or from browser-initiated requests (fixes https://github.com/bromite/bromite/issues/309)
|
||||
|
||||
# 75.0.3770.50
|
||||
* disable dynamic module loading
|
||||
* more fixes to allow building for SDK 17
|
||||
|
||||
# 74.0.3729.162
|
||||
* remove recent tabs signin
|
||||
|
||||
# 74.0.3729.154
|
||||
|
||||
# 74.0.3729.141
|
||||
|
||||
# 74.0.3729.122
|
||||
* remove more unnecessary permissions
|
||||
|
||||
# 74.0.3729.106
|
||||
* remove account/sync menu entries (fixes https://github.com/bromite/bromite/issues/285)
|
||||
* fix failed debug builds
|
||||
|
||||
# 74.0.3729.86
|
||||
* enable dark mode settings entry by default
|
||||
* fix permission request for Play services on reboot (fixes https://github.com/bromite/bromite/issues/281)
|
||||
|
||||
# 74.0.3729.80
|
||||
* increase minimum SDK version to 17 (Jelly Bean 4.2)
|
||||
* dropped obsolete patch for hyperlink auditing disable
|
||||
|
||||
# 73.0.3683.107
|
||||
* dropped patch to disable smooth scrolling
|
||||
* fixed custom tab intents issue (fixes https://github.com/bromite/bromite/issues/279)
|
||||
|
||||
# 73.0.3683.105
|
||||
* removed Fanboy's Annoyance List and Peter Lowe's adservers list from filters
|
||||
|
||||
# 73.0.3683.97
|
||||
* dropped redundant patch to hide NTP tiles (use home page + about:blank)
|
||||
|
||||
# 73.0.3683.88
|
||||
* add option to use home page as NTP
|
||||
|
||||
# 73.0.3683.82
|
||||
* remove force home page button flag
|
||||
* enable site per process isolation for devices with memory > 1GB
|
||||
* use 64-bit processes for SystemWebView
|
||||
* disable local field trials seed (redundant)
|
||||
* fix patch for classic new tab page (redundant)
|
||||
|
||||
# 73.0.3683.79
|
||||
* add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
|
||||
* DoH: include upstream patch for DNS secure mode
|
||||
* DoH: enable DNS secure mode by default
|
||||
|
||||
# 73.0.3683.70
|
||||
|
||||
# 73.0.3683.61
|
||||
* drop patches with functionality now available from upstream (DuckDuckGo and Qwant search engines, TLS 1.3 final)
|
||||
* add only DuckDuckGo Lite search engine
|
||||
* provide image URL for Qwant
|
||||
* disable safe browsing subresource filter by default
|
||||
* fix PAC URL support in proxy configuration
|
||||
|
||||
# 72.0.3626.120
|
||||
* add support for resource type in adblock engine (fixes https://github.com/bromite/bromite/issues/115)
|
||||
* adblock engine speed optimizations
|
||||
* use adblock engine also in SystemWebView
|
||||
* add back uBlock Origin and EasyList filters
|
||||
* added Fanboy's Annoyance List
|
||||
|
||||
# 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
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,172 @@
|
||||
# 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.4 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](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2): [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
|
||||
|
||||
<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 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
|
||||
|
||||
* native 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 [GrapheneOS](https://github.com/GrapheneOS) 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 19 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
|
||||
For every Bromite build you can always find a matching [vanilla Chromium](https://www.bromite.org/chromium) build which is used for example to verify which issues are specific to Bromite or not.
|
||||
|
||||
All official releases are also available through the [official third-party F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
## Integrity and authenticity
|
||||
|
||||
You can verify the integrity of a downloaded APK file from this project with any `sha256sum`-compatible tool by downloading the corresponding `brm_X.Y.Z.sha256.txt` or `chr_X.Y.Z.sha256.txt` file, where X.Y.Z is the release version number. Example:
|
||||
```
|
||||
$ sha256sum --check brm_68.0.3440.54.sha256.txt
|
||||
arm64_SystemWebView.apk: OK
|
||||
arm64_ChromePublic.apk: OK
|
||||
arm64_ChromeModernPublic.apk: OK
|
||||
```
|
||||
|
||||
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 `bromite_patches_list.txt` file (you can use `git am`).
|
||||
|
||||
## How to build the filters
|
||||
|
||||
See upstream documentation: https://github.com/chromium/chromium/blob/master/components/subresource_filter/FILTER_LIST_GENERATION.md
|
||||
|
||||
Bromite uses an unindexed filter file, which is periodically published at https://github.com/bromite/filters
|
||||
|
||||
# Credits
|
||||
|
||||
* [Chromium project](https://www.chromium.org/Home) and developers
|
||||
* [Iridium project](https://github.com/iridium-browser) for some patches
|
||||
* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches
|
||||
* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches
|
||||
* [GrapheneOS](https://github.com/GrapheneOS) for some security patches
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/browser-android-tabs) for some patches
|
||||
* nochromo for the original adblock patch, currently used only in the SystemWebView
|
||||
* [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
|
||||
@@ -0,0 +1,37 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
dcheck_always_on=false
|
||||
debuggable_apks=false
|
||||
disable_android_lint=true
|
||||
enable_ac3_eac3_audio_demuxing=true enable_hevc_demuxing=true enable_iterator_debugging=false
|
||||
enable_av1_decoder=true
|
||||
enable_gvr_services=false
|
||||
enable_hangout_services_extension=false
|
||||
enable_mdns=false
|
||||
enable_mse_mpeg2ts_stream_parser=true ffmpeg_branding="Chrome" proprietary_codecs=true
|
||||
enable_nacl=false
|
||||
enable_nacl_nonsfi=false
|
||||
enable_remoting=false
|
||||
enable_reporting=false
|
||||
enable_resource_whitelist_generation=false
|
||||
enable_vr=false
|
||||
exclude_unwind_tables = true
|
||||
fieldtrial_testing_like_official_build=true
|
||||
is_cfi=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
remove_webcore_debug_symbols=true
|
||||
rtc_build_examples=false
|
||||
safe_browsing_mode=0
|
||||
strip_absolute_paths_from_debug_symbols=true
|
||||
strip_debug_info=true
|
||||
symbol_level=0
|
||||
symbol_level=1
|
||||
target_os="android"
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_jumbo_build=false
|
||||
use_official_google_api_keys=false
|
||||
use_openh264=true chrome_pgo_phase=0 full_wpo_on_official=true
|
||||
use_sysroot=false
|
||||
@@ -0,0 +1,143 @@
|
||||
Disable-third-party-cookies-by-default.patch
|
||||
Revert-Remove-pre-unified-consent-code-in-sync-and-privacy-directory.patch
|
||||
Revert-Remove-UnifiedConsent-from-ChromeFeatureList.patch
|
||||
Restore-classic-new-tab-page.patch
|
||||
Always-use-new-tab-page-for-default-home-page.patch
|
||||
Always-allow-partner-customisation.patch
|
||||
Always-show-home-page-settings.patch
|
||||
battery_status_service-disable-more-privacy-nightmares.patch
|
||||
Battery-API-return-nothing.patch
|
||||
google-cloud-messaging-disable-experiment-status-check.patch
|
||||
updater-disable-updater-pings.patch
|
||||
prefs-only-keep-cookies-until-exit.patch
|
||||
Remove-EV-certificates.patch
|
||||
promo-disable-Google-promotion-fetching.patch
|
||||
Disable-omission-of-URL-elements-in-Omnibox.patch
|
||||
Modify-default-preferences.patch
|
||||
Disable-contextual-search-by-default.patch
|
||||
Do-not-store-passwords-by-default.patch
|
||||
Disable-NTP-remote-suggestions-by-default.patch
|
||||
Disable-references-to-fonts.googleapis.com.patch
|
||||
Disable-WebRTC-by-default.patch
|
||||
Never-send-any-crash-upload-data.patch
|
||||
Hide-send-reports-checkbox.patch
|
||||
Never-fetch-popular-sites.patch
|
||||
ungoogled-chromium-Disable-webRTC-log-uploader.patch
|
||||
ungoogled-chromium-Disable-untraceable-URLs.patch
|
||||
ungoogled-chromium-Disable-translate-integration.patch
|
||||
ungoogled-chromium-Disable-profile-avatar-downloading.patch
|
||||
ungoogled-chromium-Disable-intranet-redirect-detector.patch
|
||||
ungoogled-chromium-Disable-Google-host-detection.patch
|
||||
ungoogled-chromium-Disable-GCM.patch
|
||||
ungoogled-chromium-Disable-Gaia.patch
|
||||
ungoogled-chromium-Disable-domain-reliability.patch
|
||||
ungoogled-chromium-Disable-Network-Time-Tracker.patch
|
||||
ungoogled-chromium-Always-use-local-DevTools-files-instead-of-remote-files-from-Google.patch
|
||||
safe_browsing-disable-incident-reporting.patch
|
||||
safe_browsing-disable-reporting-of-safebrowsing-override.patch
|
||||
safe_browsing-disable-cookie-transmission.patch
|
||||
Disable-safe-browsing.patch
|
||||
Skip-the-first-run-and-metrics.patch
|
||||
Disable-all-promo-dialogs.patch
|
||||
Disable-sync-services-menu-entry.patch
|
||||
Remove-signin-and-data-saver-integrations.patch
|
||||
Remove-background-sync-and-translate-menu-options.patch
|
||||
Hide-passwords-manager-link.patch
|
||||
Disable-Omaha-update-checks.patch
|
||||
Disable-update-scheduler.patch
|
||||
Add-StartPage-search-engine.patch
|
||||
Add-English-only-search-engine.patch
|
||||
Add-DuckDuckGo-Lite-search-engine.patch
|
||||
Add-Qwant-search-engine.patch
|
||||
Fix-crash-when-accessing-page-info-site-settings.patch
|
||||
openH264-enable-ARM-ARM64-optimizations.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
build-remove-calling-untrusted-hooks.patch
|
||||
AV1-codec-support.patch
|
||||
Inject-scripts-for-AMP-tracking-ads-and-video-functionality.patch
|
||||
Allow-playing-audio-in-background.patch
|
||||
Add-flag-to-control-video-playback-resume-feature.patch
|
||||
Open-YouTube-links-in-Bromite.patch
|
||||
Add-exit-menu-item.patch
|
||||
Remove-help-menu-item.patch
|
||||
Add-menu-option-to-toggle-global-Javascript-preference.patch
|
||||
Add-menu-option-to-toggle-ad-blocker.patch
|
||||
User-Agent-anonymize.patch
|
||||
AudioBuffer-AnalyserNode-fingerprinting-mitigations-via-IDL.patch
|
||||
Multiple-fingerprinting-mitigations-for-canvas-text-and-client-rectangles.patch
|
||||
Add-flags-to-disable-device-motion-and-orientation-APIs.patch
|
||||
Punt-the-Widevine-version-string.patch
|
||||
Disable-metrics-on-all-I-O-threads.patch
|
||||
Add-a-flag-for-DNS-over-HTTPS.patch
|
||||
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
|
||||
Add-flag-to-configure-maximum-connections-per-host.patch
|
||||
Add-site-settings-option-for-session-only-cookies.patch
|
||||
Add-bookmark-import-export-actions.patch
|
||||
Disable-promos-displayed-in-bookmarks-manager.patch
|
||||
Add-an-always-incognito-mode.patch
|
||||
Add-custom-tab-intents-privacy-option.patch
|
||||
Add-option-to-not-persist-tabs-across-sessions.patch
|
||||
Disable-fetching-of-all-field-trials.patch
|
||||
Disable-seed-based-field-trials.patch
|
||||
Disable-plugins-enumeration.patch
|
||||
net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
|
||||
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
|
||||
profile-resetter-do-not-tick-send-settings-by-default.patch
|
||||
browser-ui-disable-warning-about-missing-API-keys.patch
|
||||
autofill-disable-autofill-download-manager.patch
|
||||
first_run-deactivate-autoupdate-globally.patch
|
||||
translate-disable-fetching-of-translate-languages-from-server.patch
|
||||
kill-TOS-and-metrics-opt-out.patch
|
||||
kill-Translate.patch
|
||||
kill-Vision.patch
|
||||
kill-Location-fall-back-to-system.patch
|
||||
kill-Auth.patch
|
||||
Remove-dependency-on-com.google.android.gms.auth.patch
|
||||
kill-GCM.patch
|
||||
Remove-dependency-on-com.google.android.gcm.patch
|
||||
Remove-dependency-on-com.google.android.gms.gcm.patch
|
||||
Remove-dependency-on-com.google.android.play.patch
|
||||
Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
|
||||
Remove-dependency-on-com.google.android.gms.flags-com.google.android.gms.location.places-com.google.android.gms.stats.patch
|
||||
Remove-dependency-on-com.google.android.gms.fido-com.google.android.gms.iid-com.google.android.gms.instantapps-com.google.android.gms.location.patch
|
||||
Remove-dependency-on-com.google.android.gms.cast.patch
|
||||
Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
|
||||
Remove-play-dependency-for-module-installer.patch
|
||||
Remove-SMS-integration.patch
|
||||
Allow-website-sign-in-without-account-sign-in.patch
|
||||
Offer-builtin-autocomplete-for-chrome-flags.patch
|
||||
Do-not-grant-notifications-to-default-search-engine.patch
|
||||
Add-flag-to-disable-IPv6-probes.patch
|
||||
Add-a-proxy-configuration-page.patch
|
||||
Do-not-ignore-download-location-prompt-setting.patch
|
||||
Disable-previews-by-default.patch
|
||||
Use-4-tile-rows-never-show-logo.patch
|
||||
Disable-metrics-collection-for-NTP-tiles.patch
|
||||
Enable-site-per-process-isolation-for-devices-with-enough-memory.patch
|
||||
Use-64-bit-WebView-processes.patch
|
||||
Add-option-to-use-home-page-as-NTP.patch
|
||||
Enable-night-mode-menu-entry-by-default.patch
|
||||
Disable-dynamic-module-loading.patch
|
||||
prefs-disable-signinallowed-by-default.patch
|
||||
prefs-always-prompt-for-download-directory-by-default.patch
|
||||
Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
|
||||
Enable-changing-default-downloads-storage-location-by-default.patch
|
||||
Enable-download-rename-option-by-default.patch
|
||||
disable-payment-support-by-default.patch
|
||||
disable-background-sync-by-default.patch
|
||||
disable-sensors-access-site-setting-by-default.patch
|
||||
Disable-media-router-and-remoting-by-default.patch
|
||||
Do-not-record-UMA-for-network-errors.patch
|
||||
Disable-unified-consent-on-Android.patch
|
||||
Revert-Cleanup-Search-Ready-Omnibox-flag-since-it-has-launched.patch
|
||||
Disable-search-ready-omnibox-by-default.patch
|
||||
disable-AdsBlockedInfoBar.patch
|
||||
Bromite-AdBlockUpdaterService.patch
|
||||
Revert-Merge-to-M78-Enable-AImageReader-by-default.patch
|
||||
Replace-DoH-probe-domain-with-RIPE-domain.patch
|
||||
Increase-number-of-autocomplete-matches-from-5-to-10.patch
|
||||
Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
|
||||
Block-all-connection-requests-with-qjz9zk-in-the-domain-name-or-with-a-trk-scheme.patch
|
||||
Disable-some-signed-exchange-features.patch
|
||||
Add-flag-to-disable-WebGL.patch
|
||||
@@ -0,0 +1,7 @@
|
||||
Revert-Remove-pre-unified-consent-code-in-sync-and-privacy-directory.patch
|
||||
Revert-Remove-UnifiedConsent-from-ChromeFeatureList.patch
|
||||
AV1-codec-support.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
Disable-safe-browsing.patch
|
||||
Disable-sync-services-menu-entry.patch
|
||||
@@ -0,0 +1,234 @@
|
||||
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
|
||||
@@ -564,9 +564,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_ndk:cpu_features" ]
|
||||
diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
|
||||
--- a/third_party/libaom/libaom_srcs.gni
|
||||
+++ b/third_party/libaom/libaom_srcs.gni
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,625 @@
|
||||
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
|
||||
@@ -91,6 +91,16 @@
|
||||
"id": 68
|
||||
},
|
||||
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
"duckduckgo": {
|
||||
"name": "DuckDuckGo",
|
||||
"keyword": "duckduckgo.com",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -65,6 +65,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_360,
|
||||
SEARCH_ENGINE_COCCOC,
|
||||
SEARCH_ENGINE_DUCKDUCKGO,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_PARSIJOO,
|
||||
SEARCH_ENGINE_QWANT,
|
||||
SEARCH_ENGINE_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
@@ -0,0 +1,258 @@
|
||||
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 | 10 +++++++++-
|
||||
chrome/browser/net/system_network_context_manager.cc | 18 +++++++++++-------
|
||||
chrome/common/chrome_features.cc | 9 ---------
|
||||
chrome/common/chrome_features.h | 2 --
|
||||
.../common/network_features.cc | 6 ++++++
|
||||
.../common/network_features.h | 6 ++++++
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
net/base/load_flags_list.h | 6 ++++++
|
||||
net/dns/dns_transaction.cc | 4 ++--
|
||||
net/url_request/url_request_http_job.cc | 16 +++++++++++-----
|
||||
10 files changed, 55 insertions(+), 26 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
|
||||
@@ -418,6 +418,14 @@ const FeatureEntry::FeatureVariation kCCTModuleCacheVariations[] = {
|
||||
base::size(kCCTModuleCache_ThirtyMinutes), nullptr},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kDnsOverHttpsChoices[] = {
|
||||
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
|
||||
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google/dns-query"},
|
||||
+ {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::FeatureParam kForceDark_SimpleHsl[] = {
|
||||
@@ -4491,7 +4499,7 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"dns-over-https", flag_descriptions::kDnsOverHttpsName,
|
||||
flag_descriptions::kDnsOverHttpsDescription,
|
||||
kOsMac | kOsWin | kOsCrOS | kOsAndroid,
|
||||
- FEATURE_VALUE_TYPE(features::kDnsOverHttps)},
|
||||
+ MULTI_VALUE_TYPE(kDnsOverHttpsChoices)},
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
{"tab-switcher-longpress-menu",
|
||||
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/chrome_content_browser_client.h"
|
||||
#include "chrome/browser/component_updater/crl_set_component_installer.h"
|
||||
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
#include "chrome/browser/net/dns_util.h"
|
||||
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
||||
#include "chrome/browser/ssl/ssl_config_service_manager.h"
|
||||
@@ -142,6 +143,7 @@ void GetStubResolverConfig(
|
||||
base::SPLIT_WANT_NONEMPTY)) {
|
||||
if (!chrome_browser_net::IsValidDohTemplate(server_template,
|
||||
&server_method)) {
|
||||
+ LOG(ERROR) << "Invalid DoH template: " << server_template << " with method " << server_method;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -406,14 +408,16 @@ SystemNetworkContextManager::SystemNetworkContextManager(
|
||||
base::Value(ShouldEnableAsyncDns()));
|
||||
std::string default_doh_mode = chrome_browser_net::kDnsOverHttpsModeOff;
|
||||
std::string default_doh_templates = "";
|
||||
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
|
||||
- if (features::kDnsOverHttpsFallbackParam.Get()) {
|
||||
- default_doh_mode = chrome_browser_net::kDnsOverHttpsModeAutomatic;
|
||||
- } else {
|
||||
- default_doh_mode = chrome_browser_net::kDnsOverHttpsModeSecure;
|
||||
- }
|
||||
- default_doh_templates = features::kDnsOverHttpsTemplatesParam.Get();
|
||||
+
|
||||
+ std::string server =
|
||||
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
+ switches::kDnsOverHttpsServer);
|
||||
+ if (!server.empty()) {
|
||||
+ default_doh_mode = chrome_browser_net::kDnsOverHttpsModeSecure;
|
||||
+ // will use POST when URLs do not contain a 'dns' query parameter
|
||||
+ default_doh_templates = server;
|
||||
}
|
||||
+
|
||||
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsMode,
|
||||
base::Value(default_doh_mode));
|
||||
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsTemplates,
|
||||
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
|
||||
@@ -269,15 +269,6 @@ const base::Feature kDisallowUnsafeHttpDownloads{
|
||||
"DisallowUnsafeHttpDownloads", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
const char kDisallowUnsafeHttpDownloadsParamName[] = "MimeTypeList";
|
||||
|
||||
-// Enable DNS over HTTPS (DoH).
|
||||
-const base::Feature kDnsOverHttps{"DnsOverHttps",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
-
|
||||
-// Set whether fallback to insecure DNS is allowed by default. This setting may
|
||||
-// be overridden for individual transactions.
|
||||
-const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
|
||||
- "Fallback", true};
|
||||
-
|
||||
// Supply one or more space-separated DoH server URI templates to use when this
|
||||
// feature is enabled. If no templates are specified, then a hardcoded mapping
|
||||
// will be used to construct a list of DoH templates associated with the IP
|
||||
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h
|
||||
--- a/chrome/common/chrome_features.h
|
||||
+++ b/chrome/common/chrome_features.h
|
||||
@@ -166,8 +166,6 @@ extern const char kDisallowUnsafeHttpDownloadsParamName[];
|
||||
COMPONENT_EXPORT(CHROME_FEATURES)
|
||||
extern const base::Feature kDnsOverHttps;
|
||||
COMPONENT_EXPORT(CHROME_FEATURES)
|
||||
-extern const base::FeatureParam<bool> kDnsOverHttpsFallbackParam;
|
||||
-COMPONENT_EXPORT(CHROME_FEATURES)
|
||||
extern const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam;
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -8,4 +8,10 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+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,6 +10,12 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+// 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 char kDnsOverHttpsChoiceDefault[],
|
||||
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[], kDnsOverHttpsChoiceQuad9[],
|
||||
+ kDnsOverHttpsChoiceAdGuard[];
|
||||
+
|
||||
} // namespace features
|
||||
|
||||
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -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
|
||||
@@ -117,3 +117,9 @@ LOAD_FLAG(RESTRICTED_PREFETCH, 1 << 18)
|
||||
// is considered privileged, and therefore this flag must only be set from a
|
||||
// trusted process.
|
||||
LOAD_FLAG(CAN_USE_RESTRICTED_PREFETCH, 1 << 19)
|
||||
+
|
||||
+// 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 << 20)
|
||||
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
|
||||
@@ -403,7 +403,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
// perspective to prevent the client from sending AIA requests).
|
||||
request_->SetLoadFlags(request_->load_flags() | LOAD_DISABLE_CACHE |
|
||||
LOAD_BYPASS_PROXY |
|
||||
- LOAD_DISABLE_CERT_NETWORK_FETCHES);
|
||||
+ LOAD_DISABLE_CERT_NETWORK_FETCHES | LOAD_MINIMAL_HEADERS);
|
||||
request_->set_allow_credentials(false);
|
||||
}
|
||||
|
||||
@@ -997,7 +997,7 @@ class DnsTransactionImpl : public DnsTransaction,
|
||||
had_tcp_attempt_(false),
|
||||
first_server_index_(0),
|
||||
url_request_context_(url_request_context),
|
||||
- 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
|
||||
@@ -339,6 +339,7 @@ void URLRequestHttpJob::Start() {
|
||||
// plugin could set a referrer although sending the referrer is inhibited.
|
||||
request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer);
|
||||
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
// Our consumer should have made sure that this is a safe referrer. See for
|
||||
// instance WebCore::FrameLoader::HideReferrer.
|
||||
if (referrer.is_valid()) {
|
||||
@@ -354,11 +355,14 @@ void URLRequestHttpJob::Start() {
|
||||
request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
|
||||
referer_value);
|
||||
}
|
||||
+ }
|
||||
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
request_info_.extra_headers.SetHeaderIfMissing(
|
||||
HttpRequestHeaders::kUserAgent,
|
||||
http_user_agent_settings_ ?
|
||||
http_user_agent_settings_->GetUserAgent() : std::string());
|
||||
+ }
|
||||
|
||||
AddExtraHeaders();
|
||||
AddCookieHeaderAndStart();
|
||||
@@ -582,10 +586,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;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,7 +609,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
@@ -0,0 +1,318 @@
|
||||
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.
|
||||
---
|
||||
chrome/android/chrome_java_sources.gni | 1 +
|
||||
.../android/java/res/xml/privacy_preferences.xml | 5 ++
|
||||
.../browser/AlwaysIncognitoLinkInterceptor.java | 73 ++++++++++++++++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 5 ++
|
||||
.../chrome/browser/appmenu/AppMenuHandlerImpl.java | 11 ++++
|
||||
.../contextmenu/ChromeContextMenuPopulator.java | 9 ++-
|
||||
.../chrome/browser/tabmodel/ChromeTabCreator.java | 24 ++++++-
|
||||
.../java/strings/android_chrome_strings.grd | 8 +++
|
||||
8 files changed, 134 insertions(+), 2 deletions(-)
|
||||
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
|
||||
|
||||
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
|
||||
--- a/chrome/android/chrome_java_sources.gni
|
||||
+++ b/chrome/android/chrome_java_sources.gni
|
||||
@@ -3,6 +3,7 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
chrome_java_sources = [
|
||||
+ "java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java",
|
||||
"java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java",
|
||||
"java/src/org/chromium/chrome/browser/ActivityTabProvider.java",
|
||||
"java/src/org/chromium/chrome/browser/ActivityTabTaskDescriptionHelper.java",
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -20,6 +20,11 @@
|
||||
android:title="@string/preload_pages_title"
|
||||
android:summary="@string/preload_pages_summary"
|
||||
android:persistent="false" />
|
||||
+ <org.chromium.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
|
||||
@@ -225,6 +225,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.
|
||||
*/
|
||||
@@ -1650,6 +1652,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/AppMenuHandlerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandlerImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandlerImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuHandlerImpl.java
|
||||
@@ -20,6 +20,7 @@ import android.view.WindowManager;
|
||||
import android.widget.PopupMenu;
|
||||
|
||||
import org.chromium.base.Callback;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ObservableSupplier;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
@@ -57,6 +58,8 @@ class AppMenuHandlerImpl
|
||||
private @Nullable OverviewModeBehavior mOverviewModeBehavior;
|
||||
private OverviewModeBehavior.OverviewModeObserver mOverviewModeObserver;
|
||||
|
||||
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
|
||||
+
|
||||
/**
|
||||
* The resource id of the menu item to highlight when the menu next opens. A value of
|
||||
* {@code null} means no item will be highlighted. This value will be cleared after the menu is
|
||||
@@ -267,6 +270,14 @@ class AppMenuHandlerImpl
|
||||
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
|
||||
@@ -15,6 +15,7 @@ import android.webkit.URLUtil;
|
||||
|
||||
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;
|
||||
@@ -46,6 +47,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
|
||||
@@ -298,7 +300,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
|
||||
@@ -8,8 +8,10 @@ import android.content.Intent;
|
||||
import android.support.annotation.Nullable;
|
||||
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;
|
||||
@@ -17,6 +19,7 @@ import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabAssociatedApp;
|
||||
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;
|
||||
@@ -37,6 +40,7 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
|
||||
private final ChromeActivity mActivity;
|
||||
private final boolean mIncognito;
|
||||
+ private final TabObserver mExtraLogic;
|
||||
|
||||
private WindowAndroid mNativeWindow;
|
||||
private TabModel mTabModel;
|
||||
@@ -47,6 +51,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
mActivity = activity;
|
||||
mNativeWindow = nativeWindow;
|
||||
mIncognito = incognito;
|
||||
+ if (!mIncognito) {
|
||||
+ mExtraLogic = new AlwaysIncognitoLinkInterceptor(ContextUtils.getAppSharedPreferences());
|
||||
+ } else {
|
||||
+ mExtraLogic = null;
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,6 +180,10 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
tab.getWebContents());
|
||||
}
|
||||
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return tab;
|
||||
} finally {
|
||||
@@ -199,6 +212,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
.setWindow(mNativeWindow)
|
||||
.setLaunchType(type)
|
||||
.build();
|
||||
+
|
||||
+ if (mExtraLogic != null) {
|
||||
+ tab.addObserver(mExtraLogic);
|
||||
+ }
|
||||
+
|
||||
tab.initialize(webContents, delegateFactory, !openInForeground, null, false);
|
||||
mTabModel.addTab(tab, position, type);
|
||||
return true;
|
||||
@@ -242,7 +260,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
|
||||
@@ -307,6 +324,11 @@ public class ChromeTabCreator extends TabCreatorManager.TabCreator {
|
||||
state.isIncognito());
|
||||
tab.initialize(null, createDefaultTabDelegateFactory(), !selectTab, state, 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
|
||||
@@ -689,6 +689,14 @@ CHAR-LIMIT guidelines:
|
||||
Search and site suggestions disabled
|
||||
</message>
|
||||
|
||||
+ <!-- always incognito -->
|
||||
+ <message name="IDS_ALWAYS_INCOGNITO_TITLE" desc="Title for always incognito mode">
|
||||
+ Open links in incognito tabs always
|
||||
+ </message>
|
||||
+ <message name="IDS_ALWAYS_INCOGNITO_SUMMARY" desc="Summary for always incognito mode">
|
||||
+ Opens links in incognito tabs when you click on new tab or on a link
|
||||
+ </message>
|
||||
+
|
||||
<!-- Themes preferences -->
|
||||
<message name="IDS_PREFS_THEMES" desc="Title for the Themes preferences. [CHAR-LIMIT=32]">
|
||||
Themes
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,114 @@
|
||||
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 ++
|
||||
.../browser/preferences/privacy/PrivacyPreferences.java | 11 +++++++++++
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 7 +++++++
|
||||
5 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
|
||||
--- a/chrome/android/java/res/values/values.xml
|
||||
+++ b/chrome/android/java/res/values/values.xml
|
||||
@@ -14,6 +14,9 @@
|
||||
<item name="top_controls_show_threshold" format="float" type="dimen">0.5</item>
|
||||
<item name="top_controls_hide_threshold" format="float" type="dimen">0.5</item>
|
||||
|
||||
+ <string name="allow_custom_tab_intents_title">Allow custom tab intents from applications</string>
|
||||
+ <string name="allow_custom_tab_intents_summary">When disabled, all custom tab intents will be processed as regular navigation instead</string>
|
||||
+
|
||||
<!-- The number of thumbnails that the thumbnail cache can hold. -->
|
||||
<integer name="default_thumbnail_cache_size">5</integer>
|
||||
<!-- The number of approximation thumbnails that the approximation cache can hold. -->
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -29,6 +29,11 @@
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.DoNotTrackPreference"
|
||||
android:key="do_not_track"
|
||||
android:title="@string/do_not_track_title" />
|
||||
+ <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" />
|
||||
<android.support.v7.preference.Preference
|
||||
android:key="contextual_search"
|
||||
android:title="@string/contextual_search_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
|
||||
@@ -43,6 +43,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.util.FeatureUtilities;
|
||||
@@ -273,6 +274,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;
|
||||
// CCT is disabled in noTouch mode except for some Chrome-internal exceptions.
|
||||
if (FeatureUtilities.isNoTouchModeEnabled()
|
||||
&& !IntentHandler.wasIntentSenderChrome(intent)) {
|
||||
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
|
||||
@@ -43,6 +43,8 @@ public class PrivacyPreferences
|
||||
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
|
||||
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
+
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
PrivacyPreferencesManager privacyPrefManager = PrivacyPreferencesManager.getInstance();
|
||||
@@ -101,6 +103,10 @@ public class PrivacyPreferences
|
||||
PrefServiceBridge.getInstance().setSearchSuggestEnabled((boolean) newValue);
|
||||
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setNetworkPredictionEnabled((boolean) newValue);
|
||||
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
} else if (PREF_CONTEXTUAL_SEARCH.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setContextualSearchPreference(((boolean) newValue) ? "true" : "false");
|
||||
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
@@ -141,6 +147,11 @@ public class PrivacyPreferences
|
||||
prefServiceBridge.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
|
||||
}
|
||||
|
||||
+ ChromeBaseCheckBoxPreference allowCustomTabIntentsPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
|
||||
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
|
||||
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
|
||||
if (doNotTrackPref != null) {
|
||||
doNotTrackPref.setSummary(prefServiceBridge.isDoNotTrackEnabled() ? textOn : textOff);
|
||||
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
|
||||
@@ -4020,6 +4020,13 @@ The site does NOT gain access to the camera. The camera images are only visible
|
||||
<message name="IDS_INCOGNITO_DISCLOSURE_CHECKBOX_TEXT" desc="Text for checkbox inviting to close incognito tabs in incognito disclosure dialog." translateable="false">
|
||||
Close other incognito tabs
|
||||
</message>
|
||||
+ <!-- Allow custom tab intents -->
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_TITLE" desc="Text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow custom tab intents
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow applications to open custom tab intents, similar to webview.
|
||||
+ </message>
|
||||
|
||||
<!-- Autofill Assistant preferences -->
|
||||
<message name="IDS_PREFS_AUTOFILL_ASSISTANT_TITLE" desc="Title for the Autofill Assistant preferences screen. [CHAR-LIMIT=32]">
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 31 Jan 2017 22:12:27 -0500
|
||||
Subject: Add exit menu item
|
||||
|
||||
Corrected Exit functionality
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 2 ++
|
||||
.../java/src/org/chromium/chrome/browser/ChromeActivity.java | 2 ++
|
||||
.../org/chromium/chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 3 +++
|
||||
4 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -80,6 +80,8 @@
|
||||
android:title="@string/menu_help" />
|
||||
<item android:id="@+id/enter_vr_id"
|
||||
android:title="@string/enter_vr" />
|
||||
+ <item android:id="@+id/exit_id"
|
||||
+ android:title="@string/menu_exit" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only in the tab switcher -->
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -2137,6 +2137,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
new AddToHomescreenManager(this, currentTab);
|
||||
addToHomescreenManager.start();
|
||||
RecordUserAction.record("MobileMenuAddToHomescreen");
|
||||
+ } else if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
} else if (id == R.id.open_webapk_id) {
|
||||
Context context = ContextUtils.getApplicationContext();
|
||||
String packageName =
|
||||
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
|
||||
@@ -2947,6 +2947,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
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
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 ++++
|
||||
.../url_formatter/spoof_checks/top_domains/BUILD.gn | 1 +
|
||||
net/socket/client_socket_pool_manager.cc | 17 +++++++++++++++++
|
||||
8 files changed, 44 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -677,6 +677,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 ==
|
||||
@@ -2546,6 +2551,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kPassiveDocumentEventListenersName,
|
||||
flag_descriptions::kPassiveDocumentEventListenersDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kPassiveDocumentEventListeners)},
|
||||
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
|
||||
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
{"document-passive-wheel-event-listeners",
|
||||
flag_descriptions::kPassiveDocumentWheelEventListenersName,
|
||||
flag_descriptions::kPassiveDocumentWheelEventListenersDescription, 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
|
||||
@@ -1240,6 +1240,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
|
||||
@@ -761,6 +761,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 char kDnsOverHttpsChoiceDefault[],
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -22,6 +22,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
|
||||
// Enables the QUIC protocol. This is a temporary testing flag.
|
||||
NETWORK_SWITCH(kEnableQuic, "enable-quic")
|
||||
|
||||
+// Allows specifying a higher number of maximum connections per host
|
||||
+// (15 instead of 6, mirroring the value Mozilla uses).
|
||||
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
|
||||
+
|
||||
// Ignores certificate-related errors.
|
||||
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
|
||||
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -78,6 +78,7 @@ executable("make_top_domain_list_for_edit_distance") {
|
||||
"//base",
|
||||
"//base:i18n",
|
||||
"//third_party/icu",
|
||||
+ "//components/network_session_configurator/common"
|
||||
]
|
||||
if (is_ios) {
|
||||
libs = [ "UIKit.framework" ]
|
||||
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
|
||||
--- a/net/socket/client_socket_pool_manager.cc
|
||||
+++ b/net/socket/client_socket_pool_manager.cc
|
||||
@@ -20,6 +20,10 @@
|
||||
#include "net/socket/client_socket_pool.h"
|
||||
#include "net/socket/connect_job.h"
|
||||
#include "net/ssl/ssl_config.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
+
|
||||
+#include "base/command_line.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
|
||||
namespace net {
|
||||
|
||||
@@ -185,6 +189,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
|
||||
int ClientSocketPoolManager::max_sockets_per_group(
|
||||
HttpNetworkSession::SocketPoolType pool_type) {
|
||||
DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES);
|
||||
+
|
||||
+ if (pool_type == HttpNetworkSession::NORMAL_SOCKET_POOL) {
|
||||
+ int maxConnectionsPerHost = 0;
|
||||
+ auto value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kMaxConnectionsPerHost);
|
||||
+ if (!value.empty() && !base::StringToInt(value, &maxConnectionsPerHost)) {
|
||||
+ LOG(DFATAL) << "--" << switches::kMaxConnectionsPerHost << " only accepts integers as arguments (\"" << value << "\" is invalid)";
|
||||
+ }
|
||||
+ if (maxConnectionsPerHost != 0) {
|
||||
+ return maxConnectionsPerHost;
|
||||
+ }
|
||||
+ // fallthrough for default value
|
||||
+ }
|
||||
+
|
||||
return g_max_sockets_per_group[pool_type];
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
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 | 8 ++++----
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
media/base/media_switches.cc | 6 +-----
|
||||
4 files changed, 13 insertions(+), 9 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
|
||||
@@ -1580,6 +1580,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-webassembly-threads", flag_descriptions::kEnableWasmThreadsName,
|
||||
flag_descriptions::kEnableWasmThreadsDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kWebAssemblyThreads)},
|
||||
+ {"resume-background-video",
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
{"shared-array-buffer", flag_descriptions::kEnableSharedArrayBufferName,
|
||||
flag_descriptions::kEnableSharedArrayBufferDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kSharedArrayBuffer)},
|
||||
@@ -1603,10 +1607,6 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kAppNotificationStatusMessaging)},
|
||||
#endif // OS_ANDROID
|
||||
{"enable-devtools-experiments", flag_descriptions::kDevtoolsExperimentsName,
|
||||
- {"resume-background-video",
|
||||
- flag_descriptions::kResumeBackgroundVideoName,
|
||||
- flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
- FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
flag_descriptions::kDevtoolsExperimentsDescription, kOsDesktop,
|
||||
SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)},
|
||||
{"silent-debugger-extension-api",
|
||||
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
|
||||
@@ -876,6 +876,11 @@ const char kMemlogStackModeNative[] = "Native";
|
||||
const char kMemlogStackModeNativeWithThreadNames[] = "Native with thread names";
|
||||
const char kMemlogStackModePseudo[] = "Trace events";
|
||||
|
||||
+const char kResumeBackgroundVideoName[] = "Resume background video.";
|
||||
+const char kResumeBackgroundVideoDescription[] =
|
||||
+ "Resume background video playback when tab re-gains focus; additionally, "
|
||||
+ "it will pause video playback every single time you switch tabs.";
|
||||
+
|
||||
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
|
||||
const char kEnablePixelCanvasRecordingDescription[] =
|
||||
"Pixel canvas recording allows the compositor to raster contents aligned "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -520,6 +520,9 @@ extern const char kEnablePortalsDescription[];
|
||||
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
|
||||
@@ -212,11 +212,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
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Nov 2018 13:06:49 +0100
|
||||
Subject: Add flag to disable IPv6 probes
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
components/subresource_filter/tools/BUILD.gn | 6 ++++++
|
||||
components/url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
|
||||
net/dns/host_resolver_manager.cc | 10 ++++++++--
|
||||
services/network/public/cpp/features.cc | 4 ++++
|
||||
services/network/public/cpp/features.h | 2 ++
|
||||
8 files changed, 34 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
|
||||
@@ -3206,6 +3206,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
kMarkHttpAsFeatureVariations,
|
||||
"HTTPReallyBadFinal")},
|
||||
|
||||
+ {"ipv6-probing",
|
||||
+ flag_descriptions::kIPv6ProbingName,
|
||||
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
|
||||
+
|
||||
#if !defined(OS_ANDROID)
|
||||
{"enable-web-authentication-testing-api",
|
||||
flag_descriptions::kEnableWebAuthenticationTestingAPIName,
|
||||
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
|
||||
@@ -2512,6 +2512,10 @@ const char kForegroundNotificationManagerDescription[] =
|
||||
const char kHomePageButtonName[] = "Force Enable Home Page Button";
|
||||
const char kHomePageButtonDescription[] = "Displays a home button if enabled.";
|
||||
|
||||
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
|
||||
+const char kIPv6ProbingDescription[] =
|
||||
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
|
||||
+
|
||||
const char kHomepageTileName[] =
|
||||
"Enable Homepage tile shown in Suggested Tiles";
|
||||
const char kHomepageTileDescription[] =
|
||||
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
|
||||
@@ -523,6 +523,9 @@ extern const char kEnableNewDownloadBackendDescription[];
|
||||
extern const char kEnablePortalsName[];
|
||||
extern const char kEnablePortalsDescription[];
|
||||
|
||||
+extern const char kIPv6ProbingName[];
|
||||
+extern const char kIPv6ProbingDescription[];
|
||||
+
|
||||
extern const char kEnablePictureInPictureName[];
|
||||
extern const char kEnablePictureInPictureDescription[];
|
||||
|
||||
diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
|
||||
--- a/components/subresource_filter/tools/BUILD.gn
|
||||
+++ b/components/subresource_filter/tools/BUILD.gn
|
||||
@@ -52,6 +52,8 @@ if (!is_ios) {
|
||||
deps = [
|
||||
":tools_lib",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -65,6 +67,8 @@ if (!is_ios) {
|
||||
":tools_lib",
|
||||
"../core/common",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -76,6 +80,8 @@ if (!is_ios) {
|
||||
"ruleset_converter:support",
|
||||
"//base",
|
||||
"//third_party/protobuf:protobuf_lite",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -78,7 +78,8 @@ executable("make_top_domain_list_for_edit_distance") {
|
||||
"//base",
|
||||
"//base:i18n",
|
||||
"//third_party/icu",
|
||||
- "//components/network_session_configurator/common"
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
if (is_ios) {
|
||||
libs = [ "UIKit.framework" ]
|
||||
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
|
||||
--- a/net/dns/host_resolver_manager.cc
|
||||
+++ b/net/dns/host_resolver_manager.cc
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "net/socket/client_socket_factory.h"
|
||||
#include "net/socket/datagram_client_socket.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
#include "url/url_canon_ip.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_MDNS)
|
||||
@@ -3209,8 +3210,13 @@ bool HostResolverManager::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
|
||||
@@ -46,6 +46,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
const base::Feature kThrottleDelayable{"ThrottleDelayable",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
+// Enable IPv6 ping probes to RIPE DNS.
|
||||
+const base::Feature kIPv6Probing{"IPv6Probing",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
|
||||
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
|
||||
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kNetworkService;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
+extern const base::Feature kIPv6Probing;
|
||||
+COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kOutOfBlinkCors;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kReporting;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 16 Nov 2019 11:18:09 +0100
|
||||
Subject: Add flag to disable WebGL
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1372,6 +1372,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kAccelerated2dCanvasName,
|
||||
flag_descriptions::kAccelerated2dCanvasDescription, kOsAll,
|
||||
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)},
|
||||
+ {switches::kDisableWebGL, flag_descriptions::kDisableWebGLName,
|
||||
+ flag_descriptions::kDisableWebGLDescription, kOsAll,
|
||||
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebGL)},
|
||||
{"composited-layer-borders", flag_descriptions::kCompositedLayerBordersName,
|
||||
flag_descriptions::kCompositedLayerBordersDescription, kOsAll,
|
||||
SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -385,6 +385,10 @@ const char kDisableAudioForDesktopShareDescription[] =
|
||||
"With this flag on, desktop share picker window will not let the user "
|
||||
"choose whether to share audio.";
|
||||
|
||||
+const char kDisableWebGLName[] = "Disable all versions of WebGL";
|
||||
+
|
||||
+const char kDisableWebGLDescription[] = "Disable all versions of WebGL";
|
||||
+
|
||||
const char kDisableBestEffortTasksName[] = "Skip best effort tasks";
|
||||
const char kDisableBestEffortTasksDescription[] =
|
||||
"With this flag on, tasks of the lowest priority will not be executed "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -256,6 +256,9 @@ extern const char kDevtoolsExperimentsDescription[];
|
||||
extern const char kDisableAudioForDesktopShareName[];
|
||||
extern const char kDisableAudioForDesktopShareDescription[];
|
||||
|
||||
+extern const char kDisableWebGLName[];
|
||||
+extern const char kDisableWebGLDescription[];
|
||||
+
|
||||
extern const char kDisableBestEffortTasksName[];
|
||||
extern const char kDisableBestEffortTasksDescription[];
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 22 Oct 2018 21:29:53 +0200
|
||||
Subject: Add flags to disable device motion and orientation APIs
|
||||
|
||||
Both flags will be disabled by default and prevent usage of gyroscope and
|
||||
legacy acceleration events.
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.h | 6 ++++++
|
||||
content/child/runtime_features.cc | 3 +++
|
||||
content/public/common/content_features.cc | 10 ++++++++++
|
||||
content/public/common/content_features.h | 2 ++
|
||||
third_party/blink/public/platform/web_runtime_features.h | 2 ++
|
||||
third_party/blink/renderer/modules/modules_initializer.cc | 9 ++++++---
|
||||
.../blink/renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
|
||||
10 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1606,6 +1606,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-gpu-rasterization", flag_descriptions::kGpuRasterizationName,
|
||||
flag_descriptions::kGpuRasterizationDescription, kOsAll,
|
||||
MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)},
|
||||
+ {"enable-device-motion", flag_descriptions::kEnableDeviceMotionName,
|
||||
+ flag_descriptions::kEnableDeviceMotionDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kDeviceMotion)},
|
||||
+ {"enable-device-orientation", flag_descriptions::kEnableDeviceOrientationName,
|
||||
+ flag_descriptions::kEnableDeviceOrientationDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kDeviceOrientation)},
|
||||
{"enable-oop-rasterization", flag_descriptions::kOopRasterizationName,
|
||||
flag_descriptions::kOopRasterizationDescription, kOsAll,
|
||||
MULTI_VALUE_TYPE(kEnableOopRasterizationChoices)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -644,6 +644,14 @@ const char kWinrtSensorsImplementationDescription[] =
|
||||
"Enables usage of the Windows.Devices.Sensors WinRT APIs on Windows for "
|
||||
"sensors";
|
||||
|
||||
+const char kEnableDeviceMotionName[] = "Enable device motion";
|
||||
+const char kEnableDeviceMotionDescription[] =
|
||||
+ "Enable device motion API which is used to detect changes in acceleration";
|
||||
+
|
||||
+const char kEnableDeviceOrientationName[] = "Enable device orientation";
|
||||
+const char kEnableDeviceOrientationDescription[] =
|
||||
+ "Enable device orientation API which is used to detect changes in orientation";
|
||||
+
|
||||
const char kEnableGenericSensorExtraClassesName[] =
|
||||
"Generic Sensor Extra Classes";
|
||||
const char kEnableGenericSensorExtraClassesDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -398,6 +398,12 @@ extern const char kEnableTLS13EarlyDataDescription[];
|
||||
extern const char kWinrtSensorsImplementationName[];
|
||||
extern const char kWinrtSensorsImplementationDescription[];
|
||||
|
||||
+extern const char kEnableDeviceMotionName[];
|
||||
+extern const char kEnableDeviceMotionDescription[];
|
||||
+
|
||||
+extern const char kEnableDeviceOrientationName[];
|
||||
+extern const char kEnableDeviceOrientationDescription[];
|
||||
+
|
||||
extern const char kEnableGenericSensorExtraClassesName[];
|
||||
extern const char kEnableGenericSensorExtraClassesDescription[];
|
||||
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -85,6 +85,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
|
||||
@@ -689,6 +689,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
|
||||
@@ -157,6 +157,8 @@ CONTENT_EXPORT extern const base::Feature kScriptStreamingOnPreload;
|
||||
CONTENT_EXPORT extern const base::Feature kTrustedDOMTypes;
|
||||
CONTENT_EXPORT extern const base::Feature kBrowserUseDisplayThreadPriority;
|
||||
|
||||
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
CONTENT_EXPORT extern const base::Feature kAndroidAutofillAccessibility;
|
||||
CONTENT_EXPORT extern const base::Feature
|
||||
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -91,6 +91,8 @@ class WebRuntimeFeatures {
|
||||
BLINK_PLATFORM_EXPORT static void EnableCSSHexAlphaColor(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableSameSiteByDefaultCookies(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableKeyboardFocusableScrollers(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableDatabase(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableDecodeJpeg420ImagesToYUV(bool);
|
||||
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
--- a/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
|
||||
@@ -244,9 +244,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
|
||||
@@ -160,6 +160,14 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
|
||||
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
|
||||
+}
|
||||
+
|
||||
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
|
||||
+}
|
||||
+
|
||||
void WebRuntimeFeatures::EnableKeyboardFocusableScrollers(bool enable) {
|
||||
RuntimeEnabledFeatures::SetKeyboardFocusableScrollersEnabled(enable);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -1128,6 +1128,14 @@
|
||||
status: "experimental",
|
||||
},
|
||||
{
|
||||
+ name: "DeviceMotion",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
+ name: "DeviceOrientation",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
+ {
|
||||
name: "OnDeviceChange",
|
||||
// Android does not yet support SystemMonitor.
|
||||
status: {"Android": "", "default": "stable"},
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 14 Sep 2019 10:19:07 +0200
|
||||
Subject: Add menu option to toggle ad blocker
|
||||
|
||||
---
|
||||
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 +++++
|
||||
.../appmenu/AppMenuPropertiesDelegateImpl.java | 40 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 2 ++
|
||||
.../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
|
||||
@@ -75,6 +75,18 @@
|
||||
android:checkable="true" />
|
||||
</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
|
||||
@@ -2159,6 +2159,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
|
||||
@@ -1757,6 +1757,14 @@ public class ChromeTabbedActivity extends ChromeActivity implements ScreenshotMo
|
||||
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/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
@@ -26,6 +26,7 @@ import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ActivityTabProvider;
|
||||
import org.chromium.chrome.browser.ChromeSwitches;
|
||||
+import org.chromium.chrome.browser.ContentSettingsType;
|
||||
import org.chromium.chrome.browser.ShortcutHelper;
|
||||
import org.chromium.chrome.browser.banners.AppBannerManager;
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
|
||||
@@ -224,6 +225,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
// Prepare translate menu button.
|
||||
prepareTranslateMenuItem(menu, currentTab);
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
// Hide 'Add to homescreen' for the following:
|
||||
// * chrome:// pages - Android doesn't know how to direct those URLs.
|
||||
// * incognito pages - To avoid problems where users create shortcuts in incognito
|
||||
@@ -299,6 +302,43 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
PrefServiceBridge.getInstance().isIncognitoModeManaged());
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Updates the ad blocker item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} to enable ad blocker
|
||||
+ * @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 Block ads 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 ad blocker is globally activated.
|
||||
+ 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
|
||||
+ ? mContext.getString(R.string.menu_enable_adblock_on)
|
||||
+ : mContext.getString(R.string.menu_enable_adblock_off));
|
||||
+ }
|
||||
+
|
||||
+
|
||||
/**
|
||||
* Sets the visibility and labels of the "Add to Home screen" and "Open WebAPK" menu items.
|
||||
*/
|
||||
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
|
||||
@@ -201,6 +201,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
|
||||
@@ -2952,6 +2952,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 ad blocker engine for the page. [CHAR-LIMIT=27]">
|
||||
+ Block ads
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_ON" desc="Accessibility description for when Block ads is selected.">
|
||||
+ Turn off ad blocking
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_OFF" desc="Accessibility description for when Block ads is unselected.">
|
||||
+ Turn on ad blocking
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR-LIMIT=27]">
|
||||
Appearance
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
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 | 12 +++++++
|
||||
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
|
||||
.../appmenu/AppMenuPropertiesDelegateImpl.java | 39 ++++++++++++++++++++++
|
||||
.../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">
|
||||
@@ -63,6 +64,17 @@
|
||||
<item android:id="@+id/translate_id"
|
||||
android:title="@string/menu_translate"
|
||||
android:orderInCategory="2"/>
|
||||
+ <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
|
||||
@@ -2149,6 +2149,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
|
||||
@@ -1802,6 +1802,14 @@ public class ChromeTabbedActivity extends ChromeActivity implements ScreenshotMo
|
||||
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/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
@@ -241,6 +241,8 @@ public class AppMenuPropertiesDelegateImpl implements 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()));
|
||||
@@ -432,6 +434,43 @@ public class AppMenuPropertiesDelegateImpl implements 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
|
||||
+ ? mContext.getString(R.string.menu_enable_javascript_on)
|
||||
+ : mContext.getString(R.string.menu_enable_javascript_off));
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+
|
||||
/**
|
||||
* Updates the request desktop site item's state.
|
||||
*
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -202,6 +202,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
|
||||
@@ -2932,6 +2932,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]">
|
||||
+ JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_ON" desc="Accessibility description for when Enable JavaScript is selected.">
|
||||
+ Turn off JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_OFF" desc="Accessibility description for when Enable JavaScript is unselected.">
|
||||
+ Turn on JavaScript
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE" desc="Menu item in Chrome's overflow/options menu. By default, when a user navigates to a web page, Chrome shows the mobile site, that is, the version of the site designed for mobile phones. If this menu item is selected, however, Chrome will try to load the 'desktop' site instead, i.e. the site designed for desktop computers or laptop computers, which have larger screens. [CHAR-LIMIT=24]">
|
||||
Desktop site
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 7 Sep 2019 15:07:42 +0200
|
||||
Subject: Add option to not persist tabs across sessions
|
||||
|
||||
---
|
||||
chrome/android/java/res/values/values.xml | 3 +++
|
||||
chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++
|
||||
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 +++-
|
||||
.../browser/preferences/privacy/PrivacyPreferences.java | 12 ++++++++++++
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 6 ++++++
|
||||
5 files changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
|
||||
--- a/chrome/android/java/res/values/values.xml
|
||||
+++ b/chrome/android/java/res/values/values.xml
|
||||
@@ -62,6 +62,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
|
||||
@@ -38,6 +38,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="close_tabs_on_exit"
|
||||
+ android:title="@string/close_tabs_on_exit_title"
|
||||
+ android:summary="@string/close_tabs_on_exit_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<Preference
|
||||
android:key="clear_browsing_data"
|
||||
android:title="@string/clear_browsing_data_title"
|
||||
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
|
||||
@@ -1166,8 +1166,10 @@ public class ChromeTabbedActivity extends ChromeActivity implements ScreenshotMo
|
||||
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.support.graphics.drawable.VectorDrawableCompat;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
@@ -14,6 +15,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.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
@@ -38,6 +40,7 @@ public class PrivacyPreferences
|
||||
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 = "preload_pages";
|
||||
+ 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_CLEAR_BROWSING_DATA = "clear_browsing_data";
|
||||
|
||||
@@ -112,6 +115,10 @@ public class PrivacyPreferences
|
||||
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setBoolean(
|
||||
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
|
||||
+ } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -162,6 +169,11 @@ public class PrivacyPreferences
|
||||
boolean isContextualSearchEnabled = !prefServiceBridge.isContextualSearchDisabled();
|
||||
contextualPref.setSummary(isContextualSearchEnabled ? textOn : textOff);
|
||||
}
|
||||
+
|
||||
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
|
||||
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
|
||||
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
}
|
||||
|
||||
private ManagedPreferenceDelegate createManagedPreferenceDelegate() {
|
||||
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
|
||||
@@ -3764,6 +3764,12 @@ The site does NOT gain access to the camera. The camera images are only visible
|
||||
<message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
|
||||
IMAGE
|
||||
</message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_TITLE" desc="Text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Close all open tabs on exit
|
||||
+ </message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Don't persist tabs between browsing sessions
|
||||
+ </message>
|
||||
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
|
||||
LINK
|
||||
</message>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
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 | 10 +++++++++
|
||||
.../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, 56 insertions(+), 4 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
|
||||
@@ -7,6 +7,11 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<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" />
|
||||
+
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeSwitchPreference
|
||||
android:key="homepage_switch"
|
||||
android:summaryOn="@string/text_on"
|
||||
android:summaryOff="@string/text_off" />
|
||||
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
|
||||
@@ -20,6 +20,7 @@ public class HomepagePreferences extends PreferenceFragmentCompat {
|
||||
@VisibleForTesting
|
||||
public 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 Preference mHomepageEdit;
|
||||
@@ -42,6 +43,15 @@ public class HomepagePreferences extends PreferenceFragmentCompat {
|
||||
return true;
|
||||
});
|
||||
|
||||
+ ChromeSwitchPreference mNTPIsHomepageSwitch =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
|
||||
+ boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
|
||||
+ mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
|
||||
+ mNTPIsHomepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
+ mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
|
||||
+ return true;
|
||||
+ });
|
||||
+
|
||||
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
|
||||
@@ -12,6 +12,7 @@ import org.chromium.chrome.browser.tab.TabState;
|
||||
import org.chromium.chrome.browser.util.UrlConstants;
|
||||
import org.chromium.content_public.browser.LoadUrlParams;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
+import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
|
||||
|
||||
/**
|
||||
* An interface to return a {@link TabCreator} either for regular or incognito tabs.
|
||||
@@ -85,12 +86,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
|
||||
@@ -663,6 +663,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
|
||||
@@ -54,6 +54,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
|
||||
@@ -59,6 +59,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
|
||||
@@ -318,6 +318,7 @@ extern const char kSettingsShowBrowserBanner[];
|
||||
extern const char kSettingsShowOSBanner[];
|
||||
#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
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
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
|
||||
@@ -32,6 +32,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
|
||||
@@ -242,6 +242,10 @@ public class PrefServiceBridge {
|
||||
return nativeGetBlockThirdPartyCookiesEnabled();
|
||||
}
|
||||
|
||||
+ public boolean isCookiesSessionOnlyEnabled() {
|
||||
+ return nativeGetCookiesSessionOnlyEnabled();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return Whether third-party cookie blocking is configured by policy
|
||||
*/
|
||||
@@ -631,6 +635,10 @@ public class PrefServiceBridge {
|
||||
nativeSetBlockThirdPartyCookiesEnabled(enabled);
|
||||
}
|
||||
|
||||
+ public void setCookiesSessionOnlyEnabled(boolean enabled) {
|
||||
+ nativeSetCookiesSessionOnlyEnabled(enabled);
|
||||
+ }
|
||||
+
|
||||
public void setDoNotTrackEnabled(boolean enabled) {
|
||||
nativeSetDoNotTrackEnabled(enabled);
|
||||
}
|
||||
@@ -1094,6 +1102,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();
|
||||
@@ -1141,6 +1150,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
|
||||
@@ -127,6 +127,7 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
|
||||
// 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";
|
||||
@@ -484,6 +485,7 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
if (type == SiteSettingsCategory.Type.COOKIES
|
||||
&& !FeatureUtilities.isNoTouchModeEnabled()) {
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else if (type == SiteSettingsCategory.Type.NOTIFICATIONS) {
|
||||
updateNotificationsVibrateCheckBox();
|
||||
}
|
||||
@@ -523,6 +525,8 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
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())) {
|
||||
@@ -840,6 +844,8 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
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);
|
||||
@@ -871,6 +877,7 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
|
||||
if (hideSecondaryToggles) {
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
screen.removePreference(notificationsVibrate);
|
||||
screen.removePreference(explainProtectedMediaKey);
|
||||
screen.removePreference(allowedGroup);
|
||||
@@ -881,14 +888,17 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
return;
|
||||
}
|
||||
|
||||
- // Configure/hide the third-party cookies toggle, as needed.
|
||||
+ // Configure/hide the third-party cookies toggle and session-only cookie toggle, as needed.
|
||||
// We don't need this toggle in touchless. Refer to crbug/951850.
|
||||
if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES)
|
||||
&& !FeatureUtilities.isNoTouchModeEnabled()) {
|
||||
thirdPartyCookies.setOnPreferenceChangeListener(this);
|
||||
updateThirdPartyCookiesCheckBox();
|
||||
+ cookiesSessionOnly.setOnPreferenceChangeListener(this);
|
||||
+ updateCookiesSessionOnlyCheckBox();
|
||||
} else {
|
||||
screen.removePreference(thirdPartyCookies);
|
||||
+ screen.removePreference(cookiesSessionOnly);
|
||||
}
|
||||
|
||||
// Configure/hide the notifications vibrate toggle, as needed.
|
||||
@@ -1003,6 +1013,15 @@ public class SingleCategoryPreferences extends PreferenceFragmentCompat
|
||||
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
|
||||
@@ -895,6 +895,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
|
||||
@@ -314,6 +314,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) {
|
||||
@@ -785,6 +796,20 @@ static void JNI_PrefServiceBridge_SetBlockThirdPartyCookiesEnabled(
|
||||
GetPrefService()->SetBoolean(prefs::kBlockThirdPartyCookies, enabled);
|
||||
}
|
||||
|
||||
+static void JNI_PrefServiceBridge_SetCookiesSessionOnlyEnabled(
|
||||
+ JNIEnv* env,
|
||||
+ const JavaParamRef<jobject>& obj,
|
||||
+ jboolean enabled) {
|
||||
+ HostContentSettingsMap* host_content_settings_map =
|
||||
+ HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
|
||||
+ LOG(INFO) << "SetCookiesSessionOnly -> " << (enabled ? "true" : "false") <<
|
||||
+ "; false -> setting_allow: " << CONTENT_SETTING_ALLOW <<
|
||||
+ "; true -> session_only: " << CONTENT_SETTING_SESSION_ONLY;
|
||||
+ host_content_settings_map->SetDefaultContentSetting(
|
||||
+ CONTENT_SETTINGS_TYPE_COOKIES,
|
||||
+ enabled ? CONTENT_SETTING_SESSION_ONLY : CONTENT_SETTING_ALLOW);
|
||||
+}
|
||||
+
|
||||
static void JNI_PrefServiceBridge_SetRememberPasswordsEnabled(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 2 Nov 2017 18:21:16 +0200
|
||||
Subject: Allow playing audio in background
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
media/blink/webmediaplayer_impl.cc | 12 +++++++++++-
|
||||
media/blink/webmediaplayer_impl.h | 2 ++
|
||||
3 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -1603,6 +1603,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kAppNotificationStatusMessaging)},
|
||||
#endif // OS_ANDROID
|
||||
{"enable-devtools-experiments", flag_descriptions::kDevtoolsExperimentsName,
|
||||
+ {"resume-background-video",
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
flag_descriptions::kDevtoolsExperimentsDescription, kOsDesktop,
|
||||
SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)},
|
||||
{"silent-debugger-extension-api",
|
||||
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
|
||||
@@ -976,6 +976,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());
|
||||
@@ -3278,7 +3284,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
|
||||
// Audio only stream is allowed to play when in background.
|
||||
// TODO: We should check IsBackgroundOptimizationCandidate here. But we need
|
||||
// to move the logic of checking video frames out of that function.
|
||||
- if (!HasVideo())
|
||||
+
|
||||
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
|
||||
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
|
||||
+ //streams be played in background.
|
||||
+ if (!HasVideoNonEmptySize())
|
||||
return false;
|
||||
|
||||
if (!is_background_video_playback_enabled_)
|
||||
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
|
||||
@@ -142,6 +142,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
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
@@ -152,7 +152,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
|
||||
registry->RegisterBooleanPref(prefs::kAccountConsistencyMirrorRequired,
|
||||
false);
|
||||
#endif
|
||||
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From: samartnik <artem@brave.com>
|
||||
Date: Thu, 14 Dec 2017 16:19:50 +0200
|
||||
Subject: Always allow partner customisation
|
||||
|
||||
---
|
||||
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
@@ -243,14 +243,14 @@ public class PartnerBrowserCustomizations {
|
||||
@Override
|
||||
protected Void doInBackground() {
|
||||
try {
|
||||
- boolean systemOrPreStable =
|
||||
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
- || !ChromeVersionInfo.isStableBuild();
|
||||
- if (!systemOrPreStable) {
|
||||
- // Only allow partner customization if this browser is a system package, or
|
||||
- // is in pre-stable channels.
|
||||
- return null;
|
||||
- }
|
||||
+ //boolean systemOrPreStable =
|
||||
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
+ // || !ChromeVersionInfo.isStableBuild();
|
||||
+ //if (!systemOrPreStable) {
|
||||
+ // // Only allow partner customization if this browser is a system package, or
|
||||
+ // // is in pre-stable channels.
|
||||
+ // return null;
|
||||
+ //}
|
||||
|
||||
if (isCancelled()) return null;
|
||||
refreshIncognitoModeDisabled();
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 5 Jun 2018 13:46:40 +0200
|
||||
Subject: Always respect async dns flag (regardless of SDK version)
|
||||
|
||||
Do not read experiment value for cronet async DNS configuration
|
||||
---
|
||||
chrome/browser/net/system_network_context_manager.cc | 2 +-
|
||||
components/cronet/url_request_context_config.cc | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
|
||||
--- a/chrome/browser/net/system_network_context_manager.cc
|
||||
+++ b/chrome/browser/net/system_network_context_manager.cc
|
||||
@@ -244,7 +244,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
|
||||
@@ -550,7 +550,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
|
||||
effective_experimental_options->Remove(it.key(), nullptr);
|
||||
continue;
|
||||
}
|
||||
- async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
|
||||
+ bool ignored;
|
||||
+ async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
|
||||
} else if (it.key() == kStaleDnsFieldTrialName) {
|
||||
const base::DictionaryValue* stale_dns_args = nullptr;
|
||||
if (!it.value().GetAsDictionary(&stale_dns_args)) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
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
|
||||
@@ -356,18 +356,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
|
||||
@@ -154,13 +154,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
|
||||
@@ -206,15 +206,11 @@ public class MainPreferences extends PreferenceFragmentCompat
|
||||
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 (NightModeUtils.isNightModeSupported() && FeatureUtilities.isNightModeAvailable()) {
|
||||
addPreferenceIfAbsent(PREF_UI_THEME);
|
||||
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 sHasGoogleAccountAuthenticator;
|
||||
private static Boolean sHasRecognitionIntentHandler;
|
||||
|
||||
- private static Boolean sIsHomePageButtonForceEnabled;
|
||||
private static Boolean sIsHomepageTileEnabled;
|
||||
private static Boolean sIsNewTabPageButtonEnabled;
|
||||
private static Boolean sIsBottomToolbarEnabled;
|
||||
@@ -178,7 +177,6 @@ public class FeatureUtilities {
|
||||
public static void cacheNativeFlags() {
|
||||
cacheCommandLineOnNonRootedEnabled();
|
||||
FirstRunUtils.cacheFirstRunPrefs();
|
||||
- cacheHomePageButtonForceEnabled();
|
||||
cacheHomepageTileEnabled();
|
||||
cacheNewTabPageButtonEnabled();
|
||||
cacheBottomToolbarEnabled();
|
||||
@@ -228,38 +226,6 @@ public class FeatureUtilities {
|
||||
return Build.VERSION.SDK_INT > Build.VERSION_CODES.M;
|
||||
}
|
||||
|
||||
- /**
|
||||
- * 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;
|
||||
- }
|
||||
-
|
||||
private static void cacheServiceManagerForDownloadResumption() {
|
||||
boolean resumptionDownloadInReducedMode =
|
||||
ChromeFeatureList.isEnabled(ChromeFeatureList.SERVICE_MANAGER_FOR_DOWNLOAD);
|
||||
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
|
||||
@@ -1932,9 +1932,6 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-chrome-duet-labels", flag_descriptions::kChromeDuetLabelsName,
|
||||
flag_descriptions::kChromeDuetLabelsDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kChromeDuetLabeled)},
|
||||
- {"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
|
||||
@@ -143,7 +143,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
|
||||
&kEphemeralTab,
|
||||
&kExploreSites,
|
||||
&kHandleMediaIntents,
|
||||
- &kHomePageButtonForceEnabled,
|
||||
&kHomepageTile,
|
||||
&kHorizontalTabSwitcherAndroid,
|
||||
&kIdentityDisc,
|
||||
@@ -439,9 +438,6 @@ const base::Feature kForegroundNotificationManager{
|
||||
const base::Feature kHandleMediaIntents{"HandleMediaIntents",
|
||||
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
|
||||
@@ -77,7 +77,6 @@ extern const base::Feature kEphemeralTab;
|
||||
extern const base::Feature kExploreSites;
|
||||
extern const base::Feature kForegroundNotificationManager;
|
||||
extern const base::Feature kHandleMediaIntents;
|
||||
-extern const base::Feature kHomePageButtonForceEnabled;
|
||||
extern const base::Feature kHomepageTile;
|
||||
extern const base::Feature kHorizontalTabSwitcherAndroid;
|
||||
extern const base::Feature kIdentityDisc;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
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
|
||||
@@ -43,10 +43,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
|
||||
@@ -39,7 +39,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 bufferOffset = 0);
|
||||
+ //[HighEntropy, Measure, RaisesException] Float32Array getChannelData(unsigned long channelIndex);
|
||||
+ //[HighEntropy, Measure, RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long bufferOffset = 0);
|
||||
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long bufferOffset = 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
|
||||
@@ -343,6 +343,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
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 22 Mar 2018 22:11:57 +0100
|
||||
Subject: Battery API: return nothing
|
||||
|
||||
Include @thestinger's fix for correct charging/unknown values
|
||||
---
|
||||
.../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
|
||||
@@ -45,45 +45,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
|
||||
}
|
||||
|
||||
bool BatteryManager::charging() {
|
||||
- return battery_status_.Charging();
|
||||
+ return true;
|
||||
}
|
||||
|
||||
double BatteryManager::chargingTime() {
|
||||
- return battery_status_.charging_time();
|
||||
+ return 0.0;
|
||||
}
|
||||
|
||||
double BatteryManager::dischargingTime() {
|
||||
- return battery_status_.discharging_time();
|
||||
+ return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
double BatteryManager::level() {
|
||||
- return battery_status_.Level();
|
||||
+ return 1.0;
|
||||
}
|
||||
|
||||
void BatteryManager::DidUpdateData() {
|
||||
DCHECK(battery_property_);
|
||||
|
||||
- BatteryStatus old_status = battery_status_;
|
||||
- battery_status_ = *BatteryDispatcher::Instance().LatestData();
|
||||
-
|
||||
if (battery_property_->GetState() == 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
|
||||
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 30 Oct 2019 11:50:13 +0100
|
||||
Subject: Block all connection requests with 'qjz9zk' in the domain name or
|
||||
with a 'trk:' scheme.
|
||||
|
||||
An info bar is displayed unless the --disable-trkbar command-line flag or the chrome://flag option is used.
|
||||
This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved'
|
||||
---
|
||||
.../chrome_autocomplete_scheme_classifier.cc | 1 +
|
||||
chrome/browser/history/history_utils.cc | 1 +
|
||||
chrome/browser/ui/singleton_tabs.cc | 3 +-
|
||||
chromecast/browser/url_request_context_factory.cc | 7 ++++-
|
||||
components/omnibox/browser/autocomplete_input.cc | 7 +++--
|
||||
components/url_formatter/url_fixer.cc | 4 +++
|
||||
.../browser/child_process_security_policy_impl.cc | 1 +
|
||||
net/BUILD.gn | 2 ++
|
||||
net/url_request/trk_protocol_handler.cc | 26 +++++++++++++++++
|
||||
net/url_request/trk_protocol_handler.h | 33 ++++++++++++++++++++++
|
||||
net/url_request/url_request.cc | 8 ++++++
|
||||
net/url_request/url_request_context_builder.cc | 4 +++
|
||||
url/url_constants.cc | 1 +
|
||||
url/url_constants.h | 1 +
|
||||
url/url_util.cc | 2 ++
|
||||
15 files changed, 97 insertions(+), 4 deletions(-)
|
||||
create mode 100644 net/url_request/trk_protocol_handler.cc
|
||||
create mode 100644 net/url_request/trk_protocol_handler.h
|
||||
|
||||
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
--- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
+++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
|
||||
@@ -28,6 +28,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
|
||||
if (base::IsStringASCII(scheme) &&
|
||||
(ProfileIOData::IsHandledProtocol(scheme) ||
|
||||
base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) ||
|
||||
+ base::LowerCaseEqualsASCII(scheme, url::kTraceScheme) ||
|
||||
base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) ||
|
||||
base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) {
|
||||
return metrics::OmniboxInputType::URL;
|
||||
diff --git a/chrome/browser/history/history_utils.cc b/chrome/browser/history/history_utils.cc
|
||||
--- a/chrome/browser/history/history_utils.cc
|
||||
+++ b/chrome/browser/history/history_utils.cc
|
||||
@@ -22,6 +22,7 @@ bool CanAddURLToHistory(const GURL& url) {
|
||||
url.SchemeIs(content::kChromeDevToolsScheme) ||
|
||||
url.SchemeIs(content::kChromeUIScheme) ||
|
||||
url.SchemeIs(content::kViewSourceScheme) ||
|
||||
+ url.SchemeIs(url::kTraceScheme) ||
|
||||
url.SchemeIs(chrome::kChromeNativeScheme) ||
|
||||
url.SchemeIs(chrome::kChromeSearchScheme) ||
|
||||
url.SchemeIs(dom_distiller::kDomDistillerScheme) ||
|
||||
diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc
|
||||
--- a/chrome/browser/ui/singleton_tabs.cc
|
||||
+++ b/chrome/browser/ui/singleton_tabs.cc
|
||||
@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
|
||||
|
||||
// Skip view-source tabs. This is needed because RewriteURLIfNecessary
|
||||
// removes the "view-source:" scheme which leads to incorrect matching.
|
||||
- if (tab_url.SchemeIs(content::kViewSourceScheme))
|
||||
+ if (tab_url.SchemeIs(content::kViewSourceScheme) ||
|
||||
+ tab_url.SchemeIs(url::kTraceScheme))
|
||||
continue;
|
||||
|
||||
GURL rewritten_tab_url = tab_url;
|
||||
diff --git a/chromecast/browser/url_request_context_factory.cc b/chromecast/browser/url_request_context_factory.cc
|
||||
--- a/chromecast/browser/url_request_context_factory.cc
|
||||
+++ b/chromecast/browser/url_request_context_factory.cc
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "net/http/http_stream_factory.h"
|
||||
#include "net/proxy_resolution/proxy_resolution_service.h"
|
||||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
+#include "net/url_request/trk_protocol_handler.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "net/url_request/url_request_context_builder.h"
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
@@ -245,13 +246,17 @@ void URLRequestContextFactory::InitializeMainContextDependencies(
|
||||
new net::URLRequestJobFactoryImpl());
|
||||
// Keep ProtocolHandlers added in sync with
|
||||
// CastContentBrowserClient::IsHandledURL().
|
||||
+ bool set_protocol = false;
|
||||
for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin();
|
||||
it != protocol_handlers->end();
|
||||
++it) {
|
||||
- bool set_protocol =
|
||||
+ set_protocol =
|
||||
job_factory->SetProtocolHandler(it->first, std::move(it->second));
|
||||
DCHECK(set_protocol);
|
||||
}
|
||||
+ set_protocol = job_factory->SetProtocolHandler(
|
||||
+ url::kTraceScheme, base::WrapUnique(new net::TrkProtocolHandler));
|
||||
+ DCHECK(set_protocol);
|
||||
|
||||
// Set up interceptors in the reverse order.
|
||||
std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc
|
||||
--- a/components/omnibox/browser/autocomplete_input.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_input.cc
|
||||
@@ -496,7 +496,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
|
||||
// For the view-source and blob schemes, we should emphasize the host of the
|
||||
// URL qualified by the view-source or blob prefix.
|
||||
if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) ||
|
||||
- base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme)) &&
|
||||
+ base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme) ||
|
||||
+ base::LowerCaseEqualsASCII(scheme_str, url::kTraceScheme)) &&
|
||||
(static_cast<int>(text.length()) > after_scheme_and_colon)) {
|
||||
// Obtain the URL prefixed by view-source or blob and parse it.
|
||||
base::string16 real_url(text.substr(after_scheme_and_colon));
|
||||
@@ -569,7 +570,9 @@ int AutocompleteInput::NumNonHostComponents(const url::Parsed& parts) {
|
||||
bool AutocompleteInput::HasHTTPScheme(const base::string16& input) {
|
||||
std::string utf8_input(base::UTF16ToUTF8(input));
|
||||
url::Component scheme;
|
||||
- if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme, &scheme)) {
|
||||
+ if (url::FindAndCompareScheme(utf8_input, url::kTraceScheme, &scheme)) {
|
||||
+ return false;
|
||||
+ } else if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme, &scheme)) {
|
||||
utf8_input.erase(0, scheme.end() + 1);
|
||||
}
|
||||
return url::FindAndCompareScheme(utf8_input, url::kHttpScheme, nullptr);
|
||||
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
|
||||
--- a/components/url_formatter/url_fixer.cc
|
||||
+++ b/components/url_formatter/url_fixer.cc
|
||||
@@ -552,6 +552,10 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (scheme == url::kTraceScheme) {
|
||||
+ return GURL();
|
||||
+ }
|
||||
+
|
||||
// We handle the file scheme separately.
|
||||
if (scheme == url::kFileScheme)
|
||||
return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
|
||||
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
|
||||
--- a/content/browser/child_process_security_policy_impl.cc
|
||||
+++ b/content/browser/child_process_security_policy_impl.cc
|
||||
@@ -507,6 +507,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() {
|
||||
RegisterWebSafeScheme(url::kHttpsScheme);
|
||||
RegisterWebSafeScheme(url::kFtpScheme);
|
||||
RegisterWebSafeScheme(url::kDataScheme);
|
||||
+ RegisterWebSafeScheme(url::kTraceScheme);
|
||||
RegisterWebSafeScheme("feed");
|
||||
|
||||
// TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1787,6 +1787,8 @@ component("net") {
|
||||
"url_request/report_sender.h",
|
||||
"url_request/static_http_user_agent_settings.cc",
|
||||
"url_request/static_http_user_agent_settings.h",
|
||||
+ "url_request/trk_protocol_handler.cc",
|
||||
+ "url_request/trk_protocol_handler.h",
|
||||
"url_request/url_fetcher.cc",
|
||||
"url_request/url_fetcher.h",
|
||||
"url_request/url_fetcher_core.cc",
|
||||
diff --git a/net/url_request/trk_protocol_handler.cc b/net/url_request/trk_protocol_handler.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/trk_protocol_handler.cc
|
||||
@@ -0,0 +1,26 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "net/url_request/trk_protocol_handler.h"
|
||||
+
|
||||
+#include "base/logging.h"
|
||||
+#include "net/base/net_errors.h"
|
||||
+#include "net/url_request/url_request_error_job.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+TrkProtocolHandler::TrkProtocolHandler() = default;
|
||||
+
|
||||
+URLRequestJob* TrkProtocolHandler::MaybeCreateJob(
|
||||
+ URLRequest* request, NetworkDelegate* network_delegate) const {
|
||||
+ LOG(ERROR) << "Blocked URL in TrkProtocolHandler: " << request->original_url();
|
||||
+ return new URLRequestErrorJob(
|
||||
+ request, network_delegate, ERR_BLOCKED_BY_CLIENT);
|
||||
+}
|
||||
+
|
||||
+bool TrkProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protocol_handler.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/trk_protocol_handler.h
|
||||
@@ -0,0 +1,33 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
+
|
||||
+#include "base/compiler_specific.h"
|
||||
+#include "base/macros.h"
|
||||
+#include "net/base/net_export.h"
|
||||
+#include "net/url_request/url_request_job_factory.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+class URLRequestJob;
|
||||
+
|
||||
+// Implements a ProtocolHandler for Trk jobs.
|
||||
+class NET_EXPORT TrkProtocolHandler
|
||||
+ : public URLRequestJobFactory::ProtocolHandler {
|
||||
+ public:
|
||||
+ TrkProtocolHandler();
|
||||
+ URLRequestJob* MaybeCreateJob(
|
||||
+ URLRequest* request,
|
||||
+ NetworkDelegate* network_delegate) const override;
|
||||
+ bool IsSafeRedirectTarget(const GURL& location) const override;
|
||||
+
|
||||
+ private:
|
||||
+ DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
|
||||
+};
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
|
||||
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
||||
--- a/net/url_request/url_request.cc
|
||||
+++ b/net/url_request/url_request.cc
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/stl_util.h"
|
||||
+#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
@@ -42,6 +43,7 @@
|
||||
#include "net/url_request/url_request_redirect_job.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
+#include "url/url_constants.h"
|
||||
|
||||
using base::Time;
|
||||
using std::string;
|
||||
@@ -612,6 +614,12 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
+ if (!url.SchemeIs(url::kTraceScheme) &&
|
||||
+ base::EndsWith(url.host(), "qjz9zk", base::CompareCase::INSENSITIVE_ASCII)) {
|
||||
+ LOG(ERROR) << "Block URL in URLRequest: " << url;
|
||||
+ url_chain_[0] = GURL(url::kTraceScheme + (":" + url.possibly_invalid_spec()));
|
||||
+ }
|
||||
+
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] {
|
||||
return NetLogURLRequestConstructorParams(url, priority_,
|
||||
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
|
||||
--- a/net/url_request/url_request_context_builder.cc
|
||||
+++ b/net/url_request/url_request_context_builder.cc
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "net/ssl/ssl_config_service_defaults.h"
|
||||
#include "net/url_request/data_protocol_handler.h"
|
||||
#include "net/url_request/static_http_user_agent_settings.h"
|
||||
+#include "net/url_request/trk_protocol_handler.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
#include "net/url_request/url_request_context_storage.h"
|
||||
#include "net/url_request/url_request_intercepting_job_factory.h"
|
||||
@@ -641,6 +642,9 @@ std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
|
||||
job_factory->SetProtocolHandler(url::kDataScheme,
|
||||
std::make_unique<DataProtocolHandler>());
|
||||
|
||||
+ job_factory->SetProtocolHandler(url::kTraceScheme,
|
||||
+ std::make_unique<TrkProtocolHandler>());
|
||||
+
|
||||
#if !BUILDFLAG(DISABLE_FILE_SUPPORT)
|
||||
if (file_enabled_) {
|
||||
job_factory->SetProtocolHandler(
|
||||
diff --git a/url/url_constants.cc b/url/url_constants.cc
|
||||
--- a/url/url_constants.cc
|
||||
+++ b/url/url_constants.cc
|
||||
@@ -26,6 +26,7 @@ const char kHttpsScheme[] = "https";
|
||||
const char kJavaScriptScheme[] = "javascript";
|
||||
const char kMailToScheme[] = "mailto";
|
||||
const char kTelScheme[] = "tel";
|
||||
+const char kTraceScheme[] = "trk";
|
||||
const char kWsScheme[] = "ws";
|
||||
const char kWssScheme[] = "wss";
|
||||
|
||||
diff --git a/url/url_constants.h b/url/url_constants.h
|
||||
--- a/url/url_constants.h
|
||||
+++ b/url/url_constants.h
|
||||
@@ -32,6 +32,7 @@ COMPONENT_EXPORT(URL) extern const char kHttpsScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char kJavaScriptScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char kMailToScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char kTelScheme[];
|
||||
+COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char kWsScheme[];
|
||||
COMPONENT_EXPORT(URL) extern const char kWssScheme[];
|
||||
|
||||
diff --git a/url/url_util.cc b/url/url_util.cc
|
||||
--- a/url/url_util.cc
|
||||
+++ b/url/url_util.cc
|
||||
@@ -52,6 +52,7 @@ struct SchemeRegistry {
|
||||
kHttpsScheme,
|
||||
kAboutScheme,
|
||||
kDataScheme,
|
||||
+ kTraceScheme,
|
||||
kWssScheme,
|
||||
};
|
||||
|
||||
@@ -67,6 +68,7 @@ struct SchemeRegistry {
|
||||
kAboutScheme,
|
||||
kJavaScriptScheme,
|
||||
kDataScheme,
|
||||
+ kTraceScheme,
|
||||
};
|
||||
|
||||
// Schemes that can be sent CORS requests.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Oct 2019 10:21:19 +0100
|
||||
Subject: Disable HEAD requests for single-word Omnibar searches
|
||||
|
||||
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727
|
||||
---
|
||||
chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc | 8 ++++----
|
||||
chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h | 2 +-
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
|
||||
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
|
||||
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
|
||||
@@ -85,8 +85,8 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
|
||||
shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
|
||||
load_state_(LOAD_NOT_SEEN),
|
||||
fetch_state_(FETCH_NOT_COMPLETE) {
|
||||
- if (alternate_nav_match_.destination_url.is_valid())
|
||||
- CreateLoader(alternate_nav_match_.destination_url);
|
||||
+// if (alternate_nav_match_.destination_url.is_valid())
|
||||
+// CreateLoader(alternate_nav_match_.destination_url);
|
||||
|
||||
// We need to start by listening to AllSources, since we don't know which tab
|
||||
// the navigation might occur in.
|
||||
@@ -286,7 +286,7 @@ void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
-void ChromeOmniboxNavigationObserver::CreateLoader(
|
||||
+/*void ChromeOmniboxNavigationObserver::CreateLoader(
|
||||
const GURL& destination_url) {
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
net::DefineNetworkTrafficAnnotation("omnibox_navigation_observer", R"(
|
||||
@@ -327,4 +327,4 @@ void ChromeOmniboxNavigationObserver::CreateLoader(
|
||||
loader_->SetAllowHttpErrorResults(true);
|
||||
loader_->SetOnRedirectCallback(base::BindRepeating(
|
||||
&ChromeOmniboxNavigationObserver::OnURLRedirect, base::Unretained(this)));
|
||||
-}
|
||||
+}*/
|
||||
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
|
||||
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
|
||||
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
|
||||
@@ -127,7 +127,7 @@ class ChromeOmniboxNavigationObserver : public OmniboxNavigationObserver,
|
||||
|
||||
// Creates a URL loader for |destination_url| and stores it in |loader_|.
|
||||
// Does not start the loader.
|
||||
- void CreateLoader(const GURL& destination_url);
|
||||
+ //void CreateLoader(const GURL& destination_url);
|
||||
|
||||
const base::string16 text_;
|
||||
const AutocompleteMatch match_;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 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
|
||||
@@ -39,7 +39,7 @@ const base::Feature* const kAllFeatures[] = {
|
||||
&kOptionalImagesEnabledFeature};
|
||||
|
||||
const base::Feature kArticleSuggestionsFeature{
|
||||
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kRemoteSuggestionsEmulateM58FetchingSchedule{
|
||||
"RemoteSuggestionsEmulateM58FetchingSchedule",
|
||||
@@ -69,7 +69,7 @@ const char kNotificationsDailyLimit[] = "daily_limit";
|
||||
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
|
||||
|
||||
const base::Feature kKeepPrefetchedContentSuggestions{
|
||||
- "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kOptionalImagesEnabledFeature{
|
||||
"NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
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
|
||||
@@ -135,7 +135,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
|
||||
@@ -465,7 +465,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 kSearchEnginePromoExistingDevice{
|
||||
"SearchEnginePromo.ExistingDevice", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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
|
||||
@@ -82,10 +82,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
false);
|
||||
#endif
|
||||
// TODO(guoweis): Remove next 2 options at M50.
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
|
||||
- registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, false);
|
||||
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
|
||||
- content::kWebRTCIPHandlingDefault);
|
||||
+ content::kWebRTCIPHandlingDisableNonProxiedUdp);
|
||||
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:09:26 +0200
|
||||
Subject: Disable all promo dialogs
|
||||
|
||||
---
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 30 +---------------------
|
||||
1 file changed, 1 insertion(+), 29 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
|
||||
@@ -799,35 +799,7 @@ public class ChromeTabbedActivity extends ChromeActivity implements ScreenshotMo
|
||||
try (TraceEvent e = TraceEvent.scoped(
|
||||
"ChromeTabbedActivity.createToolbarButtonInProductHelpController")) {
|
||||
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(
|
||||
- ChromePreferenceManager.PROMOS_SKIPPED_ON_FIRST_START, true);
|
||||
- }
|
||||
-
|
||||
- ToolbarButtonInProductHelpController.create(this, isShowingPromo);
|
||||
+ ToolbarButtonInProductHelpController.create(this, false);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Wed, 23 Nov 2016 09:26:51 -0500
|
||||
Subject: Disable contextual search by default
|
||||
|
||||
Disable contextual search in preference by default
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java | 2 +-
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -423,7 +423,7 @@ public class PrefServiceBridge {
|
||||
* @return Whether the Contextual Search feature was disabled by the user explicitly.
|
||||
*/
|
||||
public boolean isContextualSearchDisabled() {
|
||||
- return getContextualSearchPreference().equals(CONTEXTUAL_SEARCH_DISABLED);
|
||||
+ return !getContextualSearchPreference().equals(CONTEXTUAL_SEARCH_ENABLED);
|
||||
}
|
||||
|
||||
/**
|
||||
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
|
||||
@@ -145,7 +145,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
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 20 May 2019 23:14:36 +0200
|
||||
Subject: Disable dynamic module loading
|
||||
|
||||
---
|
||||
chrome/android/chrome_java_sources.gni | 13 ----------
|
||||
.../browser/customtabs/CustomTabActivity.java | 18 -------------
|
||||
.../customtabs/CustomTabIntentDataProvider.java | 17 ++----------
|
||||
.../browser/customtabs/CustomTabsConnection.java | 30 ----------------------
|
||||
.../CustomTabActivityComponent.java | 4 ---
|
||||
5 files changed, 2 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
|
||||
--- a/chrome/android/chrome_java_sources.gni
|
||||
+++ b/chrome/android/chrome_java_sources.gni
|
||||
@@ -418,19 +418,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/customtabs/content/TabCreationMode.java",
|
||||
"java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityComponent.java",
|
||||
"java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityModule.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ActivityDelegate.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ActivityDelegatePostMessageBackend.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ActivityHostImpl.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/DynamicModuleConstants.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/DynamicModuleCoordinator.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/DynamicModuleNavigationEventObserver.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/DynamicModulePageLoadObserver.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/DynamicModuleToolbarController.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleEntryPoint.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleHostImpl.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleLoader.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ModuleMetrics.java",
|
||||
- "java/src/org/chromium/chrome/browser/customtabs/dynamicmodule/ObjectWrapper.java",
|
||||
"java/src/org/chromium/chrome/browser/customtabs/features/CustomTabNavigationBarController.java",
|
||||
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabBrowserControlsVisibilityDelegate.java",
|
||||
"java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarCoordinator.java",
|
||||
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
|
||||
@@ -66,7 +66,6 @@ import org.chromium.chrome.browser.customtabs.content.CustomTabIntentHandler.Int
|
||||
import org.chromium.chrome.browser.customtabs.content.TabCreationMode;
|
||||
import org.chromium.chrome.browser.customtabs.dependency_injection.CustomTabActivityComponent;
|
||||
import org.chromium.chrome.browser.customtabs.dependency_injection.CustomTabActivityModule;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.DynamicModuleCoordinator;
|
||||
import org.chromium.chrome.browser.customtabs.features.CustomTabNavigationBarController;
|
||||
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator;
|
||||
import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule;
|
||||
@@ -136,9 +135,6 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
|
||||
|
||||
private final CustomTabsConnection mConnection = CustomTabsConnection.getInstance();
|
||||
|
||||
- @Nullable
|
||||
- private DynamicModuleCoordinator mDynamicModuleCoordinator;
|
||||
-
|
||||
private ActivityTabTaskDescriptionHelper mTaskDescriptionHelper;
|
||||
|
||||
private CustomTabNightModeStateController mNightModeStateController;
|
||||
@@ -308,12 +304,6 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
|
||||
public void finishNativeInitialization() {
|
||||
if (!mIntentDataProvider.isInfoPage()) FirstRunSignInProcessor.start(this);
|
||||
|
||||
- // Try to initialize dynamic module early to enqueue navigation events
|
||||
- // @see DynamicModuleNavigationEventObserver
|
||||
- if (mIntentDataProvider.isDynamicModuleEnabled()) {
|
||||
- mDynamicModuleCoordinator = getComponent().resolveDynamicModuleCoordinator();
|
||||
- }
|
||||
-
|
||||
mSessionHandler = new SessionHandler() {
|
||||
|
||||
@Override
|
||||
@@ -432,10 +422,6 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
|
||||
WebContents webContents = tab == null ? null : tab.getWebContents();
|
||||
mConnection.resetPostMessageHandlerForSession(
|
||||
mIntentDataProvider.getSession(), webContents);
|
||||
-
|
||||
- if (mDynamicModuleCoordinator != null) {
|
||||
- mDynamicModuleCoordinator.resetPostMessageHandlersForCurrentSession(null);
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -794,10 +780,6 @@ public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent
|
||||
if (mIntentDataProvider.isTrustedWebActivity()) {
|
||||
component.resolveTrustedWebActivityCoordinator();
|
||||
}
|
||||
- if (mConnection.shouldHideTopBarOnModuleManagedUrlsForSession(
|
||||
- mIntentDataProvider.getSession())) {
|
||||
- component.resolveDynamicModuleToolbarController();
|
||||
- }
|
||||
|
||||
return component;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
@@ -46,7 +46,6 @@ import org.chromium.chrome.browser.ChromeSwitches;
|
||||
import org.chromium.chrome.browser.ChromeVersionInfo;
|
||||
import org.chromium.chrome.browser.IntentHandler;
|
||||
import org.chromium.chrome.browser.browserservices.BrowserServicesIntentDataProvider;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.ModuleMetrics;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.util.ColorUtils;
|
||||
@@ -460,20 +459,8 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
// even receive the extras for using the feature.
|
||||
if (componentName == null) return false;
|
||||
|
||||
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_MODULE)) {
|
||||
- Log.w(TAG, "The %s feature is disabled.", ChromeFeatureList.CCT_MODULE);
|
||||
- ModuleMetrics.recordLoadResult(ModuleMetrics.LoadResult.FEATURE_DISABLED);
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- ExternalAuthUtils authUtils = ChromeApplication.getComponent().resolveExternalAuthUtils();
|
||||
- if (!authUtils.isGoogleSigned(componentName.getPackageName())) {
|
||||
- Log.w(TAG, "The %s package is not Google-signed.", componentName.getPackageName());
|
||||
- ModuleMetrics.recordLoadResult(ModuleMetrics.LoadResult.NOT_GOOGLE_SIGNED);
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- return true;
|
||||
+ Log.w(TAG, "The %s feature is disabled.", ChromeFeatureList.CCT_MODULE);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
@@ -59,8 +59,6 @@ import org.chromium.chrome.browser.browserservices.Origin;
|
||||
import org.chromium.chrome.browser.browserservices.PostMessageHandler;
|
||||
import org.chromium.chrome.browser.browserservices.SessionDataHolder;
|
||||
import org.chromium.chrome.browser.browserservices.SessionHandler;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.ModuleLoader;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.ModuleMetrics;
|
||||
import org.chromium.chrome.browser.device.DeviceClassManager;
|
||||
import org.chromium.chrome.browser.init.ChainedTasks;
|
||||
import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
|
||||
@@ -219,7 +217,6 @@ public class CustomTabsConnection {
|
||||
|
||||
private volatile ChainedTasks mWarmupTasks;
|
||||
|
||||
- private @Nullable ModuleLoader mModuleLoader;
|
||||
/**
|
||||
* <strong>DO NOT CALL</strong>
|
||||
* Public to be instanciable from {@link ChromeApplication}. This is however
|
||||
@@ -1373,7 +1370,6 @@ public class CustomTabsConnection {
|
||||
if (ChromeApplication.isSevereMemorySignal(level)) {
|
||||
getInstance().mClientManager.cleanupUnusedSessions();
|
||||
}
|
||||
- if (getInstance().mModuleLoader != null) getInstance().mModuleLoader.onTrimMemory(level);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -1510,32 +1506,6 @@ public class CustomTabsConnection {
|
||||
recordSpeculationStatusOnSwap(SPECULATION_STATUS_ON_SWAP_BACKGROUND_TAB_NOT_MATCHED);
|
||||
}
|
||||
|
||||
- public ModuleLoader getModuleLoader(ComponentName componentName, @Nullable String assetName) {
|
||||
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_MODULE_DEX_LOADING)) {
|
||||
- assetName = null;
|
||||
- }
|
||||
-
|
||||
- if (mModuleLoader != null) {
|
||||
- boolean isComponentNameChanged =
|
||||
- !componentName.equals(mModuleLoader.getComponentName());
|
||||
- boolean isAssetNameChanged =
|
||||
- !TextUtils.equals(assetName, mModuleLoader.getDexAssetName());
|
||||
- ModuleLoader.ModuleApkVersion newModuleApkVersion =
|
||||
- ModuleLoader.ModuleApkVersion.getModuleVersion(componentName.getPackageName());
|
||||
- boolean isModuleVersionChanged =
|
||||
- !mModuleLoader.getModuleApkVersion().equals(newModuleApkVersion);
|
||||
-
|
||||
- if (isComponentNameChanged || isAssetNameChanged || isModuleVersionChanged) {
|
||||
- mModuleLoader.destroyModule(ModuleMetrics.DestructionReason.MODULE_LOADER_CHANGED);
|
||||
- mModuleLoader = null;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (mModuleLoader == null) mModuleLoader = new ModuleLoader(componentName, assetName);
|
||||
-
|
||||
- return mModuleLoader;
|
||||
- }
|
||||
-
|
||||
@CalledByNative
|
||||
public static void notifyClientOfDetachedRequestCompletion(
|
||||
CustomTabsSessionToken session, String url, int status) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityComponent.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityComponent.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityComponent.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/dependency_injection/CustomTabActivityComponent.java
|
||||
@@ -15,8 +15,6 @@ import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigatio
|
||||
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabController;
|
||||
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabFactory;
|
||||
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.DynamicModuleCoordinator;
|
||||
-import org.chromium.chrome.browser.customtabs.dynamicmodule.DynamicModuleToolbarController;
|
||||
import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator;
|
||||
import org.chromium.chrome.browser.dependency_injection.ActivityScope;
|
||||
import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule;
|
||||
@@ -32,8 +30,6 @@ import dagger.Subcomponent;
|
||||
@ActivityScope
|
||||
public interface CustomTabActivityComponent extends ChromeActivityComponent {
|
||||
TrustedWebActivityCoordinator resolveTrustedWebActivityCoordinator();
|
||||
- DynamicModuleToolbarController resolveDynamicModuleToolbarController();
|
||||
- DynamicModuleCoordinator resolveDynamicModuleCoordinator();
|
||||
|
||||
CustomTabBottomBarDelegate resolveBottomBarDelegate();
|
||||
CustomTabActivityTabController resolveTabController();
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 8 Jul 2018 18:16:34 +0200
|
||||
Subject: Disable fetching of all field trials
|
||||
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/ChromeFeatureList.java | 12 +++---------
|
||||
components/variations/service/variations_service.cc | 12 +-----------
|
||||
2 files changed, 4 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
|
||||
@@ -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 !BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
- switches::kVariationsServerURL) &&
|
||||
- !g_should_fetch_for_testing) {
|
||||
- DVLOG(1)
|
||||
- << "Not performing repeated fetching in unofficial build without --"
|
||||
- << switches::kVariationsServerURL << " specified.";
|
||||
- return false;
|
||||
- }
|
||||
-#endif
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Thu, 4 Jul 2019 19:08:52 -0400
|
||||
Subject: Disable media router and remoting by default
|
||||
|
||||
---
|
||||
chrome/browser/media/router/media_router_feature.cc | 17 ++++++++---------
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
chrome/browser/profiles/profile_impl.cc | 2 +-
|
||||
3 files changed, 10 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
|
||||
--- a/chrome/browser/media/router/media_router_feature.cc
|
||||
+++ b/chrome/browser/media/router/media_router_feature.cc
|
||||
@@ -57,17 +57,16 @@ const PrefService::Preference* GetMediaRouterPref(
|
||||
|
||||
bool MediaRouterEnabled(content::BrowserContext* context) {
|
||||
#if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
- const PrefService::Preference* pref = GetMediaRouterPref(context);
|
||||
- // Only use the pref value if it set from a mandatory policy.
|
||||
- if (pref->IsManaged() && !pref->IsDefaultValue()) {
|
||||
- bool allowed = false;
|
||||
- CHECK(pref->GetValue()->GetAsBoolean(&allowed));
|
||||
- return allowed;
|
||||
- }
|
||||
-
|
||||
// The component extension cannot be loaded in guest sessions.
|
||||
// TODO(crbug.com/756243): Figure out why.
|
||||
- return !Profile::FromBrowserContext(context)->IsGuestSession();
|
||||
+ if (Profile::FromBrowserContext(context)->IsGuestSession()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ const PrefService::Preference* pref = GetMediaRouterPref(context);
|
||||
+ bool allowed = false;
|
||||
+ pref->GetValue()->GetAsBoolean(&allowed);
|
||||
+ return allowed;
|
||||
#else // !(defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS))
|
||||
return false;
|
||||
#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
|
||||
--- a/chrome/browser/profiles/profile.cc
|
||||
+++ b/chrome/browser/profiles/profile.cc
|
||||
@@ -223,7 +223,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
prefs::kMediaRouterFirstRunFlowAcknowledged,
|
||||
false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
- registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kMediaRouterMediaRemotingEnabled, false);
|
||||
registry->RegisterListPref(prefs::kMediaRouterTabMirroringSources);
|
||||
|
||||
registry->RegisterDictionaryPref(prefs::kWebShareVisitedTargets);
|
||||
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
||||
--- a/chrome/browser/profiles/profile_impl.cc
|
||||
+++ b/chrome/browser/profiles/profile_impl.cc
|
||||
@@ -444,7 +444,7 @@ void ProfileImpl::RegisterProfilePrefs(
|
||||
registry->RegisterStringPref(
|
||||
prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
|
||||
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
|
||||
#if defined(OS_CHROMEOS)
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kOobeMarketingOptInScreenFinished, false,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
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
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "chrome/browser/profiles/profile_android.h"
|
||||
#include "components/favicon_base/favicon_types.h"
|
||||
#include "components/history/core/browser/history_service.h"
|
||||
-#include "components/ntp_tiles/metrics.h"
|
||||
#include "components/ntp_tiles/most_visited_sites.h"
|
||||
#include "components/ntp_tiles/section_type.h"
|
||||
#include "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 {
|
||||
|
||||
@@ -236,7 +234,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
|
||||
JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
jint jtiles_count) {
|
||||
- ntp_tiles::metrics::RecordPageImpression(jtiles_count);
|
||||
}
|
||||
|
||||
void MostVisitedSitesBridge::RecordTileImpression(
|
||||
@@ -249,18 +246,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(
|
||||
@@ -271,12 +256,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
|
||||
jint title_source,
|
||||
jint source,
|
||||
jlong jdata_generation_time_ms) {
|
||||
- ntp_tiles::metrics::RecordTileClick(ntp_tiles::NTPTileImpression(
|
||||
- index, static_cast<TileSource>(source),
|
||||
- static_cast<TileTitleSource>(title_source),
|
||||
- static_cast<TileVisualType>(tile_type), favicon_base::IconType::kInvalid,
|
||||
- base::Time::FromJavaTime(jdata_generation_time_ms),
|
||||
- /*url_for_rappor=*/GURL()));
|
||||
}
|
||||
|
||||
static jlong JNI_MostVisitedSitesBridge_Init(
|
||||
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
|
||||
--- a/components/ntp_tiles/BUILD.gn
|
||||
+++ b/components/ntp_tiles/BUILD.gn
|
||||
@@ -22,8 +22,6 @@ static_library("ntp_tiles") {
|
||||
"icon_cacher.h",
|
||||
"icon_cacher_impl.cc",
|
||||
"icon_cacher_impl.h",
|
||||
- "metrics.cc",
|
||||
- "metrics.h",
|
||||
"most_visited_sites.cc",
|
||||
"most_visited_sites.h",
|
||||
"ntp_tile.cc",
|
||||
@@ -78,7 +76,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
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
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
|
||||
@@ -909,7 +909,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
|
||||
@@ -47,8 +47,6 @@
|
||||
#include "components/content_settings/core/browser/host_content_settings_map.h"
|
||||
#include "components/cookie_config/cookie_store_util.h"
|
||||
#include "components/dom_distiller/core/url_constants.h"
|
||||
-#include "components/metrics/metrics_pref_names.h"
|
||||
-#include "components/metrics/metrics_service.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
|
||||
#include "components/signin/public/base/signin_pref_names.h"
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 30 May 2019 03:37:45 +0200
|
||||
Subject: Disable offline pages in the downloads home to be opened in CCT by
|
||||
default
|
||||
|
||||
---
|
||||
components/offline_pages/core/offline_page_feature.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc
|
||||
--- a/components/offline_pages/core/offline_page_feature.cc
|
||||
+++ b/components/offline_pages/core/offline_page_feature.cc
|
||||
@@ -51,7 +51,7 @@ const base::Feature kOfflinePagesDescriptivePendingStatusFeature{
|
||||
"OfflinePagesDescriptivePendingStatus", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{
|
||||
- "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kOfflinePagesCTSuppressNotificationsFeature{
|
||||
"OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
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
|
||||
@@ -433,13 +433,13 @@ bool 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
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
@@ -1234,10 +1234,8 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
|
||||
}
|
||||
|
||||
PluginData* LocalFrame::GetPluginData() const {
|
||||
- if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
|
||||
- return nullptr;
|
||||
- return GetPage()->GetPluginData(
|
||||
- Tree().Top().GetSecurityContext()->GetSecurityOrigin());
|
||||
+ // what about no
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
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/bookmarks/BookmarkPromoHeader.java | 54 +---------------------
|
||||
.../bookmarks/ReorderBookmarkItemsAdapter.java | 19 +-------
|
||||
.../browser/signin/SigninPromoController.java | 19 +-------
|
||||
5 files changed, 7 insertions(+), 138 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
|
||||
@@ -59,7 +59,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
private BookmarkDelegate mDelegate;
|
||||
private Context mContext;
|
||||
- private BookmarkPromoHeader mPromoHeaderManager;
|
||||
private String mSearchText;
|
||||
private BookmarkId mCurrentFolder;
|
||||
|
||||
@@ -217,9 +216,9 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
|
||||
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);
|
||||
@@ -240,8 +239,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
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;
|
||||
@@ -260,7 +257,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
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.
|
||||
@@ -296,7 +292,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
}
|
||||
};
|
||||
|
||||
- mPromoHeaderManager = new BookmarkPromoHeader(mContext, promoHeaderChangeAction);
|
||||
populateTopLevelFoldersList();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -307,7 +302,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
mDelegate.removeUIObserver(this);
|
||||
mDelegate.getModel().removeObserver(mBookmarkModelObserver);
|
||||
mDelegate = null;
|
||||
- mPromoHeaderManager.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -387,19 +381,6 @@ class BookmarkItemsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
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/bookmarks/BookmarkPromoHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
|
||||
@@ -18,7 +18,6 @@ import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
|
||||
-import org.chromium.chrome.browser.signin.PersonalizedSigninPromoView;
|
||||
import org.chromium.chrome.browser.signin.ProfileDataCache;
|
||||
import org.chromium.chrome.browser.signin.SigninAccessPoint;
|
||||
import org.chromium.chrome.browser.signin.SigninManager;
|
||||
@@ -132,19 +131,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
|
||||
}
|
||||
|
||||
/**
|
||||
- * @return Personalized signin promo header {@link ViewHolder} instance that can be used with
|
||||
- * {@link RecyclerView}.
|
||||
- */
|
||||
- // TODO(crbug.com/160194): Clean up after bookmark reordering launches.
|
||||
- ViewHolder createPersonalizedSigninPromoHolder(ViewGroup parent) {
|
||||
- View view = LayoutInflater.from(mContext).inflate(
|
||||
- R.layout.personalized_signin_promo_view_bookmarks, parent, false);
|
||||
-
|
||||
- // ViewHolder is abstract and it cannot be instantiated directly.
|
||||
- return new ViewHolder(view) {};
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* @return Sync promo header {@link ViewHolder} instance that can be used with
|
||||
* {@link RecyclerView}.
|
||||
*/
|
||||
@@ -156,42 +142,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
|
||||
return new ViewHolder(view) {};
|
||||
}
|
||||
|
||||
- /**
|
||||
- * Configures the personalized signin promo and records promo impressions.
|
||||
- * @param view The view to be configured.
|
||||
- */
|
||||
- void setupPersonalizedSigninPromo(PersonalizedSigninPromoView view) {
|
||||
- SigninPromoUtil.setupPromoViewFromCache(mSigninPromoController, mProfileDataCache, view,
|
||||
- this::setPersonalizedSigninPromoDeclined);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Detaches the previously configured {@link PersonalizedSigninPromoView}.
|
||||
- */
|
||||
- void detachPersonalizePromoView() {
|
||||
- if (mSigninPromoController != null) mSigninPromoController.detach();
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Saves that the personalized signin promo was declined and updates the UI.
|
||||
- */
|
||||
- private void setPersonalizedSigninPromoDeclined() {
|
||||
- SharedPreferences.Editor sharedPreferencesEditor =
|
||||
- ContextUtils.getAppSharedPreferences().edit();
|
||||
- sharedPreferencesEditor.putBoolean(PREF_PERSONALIZED_SIGNIN_PROMO_DECLINED, true);
|
||||
- sharedPreferencesEditor.apply();
|
||||
- mPromoState = calculatePromoState();
|
||||
- triggerPromoUpdate();
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * @return Whether the user declined the personalized signin promo.
|
||||
- */
|
||||
- private boolean wasPersonalizedSigninPromoDeclined() {
|
||||
- return ContextUtils.getAppSharedPreferences().getBoolean(
|
||||
- PREF_PERSONALIZED_SIGNIN_PROMO_DECLINED, false);
|
||||
- }
|
||||
-
|
||||
private @PromoState int calculatePromoState() {
|
||||
if (sPromoStateForTests != null) {
|
||||
return sPromoStateForTests;
|
||||
@@ -204,8 +154,7 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
|
||||
if (!ChromeSigninController.get().isSignedIn()) {
|
||||
boolean impressionLimitReached = !SigninPromoController.hasNotReachedImpressionLimit(
|
||||
SigninAccessPoint.BOOKMARK_MANAGER);
|
||||
- if (!mSignInManager.isSignInAllowed() || impressionLimitReached
|
||||
- || wasPersonalizedSigninPromoDeclined()) {
|
||||
+ if (!mSignInManager.isSignInAllowed() || impressionLimitReached) {
|
||||
return PromoState.PROMO_NONE;
|
||||
}
|
||||
return PromoState.PROMO_SIGNIN_PERSONALIZED;
|
||||
@@ -253,7 +202,6 @@ class BookmarkPromoHeader implements AndroidSyncSettingsObserver, SignInStateObs
|
||||
}
|
||||
|
||||
private void triggerPromoUpdate() {
|
||||
- detachPersonalizePromoView();
|
||||
mPromoHeaderChangeAction.run();
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java
|
||||
@@ -186,8 +186,6 @@ class ReorderBookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkIte
|
||||
assert mDelegate != null;
|
||||
|
||||
switch (viewType) {
|
||||
- case ViewType.PERSONALIZED_SIGNIN_PROMO:
|
||||
- return mPromoHeaderManager.createPersonalizedSigninPromoHolder(parent);
|
||||
case ViewType.SYNC_PROMO:
|
||||
return mPromoHeaderManager.createSyncPromoHolder(parent);
|
||||
case ViewType.FOLDER:
|
||||
@@ -202,10 +200,7 @@ class ReorderBookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkIte
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
- if (holder.getItemViewType() == ViewType.PERSONALIZED_SIGNIN_PROMO) {
|
||||
- PersonalizedSigninPromoView view = (PersonalizedSigninPromoView) holder.itemView;
|
||||
- mPromoHeaderManager.setupPersonalizedSigninPromo(view);
|
||||
- } else if (!(holder.getItemViewType() == ViewType.SYNC_PROMO)) {
|
||||
+ if (!(holder.getItemViewType() == ViewType.SYNC_PROMO)) {
|
||||
BookmarkRow row = ((BookmarkRow) holder.itemView);
|
||||
BookmarkId id = getIdByPosition(position);
|
||||
row.setBookmarkId(id, getLocationFromPosition(position));
|
||||
@@ -229,13 +224,6 @@ class ReorderBookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkIte
|
||||
|
||||
@Override
|
||||
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.
|
||||
- }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,9 +392,6 @@ class ReorderBookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkIte
|
||||
case BookmarkPromoHeader.PromoState.PROMO_NONE:
|
||||
mPromoHeaderType = ViewType.INVALID_PROMO;
|
||||
break;
|
||||
- case BookmarkPromoHeader.PromoState.PROMO_SIGNIN_PERSONALIZED:
|
||||
- mPromoHeaderType = ViewType.PERSONALIZED_SIGNIN_PROMO;
|
||||
- break;
|
||||
case BookmarkPromoHeader.PromoState.PROMO_SYNC:
|
||||
mPromoHeaderType = ViewType.SYNC_PROMO;
|
||||
break;
|
||||
@@ -571,4 +556,4 @@ class ReorderBookmarkItemsAdapter extends DragReorderableListAdapter<BookmarkIte
|
||||
private void clearHighlight() {
|
||||
mHighlightedBookmark = null;
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
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
|
||||
@@ -73,23 +73,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;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
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
|
||||
@@ -308,7 +308,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
|
||||
}
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() {
|
||||
- return "style-src 'self' https://fonts.googleapis.com;";
|
||||
+ return "style-src 'self';";
|
||||
}
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() {
|
||||
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
|
||||
@@ -130,7 +130,7 @@ function maybeSetWebFont() {
|
||||
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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Aug 2019 08:47:04 +0200
|
||||
Subject: Disable search-ready omnibox 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
|
||||
@@ -518,7 +518,7 @@ const base::Feature kRevampedContextMenu{"RevampedContextMenu",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kSearchReadyOmniboxFeature{
|
||||
- "SearchReadyOmnibox", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "SearchReadyOmnibox", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kServiceManagerForBackgroundPrefetch{
|
||||
"ServiceManagerForBackgroundPrefetch", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
@@ -535,8 +535,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
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 2 Nov 2019 16:22:56 +0100
|
||||
Subject: Disable some signed exchange features
|
||||
|
||||
---
|
||||
content/public/common/content_features.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -508,7 +508,7 @@ const base::Feature kSignedExchangePrefetchCacheForNavigations{
|
||||
// Signed Exchange Reporting for distributors
|
||||
// https://www.chromestatus.com/features/5687904902840320
|
||||
const base::Feature kSignedExchangeReportingForDistributors{
|
||||
- "SignedExchangeReportingForDistributors", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "SignedExchangeReportingForDistributors", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
// Subresource prefetching+loading via Signed HTTP Exchange
|
||||
// https://www.chromestatus.com/features/5126805474246656
|
||||
@@ -518,7 +518,7 @@ const base::Feature kSignedExchangeSubresourcePrefetch{
|
||||
// Origin-Signed HTTP Exchanges (for WebPackage Loading)
|
||||
// https://www.chromestatus.com/features/5745285984681984
|
||||
const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
// Whether to send a ping to the inner URL upon navigation or not.
|
||||
const base::Feature kSignedHTTPExchangePingValidity{
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 11 Nov 2019 23:09:48 +0100
|
||||
Subject: Disable sync services menu entry
|
||||
|
||||
---
|
||||
chrome/android/java/res/xml/main_preferences.xml | 6 ------
|
||||
chrome/android/java/res/xml/privacy_preferences.xml | 7 -------
|
||||
2 files changed, 13 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/main_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/main_preferences.xml
|
||||
@@ -14,12 +14,6 @@
|
||||
android:key="sign_in"
|
||||
android:order="1"
|
||||
android:title="@string/sign_in_to_chrome"/>
|
||||
- <org.chromium.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.sync.SyncAndServicesPreferences"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="basics_section"
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -33,12 +33,5 @@
|
||||
android:title="@string/clear_browsing_data_title"
|
||||
android:summary="@string/clear_browsing_data_summary"
|
||||
android:fragment="org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment" />
|
||||
- <android.support.v7.preference.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"
|
||||
- android:summary="@string/privacy_sync_and_services_link"
|
||||
app:allowDividerBelow="false" />
|
||||
</PreferenceScreen>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
@@ -57,7 +57,7 @@ void CookieSettings::GetCookieSettings(
|
||||
void CookieSettings::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kBlockThirdPartyCookies, false,
|
||||
+ prefs::kBlockThirdPartyCookies, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kCookieControlsMode,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Aug 2019 08:45:43 +0200
|
||||
Subject: Disable unified consent on Android
|
||||
|
||||
---
|
||||
components/unified_consent/feature.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/unified_consent/feature.cc b/components/unified_consent/feature.cc
|
||||
--- a/components/unified_consent/feature.cc
|
||||
+++ b/components/unified_consent/feature.cc
|
||||
@@ -11,7 +11,7 @@ namespace unified_consent {
|
||||
// base::Feature definition.
|
||||
const base::Feature kUnifiedConsent {
|
||||
"UnifiedConsent",
|
||||
-#if defined(OS_CHROMEOS)
|
||||
+#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||
base::FEATURE_DISABLED_BY_DEFAULT
|
||||
#else
|
||||
base::FEATURE_ENABLED_BY_DEFAULT
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 27 Oct 2018 17:54:01 +0200
|
||||
Subject: Disable update scheduler
|
||||
|
||||
---
|
||||
.../chromium/chrome/browser/component_updater/UpdateScheduler.java | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java b/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java
|
||||
@@ -36,10 +36,7 @@ public class UpdateScheduler {
|
||||
|
||||
@CalledByNative
|
||||
/* package */ static boolean isAvailable() {
|
||||
- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||
- || GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext())
|
||||
- == ConnectionResult.SUCCESS;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/* package */ void onStartTaskBeforeNativeLoaded(TaskFinishedCallback callback) {
|
||||
@@ -112,4 +109,4 @@ public class UpdateScheduler {
|
||||
void onStartTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller);
|
||||
void onStopTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller);
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
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 | 20 ++++++--------------
|
||||
chrome/common/chrome_features.cc | 2 +-
|
||||
2 files changed, 7 insertions(+), 15 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
|
||||
@@ -190,7 +190,7 @@ void SearchPermissionsService::ResetDSEPermission(ContentSettingsType type) {
|
||||
DCHECK(dse_url.is_empty() || IsPermissionControlledByDSE(type, dse_origin));
|
||||
|
||||
if (!dse_url.is_empty())
|
||||
- SetContentSetting(dse_url, type, CONTENT_SETTING_ALLOW);
|
||||
+ SetContentSetting(dse_url, type, CONTENT_SETTING_BLOCK);
|
||||
}
|
||||
|
||||
void SearchPermissionsService::ResetDSEPermissions() {
|
||||
@@ -333,11 +333,7 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
|
||||
return;
|
||||
}
|
||||
|
||||
- // If we get to here, the DSE is not disabled by enterprise policy. If it was
|
||||
- // previously enterprise controlled, we initialize the setting to BLOCK since
|
||||
- // we don't know what the user's setting was previously.
|
||||
- bool was_enterprise_controlled =
|
||||
- pref_service_->GetBoolean(prefs::kDSEWasDisabledByPolicy);
|
||||
+ // If this line is reached then DSE is not disabled by enterprise policy.
|
||||
pref_service_->ClearPref(prefs::kDSEWasDisabledByPolicy);
|
||||
|
||||
// Initialize the pref for geolocation if it hasn't been initialized yet.
|
||||
@@ -370,10 +366,8 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
|
||||
pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated);
|
||||
} else if (dse_geolocation_setting == CONTENT_SETTING_ASK) {
|
||||
// If the user hasn't explicitly allowed or blocked geolocation for the
|
||||
- // DSE, initialize it to allowed.
|
||||
- dse_geolocation_setting = was_enterprise_controlled
|
||||
- ? CONTENT_SETTING_BLOCK
|
||||
- : CONTENT_SETTING_ALLOW;
|
||||
+ // DSE, initialize it to blocked.
|
||||
+ dse_geolocation_setting = CONTENT_SETTING_BLOCK;
|
||||
}
|
||||
|
||||
// Update the content setting with the auto-grants for the DSE.
|
||||
@@ -398,11 +392,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 blocked.
|
||||
if (dse_notifications_setting == CONTENT_SETTING_ASK) {
|
||||
- dse_notifications_setting = was_enterprise_controlled
|
||||
- ? CONTENT_SETTING_BLOCK
|
||||
- : CONTENT_SETTING_ALLOW;
|
||||
+ dse_notifications_setting = CONTENT_SETTING_BLOCK;
|
||||
}
|
||||
|
||||
// Update the content setting with the auto-grants for the DSE.
|
||||
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
|
||||
@@ -279,7 +279,7 @@ const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
|
||||
#if defined(OS_ANDROID)
|
||||
// Enable changing default downloads storage location on Android.
|
||||
const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
#endif
|
||||
|
||||
// If enabled, Drive will use FCM for its invalidations.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
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 | 73 +++++++---------------
|
||||
1 file changed, 21 insertions(+), 52 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
|
||||
@@ -32,9 +32,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) {
|
||||
@@ -67,12 +64,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
|
||||
@@ -105,50 +118,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);
|
||||
- DownloadLocationDialogBridgeJni.get().onComplete(
|
||||
- mNativeDownloadLocationDialogBridge, DownloadLocationDialogBridge.this,
|
||||
- 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
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 27 Jul 2019 11:19:53 +0200
|
||||
Subject: Do not record UMA for network errors
|
||||
|
||||
---
|
||||
services/network/network_context.cc | 17 -----------------
|
||||
1 file changed, 17 deletions(-)
|
||||
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -393,23 +393,6 @@ class NetworkContext::ContextNetworkDelegate
|
||||
started);
|
||||
}
|
||||
|
||||
- // Record network errors that HTTP requests complete with, including OK and
|
||||
- // ABORTED.
|
||||
- // TODO(mmenke): Seems like this really should be looking at HTTPS requests,
|
||||
- // too.
|
||||
- // TODO(mmenke): We should remove the main frame case from here, and move it
|
||||
- // into the consumer - the network service shouldn't know what a main frame
|
||||
- // is.
|
||||
- if (request->url().SchemeIs("http")) {
|
||||
- base::UmaHistogramSparse("Net.HttpRequestCompletionErrorCodes",
|
||||
- -net_error);
|
||||
-
|
||||
- if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) {
|
||||
- base::UmaHistogramSparse(
|
||||
- "Net.HttpRequestCompletionErrorCodes.MainFrame", -net_error);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
ForwardProxyErrors(net_error);
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
@@ -202,10 +202,10 @@ void PasswordManager::RegisterProfilePrefs(
|
||||
registry->RegisterBooleanPref(prefs::kBlacklistedCredentialsNormalized,
|
||||
false);
|
||||
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
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 30 May 2019 03:42:06 +0200
|
||||
Subject: Enable changing default downloads storage location by default
|
||||
|
||||
---
|
||||
chrome/common/chrome_features.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -279,7 +279,7 @@ const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
|
||||
#if defined(OS_ANDROID)
|
||||
// Enable changing default downloads storage location on Android.
|
||||
const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
#endif
|
||||
|
||||
// If enabled, Drive will use FCM for its invalidations.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 30 May 2019 03:44:07 +0200
|
||||
Subject: Enable download rename option 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
|
||||
@@ -421,7 +421,7 @@ const base::Feature kDownloadNotificationBadge{
|
||||
"DownloadNotificationBadge", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kDownloadRename{"DownloadRename",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kDownloadTabManagementModule{
|
||||
"DownloadTabManagementModule", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
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
|
||||
@@ -282,6 +282,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_mac && !is_ios && current_os != "aix") {
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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
|
||||
@@ -246,7 +246,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
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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
|
||||
@@ -608,11 +608,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
|
||||
@@ -634,7 +630,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
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
@@ -761,6 +761,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
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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
|
||||
@@ -251,7 +251,7 @@ public class SavePasswordsPreferences
|
||||
return;
|
||||
}
|
||||
|
||||
- displayManageAccountLink();
|
||||
+ //displayManageAccountLink();
|
||||
|
||||
PreferenceGroup passwordParent;
|
||||
if (mSearchQuery == null) {
|
||||
@@ -326,7 +326,7 @@ public class SavePasswordsPreferences
|
||||
return;
|
||||
}
|
||||
|
||||
- displayManageAccountLink();
|
||||
+ //displayManageAccountLink();
|
||||
|
||||
PreferenceCategory profileCategory = new PreferenceCategory(getStyledContext());
|
||||
profileCategory.setKey(PREF_KEY_CATEGORY_EXCEPTIONS);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:03:29 +0200
|
||||
Subject: Hide send reports checkbox
|
||||
|
||||
---
|
||||
chrome/android/java/res/layout/fre_tosanduma.xml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/fre_tosanduma.xml b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
--- a/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
+++ b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Oct 2019 10:18:39 +0100
|
||||
Subject: Increase number of autocomplete matches from 5 to 10
|
||||
|
||||
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526874703
|
||||
---
|
||||
components/omnibox/browser/autocomplete_result.cc | 7 ++-----
|
||||
components/omnibox/browser/omnibox_field_trial.cc | 3 ++-
|
||||
2 files changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc
|
||||
--- a/components/omnibox/browser/autocomplete_result.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_result.cc
|
||||
@@ -48,17 +48,14 @@ struct MatchGURLHash {
|
||||
// static
|
||||
size_t AutocompleteResult::GetMaxMatches(bool is_zero_suggest) {
|
||||
#if (defined(OS_ANDROID))
|
||||
- constexpr size_t kDefaultMaxAutocompleteMatches = 5;
|
||||
+ constexpr size_t kDefaultMaxAutocompleteMatches = 10; // was 6, this needs to be double the value of default_max_matches_per_provider from components/omnibox/browser/omnibox_field_trial.cc
|
||||
if (is_zero_suggest)
|
||||
return kDefaultMaxAutocompleteMatches;
|
||||
#else
|
||||
constexpr size_t kDefaultMaxAutocompleteMatches = 6;
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
- return base::GetFieldTrialParamByFeatureAsInt(
|
||||
- omnibox::kUIExperimentMaxAutocompleteMatches,
|
||||
- OmniboxFieldTrial::kUIMaxAutocompleteMatchesParam,
|
||||
- kDefaultMaxAutocompleteMatches);
|
||||
+ return kDefaultMaxAutocompleteMatches;
|
||||
}
|
||||
|
||||
AutocompleteResult::AutocompleteResult() {
|
||||
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
|
||||
--- a/components/omnibox/browser/omnibox_field_trial.cc
|
||||
+++ b/components/omnibox/browser/omnibox_field_trial.cc
|
||||
@@ -321,7 +321,8 @@ void OmniboxFieldTrial::GetDemotionsByType(
|
||||
|
||||
size_t OmniboxFieldTrial::GetProviderMaxMatches(
|
||||
AutocompleteProvider::Type provider) {
|
||||
- size_t default_max_matches_per_provider = 3;
|
||||
+ size_t default_max_matches_per_provider = 5; // was 3; this needs to be half the value of kDefaultMaxAutocompleteMatches from components/omnibox/browser/autocomplete_result.cc
|
||||
+ return default_max_matches_per_provider;
|
||||
|
||||
std::string param_value = base::GetFieldTrialParamValueByFeature(
|
||||
omnibox::kUIExperimentMaxAutocompleteMatches,
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,254 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:09:24 +0200
|
||||
Subject: Modify default preferences
|
||||
|
||||
Do not hide component extensions
|
||||
---
|
||||
chrome/browser/background/background_mode_manager.cc | 2 +-
|
||||
chrome/browser/chrome_content_browser_client.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.h | 2 +-
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
.../settings/reset_page/reset_profile_dialog.html | 2 +-
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
|
||||
chrome/browser/ui/navigation_correction_tab_observer.cc | 2 +-
|
||||
.../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 | 2 +-
|
||||
components/bookmarks/browser/bookmark_utils.cc | 4 ++--
|
||||
components/safe_browsing/common/safe_browsing_prefs.cc | 4 ++--
|
||||
extensions/common/extension.cc | 8 --------
|
||||
15 files changed, 19 insertions(+), 37 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
|
||||
@@ -301,7 +301,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
|
||||
@@ -1150,7 +1150,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
|
||||
void ChromeContentBrowserClient::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
|
||||
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
|
||||
registry->RegisterListPref(prefs::kEnableDeprecatedWebPlatformFeatures);
|
||||
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
|
||||
// user policy in addition to the same named ones in Local State (which are
|
||||
diff --git a/chrome/browser/net/prediction_options.cc b/chrome/browser/net/prediction_options.cc
|
||||
--- a/chrome/browser/net/prediction_options.cc
|
||||
+++ b/chrome/browser/net/prediction_options.cc
|
||||
@@ -31,7 +31,7 @@ NetworkPredictionStatus CanPrefetchAndPrerender(
|
||||
}
|
||||
return NetworkPredictionStatus::DISABLED_DUE_TO_NETWORK;
|
||||
default:
|
||||
- DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
+ //DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
return NetworkPredictionStatus::DISABLED_ALWAYS;
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/net/prediction_options.h b/chrome/browser/net/prediction_options.h
|
||||
--- a/chrome/browser/net/prediction_options.h
|
||||
+++ b/chrome/browser/net/prediction_options.h
|
||||
@@ -22,7 +22,7 @@ enum NetworkPredictionOptions {
|
||||
NETWORK_PREDICTION_ALWAYS,
|
||||
NETWORK_PREDICTION_WIFI_ONLY,
|
||||
NETWORK_PREDICTION_NEVER,
|
||||
- NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_WIFI_ONLY,
|
||||
+ NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_NEVER,
|
||||
};
|
||||
|
||||
enum class NetworkPredictionStatus {
|
||||
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
|
||||
--- a/chrome/browser/profiles/profile.cc
|
||||
+++ b/chrome/browser/profiles/profile.cc
|
||||
@@ -140,7 +140,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
|
||||
@@ -50,7 +50,7 @@
|
||||
</cr-button>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
- <cr-checkbox id="sendSettings" checked>
|
||||
+ <cr-checkbox id="sendSettings">
|
||||
$i18nRaw{resetPageFeedback}</cr-checkbox>
|
||||
</div>
|
||||
</cr-dialog>
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -66,11 +66,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
|
||||
@@ -42,7 +42,7 @@ NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {}
|
||||
// static
|
||||
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* prefs) {
|
||||
- prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled, true,
|
||||
+ prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled, 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
|
||||
@@ -107,10 +107,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
|
||||
@@ -516,10 +516,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;
|
||||
}
|
||||
@@ -803,10 +800,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1427,8 +1421,8 @@ void AutofillManager::Reset() {
|
||||
#if defined(OS_ANDROID) || defined(OS_IOS)
|
||||
autofill_assistant_.Reset();
|
||||
#endif
|
||||
- has_logged_autofill_enabled_ = false;
|
||||
- has_logged_address_suggestions_count_ = false;
|
||||
+ has_logged_autofill_enabled_ = true;
|
||||
+ has_logged_address_suggestions_count_ = true;
|
||||
did_show_suggestions_ = false;
|
||||
user_did_type_ = false;
|
||||
user_did_autofill_ = false;
|
||||
diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc
|
||||
--- a/components/autofill/core/common/autofill_prefs.cc
|
||||
+++ b/components/autofill/core/common/autofill_prefs.cc
|
||||
@@ -150,7 +150,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
prefs::kAutofillLastVersionDisusedAddressesDeleted, 0,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kAutofillCreditCardEnabled, true,
|
||||
+ prefs::kAutofillCreditCardEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterStringPref(
|
||||
prefs::kAutofillProfileValidity, "",
|
||||
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
|
||||
--- a/components/bookmarks/browser/bookmark_utils.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_utils.cc
|
||||
@@ -443,12 +443,12 @@ bool DoesBookmarkContainWords(const base::string16& title,
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowBookmarkBar,
|
||||
- false,
|
||||
+ true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, true);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowAppsShortcutInBookmarkBar,
|
||||
- true,
|
||||
+ false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowManagedBookmarksInBookmarkBar,
|
||||
diff --git a/components/safe_browsing/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
|
||||
@@ -167,9 +167,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
|
||||
@@ -365,14 +365,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
|
||||
|
||||
+732
@@ -0,0 +1,732 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 30 Mar 2018 10:09:03 +0200
|
||||
Subject: Multiple fingerprinting mitigations for canvas, text and client
|
||||
rectangles
|
||||
|
||||
1. getClientRects, getBoundingClientRect, measureText: add fingerprinting mitigation
|
||||
|
||||
Scale the result of Range::getClientRects, Element::getBoundingClientRect and
|
||||
Canvas::measureText by a random +/-3/1000000th of the original value for each
|
||||
float in the returned Rect/Quad.
|
||||
|
||||
It contains improvements from ungoogled-chromium which add two flags:
|
||||
1. --fingerprinting-client-rects-noise to enable fingerprinting deception for Range::getClientRects and Element::getBoundingClientRect
|
||||
2. --fingerprinting-canvas-measuretext-noise to enable fingerprinting deception for Canvas::measureText
|
||||
|
||||
2. Canvas: fingerprinting mitigations for image data and webGL
|
||||
|
||||
Disable webGL renderer info and modify the color data returned by ToBlob,
|
||||
ToDataURL and getImageData so that it will contain randomly manipulated
|
||||
pixels (maximum 20) that slightly change the color of the R,G,B components
|
||||
without a visible effect.
|
||||
|
||||
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
|
||||
approach to change color components.
|
||||
|
||||
Added flag --fingerprinting-canvas-image-data-noise to disable Canvas image data fingerprinting deception
|
||||
---
|
||||
chrome/browser/BUILD.gn | 1 +
|
||||
chrome/browser/about_flags.cc | 13 ++
|
||||
content/browser/BUILD.gn | 1 +
|
||||
.../renderer_host/render_process_host_impl.cc | 4 +
|
||||
content/child/BUILD.gn | 1 +
|
||||
content/child/runtime_features.cc | 8 ++
|
||||
.../blink/public/platform/web_runtime_features.h | 3 +
|
||||
third_party/blink/renderer/core/dom/document.cc | 18 +++
|
||||
third_party/blink/renderer/core/dom/document.h | 7 +
|
||||
third_party/blink/renderer/core/dom/element.cc | 8 ++
|
||||
third_party/blink/renderer/core/dom/range.cc | 12 +-
|
||||
.../renderer/core/html/canvas/text_metrics.cc | 18 +++
|
||||
.../blink/renderer/core/html/canvas/text_metrics.h | 2 +
|
||||
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 8 +-
|
||||
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
|
||||
third_party/blink/renderer/platform/BUILD.gn | 5 +-
|
||||
.../platform/exported/web_runtime_features.cc | 12 ++
|
||||
.../platform/graphics/image_data_buffer.cc | 7 +
|
||||
.../platform/graphics/static_bitmap_image.cc | 159 +++++++++++++++++++++
|
||||
.../platform/graphics/static_bitmap_image.h | 2 +
|
||||
.../platform/runtime_enabled_features.json5 | 9 ++
|
||||
third_party/ungoogled/BUILD.gn | 10 ++
|
||||
third_party/ungoogled/ungoogled_switches.cc | 18 +++
|
||||
third_party/ungoogled/ungoogled_switches.h | 18 +++
|
||||
24 files changed, 343 insertions(+), 5 deletions(-)
|
||||
create mode 100644 third_party/ungoogled/BUILD.gn
|
||||
create mode 100644 third_party/ungoogled/ungoogled_switches.cc
|
||||
create mode 100644 third_party/ungoogled/ungoogled_switches.h
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -2200,6 +2200,7 @@ jumbo_split_static_library("browser") {
|
||||
"//third_party/metrics_proto",
|
||||
"//third_party/re2",
|
||||
"//third_party/smhasher:cityhash",
|
||||
+ "//third_party/ungoogled:switches",
|
||||
"//third_party/webrtc_overrides",
|
||||
"//third_party/webrtc_overrides:init_webrtc",
|
||||
"//third_party/widevine/cdm:buildflags",
|
||||
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
|
||||
@@ -147,6 +147,7 @@
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
|
||||
#include "third_party/leveldatabase/leveldb_features.h"
|
||||
+#include "third_party/ungoogled/ungoogled_switches.h"
|
||||
#include "ui/accessibility/accessibility_switches.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
@@ -1405,12 +1406,24 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
{"enable-webrtc-srtp-aes-gcm", flag_descriptions::kWebrtcSrtpAesGcmName,
|
||||
flag_descriptions::kWebrtcSrtpAesGcmDescription, kOsAll,
|
||||
SINGLE_VALUE_TYPE(switches::kEnableWebRtcSrtpAesGcm)},
|
||||
+ {"fingerprinting-canvas-image-data-noise",
|
||||
+ "Disable Canvas image data fingerprint deception",
|
||||
+ "Slightly modifies at most 20 pixels in Canvas image data extracted via JS APIs",
|
||||
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingCanvasImageDataNoise)},
|
||||
{"enable-webrtc-stun-origin", flag_descriptions::kWebrtcStunOriginName,
|
||||
flag_descriptions::kWebrtcStunOriginDescription, kOsAll,
|
||||
SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin)},
|
||||
{"enable-webrtc-hybrid-agc", flag_descriptions::kWebrtcHybridAgcName,
|
||||
flag_descriptions::kWebrtcHybridAgcDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kWebRtcHybridAgc)},
|
||||
+ {"fingerprinting-client-rects-noise",
|
||||
+ "Disable get*ClientRects() fingerprint deception",
|
||||
+ "Scale the output values of Range::getClientRects() and Element::getBoundingClientRect() with a randomly selected factor in the range -0.0003% to 0.0003%, which are recomputed on every document initialization.",
|
||||
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingClientRectsNoise)},
|
||||
+ {"fingerprinting-canvas-measuretext-noise",
|
||||
+ "Disable Canvas::measureText() fingerprint deception",
|
||||
+ "Scale the output values of Canvas::measureText() with a randomly selected factor in the range -0.0003% to 0.0003%, which are recomputed on every document initialization.",
|
||||
+ kOsAll, SINGLE_DISABLE_VALUE_TYPE(switches::kFingerprintingCanvasMeasureTextNoise)},
|
||||
{"enable-webrtc-new-encode-cpu-load-estimator",
|
||||
flag_descriptions::kWebrtcNewEncodeCpuLoadEstimatorName,
|
||||
flag_descriptions::kWebrtcNewEncodeCpuLoadEstimatorDescription, kOsAll,
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -206,6 +206,7 @@ jumbo_source_set("browser") {
|
||||
"//third_party/libyuv",
|
||||
"//third_party/re2",
|
||||
"//third_party/sqlite",
|
||||
+ "//third_party/ungoogled:switches",
|
||||
"//third_party/webrtc/modules/desktop_capture:primitives",
|
||||
"//third_party/webrtc/rtc_base:rtc_base",
|
||||
"//third_party/zlib",
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -213,6 +213,7 @@
|
||||
#include "third_party/blink/public/common/page/launching_process_state.h"
|
||||
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
|
||||
#include "third_party/blink/public/public_buildflags.h"
|
||||
+#include "third_party/ungoogled/ungoogled_switches.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/accessibility/accessibility_switches.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
@@ -2970,6 +2971,9 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
switches::kEnableWebGLSwapChain,
|
||||
switches::kEnableWebVR,
|
||||
switches::kFileUrlPathAlias,
|
||||
+ switches::kFingerprintingClientRectsNoise,
|
||||
+ switches::kFingerprintingCanvasMeasureTextNoise,
|
||||
+ switches::kFingerprintingCanvasImageDataNoise,
|
||||
switches::kForceDisplayColorProfile,
|
||||
switches::kForceDeviceScaleFactor,
|
||||
switches::kForceGpuMemAvailableMb,
|
||||
diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn
|
||||
--- a/content/child/BUILD.gn
|
||||
+++ b/content/child/BUILD.gn
|
||||
@@ -120,6 +120,7 @@ target(link_target_type, "child") {
|
||||
"//third_party/blink/public:scaled_resources",
|
||||
"//third_party/blink/public/common",
|
||||
"//third_party/ced",
|
||||
+ "//third_party/ungoogled:switches",
|
||||
"//third_party/zlib/google:compression_utils",
|
||||
"//ui/base",
|
||||
"//ui/events/blink",
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/platform/web_runtime_features.h"
|
||||
+#include "third_party/ungoogled/ungoogled_switches.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/events/blink/blink_features.h"
|
||||
#include "ui/gfx/switches.h"
|
||||
@@ -461,6 +462,13 @@ void SetIndividualRuntimeFeatures(
|
||||
WebRuntimeFeatures::EnableAllowSyncXHRInPageDismissal(true);
|
||||
}
|
||||
|
||||
+ WebRuntimeFeatures::EnableFingerprintingClientRectsNoise(
|
||||
+ !command_line.HasSwitch(switches::kFingerprintingClientRectsNoise));
|
||||
+ WebRuntimeFeatures::EnableFingerprintingCanvasMeasureTextNoise(
|
||||
+ !command_line.HasSwitch(switches::kFingerprintingCanvasMeasureTextNoise));
|
||||
+ WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(
|
||||
+ !command_line.HasSwitch(switches::kFingerprintingCanvasImageDataNoise));
|
||||
+
|
||||
WebRuntimeFeatures::EnableAutoplayIgnoresWebAudio(
|
||||
base::FeatureList::IsEnabled(media::kAutoplayIgnoreWebAudio));
|
||||
|
||||
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
|
||||
@@ -228,6 +228,9 @@ class WebRuntimeFeatures {
|
||||
BLINK_PLATFORM_EXPORT static void EnableMergeBlockingNonBlockingPools(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableGetDisplayMedia(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableAllowSyncXHRInPageDismissal(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingClientRectsNoise(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingCanvasMeasureTextNoise(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableFingerprintingCanvasImageDataNoise(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableShadowDOMV0(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableCustomElementsV0(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableHTMLImports(bool);
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
+#include "base/rand_util.h"
|
||||
#include "base/time/time.h"
|
||||
#include "cc/input/overscroll_behavior.h"
|
||||
#include "cc/input/scroll_snap_data.h"
|
||||
@@ -1199,6 +1200,15 @@ Document::Document(const DocumentInit& initializer,
|
||||
#ifndef NDEBUG
|
||||
liveDocumentSet().insert(this);
|
||||
#endif
|
||||
+
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ // Precompute -0.0003% to 0.0003% noise factor for get*ClientRect*() fingerprinting
|
||||
+ noise_factor_x_ = 1 + (base::RandDouble() - 0.5) * 0.000003;
|
||||
+ noise_factor_y_ = 1 + (base::RandDouble() - 0.5) * 0.000003;
|
||||
+ } else {
|
||||
+ noise_factor_x_ = 1;
|
||||
+ noise_factor_y_ = 1;
|
||||
+ }
|
||||
}
|
||||
|
||||
Document::~Document() {
|
||||
@@ -1227,6 +1237,14 @@ Range* Document::CreateRangeAdjustedToTreeScope(const TreeScope& tree_scope,
|
||||
Position::BeforeNode(*shadow_host));
|
||||
}
|
||||
|
||||
+double Document::GetNoiseFactorX() {
|
||||
+ return noise_factor_x_;
|
||||
+}
|
||||
+
|
||||
+double Document::GetNoiseFactorY() {
|
||||
+ return noise_factor_y_;
|
||||
+}
|
||||
+
|
||||
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
|
||||
@@ -408,6 +408,10 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
|
||||
}
|
||||
|
||||
+ // Values for get*ClientRect fingerprint deception
|
||||
+ double GetNoiseFactorX();
|
||||
+ double GetNoiseFactorY();
|
||||
+
|
||||
String visibilityState() const;
|
||||
bool IsPageVisible() const;
|
||||
bool hidden() const;
|
||||
@@ -1905,6 +1909,9 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
base::ElapsedTimer start_time_;
|
||||
|
||||
+ double noise_factor_x_;
|
||||
+ double noise_factor_y_;
|
||||
+
|
||||
Member<ScriptRunner> script_runner_;
|
||||
|
||||
HeapVector<Member<ScriptElementBase>> current_script_stack_;
|
||||
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc
|
||||
--- a/third_party/blink/renderer/core/dom/element.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/element.cc
|
||||
@@ -1630,6 +1630,11 @@ DOMRectList* Element::getClientRects() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
|
||||
quads, *element_layout_object);
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
|
||||
+ }
|
||||
+ }
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
@@ -1647,6 +1652,9 @@ DOMRect* Element::getBoundingClientRect() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ result.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
|
||||
+ }
|
||||
return DOMRect::FromFloatRect(result);
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/range.cc b/third_party/blink/renderer/core/dom/range.cc
|
||||
--- a/third_party/blink/renderer/core/dom/range.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/range.cc
|
||||
@@ -1631,11 +1631,21 @@ DOMRectList* Range::getClientRects() const {
|
||||
Vector<FloatQuad> quads;
|
||||
GetBorderAndTextQuads(quads);
|
||||
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(owner_document_->GetNoiseFactorX(), owner_document_->GetNoiseFactorY());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
DOMRect* Range::getBoundingClientRect() const {
|
||||
- return DOMRect::FromFloatRect(BoundingRect());
|
||||
+ auto rect = BoundingRect();
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ rect.Scale(owner_document_->GetNoiseFactorX(), owner_document_->GetNoiseFactorY());
|
||||
+ }
|
||||
+ 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
|
||||
@@ -54,6 +54,24 @@ TextMetrics::TextMetrics(const Font& font,
|
||||
Update(font, direction, baseline, align, text);
|
||||
}
|
||||
|
||||
+void TextMetrics::Shuffle(const double factor) {
|
||||
+ // x-direction
|
||||
+ width_ *= factor;
|
||||
+ actual_bounding_box_left_ *= factor;
|
||||
+ actual_bounding_box_right_ *= factor;
|
||||
+
|
||||
+ // y-direction
|
||||
+ font_bounding_box_ascent_ *= factor;
|
||||
+ font_bounding_box_descent_ *= factor;
|
||||
+ actual_bounding_box_ascent_ *= factor;
|
||||
+ actual_bounding_box_descent_ *= factor;
|
||||
+ em_height_ascent_ *= factor;
|
||||
+ em_height_descent_ *= factor;
|
||||
+ baselines_->setAlphabetic(baselines_->alphabetic() * factor);
|
||||
+ baselines_->setHanging(baselines_->hanging() * factor);
|
||||
+ baselines_->setIdeographic(baselines_->ideographic() * factor);
|
||||
+}
|
||||
+
|
||||
void TextMetrics::Update(const Font& font,
|
||||
const TextDirection& direction,
|
||||
const TextBaseline& baseline,
|
||||
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.h b/third_party/blink/renderer/core/html/canvas/text_metrics.h
|
||||
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.h
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.h
|
||||
@@ -64,6 +64,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
|
||||
|
||||
void Trace(Visitor*) 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
|
||||
@@ -811,9 +811,15 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
else
|
||||
direction = ToTextDirection(GetState().GetDirection(), canvas());
|
||||
|
||||
- return MakeGarbageCollected<TextMetrics>(font, direction,
|
||||
+ TextMetrics* text_metrics = MakeGarbageCollected<TextMetrics>(font, direction,
|
||||
GetState().GetTextBaseline(),
|
||||
GetState().GetTextAlign(), text);
|
||||
+
|
||||
+ // Scale text metrics if enabled
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingCanvasMeasureTextNoiseEnabled()) {
|
||||
+ text_metrics->Shuffle(canvas()->GetDocument().GetNoiseFactorX());
|
||||
+ }
|
||||
+ return text_metrics;
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::DrawTextInternal(
|
||||
diff --git a/third_party/blink/renderer/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
|
||||
@@ -1417,7 +1417,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",
|
||||
@@ -1450,6 +1452,7 @@ jumbo_component("platform") {
|
||||
"//third_party/ced",
|
||||
"//third_party/emoji-segmenter",
|
||||
"//third_party/icu",
|
||||
+ "//third_party/ungoogled:switches",
|
||||
"//third_party/webrtc/api:libjingle_logging_api",
|
||||
"//third_party/webrtc/api/audio_codecs/L16:audio_decoder_L16",
|
||||
"//third_party/webrtc/api/audio_codecs/L16:audio_encoder_L16",
|
||||
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
|
||||
@@ -722,4 +722,16 @@ void WebRuntimeFeatures::EnableAcceleratedSmallCanvases(bool enable) {
|
||||
RuntimeEnabledFeatures::SetAcceleratedSmallCanvasesEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableFingerprintingClientRectsNoise(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetFingerprintingClientRectsNoiseEnabled(enable);
|
||||
+}
|
||||
+
|
||||
+void WebRuntimeFeatures::EnableFingerprintingCanvasMeasureTextNoise(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetFingerprintingCanvasMeasureTextNoiseEnabled(enable);
|
||||
+}
|
||||
+
|
||||
+void WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetFingerprintingCanvasImageDataNoiseEnabled(enable);
|
||||
+}
|
||||
+
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
--- a/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/image_data_buffer.cc
|
||||
@@ -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,11 @@ bool ImageDataBuffer::EncodeImageInternal(const ImageEncodingMimeType mime_type,
|
||||
const SkPixmap& pixmap) const {
|
||||
DCHECK(is_valid_);
|
||||
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
|
||||
+ // shuffle subchannel color data within the pixmap
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(pixmap_.writable_addr(), pixmap_.info(), 0, 0);
|
||||
+ }
|
||||
+
|
||||
if (mime_type == kMimeTypeJpeg) {
|
||||
SkJpegEncoder::Options options;
|
||||
options.fQuality = ImageEncoder::ComputeJpegQuality(quality);
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/logging.h"
|
||||
#include "base/numerics/checked_math.h"
|
||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
|
||||
@@ -11,12 +13,14 @@
|
||||
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
|
||||
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrContext.h"
|
||||
+#include "third_party/skia/include/private/SkColorData.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -154,10 +158,165 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
|
||||
DCHECK(read_pixels_successful ||
|
||||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
|
||||
rect.X(), rect.Y(), info.width(), info.height())));
|
||||
+
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
|
||||
+ 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
|
||||
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
|
||||
@@ -677,6 +677,15 @@
|
||||
name: "FileSystem",
|
||||
status: "stable",
|
||||
},
|
||||
+ {
|
||||
+ name: "FingerprintingClientRectsNoise",
|
||||
+ },
|
||||
+ {
|
||||
+ name: "FingerprintingCanvasMeasureTextNoise",
|
||||
+ },
|
||||
+ {
|
||||
+ name: "FingerprintingCanvasImageDataNoise",
|
||||
+ },
|
||||
// FirstContentfulPaintPlusPlus enables the Largest Text Paint metric, Last
|
||||
// Text Paint metric, Largest Image Paint metric and Last Image Paint
|
||||
// metric. See also: http://bit.ly/fcp_plus_plus
|
||||
diff --git a/third_party/ungoogled/BUILD.gn b/third_party/ungoogled/BUILD.gn
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/ungoogled/BUILD.gn
|
||||
@@ -0,0 +1,10 @@
|
||||
+# Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+# Use of this source code is governed by a BSD-style license that can be
|
||||
+# found in the LICENSE file.
|
||||
+
|
||||
+component("switches") {
|
||||
+ sources = [
|
||||
+ "ungoogled_switches.h",
|
||||
+ "ungoogled_switches.cc",
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/third_party/ungoogled/ungoogled_switches.cc b/third_party/ungoogled/ungoogled_switches.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/ungoogled/ungoogled_switches.cc
|
||||
@@ -0,0 +1,18 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "third_party/ungoogled/ungoogled_switches.h"
|
||||
+
|
||||
+namespace switches {
|
||||
+
|
||||
+// Enable fingerprinting deception for getClientRects and getBoundingClientRect
|
||||
+const char kFingerprintingClientRectsNoise[] = "fingerprinting-client-rects-noise";
|
||||
+
|
||||
+// Enable fingerprinting deception for measureText
|
||||
+const char kFingerprintingCanvasMeasureTextNoise[] = "fingerprinting-canvas-measuretext-noise";
|
||||
+
|
||||
+// Enable fingerprinting deception for Canvas image data
|
||||
+const char kFingerprintingCanvasImageDataNoise[] = "fingerprinting-canvas-image-data-noise";
|
||||
+
|
||||
+} // namespace switches
|
||||
diff --git a/third_party/ungoogled/ungoogled_switches.h b/third_party/ungoogled/ungoogled_switches.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/ungoogled/ungoogled_switches.h
|
||||
@@ -0,0 +1,18 @@
|
||||
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+// Defines all the fingerprinting command-line switches.
|
||||
+
|
||||
+#ifndef THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
|
||||
+#define THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
|
||||
+
|
||||
+namespace switches {
|
||||
+
|
||||
+extern const char kFingerprintingClientRectsNoise[];
|
||||
+extern const char kFingerprintingCanvasMeasureTextNoise[];
|
||||
+extern const char kFingerprintingCanvasImageDataNoise[];
|
||||
+
|
||||
+}
|
||||
+
|
||||
+#endif // THIRD_PARTY_UNGOOGLED_FINGERPRINTING_SWITCHES_H_
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
@@ -283,6 +283,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
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
@@ -125,6 +125,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
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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
|
||||
@@ -255,6 +255,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
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 11 Jan 2018 13:27:34 +0200
|
||||
Subject: Open YouTube links in Bromite
|
||||
|
||||
---
|
||||
.../chrome/browser/externalnav/ExternalNavigationHandler.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
@@ -402,6 +402,13 @@ public class ExternalNavigationHandler {
|
||||
}
|
||||
|
||||
// TODO(changwan): check if we need to handle URL even when external intent is off.
|
||||
+ // 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;
|
||||
+ }
|
||||
+
|
||||
if (CommandLine.getInstance().hasSwitch(
|
||||
ChromeSwitches.DISABLE_EXTERNAL_INTENT_REQUESTS)) {
|
||||
Log.w(TAG, "External intent handling is disabled by a command-line flag.");
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 2 Apr 2018 11:36:02 +0200
|
||||
Subject: Punt the Widevine version string
|
||||
|
||||
Originally from http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.wily.beta/view/head:/debian/patches/fix_building_widevinecdm_with_chromium.patch
|
||||
---
|
||||
chrome/common/chrome_content_client.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
|
||||
--- a/chrome/common/chrome_content_client.cc
|
||||
+++ b/chrome/common/chrome_content_client.cc
|
||||
@@ -517,7 +517,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
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 3 Nov 2019 08:22:29 +0100
|
||||
Subject: Remove SMS integration
|
||||
|
||||
---
|
||||
content/public/android/BUILD.gn | 2 -
|
||||
.../org/chromium/content/browser/sms/Wrappers.java | 74 ----------------------
|
||||
2 files changed, 76 deletions(-)
|
||||
delete mode 100644 content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
||||
|
||||
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
|
||||
--- a/content/public/android/BUILD.gn
|
||||
+++ b/content/public/android/BUILD.gn
|
||||
@@ -231,8 +231,6 @@ android_library("content_java") {
|
||||
"java/src/org/chromium/content/browser/selection/SmartSelectionClient.java",
|
||||
"java/src/org/chromium/content/browser/selection/SmartSelectionMetricsLogger.java",
|
||||
"java/src/org/chromium/content/browser/selection/SmartSelectionProvider.java",
|
||||
- "java/src/org/chromium/content/browser/sms/SmsReceiver.java",
|
||||
- "java/src/org/chromium/content/browser/sms/Wrappers.java",
|
||||
"java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java",
|
||||
"java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java",
|
||||
"java/src/org/chromium/content/common/ContentSwitchUtils.java",
|
||||
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
||||
deleted file mode 100644
|
||||
--- a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
|
||||
+++ /dev/null
|
||||
@@ -1,74 +0,0 @@
|
||||
-// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||
-// Use of this source code is governed by a BSD-style license that can be
|
||||
-// found in the LICENSE file.
|
||||
-
|
||||
-package org.chromium.content.browser.sms;
|
||||
-
|
||||
-import android.content.BroadcastReceiver;
|
||||
-import android.content.Context;
|
||||
-import android.content.ContextWrapper;
|
||||
-import android.content.Intent;
|
||||
-import android.content.IntentFilter;
|
||||
-
|
||||
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
|
||||
-import com.google.android.gms.tasks.Task;
|
||||
-
|
||||
-class Wrappers {
|
||||
- // Prevent instantiation.
|
||||
- private Wrappers() {}
|
||||
-
|
||||
- /**
|
||||
- * Wraps com.google.android.gms.auth.api.phone.SmsRetrieverClient.
|
||||
- */
|
||||
- static class SmsRetrieverClientWrapper {
|
||||
- private final SmsRetrieverClient mSmsRetrieverClient;
|
||||
- private SmsReceiverContext mContext;
|
||||
-
|
||||
- public SmsRetrieverClientWrapper(SmsRetrieverClient smsRetrieverClient) {
|
||||
- mSmsRetrieverClient = smsRetrieverClient;
|
||||
- }
|
||||
-
|
||||
- public void setContext(SmsReceiverContext context) {
|
||||
- mContext = context;
|
||||
- }
|
||||
-
|
||||
- public SmsReceiverContext getContext() {
|
||||
- return mContext;
|
||||
- }
|
||||
-
|
||||
- public Task<Void> startSmsRetriever() {
|
||||
- return mSmsRetrieverClient.startSmsRetriever();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Extends android.content.ContextWrapper to store and retrieve the
|
||||
- * registered BroadcastReceiver.
|
||||
- */
|
||||
- static class SmsReceiverContext extends ContextWrapper {
|
||||
- private BroadcastReceiver mReceiver;
|
||||
-
|
||||
- public SmsReceiverContext(Context context) {
|
||||
- super(context);
|
||||
- }
|
||||
-
|
||||
- public BroadcastReceiver getRegisteredReceiver() {
|
||||
- return mReceiver;
|
||||
- }
|
||||
-
|
||||
- // ---------------------------------------------------------------------
|
||||
- // Context overrides:
|
||||
-
|
||||
- @Override
|
||||
- public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
||||
- mReceiver = receiver;
|
||||
- return super.registerReceiver(receiver, filter);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void unregisterReceiver(BroadcastReceiver receiver) {
|
||||
- mReceiver = null;
|
||||
- super.unregisterReceiver(receiver);
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Wed, 22 Mar 2017 19:10:30 -0400
|
||||
Subject: Remove background sync and translate menu options
|
||||
|
||||
---
|
||||
chrome/android/java/res/xml/site_settings_preferences.xml | 4 ----
|
||||
.../chrome/browser/preferences/website/SiteSettingsPreferences.java | 3 +--
|
||||
2 files changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
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
|
||||
@@ -49,10 +49,6 @@
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
android:key="ads" />
|
||||
- <!-- Background sync -->
|
||||
- <org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
- android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
- android:key="background_sync" />
|
||||
<!-- Automatic Downloads -->
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
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
|
||||
@@ -73,7 +73,7 @@ public class SiteSettingsPreferences
|
||||
// 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));
|
||||
@@ -111,7 +111,6 @@ public class SiteSettingsPreferences
|
||||
websitePrefs.add(Type.ADS);
|
||||
}
|
||||
websitePrefs.add(Type.AUTOMATIC_DOWNLOADS);
|
||||
- websitePrefs.add(Type.BACKGROUND_SYNC);
|
||||
CommandLine commandLine = CommandLine.getInstance();
|
||||
if (commandLine.hasSwitch(ContentSwitches.ENABLE_WEB_BLUETOOTH_SCANNING)) {
|
||||
websitePrefs.add(Type.BLUETOOTH_SCANNING);
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 09:29:52 +0100
|
||||
Subject: Remove dependency on com.google.android.gcm
|
||||
|
||||
---
|
||||
third_party/android_sdk/BUILD.gn | 3 --
|
||||
.../external/client/android2/AndroidManifest.xml | 35 ----------------------
|
||||
.../channel/AndroidMessageReceiverService.java | 17 -----------
|
||||
.../channel/AndroidMessageSenderService.java | 3 +-
|
||||
4 files changed, 1 insertion(+), 57 deletions(-)
|
||||
|
||||
diff --git a/third_party/android_sdk/BUILD.gn b/third_party/android_sdk/BUILD.gn
|
||||
--- a/third_party/android_sdk/BUILD.gn
|
||||
+++ b/third_party/android_sdk/BUILD.gn
|
||||
@@ -67,7 +67,4 @@ if (enable_java_templates) {
|
||||
testonly = true
|
||||
java_files = [ "//third_party/android_sdk/public/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java" ]
|
||||
}
|
||||
- android_java_prebuilt("android_gcm_java") {
|
||||
- jar_path = "//third_party/android_sdk/public/extras/google/gcm/gcm-client/dist/gcm.jar"
|
||||
- }
|
||||
}
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
|
||||
@@ -4,10 +4,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.ipc.invalidation.client.android2">
|
||||
|
||||
- <!-- App receives GCM messages. -->
|
||||
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
- <!-- GCM connects to Google Services. -->
|
||||
- <uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Keeps the processor from sleeping when a message is received. -->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
@@ -16,40 +12,9 @@
|
||||
<service android:exported="false"
|
||||
android:name="com.google.ipc.invalidation.ticl.android2.TiclService"/>
|
||||
|
||||
- <!-- Ticl sender. -->
|
||||
- <service android:exported="false"
|
||||
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"/>
|
||||
-
|
||||
<!-- Receiver for scheduler alarms. -->
|
||||
<receiver android:exported="false"
|
||||
android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"/>
|
||||
|
||||
- <!-- GCM Broadcast Receiver -->
|
||||
- <receiver android:exported="true"
|
||||
- android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener$GCMReceiver"
|
||||
- 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="com.google.ipc.invalidation.ticl.android2" />
|
||||
- </intent-filter>
|
||||
- </receiver>
|
||||
-
|
||||
- <!-- GCM multiplexer -->
|
||||
- <service android:exported="false"
|
||||
- android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener">
|
||||
- <meta-data android:name="sender_ids" android:value="ipc.invalidation@gmail.com"/>
|
||||
- </service>
|
||||
-
|
||||
- <!-- Invalidation service multiplexed GCM receiver -->
|
||||
- <service android:exported="false"
|
||||
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService"
|
||||
- android:enabled="true"/>
|
||||
- <receiver android:exported="false"
|
||||
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService$Receiver">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.ipc.invalidation.gcmmplex.EVENT" />
|
||||
- </intent-filter>
|
||||
- </receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.ipc.invalidation.ticl.android2.channel;
|
||||
|
||||
-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.external.client.contrib.MultiplexingGcmListener;
|
||||
@@ -126,20 +125,4 @@ public class AndroidMessageReceiverService extends MultiplexingGcmListener.Abstr
|
||||
// now, there is nothing to do.
|
||||
}
|
||||
|
||||
- /**
|
||||
- * Initializes GCM as a convenience method for tests. In production, applications should handle
|
||||
- * this.
|
||||
- */
|
||||
- public static void initializeGcmForTest(Context context, Logger logger, String senderId) {
|
||||
- // Initialize GCM.
|
||||
- GCMRegistrar.checkDevice(context);
|
||||
- GCMRegistrar.checkManifest(context);
|
||||
- String regId = GCMRegistrar.getRegistrationId(context);
|
||||
- if (regId.isEmpty()) {
|
||||
- logger.info("Not registered with GCM; registering");
|
||||
- GCMRegistrar.register(context, senderId);
|
||||
- } else {
|
||||
- logger.fine("Already registered with GCM: %s", regId);
|
||||
- }
|
||||
- }
|
||||
}
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.ipc.invalidation.ticl.android2.channel;
|
||||
|
||||
-import com.google.android.gcm.GCMRegistrar;
|
||||
import com.google.ipc.invalidation.common.GcmSharedConstants;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
@@ -395,7 +394,7 @@ public class AndroidMessageSenderService extends IntentService {
|
||||
// No client key when using old style registration id.
|
||||
clientKey = "";
|
||||
try {
|
||||
- registrationId = GCMRegistrar.getRegistrationId(context);
|
||||
+ registrationId = null;
|
||||
} catch (RuntimeException exception) {
|
||||
// GCMRegistrar#getRegistrationId occasionally throws a runtime exception. Catching the
|
||||
// exception rather than crashing.
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 09:22:31 +0100
|
||||
Subject: Remove dependency on com.google.android.gms.auth
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 1 -
|
||||
components/signin/core/browser/android/BUILD.gn | 1 -
|
||||
.../components/signin/AccountIdProvider.java | 10 +----
|
||||
.../signin/SystemAccountManagerDelegate.java | 15 +-------
|
||||
content/public/android/BUILD.gn | 1 -
|
||||
content/test/BUILD.gn | 1 -
|
||||
third_party/android_deps/BUILD.gn | 44 ----------------------
|
||||
third_party/robolectric/BUILD.gn | 1 -
|
||||
8 files changed, 2 insertions(+), 72 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -267,7 +267,6 @@ android_library("chrome_java") {
|
||||
":thumbnail_cache_entry_proto_java",
|
||||
":update_proto_java",
|
||||
":usage_stats_proto_java",
|
||||
- "$google_play_services_package:google_play_services_auth_base_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
|
||||
--- a/components/signin/core/browser/android/BUILD.gn
|
||||
+++ b/components/signin/core/browser/android/BUILD.gn
|
||||
@@ -15,7 +15,6 @@ generate_jni("jni_headers") {
|
||||
|
||||
android_library("java") {
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_auth_base_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
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,9 +4,6 @@
|
||||
|
||||
package org.chromium.components.signin;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.StrictModeContext;
|
||||
@@ -47,12 +44,7 @@ public class AccountIdProvider {
|
||||
* Google Play services is available.
|
||||
*/
|
||||
public boolean canBeUsed() {
|
||||
- // TODO(http://crbug.com/577190): Remove StrictMode override.
|
||||
- try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
|
||||
- int resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext());
|
||||
- return resultCode == ConnectionResult.SUCCESS;
|
||||
- }
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
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.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ApiCompatibilityUtils;
|
||||
import org.chromium.base.Callback;
|
||||
import org.chromium.base.ContextUtils;
|
||||
@@ -82,17 +79,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
}
|
||||
|
||||
protected void checkCanUseGooglePlayServices() throws AccountManagerDelegateException {
|
||||
- Context context = ContextUtils.getApplicationContext();
|
||||
- final int resultCode =
|
||||
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
|
||||
- if (resultCode == ConnectionResult.SUCCESS) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- throw new GmsAvailabilityException(
|
||||
- String.format("Can't use Google Play Services: %s",
|
||||
- GoogleApiAvailability.getInstance().getErrorString(resultCode)),
|
||||
- resultCode);
|
||||
+ throw new GmsAvailabilityException("Can't use Google Play Services", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
|
||||
--- a/content/public/android/BUILD.gn
|
||||
+++ b/content/public/android/BUILD.gn
|
||||
@@ -52,7 +52,6 @@ action("generate_sandboxed_service_srcjar") {
|
||||
android_library("content_java") {
|
||||
deps = [
|
||||
":content_java_resources",
|
||||
- "$google_play_services_package:google_play_services_auth_api_phone_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -2442,7 +2442,6 @@ if (is_android) {
|
||||
testonly = true
|
||||
java_files = content_java_sources_needing_jni
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_auth_api_phone_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -772,50 +772,6 @@ android_aar_prebuilt("com_android_support_viewpager_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_auth_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_auth/play-services-auth-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_auth/com_google_android_gms_play_services_auth.info"
|
||||
- deps = [
|
||||
- ":google_play_services_auth_api_phone_java",
|
||||
- ":google_play_services_auth_base_java",
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_auth_api_phone_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_auth_api_phone/play-services-auth-api-phone-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_auth_api_phone/com_google_android_gms_play_services_auth_api_phone.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_auth_base_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_auth_base/play-services-auth-base-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_auth_base/com_google_android_gms_play_services_auth_base.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("google_play_services_base_java") {
|
||||
aar_path = "libs/com_google_android_gms_play_services_base/play-services-base-15.0.1.aar"
|
||||
info_path = "libs/com_google_android_gms_play_services_base/com_google_android_gms_play_services_base.info"
|
||||
diff --git a/third_party/robolectric/BUILD.gn b/third_party/robolectric/BUILD.gn
|
||||
--- a/third_party/robolectric/BUILD.gn
|
||||
+++ b/third_party/robolectric/BUILD.gn
|
||||
@@ -938,7 +938,6 @@ java_library("shadows_play_services_java") {
|
||||
":robolectric_shadowapi_java",
|
||||
":robolectric_utils_java",
|
||||
":shadows_core_java",
|
||||
- "$google_play_services_package:google_play_services_auth_base_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"//third_party/android_deps:android_support_v4_java",
|
||||
--
|
||||
2.11.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+798
@@ -0,0 +1,798 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 08:58:19 +0100
|
||||
Subject: Remove dependency on
|
||||
com.google.android.gms.common/auth/signin/dynamic,
|
||||
com.google.android.gms.tasks
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 8 ---
|
||||
chrome/android/features/media_router/BUILD.gn | 2 -
|
||||
.../browser/media/router/ChromeMediaRouter.java | 7 +-
|
||||
chrome/android/java/AndroidManifest.xml | 9 ---
|
||||
.../src/org/chromium/chrome/browser/AppHooks.java | 14 +---
|
||||
.../chromium/chrome/browser/ChromeVersionInfo.java | 12 +---
|
||||
.../browser/component_updater/UpdateScheduler.java | 3 -
|
||||
.../browser/externalauth/ExternalAuthUtils.java | 14 ++--
|
||||
.../externalauth/UserRecoverableErrorHandler.java | 7 --
|
||||
.../browser/gcore/ChromeGoogleApiClientImpl.java | 25 +------
|
||||
.../browser/gcore/GoogleApiClientHelper.java | 82 +---------------------
|
||||
.../chrome/browser/omaha/UpdateStatusProvider.java | 10 +--
|
||||
.../browser/preferences/PreferencesLauncher.java | 5 +-
|
||||
chrome/test/android/BUILD.gn | 2 -
|
||||
components/background_task_scheduler/BUILD.gn | 10 ---
|
||||
components/signin/core/browser/android/BUILD.gn | 2 -
|
||||
.../signin/GmsAvailabilityException.java | 4 +-
|
||||
content/public/android/BUILD.gn | 3 -
|
||||
content/test/BUILD.gn | 3 -
|
||||
device/BUILD.gn | 2 -
|
||||
remoting/android/client_java_tmpl.gni | 3 -
|
||||
services/BUILD.gn | 4 --
|
||||
services/device/geolocation/BUILD.gn | 2 -
|
||||
services/shape_detection/BUILD.gn | 2 -
|
||||
third_party/android_deps/BUILD.gn | 38 ----------
|
||||
third_party/cacheinvalidation/BUILD.gn | 1 -
|
||||
third_party/robolectric/BUILD.gn | 2 -
|
||||
27 files changed, 16 insertions(+), 260 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -267,9 +267,6 @@ android_library("chrome_java") {
|
||||
":thumbnail_cache_entry_proto_java",
|
||||
":update_proto_java",
|
||||
":usage_stats_proto_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
"//chrome/android/features/keyboard_accessory:public_java",
|
||||
@@ -685,8 +682,6 @@ junit_binary("chrome_junit_tests") {
|
||||
":chrome_java",
|
||||
":chrome_junit_test_support",
|
||||
":partner_location_descriptor_proto_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
@@ -784,9 +779,6 @@ android_library("chrome_test_java") {
|
||||
":browser_java_test_support",
|
||||
":chrome_test_util_java",
|
||||
":partner_location_descriptor_proto_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base/test:test_support_java",
|
||||
diff --git a/chrome/android/features/media_router/BUILD.gn b/chrome/android/features/media_router/BUILD.gn
|
||||
--- a/chrome/android/features/media_router/BUILD.gn
|
||||
+++ b/chrome/android/features/media_router/BUILD.gn
|
||||
@@ -9,8 +9,6 @@ import("//chrome/common/features.gni")
|
||||
android_library("java") {
|
||||
deps = [
|
||||
":java_resources",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
"//chrome/android:chrome_java",
|
||||
diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
|
||||
--- a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
|
||||
+++ b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
|
||||
@@ -7,9 +7,6 @@ package org.chromium.chrome.browser.media.router;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.media.MediaRouter;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.StrictModeContext;
|
||||
@@ -43,9 +40,7 @@ public class ChromeMediaRouter implements MediaRouteManager {
|
||||
int googleApiAvailabilityResult =
|
||||
AppHooks.get().isGoogleApiAvailableWithMinApkVersion(
|
||||
MIN_GOOGLE_PLAY_SERVICES_APK_VERSION);
|
||||
- if (googleApiAvailabilityResult != ConnectionResult.SUCCESS) {
|
||||
- GoogleApiAvailability.getInstance().showErrorNotification(
|
||||
- ContextUtils.getApplicationContext(), googleApiAvailabilityResult);
|
||||
+ if (true) {
|
||||
return;
|
||||
}
|
||||
MediaRouteProvider cafProvider = CafMediaRouteProvider.create(manager);
|
||||
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
|
||||
@@ -889,15 +889,6 @@ by a child template that "extends" this file.
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
- <!-- Activity for dispatching intents to Instant Apps. -->
|
||||
- <activity
|
||||
- android:name="org.chromium.chrome.browser.instantapps.AuthenticatedProxyActivity"
|
||||
- android:exported="false"
|
||||
- android:theme="@android:style/Theme.NoDisplay"
|
||||
- android:noHistory="true"
|
||||
- android:excludeFromRecents="true">
|
||||
- </activity>
|
||||
-
|
||||
<activity
|
||||
android:name="org.chromium.chrome.browser.vr.VrCancelAnimationActivity"
|
||||
android:exported="false"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
|
||||
@@ -15,9 +15,6 @@ import android.support.annotation.Nullable;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.Callback;
|
||||
import org.chromium.base.CommandLine;
|
||||
import org.chromium.base.ContextUtils;
|
||||
@@ -419,16 +416,7 @@ public abstract class AppHooks {
|
||||
* same as {@link GoogleApiAvailability#isGooglePlayServicesAvailable()}.
|
||||
*/
|
||||
public int isGoogleApiAvailableWithMinApkVersion(int minApkVersion) {
|
||||
- try {
|
||||
- PackageInfo gmsPackageInfo =
|
||||
- ContextUtils.getApplicationContext().getPackageManager().getPackageInfo(
|
||||
- GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, /* flags= */ 0);
|
||||
- int apkVersion = gmsPackageInfo.versionCode;
|
||||
- if (apkVersion >= minApkVersion) return ConnectionResult.SUCCESS;
|
||||
- } catch (PackageManager.NameNotFoundException e) {
|
||||
- return ConnectionResult.SERVICE_MISSING;
|
||||
- }
|
||||
- return ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED;
|
||||
+ return 1; /* SERVICE_MISSING*/
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java
|
||||
@@ -7,8 +7,6 @@ package org.chromium.chrome.browser;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
@@ -95,7 +93,7 @@ public class ChromeVersionInfo {
|
||||
public static String getGmsInfo() {
|
||||
Context context = ContextUtils.getApplicationContext();
|
||||
|
||||
- final long sdkVersion = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
+ final long sdkVersion = 12600000;
|
||||
final long installedGmsVersion = getPlayServicesApkVersionNumber(context);
|
||||
|
||||
final String accessType;
|
||||
@@ -112,12 +110,6 @@ public class ChromeVersionInfo {
|
||||
}
|
||||
|
||||
private static long getPlayServicesApkVersionNumber(Context context) {
|
||||
- try {
|
||||
- return context.getPackageManager()
|
||||
- .getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0)
|
||||
- .versionCode;
|
||||
- } catch (PackageManager.NameNotFoundException e) {
|
||||
- return 0;
|
||||
- }
|
||||
+ return 0;
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -6,9 +6,6 @@ package org.chromium.chrome.browser.component_updater;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
import org.chromium.base.annotations.JNINamespace;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
|
||||
@@ -13,9 +13,6 @@ import android.os.Binder;
|
||||
import android.support.annotation.WorkerThread;
|
||||
import android.text.TextUtils;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.CommandLine;
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
@@ -157,9 +154,7 @@ public class ExternalAuthUtils {
|
||||
* when it is updating.
|
||||
*/
|
||||
public boolean isGooglePlayServicesMissing(final Context context) {
|
||||
- final int resultCode = checkGooglePlayServicesAvailable(context);
|
||||
- return (resultCode == ConnectionResult.SERVICE_MISSING
|
||||
- || resultCode == ConnectionResult.SERVICE_INVALID);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,7 +176,6 @@ public class ExternalAuthUtils {
|
||||
|
||||
Context context = ContextUtils.getApplicationContext();
|
||||
final int resultCode = checkGooglePlayServicesAvailable(context);
|
||||
- if (resultCode == ConnectionResult.SUCCESS) return true;
|
||||
// resultCode is some kind of error.
|
||||
Log.v(TAG, "Unable to use Google Play Services: %s", describeError(resultCode));
|
||||
if (isUserRecoverableError(resultCode)) {
|
||||
@@ -251,7 +245,7 @@ public class ExternalAuthUtils {
|
||||
protected int checkGooglePlayServicesAvailable(final Context context) {
|
||||
// TODO(crbug.com/577190): Temporarily allowing disk access until more permanent fix is in.
|
||||
try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
|
||||
- return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
|
||||
+ return 1; /*SERVICE_MISSING*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +257,7 @@ public class ExternalAuthUtils {
|
||||
* @return true If the code represents a user-recoverable error
|
||||
*/
|
||||
protected boolean isUserRecoverableError(final int errorCode) {
|
||||
- return GoogleApiAvailability.getInstance().isUserResolvableError(errorCode);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,6 +267,6 @@ public class ExternalAuthUtils {
|
||||
* @return a textual description of the error code
|
||||
*/
|
||||
protected String describeError(final int errorCode) {
|
||||
- return GoogleApiAvailability.getInstance().getErrorString(errorCode);
|
||||
+ return "";
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java
|
||||
@@ -9,8 +9,6 @@ import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.metrics.CachedMetrics.ActionEvent;
|
||||
|
||||
@@ -97,7 +95,6 @@ public abstract class UserRecoverableErrorHandler {
|
||||
if (!sNotificationShown.getAndSet(true)) {
|
||||
return;
|
||||
}
|
||||
- GoogleApiAvailability.getInstance().showErrorNotification(context, errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,11 +187,7 @@ public abstract class UserRecoverableErrorHandler {
|
||||
cancelDialog();
|
||||
}
|
||||
if (mDialog == null) {
|
||||
- mDialog = GoogleApiAvailability.getInstance().getErrorDialog(
|
||||
- mActivity, errorCode, NO_RESPONSE_REQUIRED);
|
||||
mErrorCode = errorCode;
|
||||
-
|
||||
- DialogUserActionRecorder.createAndAttachToDialog(mDialog);
|
||||
}
|
||||
// This can happen if |errorCode| is ConnectionResult.SERVICE_INVALID.
|
||||
if (mDialog != null && !mDialog.isShowing()) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
|
||||
@@ -6,9 +6,6 @@ package org.chromium.chrome.browser.gcore;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.TraceEvent;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
@@ -22,7 +19,6 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
|
||||
private static final String TAG = "Icing";
|
||||
|
||||
private final Context mApplicationContext;
|
||||
- private final GoogleApiClient mClient;
|
||||
|
||||
/**
|
||||
* @param context its application context will be exposed through
|
||||
@@ -31,10 +27,9 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
|
||||
* @param requireFirstPartyBuild true if the given client can only be used in a first-party
|
||||
* build.
|
||||
*/
|
||||
- public ChromeGoogleApiClientImpl(Context context, GoogleApiClient client,
|
||||
+ public ChromeGoogleApiClientImpl(Context context,
|
||||
boolean requireFirstPartyBuild) {
|
||||
mApplicationContext = context.getApplicationContext();
|
||||
- mClient = client;
|
||||
if (requireFirstPartyBuild && !ExternalAuthUtils.getInstance().isChromeGoogleSigned()) {
|
||||
throw new IllegalStateException("GoogleApiClient requires first-party build");
|
||||
}
|
||||
@@ -42,7 +37,6 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
|
||||
|
||||
@Override
|
||||
public void disconnect() {
|
||||
- mClient.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,24 +52,11 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
|
||||
@Override
|
||||
public boolean connectWithTimeout(long timeout) {
|
||||
TraceEvent.begin("ChromeGoogleApiClientImpl:connectWithTimeout");
|
||||
- try {
|
||||
- ConnectionResult result = mClient.blockingConnect(timeout, TimeUnit.MILLISECONDS);
|
||||
- if (!result.isSuccess()) {
|
||||
- Log.e(TAG, "Connection to GmsCore unsuccessful. Error %d", result.getErrorCode());
|
||||
- } else {
|
||||
- Log.d(TAG, "Connection to GmsCore successful.");
|
||||
- }
|
||||
- return result.isSuccess();
|
||||
- } finally {
|
||||
- TraceEvent.end("ChromeGoogleApiClientImpl:connectWithTimeout");
|
||||
- }
|
||||
+ TraceEvent.end("ChromeGoogleApiClientImpl:connectWithTimeout");
|
||||
+ return false;
|
||||
}
|
||||
|
||||
public Context getApplicationContext() {
|
||||
return mApplicationContext;
|
||||
}
|
||||
-
|
||||
- public GoogleApiClient getApiClient() {
|
||||
- return mClient;
|
||||
- }
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
|
||||
@@ -7,11 +7,6 @@ package org.chromium.chrome.browser.gcore;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
|
||||
-
|
||||
import org.chromium.base.ApplicationStatus;
|
||||
import org.chromium.base.ApplicationStatus.ApplicationStateListener;
|
||||
import org.chromium.base.Log;
|
||||
@@ -67,30 +62,16 @@ import org.chromium.base.ThreadUtils;
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
-public class GoogleApiClientHelper
|
||||
- implements OnConnectionFailedListener, ConnectionCallbacks {
|
||||
+public class GoogleApiClientHelper {
|
||||
private static final String TAG = "GCore";
|
||||
|
||||
private int mResolutionAttempts;
|
||||
private boolean mWasConnectedBefore;
|
||||
private final Handler mHandler = new Handler(ThreadUtils.getUiThreadLooper());
|
||||
- private final GoogleApiClient mClient;
|
||||
private long mDisconnectionDelayMs;
|
||||
private Runnable mPendingDisconnect;
|
||||
|
||||
/**
|
||||
- * Creates a helper and enrolls it in the various connection management features.
|
||||
- * See the class documentation for {@link GoogleApiClientHelper} for more information.
|
||||
- *
|
||||
- * @param client The client to wrap.
|
||||
- */
|
||||
- public GoogleApiClientHelper(GoogleApiClient client) {
|
||||
- mClient = client;
|
||||
- enableConnectionRetrying(true);
|
||||
- enableLifecycleManagement(true);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Opts in or out of lifecycle management. The client's connection will be closed and reopened
|
||||
* when Chrome goes in and out of background.
|
||||
*
|
||||
@@ -116,13 +97,6 @@ public class GoogleApiClientHelper
|
||||
* Enabling or disabling it while it is already enabled or disabled has no effect.
|
||||
*/
|
||||
public void enableConnectionRetrying(boolean enabled) {
|
||||
- if (enabled) {
|
||||
- mClient.registerConnectionCallbacks(this);
|
||||
- mClient.registerConnectionFailedListener(this);
|
||||
- } else {
|
||||
- mClient.unregisterConnectionCallbacks(this);
|
||||
- mClient.unregisterConnectionFailedListener(this);
|
||||
- }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,21 +129,11 @@ public class GoogleApiClientHelper
|
||||
// Cancel and reschedule the disconnection if we are in the background. We do it early to
|
||||
// avoid race conditions between a disconnect on the UI thread and the connect below.
|
||||
if (!ApplicationStatus.hasVisibleActivities()) scheduleDisconnection();
|
||||
-
|
||||
- // The client might be disconnected if we were idle in the background for too long.
|
||||
- if (!mClient.isConnected() && !mClient.isConnecting()) {
|
||||
- Log.d(TAG, "Reconnecting the client.");
|
||||
- mClient.connect();
|
||||
- }
|
||||
}
|
||||
|
||||
void restoreConnectedState() {
|
||||
// If we go back to the foreground before a delayed disconnect happens, cancel it.
|
||||
cancelPendingDisconnection();
|
||||
-
|
||||
- if (mWasConnectedBefore) {
|
||||
- mClient.connect();
|
||||
- }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,12 +156,6 @@ public class GoogleApiClientHelper
|
||||
}
|
||||
|
||||
private void disconnect() {
|
||||
- if (mClient.isConnected() || mClient.isConnecting()) {
|
||||
- mWasConnectedBefore = true;
|
||||
- }
|
||||
-
|
||||
- // We always call disconnect to abort possibly pending connection requests.
|
||||
- mClient.disconnect();
|
||||
}
|
||||
|
||||
private void cancelPendingDisconnection() {
|
||||
@@ -207,43 +165,7 @@ public class GoogleApiClientHelper
|
||||
mPendingDisconnect = null;
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public void onConnectionFailed(ConnectionResult result) {
|
||||
- if (!isErrorRecoverableByRetrying(result.getErrorCode())) {
|
||||
- Log.d(TAG, "Not retrying managed client connection. Unrecoverable error: %d",
|
||||
- result.getErrorCode());
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (mResolutionAttempts < ConnectedTask.RETRY_NUMBER_LIMIT) {
|
||||
- Log.d(TAG, "Retrying managed client connection. attempt %d/%d - errorCode: %d",
|
||||
- mResolutionAttempts, ConnectedTask.RETRY_NUMBER_LIMIT, result.getErrorCode());
|
||||
- mResolutionAttempts += 1;
|
||||
-
|
||||
- mHandler.postDelayed(new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
- mClient.connect();
|
||||
- }
|
||||
- }, ConnectedTask.CONNECTION_RETRY_TIME_MS);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onConnected(Bundle connectionHint) {
|
||||
- mResolutionAttempts = 0;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onConnectionSuspended(int cause) {
|
||||
- // GoogleApiClient handles retrying on suspension itself. Logging in case it didn't succeed
|
||||
- // for some reason.
|
||||
- Log.w(TAG, "Managed client connection suspended. Cause: %d", cause);
|
||||
- }
|
||||
-
|
||||
private static boolean isErrorRecoverableByRetrying(int errorCode) {
|
||||
- return errorCode == ConnectionResult.INTERNAL_ERROR
|
||||
- || errorCode == ConnectionResult.NETWORK_ERROR
|
||||
- || errorCode == ConnectionResult.SERVICE_UPDATING;
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
|
||||
@@ -19,8 +19,6 @@ import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
-import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
-
|
||||
import org.chromium.base.ActivityState;
|
||||
import org.chromium.base.ApplicationStatus;
|
||||
import org.chromium.base.ApplicationStatus.ActivityStateListener;
|
||||
@@ -463,13 +461,7 @@ public class UpdateStatusProvider implements ActivityStateListener {
|
||||
}
|
||||
|
||||
private boolean isGooglePlayStoreAvailable(Context context) {
|
||||
- try {
|
||||
- context.getPackageManager().getPackageInfo(
|
||||
- GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
|
||||
- } catch (PackageManager.NameNotFoundException e) {
|
||||
- return false;
|
||||
- }
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java
|
||||
@@ -12,8 +12,6 @@ import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
@@ -202,8 +200,7 @@ public class PreferencesLauncher {
|
||||
int minGooglePlayServicesVersion = ChromeFeatureList.getFieldTrialParamByFeatureAsInt(
|
||||
GOOGLE_ACCOUNT_PWM_UI, MIN_GOOGLE_PLAY_SERVICES_VERSION_PARAM,
|
||||
DEFAULT_MIN_GOOGLE_PLAY_SERVICES_APK_VERSION);
|
||||
- if (AppHooks.get().isGoogleApiAvailableWithMinApkVersion(minGooglePlayServicesVersion)
|
||||
- != ConnectionResult.SUCCESS)
|
||||
+ if (true)
|
||||
return false;
|
||||
|
||||
if (!ChromeFeatureList.isEnabled(GOOGLE_ACCOUNT_PWM_UI)) return false;
|
||||
diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn
|
||||
--- a/chrome/test/android/BUILD.gn
|
||||
+++ b/chrome/test/android/BUILD.gn
|
||||
@@ -153,8 +153,6 @@ android_library("chrome_java_test_support") {
|
||||
"javatests/src/org/chromium/chrome/test/util/TranslateUtil.java",
|
||||
]
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//chrome/android:chrome_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
|
||||
@@ -52,9 +52,6 @@ if (is_android) {
|
||||
deps = [
|
||||
":background_task_scheduler_task_ids_java",
|
||||
":scheduled_task_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//content/public/android:content_java",
|
||||
"//third_party/android_deps:com_android_support_support_annotations_java",
|
||||
@@ -75,9 +72,6 @@ if (is_android) {
|
||||
deps = [
|
||||
":background_task_scheduler_java",
|
||||
":background_task_scheduler_task_ids_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//content/public/test/android:content_java_test_support",
|
||||
@@ -104,10 +98,6 @@ if (is_android) {
|
||||
|
||||
deps = [
|
||||
":background_task_scheduler_java",
|
||||
- "$google_play_services_package:google_play_services_auth_base_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
|
||||
--- a/components/signin/core/browser/android/BUILD.gn
|
||||
+++ b/components/signin/core/browser/android/BUILD.gn
|
||||
@@ -15,8 +15,6 @@ generate_jni("jni_headers") {
|
||||
|
||||
android_library("java") {
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
"//net/android:net_java",
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/GmsAvailabilityException.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/GmsAvailabilityException.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/GmsAvailabilityException.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/GmsAvailabilityException.java
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
package org.chromium.components.signin;
|
||||
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
/**
|
||||
* This class encapsulates return code if GMSCore package is not available.
|
||||
*/
|
||||
@@ -27,6 +25,6 @@ public class GmsAvailabilityException extends AccountManagerDelegateException {
|
||||
}
|
||||
|
||||
public boolean isUserResolvableError() {
|
||||
- return GoogleApiAvailability.getInstance().isUserResolvableError(mResultCode);
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
|
||||
--- a/content/public/android/BUILD.gn
|
||||
+++ b/content/public/android/BUILD.gn
|
||||
@@ -52,9 +52,6 @@ action("generate_sandboxed_service_srcjar") {
|
||||
android_library("content_java") {
|
||||
deps = [
|
||||
":content_java_resources",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
"//components/download/public/common:public_java",
|
||||
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
|
||||
--- a/content/test/BUILD.gn
|
||||
+++ b/content/test/BUILD.gn
|
||||
@@ -2442,9 +2442,6 @@ if (is_android) {
|
||||
testonly = true
|
||||
java_files = content_java_sources_needing_jni
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//content/public/android:content_java",
|
||||
]
|
||||
diff --git a/device/BUILD.gn b/device/BUILD.gn
|
||||
--- a/device/BUILD.gn
|
||||
+++ b/device/BUILD.gn
|
||||
@@ -386,8 +386,6 @@ if (is_android) {
|
||||
junit_binary("device_junit_tests") {
|
||||
java_files = [ "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java" ]
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
diff --git a/remoting/android/client_java_tmpl.gni b/remoting/android/client_java_tmpl.gni
|
||||
--- a/remoting/android/client_java_tmpl.gni
|
||||
+++ b/remoting/android/client_java_tmpl.gni
|
||||
@@ -101,9 +101,6 @@ template("remoting_android_client_java_tmpl") {
|
||||
|
||||
if (defined(invoker.play_services_package)) {
|
||||
deps += [
|
||||
- "${invoker.play_services_package}:google_play_services_auth_base_java",
|
||||
- "${invoker.play_services_package}:google_play_services_base_java",
|
||||
- "${invoker.play_services_package}:google_play_services_basement_java",
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/services/BUILD.gn b/services/BUILD.gn
|
||||
--- a/services/BUILD.gn
|
||||
+++ b/services/BUILD.gn
|
||||
@@ -107,8 +107,6 @@ if (is_android) {
|
||||
"shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
|
||||
]
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
@@ -136,8 +134,6 @@ if (is_android) {
|
||||
"shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
|
||||
]
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//mojo/public/java:base_java",
|
||||
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
|
||||
@@ -141,8 +141,6 @@ if (is_android) {
|
||||
deps = [
|
||||
":geolocation",
|
||||
":geolocation_jni_headers",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//components/location/android:location_java",
|
||||
"//services/device/public/java:geolocation_java",
|
||||
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
|
||||
--- a/services/shape_detection/BUILD.gn
|
||||
+++ b/services/shape_detection/BUILD.gn
|
||||
@@ -89,8 +89,6 @@ if (is_android) {
|
||||
]
|
||||
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//base:base_java",
|
||||
"//mojo/public/java:base_java",
|
||||
"//mojo/public/java:bindings_java",
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -772,44 +772,6 @@ android_aar_prebuilt("com_android_support_viewpager_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_base_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_base/play-services-base-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_base/com_google_android_gms_play_services_base.info"
|
||||
- deps = [
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_basement_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_basement/play-services-basement-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_basement/com_google_android_gms_play_services_basement.info"
|
||||
- deps = [
|
||||
- ":com_android_support_support_v4_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
- input_jars_paths = [ "$android_sdk/optional/org.apache.http.legacy.jar" ]
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_tasks_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_tasks/play-services-tasks-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_tasks/com_google_android_gms_play_services_tasks.info"
|
||||
- deps = [
|
||||
- ":google_play_services_basement_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("com_google_android_material_material_java") {
|
||||
aar_path = "libs/com_google_android_material_material/material-1.0.0-rc02.aar"
|
||||
info_path = "libs/com_google_android_material_material/com_google_android_material_material.info"
|
||||
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
|
||||
@@ -137,7 +137,6 @@ if (is_android) {
|
||||
jacoco_never_instrument = true
|
||||
deps = [
|
||||
":cacheinvalidation_proto_java",
|
||||
- "$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//third_party/android_protobuf:protobuf_nano_javalib",
|
||||
]
|
||||
diff --git a/third_party/robolectric/BUILD.gn b/third_party/robolectric/BUILD.gn
|
||||
--- a/third_party/robolectric/BUILD.gn
|
||||
+++ b/third_party/robolectric/BUILD.gn
|
||||
@@ -938,8 +938,6 @@ java_library("shadows_play_services_java") {
|
||||
":robolectric_shadowapi_java",
|
||||
":robolectric_utils_java",
|
||||
":shadows_core_java",
|
||||
- "$google_play_services_package:google_play_services_base_java",
|
||||
- "$google_play_services_package:google_play_services_basement_java",
|
||||
"//third_party/android_deps:android_support_v4_java",
|
||||
"//third_party/gson:gson_java",
|
||||
"//third_party/guava:guava_java",
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+554
@@ -0,0 +1,554 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 07:58:48 +0100
|
||||
Subject: Remove dependency on com.google.android.gms.fido,
|
||||
com.google.android.gms.iid, com.google.android.gms.instantapps,
|
||||
com.google.android.gms.location
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 5 -
|
||||
.../externalnav/ExternalNavigationHandler.java | 3 -
|
||||
.../browser/instantapps/InstantAppsHandler.java | 59 +-----------
|
||||
components/gcm_driver/instance_id/android/BUILD.gn | 2 -
|
||||
.../instance_id/InstanceIDWithSubtype.java | 28 +-----
|
||||
device/BUILD.gn | 1 -
|
||||
services/device/geolocation/BUILD.gn | 1 -
|
||||
.../geolocation/LocationProviderGmsCore.java | 103 +--------------------
|
||||
third_party/android_deps/BUILD.gn | 58 ------------
|
||||
third_party/cacheinvalidation/BUILD.gn | 1 -
|
||||
.../client/android2/AndroidManifestUpdatedGcm.xml | 3 -
|
||||
11 files changed, 9 insertions(+), 255 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -271,8 +271,6 @@ android_library("chrome_java") {
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
"$google_play_services_package:google_play_services_cast_java",
|
||||
- "$google_play_services_package:google_play_services_fido_java",
|
||||
- "$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:jni_java",
|
||||
@@ -693,7 +691,6 @@ junit_binary("chrome_junit_tests") {
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
"$google_play_services_package:google_play_services_cast_java",
|
||||
- "$google_play_services_package:google_play_services_fido_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
@@ -795,8 +792,6 @@ android_library("chrome_test_java") {
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
"$google_play_services_package:google_play_services_cast_java",
|
||||
- "$google_play_services_package:google_play_services_fido_java",
|
||||
- "$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
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
|
||||
@@ -581,7 +581,6 @@ public class ExternalNavigationHandler {
|
||||
if (shouldProxyForInstantApps) {
|
||||
RecordHistogram.recordEnumeratedHistogram("Android.InstantApps.DirectInstantAppsIntent",
|
||||
AiaIntent.SERP, AiaIntent.NUM_ENTRIES);
|
||||
- intent.putExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER, true);
|
||||
} else if (isDirectInstantAppsIntent) {
|
||||
// For security reasons, we disable all intent:// URLs to Instant Apps that are
|
||||
// not coming from SERP.
|
||||
@@ -590,8 +589,6 @@ public class ExternalNavigationHandler {
|
||||
AiaIntent.OTHER, AiaIntent.NUM_ENTRIES);
|
||||
return OverrideUrlLoadingResult.NO_OVERRIDE;
|
||||
} else {
|
||||
- // Make sure this extra is not sent unless we've done the verification.
|
||||
- intent.removeExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER);
|
||||
}
|
||||
|
||||
boolean deviceCanHandleIntent = deviceCanHandleIntent(intent);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
||||
@@ -42,36 +42,6 @@ public class InstantAppsHandler {
|
||||
// TODO(mariakhomenko): Use system once we roll to O SDK.
|
||||
private static final int FLAG_DO_NOT_LAUNCH = 0x00000200;
|
||||
|
||||
- // TODO(mariakhomenko): Depend directly on the constants once we roll to v8 libraries.
|
||||
- private static final String DO_NOT_LAUNCH_EXTRA =
|
||||
- "com.google.android.gms.instantapps.DO_NOT_LAUNCH_INSTANT_APP";
|
||||
-
|
||||
- protected static final String IS_REFERRER_TRUSTED_EXTRA =
|
||||
- "com.google.android.gms.instantapps.IS_REFERRER_TRUSTED";
|
||||
-
|
||||
- protected static final String IS_USER_CONFIRMED_LAUNCH_EXTRA =
|
||||
- "com.google.android.gms.instantapps.IS_USER_CONFIRMED_LAUNCH";
|
||||
-
|
||||
- protected static final String TRUSTED_REFERRER_PKG_EXTRA =
|
||||
- "com.google.android.gms.instantapps.TRUSTED_REFERRER_PKG";
|
||||
-
|
||||
- public static final String IS_GOOGLE_SEARCH_REFERRER =
|
||||
- "com.google.android.gms.instantapps.IS_GOOGLE_SEARCH_REFERRER";
|
||||
-
|
||||
- private static final String BROWSER_LAUNCH_REASON =
|
||||
- "com.google.android.gms.instantapps.BROWSER_LAUNCH_REASON";
|
||||
-
|
||||
- private static final String SUPERVISOR_PKG = "com.google.android.instantapps.supervisor";
|
||||
-
|
||||
- private static final String[] SUPERVISOR_START_ACTIONS = {
|
||||
- "com.google.android.instantapps.START", "com.google.android.instantapps.nmr1.INSTALL",
|
||||
- "com.google.android.instantapps.nmr1.VIEW"};
|
||||
-
|
||||
- // Instant Apps system resolver activity on N-MR1+.
|
||||
- @VisibleForTesting
|
||||
- public static final String EPHEMERAL_INSTALLER_CLASS =
|
||||
- "com.google.android.gms.instantapps.routing.EphemeralInstallerActivity";
|
||||
-
|
||||
/** Finch experiment name. */
|
||||
private static final String INSTANT_APPS_EXPERIMENT_NAME = "InstantApps";
|
||||
|
||||
@@ -123,14 +93,6 @@ public class InstantAppsHandler {
|
||||
* @return Whether the given intent is going to open an Instant App.
|
||||
*/
|
||||
public static boolean isIntentToInstantApp(Intent intent) {
|
||||
- if (SUPERVISOR_PKG.equals(intent.getPackage())) return true;
|
||||
-
|
||||
- String intentAction = intent.getAction();
|
||||
- for (String action : SUPERVISOR_START_ACTIONS) {
|
||||
- if (action.equals(intentAction)) {
|
||||
- return true;
|
||||
- }
|
||||
- }
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -167,13 +129,7 @@ public class InstantAppsHandler {
|
||||
sFallbackIntentTimes.record(SystemClock.elapsedRealtime() - startTime);
|
||||
intent.removeExtra(INSTANT_APP_START_TIME_EXTRA);
|
||||
}
|
||||
- int callSource = IntentUtils.safeGetIntExtra(intent, BROWSER_LAUNCH_REASON, 0);
|
||||
- if (callSource > 0 && callSource < SOURCE_BOUNDARY) {
|
||||
- sFallbackCallSource.record(callSource);
|
||||
- intent.removeExtra(BROWSER_LAUNCH_REASON);
|
||||
- } else if (callSource >= SOURCE_BOUNDARY) {
|
||||
- Log.e(TAG, "Unexpected call source constant for Instant Apps: " + callSource);
|
||||
- }
|
||||
+ Log.e(TAG, "Unexpected call source constant for Instant Apps");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,14 +164,6 @@ public class InstantAppsHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (IntentUtils.safeGetBooleanExtra(intent, DO_NOT_LAUNCH_EXTRA, false)
|
||||
- || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||
- && (intent.getFlags() & FLAG_DO_NOT_LAUNCH) != 0)) {
|
||||
- maybeRecordFallbackStats(intent);
|
||||
- Log.i(TAG, "Not handling with Instant Apps (DO_NOT_LAUNCH_EXTRA)");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
if (IntentUtils.safeGetBooleanExtra(
|
||||
intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false)
|
||||
|| IntentUtils.safeHasExtra(intent, ShortcutHelper.EXTRA_SOURCE)
|
||||
@@ -240,7 +188,6 @@ public class InstantAppsHandler {
|
||||
}
|
||||
|
||||
Intent callbackIntent = new Intent(intent);
|
||||
- callbackIntent.putExtra(DO_NOT_LAUNCH_EXTRA, true);
|
||||
callbackIntent.putExtra(INSTANT_APP_START_TIME_EXTRA, startTime);
|
||||
|
||||
return tryLaunchingInstantApp(context, intent, isCustomTabsIntent, callbackIntent);
|
||||
@@ -343,12 +290,9 @@ public class InstantAppsHandler {
|
||||
Intent iaIntent = data.getIntent();
|
||||
if (data.getReferrer() != null) {
|
||||
iaIntent.putExtra(Intent.EXTRA_REFERRER, data.getReferrer());
|
||||
- iaIntent.putExtra(IS_REFERRER_TRUSTED_EXTRA, true);
|
||||
}
|
||||
|
||||
Context appContext = ContextUtils.getApplicationContext();
|
||||
- iaIntent.putExtra(TRUSTED_REFERRER_PKG_EXTRA, appContext.getPackageName());
|
||||
- iaIntent.putExtra(IS_USER_CONFIRMED_LAUNCH_EXTRA, true);
|
||||
|
||||
try {
|
||||
appContext.startActivity(iaIntent);
|
||||
@@ -394,7 +338,6 @@ public class InstantAppsHandler {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
return info.isInstantAppAvailable;
|
||||
} else if (info.activityInfo != null) {
|
||||
- return EPHEMERAL_INSTALLER_CLASS.equals(info.activityInfo.name);
|
||||
}
|
||||
|
||||
return false;
|
||||
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
|
||||
@@ -18,7 +18,6 @@ generate_jni("test_support_jni_headers") {
|
||||
|
||||
android_library("instance_id_driver_java") {
|
||||
deps = [
|
||||
- "$google_play_services_package:google_play_services_iid_java",
|
||||
"//base:base_java",
|
||||
"//components/gcm_driver/android:gcm_driver_java",
|
||||
]
|
||||
@@ -34,7 +33,6 @@ android_library("instance_id_driver_java") {
|
||||
android_library("instance_id_driver_test_support_java") {
|
||||
deps = [
|
||||
":instance_id_driver_java",
|
||||
- "$google_play_services_package:google_play_services_iid_java",
|
||||
"//base:base_java",
|
||||
]
|
||||
|
||||
diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
||||
--- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
||||
+++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
||||
@@ -8,8 +8,6 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
-import com.google.android.gms.iid.InstanceID;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
|
||||
@@ -25,8 +23,6 @@ public class InstanceIDWithSubtype {
|
||||
// Must match the private InstanceID.OPTION_SUBTYPE, which is guaranteed to not change.
|
||||
private static final String OPTION_SUBTYPE = "subtype";
|
||||
|
||||
- private final InstanceID mInstanceID;
|
||||
-
|
||||
/**
|
||||
* Cached instances. May be accessed from multiple threads; synchronize on sSubtypeInstancesLock
|
||||
*/
|
||||
@@ -38,10 +34,6 @@ public class InstanceIDWithSubtype {
|
||||
@VisibleForTesting
|
||||
protected static FakeFactory sFakeFactoryForTesting;
|
||||
|
||||
- protected InstanceIDWithSubtype(InstanceID instanceID) {
|
||||
- mInstanceID = instanceID;
|
||||
- }
|
||||
-
|
||||
/**
|
||||
* Returns an instance of this class. Unlike {@link InstanceID#getInstance(Context)}, it is not
|
||||
* a singleton, but instead a different instance will be returned for each {@code subtype}.
|
||||
@@ -57,11 +49,6 @@ public class InstanceIDWithSubtype {
|
||||
if (sFakeFactoryForTesting != null) {
|
||||
existing = sFakeFactoryForTesting.create(subtype);
|
||||
} else {
|
||||
- Bundle options = new Bundle();
|
||||
- options.putCharSequence(OPTION_SUBTYPE, subtype);
|
||||
- InstanceID instanceID =
|
||||
- InstanceID.getInstance(ContextUtils.getApplicationContext(), options);
|
||||
- existing = new InstanceIDWithSubtype(instanceID);
|
||||
}
|
||||
sSubtypeInstances.put(subtype, existing);
|
||||
}
|
||||
@@ -70,35 +57,30 @@ public class InstanceIDWithSubtype {
|
||||
}
|
||||
|
||||
public String getSubtype() {
|
||||
- return mInstanceID.getSubtype();
|
||||
+ return "";
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
- return mInstanceID.getId();
|
||||
+ return "";
|
||||
}
|
||||
|
||||
public long getCreationTime() {
|
||||
- return mInstanceID.getCreationTime();
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public void deleteInstanceID() throws IOException {
|
||||
- synchronized (sSubtypeInstancesLock) {
|
||||
- sSubtypeInstances.remove(mInstanceID.getSubtype());
|
||||
- mInstanceID.deleteInstanceID();
|
||||
- }
|
||||
}
|
||||
|
||||
public void deleteToken(String authorizedEntity, String scope) throws IOException {
|
||||
- mInstanceID.deleteToken(authorizedEntity, scope);
|
||||
}
|
||||
|
||||
public String getToken(String authorizedEntity, String scope) throws IOException {
|
||||
- return mInstanceID.getToken(authorizedEntity, scope);
|
||||
+ return "";
|
||||
}
|
||||
|
||||
public String getToken(String authorizedEntity, String scope, Bundle extras)
|
||||
throws IOException {
|
||||
- return mInstanceID.getToken(authorizedEntity, scope, extras);
|
||||
+ return "";
|
||||
}
|
||||
|
||||
/** Fake subclasses can set {@link #sFakeFactoryForTesting} to an implementation of this. */
|
||||
diff --git a/device/BUILD.gn b/device/BUILD.gn
|
||||
--- a/device/BUILD.gn
|
||||
+++ b/device/BUILD.gn
|
||||
@@ -388,7 +388,6 @@ if (is_android) {
|
||||
deps = [
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_location_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
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
|
||||
@@ -143,7 +143,6 @@ if (is_android) {
|
||||
":geolocation_jni_headers",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_location_java",
|
||||
"//base:base_java",
|
||||
"//components/location/android:location_java",
|
||||
"//services/device/public/java:geolocation_java",
|
||||
diff --git a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
||||
--- a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
||||
+++ b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
||||
@@ -8,16 +8,6 @@ import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
|
||||
-import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
|
||||
-import com.google.android.gms.location.FusedLocationProviderApi;
|
||||
-import com.google.android.gms.location.LocationListener;
|
||||
-import com.google.android.gms.location.LocationRequest;
|
||||
-import com.google.android.gms.location.LocationServices;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.components.location.LocationUtils;
|
||||
@@ -27,126 +17,39 @@ import org.chromium.components.location.LocationUtils;
|
||||
*
|
||||
* https://developers.google.com/android/reference/com/google/android/gms/location/package-summary
|
||||
*/
|
||||
-public class LocationProviderGmsCore implements ConnectionCallbacks, OnConnectionFailedListener,
|
||||
- LocationListener, LocationProvider {
|
||||
+public class LocationProviderGmsCore implements LocationProvider {
|
||||
private static final String TAG = "cr_LocationProvider";
|
||||
|
||||
// Values for the LocationRequest's setInterval for normal and high accuracy, respectively.
|
||||
private static final long UPDATE_INTERVAL_MS = 1000;
|
||||
private static final long UPDATE_INTERVAL_FAST_MS = 500;
|
||||
|
||||
- private final GoogleApiClient mGoogleApiClient;
|
||||
- private FusedLocationProviderApi mLocationProviderApi = LocationServices.FusedLocationApi;
|
||||
-
|
||||
private boolean mEnablehighAccuracy;
|
||||
- private LocationRequest mLocationRequest;
|
||||
|
||||
public static boolean isGooglePlayServicesAvailable(Context context) {
|
||||
- return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
|
||||
- == ConnectionResult.SUCCESS;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
LocationProviderGmsCore(Context context) {
|
||||
Log.i(TAG, "Google Play Services");
|
||||
- mGoogleApiClient = new GoogleApiClient.Builder(context)
|
||||
- .addApi(LocationServices.API)
|
||||
- .addConnectionCallbacks(this)
|
||||
- .addOnConnectionFailedListener(this)
|
||||
- .build();
|
||||
- assert mGoogleApiClient != null;
|
||||
- }
|
||||
-
|
||||
- LocationProviderGmsCore(GoogleApiClient client, FusedLocationProviderApi locationApi) {
|
||||
- mGoogleApiClient = client;
|
||||
- mLocationProviderApi = locationApi;
|
||||
- }
|
||||
-
|
||||
- // ConnectionCallbacks implementation
|
||||
- @Override
|
||||
- public void onConnected(Bundle connectionHint) {
|
||||
- ThreadUtils.assertOnUiThread();
|
||||
-
|
||||
- mLocationRequest = LocationRequest.create();
|
||||
- if (mEnablehighAccuracy) {
|
||||
- // With enableHighAccuracy, request a faster update interval and configure the provider
|
||||
- // for high accuracy mode.
|
||||
- mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
|
||||
- .setInterval(UPDATE_INTERVAL_FAST_MS);
|
||||
- } else {
|
||||
- // Use balanced mode by default. In this mode, the API will prefer the network provider
|
||||
- // but may use sensor data (for instance, GPS) if high accuracy is requested by another
|
||||
- // app.
|
||||
- //
|
||||
- // If location is configured for sensors-only then elevate the priority to ensure GPS
|
||||
- // and other sensors are used.
|
||||
- if (LocationUtils.getInstance().isSystemLocationSettingSensorsOnly()) {
|
||||
- mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||
- } else {
|
||||
- mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
|
||||
- }
|
||||
- mLocationRequest.setInterval(UPDATE_INTERVAL_MS);
|
||||
- }
|
||||
-
|
||||
- final Location location = mLocationProviderApi.getLastLocation(mGoogleApiClient);
|
||||
- if (location != null) {
|
||||
- LocationProviderAdapter.onNewLocationAvailable(location);
|
||||
- }
|
||||
-
|
||||
- try {
|
||||
- // Request updates on UI Thread replicating LocationProviderAndroid's behaviour.
|
||||
- mLocationProviderApi.requestLocationUpdates(
|
||||
- mGoogleApiClient, mLocationRequest, this, ThreadUtils.getUiThreadLooper());
|
||||
- } catch (IllegalStateException | SecurityException e) {
|
||||
- // IllegalStateException is thrown "If this method is executed in a thread that has not
|
||||
- // called Looper.prepare()". SecurityException is thrown if there is no permission, see
|
||||
- // https://crbug.com/731271.
|
||||
- Log.e(TAG, " mLocationProviderApi.requestLocationUpdates() " + e);
|
||||
- LocationProviderAdapter.newErrorAvailable(
|
||||
- "Failed to request location updates: " + e.toString());
|
||||
- assert false;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onConnectionSuspended(int cause) {}
|
||||
-
|
||||
- // OnConnectionFailedListener implementation
|
||||
- @Override
|
||||
- public void onConnectionFailed(ConnectionResult result) {
|
||||
- LocationProviderAdapter.newErrorAvailable(
|
||||
- "Failed to connect to Google Play Services: " + result.toString());
|
||||
}
|
||||
|
||||
// LocationProvider implementation
|
||||
@Override
|
||||
public void start(boolean enableHighAccuracy) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
- if (mGoogleApiClient.isConnected()) mGoogleApiClient.disconnect();
|
||||
|
||||
mEnablehighAccuracy = enableHighAccuracy;
|
||||
- mGoogleApiClient.connect(); // Should return via onConnected().
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
- if (!mGoogleApiClient.isConnected()) return;
|
||||
-
|
||||
- mLocationProviderApi.removeLocationUpdates(mGoogleApiClient, this);
|
||||
-
|
||||
- mGoogleApiClient.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
assert ThreadUtils.runningOnUiThread();
|
||||
- if (mGoogleApiClient == null) return false;
|
||||
- return mGoogleApiClient.isConnecting() || mGoogleApiClient.isConnected();
|
||||
- }
|
||||
-
|
||||
- // LocationListener implementation
|
||||
- @Override
|
||||
- public void onLocationChanged(Location location) {
|
||||
- LocationProviderAdapter.onNewLocationAvailable(location);
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -830,64 +830,6 @@ android_aar_prebuilt("google_play_services_cast_framework_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_fido_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_fido/play-services-fido-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_fido/com_google_android_gms_play_services_fido.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_iid_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_iid/play-services-iid-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_iid/com_google_android_gms_play_services_iid.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_stats_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_instantapps_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_instantapps/play-services-instantapps-16.0.0.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_instantapps/com_google_android_gms_play_services_instantapps.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_location_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_location/play-services-location-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_location/com_google_android_gms_play_services_location.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_places_placereport_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("google_play_services_tasks_java") {
|
||||
aar_path = "libs/com_google_android_gms_play_services_tasks/play-services-tasks-15.0.1.aar"
|
||||
info_path = "libs/com_google_android_gms_play_services_tasks/com_google_android_gms_play_services_tasks.info"
|
||||
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
|
||||
@@ -137,7 +137,6 @@ if (is_android) {
|
||||
jacoco_never_instrument = true
|
||||
deps = [
|
||||
":cacheinvalidation_proto_java",
|
||||
- "$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//third_party/android_protobuf:protobuf_nano_javalib",
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
@@ -27,9 +27,6 @@
|
||||
<!-- InstanceID Listener Service -->
|
||||
<service android:exported="false"
|
||||
android:name="com.google.ipc.invalidation.ticl2.android2.channel.AndroidInstanceIDListenerService">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.iid.InstanceID"/>
|
||||
- </intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 07:57:37 +0100
|
||||
Subject: Remove dependency on com.google.android.gms.flags,
|
||||
com.google.android.gms.location.places, com.google.android.gms.stats
|
||||
|
||||
---
|
||||
third_party/android_deps/BUILD.gn | 49 ---------------------------------------
|
||||
1 file changed, 49 deletions(-)
|
||||
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -1499,55 +1499,6 @@ android_aar_prebuilt("com_android_support_versionedparcelable_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_flags_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_flags/play-services-flags-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_flags/com_google_android_gms_play_services_flags.info"
|
||||
-
|
||||
- # To remove visibility constraint, add this dependency to
|
||||
- # //tools/android/roll/android_deps/build.gradle.
|
||||
- visibility = [ ":*" ]
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_places_placereport_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_places_placereport/play-services-places-placereport-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_places_placereport/com_google_android_gms_play_services_places_placereport.info"
|
||||
-
|
||||
- # To remove visibility constraint, add this dependency to
|
||||
- # //tools/android/roll/android_deps/build.gradle.
|
||||
- visibility = [ ":*" ]
|
||||
- deps = [
|
||||
- ":google_play_services_basement_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_stats_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_stats/play-services-stats-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_stats/com_google_android_gms_play_services_stats.info"
|
||||
-
|
||||
- # To remove visibility constraint, add this dependency to
|
||||
- # //tools/android/roll/android_deps/build.gradle.
|
||||
- visibility = [ ":*" ]
|
||||
- deps = [
|
||||
- ":google_play_services_basement_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
java_prebuilt("com_google_code_findbugs_jsr305_java") {
|
||||
jar_path = "libs/com_google_code_findbugs_jsr305/jsr305-1.3.9.jar"
|
||||
output_name = "com_google_code_findbugs_jsr305"
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,749 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Sat, 2 Nov 2019 07:56:44 +0100
|
||||
Subject: Remove dependency on com.google.android.gms.gcm
|
||||
|
||||
It also disalbes Snippets, auto-update of offline pages and launching browser from background service.
|
||||
The snippets are already disabled in native codes, this will disable it on Java level.
|
||||
---
|
||||
chrome/android/BUILD.gn | 3 -
|
||||
.../chrome/browser/BackgroundSyncLauncher.java | 17 +----
|
||||
.../chrome/browser/ChromeBackgroundService.java | 79 +------------------
|
||||
.../invalidation/InvalidationController.java | 1 +
|
||||
.../browser/ntp/snippets/SnippetsLauncher.java | 2 +-
|
||||
.../services/gcm/ChromeGcmListenerService.java | 58 +-------------
|
||||
components/background_task_scheduler/BUILD.gn | 3 -
|
||||
.../BackgroundTaskGcmTaskService.java | 63 +--------------
|
||||
.../BackgroundTaskSchedulerFactory.java | 6 +-
|
||||
.../BackgroundTaskSchedulerGcmNetworkManager.java | 14 +---
|
||||
third_party/android_deps/BUILD.gn | 15 ----
|
||||
third_party/cacheinvalidation/BUILD.gn | 1 -
|
||||
.../client/android2/AndroidManifestUpdatedGcm.xml | 20 -----
|
||||
.../android2/channel/AndroidGcmController.java | 42 +---------
|
||||
.../channel/AndroidInstanceIDListenerService.java | 13 +---
|
||||
.../channel/GcmRegistrationTaskService.java | 89 +---------------------
|
||||
16 files changed, 14 insertions(+), 412 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -272,7 +272,6 @@ android_library("chrome_java") {
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
"$google_play_services_package:google_play_services_cast_java",
|
||||
"$google_play_services_package:google_play_services_fido_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
@@ -798,7 +797,6 @@ android_library("chrome_test_java") {
|
||||
"$google_play_services_package:google_play_services_cast_framework_java",
|
||||
"$google_play_services_package:google_play_services_cast_java",
|
||||
"$google_play_services_package:google_play_services_fido_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
@@ -1543,7 +1541,6 @@ android_library("browser_java_test_support") {
|
||||
]
|
||||
deps = [
|
||||
":chrome_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//chrome/android/public/profiles:java",
|
||||
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
|
||||
@@ -41,7 +41,7 @@ public class BackgroundSyncLauncher {
|
||||
* Automatic GCM use is disabled by tests, and also by this class if it is determined on
|
||||
* creation that the installed Play Services library is out of date.
|
||||
*/
|
||||
- private static boolean sGCMEnabled = true;
|
||||
+ private static boolean sGCMEnabled;
|
||||
|
||||
@VisibleForTesting
|
||||
protected AsyncTask<Void> mLaunchBrowserIfStoppedTask;
|
||||
@@ -140,20 +140,7 @@ public class BackgroundSyncLauncher {
|
||||
*/
|
||||
@CalledByNative
|
||||
private static boolean shouldDisableBackgroundSync() {
|
||||
- // Check to see if Play Services is up to date, and disable GCM if not.
|
||||
- // This will not automatically set {@link sGCMEnabled} to true, in case it has been
|
||||
- // disabled in tests.
|
||||
- if (sGCMEnabled) {
|
||||
- boolean isAvailable = true;
|
||||
- if (!ExternalAuthUtils.canUseGooglePlayServices()) {
|
||||
- setGCMEnabled(false);
|
||||
- Log.i(TAG, "Disabling Background Sync because Play Services is not up to date.");
|
||||
- isAvailable = false;
|
||||
- }
|
||||
- RecordHistogram.recordBooleanHistogram(
|
||||
- "BackgroundSync.LaunchTask.PlayServicesAvailable", isAvailable);
|
||||
- }
|
||||
- return !sGCMEnabled;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
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
|
||||
@@ -6,10 +6,6 @@ package org.chromium.chrome.browser;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.GcmTaskService;
|
||||
-import com.google.android.gms.gcm.TaskParams;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.library_loader.ProcessInitException;
|
||||
@@ -27,67 +23,9 @@ import org.chromium.content_public.browser.UiThreadTaskTraits;
|
||||
* browser needs to be launched for scheduled tasks, or in response to changing network or power
|
||||
* conditions.
|
||||
*/
|
||||
-public class ChromeBackgroundService extends GcmTaskService {
|
||||
+public class ChromeBackgroundService {
|
||||
private static final String TAG = "BackgroundService";
|
||||
|
||||
- @Override
|
||||
- @VisibleForTesting
|
||||
- public int onRunTask(final TaskParams params) {
|
||||
- final String taskTag = params.getTag();
|
||||
- final Context context = this;
|
||||
- PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> {
|
||||
- switch (taskTag) {
|
||||
- case BackgroundSyncLauncher.TASK_TAG:
|
||||
- handleBackgroundSyncEvent(context, taskTag);
|
||||
- break;
|
||||
-
|
||||
- case OfflinePageUtils.TASK_TAG:
|
||||
- // Offline pages are migrating to BackgroundTaskScheduler, therefore getting
|
||||
- // a task through ChromeBackgroundSerivce should cause a rescheduling using
|
||||
- // the new component.
|
||||
- rescheduleOfflinePages();
|
||||
- break;
|
||||
-
|
||||
- case SnippetsLauncher.TASK_TAG_WIFI:
|
||||
- case SnippetsLauncher.TASK_TAG_FALLBACK:
|
||||
- handleSnippetsOnPersistentSchedulerWakeUp(context, taskTag);
|
||||
- break;
|
||||
-
|
||||
- // This is only for tests.
|
||||
- case ServiceManagerStartupUtils.TASK_TAG:
|
||||
- handleServicificationStartupTask(context, taskTag);
|
||||
- break;
|
||||
-
|
||||
- default:
|
||||
- Log.i(TAG, "Unknown task tag " + taskTag);
|
||||
- break;
|
||||
- }
|
||||
- });
|
||||
-
|
||||
- return GcmNetworkManager.RESULT_SUCCESS;
|
||||
- }
|
||||
-
|
||||
- private void handleBackgroundSyncEvent(Context context, String tag) {
|
||||
- if (!BackgroundSyncLauncher.hasInstance()) {
|
||||
- // Start the browser. The browser's BackgroundSyncManager (for the active profile) will
|
||||
- // start, check the network, and run any necessary sync events. This task runs with a
|
||||
- // wake lock, but has a three minute timeout, so we need to start the browser in its
|
||||
- // own task.
|
||||
- // TODO(jkarlin): Protect the browser sync event with a wake lock.
|
||||
- // See crbug.com/486020.
|
||||
- launchBrowser(context, tag);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private void handleSnippetsOnPersistentSchedulerWakeUp(Context context, String tag) {
|
||||
- if (!SnippetsLauncher.hasInstance()) launchBrowser(context, tag);
|
||||
- snippetsOnPersistentSchedulerWakeUp();
|
||||
- }
|
||||
-
|
||||
- private void handleServicificationStartupTask(Context context, String tag) {
|
||||
- launchBrowser(context, tag);
|
||||
- }
|
||||
-
|
||||
@VisibleForTesting
|
||||
protected void snippetsOnPersistentSchedulerWakeUp() {
|
||||
SnippetsBridge.onPersistentSchedulerWakeUp();
|
||||
@@ -115,23 +53,8 @@ public class ChromeBackgroundService extends GcmTaskService {
|
||||
protected void rescheduleBackgroundSyncTasksOnUpgrade() {
|
||||
}
|
||||
|
||||
- private void handleSnippetsOnBrowserUpgraded() {
|
||||
- if (SnippetsLauncher.shouldNotifyOnBrowserUpgraded()) {
|
||||
- if (!SnippetsLauncher.hasInstance()) {
|
||||
- launchBrowser(this, /*tag=*/""); // The |tag| doesn't matter here.
|
||||
- }
|
||||
- snippetsOnBrowserUpgraded();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/** Reschedules offline pages (using appropriate version of Background Task Scheduler). */
|
||||
protected void rescheduleOfflinePages() {
|
||||
BackgroundScheduler.getInstance().reschedule();
|
||||
}
|
||||
-
|
||||
- @Override
|
||||
- public void onInitializeTasks() {
|
||||
- rescheduleBackgroundSyncTasksOnUpgrade();
|
||||
- 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
|
||||
@@ -167,6 +167,7 @@ public class InvalidationController implements ApplicationStatus.ApplicationStat
|
||||
|
||||
// Ensure GCM has been initialized.
|
||||
ensureGcmIsInitialized();
|
||||
+ if (!mGcmInitialized) return;
|
||||
|
||||
// Do not apply changes to {@link #mSessionInvalidationsEnabled} yet because the timer task
|
||||
// may be scheduled far into the future.
|
||||
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
|
||||
@@ -35,7 +35,7 @@ public class SnippetsLauncher {
|
||||
// If it is non-null then the browser is running.
|
||||
private static SnippetsLauncher sInstance;
|
||||
|
||||
- private boolean mGCMEnabled = true;
|
||||
+ private boolean mGCMEnabled;
|
||||
|
||||
/**
|
||||
* Create a SnippetsLauncher object, which is owned by C++.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
|
||||
@@ -11,7 +11,6 @@ import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmListenerService;
|
||||
import com.google.ipc.invalidation.ticl.android2.channel.AndroidGcmController;
|
||||
|
||||
import org.chromium.base.ContextUtils;
|
||||
@@ -35,62 +34,9 @@ import org.chromium.content_public.browser.UiThreadTaskTraits;
|
||||
/**
|
||||
* Receives Downstream messages and status of upstream messages from GCM.
|
||||
*/
|
||||
-public class ChromeGcmListenerService extends GcmListenerService {
|
||||
+public class ChromeGcmListenerService {
|
||||
private static final String TAG = "ChromeGcmListener";
|
||||
|
||||
- @Override
|
||||
- public void onCreate() {
|
||||
- ProcessInitializationHandler.getInstance().initializePreNative();
|
||||
- super.onCreate();
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onMessageReceived(final String from, final Bundle data) {
|
||||
- boolean hasCollapseKey = !TextUtils.isEmpty(data.getString("collapse_key"));
|
||||
- GcmUma.recordDataMessageReceived(ContextUtils.getApplicationContext(), hasCollapseKey);
|
||||
-
|
||||
- String invalidationSenderId = AndroidGcmController.get(this).getSenderId();
|
||||
- if (from.equals(invalidationSenderId)) {
|
||||
- AndroidGcmController.get(this).onMessageReceived(data);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- // Dispatch the message to the GCM Driver for native features.
|
||||
- PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> {
|
||||
- GCMMessage message = null;
|
||||
- try {
|
||||
- message = new GCMMessage(from, data);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- Log.e(TAG, "Received an invalid GCM Message", e);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- scheduleOrDispatchMessageToDriver(message);
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onMessageSent(String msgId) {
|
||||
- Log.d(TAG, "Message sent successfully. Message id: " + msgId);
|
||||
- GcmUma.recordGcmUpstreamHistogram(
|
||||
- ContextUtils.getApplicationContext(), GcmUma.UMA_UPSTREAM_SUCCESS);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onSendError(String msgId, String error) {
|
||||
- Log.w(TAG, "Error in sending message. Message id: " + msgId + " Error: " + error);
|
||||
- GcmUma.recordGcmUpstreamHistogram(
|
||||
- ContextUtils.getApplicationContext(), GcmUma.UMA_UPSTREAM_SEND_FAILED);
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void onDeletedMessages() {
|
||||
- // TODO(johnme): Ask GCM to include the subtype in this event.
|
||||
- Log.w(TAG, "Push messages were deleted, but we can't tell the Service Worker as we don't"
|
||||
- + "know what subtype (app ID) it occurred for.");
|
||||
- GcmUma.recordDeletedMessages(ContextUtils.getApplicationContext());
|
||||
- }
|
||||
-
|
||||
/**
|
||||
* Returns if we deliver the GCMMessage with a background service by calling
|
||||
* Context#startService. This will only work if Android has put us in a whitelist to allow
|
||||
@@ -225,8 +171,6 @@ public class ChromeGcmListenerService extends GcmListenerService {
|
||||
|
||||
try {
|
||||
ChromeBrowserInitializer.getInstance(applicationContext).handleSynchronousStartup();
|
||||
- GCMDriver.dispatchMessage(message);
|
||||
-
|
||||
} catch (ProcessInitException e) {
|
||||
Log.e(TAG, "ProcessInitException while starting the browser process");
|
||||
|
||||
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
|
||||
@@ -54,7 +54,6 @@ if (is_android) {
|
||||
":scheduled_task_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//content/public/android:content_java",
|
||||
@@ -78,7 +77,6 @@ if (is_android) {
|
||||
":background_task_scheduler_task_ids_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
@@ -109,7 +107,6 @@ if (is_android) {
|
||||
"$google_play_services_package:google_play_services_auth_base_java",
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java
|
||||
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java
|
||||
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java
|
||||
@@ -6,10 +6,6 @@ package org.chromium.components.background_task_scheduler;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.GcmTaskService;
|
||||
-import com.google.android.gms.gcm.TaskParams;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
@@ -20,7 +16,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/** Delegates calls out to various tasks that need to run in the background. */
|
||||
-public class BackgroundTaskGcmTaskService extends GcmTaskService {
|
||||
+public class BackgroundTaskGcmTaskService {
|
||||
private static final String TAG = "BkgrdTaskGcmTS";
|
||||
|
||||
private BackgroundTaskSchedulerGcmNetworkManager.Clock mClock = System::currentTimeMillis;
|
||||
@@ -90,63 +86,6 @@ public class BackgroundTaskGcmTaskService extends GcmTaskService {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public int onRunTask(TaskParams params) {
|
||||
- final TaskParameters taskParams =
|
||||
- BackgroundTaskSchedulerGcmNetworkManager.getTaskParametersFromTaskParams(params);
|
||||
-
|
||||
- final BackgroundTask backgroundTask =
|
||||
- BackgroundTaskSchedulerFactory.getBackgroundTaskFromTaskId(taskParams.getTaskId());
|
||||
- if (backgroundTask == null) {
|
||||
- Log.w(TAG, "Failed to start task. Could not instantiate BackgroundTask class.");
|
||||
- // Cancel task if the BackgroundTask class is not found anymore. We assume this means
|
||||
- // that the task has been deprecated.
|
||||
- BackgroundTaskSchedulerFactory.getScheduler().cancel(
|
||||
- ContextUtils.getApplicationContext(), taskParams.getTaskId());
|
||||
- return GcmNetworkManager.RESULT_FAILURE;
|
||||
- }
|
||||
-
|
||||
- if (BackgroundTaskSchedulerGcmNetworkManager.didTaskExpire(
|
||||
- params, mClock.currentTimeMillis())) {
|
||||
- BackgroundTaskSchedulerUma.getInstance().reportTaskExpired(taskParams.getTaskId());
|
||||
- return GcmNetworkManager.RESULT_FAILURE;
|
||||
- }
|
||||
-
|
||||
- final Waiter waiter = new Waiter(Waiter.MAX_TIMEOUT_SECONDS);
|
||||
-
|
||||
- final AtomicBoolean taskNeedsBackgroundProcessing = new AtomicBoolean();
|
||||
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
- BackgroundTaskSchedulerUma.getInstance().reportTaskStarted(taskParams.getTaskId());
|
||||
- taskNeedsBackgroundProcessing.set(
|
||||
- backgroundTask.onStartTask(ContextUtils.getApplicationContext(), taskParams,
|
||||
- new TaskFinishedCallbackGcmTaskService(waiter)));
|
||||
- }
|
||||
- });
|
||||
-
|
||||
- if (!taskNeedsBackgroundProcessing.get()) return GcmNetworkManager.RESULT_SUCCESS;
|
||||
-
|
||||
- waiter.startWaiting();
|
||||
-
|
||||
- if (waiter.isRescheduleNeeded()) return GcmNetworkManager.RESULT_RESCHEDULE;
|
||||
- if (!waiter.hasTaskTimedOut()) return GcmNetworkManager.RESULT_SUCCESS;
|
||||
-
|
||||
- final AtomicBoolean taskNeedsRescheduling = new AtomicBoolean();
|
||||
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
- BackgroundTaskSchedulerUma.getInstance().reportTaskStopped(taskParams.getTaskId());
|
||||
- taskNeedsRescheduling.set(backgroundTask.onStopTask(
|
||||
- ContextUtils.getApplicationContext(), taskParams));
|
||||
- }
|
||||
- });
|
||||
-
|
||||
- if (taskNeedsRescheduling.get()) return GcmNetworkManager.RESULT_RESCHEDULE;
|
||||
-
|
||||
- return GcmNetworkManager.RESULT_SUCCESS;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
public void onInitializeTasks() {
|
||||
// Ignore the event on OSs supporting JobScheduler.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) return;
|
||||
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
|
||||
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
|
||||
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java
|
||||
@@ -17,11 +17,7 @@ public final class BackgroundTaskSchedulerFactory {
|
||||
private static BackgroundTaskFactory sBackgroundTaskFactory;
|
||||
|
||||
static BackgroundTaskSchedulerDelegate getSchedulerDelegateForSdk(int sdkInt) {
|
||||
- if (sdkInt >= Build.VERSION_CODES.M) {
|
||||
- return new BackgroundTaskSchedulerJobService();
|
||||
- } else {
|
||||
- return new BackgroundTaskSchedulerGcmNetworkManager();
|
||||
- }
|
||||
+ return new BackgroundTaskSchedulerJobService(); /* minSDK is 24 */
|
||||
}
|
||||
|
||||
/**
|
||||
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
|
||||
@@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* An implementation of {@link BackgroundTaskSchedulerDelegate} that uses the Play Services
|
||||
* {@link GcmNetworkManager} to schedule jobs.
|
||||
*/
|
||||
-class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedulerDelegate {
|
||||
+class BackgroundTaskSchedulerGcmNetworkManager {
|
||||
private static final String TAG = "BkgrdTaskSchedGcmNM";
|
||||
|
||||
/** Delta time for expiration checks, after the end time. */
|
||||
@@ -34,18 +34,6 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
sClock = clock;
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public boolean schedule(Context context, @NonNull TaskInfo taskInfo) {
|
||||
- ThreadUtils.assertOnUiThread();
|
||||
-
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void cancel(Context context, int taskId) {
|
||||
- ThreadUtils.assertOnUiThread();
|
||||
- }
|
||||
-
|
||||
private static String taskIdToTaskTag(int taskId) {
|
||||
return Integer.toString(taskId);
|
||||
}
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -844,21 +844,6 @@ android_aar_prebuilt("google_play_services_fido_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_gcm_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_gcm/play-services-gcm-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_gcm/com_google_android_gms_play_services_gcm.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_iid_java",
|
||||
- ":google_play_services_stats_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("google_play_services_iid_java") {
|
||||
aar_path = "libs/com_google_android_gms_play_services_iid/play-services-iid-15.0.1.aar"
|
||||
info_path = "libs/com_google_android_gms_play_services_iid/com_google_android_gms_play_services_iid.info"
|
||||
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
|
||||
@@ -137,7 +137,6 @@ if (is_android) {
|
||||
jacoco_never_instrument = true
|
||||
deps = [
|
||||
":cacheinvalidation_proto_java",
|
||||
- "$google_play_services_package:google_play_services_gcm_java",
|
||||
"$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//base:base_java",
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml
|
||||
@@ -24,17 +24,6 @@
|
||||
<receiver android:exported="false"
|
||||
android:name="com.google.ipc.invalidation.ticl2.android2.AndroidInternalScheduler$AlarmReceiver"/>
|
||||
|
||||
- <!-- GCM Broadcast Receiver -->
|
||||
- <receiver android:exported="true"
|
||||
- android:name="com.google.android.gms.gcm.GcmReceiver"
|
||||
- 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="com.google.ipc.invalidation.client2.android2"/>
|
||||
- </intent-filter>
|
||||
- </receiver>
|
||||
-
|
||||
<!-- InstanceID Listener Service -->
|
||||
<service android:exported="false"
|
||||
android:name="com.google.ipc.invalidation.ticl2.android2.channel.AndroidInstanceIDListenerService">
|
||||
@@ -42,14 +31,5 @@
|
||||
<action android:name="com.google.android.gms.iid.InstanceID"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
-
|
||||
- <!-- GcmTaskService for registration -->
|
||||
- <service android:name="com.google.ipc.invalidation.ticl2.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>
|
||||
</application>
|
||||
</manifest>
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java
|
||||
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.google.ipc.invalidation.ticl.android2.channel;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.OneoffTask;
|
||||
import com.google.ipc.invalidation.common.GcmSharedConstants;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
@@ -50,7 +48,7 @@ public class AndroidGcmController {
|
||||
|
||||
private static AndroidGcmController androidGcmController;
|
||||
|
||||
- private GcmNetworkManager gcmNetworkManager;
|
||||
+// private GcmNetworkManager gcmNetworkManager;
|
||||
|
||||
private Context context;
|
||||
|
||||
@@ -64,33 +62,13 @@ public class AndroidGcmController {
|
||||
public static AndroidGcmController get(Context context) {
|
||||
synchronized (lock) {
|
||||
if (androidGcmController == null) {
|
||||
- androidGcmController =
|
||||
- new AndroidGcmController(context, GcmNetworkManager.getInstance(context));
|
||||
+ androidGcmController = null;
|
||||
}
|
||||
}
|
||||
return androidGcmController;
|
||||
}
|
||||
|
||||
/**
|
||||
- * Override AndroidGcmController with a custom GcmNetworkManager in tests. This overrides the
|
||||
- * existing instance of AndroidGcmController if any.
|
||||
- *
|
||||
- * @param context the application context.
|
||||
- * @param gcmNetworkManager the custom GcmNetworkManager to use.
|
||||
- */
|
||||
- public static void overrideAndroidGcmControllerForTests(
|
||||
- Context context, GcmNetworkManager gcmNetworkManager) {
|
||||
- synchronized (lock) {
|
||||
- androidGcmController = new AndroidGcmController(context, gcmNetworkManager);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private AndroidGcmController(Context context, GcmNetworkManager gcmNetworkManager) {
|
||||
- this.context = context;
|
||||
- this.gcmNetworkManager = gcmNetworkManager;
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Returns true if no registration token is stored or the current application version is higher
|
||||
* than the version for the token stored.
|
||||
*/
|
||||
@@ -142,21 +120,7 @@ public class AndroidGcmController {
|
||||
return;
|
||||
}
|
||||
|
||||
- OneoffTask registrationTask =
|
||||
- new OneoffTask.Builder()
|
||||
- .setExecutionWindow(0, 1)
|
||||
- .setTag(AndroidChannelConstants.GCM_REGISTRATION_TASK_SERVICE_TAG)
|
||||
- .setService(GcmRegistrationTaskService.class)
|
||||
- .build();
|
||||
-
|
||||
- try {
|
||||
- gcmNetworkManager.schedule(registrationTask);
|
||||
- } catch (IllegalArgumentException exception) {
|
||||
- // Scheduling the service can throw an exception due to a framework error on Android when
|
||||
- // the the look up for the GCMTaskService being scheduled to be run fails.
|
||||
- // See crbug/548314.
|
||||
- logger.warning("Failed to schedule GCM registration task. Exception: %s", exception);
|
||||
- }
|
||||
+ logger.warning("Failed to schedule GCM registration task.");
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.google.ipc.invalidation.ticl.android2.channel;
|
||||
|
||||
-import com.google.android.gms.iid.InstanceIDListenerService;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
|
||||
@@ -23,16 +22,6 @@ import com.google.ipc.invalidation.external.client.android.service.AndroidLogger
|
||||
* Implementation of {@link InstanceIDListenerService} to receive notifications from GCM to
|
||||
* update the registration token.
|
||||
*/
|
||||
-public class AndroidInstanceIDListenerService extends InstanceIDListenerService {
|
||||
+public class AndroidInstanceIDListenerService {
|
||||
private static final Logger logger = AndroidLogger.forTag("InstanceIDListener");
|
||||
-
|
||||
- /**
|
||||
- * Called when the token needs to updated. {@link AndroidGcmController#fetchToken} clears the
|
||||
- * current token and schedules a task to fetch a new token.
|
||||
- */
|
||||
- @Override
|
||||
- public void onTokenRefresh() {
|
||||
- logger.info("Received token refresh request");
|
||||
- AndroidGcmController.get(this).fetchToken();
|
||||
- }
|
||||
}
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java
|
||||
@@ -15,11 +15,6 @@
|
||||
*/
|
||||
package com.google.ipc.invalidation.ticl.android2.channel;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.GcmTaskService;
|
||||
-import com.google.android.gms.gcm.GoogleCloudMessaging;
|
||||
-import com.google.android.gms.gcm.TaskParams;
|
||||
-import com.google.android.gms.iid.InstanceID;
|
||||
import com.google.ipc.invalidation.common.GcmSharedConstants;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
@@ -42,88 +37,6 @@ import java.io.IOException;
|
||||
* failure to fetch the token, the task is rescheduled using the GcmNetworkManager which uses
|
||||
* exponential back-offs to control when the task is executed.
|
||||
*/
|
||||
-public class GcmRegistrationTaskService extends GcmTaskService {
|
||||
+public class GcmRegistrationTaskService {
|
||||
private static final Logger logger = AndroidLogger.forTag("RegistrationTaskService");
|
||||
-
|
||||
- public InstanceID getInstanceID(Context context) {
|
||||
- return InstanceID.getInstance(context);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Called when the task is ready to be executed. Registers with GCM using
|
||||
- * {@link InstanceID#getToken} and stores the registration token.
|
||||
- *
|
||||
- * <p>Returns {@link GcmNetworkManager#RESULT_SUCCESS} when the token is successfully retrieved.
|
||||
- * On failure {@link GcmNetworkManager#RESULT_RESCHEDULE} is used which reschedules the service
|
||||
- * to be executed again using exponential back-off.
|
||||
- */
|
||||
- @Override
|
||||
- public int onRunTask(TaskParams params) {
|
||||
- if (!AndroidChannelConstants.GCM_REGISTRATION_TASK_SERVICE_TAG.equals(params.getTag())) {
|
||||
- logger.warning("Unknown task received with tag: %s", params.getTag());
|
||||
- return GcmNetworkManager.RESULT_FAILURE;
|
||||
- }
|
||||
-
|
||||
- String senderId = GcmSharedConstants.GCM_UPDATED_SENDER_ID;
|
||||
- try {
|
||||
- String token = getInstanceID(this).getToken(
|
||||
- senderId, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
|
||||
- storeToken(token);
|
||||
- return GcmNetworkManager.RESULT_SUCCESS;
|
||||
- } catch (IOException exception) {
|
||||
- logger.warning("Failed to get token for sender: %s. Exception : %s", senderId, exception);
|
||||
- return GcmNetworkManager.RESULT_RESCHEDULE;
|
||||
- } catch (SecurityException exception) {
|
||||
- // InstanceID#getToken occasionally throws a security exception when trying send the
|
||||
- // registration intent to GMSCore. Catching the exception here to prevent crashes.
|
||||
- logger.warning("Security exception when fetching token: %s", exception);
|
||||
- return GcmNetworkManager.RESULT_RESCHEDULE;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /** Stores the registration token and the current application version in Shared Preferences. */
|
||||
- private void storeToken(String token) {
|
||||
- AndroidChannelPreferences.setRegistrationToken(token);
|
||||
- AndroidChannelPreferences.setAppVersion(
|
||||
- CommonUtils.getPackageVersion(this, getPackageName()));
|
||||
- // Send the updated token to the server.
|
||||
- updateServer();
|
||||
- }
|
||||
-
|
||||
- /** Sends a message to the server to update the GCM registration token. */
|
||||
- private void updateServer() {
|
||||
- // Inform the sender service that the registration token has changed. If the sender service
|
||||
- // had buffered a message because no registration token was previously available, this intent
|
||||
- // will cause it to send that message.
|
||||
- Intent sendBuffered = new Intent();
|
||||
- final String ignoredData = "";
|
||||
- sendBuffered.putExtra(AndroidChannelConstants.MESSAGE_SENDER_SVC_GCM_REGID_CHANGE, ignoredData);
|
||||
-
|
||||
- // Select the sender service to use for upstream message.
|
||||
- if (AndroidChannelPreferences.getGcmChannelType() == GcmChannelType.GCM_UPSTREAM) {
|
||||
- String upstreamServiceClass = new AndroidTiclManifest(this).getGcmUpstreamServiceClass();
|
||||
- if (upstreamServiceClass == null) {
|
||||
- logger.warning("GcmUpstreamSenderService class not found.");
|
||||
- return;
|
||||
- }
|
||||
- sendBuffered.setClassName(this, upstreamServiceClass);
|
||||
- } else {
|
||||
- sendBuffered.setClass(this, AndroidMessageSenderService.class);
|
||||
- }
|
||||
- try {
|
||||
- startService(sendBuffered);
|
||||
- } catch (IllegalStateException exception) {
|
||||
- logger.warning("Unable to send buffered message(s): %s", exception);
|
||||
- }
|
||||
-
|
||||
- // Inform the Ticl service that the registration id has changed. This will cause it to send
|
||||
- // a message to the data center and update the GCM registration id stored at the data center.
|
||||
- Intent updateServer = ProtocolIntents.InternalDowncalls.newNetworkAddrChangeIntent();
|
||||
- updateServer.setClassName(this, new AndroidTiclManifest(this).getTiclServiceClass());
|
||||
- try {
|
||||
- startService(updateServer);
|
||||
- } catch (IllegalStateException exception) {
|
||||
- logger.warning("Unable to inform server about new registration id: %s", exception);
|
||||
- }
|
||||
- }
|
||||
}
|
||||
--
|
||||
2.11.0
|
||||
|
||||
+575
@@ -0,0 +1,575 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Fri, 1 Nov 2019 23:10:47 +0100
|
||||
Subject: Remove dependency on com.google.android.gms.vision,
|
||||
com.google.android.gms.clearcut, com.google.android.gms.phenotype
|
||||
|
||||
---
|
||||
services/BUILD.gn | 4 -
|
||||
services/shape_detection/BUILD.gn | 2 -
|
||||
.../shape_detection/BarcodeDetectionImpl.java | 114 +------------------
|
||||
.../BarcodeDetectionProviderImpl.java | 18 +--
|
||||
.../shape_detection/FaceDetectionImplGmsCore.java | 122 +--------------------
|
||||
.../shape_detection/TextDetectionImpl.java | 60 +---------
|
||||
third_party/android_deps/BUILD.gn | 66 -----------
|
||||
7 files changed, 10 insertions(+), 376 deletions(-)
|
||||
|
||||
diff --git a/services/BUILD.gn b/services/BUILD.gn
|
||||
--- a/services/BUILD.gn
|
||||
+++ b/services/BUILD.gn
|
||||
@@ -109,8 +109,6 @@ if (is_android) {
|
||||
deps = [
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_vision_common_java",
|
||||
- "$google_play_services_package:google_play_services_vision_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//base:base_junit_test_support",
|
||||
@@ -140,8 +138,6 @@ if (is_android) {
|
||||
deps = [
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_vision_common_java",
|
||||
- "$google_play_services_package:google_play_services_vision_java",
|
||||
"//base:base_java",
|
||||
"//base:base_java_test_support",
|
||||
"//mojo/public/java:base_java",
|
||||
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
|
||||
--- a/services/shape_detection/BUILD.gn
|
||||
+++ b/services/shape_detection/BUILD.gn
|
||||
@@ -91,8 +91,6 @@ if (is_android) {
|
||||
deps = [
|
||||
"$google_play_services_package:google_play_services_base_java",
|
||||
"$google_play_services_package:google_play_services_basement_java",
|
||||
- "$google_play_services_package:google_play_services_vision_common_java",
|
||||
- "$google_play_services_package:google_play_services_vision_java",
|
||||
"//base:base_java",
|
||||
"//mojo/public/java:base_java",
|
||||
"//mojo/public/java:bindings_java",
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java
|
||||
@@ -8,10 +8,6 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.util.SparseArray;
|
||||
|
||||
-import com.google.android.gms.vision.Frame;
|
||||
-import com.google.android.gms.vision.barcode.Barcode;
|
||||
-import com.google.android.gms.vision.barcode.BarcodeDetector;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.gfx.mojom.PointF;
|
||||
@@ -28,50 +24,7 @@ import org.chromium.shape_detection.mojom.BarcodeFormat;
|
||||
public class BarcodeDetectionImpl implements BarcodeDetection {
|
||||
private static final String TAG = "BarcodeDetectionImpl";
|
||||
|
||||
- private BarcodeDetector mBarcodeDetector;
|
||||
-
|
||||
public BarcodeDetectionImpl(BarcodeDetectorOptions options) {
|
||||
- int formats = Barcode.ALL_FORMATS;
|
||||
- if (options.formats != null && options.formats.length > 0) {
|
||||
- formats = 0;
|
||||
- // Keep this list in sync with the constants defined in
|
||||
- // com.google.android.gms.vision.barcode.Barcode and the list of
|
||||
- // supported formats in BarcodeDetectionProviderImpl.
|
||||
- for (int i = 0; i < options.formats.length; ++i) {
|
||||
- if (options.formats[i] == BarcodeFormat.AZTEC) {
|
||||
- formats |= Barcode.AZTEC;
|
||||
- } else if (options.formats[i] == BarcodeFormat.CODE_128) {
|
||||
- formats |= Barcode.CODE_128;
|
||||
- } else if (options.formats[i] == BarcodeFormat.CODE_39) {
|
||||
- formats |= Barcode.CODE_39;
|
||||
- } else if (options.formats[i] == BarcodeFormat.CODE_93) {
|
||||
- formats |= Barcode.CODE_93;
|
||||
- } else if (options.formats[i] == BarcodeFormat.CODABAR) {
|
||||
- formats |= Barcode.CODABAR;
|
||||
- } else if (options.formats[i] == BarcodeFormat.DATA_MATRIX) {
|
||||
- formats |= Barcode.DATA_MATRIX;
|
||||
- } else if (options.formats[i] == BarcodeFormat.EAN_13) {
|
||||
- formats |= Barcode.EAN_13;
|
||||
- } else if (options.formats[i] == BarcodeFormat.EAN_8) {
|
||||
- formats |= Barcode.EAN_8;
|
||||
- } else if (options.formats[i] == BarcodeFormat.ITF) {
|
||||
- formats |= Barcode.ITF;
|
||||
- } else if (options.formats[i] == BarcodeFormat.PDF417) {
|
||||
- formats |= Barcode.PDF417;
|
||||
- } else if (options.formats[i] == BarcodeFormat.QR_CODE) {
|
||||
- formats |= Barcode.QR_CODE;
|
||||
- } else if (options.formats[i] == BarcodeFormat.UPC_A) {
|
||||
- formats |= Barcode.UPC_A;
|
||||
- } else if (options.formats[i] == BarcodeFormat.UPC_E) {
|
||||
- formats |= Barcode.UPC_E;
|
||||
- } else {
|
||||
- Log.e(TAG, "Unsupported barcode format hint: " + options.formats[i]);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- mBarcodeDetector = new BarcodeDetector.Builder(ContextUtils.getApplicationContext())
|
||||
- .setBarcodeFormats(formats)
|
||||
- .build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,47 +33,12 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
|
||||
// on the device; this happens "fast", but it might have not completed,
|
||||
// bail in this case. Also, the API was disabled between and v.9.0 and
|
||||
// v.9.2, see https://developers.google.com/android/guides/releases.
|
||||
- if (!mBarcodeDetector.isOperational()) {
|
||||
- Log.e(TAG, "BarcodeDetector is not operational");
|
||||
- callback.call(new BarcodeDetectionResult[0]);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- Frame frame = BitmapUtils.convertToFrame(bitmapData);
|
||||
- if (frame == null) {
|
||||
- Log.e(TAG, "Error converting Mojom Bitmap to Frame");
|
||||
- callback.call(new BarcodeDetectionResult[0]);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- final SparseArray<Barcode> barcodes = mBarcodeDetector.detect(frame);
|
||||
-
|
||||
- BarcodeDetectionResult[] barcodeArray = new BarcodeDetectionResult[barcodes.size()];
|
||||
- for (int i = 0; i < barcodes.size(); i++) {
|
||||
- barcodeArray[i] = new BarcodeDetectionResult();
|
||||
- final Barcode barcode = barcodes.valueAt(i);
|
||||
- barcodeArray[i].rawValue = barcode.rawValue;
|
||||
- final Rect rect = barcode.getBoundingBox();
|
||||
- barcodeArray[i].boundingBox = new RectF();
|
||||
- barcodeArray[i].boundingBox.x = rect.left;
|
||||
- barcodeArray[i].boundingBox.y = rect.top;
|
||||
- barcodeArray[i].boundingBox.width = rect.width();
|
||||
- barcodeArray[i].boundingBox.height = rect.height();
|
||||
- final Point[] corners = barcode.cornerPoints;
|
||||
- barcodeArray[i].cornerPoints = new PointF[corners.length];
|
||||
- for (int j = 0; j < corners.length; j++) {
|
||||
- barcodeArray[i].cornerPoints[j] = new PointF();
|
||||
- barcodeArray[i].cornerPoints[j].x = corners[j].x;
|
||||
- barcodeArray[i].cornerPoints[j].y = corners[j].y;
|
||||
- }
|
||||
- barcodeArray[i].format = toBarcodeFormat(barcode.format);
|
||||
- }
|
||||
- callback.call(barcodeArray);
|
||||
+ Log.e(TAG, "BarcodeDetector is not operational");
|
||||
+ callback.call(new BarcodeDetectionResult[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
- mBarcodeDetector.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,34 +47,6 @@ public class BarcodeDetectionImpl implements BarcodeDetection {
|
||||
}
|
||||
|
||||
private int toBarcodeFormat(int format) {
|
||||
- switch (format) {
|
||||
- case Barcode.CODE_128:
|
||||
- return BarcodeFormat.CODE_128;
|
||||
- case Barcode.CODE_39:
|
||||
- return BarcodeFormat.CODE_39;
|
||||
- case Barcode.CODE_93:
|
||||
- return BarcodeFormat.CODE_93;
|
||||
- case Barcode.CODABAR:
|
||||
- return BarcodeFormat.CODABAR;
|
||||
- case Barcode.DATA_MATRIX:
|
||||
- return BarcodeFormat.DATA_MATRIX;
|
||||
- case Barcode.EAN_13:
|
||||
- return BarcodeFormat.EAN_13;
|
||||
- case Barcode.EAN_8:
|
||||
- return BarcodeFormat.EAN_8;
|
||||
- case Barcode.ITF:
|
||||
- return BarcodeFormat.ITF;
|
||||
- case Barcode.QR_CODE:
|
||||
- return BarcodeFormat.QR_CODE;
|
||||
- case Barcode.UPC_A:
|
||||
- return BarcodeFormat.UPC_A;
|
||||
- case Barcode.UPC_E:
|
||||
- return BarcodeFormat.UPC_E;
|
||||
- case Barcode.PDF417:
|
||||
- return BarcodeFormat.PDF417;
|
||||
- case Barcode.AZTEC:
|
||||
- return BarcodeFormat.AZTEC;
|
||||
- }
|
||||
return BarcodeFormat.UNKNOWN;
|
||||
}
|
||||
}
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java
|
||||
@@ -4,9 +4,6 @@
|
||||
|
||||
package org.chromium.shape_detection;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.mojo.bindings.InterfaceRequest;
|
||||
@@ -35,12 +32,6 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
|
||||
// Keep this list in sync with the constants defined in
|
||||
// com.google.android.gms.vision.barcode.Barcode and the format hints
|
||||
// supported by BarcodeDetectionImpl.
|
||||
- int[] supportedFormats = {BarcodeFormat.AZTEC, BarcodeFormat.CODE_128,
|
||||
- BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODABAR,
|
||||
- BarcodeFormat.DATA_MATRIX, BarcodeFormat.EAN_13, BarcodeFormat.EAN_8,
|
||||
- BarcodeFormat.ITF, BarcodeFormat.PDF417, BarcodeFormat.QR_CODE, BarcodeFormat.UPC_A,
|
||||
- BarcodeFormat.UPC_E};
|
||||
- callback.call(supportedFormats);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,12 +41,7 @@ public class BarcodeDetectionProviderImpl implements BarcodeDetectionProvider {
|
||||
public void onConnectionError(MojoException e) {}
|
||||
|
||||
public static BarcodeDetectionProvider create() {
|
||||
- if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext())
|
||||
- != ConnectionResult.SUCCESS) {
|
||||
- Log.e(TAG, "Google Play Services not available");
|
||||
- return null;
|
||||
- }
|
||||
- return new BarcodeDetectionProviderImpl();
|
||||
+ Log.e(TAG, "Google Play Services not available");
|
||||
+ return null;
|
||||
}
|
||||
}
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java
|
||||
@@ -7,11 +7,6 @@ package org.chromium.shape_detection;
|
||||
import android.graphics.PointF;
|
||||
import android.util.SparseArray;
|
||||
|
||||
-import com.google.android.gms.vision.Frame;
|
||||
-import com.google.android.gms.vision.face.Face;
|
||||
-import com.google.android.gms.vision.face.FaceDetector;
|
||||
-import com.google.android.gms.vision.face.Landmark;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.gfx.mojom.RectF;
|
||||
@@ -36,133 +31,20 @@ public class FaceDetectionImplGmsCore implements FaceDetection {
|
||||
private static final int MAX_EULER_Z = 15;
|
||||
private final int mMaxFaces;
|
||||
private final boolean mFastMode;
|
||||
- private final FaceDetector mFaceDetector;
|
||||
|
||||
FaceDetectionImplGmsCore(FaceDetectorOptions options) {
|
||||
- FaceDetector.Builder builder =
|
||||
- new FaceDetector.Builder(ContextUtils.getApplicationContext());
|
||||
mMaxFaces = Math.min(options.maxDetectedFaces, MAX_FACES);
|
||||
mFastMode = options.fastMode;
|
||||
-
|
||||
- try {
|
||||
- builder.setMode(mFastMode ? FaceDetector.FAST_MODE : FaceDetector.ACCURATE_MODE);
|
||||
- builder.setLandmarkType(FaceDetector.ALL_LANDMARKS);
|
||||
- if (mMaxFaces == 1) {
|
||||
- builder.setProminentFaceOnly(true);
|
||||
- }
|
||||
- } catch (IllegalArgumentException e) {
|
||||
- Log.e(TAG, "Unexpected exception " + e);
|
||||
- assert false;
|
||||
- }
|
||||
-
|
||||
- mFaceDetector = builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detect(org.chromium.skia.mojom.Bitmap bitmapData, DetectResponse callback) {
|
||||
- // The vision library will be downloaded the first time the API is used
|
||||
- // on the device; this happens "fast", but it might have not completed,
|
||||
- // bail in this case.
|
||||
- if (!mFaceDetector.isOperational()) {
|
||||
- Log.e(TAG, "FaceDetector is not operational");
|
||||
-
|
||||
- // Fallback to Android's FaceDetectionImpl.
|
||||
- FaceDetectorOptions options = new FaceDetectorOptions();
|
||||
- options.fastMode = mFastMode;
|
||||
- options.maxDetectedFaces = mMaxFaces;
|
||||
- FaceDetectionImpl detector = new FaceDetectionImpl(options);
|
||||
- detector.detect(bitmapData, callback);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- Frame frame = BitmapUtils.convertToFrame(bitmapData);
|
||||
- if (frame == null) {
|
||||
- Log.e(TAG, "Error converting Mojom Bitmap to Frame");
|
||||
- callback.call(new FaceDetectionResult[0]);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- final SparseArray<Face> faces = mFaceDetector.detect(frame);
|
||||
-
|
||||
- FaceDetectionResult[] faceArray = new FaceDetectionResult[faces.size()];
|
||||
- for (int i = 0; i < faces.size(); i++) {
|
||||
- faceArray[i] = new FaceDetectionResult();
|
||||
- final Face face = faces.valueAt(i);
|
||||
-
|
||||
- final List<Landmark> landmarks = face.getLandmarks();
|
||||
- ArrayList<org.chromium.shape_detection.mojom.Landmark> mojoLandmarks =
|
||||
- new ArrayList<org.chromium.shape_detection.mojom.Landmark>(landmarks.size());
|
||||
-
|
||||
- int leftEyeIndex = -1;
|
||||
- int rightEyeIndex = -1;
|
||||
- int bottomMouthIndex = -1;
|
||||
- for (int j = 0; j < landmarks.size(); j++) {
|
||||
- final Landmark landmark = landmarks.get(j);
|
||||
- final int landmarkType = landmark.getType();
|
||||
- if (landmarkType != Landmark.LEFT_EYE && landmarkType != Landmark.RIGHT_EYE
|
||||
- && landmarkType != Landmark.BOTTOM_MOUTH
|
||||
- && landmarkType != Landmark.NOSE_BASE) {
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- org.chromium.shape_detection.mojom.Landmark mojoLandmark =
|
||||
- new org.chromium.shape_detection.mojom.Landmark();
|
||||
- mojoLandmark.locations = new org.chromium.gfx.mojom.PointF[1];
|
||||
- mojoLandmark.locations[0] = new org.chromium.gfx.mojom.PointF();
|
||||
- mojoLandmark.locations[0].x = landmark.getPosition().x;
|
||||
- mojoLandmark.locations[0].y = landmark.getPosition().y;
|
||||
-
|
||||
- if (landmarkType == Landmark.LEFT_EYE) {
|
||||
- mojoLandmark.type = LandmarkType.EYE;
|
||||
- leftEyeIndex = j;
|
||||
- } else if (landmarkType == Landmark.RIGHT_EYE) {
|
||||
- mojoLandmark.type = LandmarkType.EYE;
|
||||
- rightEyeIndex = j;
|
||||
- } else if (landmarkType == Landmark.BOTTOM_MOUTH) {
|
||||
- mojoLandmark.type = LandmarkType.MOUTH;
|
||||
- bottomMouthIndex = j;
|
||||
- } else {
|
||||
- assert landmarkType == Landmark.NOSE_BASE;
|
||||
- mojoLandmark.type = LandmarkType.NOSE;
|
||||
- }
|
||||
- mojoLandmarks.add(mojoLandmark);
|
||||
- }
|
||||
- faceArray[i].landmarks = mojoLandmarks.toArray(
|
||||
- new org.chromium.shape_detection.mojom.Landmark[mojoLandmarks.size()]);
|
||||
-
|
||||
- final PointF corner = face.getPosition();
|
||||
- faceArray[i].boundingBox = new RectF();
|
||||
- if (leftEyeIndex != -1 && rightEyeIndex != -1
|
||||
- && Math.abs(face.getEulerZ()) < MAX_EULER_Z) {
|
||||
- // Tighter calculation of the bounding box because the GMScore
|
||||
- // and Android Face APIs give different results.
|
||||
- final PointF leftEyePoint = landmarks.get(leftEyeIndex).getPosition();
|
||||
- final PointF rightEyePoint = landmarks.get(rightEyeIndex).getPosition();
|
||||
- final float eyesDistance = leftEyePoint.x - rightEyePoint.x;
|
||||
- final float eyeMouthDistance = bottomMouthIndex != -1
|
||||
- ? landmarks.get(bottomMouthIndex).getPosition().y - leftEyePoint.y
|
||||
- : -1;
|
||||
- final PointF midEyePoint =
|
||||
- new PointF(corner.x + face.getWidth() / 2, leftEyePoint.y);
|
||||
- faceArray[i].boundingBox.x = 2 * rightEyePoint.x - midEyePoint.x;
|
||||
- faceArray[i].boundingBox.y = midEyePoint.y - eyesDistance;
|
||||
- faceArray[i].boundingBox.width = 2 * eyesDistance;
|
||||
- faceArray[i].boundingBox.height = eyeMouthDistance > eyesDistance
|
||||
- ? eyeMouthDistance + eyesDistance
|
||||
- : 2 * eyesDistance;
|
||||
- } else {
|
||||
- faceArray[i].boundingBox.x = corner.x;
|
||||
- faceArray[i].boundingBox.y = corner.y;
|
||||
- faceArray[i].boundingBox.width = face.getWidth();
|
||||
- faceArray[i].boundingBox.height = face.getHeight();
|
||||
- }
|
||||
- }
|
||||
- callback.call(faceArray);
|
||||
+ Log.e(TAG, "FaceDetector is not operational");
|
||||
+ callback.call(new FaceDetectionResult[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
- mFaceDetector.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java
|
||||
@@ -8,12 +8,6 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.util.SparseArray;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-import com.google.android.gms.vision.Frame;
|
||||
-import com.google.android.gms.vision.text.TextBlock;
|
||||
-import com.google.android.gms.vision.text.TextRecognizer;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.gfx.mojom.PointF;
|
||||
@@ -29,58 +23,17 @@ import org.chromium.shape_detection.mojom.TextDetectionResult;
|
||||
public class TextDetectionImpl implements TextDetection {
|
||||
private static final String TAG = "TextDetectionImpl";
|
||||
|
||||
- private TextRecognizer mTextRecognizer;
|
||||
-
|
||||
public TextDetectionImpl() {
|
||||
- mTextRecognizer = new TextRecognizer.Builder(ContextUtils.getApplicationContext()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detect(org.chromium.skia.mojom.Bitmap bitmapData, DetectResponse callback) {
|
||||
- // The vision library will be downloaded the first time the API is used
|
||||
- // on the device; this happens "fast", but it might have not completed,
|
||||
- // bail in this case. Also, the API was disabled between and v.9.0 and
|
||||
- // v.9.2, see https://developers.google.com/android/guides/releases.
|
||||
- if (!mTextRecognizer.isOperational()) {
|
||||
- Log.e(TAG, "TextDetector is not operational");
|
||||
- callback.call(new TextDetectionResult[0]);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- Frame frame = BitmapUtils.convertToFrame(bitmapData);
|
||||
- if (frame == null) {
|
||||
- Log.e(TAG, "Error converting Mojom Bitmap to Frame");
|
||||
- callback.call(new TextDetectionResult[0]);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- final SparseArray<TextBlock> textBlocks = mTextRecognizer.detect(frame);
|
||||
-
|
||||
- TextDetectionResult[] detectedTextArray = new TextDetectionResult[textBlocks.size()];
|
||||
- for (int i = 0; i < textBlocks.size(); i++) {
|
||||
- detectedTextArray[i] = new TextDetectionResult();
|
||||
- final TextBlock textBlock = textBlocks.valueAt(i);
|
||||
- detectedTextArray[i].rawValue = textBlock.getValue();
|
||||
- final Rect rect = textBlock.getBoundingBox();
|
||||
- detectedTextArray[i].boundingBox = new RectF();
|
||||
- detectedTextArray[i].boundingBox.x = rect.left;
|
||||
- detectedTextArray[i].boundingBox.y = rect.top;
|
||||
- detectedTextArray[i].boundingBox.width = rect.width();
|
||||
- detectedTextArray[i].boundingBox.height = rect.height();
|
||||
- final Point[] corners = textBlock.getCornerPoints();
|
||||
- detectedTextArray[i].cornerPoints = new PointF[corners.length];
|
||||
- for (int j = 0; j < corners.length; j++) {
|
||||
- detectedTextArray[i].cornerPoints[j] = new PointF();
|
||||
- detectedTextArray[i].cornerPoints[j].x = corners[j].x;
|
||||
- detectedTextArray[i].cornerPoints[j].y = corners[j].y;
|
||||
- }
|
||||
- }
|
||||
- callback.call(detectedTextArray);
|
||||
+ Log.e(TAG, "TextDetector is not operational");
|
||||
+ callback.call(new TextDetectionResult[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
- mTextRecognizer.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,12 +42,7 @@ public class TextDetectionImpl implements TextDetection {
|
||||
}
|
||||
|
||||
public static TextDetection create() {
|
||||
- if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext())
|
||||
- != ConnectionResult.SUCCESS) {
|
||||
- Log.e(TAG, "Google Play Services not available");
|
||||
- return null;
|
||||
- }
|
||||
- return new TextDetectionImpl();
|
||||
+ Log.e(TAG, "Google Play Services not available");
|
||||
+ return null;
|
||||
}
|
||||
}
|
||||
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
||||
--- a/third_party/android_deps/BUILD.gn
|
||||
+++ b/third_party/android_deps/BUILD.gn
|
||||
@@ -900,35 +900,6 @@ android_aar_prebuilt("google_play_services_tasks_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_vision_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_vision/play-services-vision-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_vision/com_google_android_gms_play_services_vision.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_vision_common_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_vision_common_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_vision_common/play-services-vision-common-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_vision_common/com_google_android_gms_play_services_vision_common.info"
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_clearcut_java",
|
||||
- ":google_play_services_flags_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("com_google_android_material_material_java") {
|
||||
aar_path = "libs/com_google_android_material_material/material-1.0.0-rc02.aar"
|
||||
info_path = "libs/com_google_android_material_material/com_google_android_material_material.info"
|
||||
@@ -1528,25 +1499,6 @@ android_aar_prebuilt("com_android_support_versionedparcelable_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_clearcut_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_clearcut/play-services-clearcut-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_clearcut/com_google_android_gms_play_services_clearcut.info"
|
||||
-
|
||||
- # To remove visibility constraint, add this dependency to
|
||||
- # //tools/android/roll/android_deps/build.gradle.
|
||||
- visibility = [ ":*" ]
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_phenotype_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("google_play_services_flags_java") {
|
||||
aar_path = "libs/com_google_android_gms_play_services_flags/play-services-flags-15.0.1.aar"
|
||||
info_path = "libs/com_google_android_gms_play_services_flags/com_google_android_gms_play_services_flags.info"
|
||||
@@ -1564,24 +1516,6 @@ android_aar_prebuilt("google_play_services_flags_java") {
|
||||
}
|
||||
|
||||
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
-android_aar_prebuilt("google_play_services_phenotype_java") {
|
||||
- aar_path = "libs/com_google_android_gms_play_services_phenotype/play-services-phenotype-15.0.1.aar"
|
||||
- info_path = "libs/com_google_android_gms_play_services_phenotype/com_google_android_gms_play_services_phenotype.info"
|
||||
-
|
||||
- # To remove visibility constraint, add this dependency to
|
||||
- # //tools/android/roll/android_deps/build.gradle.
|
||||
- visibility = [ ":*" ]
|
||||
- deps = [
|
||||
- ":google_play_services_base_java",
|
||||
- ":google_play_services_basement_java",
|
||||
- ":google_play_services_tasks_java",
|
||||
- ]
|
||||
-
|
||||
- # Removing drawables from GMS .aars as they are unused bloat.
|
||||
- strip_drawables = true
|
||||
-}
|
||||
-
|
||||
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
||||
android_aar_prebuilt("google_play_services_places_placereport_java") {
|
||||
aar_path = "libs/com_google_android_gms_play_services_places_placereport/play-services-places-placereport-15.0.1.aar"
|
||||
info_path = "libs/com_google_android_gms_play_services_places_placereport/com_google_android_gms_play_services_places_placereport.info"
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,496 @@
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Fri, 1 Nov 2019 23:01:41 +0100
|
||||
Subject: Remove dependency on com.google.android.play
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 1 -
|
||||
.../omaha/inline/FakeAppUpdateManagerWrapper.java | 60 +-----
|
||||
.../inline/InlineUpdateControllerFactory.java | 16 --
|
||||
.../omaha/inline/PlayInlineUpdateController.java | 226 +--------------------
|
||||
components/module_installer/android/BUILD.gn | 1 -
|
||||
third_party/google_android_play_core/BUILD.gn | 5 -
|
||||
6 files changed, 3 insertions(+), 306 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -387,7 +387,6 @@ android_library("chrome_java") {
|
||||
"//third_party/cct_dynamic_module:cct_dynamic_module_java",
|
||||
"//third_party/feed:feed_lib_proto_java",
|
||||
"//third_party/gif_player:gif_player_java",
|
||||
- "//third_party/google_android_play_core:com_google_android_play_core_java",
|
||||
"//third_party/jsr-305:jsr_305_javalib",
|
||||
"//ui/android:ui_java",
|
||||
"//ui/base/mojom:mojom_java",
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/FakeAppUpdateManagerWrapper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/FakeAppUpdateManagerWrapper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/FakeAppUpdateManagerWrapper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/FakeAppUpdateManagerWrapper.java
|
||||
@@ -10,11 +10,6 @@ import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.support.annotation.IntDef;
|
||||
|
||||
-import com.google.android.play.core.appupdate.AppUpdateInfo;
|
||||
-import com.google.android.play.core.appupdate.testing.FakeAppUpdateManager;
|
||||
-import com.google.android.play.core.install.model.AppUpdateType;
|
||||
-import com.google.android.play.core.tasks.Task;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.task.PostTask;
|
||||
import org.chromium.chrome.browser.ChromeActivity;
|
||||
@@ -30,7 +25,7 @@ import java.lang.ref.WeakReference;
|
||||
* wrapper isn't meant to be used for a full integration test, but simulating all of the possible
|
||||
* error cases is a bit easier to do here.
|
||||
*/
|
||||
-public class FakeAppUpdateManagerWrapper extends FakeAppUpdateManager {
|
||||
+public class FakeAppUpdateManagerWrapper {
|
||||
private static final int RESULT_IN_APP_UPDATE_FAILED = 1;
|
||||
private static final int STEP_DELAY_MS = 5000;
|
||||
private static final int TOAST_DURATION_MS = 2000;
|
||||
@@ -107,15 +102,12 @@ public class FakeAppUpdateManagerWrapper extends FakeAppUpdateManager {
|
||||
switch (event) {
|
||||
case Event.UPDATE_AVAILABLE:
|
||||
w.toast("Making app update available.");
|
||||
- w.setUpdateAvailable(10000 /* Figure out a better version? */);
|
||||
return;
|
||||
case Event.USER_ACCEPTS_UPDATE:
|
||||
w.toast("User accepts update.");
|
||||
- w.userAcceptsUpdate();
|
||||
return;
|
||||
case Event.USER_REJECTS_UPDATE:
|
||||
w.toast("User rejects update.");
|
||||
- w.userRejectsUpdate();
|
||||
return;
|
||||
case Event.TRIGGER_DOWNLOAD:
|
||||
w.toast("Triggering download.");
|
||||
@@ -123,27 +115,21 @@ public class FakeAppUpdateManagerWrapper extends FakeAppUpdateManager {
|
||||
return;
|
||||
case Event.DOWNLOAD_STARTS:
|
||||
w.toast("Download has started.");
|
||||
- w.downloadStarts();
|
||||
return;
|
||||
case Event.DOWNLOAD_FAILS:
|
||||
w.toast("Triggering download failure.");
|
||||
- w.downloadFails();
|
||||
return;
|
||||
case Event.USER_CANCELS_DOWNLOAD:
|
||||
w.toast("Triggering cancellation of download.");
|
||||
- w.userCancelsDownload();
|
||||
return;
|
||||
case Event.DOWNLOAD_COMPLETES:
|
||||
w.toast("Download completes.");
|
||||
- w.downloadCompletes();
|
||||
return;
|
||||
case Event.INSTALL_FAILS:
|
||||
w.toast("Triggering install failure.");
|
||||
- w.installFails();
|
||||
return;
|
||||
case Event.INSTALL_COMPLETES:
|
||||
w.toast("Triggering install completion.");
|
||||
- w.installCompletes();
|
||||
return;
|
||||
default:
|
||||
w.toast("Unknown event.");
|
||||
@@ -158,56 +144,12 @@ public class FakeAppUpdateManagerWrapper extends FakeAppUpdateManager {
|
||||
* @param endState at which point should the inline update flow end.
|
||||
*/
|
||||
FakeAppUpdateManagerWrapper(@Type int endState) {
|
||||
- super(ContextUtils.getApplicationContext());
|
||||
mType = endState;
|
||||
mEventHandler = new EventHandler(this);
|
||||
|
||||
if (mType != Type.NONE) execute(Event.UPDATE_AVAILABLE);
|
||||
}
|
||||
|
||||
- // FakeAppUpdateManager implementation.
|
||||
- @Override
|
||||
- public boolean startUpdateFlowForResult(AppUpdateInfo appUpdateInfo,
|
||||
- @AppUpdateType int appUpdateType, Activity activity, int requestCode) {
|
||||
- toast("Starting update flow.");
|
||||
- // TODO(dtrainor): Simulate exceptions being thrown or returning false from the super call.
|
||||
- boolean success =
|
||||
- super.startUpdateFlowForResult(appUpdateInfo, appUpdateType, activity, requestCode);
|
||||
- if (!success) return false;
|
||||
-
|
||||
- assert activity instanceof ChromeActivity : "Unexpected triggering activity.";
|
||||
-
|
||||
- final int resultCode;
|
||||
- if (mType == Type.FAIL_DIALOG_CANCEL) {
|
||||
- resultCode = Activity.RESULT_CANCELED;
|
||||
- } else if (mType == Type.FAIL_DIALOG_UPDATE_FAILED) {
|
||||
- resultCode = RESULT_IN_APP_UPDATE_FAILED;
|
||||
- } else {
|
||||
- resultCode = Activity.RESULT_OK;
|
||||
- }
|
||||
-
|
||||
- PostTask.postDelayedTask(UiThreadTaskTraits.DEFAULT, () -> {
|
||||
- triggerDialogResponse((ChromeActivity) activity, requestCode, resultCode);
|
||||
- }, STEP_DELAY_MS);
|
||||
-
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public Task<Void> completeUpdate() {
|
||||
- toast("Completing update.");
|
||||
- Task<Void> result = super.completeUpdate();
|
||||
-
|
||||
- if (mType == Type.FAIL_INSTALL) {
|
||||
- postDelayedEvent(Event.INSTALL_FAILS);
|
||||
- } else {
|
||||
- postDelayedEvent(Event.INSTALL_COMPLETES);
|
||||
- // This doesn't actually restart Chrome in this case.
|
||||
- }
|
||||
-
|
||||
- return result;
|
||||
- }
|
||||
-
|
||||
private void triggerDialogResponse(ChromeActivity activity, int requestCode, int resultCode) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
execute(Event.USER_ACCEPTS_UPDATE);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
package org.chromium.chrome.browser.omaha.inline;
|
||||
|
||||
-import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.omaha.UpdateConfigs;
|
||||
@@ -20,20 +18,6 @@ public class InlineUpdateControllerFactory {
|
||||
public static InlineUpdateController create(Runnable callback) {
|
||||
@FakeAppUpdateManagerWrapper.Type
|
||||
int mockInlineEndState = UpdateConfigs.getMockInlineScenarioEndState();
|
||||
- if (mockInlineEndState != FakeAppUpdateManagerWrapper.Type.NO_SIMULATION) {
|
||||
- // The config requires to run through a test controller, using the
|
||||
- // PlayInlineUpdateController, but with a fake Google Play backend that automatically
|
||||
- // goes through a scenario flow.
|
||||
- return new PlayInlineUpdateController(
|
||||
- callback, new FakeAppUpdateManagerWrapper(mockInlineEndState));
|
||||
- }
|
||||
-
|
||||
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
|
||||
- // The application configuration requires to use the real Google Play backend for inline
|
||||
- // updates.
|
||||
- return new PlayInlineUpdateController(
|
||||
- callback, AppUpdateManagerFactory.create(ContextUtils.getApplicationContext()));
|
||||
- }
|
||||
|
||||
// No test scenario was in place, and the inline flow has not been enabled, so use a
|
||||
// controller with no functionality.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java
|
||||
@@ -9,15 +9,6 @@ import android.content.IntentSender.SendIntentException;
|
||||
import android.support.annotation.IntDef;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
-import com.google.android.play.core.appupdate.AppUpdateInfo;
|
||||
-import com.google.android.play.core.appupdate.AppUpdateManager;
|
||||
-import com.google.android.play.core.install.InstallState;
|
||||
-import com.google.android.play.core.install.InstallStateUpdatedListener;
|
||||
-import com.google.android.play.core.install.model.AppUpdateType;
|
||||
-import com.google.android.play.core.install.model.InstallErrorCode;
|
||||
-import com.google.android.play.core.install.model.InstallStatus;
|
||||
-import com.google.android.play.core.install.model.UpdateAvailability;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
|
||||
@@ -31,7 +22,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
* in the foreground.
|
||||
*/
|
||||
public class PlayInlineUpdateController
|
||||
- implements InlineUpdateController, InstallStateUpdatedListener {
|
||||
+ implements InlineUpdateController {
|
||||
/**
|
||||
* Converts Play's InstallErrorCode enum to a stable monotomically incrementing Chrome enum.
|
||||
* This is used for metric stability.
|
||||
@@ -126,26 +117,9 @@ public class PlayInlineUpdateController
|
||||
private static final int RESULT_IN_APP_UPDATE_FAILED = 1;
|
||||
private static final int REQUEST_CODE = 8123;
|
||||
|
||||
- private final Runnable mCallback;
|
||||
- private final AppUpdateManager mAppUpdateManager;
|
||||
-
|
||||
private boolean mEnabled;
|
||||
private @Nullable @UpdateState Integer mUpdateState;
|
||||
|
||||
- private AppUpdateInfo mAppUpdateInfo;
|
||||
- private @Nullable @UpdateAvailability Integer mUpdateAvailability;
|
||||
- private @Nullable @InstallStatus Integer mInstallStatus;
|
||||
-
|
||||
- /**
|
||||
- * Builds an instance of {@link PlayInlineUpdateController}.
|
||||
- * @param callback The {@link Runnable} to notify when an inline update state change occurs.
|
||||
- */
|
||||
- PlayInlineUpdateController(Runnable callback, AppUpdateManager appUpdateManager) {
|
||||
- mCallback = callback;
|
||||
- mAppUpdateManager = appUpdateManager;
|
||||
- setEnabled(true);
|
||||
- }
|
||||
-
|
||||
// InlineUpdateController implementation.
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
@@ -154,10 +128,8 @@ public class PlayInlineUpdateController
|
||||
|
||||
if (mEnabled) {
|
||||
mUpdateState = UpdateState.NONE;
|
||||
- mAppUpdateManager.registerListener(this);
|
||||
pullCurrentState();
|
||||
} else {
|
||||
- mAppUpdateManager.unregisterListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,220 +140,26 @@ public class PlayInlineUpdateController
|
||||
|
||||
@Override
|
||||
public void startUpdate(Activity activity) {
|
||||
- try {
|
||||
- boolean success = mAppUpdateManager.startUpdateFlowForResult(
|
||||
- mAppUpdateInfo, AppUpdateType.FLEXIBLE, activity, REQUEST_CODE);
|
||||
- Log.i(TAG, "startUpdateFlowForResult() returned " + success);
|
||||
-
|
||||
- if (!success) recordCallFailure(CallFailure.START_FAILED);
|
||||
- } catch (SendIntentException exception) {
|
||||
- mInstallStatus = InstallStatus.FAILED;
|
||||
- Log.i(TAG, "startUpdateFlowForResult() threw an exception.");
|
||||
- recordCallFailure(CallFailure.START_EXCEPTION);
|
||||
- }
|
||||
- // TODO(dtrainor): Use success.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completeUpdate() {
|
||||
- mAppUpdateManager.completeUpdate()
|
||||
- .addOnSuccessListener(unused -> {
|
||||
- Log.i(TAG, "completeUpdate() success.");
|
||||
- pushStatus();
|
||||
- })
|
||||
- .addOnFailureListener(exception -> {
|
||||
- Log.i(TAG, "completeUpdate() failed.");
|
||||
- recordCallFailure(CallFailure.COMPLETE_FAILED);
|
||||
- mInstallStatus = InstallStatus.FAILED;
|
||||
- pushStatus();
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- // InstallStateUpdatedListener implementation.
|
||||
- @Override
|
||||
- public void onStateUpdate(InstallState state) {
|
||||
- Log.i(TAG,
|
||||
- "onStateUpdate(" + state.installStatus() + ", " + state.installErrorCode() + ")");
|
||||
-
|
||||
- if (state.installStatus() != mInstallStatus) {
|
||||
- RecordHistogram.recordEnumeratedHistogram("GoogleUpdate.Inline.StateChange.Error."
|
||||
- + installStatusToEnumSuffix(state.installStatus()),
|
||||
- installErrorCodeToMetrics(state.installErrorCode()),
|
||||
- InstallErrorCodeMetrics.NUM_ENTRIES);
|
||||
- }
|
||||
-
|
||||
- mInstallStatus = state.installStatus();
|
||||
- pushStatus();
|
||||
}
|
||||
|
||||
private void pullCurrentState() {
|
||||
- mAppUpdateManager.getAppUpdateInfo()
|
||||
- .addOnSuccessListener(info -> {
|
||||
- mAppUpdateInfo = info;
|
||||
- mUpdateAvailability = info.updateAvailability();
|
||||
- mInstallStatus = info.installStatus();
|
||||
- Log.i(TAG,
|
||||
- "pullCurrentState(" + mUpdateAvailability + ", " + mInstallStatus
|
||||
- + ") success.");
|
||||
- recordOnAppUpdateInfo(info);
|
||||
- pushStatus();
|
||||
- })
|
||||
- .addOnFailureListener(exception -> {
|
||||
- mAppUpdateInfo = null;
|
||||
- mUpdateAvailability = UpdateAvailability.UNKNOWN;
|
||||
- mInstallStatus = InstallStatus.UNKNOWN;
|
||||
- Log.i(TAG, "pullCurrentState() failed.");
|
||||
- recordCallFailure(CallFailure.QUERY_FAILED);
|
||||
- pushStatus();
|
||||
- });
|
||||
}
|
||||
|
||||
private void pushStatus() {
|
||||
- if (!mEnabled || mUpdateAvailability == null || mInstallStatus == null) return;
|
||||
-
|
||||
- @UpdateState
|
||||
- int newState = toUpdateState(mUpdateAvailability, mInstallStatus);
|
||||
- if (mUpdateState != null && mUpdateState == newState) return;
|
||||
-
|
||||
- Log.i(TAG, "Pushing inline update state to " + newState);
|
||||
- mUpdateState = newState;
|
||||
- mCallback.run();
|
||||
}
|
||||
|
||||
private static @UpdateState int toUpdateState(
|
||||
- @UpdateAvailability int updateAvailability, @InstallStatus int installStatus) {
|
||||
+ int updateAvailability, int installStatus) {
|
||||
@UpdateState
|
||||
int newStatus = UpdateState.NONE;
|
||||
|
||||
- // Note, use InstallStatus first then UpdateAvailability if InstallStatus doesn't indicate
|
||||
- // a currently active install.
|
||||
- switch (installStatus) {
|
||||
- case InstallStatus.PENDING:
|
||||
- // Intentional fall through.
|
||||
- case InstallStatus.DOWNLOADING:
|
||||
- newStatus = UpdateState.INLINE_UPDATE_DOWNLOADING;
|
||||
- break;
|
||||
- case InstallStatus.DOWNLOADED:
|
||||
- newStatus = UpdateState.INLINE_UPDATE_READY;
|
||||
- break;
|
||||
- case InstallStatus.FAILED:
|
||||
- newStatus = UpdateState.INLINE_UPDATE_FAILED;
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (newStatus == UpdateState.NONE) {
|
||||
- switch (updateAvailability) {
|
||||
- case UpdateAvailability.UPDATE_AVAILABLE:
|
||||
- newStatus = UpdateState.INLINE_UPDATE_AVAILABLE;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
- private static String installStatusToEnumSuffix(@InstallStatus int status) {
|
||||
- switch (status) {
|
||||
- case InstallStatus.UNKNOWN:
|
||||
- return "Unknown";
|
||||
- case InstallStatus.REQUIRES_UI_INTENT:
|
||||
- return "RequiresUiIntent";
|
||||
- case InstallStatus.PENDING:
|
||||
- return "Pending";
|
||||
- case InstallStatus.DOWNLOADING:
|
||||
- return "Downloading";
|
||||
- case InstallStatus.DOWNLOADED:
|
||||
- return "Downloaded";
|
||||
- case InstallStatus.INSTALLING:
|
||||
- return "Installing";
|
||||
- case InstallStatus.INSTALLED:
|
||||
- return "Installed";
|
||||
- case InstallStatus.FAILED:
|
||||
- return "Failed";
|
||||
- case InstallStatus.CANCELED:
|
||||
- return "Canceled";
|
||||
- default:
|
||||
- return "Untracked";
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private static @InstallErrorCodeMetrics int installErrorCodeToMetrics(
|
||||
- @InstallErrorCode int error) {
|
||||
- switch (error) {
|
||||
- case InstallErrorCode.NO_ERROR:
|
||||
- return InstallErrorCodeMetrics.NO_ERROR;
|
||||
- case InstallErrorCode.NO_ERROR_PARTIALLY_ALLOWED:
|
||||
- return InstallErrorCodeMetrics.NO_ERROR_PARTIALLY_ALLOWED;
|
||||
- case InstallErrorCode.ERROR_UNKNOWN:
|
||||
- return InstallErrorCodeMetrics.ERROR_UNKNOWN;
|
||||
- case InstallErrorCode.ERROR_API_NOT_AVAILABLE:
|
||||
- return InstallErrorCodeMetrics.ERROR_API_NOT_AVAILABLE;
|
||||
- case InstallErrorCode.ERROR_INVALID_REQUEST:
|
||||
- return InstallErrorCodeMetrics.ERROR_INVALID_REQUEST;
|
||||
- case InstallErrorCode.ERROR_INSTALL_UNAVAILABLE:
|
||||
- return InstallErrorCodeMetrics.ERROR_INSTALL_UNAVAILABLE;
|
||||
- case InstallErrorCode.ERROR_INSTALL_NOT_ALLOWED:
|
||||
- return InstallErrorCodeMetrics.ERROR_INSTALL_NOT_ALLOWED;
|
||||
- case InstallErrorCode.ERROR_DOWNLOAD_NOT_PRESENT:
|
||||
- return InstallErrorCodeMetrics.ERROR_DOWNLOAD_NOT_PRESENT;
|
||||
- case InstallErrorCode.ERROR_INTERNAL_ERROR:
|
||||
- return InstallErrorCodeMetrics.ERROR_INTERNAL_ERROR;
|
||||
- default:
|
||||
- return InstallErrorCodeMetrics.ERROR_UNTRACKED;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private static @UpdateAvailabilityMetric int updateAvailabilityToMetrics(
|
||||
- @UpdateAvailability int updateAvailability) {
|
||||
- switch (updateAvailability) {
|
||||
- case UpdateAvailability.UNKNOWN:
|
||||
- return UpdateAvailabilityMetric.UNKNOWN;
|
||||
- case UpdateAvailability.UPDATE_NOT_AVAILABLE:
|
||||
- return UpdateAvailabilityMetric.UPDATE_NOT_AVAILABLE;
|
||||
- case UpdateAvailability.UPDATE_AVAILABLE:
|
||||
- return UpdateAvailabilityMetric.UPDATE_AVAILABLE;
|
||||
- case UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS:
|
||||
- return UpdateAvailabilityMetric.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS;
|
||||
- default:
|
||||
- return UpdateAvailabilityMetric.UNTRACKED;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private static @InstallStatusMetric int installStatusToMetrics(
|
||||
- @InstallStatus int installStatus) {
|
||||
- switch (installStatus) {
|
||||
- case InstallStatus.UNKNOWN:
|
||||
- return InstallStatusMetric.UNKNOWN;
|
||||
- case InstallStatus.REQUIRES_UI_INTENT:
|
||||
- return InstallStatusMetric.REQUIRES_UI_INTENT;
|
||||
- case InstallStatus.PENDING:
|
||||
- return InstallStatusMetric.PENDING;
|
||||
- case InstallStatus.DOWNLOADING:
|
||||
- return InstallStatusMetric.DOWNLOADING;
|
||||
- case InstallStatus.DOWNLOADED:
|
||||
- return InstallStatusMetric.DOWNLOADED;
|
||||
- case InstallStatus.INSTALLING:
|
||||
- return InstallStatusMetric.INSTALLING;
|
||||
- case InstallStatus.INSTALLED:
|
||||
- return InstallStatusMetric.INSTALLED;
|
||||
- case InstallStatus.FAILED:
|
||||
- return InstallStatusMetric.FAILED;
|
||||
- case InstallStatus.CANCELED:
|
||||
- return InstallStatusMetric.CANCELED;
|
||||
- default:
|
||||
- return InstallStatusMetric.UNTRACKED;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- private static void recordOnAppUpdateInfo(AppUpdateInfo info) {
|
||||
- RecordHistogram.recordEnumeratedHistogram(
|
||||
- "GoogleUpdate.Inline.AppUpdateInfo.UpdateAvailability",
|
||||
- updateAvailabilityToMetrics(info.updateAvailability()),
|
||||
- UpdateAvailabilityMetric.NUM_ENTRIES);
|
||||
- RecordHistogram.recordEnumeratedHistogram("GoogleUpdate.Inline.AppUpdateInfo.InstallStatus",
|
||||
- installStatusToMetrics(info.installStatus()), InstallStatusMetric.NUM_ENTRIES);
|
||||
- }
|
||||
-
|
||||
private static void recordCallFailure(@CallFailure int failure) {
|
||||
RecordHistogram.recordEnumeratedHistogram(
|
||||
"GoogleUpdate.Inline.CallFailure", failure, CallFailure.NUM_ENTRIES);
|
||||
diff --git a/components/module_installer/android/BUILD.gn b/components/module_installer/android/BUILD.gn
|
||||
--- a/components/module_installer/android/BUILD.gn
|
||||
+++ b/components/module_installer/android/BUILD.gn
|
||||
@@ -23,7 +23,6 @@ android_library("module_installer_java") {
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//components/crash/android:java",
|
||||
- "//third_party/google_android_play_core:com_google_android_play_core_java",
|
||||
]
|
||||
|
||||
srcjar_deps = [ ":module_installer_build_config" ]
|
||||
diff --git a/third_party/google_android_play_core/BUILD.gn b/third_party/google_android_play_core/BUILD.gn
|
||||
--- a/third_party/google_android_play_core/BUILD.gn
|
||||
+++ b/third_party/google_android_play_core/BUILD.gn
|
||||
@@ -3,8 +3,3 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/android/rules.gni")
|
||||
-
|
||||
-android_aar_prebuilt("com_google_android_play_core_java") {
|
||||
- aar_path = "core-1.6.4.aar"
|
||||
- info_path = "com_google_android_play_core.info"
|
||||
-}
|
||||
--
|
||||
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