Compare commits
147
Commits
ci
..
68.0.3440.55
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a Bromite bug report
|
||||
|
||||
---
|
||||
|
||||
**Version**
|
||||
|
||||
Version: `v67...`
|
||||
Arch: `arm` or `arm64` or `x86`
|
||||
|
||||
**Is the bug reproducible with latest version?**
|
||||
`Bug must be reproducible with latest version`
|
||||
|
||||
**Can the bug be reproduced with corresponding [Chromium](https://github.com/bromite/chromium/releases) version?**
|
||||
`Bug must NOT be reproducible with Chromium to be qualified as a Bromite bug`
|
||||
|
||||
**Is the bug a crash?**
|
||||
If yes then individuate and post the logcat dump (remove privacy sensitive information, if any), otherwise remove this section.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a privacy-related idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to privacy?**
|
||||
Only privacy-related feature requests are considered.
|
||||
|
||||
**Is there a patch available for this feature somewhere?**
|
||||
...
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've 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
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
# 67.0.3396.107
|
||||
* updated AdBlock filters
|
||||
* 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
|
||||
* updated AdBlock filters
|
||||
|
||||
# 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`
|
||||
* updated AdBlock filters
|
||||
|
||||
# 67.0.3396.92
|
||||
* improve randomisation for each retrieved Canvas data (fixes https://github.com/bromite/bromite/issues/69)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 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 randomisation 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
|
||||
* updated AdBlock filters
|
||||
|
||||
# 67.0.3396.82
|
||||
* updated AdBlock filters
|
||||
|
||||
# 67.0.3396.76
|
||||
* updated AdBlock filters
|
||||
|
||||
# 67.0.3396.72
|
||||
* add global toggle for adblock engine (https://github.com/bromite/bromite/issues/53)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 67.0.3396.67
|
||||
* updated AdBlock filters
|
||||
|
||||
# 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)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.200
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.196
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.188
|
||||
* updated AdBlock filters
|
||||
* increase max (persistent) connections per server from 6 to 15
|
||||
* preliminary work for better canvas fingerprinting mitigations
|
||||
|
||||
# 66.0.3359.161
|
||||
* updated AdBlock filters
|
||||
|
||||
# 66.0.3359.148
|
||||
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
|
||||
* updated AdBlock filters
|
||||
* reduce randomisation for client rects from 5% to 3%
|
||||
|
||||
# 65.0.3325.230
|
||||
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.218
|
||||
* always set WideVine version
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.204
|
||||
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
|
||||
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
|
||||
* set audio latency to fixed number
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.198
|
||||
* re-landed support for third-party AdBlock filters
|
||||
* completed patches cleanup
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.190
|
||||
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 65.0.3325.176
|
||||
* block plugins enumeration API
|
||||
* block battery API
|
||||
* remove device name and build id from User Agent
|
||||
* added Qwant search engine
|
||||
* updated AdBlock filters
|
||||
* disable non-working 3rd-party filters support
|
||||
|
||||
# 64.0.3282.204
|
||||
* use H264 NEON optimizations also for arm64
|
||||
* fix build of Stable channel
|
||||
* updated AdBlock filters
|
||||
* started building vanilla Chromium releases as well
|
||||
|
||||
# 64.0.3282.193
|
||||
* updated AdBlock filters
|
||||
* disable reporting
|
||||
|
||||
# 64.0.3282.182
|
||||
* add support for domain-based adblock filters
|
||||
* optimized memory allocation for filters
|
||||
* updated AdBlock filters
|
||||
|
||||
# 64.0.3282.168
|
||||
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
|
||||
* 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
|
||||
* updated AdBlock filters
|
||||
|
||||
# 63.0.3239.150
|
||||
* fixed crash when clicking on address bar lock (page info) or opening site settings (https://github.com/bromite/bromite/issues/28)
|
||||
* build H264 with NEON optimizations for ARMv7
|
||||
* updated AdBlock filters
|
||||
* more builds for arm64 architecture
|
||||
|
||||
# 63.0.3239.144
|
||||
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
|
||||
* updated AdBlock filters
|
||||
|
||||
# 63.0.3239.129
|
||||
* updated AdBlock filters
|
||||
|
||||
# 63.0.3239.122
|
||||
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
|
||||
* 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
|
||||
* updated adBlock filters
|
||||
* fix build of x86 version (was broken in previous version)
|
||||
|
||||
# 63.0.3239.85
|
||||
* no suggest URL for DuckDuckGo (https://github.com/bromite/bromite/issues/19)
|
||||
* fixed 4chan blocking rule
|
||||
* limit AMP links cleanup to search results only (fixes broken images/news result tabs)
|
||||
* updated adBlock filters
|
||||
|
||||
# 63.0.3239.78
|
||||
* correctly set version and build numbers
|
||||
* updated adBlock filters
|
||||
|
||||
# 63.0.3239.73
|
||||
|
||||
# 63.0.3239.64
|
||||
* updated adblock filters
|
||||
* fixed an issue with incognito new tab
|
||||
* permanent disable for ToS/metrics and unused auto-updates check
|
||||
|
||||
# 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,138 @@
|
||||
# Bromite - Take back your browser
|
||||
|
||||
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> [![license][license-image]][license-url]
|
||||
|
||||
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
|
||||
|
||||
Bromite is [Chromium](https://www.chromium.org/Home) plus some patches for ad blocking and enhanced privacy.
|
||||
|
||||
Bromite is only available for Android v4.1 and above.
|
||||
|
||||
See [open issues](https://github.com/bromite/bromite/issues) for the development in progress.
|
||||
|
||||
<img src="https://www.bromite.org/bromite_bromite_gh_downloads.svg" alt="downloads on Github" title="downloads on Github" /> <img src="https://www.bromite.org/bromite_bromite_xda_downloads.svg" alt="downloads on XDA Labs" title="downloads on XDA Labs" />
|
||||
|
||||
# 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.
|
||||
|
||||
Donate via LiberaPay: [](https://liberapay.com/csagan5/donate)
|
||||
|
||||
Support development with a donation of 3 EUR: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
|
||||
|
||||
Support development with a free amount donation: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC7Q6A3UAQPY8)
|
||||
|
||||
<a href="bitcoin:3MkC3idL61npQSCxL1gceksmRTkNkiCPcG">BTC donations address</a>: `3MkC3idL61npQSCxL1gceksmRTkNkiCPcG`
|
||||
|
||||
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
|
||||
|
||||
# F.A.Q.
|
||||
|
||||
## Does Google Sync/Translate/Data saver work?
|
||||
No.
|
||||
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
|
||||
|
||||
## Does Bromite require root?
|
||||
No.
|
||||
|
||||
## What is the SystemWebView?
|
||||
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
|
||||
|
||||
## How to enable DNS-over-HTTPS?
|
||||
|
||||
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
|
||||
|
||||
## Can you add dark mode/some cool themes?
|
||||
No.
|
||||
Bromite is about adblocking and privacy.
|
||||
|
||||
## Can you add HTTPS everywhere?
|
||||
No.
|
||||
We cannot add add-ons to Bromite (merely some features) and anyway HTTPS everywhere in particular is too invasive to be easily maintained across new releases.
|
||||
|
||||
## Is Bromite on Play Store?
|
||||
No, and this is unlikely to change. The Play Store would not allow total freedom on the adblocking choice, amongst other limitations.
|
||||
|
||||
## Is Bromite on F-Droid?
|
||||
Not (yet), for technical reasons. This is likely to change in future.
|
||||
|
||||
## Does Bromite support WebRTC?
|
||||
No, it is not built-in.
|
||||
|
||||
# Features
|
||||
|
||||
* baked-in adblock engine with filters from EasyList, EasyPrivacy and others
|
||||
* remove click-tracking and AMP from search results
|
||||
* DNS-over-HTTPS support via Google/CloudFlare servers
|
||||
* allow playing videos in background
|
||||
* [StartPage](https://startpage.com/), [DuckDuckGo](https://duckduckgo.com/) and [Qwant](https://www.qwant.com/) search engines
|
||||
* 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
|
||||
* webRTC, canvas, audio and other anti-fingerprinting mitigations
|
||||
* all codecs included (proprietary, open H.264 etc.)
|
||||
* built with official speed optimizations
|
||||
|
||||
You can inspect all functionality/privacy changes by reading the patches: https://github.com/bromite/bromite/tree/master/patches
|
||||
|
||||
# Releases
|
||||
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases); 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.
|
||||
|
||||
Each tag corresponds to a Chromium Stable release tag.
|
||||
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDKs versions 16 and 21
|
||||
Additionally, [SystemWebView](https://www.bromite.org/system_web_view), Monochrome and the [vanilla Chromium](https://www.bromite.org/chromium) builds are provided.
|
||||
|
||||
## 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
|
||||
arm64_MonochromePublic.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.
|
||||
|
||||
# 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
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/browser-android-tabs) for some patches
|
||||
* nochromo for the original adblock patch
|
||||
* [AdBlock Plus](https://adblockplus.org/), [uBlock](https://www.ublock.org/), [Peter Lowe's adservers list](https://pgl.yoyo.org/adservers/), [EasyList and EasyPrivacy](https://easylist.to/) for the filters included
|
||||
|
||||
# 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
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v2
|
||||
|
||||
mQENBFphnJwBCAC1qSMaPR5Nq9sEHa9ZePwoGLFafjOBcApz7IYW7dIsQYXVUHlo
|
||||
lbBwwfFUjnnIf/wzZ42ck/QGRKJ18qA9VybWyT8as0Sz26Tmxah31vI7kzlBZCYY
|
||||
/ZER5N3onQFVVVoynYxmep5HdK7enAXOtLBOogbJ/x2Q9ITPuJ+Pv3b4R5E2ui/i
|
||||
hFAruUh+oifPBzh3fjBTTr0uvDqbsnsczQptFghKxYyJiPTblCD51Ou11a3uNt1y
|
||||
PuG1bR5jImgt33T6zjdFac6kQ2Zalxa/URU/FQPiYJ1X2J1jCgdEgRKlK70ha+oN
|
||||
mnVWhFzjecuCw180HCZh1OQho+LPWbtMFyvtABEBAAG0M2NzYWdhbjUgPDMyNjg1
|
||||
Njk2K2NzYWdhbjVAdXNlcnMubm9yZXBseS5naXRodWIuY29tPokBIgQTAQgAFgUC
|
||||
WmGcnAkQZBkKUdhdwMUCGwsCGQEAADpDB/4zlnDg1gToKqtz994jLzUM7PJOPTWa
|
||||
c8xGCj7l8BpGcCOK0fk7fOQ+bDYT0OSHZ1OCR7Gbm6ENu03wNLQ7W9Tr0uf/yDIP
|
||||
mItcFk6nYmMKPnK6bd7QWLMsT9mK6mYb02zt6Ql8D7EsWGxifQVQG85ETObhoSqw
|
||||
EH6zqZvflxJLmN+vh/Orm1ipzEvw7cjvpSloDwypjY6x9MGEE9utFcGySx726gKu
|
||||
Wmz417QZc/TpylCd1p72G9pCqv1Si+y+P9tSEdjWSM6EqEwMr5W+IJ1O6BZQ7A9p
|
||||
0l2FZqYC2WkRDJZqWiYoYltP6z1SEbbVI5rQaaVAesS1Ae8OOR9EmlK8
|
||||
=6Hsd
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
+104177
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 18 May 2018 10:10:00 +0200
|
||||
Subject: Increase maximum connections per host from 6 to 15
|
||||
|
||||
---
|
||||
net/socket/client_socket_pool_manager.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
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
|
||||
@@ -34,7 +34,7 @@ static_assert(arraysize(g_max_sockets_per_pool) ==
|
||||
HttpNetworkSession::NUM_SOCKET_POOL_TYPES,
|
||||
"max sockets per pool length mismatch");
|
||||
|
||||
-// Default to allow up to 6 connections per host. Experiment and tuning may
|
||||
+// Default to allow up to 15 connections per host. Experiment and tuning may
|
||||
// try other values (greater than 0). Too large may cause many problems, such
|
||||
// as home routers blocking the connections!?!? See http://crbug.com/12066.
|
||||
//
|
||||
@@ -43,7 +43,7 @@ static_assert(arraysize(g_max_sockets_per_pool) ==
|
||||
// be the same as the limit for ws. Also note that Firefox uses a limit of 200.
|
||||
// See http://crbug.com/486800
|
||||
int g_max_sockets_per_group[] = {
|
||||
- 6, // NORMAL_SOCKET_POOL
|
||||
+ 15, // NORMAL_SOCKET_POOL
|
||||
255 // WEBSOCKET_SOCKET_POOL
|
||||
};
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,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
|
||||
@@ -111,7 +111,7 @@ void CookieSettings::GetCookieSettings(
|
||||
void CookieSettings::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kBlockThirdPartyCookies, false,
|
||||
+ prefs::kBlockThirdPartyCookies, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 11:40:05 +0100
|
||||
Subject: Restore classic new tab page
|
||||
|
||||
---
|
||||
chrome/browser/search/search.cc | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
|
||||
--- a/chrome/browser/search/search.cc
|
||||
+++ b/chrome/browser/search/search.cc
|
||||
@@ -155,10 +155,7 @@ bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
|
||||
}
|
||||
|
||||
bool ShouldShowLocalNewTab(Profile* profile) {
|
||||
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
- return command_line->HasSwitch(switches::kForceLocalNtp) ||
|
||||
- (base::FeatureList::IsEnabled(features::kUseGoogleLocalNtp) &&
|
||||
- profile && DefaultSearchProviderIsGoogle(profile));
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool ShouldDelayRemoteNTP(const GURL& search_provider_url, Profile* profile) {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Tue, 4 Aug 2015 15:15:53 +0200
|
||||
Subject: battery_status_service: disable more privacy nightmares
|
||||
|
||||
The W3C Battery Status API[1] has quite a laughable statement:
|
||||
|
||||
"The information disclosed has minimal impact on privacy or
|
||||
fingerprinting, and therefore is exposed without permission grants".
|
||||
|
||||
Along comes a paper "The leaking battery, A privacy analysis of the
|
||||
HTML5 Battery Status API."
|
||||
|
||||
Clean up after the W3C and disable the battery status updater which
|
||||
could be used to identity users[2].
|
||||
|
||||
[1] http://www.w3.org/TR/battery-status/
|
||||
[2] https://eprint.iacr.org/2015/616.pdf
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/40
|
||||
---
|
||||
services/device/battery/battery_status_service.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
|
||||
--- a/services/device/battery/battery_status_service.cc
|
||||
+++ b/services/device/battery/battery_status_service.cc
|
||||
@@ -41,6 +41,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
if (!battery_fetcher_)
|
||||
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
|
||||
|
||||
+#if 0
|
||||
if (callback_list_.empty()) {
|
||||
bool success = battery_fetcher_->StartListeningBatteryChange();
|
||||
// On failure pass the default values back.
|
||||
@@ -52,6 +53,7 @@ BatteryStatusService::AddCallback(const BatteryUpdateCallback& callback) {
|
||||
// Send recent status to the new callback if already available.
|
||||
callback.Run(status_);
|
||||
}
|
||||
+#endif
|
||||
|
||||
return callback_list_.Add(callback);
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Mon, 1 Jun 2015 17:14:34 +0200
|
||||
Subject: google-cloud-messaging: disable experiment status check
|
||||
|
||||
This avoids trk:263 from triggering.
|
||||
---
|
||||
components/gcm_driver/gcm_channel_status_request.cc | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/components/gcm_driver/gcm_channel_status_request.cc b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
--- a/components/gcm_driver/gcm_channel_status_request.cc
|
||||
+++ b/components/gcm_driver/gcm_channel_status_request.cc
|
||||
@@ -23,8 +23,10 @@ namespace gcm {
|
||||
|
||||
namespace {
|
||||
|
||||
+#if 0
|
||||
const char kRequestContentType[] = "application/octet-stream";
|
||||
const char kGCMChannelTag[] = "gcm_channel";
|
||||
+#endif
|
||||
const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes.
|
||||
const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes.
|
||||
|
||||
@@ -57,6 +59,7 @@ int GCMChannelStatusRequest::min_poll_interval_seconds() {
|
||||
}
|
||||
|
||||
void GCMChannelStatusRequest::Start() {
|
||||
+#if 0
|
||||
DCHECK(!url_fetcher_.get());
|
||||
|
||||
GURL request_url(channel_status_request_url_);
|
||||
@@ -112,6 +115,9 @@ void GCMChannelStatusRequest::Start() {
|
||||
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
|
||||
net::LOAD_DO_NOT_SAVE_COOKIES);
|
||||
url_fetcher_->Start();
|
||||
+#endif
|
||||
+ // Simulate an empty response and disable GCM.
|
||||
+ callback_.Run(false, false, 0);
|
||||
}
|
||||
|
||||
void GCMChannelStatusRequest::OnURLFetchComplete(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Tue, 2 Jun 2015 11:01:50 +0200
|
||||
Subject: updater: disable updater pings
|
||||
|
||||
Despite auto-updater being arguably disabled (see previous commit),
|
||||
Chromium would still send background requests. Kill it.
|
||||
(trk:170, trk:171)
|
||||
---
|
||||
.../component_updater/component_updater_url_constants.cc | 4 ++--
|
||||
components/component_updater/configurator_impl.cc | 11 +++++++----
|
||||
components/component_updater/configurator_impl.h | 1 -
|
||||
3 files changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/components/component_updater/component_updater_url_constants.cc b/components/component_updater/component_updater_url_constants.cc
|
||||
--- a/components/component_updater/component_updater_url_constants.cc
|
||||
+++ b/components/component_updater/component_updater_url_constants.cc
|
||||
@@ -14,9 +14,9 @@ namespace component_updater {
|
||||
//
|
||||
// The value of |kDefaultUrlSource| can be overridden with
|
||||
// --component-updater=url-source=someurl.
|
||||
-const char kUpdaterDefaultUrl[] = "https://clients2.google.com/service/update2";
|
||||
+const char kUpdaterDefaultUrl[] = "about:blank";
|
||||
|
||||
-const char kUpdaterFallbackUrl[] = "http://clients2.google.com/service/update2";
|
||||
+const char kUpdaterFallbackUrl[] = "about:blank";
|
||||
|
||||
const char kUpdaterDefaultUrlAlt[] =
|
||||
"https://update.googleapis.com/service/update2";
|
||||
diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
|
||||
--- a/components/component_updater/configurator_impl.cc
|
||||
+++ b/components/component_updater/configurator_impl.cc
|
||||
@@ -43,7 +43,9 @@ const char kSwitchRequestParam[] = "test-request";
|
||||
|
||||
// Disables pings. Pings are the requests sent to the update server that report
|
||||
// the success or the failure of component install or update attempts.
|
||||
+#if 0
|
||||
const char kSwitchDisablePings[] = "disable-pings";
|
||||
+#endif
|
||||
|
||||
// Sets the URL for updates.
|
||||
const char kSwitchUrlSource[] = "url-source";
|
||||
@@ -56,8 +58,10 @@ const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
|
||||
const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads";
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
+#if 0
|
||||
const base::Feature kAlternateComponentUrls{"AlternateComponentUrls",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+#endif
|
||||
|
||||
// If there is an element of |vec| of the form |test|=.*, returns the right-
|
||||
// hand side of that assignment. Otherwise, returns an empty string.
|
||||
@@ -86,14 +90,12 @@ ConfiguratorImpl::ConfiguratorImpl(const base::CommandLine* cmdline,
|
||||
: fast_update_(false),
|
||||
pings_enabled_(false),
|
||||
deltas_enabled_(false),
|
||||
- background_downloads_enabled_(false),
|
||||
- require_encryption_(require_encryption) {
|
||||
+ background_downloads_enabled_(false) {
|
||||
// Parse comma-delimited debug flags.
|
||||
std::vector<std::string> switch_values = base::SplitString(
|
||||
cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",",
|
||||
base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||
fast_update_ = base::ContainsValue(switch_values, kSwitchFastUpdate);
|
||||
- pings_enabled_ = !base::ContainsValue(switch_values, kSwitchDisablePings);
|
||||
deltas_enabled_ =
|
||||
!base::ContainsValue(switch_values, kSwitchDisableDeltaUpdates);
|
||||
|
||||
@@ -140,6 +142,7 @@ std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
|
||||
return urls;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
if (base::FeatureList::IsEnabled(kAlternateComponentUrls)) {
|
||||
urls.push_back(GURL(kUpdaterDefaultUrlAlt));
|
||||
urls.push_back(GURL(kUpdaterFallbackUrlAlt));
|
||||
@@ -150,7 +153,7 @@ std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
|
||||
|
||||
if (require_encryption_)
|
||||
update_client::RemoveUnsecureUrls(&urls);
|
||||
-
|
||||
+#endif
|
||||
return urls;
|
||||
}
|
||||
|
||||
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
|
||||
--- a/components/component_updater/configurator_impl.h
|
||||
+++ b/components/component_updater/configurator_impl.h
|
||||
@@ -89,7 +89,6 @@ class ConfiguratorImpl {
|
||||
bool pings_enabled_;
|
||||
bool deltas_enabled_;
|
||||
bool background_downloads_enabled_;
|
||||
- bool require_encryption_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ConfiguratorImpl);
|
||||
};
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sat, 13 Sep 2014 17:25:47 +0200
|
||||
Subject: prefs: only keep cookies until exit
|
||||
|
||||
Out with all those tracking cookies!
|
||||
---
|
||||
components/content_settings/core/browser/content_settings_registry.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -117,7 +117,7 @@ void ContentSettingsRegistry::Init() {
|
||||
// WARNING: The string names of the permissions passed in below are used to
|
||||
// generate preference names and should never be changed!
|
||||
|
||||
- Register(CONTENT_SETTINGS_TYPE_COOKIES, "cookies", CONTENT_SETTING_ALLOW,
|
||||
+ Register(CONTENT_SETTINGS_TYPE_COOKIES, "cookies", CONTENT_SETTING_SESSION_ONLY,
|
||||
WebsiteSettingsInfo::SYNCABLE,
|
||||
WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme),
|
||||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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 | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc
|
||||
--- a/net/cert/ev_root_ca_metadata.cc
|
||||
+++ b/net/cert/ev_root_ca_metadata.cc
|
||||
@@ -46,6 +46,16 @@ struct EVMetadata {
|
||||
|
||||
// These certificates may be found in net/data/ssl/ev_roots.
|
||||
static const EVMetadata ev_root_ca_metadata[] = {
|
||||
+ // need some dummy thing to make compiler happy, because
|
||||
+ // arraysize() is implemented as a convoluted template rather than
|
||||
+ // the traditional sizeof(x)/sizeof(*x)
|
||||
+ { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } },
|
||||
+ {
|
||||
+ "0",
|
||||
+ }
|
||||
+ },
|
||||
+#if 0
|
||||
// AC Camerfirma S.A. Chambers of Commerce Root - 2008
|
||||
// https://www.camerfirma.com
|
||||
{
|
||||
@@ -748,7 +758,9 @@ static const EVMetadata ev_root_ca_metadata[] = {
|
||||
0xd2, 0x09, 0xb7, 0x37, 0xcb, 0xe2, 0xc1, 0x8c, 0xfb, 0x2c, 0x10,
|
||||
0xc0, 0xff, 0x0b, 0xcf, 0x0d, 0x32, 0x86, 0xfc, 0x1a, 0xa2}},
|
||||
{"2.16.840.1.114404.1.1.2.4.1", ""},
|
||||
- }};
|
||||
+ }
|
||||
+#endif
|
||||
+};
|
||||
|
||||
#endif // defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sun, 9 Nov 2014 01:54:27 +0100
|
||||
Subject: promo: disable Google promotion fetching
|
||||
|
||||
Documentation is scarce, and sprinkled with misleading acronyms.
|
||||
NTP is not NTP, for example. FWIW:
|
||||
|
||||
// A PromoResourceService fetches data from a web resource server to
|
||||
// be used to dynamically change the appearance of the New Tab Page.
|
||||
// For example, it has been used to fetch "tips" to be displayed on
|
||||
// the NTP, or to display promotional messages to certain groups of
|
||||
// Chrome users.
|
||||
|
||||
Whatever it is that it downloads, deactivate the one that leads to
|
||||
Google.
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/33
|
||||
---
|
||||
chrome/browser/signin/signin_promo.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
|
||||
--- a/chrome/browser/signin/signin_promo.cc
|
||||
+++ b/chrome/browser/signin/signin_promo.cc
|
||||
@@ -130,6 +130,7 @@ namespace signin {
|
||||
|
||||
bool ShouldShowPromoAtStartup(Profile* profile, bool is_new_profile) {
|
||||
DCHECK(profile);
|
||||
+ return false;
|
||||
|
||||
// Don't show if the profile is an incognito.
|
||||
if (profile->IsOffTheRecord())
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 11 Oct 2017 23:24:58 +0200
|
||||
Subject: Disables omission of URL elements in Omnibox
|
||||
|
||||
Disable all omissions (already shadowed by first flag)
|
||||
---
|
||||
components/url_formatter/url_formatter.cc | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 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
|
||||
@@ -402,12 +402,12 @@ 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 kFormatUrlExperimentalElideAfterHost = 1 << 4;
|
||||
-const FormatUrlType kFormatUrlOmitTrivialSubdomains = 1 << 5;
|
||||
+const FormatUrlType kFormatUrlOmitUsernamePassword = 0 << 0;
|
||||
+const FormatUrlType kFormatUrlOmitHTTP = 0 << 1;
|
||||
+const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 0 << 2;
|
||||
+const FormatUrlType kFormatUrlOmitHTTPS = 0 << 3;
|
||||
+const FormatUrlType kFormatUrlExperimentalElideAfterHost = 0 << 4;
|
||||
+const FormatUrlType kFormatUrlOmitTrivialSubdomains = 0 << 5;
|
||||
|
||||
const FormatUrlType kFormatUrlOmitDefaults =
|
||||
kFormatUrlOmitUsernamePassword | kFormatUrlOmitHTTP |
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:09:24 +0200
|
||||
Subject: Modify default preferences
|
||||
|
||||
---
|
||||
chrome/browser/background/background_mode_manager.cc | 2 +-
|
||||
chrome/browser/chrome_content_browser_client.cc | 2 +-
|
||||
chrome/browser/io_thread.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.cc | 2 +-
|
||||
chrome/browser/net/prediction_options.h | 2 +-
|
||||
chrome/browser/profiles/profile.cc | 2 +-
|
||||
.../resources/settings/reset_page/reset_profile_dialog.html | 2 +-
|
||||
chrome/browser/signin/signin_promo.cc | 4 ++--
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
|
||||
chrome/browser/ui/navigation_correction_tab_observer.cc | 2 +-
|
||||
chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc | 4 ----
|
||||
chrome/service/cloud_print/connector_settings.cc | 2 +-
|
||||
components/autofill/core/browser/autofill_manager.cc | 2 +-
|
||||
components/bookmarks/browser/bookmark_utils.cc | 4 ++--
|
||||
components/safe_browsing/common/safe_browsing_prefs.cc | 4 ++--
|
||||
extensions/common/extension.cc | 8 --------
|
||||
16 files changed, 18 insertions(+), 30 deletions(-)
|
||||
|
||||
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
|
||||
@@ -362,7 +362,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
|
||||
@@ -990,7 +990,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/io_thread.cc b/chrome/browser/io_thread.cc
|
||||
--- a/chrome/browser/io_thread.cc
|
||||
+++ b/chrome/browser/io_thread.cc
|
||||
@@ -615,7 +615,7 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
std::string());
|
||||
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
|
||||
data_reduction_proxy::RegisterPrefs(registry);
|
||||
- registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false);
|
||||
registry->RegisterListPref(prefs::kDnsOverHttpsServers);
|
||||
registry->RegisterListPref(prefs::kDnsOverHttpsServerMethods);
|
||||
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
|
||||
diff --git a/chrome/browser/net/prediction_options.cc b/chrome/browser/net/prediction_options.cc
|
||||
--- a/chrome/browser/net/prediction_options.cc
|
||||
+++ b/chrome/browser/net/prediction_options.cc
|
||||
@@ -30,7 +30,7 @@ NetworkPredictionStatus CanPrefetchAndPrerender(
|
||||
return NetworkPredictionStatus::ENABLED;
|
||||
}
|
||||
default:
|
||||
- DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
+ //DCHECK_EQ(NETWORK_PREDICTION_NEVER, network_prediction_options);
|
||||
return NetworkPredictionStatus::DISABLED_ALWAYS;
|
||||
}
|
||||
}
|
||||
diff --git a/chrome/browser/net/prediction_options.h b/chrome/browser/net/prediction_options.h
|
||||
--- a/chrome/browser/net/prediction_options.h
|
||||
+++ b/chrome/browser/net/prediction_options.h
|
||||
@@ -23,7 +23,7 @@ enum NetworkPredictionOptions {
|
||||
NETWORK_PREDICTION_ALWAYS,
|
||||
NETWORK_PREDICTION_WIFI_ONLY,
|
||||
NETWORK_PREDICTION_NEVER,
|
||||
- NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_WIFI_ONLY,
|
||||
+ NETWORK_PREDICTION_DEFAULT = NETWORK_PREDICTION_NEVER,
|
||||
};
|
||||
|
||||
enum class NetworkPredictionStatus {
|
||||
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
|
||||
--- a/chrome/browser/profiles/profile.cc
|
||||
+++ b/chrome/browser/profiles/profile.cc
|
||||
@@ -138,7 +138,7 @@ const char Profile::kNoHostedDomainFound[] = "NO_HOSTED_DOMAIN";
|
||||
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
|
||||
@@ -45,7 +45,7 @@
|
||||
</paper-button>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
- <paper-checkbox id="sendSettings" checked>
|
||||
+ <paper-checkbox id="sendSettings">
|
||||
$i18nRaw{resetPageFeedback}</paper-checkbox>
|
||||
</div>
|
||||
</cr-dialog>
|
||||
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
|
||||
--- a/chrome/browser/signin/signin_promo.cc
|
||||
+++ b/chrome/browser/signin/signin_promo.cc
|
||||
@@ -384,8 +384,8 @@ void ForceWebBasedSigninFlowForTesting(bool force) {
|
||||
void RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterIntegerPref(prefs::kSignInPromoStartupCount, 0);
|
||||
- registry->RegisterBooleanPref(prefs::kSignInPromoUserSkipped, false);
|
||||
- registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSignInPromoUserSkipped, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSignInPromoShowOnFirstRunAllowed, false);
|
||||
registry->RegisterBooleanPref(prefs::kSignInPromoShowNTPBubble, false);
|
||||
registry->RegisterIntegerPref(prefs::kDiceSigninUserMenuPromoCount, 0);
|
||||
}
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -70,11 +70,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->RegisterBooleanPref(prefs::kDevToolsDisabled, false);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
|
||||
diff --git a/chrome/browser/ui/navigation_correction_tab_observer.cc b/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
--- a/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
+++ b/chrome/browser/ui/navigation_correction_tab_observer.cc
|
||||
@@ -58,7 +58,7 @@ NavigationCorrectionTabObserver::~NavigationCorrectionTabObserver() {
|
||||
void NavigationCorrectionTabObserver::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* prefs) {
|
||||
prefs->RegisterBooleanPref(prefs::kAlternateErrorPagesEnabled,
|
||||
- true,
|
||||
+ false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
|
||||
@@ -143,10 +143,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
|
||||
@@ -227,7 +227,7 @@ void AutofillManager::RegisterProfilePrefs(
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kAutofillCreditCardSigninPromoImpressionCount, 0);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kAutofillEnabled, true,
|
||||
+ prefs::kAutofillEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kAutofillProfileUseDatesFixed, false,
|
||||
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
|
||||
--- a/components/bookmarks/browser/bookmark_utils.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_utils.cc
|
||||
@@ -442,12 +442,12 @@ void GetBookmarksMatchingProperties(BookmarkModel* model,
|
||||
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
|
||||
@@ -374,9 +374,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
|
||||
@@ -368,14 +368,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.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -244,10 +244,10 @@ PasswordFormManager* FindMatchedManager(
|
||||
void PasswordManager::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kCredentialsEnableService, true,
|
||||
+ prefs::kCredentialsEnableService, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
- prefs::kCredentialsEnableAutosignin, true,
|
||||
+ prefs::kCredentialsEnableAutosignin, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
|
||||
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
|
||||
PrefRegistry::NO_REGISTRATION_FLAGS);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 08:15:17 +0200
|
||||
Subject: Disable NTP remote suggestions by default
|
||||
|
||||
---
|
||||
components/ntp_snippets/features.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
|
||||
--- a/components/ntp_snippets/features.cc
|
||||
+++ b/components/ntp_snippets/features.cc
|
||||
@@ -41,16 +41,16 @@ const base::Feature kArticleSuggestionsExpandableHeader{
|
||||
"NTPArticleSuggestionsExpandableHeader", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kArticleSuggestionsFeature{
|
||||
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kBookmarkSuggestionsFeature{
|
||||
- "NTPBookmarkSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "NTPBookmarkSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kRecentOfflineTabSuggestionsFeature{
|
||||
"NTPOfflinePageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kIncreasedVisibility{"NTPSnippetsIncreasedVisibility",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kPhysicalWebPageSuggestionsFeature{
|
||||
"NTPPhysicalWebPageSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -310,7 +310,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc()
|
||||
const {
|
||||
- return "style-src 'self' https://fonts.googleapis.com;";
|
||||
+ return "style-src 'self';";
|
||||
}
|
||||
|
||||
std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const {
|
||||
diff --git a/components/dom_distiller/core/html/preview.html b/components/dom_distiller/core/html/preview.html
|
||||
--- a/components/dom_distiller/core/html/preview.html
|
||||
+++ b/components/dom_distiller/core/html/preview.html
|
||||
@@ -11,7 +11,7 @@ found in the LICENSE file.
|
||||
<meta name="theme-color" id="theme-color">
|
||||
<title>Title goes here and it could be kind of lengthy - Publisher name</title>
|
||||
<link href="../css/distilledpage.css" rel="stylesheet" type="text/css">
|
||||
- <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
||||
+ <link href='chrome://resources/css/roboto.css' rel='stylesheet' type='text/css'>
|
||||
<style>
|
||||
.english :lang(th) {display: none}
|
||||
.english :lang(zh) {display: none}
|
||||
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
|
||||
@@ -120,7 +120,7 @@ function maybeSetWebFont() {
|
||||
if (distiller_on_ios) return;
|
||||
|
||||
var e = document.createElement('link');
|
||||
- e.href = 'https://fonts.googleapis.com/css?family=Roboto';
|
||||
+ e.href = 'chrome://resources/css/roboto.css';
|
||||
e.rel = 'stylesheet';
|
||||
e.type = 'text/css';
|
||||
document.head.appendChild(e);
|
||||
diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
--- a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
+++ b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
|
||||
@@ -12,8 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License. */
|
||||
|
||||
-@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
|
||||
-@import "https://fonts.googleapis.com/css?family=Source+Code+Pro";
|
||||
+@import "chrome://resources/css/roboto.css";
|
||||
|
||||
body,
|
||||
table,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -89,10 +89,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_WEBRTC)
|
||||
// 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());
|
||||
#endif
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 27 Oct 2017 15:53:37 +0200
|
||||
Subject: Disable data saver
|
||||
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java | 1 -
|
||||
.../chrome/browser/net/spdyproxy/DataReductionProxySettings.java | 2 ++
|
||||
.../browser/preferences/datareduction/DataReductionPromoUtils.java | 2 +-
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
@@ -140,7 +140,6 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa
|
||||
boolean notifyAdapter = false;
|
||||
// An optional Data Saver page.
|
||||
if (mFreProperties.getBoolean(SHOW_DATA_REDUCTION_PAGE)) {
|
||||
- mPages.add(new DataReductionProxyFirstRunFragment.Page());
|
||||
mFreProgressStates.add(FRE_PROGRESS_DATA_SAVER_SHOWN);
|
||||
notifyAdapter = true;
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
|
||||
@@ -149,6 +149,7 @@ public class DataReductionProxySettings {
|
||||
// DataReductionProxySettings is a singleton that lives forever and there's no clean
|
||||
// shutdown of Chrome on Android
|
||||
mNativeDataReductionProxySettings = nativeInit();
|
||||
+ nativeSetDataReductionProxyEnabled(mNativeDataReductionProxySettings, false);
|
||||
}
|
||||
|
||||
/** Returns true if the SPDY proxy promo is allowed to be shown. */
|
||||
@@ -171,6 +172,7 @@ public class DataReductionProxySettings {
|
||||
* data reduction statistics if this is the first time the SPDY proxy has been enabled.
|
||||
*/
|
||||
public void setDataReductionProxyEnabled(Context context, boolean enabled) {
|
||||
+ enabled = false;
|
||||
if (enabled
|
||||
&& ContextUtils.getAppSharedPreferences().getLong(
|
||||
DATA_REDUCTION_FIRST_ENABLED_TIME, 0)
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionPromoUtils.java
|
||||
@@ -68,7 +68,7 @@ public class DataReductionPromoUtils {
|
||||
}
|
||||
if (DataReductionProxySettings.getInstance().isDataReductionProxyManaged()) return false;
|
||||
if (DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()) return false;
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 22:51:43 +0100
|
||||
Subject: Skip the first run and metrics
|
||||
|
||||
---
|
||||
.../chrome/browser/firstrun/FirstRunStatus.java | 8 ++++----
|
||||
.../chrome/browser/firstrun/FirstRunUtils.java | 16 ++++++----------
|
||||
.../browser/firstrun/ToSAndUMAFirstRunFragment.java | 18 ++++++------------
|
||||
3 files changed, 16 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
|
||||
@@ -36,11 +36,11 @@ public class FirstRunStatus {
|
||||
* includes ToS and Sign In pages if necessary.
|
||||
*/
|
||||
public static boolean getFirstRunFlowComplete() {
|
||||
- if (ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false)) {
|
||||
- return true;
|
||||
+ boolean complete = ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false);
|
||||
+ if (!complete) {
|
||||
+ setFirstRunFlowComplete(true);
|
||||
}
|
||||
- return CommandLine.getInstance().hasSwitch(
|
||||
- ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java
|
||||
@@ -30,16 +30,12 @@ public class FirstRunUtils {
|
||||
// - checkAnyUserHasSeenToS() may be true which needs to sync its state to the prefs.
|
||||
boolean javaPrefValue = javaPrefs.getBoolean(CACHED_TOS_ACCEPTED_PREF, false);
|
||||
boolean nativePrefValue = prefsBridge.isFirstRunEulaAccepted();
|
||||
- boolean userHasSeenTos =
|
||||
- ToSAckedReceiver.checkAnyUserHasSeenToS();
|
||||
- boolean isFirstRunComplete = FirstRunStatus.getFirstRunFlowComplete();
|
||||
- if (javaPrefValue || nativePrefValue || userHasSeenTos || isFirstRunComplete) {
|
||||
- if (!javaPrefValue) {
|
||||
- javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
|
||||
- }
|
||||
- if (!nativePrefValue) {
|
||||
- prefsBridge.setEulaAccepted();
|
||||
- }
|
||||
+
|
||||
+ if (!javaPrefValue) {
|
||||
+ javaPrefs.edit().putBoolean(CACHED_TOS_ACCEPTED_PREF, true).apply();
|
||||
+ }
|
||||
+ if (!nativePrefValue) {
|
||||
+ prefsBridge.setEulaAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
|
||||
@@ -74,20 +74,14 @@ public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragm
|
||||
}
|
||||
});
|
||||
|
||||
- if (ChromeVersionInfo.isOfficialBuild()) {
|
||||
- int paddingStart = getResources().getDimensionPixelSize(
|
||||
- R.dimen.fre_tos_checkbox_padding);
|
||||
- ApiCompatibilityUtils.setPaddingRelative(mSendReportCheckBox,
|
||||
- ApiCompatibilityUtils.getPaddingStart(mSendReportCheckBox) + paddingStart,
|
||||
- mSendReportCheckBox.getPaddingTop(),
|
||||
- ApiCompatibilityUtils.getPaddingEnd(mSendReportCheckBox),
|
||||
- mSendReportCheckBox.getPaddingBottom());
|
||||
-
|
||||
- mSendReportCheckBox.setChecked(FirstRunActivity.DEFAULT_METRICS_AND_CRASH_REPORTING);
|
||||
- } else {
|
||||
- mSendReportCheckBox.setVisibility(View.GONE);
|
||||
+ int paddingStart = getResources().getDimensionPixelSize(R.dimen.fre_tos_checkbox_padding);
|
||||
+ if (paddingStart != 0) {
|
||||
+ mSendReportCheckBox.setChecked(false);
|
||||
}
|
||||
|
||||
+ mSendReportCheckBox.setChecked(false);
|
||||
+ mSendReportCheckBox.setVisibility(View.GONE);
|
||||
+
|
||||
mTosAndPrivacy.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
NoUnderlineClickableSpan clickableTermsSpan = new NoUnderlineClickableSpan() {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 14:23:07 +0200
|
||||
Subject: Disable signin and data saver preferences
|
||||
|
||||
Never show the data saver promo snackbar
|
||||
---
|
||||
chrome/android/java/res/xml/main_preferences.xml | 8 +++---
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 6 ++--
|
||||
.../browser/preferences/MainPreferences.java | 32 ++++++++++++----------
|
||||
3 files changed, 26 insertions(+), 20 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
|
||||
@@ -6,10 +6,10 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orderingFromXml="false">
|
||||
|
||||
- <org.chromium.chrome.browser.preferences.SignInPreference
|
||||
+ <!-- org.chromium.chrome.browser.preferences.SignInPreference
|
||||
android:key="sign_in"
|
||||
android:order="0"
|
||||
- android:title="@string/sign_in_to_chrome"/>
|
||||
+ android:title="@string/sign_in_to_chrome"/-->
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="basics_section"
|
||||
@@ -70,11 +70,11 @@
|
||||
android:key="languages"
|
||||
android:order="12"
|
||||
android:title="@string/prefs_languages"/>
|
||||
- <org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
+ <!-- org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences"
|
||||
android:key="data_reduction"
|
||||
android:order="13"
|
||||
- android:title="@string/data_reduction_title"/>
|
||||
+ android:title="@string/data_reduction_title"/-->
|
||||
<org.chromium.chrome.browser.preferences.ChromeBasePreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.download.DownloadPreferences"
|
||||
android:key="downloads"
|
||||
diff --git a/chrome/android/java/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
|
||||
@@ -114,7 +114,7 @@ import org.chromium.chrome.browser.printing.TabPrinter;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.share.ShareMenuActionHandler;
|
||||
import org.chromium.chrome.browser.snackbar.BottomContainer;
|
||||
-import org.chromium.chrome.browser.snackbar.DataReductionPromoSnackbarController;
|
||||
+//import org.chromium.chrome.browser.snackbar.DataReductionPromoSnackbarController;
|
||||
import org.chromium.chrome.browser.snackbar.DataUseSnackbarController;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable;
|
||||
@@ -255,7 +255,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
private SnackbarManager mSnackbarManager;
|
||||
private ModalDialogManager mModalDialogManager;
|
||||
private DataUseSnackbarController mDataUseSnackbarController;
|
||||
- private DataReductionPromoSnackbarController mDataReductionPromoSnackbarController;
|
||||
+ //private DataReductionPromoSnackbarController mDataReductionPromoSnackbarController;
|
||||
private AppMenuPropertiesDelegate mAppMenuPropertiesDelegate;
|
||||
private AppMenuHandler mAppMenuHandler;
|
||||
private ToolbarManager mToolbarManager;
|
||||
@@ -576,6 +576,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
mDataUseSnackbarController.showDataUseTrackingEndedBar();
|
||||
}
|
||||
|
||||
+/*
|
||||
// Only alert about data savings once the first paint has happened. It doesn't make
|
||||
// sense to show a snackbar about savings when nothing has been displayed yet.
|
||||
if (DataReductionProxySettings.getInstance().isSnackbarPromoAllowed(tab.getUrl())) {
|
||||
@@ -588,6 +589,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
DataReductionProxySettings.getInstance()
|
||||
.getTotalHttpContentLengthSaved());
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
|
||||
@@ -18,9 +18,9 @@ import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.autofill.PersonalDataManager;
|
||||
import org.chromium.chrome.browser.contextual_suggestions.EnabledStateMonitor;
|
||||
-import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
+//import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
|
||||
-import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences;
|
||||
+//import org.chromium.chrome.browser.preferences.datareduction.DataReductionPreferences;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService.TemplateUrl;
|
||||
import org.chromium.chrome.browser.signin.SigninManager;
|
||||
@@ -35,20 +35,20 @@ import java.util.Map;
|
||||
*/
|
||||
public class MainPreferences extends PreferenceFragment
|
||||
implements SigninManager.SignInStateObserver, TemplateUrlService.LoadListener {
|
||||
- public static final String PREF_SIGN_IN = "sign_in";
|
||||
+ //public static final String PREF_SIGN_IN = "sign_in";
|
||||
public static final String PREF_AUTOFILL_SETTINGS = "autofill_settings";
|
||||
public static final String PREF_SEARCH_ENGINE = "search_engine";
|
||||
public static final String PREF_SAVED_PASSWORDS = "saved_passwords";
|
||||
public static final String PREF_CONTEXTUAL_SUGGESTIONS = "contextual_suggestions";
|
||||
public static final String PREF_HOMEPAGE = "homepage";
|
||||
- public static final String PREF_DATA_REDUCTION = "data_reduction";
|
||||
+ //public static final String PREF_DATA_REDUCTION = "data_reduction";
|
||||
public static final String PREF_NOTIFICATIONS = "notifications";
|
||||
public static final String PREF_LANGUAGES = "languages";
|
||||
public static final String PREF_DOWNLOADS = "downloads";
|
||||
|
||||
private final ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
private final Map<String, Preference> mAllPreferences = new HashMap<>();
|
||||
- private SignInPreference mSignInPreference;
|
||||
+ //private SignInPreference mSignInPreference;
|
||||
|
||||
public MainPreferences() {
|
||||
setHasOptionsMenu(true);
|
||||
@@ -64,25 +64,29 @@ public class MainPreferences extends PreferenceFragment
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
- mSignInPreference.onPreferenceFragmentDestroyed();
|
||||
+ //mSignInPreference.onPreferenceFragmentDestroyed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
+/*
|
||||
if (SigninManager.get().isSigninSupported()) {
|
||||
SigninManager.get().addSignInStateObserver(this);
|
||||
mSignInPreference.registerForUpdates();
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
+/*
|
||||
if (SigninManager.get().isSigninSupported()) {
|
||||
SigninManager.get().removeSignInStateObserver(this);
|
||||
mSignInPreference.unregisterForUpdates();
|
||||
}
|
||||
+*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,7 +102,7 @@ public class MainPreferences extends PreferenceFragment
|
||||
setManagedPreferenceDelegateForPreference(PREF_SEARCH_ENGINE);
|
||||
setManagedPreferenceDelegateForPreference(PREF_AUTOFILL_SETTINGS);
|
||||
setManagedPreferenceDelegateForPreference(PREF_SAVED_PASSWORDS);
|
||||
- setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
|
||||
+ //setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// If we are on Android O+ the Notifications preference should lead to the Android
|
||||
@@ -154,7 +158,7 @@ public class MainPreferences extends PreferenceFragment
|
||||
Preference preference = getPreferenceScreen().getPreference(index);
|
||||
mAllPreferences.put(preference.getKey(), preference);
|
||||
}
|
||||
- mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
|
||||
+ //mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
|
||||
}
|
||||
|
||||
private void setManagedPreferenceDelegateForPreference(String key) {
|
||||
@@ -163,12 +167,6 @@ public class MainPreferences extends PreferenceFragment
|
||||
}
|
||||
|
||||
private void updatePreferences() {
|
||||
- if (SigninManager.get().isSigninSupported()) {
|
||||
- addPreferenceIfAbsent(PREF_SIGN_IN);
|
||||
- } else {
|
||||
- removePreferenceIfPresent(PREF_SIGN_IN);
|
||||
- }
|
||||
-
|
||||
updateSearchEnginePreference();
|
||||
|
||||
if (HomepageManager.shouldShowHomepageSetting()) {
|
||||
@@ -187,9 +185,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
removePreferenceIfPresent(PREF_CONTEXTUAL_SUGGESTIONS);
|
||||
}
|
||||
|
||||
+/*
|
||||
ChromeBasePreference dataReduction =
|
||||
(ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
|
||||
dataReduction.setSummary(DataReductionPreferences.generateSummary(getResources()));
|
||||
+*/
|
||||
}
|
||||
|
||||
private Preference addPreferenceIfAbsent(String key) {
|
||||
@@ -260,9 +260,11 @@ public class MainPreferences extends PreferenceFragment
|
||||
if (PREF_SAVED_PASSWORDS.equals(preference.getKey())) {
|
||||
return PrefServiceBridge.getInstance().isRememberPasswordsManaged();
|
||||
}
|
||||
+/*
|
||||
if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
|
||||
return DataReductionProxySettings.getInstance().isDataReductionProxyManaged();
|
||||
}
|
||||
+*/
|
||||
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
|
||||
return TemplateUrlService.getInstance().isDefaultSearchManaged();
|
||||
}
|
||||
@@ -280,11 +282,13 @@ public class MainPreferences extends PreferenceFragment
|
||||
return prefs.isRememberPasswordsManaged()
|
||||
&& !prefs.isRememberPasswordsEnabled();
|
||||
}
|
||||
+/*
|
||||
if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
|
||||
DataReductionProxySettings settings = DataReductionProxySettings.getInstance();
|
||||
return settings.isDataReductionProxyManaged()
|
||||
&& !settings.isDataReductionProxyEnabled();
|
||||
}
|
||||
+*/
|
||||
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
|
||||
return TemplateUrlService.getInstance().isDefaultSearchManaged();
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 12 Jun 2018 15:09:26 +0200
|
||||
Subject: Disable signin/data reduction promos
|
||||
|
||||
---
|
||||
.../java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -562,7 +562,7 @@ public class ChromeTabbedActivity
|
||||
// TODO(tedchoc): Unify promo dialog logic as the search engine promo dialog checks
|
||||
// might not have completed at this point and we could show multiple
|
||||
// promos.
|
||||
- boolean isShowingPromo = mLocaleManager.hasShownSearchEnginePromoThisSession();
|
||||
+ /*boolean isShowingPromo = mLocaleManager.hasShownSearchEnginePromoThisSession();
|
||||
// Promo dialogs in multiwindow mode are broken on some devices: http://crbug.com/354696
|
||||
boolean isLegacyMultiWindow = MultiWindowUtils.getInstance().isLegacyMultiWindow(this);
|
||||
if (!isShowingPromo && !mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete()
|
||||
@@ -581,7 +581,7 @@ public class ChromeTabbedActivity
|
||||
preferenceManager.setPromosSkippedOnFirstStart(true);
|
||||
}
|
||||
|
||||
- if (!isShowingPromo) {
|
||||
+ if (!isShowingPromo) */ {
|
||||
final Tracker tracker =
|
||||
TrackerFactory.getTrackerForProfile(Profile.getLastUsedProfile());
|
||||
tracker.addOnInitializedCallback(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Wed, 22 Mar 2017 19:10:30 -0400
|
||||
Subject: Removed Sync and Translate menu
|
||||
|
||||
---
|
||||
.../java/res/drawable-hdpi/settings_translate.png | Bin 399 -> 0 bytes
|
||||
.../java/res/drawable-mdpi/settings_translate.png | Bin 284 -> 0 bytes
|
||||
.../java/res/drawable-xhdpi/settings_translate.png | Bin 547 -> 0 bytes
|
||||
.../res/drawable-xxhdpi/settings_translate.png | Bin 793 -> 0 bytes
|
||||
.../res/drawable-xxxhdpi/settings_translate.png | Bin 1038 -> 0 bytes
|
||||
.../java/res/xml/site_settings_preferences.xml | 8 +++----
|
||||
.../website/SiteSettingsPreferences.java | 26 ++++++++++-----------
|
||||
headless/lib/browser/protocol/browser_handler.cc | 2 +-
|
||||
8 files changed, 18 insertions(+), 18 deletions(-)
|
||||
delete mode 100644 chrome/android/java/res/drawable-hdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-mdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xhdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xxhdpi/settings_translate.png
|
||||
delete mode 100644 chrome/android/java/res/drawable-xxxhdpi/settings_translate.png
|
||||
|
||||
diff --git a/chrome/android/java/res/drawable-hdpi/settings_translate.png b/chrome/android/java/res/drawable-hdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 8067680e81c6ffa1a003c579411173827a3a9f96..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-mdpi/settings_translate.png b/chrome/android/java/res/drawable-mdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 3b9b4cd482d36a60d4ff0a110b0bcefabe4c1060..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xhdpi/settings_translate.png b/chrome/android/java/res/drawable-xhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 131a57394ca30dcff4bebcb2471bbbf0e1ac134e..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 55878e697b1afed1b4f039a561dc6212e24fc024..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png b/chrome/android/java/res/drawable-xxxhdpi/settings_translate.png
|
||||
deleted file mode 100644
|
||||
index 058b50b84dd216d983e9dea2ea264b39773ac318..0000000000000000000000000000000000000000
|
||||
diff --git a/chrome/android/java/res/xml/site_settings_preferences.xml b/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
index afb425b..a545372 100644
|
||||
--- a/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/site_settings_preferences.xml
|
||||
@@ -44,9 +44,9 @@
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
android:key="ads" />
|
||||
<!-- Background sync -->
|
||||
- <org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
+ <!--<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
- android:key="background_sync" />
|
||||
+ android:key="background_sync" />-->
|
||||
<!-- Protected content -->
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
@@ -66,11 +66,11 @@
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.SingleCategoryPreferences"
|
||||
android:key="sound" />
|
||||
<!-- Google Translate -->
|
||||
- <Preference
|
||||
+ <!-- <Preference
|
||||
android:fragment="org.chromium.chrome.browser.preferences.website.TranslatePreferences"
|
||||
android:key="translate"
|
||||
android:title="@string/google_translate"
|
||||
- android:icon="@drawable/settings_translate" />
|
||||
+ android:icon="@drawable/settings_translate" />-->
|
||||
<!-- Storage -->
|
||||
<!-- TODO(finnur): Move this over to the new Usage screen, once it exists. -->
|
||||
<org.chromium.chrome.browser.preferences.website.SiteSettingsPreference
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
index 24b3a7d..dc1c609 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
@@ -38,7 +38,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
static final String ALL_SITES_KEY = "all_sites";
|
||||
static final String ADS_KEY = "ads";
|
||||
static final String AUTOPLAY_KEY = "autoplay";
|
||||
- static final String BACKGROUND_SYNC_KEY = "background_sync";
|
||||
+ //static final String BACKGROUND_SYNC_KEY = "background_sync";
|
||||
static final String CAMERA_KEY = "camera";
|
||||
static final String CLIPBOARD_KEY = "clipboard";
|
||||
static final String COOKIES_KEY = "cookies";
|
||||
@@ -51,7 +51,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
static final String PROTECTED_CONTENT_KEY = "protected_content";
|
||||
static final String SOUND_KEY = "sound";
|
||||
static final String STORAGE_KEY = "use_storage";
|
||||
- static final String TRANSLATE_KEY = "translate";
|
||||
+ //static final String TRANSLATE_KEY = "translate";
|
||||
static final String USB_KEY = "usb";
|
||||
|
||||
// Whether the Protected Content menu is available for display.
|
||||
@@ -86,8 +86,8 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
return ContentSettingsType.CONTENT_SETTINGS_TYPE_ADS;
|
||||
} else if (AUTOPLAY_KEY.equals(key)) {
|
||||
return ContentSettingsType.CONTENT_SETTINGS_TYPE_AUTOPLAY;
|
||||
- } else if (BACKGROUND_SYNC_KEY.equals(key)) {
|
||||
- return ContentSettingsType.CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;
|
||||
+ /*} else if (BACKGROUND_SYNC_KEY.equals(key)) {
|
||||
+ return ContentSettingsType.CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;*/
|
||||
} else if (CAMERA_KEY.equals(key)) {
|
||||
return ContentSettingsType.CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
||||
} else if (CLIPBOARD_KEY.equals(key)) {
|
||||
@@ -118,7 +118,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
// menus.
|
||||
getPreferenceScreen().removePreference(findPreference(ALL_SITES_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(ADS_KEY));
|
||||
- getPreferenceScreen().removePreference(findPreference(BACKGROUND_SYNC_KEY));
|
||||
+ //getPreferenceScreen().removePreference(findPreference(BACKGROUND_SYNC_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(CAMERA_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(CLIPBOARD_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(COOKIES_KEY));
|
||||
@@ -130,7 +130,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
getPreferenceScreen().removePreference(findPreference(POPUPS_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(SOUND_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(STORAGE_KEY));
|
||||
- getPreferenceScreen().removePreference(findPreference(TRANSLATE_KEY));
|
||||
+ //getPreferenceScreen().removePreference(findPreference(TRANSLATE_KEY));
|
||||
getPreferenceScreen().removePreference(findPreference(USB_KEY));
|
||||
} else {
|
||||
// If both Autoplay and Protected Content menus are available, they'll be tucked under
|
||||
@@ -156,9 +156,9 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
}
|
||||
// The new Languages Preference *feature* is an advanced version of this translate
|
||||
// preference. Once Languages Preference is enabled, remove this setting.
|
||||
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.LANGUAGES_PREFERENCE)) {
|
||||
+ /*if (ChromeFeatureList.isEnabled(ChromeFeatureList.LANGUAGES_PREFERENCE)) {
|
||||
getPreferenceScreen().removePreference(findPreference(TRANSLATE_KEY));
|
||||
- }
|
||||
+ }*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
PrefServiceBridge prefServiceBridge = PrefServiceBridge.getInstance();
|
||||
|
||||
// Translate preference.
|
||||
- Preference translatePref = findPreference(TRANSLATE_KEY);
|
||||
+ /*Preference translatePref = findPreference(TRANSLATE_KEY);
|
||||
if (translatePref != null) {
|
||||
setTranslateStateSummary(translatePref);
|
||||
- }
|
||||
+ }*/
|
||||
|
||||
// Preferences that navigate to Website Settings.
|
||||
List<String> websitePrefs = new ArrayList<String>();
|
||||
@@ -183,7 +183,7 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
// When showing the main menu, if Protected Content is not available, only Autoplay
|
||||
// will be visible.
|
||||
if (!mProtectedContentMenuAvailable) websitePrefs.add(AUTOPLAY_KEY);
|
||||
- websitePrefs.add(BACKGROUND_SYNC_KEY);
|
||||
+ //websitePrefs.add(BACKGROUND_SYNC_KEY);
|
||||
websitePrefs.add(CAMERA_KEY);
|
||||
if (ChromeFeatureList.isEnabled(ChromeFeatureList.CLIPBOARD_CONTENT_SETTING)) {
|
||||
websitePrefs.add(CLIPBOARD_KEY);
|
||||
@@ -208,8 +208,8 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
checked = PrefServiceBridge.getInstance().adsEnabled();
|
||||
} else if (AUTOPLAY_KEY.equals(prefName)) {
|
||||
checked = PrefServiceBridge.getInstance().isAutoplayEnabled();
|
||||
- } else if (BACKGROUND_SYNC_KEY.equals(prefName)) {
|
||||
- checked = PrefServiceBridge.getInstance().isBackgroundSyncAllowed();
|
||||
+ /*} else if (BACKGROUND_SYNC_KEY.equals(prefName)) {
|
||||
+ checked = PrefServiceBridge.getInstance().isBackgroundSyncAllowed();*/
|
||||
} else if (CAMERA_KEY.equals(prefName)) {
|
||||
checked = PrefServiceBridge.getInstance().isCameraEnabled();
|
||||
} else if (CLIPBOARD_KEY.equals(prefName)) {
|
||||
diff --git a/headless/lib/browser/protocol/browser_handler.cc b/headless/lib/browser/protocol/browser_handler.cc
|
||||
index 97ec5f5..955b233 100644
|
||||
--- a/headless/lib/browser/protocol/browser_handler.cc
|
||||
+++ b/headless/lib/browser/protocol/browser_handler.cc
|
||||
@@ -71,7 +71,7 @@ Response BrowserHandler::Close() {
|
||||
Response BrowserHandler::SetWindowBounds(
|
||||
int window_id,
|
||||
std::unique_ptr<Browser::Bounds> window_bounds) {
|
||||
- HeadlessWebContentsImpl* web_contents = web_contents =
|
||||
+ HeadlessWebContentsImpl* web_contents =
|
||||
browser()->GetWebContentsForWindowId(window_id);
|
||||
if (!web_contents)
|
||||
return Response::Error("Browser window not found");
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 26 Nov 2017 23:11:56 +0100
|
||||
Subject: Disable Omaha update checks
|
||||
|
||||
---
|
||||
.../android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -132,7 +132,7 @@ public class OmahaBase {
|
||||
|
||||
/** See {@link #sIsDisabled}. */
|
||||
static boolean isDisabled() {
|
||||
- return sIsDisabled;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,715 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 11:06:18 +0200
|
||||
Subject: Add DuckDuckGo search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 19 ++
|
||||
components/search_engines/search_engine_type.h | 2 +
|
||||
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
|
||||
3 files changed, 130 insertions(+), 109 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -38,6 +38,25 @@
|
||||
// The following engines are included in country lists and are added to the
|
||||
// list of search engines on the first run depending on user's country.
|
||||
"elements": {
|
||||
+ "duckduckgo": {
|
||||
+ "name": "DuckDuckGo",
|
||||
+ "keyword": "duckduckgo.com",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/?q={searchTerms}",
|
||||
+ "suggest_url": "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGO",
|
||||
+ "id": 11
|
||||
+ },
|
||||
+
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
"aol": {
|
||||
"name": "AOL",
|
||||
"keyword": "aol.com",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -63,6 +63,8 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_YANDEX,
|
||||
SEARCH_ENGINE_ZOZNAM,
|
||||
SEARCH_ENGINE_360,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGO,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -51,548 +51,548 @@ namespace {
|
||||
|
||||
// Default (for countries with no better engine set)
|
||||
const PrepopulatedEngine* const engines_default[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// United Arab Emirates
|
||||
const PrepopulatedEngine* const engines_AE[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Albania
|
||||
const PrepopulatedEngine* const engines_AL[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Argentina
|
||||
const PrepopulatedEngine* const engines_AR[] = {
|
||||
- &google, &bing, &yahoo_ar,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
};
|
||||
|
||||
// Austria
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
- &google, &bing, &yahoo_at,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
};
|
||||
|
||||
// Australia
|
||||
const PrepopulatedEngine* const engines_AU[] = {
|
||||
- &google, &bing, &yahoo_au,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
};
|
||||
|
||||
// Bosnia and Herzegovina
|
||||
const PrepopulatedEngine* const engines_BA[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Belgium
|
||||
const PrepopulatedEngine* const engines_BE[] = {
|
||||
- &google, &bing, &yahoo, &yahoo_fr,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
const PrepopulatedEngine* const engines_BG[] = {
|
||||
- &google, &bing, &ask,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Bahrain
|
||||
const PrepopulatedEngine* const engines_BH[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Burundi
|
||||
const PrepopulatedEngine* const engines_BI[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Brunei
|
||||
const PrepopulatedEngine* const engines_BN[] = {
|
||||
- &google, &yahoo_my, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Bolivia
|
||||
const PrepopulatedEngine* const engines_BO[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Brazil
|
||||
const PrepopulatedEngine* const engines_BR[] = {
|
||||
- &google, &ask_br, &bing, &yahoo_br,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
};
|
||||
|
||||
// Belarus
|
||||
const PrepopulatedEngine* const engines_BY[] = {
|
||||
- &google, &yandex_by, &mail_ru,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
};
|
||||
|
||||
// Belize
|
||||
const PrepopulatedEngine* const engines_BZ[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Canada
|
||||
const PrepopulatedEngine* const engines_CA[] = {
|
||||
- &google, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
};
|
||||
|
||||
// Switzerland
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
- &google, &bing, &yahoo_ch,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
};
|
||||
|
||||
// Chile
|
||||
const PrepopulatedEngine* const engines_CL[] = {
|
||||
- &google, &bing, &yahoo_cl,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
};
|
||||
|
||||
// China
|
||||
const PrepopulatedEngine* const engines_CN[] = {
|
||||
- &google, &baidu, &sogou, &so_360,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
};
|
||||
|
||||
// Colombia
|
||||
const PrepopulatedEngine* const engines_CO[] = {
|
||||
- &google, &bing, &yahoo_co,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
const PrepopulatedEngine* const engines_CR[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Czech Republic
|
||||
const PrepopulatedEngine* const engines_CZ[] = {
|
||||
- &google, &seznam, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
};
|
||||
|
||||
// Germany
|
||||
const PrepopulatedEngine* const engines_DE[] = {
|
||||
- &google, &bing, &yahoo_de,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Denmark
|
||||
const PrepopulatedEngine* const engines_DK[] = {
|
||||
- &google, &bing, &yahoo_dk,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
};
|
||||
|
||||
// Dominican Republic
|
||||
const PrepopulatedEngine* const engines_DO[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Algeria
|
||||
const PrepopulatedEngine* const engines_DZ[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
const PrepopulatedEngine* const engines_EC[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
const PrepopulatedEngine* const engines_EE[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Egypt
|
||||
const PrepopulatedEngine* const engines_EG[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Spain
|
||||
const PrepopulatedEngine* const engines_ES[] = {
|
||||
- &google, &bing, &yahoo_es,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
};
|
||||
|
||||
// Faroe Islands
|
||||
const PrepopulatedEngine* const engines_FO[] = {
|
||||
- &google, &bing, &ask,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Finland
|
||||
const PrepopulatedEngine* const engines_FI[] = {
|
||||
- &google, &bing, &yahoo_fi,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
};
|
||||
|
||||
// France
|
||||
const PrepopulatedEngine* const engines_FR[] = {
|
||||
- &google, &bing, &yahoo_fr,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// United Kingdom
|
||||
const PrepopulatedEngine* const engines_GB[] = {
|
||||
- &google, &bing, &yahoo_uk, &ask_uk,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
};
|
||||
|
||||
// Greece
|
||||
const PrepopulatedEngine* const engines_GR[] = {
|
||||
- &google, &bing, &yahoo_gr,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
};
|
||||
|
||||
// Guatemala
|
||||
const PrepopulatedEngine* const engines_GT[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Hong Kong
|
||||
const PrepopulatedEngine* const engines_HK[] = {
|
||||
- &google, &yahoo_hk, &baidu, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
const PrepopulatedEngine* const engines_HN[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Croatia
|
||||
const PrepopulatedEngine* const engines_HR[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Hungary
|
||||
const PrepopulatedEngine* const engines_HU[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Indonesia
|
||||
const PrepopulatedEngine* const engines_ID[] = {
|
||||
- &google, &yahoo_id, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
const PrepopulatedEngine* const engines_IE[] = {
|
||||
- &google, &bing, &yahoo_uk,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
};
|
||||
|
||||
// Israel
|
||||
const PrepopulatedEngine* const engines_IL[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// India
|
||||
const PrepopulatedEngine* const engines_IN[] = {
|
||||
- &google, &bing, &yahoo_in,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
};
|
||||
|
||||
// Iraq
|
||||
const PrepopulatedEngine* const engines_IQ[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Iran
|
||||
const PrepopulatedEngine* const engines_IR[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Iceland
|
||||
const PrepopulatedEngine* const engines_IS[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Italy
|
||||
const PrepopulatedEngine* const engines_IT[] = {
|
||||
- &google, &virgilio, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
};
|
||||
|
||||
// Jamaica
|
||||
const PrepopulatedEngine* const engines_JM[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Jordan
|
||||
const PrepopulatedEngine* const engines_JO[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Japan
|
||||
const PrepopulatedEngine* const engines_JP[] = {
|
||||
- &google, &yahoo_jp, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
};
|
||||
|
||||
// Kenya
|
||||
const PrepopulatedEngine* const engines_KE[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Kuwait
|
||||
const PrepopulatedEngine* const engines_KW[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// South Korea
|
||||
const PrepopulatedEngine* const engines_KR[] = {
|
||||
- &google, &naver, &daum,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
};
|
||||
|
||||
// Kazakhstan
|
||||
const PrepopulatedEngine* const engines_KZ[] = {
|
||||
- &google, &mail_ru, &yandex_kz,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
};
|
||||
|
||||
// Lebanon
|
||||
const PrepopulatedEngine* const engines_LB[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Liechtenstein
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
- &google, &bing, &yahoo_de,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Lithuania
|
||||
const PrepopulatedEngine* const engines_LT[] = {
|
||||
- &google, &bing, &yandex_ru,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
};
|
||||
|
||||
// Luxembourg
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
- &google, &bing, &yahoo_fr,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Latvia
|
||||
const PrepopulatedEngine* const engines_LV[] = {
|
||||
- &google, &yandex_ru, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
};
|
||||
|
||||
// Libya
|
||||
const PrepopulatedEngine* const engines_LY[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
const PrepopulatedEngine* const engines_MA[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
const PrepopulatedEngine* const engines_MC[] = {
|
||||
- &google, &yahoo_fr, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
};
|
||||
|
||||
// Moldova
|
||||
const PrepopulatedEngine* const engines_MD[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Montenegro
|
||||
const PrepopulatedEngine* const engines_ME[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
const PrepopulatedEngine* const engines_MK[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Mexico
|
||||
const PrepopulatedEngine* const engines_MX[] = {
|
||||
- &google, &bing, &yahoo_mx,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
};
|
||||
|
||||
// Malaysia
|
||||
const PrepopulatedEngine* const engines_MY[] = {
|
||||
- &google, &yahoo_my, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Nicaragua
|
||||
const PrepopulatedEngine* const engines_NI[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Netherlands
|
||||
const PrepopulatedEngine* const engines_NL[] = {
|
||||
- &google, &yahoo_nl, &vinden,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
};
|
||||
|
||||
// Norway
|
||||
const PrepopulatedEngine* const engines_NO[] = {
|
||||
- &google, &bing, &kvasir,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
};
|
||||
|
||||
// New Zealand
|
||||
const PrepopulatedEngine* const engines_NZ[] = {
|
||||
- &google, &bing, &yahoo_nz,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
};
|
||||
|
||||
// Oman
|
||||
const PrepopulatedEngine* const engines_OM[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Panama
|
||||
const PrepopulatedEngine* const engines_PA[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Peru
|
||||
const PrepopulatedEngine* const engines_PE[] = {
|
||||
- &google, &bing, &yahoo_pe,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
const PrepopulatedEngine* const engines_PH[] = {
|
||||
- &google, &yahoo_ph, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
const PrepopulatedEngine* const engines_PK[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
const PrepopulatedEngine* const engines_PR[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Poland
|
||||
const PrepopulatedEngine* const engines_PL[] = {
|
||||
- &google, &onet, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
};
|
||||
|
||||
// Portugal
|
||||
const PrepopulatedEngine* const engines_PT[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Paraguay
|
||||
const PrepopulatedEngine* const engines_PY[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Qatar
|
||||
const PrepopulatedEngine* const engines_QA[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Romania
|
||||
const PrepopulatedEngine* const engines_RO[] = {
|
||||
- &google, &yahoo_ro, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
};
|
||||
|
||||
// Serbia
|
||||
const PrepopulatedEngine* const engines_RS[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Russia
|
||||
const PrepopulatedEngine* const engines_RU[] = {
|
||||
- &google, &yandex_ru, &mail_ru,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
const PrepopulatedEngine* const engines_RW[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Saudi Arabia
|
||||
const PrepopulatedEngine* const engines_SA[] = {
|
||||
- &google, &yahoo_maktoob, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
const PrepopulatedEngine* const engines_SE[] = {
|
||||
- &google, &bing, &yahoo_se,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
};
|
||||
|
||||
// Singapore
|
||||
const PrepopulatedEngine* const engines_SG[] = {
|
||||
- &google, &yahoo_sg, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
};
|
||||
|
||||
// Slovenia
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
- &google, &najdi, &ask,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
};
|
||||
|
||||
// Slovakia
|
||||
const PrepopulatedEngine* const engines_SK[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// El Salvador
|
||||
const PrepopulatedEngine* const engines_SV[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Syria
|
||||
const PrepopulatedEngine* const engines_SY[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
const PrepopulatedEngine* const engines_TH[] = {
|
||||
- &google, &yahoo_th, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
};
|
||||
|
||||
// Tunisia
|
||||
const PrepopulatedEngine* const engines_TN[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Turkey
|
||||
const PrepopulatedEngine* const engines_TR[] = {
|
||||
- &google, &bing, &yahoo_tr, &yandex_tr,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
const PrepopulatedEngine* const engines_TT[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Taiwan
|
||||
const PrepopulatedEngine* const engines_TW[] = {
|
||||
- &google, &yahoo_tw, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
};
|
||||
|
||||
// Tanzania
|
||||
const PrepopulatedEngine* const engines_TZ[] = {
|
||||
- &google, &yahoo, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Ukraine
|
||||
const PrepopulatedEngine* const engines_UA[] = {
|
||||
- &google, &yandex_ua, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
};
|
||||
|
||||
// United States
|
||||
const PrepopulatedEngine* const engines_US[] = {
|
||||
- &google, &bing, &yahoo, &aol, &ask,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
};
|
||||
|
||||
// Uruguay
|
||||
const PrepopulatedEngine* const engines_UY[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Venezuela
|
||||
const PrepopulatedEngine* const engines_VE[] = {
|
||||
- &google, &bing, &yahoo_ve,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
};
|
||||
|
||||
// Vietnam
|
||||
const PrepopulatedEngine* const engines_VN[] = {
|
||||
- &google, &yahoo_vn, &bing,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
};
|
||||
|
||||
// Yemen
|
||||
const PrepopulatedEngine* const engines_YE[] = {
|
||||
- &google, &bing, &yahoo_maktoob,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
const PrepopulatedEngine* const engines_ZA[] = {
|
||||
- &google, &bing, &yahoo,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Zimbabwe
|
||||
const PrepopulatedEngine* const engines_ZW[] = {
|
||||
- &google, &bing, &yahoo, &ask,
|
||||
+ &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
};
|
||||
|
||||
// A list of all the engines that we know about.
|
||||
const PrepopulatedEngine* const kAllEngines[] = {
|
||||
// Prepopulated engines:
|
||||
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &kvasir,
|
||||
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,714 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 18 Oct 2017 21:24:05 +0200
|
||||
Subject: Add StartPage search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 12 +-
|
||||
components/search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
|
||||
3 files changed, 121 insertions(+), 110 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 100
|
||||
+ "kCurrentDataVersion": 101
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -232,6 +232,16 @@
|
||||
"id": 56
|
||||
},
|
||||
|
||||
+ "startpage": {
|
||||
+ "name": "StartPage",
|
||||
+ "keyword": "startpage.com",
|
||||
+ "favicon_url": "https://www.startpage.com/graphics/favicon/sp-favicon-16x16.png",
|
||||
+ "search_url": "https://www.startpage.com/do/dsearch?query={searchTerms}&cat=web&pl=opensearch",
|
||||
+ "suggest_url": "https://www.startpage.com/cgi-bin/csuggest?query={searchTerms}&limit=10&format=json",
|
||||
+ "type": "SEARCH_ENGINE_STARTPAGE",
|
||||
+ "id": 33
|
||||
+ },
|
||||
+
|
||||
"vinden": {
|
||||
"name": "Vinden.nl",
|
||||
"keyword": "vinden.nl",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -65,6 +65,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_360,
|
||||
SEARCH_ENGINE_DUCKDUCKGO,
|
||||
SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
+ SEARCH_ENGINE_STARTPAGE,
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -51,548 +51,548 @@ namespace {
|
||||
|
||||
// Default (for countries with no better engine set)
|
||||
const PrepopulatedEngine* const engines_default[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// United Arab Emirates
|
||||
const PrepopulatedEngine* const engines_AE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Albania
|
||||
const PrepopulatedEngine* const engines_AL[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Argentina
|
||||
const PrepopulatedEngine* const engines_AR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
};
|
||||
|
||||
// Austria
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
};
|
||||
|
||||
// Australia
|
||||
const PrepopulatedEngine* const engines_AU[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
};
|
||||
|
||||
// Bosnia and Herzegovina
|
||||
const PrepopulatedEngine* const engines_BA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Belgium
|
||||
const PrepopulatedEngine* const engines_BE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
const PrepopulatedEngine* const engines_BG[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Bahrain
|
||||
const PrepopulatedEngine* const engines_BH[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Burundi
|
||||
const PrepopulatedEngine* const engines_BI[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Brunei
|
||||
const PrepopulatedEngine* const engines_BN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Bolivia
|
||||
const PrepopulatedEngine* const engines_BO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Brazil
|
||||
const PrepopulatedEngine* const engines_BR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
};
|
||||
|
||||
// Belarus
|
||||
const PrepopulatedEngine* const engines_BY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
};
|
||||
|
||||
// Belize
|
||||
const PrepopulatedEngine* const engines_BZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Canada
|
||||
const PrepopulatedEngine* const engines_CA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
};
|
||||
|
||||
// Switzerland
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
};
|
||||
|
||||
// Chile
|
||||
const PrepopulatedEngine* const engines_CL[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
};
|
||||
|
||||
// China
|
||||
const PrepopulatedEngine* const engines_CN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
};
|
||||
|
||||
// Colombia
|
||||
const PrepopulatedEngine* const engines_CO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
const PrepopulatedEngine* const engines_CR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Czech Republic
|
||||
const PrepopulatedEngine* const engines_CZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
};
|
||||
|
||||
// Germany
|
||||
const PrepopulatedEngine* const engines_DE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Denmark
|
||||
const PrepopulatedEngine* const engines_DK[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
};
|
||||
|
||||
// Dominican Republic
|
||||
const PrepopulatedEngine* const engines_DO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Algeria
|
||||
const PrepopulatedEngine* const engines_DZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
const PrepopulatedEngine* const engines_EC[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
const PrepopulatedEngine* const engines_EE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Egypt
|
||||
const PrepopulatedEngine* const engines_EG[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Spain
|
||||
const PrepopulatedEngine* const engines_ES[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
};
|
||||
|
||||
// Faroe Islands
|
||||
const PrepopulatedEngine* const engines_FO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Finland
|
||||
const PrepopulatedEngine* const engines_FI[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
};
|
||||
|
||||
// France
|
||||
const PrepopulatedEngine* const engines_FR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// United Kingdom
|
||||
const PrepopulatedEngine* const engines_GB[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
};
|
||||
|
||||
// Greece
|
||||
const PrepopulatedEngine* const engines_GR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
};
|
||||
|
||||
// Guatemala
|
||||
const PrepopulatedEngine* const engines_GT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Hong Kong
|
||||
const PrepopulatedEngine* const engines_HK[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
const PrepopulatedEngine* const engines_HN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Croatia
|
||||
const PrepopulatedEngine* const engines_HR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Hungary
|
||||
const PrepopulatedEngine* const engines_HU[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Indonesia
|
||||
const PrepopulatedEngine* const engines_ID[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
const PrepopulatedEngine* const engines_IE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
};
|
||||
|
||||
// Israel
|
||||
const PrepopulatedEngine* const engines_IL[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// India
|
||||
const PrepopulatedEngine* const engines_IN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
};
|
||||
|
||||
// Iraq
|
||||
const PrepopulatedEngine* const engines_IQ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Iran
|
||||
const PrepopulatedEngine* const engines_IR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Iceland
|
||||
const PrepopulatedEngine* const engines_IS[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Italy
|
||||
const PrepopulatedEngine* const engines_IT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
};
|
||||
|
||||
// Jamaica
|
||||
const PrepopulatedEngine* const engines_JM[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Jordan
|
||||
const PrepopulatedEngine* const engines_JO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Japan
|
||||
const PrepopulatedEngine* const engines_JP[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
};
|
||||
|
||||
// Kenya
|
||||
const PrepopulatedEngine* const engines_KE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Kuwait
|
||||
const PrepopulatedEngine* const engines_KW[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// South Korea
|
||||
const PrepopulatedEngine* const engines_KR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
};
|
||||
|
||||
// Kazakhstan
|
||||
const PrepopulatedEngine* const engines_KZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
};
|
||||
|
||||
// Lebanon
|
||||
const PrepopulatedEngine* const engines_LB[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Liechtenstein
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Lithuania
|
||||
const PrepopulatedEngine* const engines_LT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
};
|
||||
|
||||
// Luxembourg
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Latvia
|
||||
const PrepopulatedEngine* const engines_LV[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
};
|
||||
|
||||
// Libya
|
||||
const PrepopulatedEngine* const engines_LY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
const PrepopulatedEngine* const engines_MA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
const PrepopulatedEngine* const engines_MC[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
};
|
||||
|
||||
// Moldova
|
||||
const PrepopulatedEngine* const engines_MD[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Montenegro
|
||||
const PrepopulatedEngine* const engines_ME[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
const PrepopulatedEngine* const engines_MK[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Mexico
|
||||
const PrepopulatedEngine* const engines_MX[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
};
|
||||
|
||||
// Malaysia
|
||||
const PrepopulatedEngine* const engines_MY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Nicaragua
|
||||
const PrepopulatedEngine* const engines_NI[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Netherlands
|
||||
const PrepopulatedEngine* const engines_NL[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
};
|
||||
|
||||
// Norway
|
||||
const PrepopulatedEngine* const engines_NO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
};
|
||||
|
||||
// New Zealand
|
||||
const PrepopulatedEngine* const engines_NZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
};
|
||||
|
||||
// Oman
|
||||
const PrepopulatedEngine* const engines_OM[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Panama
|
||||
const PrepopulatedEngine* const engines_PA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Peru
|
||||
const PrepopulatedEngine* const engines_PE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
const PrepopulatedEngine* const engines_PH[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
const PrepopulatedEngine* const engines_PK[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
const PrepopulatedEngine* const engines_PR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Poland
|
||||
const PrepopulatedEngine* const engines_PL[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
};
|
||||
|
||||
// Portugal
|
||||
const PrepopulatedEngine* const engines_PT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Paraguay
|
||||
const PrepopulatedEngine* const engines_PY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Qatar
|
||||
const PrepopulatedEngine* const engines_QA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Romania
|
||||
const PrepopulatedEngine* const engines_RO[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
};
|
||||
|
||||
// Serbia
|
||||
const PrepopulatedEngine* const engines_RS[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Russia
|
||||
const PrepopulatedEngine* const engines_RU[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
const PrepopulatedEngine* const engines_RW[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Saudi Arabia
|
||||
const PrepopulatedEngine* const engines_SA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
const PrepopulatedEngine* const engines_SE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
};
|
||||
|
||||
// Singapore
|
||||
const PrepopulatedEngine* const engines_SG[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
};
|
||||
|
||||
// Slovenia
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
};
|
||||
|
||||
// Slovakia
|
||||
const PrepopulatedEngine* const engines_SK[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// El Salvador
|
||||
const PrepopulatedEngine* const engines_SV[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Syria
|
||||
const PrepopulatedEngine* const engines_SY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
const PrepopulatedEngine* const engines_TH[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
};
|
||||
|
||||
// Tunisia
|
||||
const PrepopulatedEngine* const engines_TN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Turkey
|
||||
const PrepopulatedEngine* const engines_TR[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
const PrepopulatedEngine* const engines_TT[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Taiwan
|
||||
const PrepopulatedEngine* const engines_TW[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
};
|
||||
|
||||
// Tanzania
|
||||
const PrepopulatedEngine* const engines_TZ[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Ukraine
|
||||
const PrepopulatedEngine* const engines_UA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
};
|
||||
|
||||
// United States
|
||||
const PrepopulatedEngine* const engines_US[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
};
|
||||
|
||||
// Uruguay
|
||||
const PrepopulatedEngine* const engines_UY[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Venezuela
|
||||
const PrepopulatedEngine* const engines_VE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
};
|
||||
|
||||
// Vietnam
|
||||
const PrepopulatedEngine* const engines_VN[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
};
|
||||
|
||||
// Yemen
|
||||
const PrepopulatedEngine* const engines_YE[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
const PrepopulatedEngine* const engines_ZA[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Zimbabwe
|
||||
const PrepopulatedEngine* const engines_ZW[] = {
|
||||
- &google, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
+ &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
};
|
||||
|
||||
// A list of all the engines that we know about.
|
||||
const PrepopulatedEngine* const kAllEngines[] = {
|
||||
// Prepopulated engines:
|
||||
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,727 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 11 Dec 2017 22:42:11 +0100
|
||||
Subject: Add Google English-only engine
|
||||
|
||||
Add a Google search engine that forces languages to English,
|
||||
disable from all its searches RLZ and field experiments querystring parameters.
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 23 ++-
|
||||
components/search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
|
||||
3 files changed, 132 insertions(+), 110 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 101
|
||||
+ "kCurrentDataVersion": 102
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -154,6 +154,27 @@
|
||||
"id": 1
|
||||
},
|
||||
|
||||
+ "googleen": {
|
||||
+ "name": "Google in English",
|
||||
+ "keyword": "googleen",
|
||||
+ "favicon_url": "https://www.google.com/favicon.ico",
|
||||
+ "search_url": "{google:baseURL}search?q={searchTerms}&{google:originalQueryForSuggestion}{google:iOSSearchLanguage}{google:searchClient}{google:contextualSearchVersion}ie={inputEncoding}&hl=en",
|
||||
+ "suggest_url": "{google:baseSuggestURL}search?client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:pageClassification}{google:searchVersion}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}&hl=en",
|
||||
+ "image_url": "{google:baseURL}searchbyimage/upload?hl=en",
|
||||
+ "new_tab_url": "{google:baseURL}_/chrome/newtab?hl=en&ie={inputEncoding}",
|
||||
+ "contextual_search_url": "{google:baseURL}_/contextualsearch?{google:contextualSearchVersion}{google:contextualSearchContextData}&hl=en",
|
||||
+ "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}",
|
||||
+ "alternate_urls": [
|
||||
+ "{google:baseURL}?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}search?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}webhp?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}s?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}s?hl=en&q={searchTerms}"
|
||||
+ ],
|
||||
+ "type": "SEARCH_ENGINE_GOOGLE_EN",
|
||||
+ "id": 13
|
||||
+ },
|
||||
+
|
||||
"kvasir": {
|
||||
"name": "Kvasir",
|
||||
"keyword": "kvasir.no",
|
||||
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
|
||||
@@ -66,6 +66,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_DUCKDUCKGO,
|
||||
SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_STARTPAGE,
|
||||
+ SEARCH_ENGINE_GOOGLE_EN,
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -51,548 +51,548 @@ namespace {
|
||||
|
||||
// Default (for countries with no better engine set)
|
||||
const PrepopulatedEngine* const engines_default[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// United Arab Emirates
|
||||
const PrepopulatedEngine* const engines_AE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Albania
|
||||
const PrepopulatedEngine* const engines_AL[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Argentina
|
||||
const PrepopulatedEngine* const engines_AR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
};
|
||||
|
||||
// Austria
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
};
|
||||
|
||||
// Australia
|
||||
const PrepopulatedEngine* const engines_AU[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
};
|
||||
|
||||
// Bosnia and Herzegovina
|
||||
const PrepopulatedEngine* const engines_BA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Belgium
|
||||
const PrepopulatedEngine* const engines_BE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
const PrepopulatedEngine* const engines_BG[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Bahrain
|
||||
const PrepopulatedEngine* const engines_BH[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Burundi
|
||||
const PrepopulatedEngine* const engines_BI[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Brunei
|
||||
const PrepopulatedEngine* const engines_BN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Bolivia
|
||||
const PrepopulatedEngine* const engines_BO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Brazil
|
||||
const PrepopulatedEngine* const engines_BR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
};
|
||||
|
||||
// Belarus
|
||||
const PrepopulatedEngine* const engines_BY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
};
|
||||
|
||||
// Belize
|
||||
const PrepopulatedEngine* const engines_BZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Canada
|
||||
const PrepopulatedEngine* const engines_CA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
};
|
||||
|
||||
// Switzerland
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
};
|
||||
|
||||
// Chile
|
||||
const PrepopulatedEngine* const engines_CL[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
};
|
||||
|
||||
// China
|
||||
const PrepopulatedEngine* const engines_CN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
};
|
||||
|
||||
// Colombia
|
||||
const PrepopulatedEngine* const engines_CO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
const PrepopulatedEngine* const engines_CR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Czech Republic
|
||||
const PrepopulatedEngine* const engines_CZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
};
|
||||
|
||||
// Germany
|
||||
const PrepopulatedEngine* const engines_DE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Denmark
|
||||
const PrepopulatedEngine* const engines_DK[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
};
|
||||
|
||||
// Dominican Republic
|
||||
const PrepopulatedEngine* const engines_DO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Algeria
|
||||
const PrepopulatedEngine* const engines_DZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
const PrepopulatedEngine* const engines_EC[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
const PrepopulatedEngine* const engines_EE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Egypt
|
||||
const PrepopulatedEngine* const engines_EG[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Spain
|
||||
const PrepopulatedEngine* const engines_ES[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
};
|
||||
|
||||
// Faroe Islands
|
||||
const PrepopulatedEngine* const engines_FO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Finland
|
||||
const PrepopulatedEngine* const engines_FI[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
};
|
||||
|
||||
// France
|
||||
const PrepopulatedEngine* const engines_FR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// United Kingdom
|
||||
const PrepopulatedEngine* const engines_GB[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
};
|
||||
|
||||
// Greece
|
||||
const PrepopulatedEngine* const engines_GR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
};
|
||||
|
||||
// Guatemala
|
||||
const PrepopulatedEngine* const engines_GT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Hong Kong
|
||||
const PrepopulatedEngine* const engines_HK[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
const PrepopulatedEngine* const engines_HN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Croatia
|
||||
const PrepopulatedEngine* const engines_HR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Hungary
|
||||
const PrepopulatedEngine* const engines_HU[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Indonesia
|
||||
const PrepopulatedEngine* const engines_ID[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
const PrepopulatedEngine* const engines_IE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
};
|
||||
|
||||
// Israel
|
||||
const PrepopulatedEngine* const engines_IL[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// India
|
||||
const PrepopulatedEngine* const engines_IN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
};
|
||||
|
||||
// Iraq
|
||||
const PrepopulatedEngine* const engines_IQ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Iran
|
||||
const PrepopulatedEngine* const engines_IR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Iceland
|
||||
const PrepopulatedEngine* const engines_IS[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Italy
|
||||
const PrepopulatedEngine* const engines_IT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
};
|
||||
|
||||
// Jamaica
|
||||
const PrepopulatedEngine* const engines_JM[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Jordan
|
||||
const PrepopulatedEngine* const engines_JO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Japan
|
||||
const PrepopulatedEngine* const engines_JP[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
};
|
||||
|
||||
// Kenya
|
||||
const PrepopulatedEngine* const engines_KE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Kuwait
|
||||
const PrepopulatedEngine* const engines_KW[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// South Korea
|
||||
const PrepopulatedEngine* const engines_KR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
};
|
||||
|
||||
// Kazakhstan
|
||||
const PrepopulatedEngine* const engines_KZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
};
|
||||
|
||||
// Lebanon
|
||||
const PrepopulatedEngine* const engines_LB[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Liechtenstein
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Lithuania
|
||||
const PrepopulatedEngine* const engines_LT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
};
|
||||
|
||||
// Luxembourg
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Latvia
|
||||
const PrepopulatedEngine* const engines_LV[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
};
|
||||
|
||||
// Libya
|
||||
const PrepopulatedEngine* const engines_LY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
const PrepopulatedEngine* const engines_MA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
const PrepopulatedEngine* const engines_MC[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
};
|
||||
|
||||
// Moldova
|
||||
const PrepopulatedEngine* const engines_MD[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Montenegro
|
||||
const PrepopulatedEngine* const engines_ME[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
const PrepopulatedEngine* const engines_MK[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Mexico
|
||||
const PrepopulatedEngine* const engines_MX[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
};
|
||||
|
||||
// Malaysia
|
||||
const PrepopulatedEngine* const engines_MY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Nicaragua
|
||||
const PrepopulatedEngine* const engines_NI[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Netherlands
|
||||
const PrepopulatedEngine* const engines_NL[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
};
|
||||
|
||||
// Norway
|
||||
const PrepopulatedEngine* const engines_NO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
};
|
||||
|
||||
// New Zealand
|
||||
const PrepopulatedEngine* const engines_NZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
};
|
||||
|
||||
// Oman
|
||||
const PrepopulatedEngine* const engines_OM[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Panama
|
||||
const PrepopulatedEngine* const engines_PA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Peru
|
||||
const PrepopulatedEngine* const engines_PE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
const PrepopulatedEngine* const engines_PH[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
const PrepopulatedEngine* const engines_PK[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
const PrepopulatedEngine* const engines_PR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Poland
|
||||
const PrepopulatedEngine* const engines_PL[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
};
|
||||
|
||||
// Portugal
|
||||
const PrepopulatedEngine* const engines_PT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Paraguay
|
||||
const PrepopulatedEngine* const engines_PY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Qatar
|
||||
const PrepopulatedEngine* const engines_QA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Romania
|
||||
const PrepopulatedEngine* const engines_RO[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
};
|
||||
|
||||
// Serbia
|
||||
const PrepopulatedEngine* const engines_RS[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Russia
|
||||
const PrepopulatedEngine* const engines_RU[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
const PrepopulatedEngine* const engines_RW[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Saudi Arabia
|
||||
const PrepopulatedEngine* const engines_SA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
const PrepopulatedEngine* const engines_SE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
};
|
||||
|
||||
// Singapore
|
||||
const PrepopulatedEngine* const engines_SG[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
};
|
||||
|
||||
// Slovenia
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
};
|
||||
|
||||
// Slovakia
|
||||
const PrepopulatedEngine* const engines_SK[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// El Salvador
|
||||
const PrepopulatedEngine* const engines_SV[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Syria
|
||||
const PrepopulatedEngine* const engines_SY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
const PrepopulatedEngine* const engines_TH[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
};
|
||||
|
||||
// Tunisia
|
||||
const PrepopulatedEngine* const engines_TN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Turkey
|
||||
const PrepopulatedEngine* const engines_TR[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
const PrepopulatedEngine* const engines_TT[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Taiwan
|
||||
const PrepopulatedEngine* const engines_TW[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
};
|
||||
|
||||
// Tanzania
|
||||
const PrepopulatedEngine* const engines_TZ[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Ukraine
|
||||
const PrepopulatedEngine* const engines_UA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
};
|
||||
|
||||
// United States
|
||||
const PrepopulatedEngine* const engines_US[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
};
|
||||
|
||||
// Uruguay
|
||||
const PrepopulatedEngine* const engines_UY[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Venezuela
|
||||
const PrepopulatedEngine* const engines_VE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
};
|
||||
|
||||
// Vietnam
|
||||
const PrepopulatedEngine* const engines_VN[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
};
|
||||
|
||||
// Yemen
|
||||
const PrepopulatedEngine* const engines_YE[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
const PrepopulatedEngine* const engines_ZA[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Zimbabwe
|
||||
const PrepopulatedEngine* const engines_ZW[] = {
|
||||
- &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
+ &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
};
|
||||
|
||||
// A list of all the engines that we know about.
|
||||
const PrepopulatedEngine* const kAllEngines[] = {
|
||||
// Prepopulated engines:
|
||||
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,715 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Mar 2018 20:31:44 +0100
|
||||
Subject: Add Qwant search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 13 +-
|
||||
components/search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 218 ++++++++++-----------
|
||||
3 files changed, 122 insertions(+), 110 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
// Increment this if you change the data in ways that mean users with
|
||||
// existing data should get a new version.
|
||||
- "kCurrentDataVersion": 102
|
||||
+ "kCurrentDataVersion": 103
|
||||
},
|
||||
|
||||
// The following engines are included in country lists and are added to the
|
||||
@@ -939,6 +939,17 @@
|
||||
"id": 6
|
||||
},
|
||||
|
||||
+ "qwant": {
|
||||
+ "name": "Qwant",
|
||||
+ "keyword": "qwant.com",
|
||||
+ "favicon_url": "https://www.qwant.com/favicon.ico",
|
||||
+ "search_url": "https://www.qwant.com/?client=opensearch&q={searchTerms}",
|
||||
+ "suggest_url": "https://api.qwant.com/api/suggest/?client=opensearch&q={searchTerms}",
|
||||
+ "image_url": "https://www.qwant.com/?t=images&q={searchTerms}",
|
||||
+ "type": "SEARCH_ENGINE_QWANT",
|
||||
+ "id": 14
|
||||
+ },
|
||||
+
|
||||
"rambler": {
|
||||
"name": "\u0420\u0430\u043c\u0431\u043b\u0435\u0440",
|
||||
"keyword": "rambler.ru",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -67,6 +67,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_STARTPAGE,
|
||||
SEARCH_ENGINE_GOOGLE_EN,
|
||||
+ SEARCH_ENGINE_QWANT,
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -51,548 +51,548 @@ namespace {
|
||||
|
||||
// Default (for countries with no better engine set)
|
||||
const PrepopulatedEngine* const engines_default[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// United Arab Emirates
|
||||
const PrepopulatedEngine* const engines_AE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Albania
|
||||
const PrepopulatedEngine* const engines_AL[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Argentina
|
||||
const PrepopulatedEngine* const engines_AR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ar,
|
||||
};
|
||||
|
||||
// Austria
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_at,
|
||||
};
|
||||
|
||||
// Australia
|
||||
const PrepopulatedEngine* const engines_AU[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_au,
|
||||
};
|
||||
|
||||
// Bosnia and Herzegovina
|
||||
const PrepopulatedEngine* const engines_BA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Belgium
|
||||
const PrepopulatedEngine* const engines_BE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
const PrepopulatedEngine* const engines_BG[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Bahrain
|
||||
const PrepopulatedEngine* const engines_BH[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Burundi
|
||||
const PrepopulatedEngine* const engines_BI[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Brunei
|
||||
const PrepopulatedEngine* const engines_BN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Bolivia
|
||||
const PrepopulatedEngine* const engines_BO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Brazil
|
||||
const PrepopulatedEngine* const engines_BR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &ask_br, &bing, &yahoo_br,
|
||||
};
|
||||
|
||||
// Belarus
|
||||
const PrepopulatedEngine* const engines_BY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_by, &mail_ru,
|
||||
};
|
||||
|
||||
// Belize
|
||||
const PrepopulatedEngine* const engines_BZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Canada
|
||||
const PrepopulatedEngine* const engines_CA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask, &yahoo_ca, &yahoo_qc,
|
||||
};
|
||||
|
||||
// Switzerland
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ch,
|
||||
};
|
||||
|
||||
// Chile
|
||||
const PrepopulatedEngine* const engines_CL[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_cl,
|
||||
};
|
||||
|
||||
// China
|
||||
const PrepopulatedEngine* const engines_CN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &baidu, &sogou, &so_360,
|
||||
};
|
||||
|
||||
// Colombia
|
||||
const PrepopulatedEngine* const engines_CO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_co,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
const PrepopulatedEngine* const engines_CR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Czech Republic
|
||||
const PrepopulatedEngine* const engines_CZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &seznam, &bing,
|
||||
};
|
||||
|
||||
// Germany
|
||||
const PrepopulatedEngine* const engines_DE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Denmark
|
||||
const PrepopulatedEngine* const engines_DK[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_dk,
|
||||
};
|
||||
|
||||
// Dominican Republic
|
||||
const PrepopulatedEngine* const engines_DO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Algeria
|
||||
const PrepopulatedEngine* const engines_DZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
const PrepopulatedEngine* const engines_EC[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Estonia
|
||||
const PrepopulatedEngine* const engines_EE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Egypt
|
||||
const PrepopulatedEngine* const engines_EG[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Spain
|
||||
const PrepopulatedEngine* const engines_ES[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_es,
|
||||
};
|
||||
|
||||
// Faroe Islands
|
||||
const PrepopulatedEngine* const engines_FO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &ask,
|
||||
};
|
||||
|
||||
// Finland
|
||||
const PrepopulatedEngine* const engines_FI[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fi,
|
||||
};
|
||||
|
||||
// France
|
||||
const PrepopulatedEngine* const engines_FR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// United Kingdom
|
||||
const PrepopulatedEngine* const engines_GB[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk, &ask_uk,
|
||||
};
|
||||
|
||||
// Greece
|
||||
const PrepopulatedEngine* const engines_GR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_gr,
|
||||
};
|
||||
|
||||
// Guatemala
|
||||
const PrepopulatedEngine* const engines_GT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Hong Kong
|
||||
const PrepopulatedEngine* const engines_HK[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_hk, &baidu, &bing,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
const PrepopulatedEngine* const engines_HN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Croatia
|
||||
const PrepopulatedEngine* const engines_HR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Hungary
|
||||
const PrepopulatedEngine* const engines_HU[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Indonesia
|
||||
const PrepopulatedEngine* const engines_ID[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_id, &bing,
|
||||
};
|
||||
|
||||
// Ireland
|
||||
const PrepopulatedEngine* const engines_IE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_uk,
|
||||
};
|
||||
|
||||
// Israel
|
||||
const PrepopulatedEngine* const engines_IL[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// India
|
||||
const PrepopulatedEngine* const engines_IN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_in,
|
||||
};
|
||||
|
||||
// Iraq
|
||||
const PrepopulatedEngine* const engines_IQ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Iran
|
||||
const PrepopulatedEngine* const engines_IR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Iceland
|
||||
const PrepopulatedEngine* const engines_IS[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Italy
|
||||
const PrepopulatedEngine* const engines_IT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &virgilio, &bing,
|
||||
};
|
||||
|
||||
// Jamaica
|
||||
const PrepopulatedEngine* const engines_JM[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Jordan
|
||||
const PrepopulatedEngine* const engines_JO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Japan
|
||||
const PrepopulatedEngine* const engines_JP[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_jp, &bing,
|
||||
};
|
||||
|
||||
// Kenya
|
||||
const PrepopulatedEngine* const engines_KE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Kuwait
|
||||
const PrepopulatedEngine* const engines_KW[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// South Korea
|
||||
const PrepopulatedEngine* const engines_KR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &naver, &daum,
|
||||
};
|
||||
|
||||
// Kazakhstan
|
||||
const PrepopulatedEngine* const engines_KZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &mail_ru, &yandex_kz,
|
||||
};
|
||||
|
||||
// Lebanon
|
||||
const PrepopulatedEngine* const engines_LB[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Liechtenstein
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_de,
|
||||
};
|
||||
|
||||
// Lithuania
|
||||
const PrepopulatedEngine* const engines_LT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yandex_ru,
|
||||
};
|
||||
|
||||
// Luxembourg
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_fr,
|
||||
};
|
||||
|
||||
// Latvia
|
||||
const PrepopulatedEngine* const engines_LV[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ru, &bing,
|
||||
};
|
||||
|
||||
// Libya
|
||||
const PrepopulatedEngine* const engines_LY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
const PrepopulatedEngine* const engines_MA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
const PrepopulatedEngine* const engines_MC[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_fr, &bing,
|
||||
};
|
||||
|
||||
// Moldova
|
||||
const PrepopulatedEngine* const engines_MD[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Montenegro
|
||||
const PrepopulatedEngine* const engines_ME[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
const PrepopulatedEngine* const engines_MK[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Mexico
|
||||
const PrepopulatedEngine* const engines_MX[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_mx,
|
||||
};
|
||||
|
||||
// Malaysia
|
||||
const PrepopulatedEngine* const engines_MY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_my, &bing,
|
||||
};
|
||||
|
||||
// Nicaragua
|
||||
const PrepopulatedEngine* const engines_NI[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Netherlands
|
||||
const PrepopulatedEngine* const engines_NL[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_nl, &vinden,
|
||||
};
|
||||
|
||||
// Norway
|
||||
const PrepopulatedEngine* const engines_NO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &kvasir,
|
||||
};
|
||||
|
||||
// New Zealand
|
||||
const PrepopulatedEngine* const engines_NZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_nz,
|
||||
};
|
||||
|
||||
// Oman
|
||||
const PrepopulatedEngine* const engines_OM[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Panama
|
||||
const PrepopulatedEngine* const engines_PA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Peru
|
||||
const PrepopulatedEngine* const engines_PE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_pe,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
const PrepopulatedEngine* const engines_PH[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_ph, &bing,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
const PrepopulatedEngine* const engines_PK[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
const PrepopulatedEngine* const engines_PR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Poland
|
||||
const PrepopulatedEngine* const engines_PL[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &onet, &bing,
|
||||
};
|
||||
|
||||
// Portugal
|
||||
const PrepopulatedEngine* const engines_PT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Paraguay
|
||||
const PrepopulatedEngine* const engines_PY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Qatar
|
||||
const PrepopulatedEngine* const engines_QA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Romania
|
||||
const PrepopulatedEngine* const engines_RO[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_ro, &bing,
|
||||
};
|
||||
|
||||
// Serbia
|
||||
const PrepopulatedEngine* const engines_RS[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Russia
|
||||
const PrepopulatedEngine* const engines_RU[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ru, &mail_ru,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
const PrepopulatedEngine* const engines_RW[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Saudi Arabia
|
||||
const PrepopulatedEngine* const engines_SA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_maktoob, &bing,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
const PrepopulatedEngine* const engines_SE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_se,
|
||||
};
|
||||
|
||||
// Singapore
|
||||
const PrepopulatedEngine* const engines_SG[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_sg, &bing,
|
||||
};
|
||||
|
||||
// Slovenia
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &najdi, &ask,
|
||||
};
|
||||
|
||||
// Slovakia
|
||||
const PrepopulatedEngine* const engines_SK[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// El Salvador
|
||||
const PrepopulatedEngine* const engines_SV[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Syria
|
||||
const PrepopulatedEngine* const engines_SY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
const PrepopulatedEngine* const engines_TH[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_th, &bing,
|
||||
};
|
||||
|
||||
// Tunisia
|
||||
const PrepopulatedEngine* const engines_TN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// Turkey
|
||||
const PrepopulatedEngine* const engines_TR[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_tr, &yandex_tr,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
const PrepopulatedEngine* const engines_TT[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Taiwan
|
||||
const PrepopulatedEngine* const engines_TW[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_tw, &bing,
|
||||
};
|
||||
|
||||
// Tanzania
|
||||
const PrepopulatedEngine* const engines_TZ[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo, &bing,
|
||||
};
|
||||
|
||||
// Ukraine
|
||||
const PrepopulatedEngine* const engines_UA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yandex_ua, &bing,
|
||||
};
|
||||
|
||||
// United States
|
||||
const PrepopulatedEngine* const engines_US[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &aol, &ask,
|
||||
};
|
||||
|
||||
// Uruguay
|
||||
const PrepopulatedEngine* const engines_UY[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Venezuela
|
||||
const PrepopulatedEngine* const engines_VE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_ve,
|
||||
};
|
||||
|
||||
// Vietnam
|
||||
const PrepopulatedEngine* const engines_VN[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &yahoo_vn, &bing,
|
||||
};
|
||||
|
||||
// Yemen
|
||||
const PrepopulatedEngine* const engines_YE[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo_maktoob,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
const PrepopulatedEngine* const engines_ZA[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo,
|
||||
};
|
||||
|
||||
// Zimbabwe
|
||||
const PrepopulatedEngine* const engines_ZW[] = {
|
||||
- &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
+ &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &bing, &yahoo, &ask,
|
||||
};
|
||||
|
||||
// A list of all the engines that we know about.
|
||||
const PrepopulatedEngine* const kAllEngines[] = {
|
||||
// Prepopulated engines:
|
||||
- &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &googleen, &google, &startpage, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
+ &aol, &ask, &ask_br, &ask_uk, &baidu, &bing, &daum, &googleen, &google, &startpage, &qwant, &duckduckgo, &duckduckgo_light, &kvasir,
|
||||
&mail_ru, &najdi, &naver, &onet, &seznam, &sogou, &vinden, &virgilio,
|
||||
&yahoo, &yahoo_ar, &yahoo_at, &yahoo_au, &yahoo_br, &yahoo_ca, &yahoo_ch,
|
||||
&yahoo_cl, &yahoo_co, &yahoo_de, &yahoo_dk, &yahoo_es, &yahoo_fi, &yahoo_fr,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -632,6 +632,9 @@ PermissionResult PermissionManager::GetPermissionStatusHelper(
|
||||
GURL canonical_requesting_origin =
|
||||
GetCanonicalOrigin(requesting_origin, embedding_origin);
|
||||
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.7.4
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 20 Jan 2018 21:17:27 +0100
|
||||
Subject: openH264: enable ARM/ARM64 optimizations
|
||||
|
||||
Enable the optimizations not only for ChromeOS but for all compatbile ARM/ARM64 architectures
|
||||
Limit threads auto-detect only for iOS
|
||||
---
|
||||
content/renderer/media_recorder/h264_encoder.cc | 6 ++--
|
||||
third_party/openh264/BUILD.gn | 39 +++++++++++++++++++++++++
|
||||
2 files changed, 42 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/content/renderer/media_recorder/h264_encoder.cc b/content/renderer/media_recorder/h264_encoder.cc
|
||||
--- a/content/renderer/media_recorder/h264_encoder.cc
|
||||
+++ b/content/renderer/media_recorder/h264_encoder.cc
|
||||
@@ -149,11 +149,11 @@ void H264Encoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) {
|
||||
init_params.iRCMode = RC_OFF_MODE;
|
||||
}
|
||||
|
||||
-#if defined(OS_CHROMEOS)
|
||||
- init_params.iMultipleThreadIdc = 0;
|
||||
-#else
|
||||
+#if defined(OS_MACOSX)
|
||||
// Threading model: Set to 1 due to https://crbug.com/583348.
|
||||
init_params.iMultipleThreadIdc = 1;
|
||||
+#else
|
||||
+ init_params.iMultipleThreadIdc = 0;
|
||||
#endif
|
||||
|
||||
// TODO(mcasas): consider reducing complexity if there are few CPUs available.
|
||||
diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
|
||||
--- a/third_party/openh264/BUILD.gn
|
||||
+++ b/third_party/openh264/BUILD.gn
|
||||
@@ -10,6 +10,7 @@ import("//third_party/yasm/yasm_assemble.gni")
|
||||
# Config shared by all openh264 targets.
|
||||
config("config") {
|
||||
cflags = []
|
||||
+ defines = []
|
||||
|
||||
if (is_chromeos && target_cpu == "arm") {
|
||||
# HAVE_NEON and __chromeos__ are needed for enabling NEON on ChromeOS
|
||||
@@ -20,6 +21,20 @@ config("config") {
|
||||
]
|
||||
}
|
||||
|
||||
+ # HAVE_NEON and __chromeos__ are needed for enabling NEON on ChromeOS
|
||||
+ # devices.
|
||||
+ if (is_chromeos && target_cpu == "arm") {
|
||||
+ defines += [
|
||||
+ "__chromeos__",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
+ if (target_cpu == "arm" || target_cpu == "arm64") {
|
||||
+ defines += [
|
||||
+ "HAVE_NEON",
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
# GCC and clang flags. MSVS (is_win && !is_clang) does not use cflags.
|
||||
if (!is_win || is_clang) {
|
||||
cflags += [
|
||||
@@ -128,6 +143,14 @@ source_set("common") {
|
||||
}
|
||||
include_dirs = openh264_common_include_dirs
|
||||
|
||||
+ # enable ARM optimizations
|
||||
+ if (target_cpu == "arm") {
|
||||
+ sources += openh264_common_sources_asm_arm
|
||||
+ }
|
||||
+ if (target_cpu == "arm64") {
|
||||
+ sources += openh264_common_sources_asm_arm64
|
||||
+ }
|
||||
+
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
@@ -154,6 +177,14 @@ source_set("processing") {
|
||||
}
|
||||
include_dirs = openh264_processing_include_dirs
|
||||
|
||||
+ # enable ARM optimizations
|
||||
+ if (target_cpu == "arm") {
|
||||
+ sources += openh264_common_sources_asm_arm
|
||||
+ }
|
||||
+ if (target_cpu == "arm64") {
|
||||
+ sources += openh264_common_sources_asm_arm64
|
||||
+ }
|
||||
+
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
@@ -173,6 +204,14 @@ source_set("encoder") {
|
||||
}
|
||||
include_dirs = openh264_encoder_include_dirs
|
||||
|
||||
+ # enable ARM optimizations
|
||||
+ if (target_cpu == "arm") {
|
||||
+ sources += openh264_common_sources_asm_arm
|
||||
+ }
|
||||
+ if (target_cpu == "arm64") {
|
||||
+ sources += openh264_common_sources_asm_arm64
|
||||
+ }
|
||||
+
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
configs += [ ":config" ]
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Oct 2017 10:09:41 +0200
|
||||
Subject: Cure AMP and tracking from search results
|
||||
|
||||
---
|
||||
third_party/blink/renderer/core/dom/BUILD.gn | 1 +
|
||||
third_party/blink/renderer/core/dom/document.cc | 20 +++++++++++++++++++-
|
||||
.../renderer/core/dom/extensions/anti_amp_cure.h | 6 ++++++
|
||||
3 files changed, 26 insertions(+), 1 deletion(-)
|
||||
create mode 100644 third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/BUILD.gn b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
--- a/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
@@ -147,6 +147,7 @@ blink_core_sources("dom") {
|
||||
"events/tree_scope_event_context.h",
|
||||
"events/window_event_context.cc",
|
||||
"events/window_event_context.h",
|
||||
+ "extensions/dont-track-me.h",
|
||||
"exception_code.h",
|
||||
"first_letter_pseudo_element.cc",
|
||||
"first_letter_pseudo_element.h",
|
||||
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
|
||||
@@ -276,6 +276,8 @@
|
||||
#include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/time.h"
|
||||
|
||||
+#include "extensions/anti_amp_cure.h"
|
||||
+
|
||||
#ifndef NDEBUG
|
||||
using WeakDocumentSet =
|
||||
blink::PersistentHeapHashSet<blink::WeakMember<blink::Document>>;
|
||||
@@ -5839,8 +5841,24 @@ void Document::FinishedParsing() {
|
||||
fetcher_->ClearResourcesFromPreviousFetcher();
|
||||
}
|
||||
|
||||
- if (IsPrefetchOnly())
|
||||
+ if (IsPrefetchOnly()) {
|
||||
WebPrerenderingSupport::Current()->PrefetchFinished();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // determine whether this is a Google search results page
|
||||
+ const SecurityOrigin *origin = GetSecurityOrigin();
|
||||
+ if (origin) {
|
||||
+ WTF::String domain = origin->Domain();
|
||||
+ size_t pos = domain.Find(".google.");
|
||||
+ auto* bodyElement = body();
|
||||
+ if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
+ LOG(INFO) << "injecting anti-AMP-cure Javascript payload";
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(ANTI_AMP_CURE_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
|
||||
diff --git a/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h b/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/dom/extensions/anti_amp_cure.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef anti_amp_cure_h
|
||||
+#define anti_amp_cure_h
|
||||
+
|
||||
+#define ANTI_AMP_CURE_JS "/* Bromite click-tracking and AMP removal v0.3.5 */\n\nfunction recreateHyperlink(a) {\n // skip already-sanitized hyperlinks\n if (a.sane) return false;\n\n // create new A element - old one has event listeners attached\n var newA = document.createElement('a');\n newA.referrerPolicy = 'origin';\n // property set when hyperlink has been created by this script\n newA.sane = 1;\n\n // remove AMP class, get actual page URL\n var ampCur = a.getAttribute('data-amp-cur');\n if (ampCur) {\n newA.href = ampCur;\n a.classList.remove('amp_r');\n } else {\n var realLink = getRealLinkFromGoogleUrl(a);\n if (realLink) {\n newA.href = realLink;\n } else {\n // might not be an actual hyperlink, ignore it\n if (!a.href) {\n return false;\n }\n // leave original href unchanged\n newA.href = a.href;\n }\n }\n // copy CSS classes\n newA.className = a.className;\n\n // copy nodes inside the hyperlink\n while (a.firstChild) {\n newA.appendChild(a.lastChild);\n }\n // replace hyperlink\n a.parentNode.replaceChild(newA, a);\n return true;\n}\n\nfunction isResult(a) {\n if (a.getAttribute('data-amp-cur'))\n return true;\n var inlineMousedown = a.getAttribute('onmousedown');\n if (!inlineMousedown)\n\treturn false;\n // return rwt(....); // E.g Google search results.\n // return google.rwt(...); // E.g. sponsored search results\n // return google.arwt(this); // E.g. sponsored search results (dec 2016).\n return /\\ba?rwt\\(/.test(inlineMousedown) || /\\bctpacw\\b/.test(inlineMousedown);\n}\n\n/**\n * @returns {String} the real URL if the given link is a Google redirect URL.\n */\nfunction getRealLinkFromGoogleUrl(a) {\n if ((a.hostname === location.hostname || a.hostname.indexOf('www.google.') == 0) &&\n /^\\/(local_)?url$/.test(a.pathname)) {\n // Google Maps / Dito (/local_url?q=<url>)\n // Mobile (/url?q=<url>)\n var url = /[?&](?:q|url)=((?:https?|ftp)[%:][^&]+)/.exec(a.search);\n if (url) {\n return decodeURIComponent(url[1]);\n }\n // Help pages, e.g. safe browsing (/url?...&q=%2Fsupport%2Fanswer...)\n url = /[?&](?:q|url)=((?:%2[Ff]|\\/)[^&]+)/.exec(a.search);\n if (url) {\n return a.origin + decodeURIComponent(url[1]);\n }\n }\n}\n\nfunction sanitizeAds() {\n // scan all divs\n var div = document.getElementById('tads');\n if (div) {\n div.style.display = 'none';\n\treturn true;\n }\n return false;\n}\n\nfunction sanitizeAll() {\n console.log(\"ads removed: \", sanitizeAds());\n console.log(\"hyperlinks sanitized: \", sanitizeAllHyperlinks(document));\n}\n\nfunction hookMoreResults() {\n var extrares = document.getElementById('extrares');\n if (!extrares) {\n console.log(\"could not hook more results\");\n return;\n }\n // mutation observers are great but they don't work\n extrares.addEventListener(\"DOMNodeInserted\", function(e) {\n var node = e.target;\n if (node.id && node.id.startsWith(\"arc-srp\"))\n console.log(\"hyperlinks sanitized on new result node: \", sanitizeAllHyperlinks(node));\n });\n}\n\nfunction setMlogoClick() {\n var mlogo = document.getElementById('qslc');\n if (mlogo && mlogo.children[0]) {\n mlogo = mlogo.children[0];\n mlogo.removeAttribute(\"href\");\n mlogo.setAttribute(\"onclick\", \"sanitizeAll()\");\n console.log(\"logo link replaced\");\n } else {\n console.log(\"could not replace logo link\");\n }\n}\n\nfunction sanitizeAllHyperlinks(rootNode) {\n var saned = 0, total = 0;\n rootNode.querySelectorAll('div[data-hveid]:not([data-hveid=\"\"]) a').forEach(function(a) {\n\ttotal++;\n\tvar res = recreateHyperlink(a);\n\tif (res) saned++;\n });\n console.log(\"sanitized \", saned, \"/\", total, \" hyperlinks\");\n\n return saned;\n}\n\n// avoid running cleanup on non-search pages\nif ((document.location.host.indexOf(\"images.google.\") == -1) && (document.location.host.indexOf(\"news.google.\") == -1)) {\n sanitizeAll();\n}\nsetMlogoClick();\n\nhookMoreResults();\n"
|
||||
+
|
||||
+#endif // anti_amp_cure_h
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -122,6 +122,9 @@ void TraceCrashServiceUploader::DoUpload(
|
||||
std::unique_ptr<const base::DictionaryValue> metadata,
|
||||
const UploadProgressCallback& progress_callback,
|
||||
const UploadDoneCallback& done_callback) {
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
progress_callback_ = progress_callback;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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 to Google"
|
||||
|
||||
---
|
||||
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/BlackBodyDefault" />
|
||||
+ android:textAppearance="@style/BlackBodyDefault" android:visibility = "gone" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -289,6 +289,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.7.4
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:14:39 +0100
|
||||
Subject: ungoogled-chromium: Disable signin
|
||||
|
||||
---
|
||||
chrome/browser/ui/chrome_pages.cc | 8 ++------
|
||||
components/signin/core/browser/signin_manager_base.cc | 2 +-
|
||||
2 files changed, 3 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
|
||||
--- a/chrome/browser/ui/chrome_pages.cc
|
||||
+++ b/chrome/browser/ui/chrome_pages.cc
|
||||
@@ -77,12 +77,6 @@ void OpenBookmarkManagerForNode(Browser* browser, int64_t node_id) {
|
||||
ShowSingletonTabOverwritingNTP(browser, params);
|
||||
}
|
||||
|
||||
-void NavigateToSingletonTab(Browser* browser, const GURL& url) {
|
||||
- NavigateParams params(GetSingletonTabNavigateParams(browser, url));
|
||||
- params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
|
||||
- ShowSingletonTabOverwritingNTP(browser, params);
|
||||
-}
|
||||
-
|
||||
// Shows either the help app or the appropriate help page for |source|. If
|
||||
// |browser| is NULL and the help page is used (vs the app), the help page is
|
||||
// shown in the last active browser. If there is no such browser, a new browser
|
||||
@@ -397,6 +391,7 @@ void ShowSearchEngineSettings(Browser* browser) {
|
||||
#if !defined(OS_ANDROID)
|
||||
void ShowBrowserSignin(Browser* browser,
|
||||
signin_metrics::AccessPoint access_point) {
|
||||
+#if 0
|
||||
Profile* original_profile = browser->profile()->GetOriginalProfile();
|
||||
SigninManagerBase* manager =
|
||||
SigninManagerFactory::GetForProfile(original_profile);
|
||||
@@ -442,6 +437,7 @@ void ShowBrowserSignin(Browser* browser,
|
||||
BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN,
|
||||
signin::ManageAccountsParams(), access_point, false);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ShowBrowserSigninOrSettings(Browser* browser,
|
||||
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc
|
||||
--- a/components/signin/core/browser/signin_manager_base.cc
|
||||
+++ b/components/signin/core/browser/signin_manager_base.cc
|
||||
@@ -158,7 +158,7 @@ void SigninManagerBase::Initialize(PrefService* local_state) {
|
||||
bool SigninManagerBase::IsInitialized() const { return initialized_; }
|
||||
|
||||
bool SigninManagerBase::IsSigninAllowed() const {
|
||||
- return client_->GetPrefs()->GetBoolean(prefs::kSigninAllowed);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
AccountInfo SigninManagerBase::GetAuthenticatedAccountInfo() const {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:21:36 +0100
|
||||
Subject: ungoogled-chromium: Disable webRTC log uploader
|
||||
|
||||
---
|
||||
chrome/browser/media/webrtc/webrtc_log_uploader.cc | 28 ++++------------------
|
||||
1 file changed, 4 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
--- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc
|
||||
@@ -115,30 +115,7 @@ void WebRtcLogUploader::LoggingStoppedDoUpload(
|
||||
DCHECK(meta_data.get());
|
||||
DCHECK(!upload_done_data.log_path.empty());
|
||||
|
||||
- std::string compressed_log;
|
||||
- CompressLog(&compressed_log, log_buffer.get());
|
||||
-
|
||||
- std::string local_log_id;
|
||||
-
|
||||
- if (base::PathExists(upload_done_data.log_path)) {
|
||||
- webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.log_path);
|
||||
-
|
||||
- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT());
|
||||
- base::FilePath log_file_path =
|
||||
- upload_done_data.log_path.AppendASCII(local_log_id)
|
||||
- .AddExtension(FILE_PATH_LITERAL(".gz"));
|
||||
- WriteCompressedLogToFile(compressed_log, log_file_path);
|
||||
-
|
||||
- base::FilePath log_list_path =
|
||||
- webrtc_logging::LogList::GetWebRtcLogListFileForDirectory(
|
||||
- upload_done_data.log_path);
|
||||
- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id);
|
||||
- }
|
||||
-
|
||||
- WebRtcLogUploadDoneData upload_done_data_with_log_id = upload_done_data;
|
||||
- upload_done_data_with_log_id.local_log_id = local_log_id;
|
||||
- PrepareMultipartPostData(compressed_log, std::move(meta_data),
|
||||
- upload_done_data_with_log_id);
|
||||
+ NotifyUploadDone(net::HTTP_OK, "", upload_done_data);
|
||||
}
|
||||
|
||||
void WebRtcLogUploader::PrepareMultipartPostData(
|
||||
@@ -149,6 +126,9 @@ void WebRtcLogUploader::PrepareMultipartPostData(
|
||||
DCHECK(!compressed_log.empty());
|
||||
DCHECK(meta_data.get());
|
||||
|
||||
+ NotifyUploadDone(net::HTTP_OK, "", upload_done_data);
|
||||
+ return;
|
||||
+
|
||||
std::unique_ptr<std::string> post_data(new std::string());
|
||||
SetupMultipart(post_data.get(),
|
||||
compressed_log,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:28:11 +0100
|
||||
Subject: ungoogled-chromium: Disable untraceable URLs
|
||||
|
||||
Disable additional URLs that are not caught by the "trk" scheme
|
||||
---
|
||||
chrome/browser/android/rlz/rlz_ping_handler.cc | 2 +-
|
||||
chrome/browser/plugins/plugins_resource_service.cc | 5 +----
|
||||
chrome/browser/safe_browsing/client_side_model_loader.cc | 6 ++----
|
||||
chrome/browser/safe_browsing/client_side_model_loader.h | 1 -
|
||||
rlz/lib/financial_ping.cc | 4 ++--
|
||||
rlz/lib/lib_values.cc | 1 -
|
||||
rlz/lib/lib_values.h | 1 -
|
||||
7 files changed, 6 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/android/rlz/rlz_ping_handler.cc b/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
--- a/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
+++ b/chrome/browser/android/rlz/rlz_ping_handler.cc
|
||||
@@ -66,7 +66,7 @@ void RlzPingHandler::Ping(
|
||||
DCHECK_EQ(id.length(), 50u);
|
||||
|
||||
GURL request_url(base::StringPrintf(
|
||||
- "https://%s%s?", rlz_lib::kFinancialServer, rlz_lib::kFinancialPingPath));
|
||||
+ "about:blank"));
|
||||
request_url = net::AppendQueryParameter(
|
||||
request_url, rlz_lib::kProductSignatureCgiVariable, "chrome");
|
||||
request_url =
|
||||
diff --git a/chrome/browser/plugins/plugins_resource_service.cc b/chrome/browser/plugins/plugins_resource_service.cc
|
||||
--- a/chrome/browser/plugins/plugins_resource_service.cc
|
||||
+++ b/chrome/browser/plugins/plugins_resource_service.cc
|
||||
@@ -51,9 +51,6 @@ const int kStartResourceFetchDelayMs = 60 * 1000;
|
||||
// Delay between calls to update the cache 1 day and 2 minutes in testing mode.
|
||||
const int kCacheUpdateDelayMs = 24 * 60 * 60 * 1000;
|
||||
|
||||
-const char kPluginsServerUrl[] =
|
||||
- "https://www.gstatic.com/chrome/config/plugins_3/";
|
||||
-
|
||||
GURL GetPluginsServerURL() {
|
||||
std::string filename;
|
||||
#if defined(OS_WIN)
|
||||
@@ -68,7 +65,7 @@ GURL GetPluginsServerURL() {
|
||||
#error Unknown platform
|
||||
#endif
|
||||
|
||||
- return GURL(kPluginsServerUrl + filename);
|
||||
+ return GURL("about:blank");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_model_loader.cc b/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
--- a/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
+++ b/chrome/browser/safe_browsing/client_side_model_loader.cc
|
||||
@@ -35,8 +35,6 @@ namespace safe_browsing {
|
||||
// Model Loader strings
|
||||
const size_t ModelLoader::kMaxModelSizeBytes = 150 * 1024;
|
||||
const int ModelLoader::kClientModelFetchIntervalMs = 3600 * 1000;
|
||||
-const char ModelLoader::kClientModelUrlPrefix[] =
|
||||
- "https://ssl.gstatic.com/safebrowsing/csd/";
|
||||
const char ModelLoader::kClientModelNamePattern[] =
|
||||
"client_model_v5%s_variation_%d.pb";
|
||||
const char ModelLoader::kClientModelFinchExperiment[] =
|
||||
@@ -90,7 +88,7 @@ ModelLoader::ModelLoader(
|
||||
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
|
||||
bool is_extended_reporting)
|
||||
: name_(FillInModelName(is_extended_reporting, GetModelNumber())),
|
||||
- url_(kClientModelUrlPrefix + name_),
|
||||
+ url_("about:blank"),
|
||||
update_renderers_callback_(update_renderers_callback),
|
||||
url_loader_factory_(url_loader_factory),
|
||||
weak_factory_(this) {
|
||||
@@ -103,7 +101,7 @@ ModelLoader::ModelLoader(
|
||||
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
|
||||
const std::string& model_name)
|
||||
: name_(model_name),
|
||||
- url_(kClientModelUrlPrefix + name_),
|
||||
+ url_("about:blank"),
|
||||
update_renderers_callback_(update_renderers_callback),
|
||||
url_loader_factory_(url_loader_factory),
|
||||
weak_factory_(this) {
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_model_loader.h b/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
--- a/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
+++ b/chrome/browser/safe_browsing/client_side_model_loader.h
|
||||
@@ -42,7 +42,6 @@ class ModelLoader {
|
||||
static const int kClientModelFetchIntervalMs;
|
||||
static const char kClientModelFinchExperiment[];
|
||||
static const char kClientModelFinchParam[];
|
||||
- static const char kClientModelUrlPrefix[];
|
||||
static const char kClientModelNamePattern[];
|
||||
|
||||
// Constructs a model loader to fetch a model using |url_loader_factory|.
|
||||
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc
|
||||
--- a/rlz/lib/financial_ping.cc
|
||||
+++ b/rlz/lib/financial_ping.cc
|
||||
@@ -351,7 +351,7 @@ FinancialPing::PingResponse FinancialPing::PingServer(const char* request,
|
||||
|
||||
// Open network connection.
|
||||
InternetHandle connection_handle = InternetConnectA(inet_handle,
|
||||
- kFinancialServer, kFinancialPort, "", "", INTERNET_SERVICE_HTTP,
|
||||
+ "about:blank", kFinancialPort, "", "", INTERNET_SERVICE_HTTP,
|
||||
INTERNET_FLAG_NO_CACHE_WRITE, 0);
|
||||
if (!connection_handle)
|
||||
return PING_FAILURE;
|
||||
@@ -395,7 +395,7 @@ FinancialPing::PingResponse FinancialPing::PingServer(const char* request,
|
||||
return PING_SUCCESSFUL;
|
||||
#else
|
||||
std::string url =
|
||||
- base::StringPrintf("https://%s%s", kFinancialServer, request);
|
||||
+ base::StringPrintf("about:blank");
|
||||
|
||||
// Use a waitable event to cause this function to block, to match the
|
||||
// wininet implementation.
|
||||
diff --git a/rlz/lib/lib_values.cc b/rlz/lib/lib_values.cc
|
||||
--- a/rlz/lib/lib_values.cc
|
||||
+++ b/rlz/lib/lib_values.cc
|
||||
@@ -41,7 +41,6 @@ const char kSetDccResponseVariable[] = "set_dcc";
|
||||
//
|
||||
|
||||
const char kFinancialPingPath[] = "/tools/pso/ping";
|
||||
-const char kFinancialServer[] = "clients1.google.com";
|
||||
const int kFinancialPort = 443;
|
||||
|
||||
// Ping times in 100-nanosecond intervals.
|
||||
diff --git a/rlz/lib/lib_values.h b/rlz/lib/lib_values.h
|
||||
--- a/rlz/lib/lib_values.h
|
||||
+++ b/rlz/lib/lib_values.h
|
||||
@@ -72,7 +72,6 @@ extern const char kSetDccResponseVariable[];
|
||||
//
|
||||
|
||||
extern const char kFinancialPingPath[];
|
||||
-extern const char kFinancialServer[];
|
||||
|
||||
extern const int kFinancialPort;
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:28:53 +0100
|
||||
Subject: ungoogled-chromium: Disable translate integration
|
||||
|
||||
---
|
||||
components/translate/content/renderer/translate_helper.cc | 4 +++-
|
||||
components/translate/core/browser/translate_manager.cc | 2 +-
|
||||
components/translate/core/browser/translate_script.cc | 3 +--
|
||||
3 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/components/translate/content/renderer/translate_helper.cc b/components/translate/content/renderer/translate_helper.cc
|
||||
--- a/components/translate/content/renderer/translate_helper.cc
|
||||
+++ b/components/translate/content/renderer/translate_helper.cc
|
||||
@@ -74,7 +74,9 @@ TranslateHelper::TranslateHelper(content::RenderFrame* render_frame,
|
||||
world_id_(world_id),
|
||||
extension_scheme_(extension_scheme),
|
||||
binding_(this),
|
||||
- weak_method_factory_(this) {}
|
||||
+ weak_method_factory_(this) {
|
||||
+ CancelPendingTranslation();
|
||||
+}
|
||||
|
||||
TranslateHelper::~TranslateHelper() {
|
||||
}
|
||||
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
|
||||
--- a/components/translate/core/browser/translate_manager.cc
|
||||
+++ b/components/translate/core/browser/translate_manager.cc
|
||||
@@ -102,7 +102,7 @@ void TranslateManager::InitiateTranslation(const std::string& page_lang) {
|
||||
if (net::NetworkChangeNotifier::IsOffline())
|
||||
return;
|
||||
|
||||
- if (!ignore_missing_key_for_testing_ && !::google_apis::HasKeysConfigured()) {
|
||||
+ if (true) {
|
||||
// Without an API key, translate won't work, so don't offer to translate in
|
||||
// the first place. Leave prefs::kOfferTranslateEnabled on, though, because
|
||||
// that settings syncs and we don't want to turn off translate everywhere
|
||||
diff --git a/components/translate/core/browser/translate_script.cc b/components/translate/core/browser/translate_script.cc
|
||||
--- a/components/translate/core/browser/translate_script.cc
|
||||
+++ b/components/translate/core/browser/translate_script.cc
|
||||
@@ -149,9 +149,8 @@ void TranslateScript::OnScriptFetchComplete(
|
||||
base::StringAppendF(&data_, "var serverParams = '%s';\n",
|
||||
server_params.c_str());
|
||||
|
||||
- GURL security_origin = translate::GetTranslateSecurityOrigin();
|
||||
base::StringAppendF(
|
||||
- &data_, "var securityOrigin = '%s';", security_origin.spec().c_str());
|
||||
+ &data_, "var securityOrigin = '';");
|
||||
|
||||
// Append embedded translate.js and a remote element library.
|
||||
base::StringPiece str =
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:29:30 +0100
|
||||
Subject: ungoogled-chromium: Disable profile avatar downloading
|
||||
|
||||
---
|
||||
chrome/browser/profiles/profile_avatar_downloader.cc | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/profiles/profile_avatar_downloader.cc b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
--- a/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
+++ b/chrome/browser/profiles/profile_avatar_downloader.cc
|
||||
@@ -16,19 +16,13 @@
|
||||
#include "net/traffic_annotation/network_traffic_annotation.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
-namespace {
|
||||
-const char kHighResAvatarDownloadUrlPrefix[] =
|
||||
- "https://www.gstatic.com/chrome/profile_avatars/";
|
||||
-}
|
||||
-
|
||||
ProfileAvatarDownloader::ProfileAvatarDownloader(
|
||||
size_t icon_index,
|
||||
const FetchCompleteCallback& callback)
|
||||
: icon_index_(icon_index),
|
||||
callback_(callback) {
|
||||
DCHECK(!callback_.is_null());
|
||||
- GURL url(std::string(kHighResAvatarDownloadUrlPrefix) +
|
||||
- profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index));
|
||||
+ GURL url(std::string("about:blank"));
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
net::DefineNetworkTrafficAnnotation("profile_avatar", R"(
|
||||
semantics {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:30:30 +0100
|
||||
Subject: ungoogled-chromium: Disable intranet redirect detector
|
||||
|
||||
Disables the intranet redirect detector. It generates extra DNS requests and the functionality using this is disabled.
|
||||
|
||||
See this page for more information: https://mikewest.org/2012/02/chrome-connects-to-three-random-domains-at-startup
|
||||
---
|
||||
chrome/browser/intranet_redirect_detector.cc | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc
|
||||
--- a/chrome/browser/intranet_redirect_detector.cc
|
||||
+++ b/chrome/browser/intranet_redirect_detector.cc
|
||||
@@ -75,9 +75,7 @@ void IntranetRedirectDetector::FinishSleep() {
|
||||
simple_loaders_.clear();
|
||||
resulting_origins_.clear();
|
||||
|
||||
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
- if (cmd_line->HasSwitch(switches::kDisableBackgroundNetworking))
|
||||
- return;
|
||||
+ return;
|
||||
|
||||
DCHECK(simple_loaders_.empty() && resulting_origins_.empty());
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,374 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:36:33 +0100
|
||||
Subject: ungoogled-chromium: Disable Google host detection
|
||||
|
||||
Disables various detections of Google hosts and functionality specific to them
|
||||
---
|
||||
.../page_load_metrics/page_load_metrics_util.cc | 4 +-
|
||||
.../page_load_metrics/page_load_metrics_util.cc | 33 +---
|
||||
components/google/core/browser/google_util.cc | 193 ++-------------------
|
||||
components/search_engines/template_url.cc | 6 +-
|
||||
net/base/url_util.cc | 22 ---
|
||||
5 files changed, 14 insertions(+), 244 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
||||
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
||||
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
||||
@@ -169,9 +169,7 @@ bool DidObserveLoadingBehaviorInAnyFrame(
|
||||
}
|
||||
|
||||
bool IsGoogleSearchHostname(const GURL& url) {
|
||||
- base::Optional<std::string> result =
|
||||
- page_load_metrics::GetGoogleHostnamePrefix(url);
|
||||
- return result && result.value() == "www";
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleSearchResultUrl(const GURL& url) {
|
||||
diff --git a/chrome/common/page_load_metrics/page_load_metrics_util.cc b/chrome/common/page_load_metrics/page_load_metrics_util.cc
|
||||
--- a/chrome/common/page_load_metrics/page_load_metrics_util.cc
|
||||
+++ b/chrome/common/page_load_metrics/page_load_metrics_util.cc
|
||||
@@ -12,38 +12,7 @@
|
||||
namespace page_load_metrics {
|
||||
|
||||
base::Optional<std::string> GetGoogleHostnamePrefix(const GURL& url) {
|
||||
- const size_t registry_length =
|
||||
- net::registry_controlled_domains::GetRegistryLength(
|
||||
- url,
|
||||
-
|
||||
- // Do not include unknown registries (registries that don't have any
|
||||
- // matches in effective TLD names).
|
||||
- net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
||||
-
|
||||
- // Do not include private registries, such as appspot.com. We don't
|
||||
- // want to match URLs like www.google.appspot.com.
|
||||
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
||||
-
|
||||
- const base::StringPiece hostname = url.host_piece();
|
||||
- if (registry_length == 0 || registry_length == std::string::npos ||
|
||||
- registry_length >= hostname.length()) {
|
||||
- return base::Optional<std::string>();
|
||||
- }
|
||||
-
|
||||
- // Removes the tld and the preceding dot.
|
||||
- const base::StringPiece hostname_minus_registry =
|
||||
- hostname.substr(0, hostname.length() - (registry_length + 1));
|
||||
-
|
||||
- if (hostname_minus_registry == "google")
|
||||
- return std::string("");
|
||||
-
|
||||
- if (!base::EndsWith(hostname_minus_registry, ".google",
|
||||
- base::CompareCase::INSENSITIVE_ASCII)) {
|
||||
- return base::Optional<std::string>();
|
||||
- }
|
||||
-
|
||||
- return std::string(hostname_minus_registry.substr(
|
||||
- 0, hostname_minus_registry.length() - strlen(".google")));
|
||||
+ return base::Optional<std::string>();
|
||||
}
|
||||
|
||||
bool IsGoogleHostname(const GURL& url) {
|
||||
diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc
|
||||
--- a/components/google/core/browser/google_util.cc
|
||||
+++ b/components/google/core/browser/google_util.cc
|
||||
@@ -41,118 +41,16 @@ namespace {
|
||||
|
||||
bool gUseMockLinkDoctorBaseURLForTesting = false;
|
||||
|
||||
-bool IsPathHomePageBase(base::StringPiece path) {
|
||||
- return (path == "/") || (path == "/webhp");
|
||||
-}
|
||||
-
|
||||
-// Removes a single trailing dot if present in |host|.
|
||||
-void StripTrailingDot(base::StringPiece* host) {
|
||||
- if (host->ends_with("."))
|
||||
- host->remove_suffix(1);
|
||||
-}
|
||||
-
|
||||
-// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
|
||||
-// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
|
||||
-// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
|
||||
-// string in |tld|, if specified and the |host| can be parsed.
|
||||
-bool IsValidHostName(base::StringPiece host,
|
||||
- base::StringPiece domain_in_lower_case,
|
||||
- SubdomainPermission subdomain_permission,
|
||||
- base::StringPiece* tld) {
|
||||
- // Fast path to avoid searching the registry set.
|
||||
- if (host.find(domain_in_lower_case) == base::StringPiece::npos)
|
||||
- return false;
|
||||
-
|
||||
- size_t tld_length =
|
||||
- net::registry_controlled_domains::GetCanonicalHostRegistryLength(
|
||||
- host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
||||
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
||||
- if ((tld_length == 0) || (tld_length == std::string::npos))
|
||||
- return false;
|
||||
-
|
||||
- // Removes the tld and the preceding dot.
|
||||
- base::StringPiece host_minus_tld =
|
||||
- host.substr(0, host.length() - tld_length - 1);
|
||||
-
|
||||
- if (tld)
|
||||
- *tld = host.substr(host.length() - tld_length);
|
||||
-
|
||||
- if (base::LowerCaseEqualsASCII(host_minus_tld, domain_in_lower_case))
|
||||
- return true;
|
||||
-
|
||||
- if (subdomain_permission == ALLOW_SUBDOMAIN) {
|
||||
- std::string dot_domain(".");
|
||||
- domain_in_lower_case.AppendToString(&dot_domain);
|
||||
- return base::EndsWith(host_minus_tld, dot_domain,
|
||||
- base::CompareCase::INSENSITIVE_ASCII);
|
||||
- }
|
||||
-
|
||||
- std::string www_domain("www.");
|
||||
- domain_in_lower_case.AppendToString(&www_domain);
|
||||
- return base::LowerCaseEqualsASCII(host_minus_tld, www_domain);
|
||||
-}
|
||||
-
|
||||
-// True if |url| is a valid URL with HTTP or HTTPS scheme. If |port_permission|
|
||||
-// is DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard
|
||||
-// port for its scheme (80 for HTTP, 443 for HTTPS).
|
||||
-bool IsValidURL(const GURL& url, PortPermission port_permission) {
|
||||
- return url.is_valid() && url.SchemeIsHTTPOrHTTPS() &&
|
||||
- (url.port().empty() || (port_permission == ALLOW_NON_STANDARD_PORTS));
|
||||
-}
|
||||
-
|
||||
-bool IsCanonicalHostGoogleHostname(base::StringPiece canonical_host,
|
||||
- SubdomainPermission subdomain_permission) {
|
||||
- const GURL& base_url(CommandLineGoogleBaseURL());
|
||||
- if (base_url.is_valid() && (canonical_host == base_url.host_piece()))
|
||||
- return true;
|
||||
-
|
||||
- base::StringPiece tld;
|
||||
- if (!IsValidHostName(canonical_host, "google", subdomain_permission, &tld))
|
||||
- return false;
|
||||
-
|
||||
- // Remove the trailing dot from tld if present, as for google domain it's the
|
||||
- // same page.
|
||||
- StripTrailingDot(&tld);
|
||||
-
|
||||
- CR_DEFINE_STATIC_LOCAL(std::set<std::string>, google_tlds,
|
||||
- ({GOOGLE_TLD_LIST}));
|
||||
- return base::ContainsKey(google_tlds, tld.as_string());
|
||||
-}
|
||||
-
|
||||
-// True if |url| is a valid URL with a host that is in the static list of
|
||||
-// Google subdomains for google search, and an HTTP or HTTPS scheme. Requires
|
||||
-// |url| to use the standard port for its scheme (80 for HTTP, 443 for HTTPS).
|
||||
-bool IsGoogleSearchSubdomainUrl(const GURL& url) {
|
||||
- if (!IsValidURL(url, PortPermission::DISALLOW_NON_STANDARD_PORTS))
|
||||
- return false;
|
||||
-
|
||||
- base::StringPiece host(url.host_piece());
|
||||
- StripTrailingDot(&host);
|
||||
-
|
||||
- CR_DEFINE_STATIC_LOCAL(std::set<std::string>, google_subdomains,
|
||||
- ({"ipv4.google.com", "ipv6.google.com"}));
|
||||
-
|
||||
- return base::ContainsKey(google_subdomains, host.as_string());
|
||||
-}
|
||||
-
|
||||
} // namespace
|
||||
|
||||
// Global functions -----------------------------------------------------------
|
||||
|
||||
bool HasGoogleSearchQueryParam(base::StringPiece str) {
|
||||
- url::Component query(0, static_cast<int>(str.length())), key, value;
|
||||
- while (url::ExtractQueryKeyValue(str.data(), &query, &key, &value)) {
|
||||
- base::StringPiece key_str = str.substr(key.begin, key.len);
|
||||
- if (key_str == "q" || key_str == "as_q")
|
||||
- return true;
|
||||
- }
|
||||
return false;
|
||||
}
|
||||
|
||||
GURL LinkDoctorBaseURL() {
|
||||
- if (gUseMockLinkDoctorBaseURLForTesting)
|
||||
- return GURL("http://mock.linkdoctor.url/for?testing");
|
||||
- return GURL(LINKDOCTOR_SERVER_REQUEST_URL);
|
||||
+ return GURL();
|
||||
}
|
||||
|
||||
void SetMockLinkDoctorBaseURLForTesting() {
|
||||
@@ -166,119 +64,50 @@ std::string GetGoogleLocale(const std::string& application_locale) {
|
||||
|
||||
GURL AppendGoogleLocaleParam(const GURL& url,
|
||||
const std::string& application_locale) {
|
||||
- return net::AppendQueryParameter(
|
||||
- url, "hl", GetGoogleLocale(application_locale));
|
||||
+ return url;
|
||||
}
|
||||
|
||||
std::string GetGoogleCountryCode(const GURL& google_homepage_url) {
|
||||
- base::StringPiece google_hostname = google_homepage_url.host_piece();
|
||||
- // TODO(igorcov): This needs a fix for case when the host has a trailing dot,
|
||||
- // like "google.com./". https://crbug.com/720295.
|
||||
- const size_t last_dot = google_hostname.find_last_of('.');
|
||||
- DCHECK_NE(std::string::npos, last_dot);
|
||||
- base::StringPiece country_code = google_hostname.substr(last_dot + 1);
|
||||
- // Assume the com TLD implies the US.
|
||||
- if (country_code == "com")
|
||||
- return "us";
|
||||
- // Google uses the Unicode Common Locale Data Repository (CLDR), and the CLDR
|
||||
- // code for the UK is "gb".
|
||||
- if (country_code == "uk")
|
||||
- return "gb";
|
||||
- // Catalonia does not have a CLDR country code, since it's a region in Spain,
|
||||
- // so use Spain instead.
|
||||
- if (country_code == "cat")
|
||||
- return "es";
|
||||
- return country_code.as_string();
|
||||
+ return "nolocale";
|
||||
}
|
||||
|
||||
GURL GetGoogleSearchURL(const GURL& google_homepage_url) {
|
||||
- // To transform the homepage URL into the corresponding search URL, add the
|
||||
- // "search" and the "q=" query string.
|
||||
- GURL::Replacements replacements;
|
||||
- replacements.SetPathStr("search");
|
||||
- replacements.SetQueryStr("q=");
|
||||
- return google_homepage_url.ReplaceComponents(replacements);
|
||||
+ return google_homepage_url;
|
||||
}
|
||||
|
||||
const GURL& CommandLineGoogleBaseURL() {
|
||||
- // Unit tests may add command-line flags after the first call to this
|
||||
- // function, so we don't simply initialize a static |base_url| directly and
|
||||
- // then unconditionally return it.
|
||||
- CR_DEFINE_STATIC_LOCAL(std::string, switch_value, ());
|
||||
CR_DEFINE_STATIC_LOCAL(GURL, base_url, ());
|
||||
- std::string current_switch_value(
|
||||
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
- switches::kGoogleBaseURL));
|
||||
- if (current_switch_value != switch_value) {
|
||||
- switch_value = current_switch_value;
|
||||
- base_url = url_formatter::FixupURL(switch_value, std::string());
|
||||
- if (!base_url.is_valid() || base_url.has_query() || base_url.has_ref())
|
||||
- base_url = GURL();
|
||||
- }
|
||||
+ base_url = GURL();
|
||||
return base_url;
|
||||
}
|
||||
|
||||
bool StartsWithCommandLineGoogleBaseURL(const GURL& url) {
|
||||
- const GURL& base_url(CommandLineGoogleBaseURL());
|
||||
- return base_url.is_valid() &&
|
||||
- base::StartsWith(url.possibly_invalid_spec(), base_url.spec(),
|
||||
- base::CompareCase::SENSITIVE);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleHostname(base::StringPiece host,
|
||||
SubdomainPermission subdomain_permission) {
|
||||
- url::CanonHostInfo host_info;
|
||||
- return IsCanonicalHostGoogleHostname(net::CanonicalizeHost(host, &host_info),
|
||||
- subdomain_permission);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleDomainUrl(const GURL& url,
|
||||
SubdomainPermission subdomain_permission,
|
||||
PortPermission port_permission) {
|
||||
- return IsValidURL(url, port_permission) &&
|
||||
- IsCanonicalHostGoogleHostname(url.host_piece(), subdomain_permission);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleHomePageUrl(const GURL& url) {
|
||||
- // First check to see if this has a Google domain.
|
||||
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
|
||||
- DISALLOW_NON_STANDARD_PORTS) &&
|
||||
- !IsGoogleSearchSubdomainUrl(url)) {
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- // Make sure the path is a known home page path.
|
||||
- base::StringPiece path(url.path_piece());
|
||||
- return IsPathHomePageBase(path) ||
|
||||
- base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleSearchUrl(const GURL& url) {
|
||||
- // First check to see if this has a Google domain.
|
||||
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
|
||||
- DISALLOW_NON_STANDARD_PORTS) &&
|
||||
- !IsGoogleSearchSubdomainUrl(url)) {
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
- // Make sure the path is a known search path.
|
||||
- base::StringPiece path(url.path_piece());
|
||||
- bool is_home_page_base = IsPathHomePageBase(path);
|
||||
- if (!is_home_page_base && (path != "/search"))
|
||||
- return false;
|
||||
-
|
||||
- // Check for query parameter in URL parameter and hash fragment, depending on
|
||||
- // the path type.
|
||||
- return HasGoogleSearchQueryParam(url.ref_piece()) ||
|
||||
- (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece()));
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsYoutubeDomainUrl(const GURL& url,
|
||||
SubdomainPermission subdomain_permission,
|
||||
PortPermission port_permission) {
|
||||
- return IsValidURL(url, port_permission) &&
|
||||
- IsValidHostName(url.host_piece(), "youtube", subdomain_permission,
|
||||
- nullptr);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& GetGoogleRegistrableDomains() {
|
||||
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
|
||||
--- a/components/search_engines/template_url.cc
|
||||
+++ b/components/search_engines/template_url.cc
|
||||
@@ -510,11 +510,7 @@ base::string16 TemplateURLRef::SearchTermToString16(
|
||||
bool TemplateURLRef::HasGoogleBaseURLs(
|
||||
const SearchTermsData& search_terms_data) const {
|
||||
ParseIfNecessary(search_terms_data);
|
||||
- return std::any_of(replacements_.begin(), replacements_.end(),
|
||||
- [](const Replacement& replacement) {
|
||||
- return replacement.type == GOOGLE_BASE_URL ||
|
||||
- replacement.type == GOOGLE_BASE_SUGGEST_URL;
|
||||
- });
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool TemplateURLRef::ExtractSearchTermsFromURL(
|
||||
diff --git a/net/base/url_util.cc b/net/base/url_util.cc
|
||||
--- a/net/base/url_util.cc
|
||||
+++ b/net/base/url_util.cc
|
||||
@@ -383,28 +383,6 @@ void GetIdentityFromURL(const GURL& url,
|
||||
}
|
||||
|
||||
bool HasGoogleHost(const GURL& url) {
|
||||
- static const char* kGoogleHostSuffixes[] = {
|
||||
- ".google.com",
|
||||
- ".youtube.com",
|
||||
- ".gmail.com",
|
||||
- ".doubleclick.net",
|
||||
- ".gstatic.com",
|
||||
- ".googlevideo.com",
|
||||
- ".googleusercontent.com",
|
||||
- ".googlesyndication.com",
|
||||
- ".google-analytics.com",
|
||||
- ".googleadservices.com",
|
||||
- ".googleapis.com",
|
||||
- ".ytimg.com",
|
||||
- };
|
||||
- base::StringPiece host = url.host_piece();
|
||||
- for (const char* suffix : kGoogleHostSuffixes) {
|
||||
- // Here it's possible to get away with faster case-sensitive comparisons
|
||||
- // because the list above is all lowercase, and a GURL's host name will
|
||||
- // always be canonicalized to lowercase as well.
|
||||
- if (base::EndsWith(host, suffix, base::CompareCase::SENSITIVE))
|
||||
- return true;
|
||||
- }
|
||||
return false;
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:37:10 +0100
|
||||
Subject: ungoogled-chromium: Disable GCM
|
||||
|
||||
Disable Google Cloud Messaging (GCM) client
|
||||
---
|
||||
components/gcm_driver/gcm_client_impl.cc | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
|
||||
--- a/components/gcm_driver/gcm_client_impl.cc
|
||||
+++ b/components/gcm_driver/gcm_client_impl.cc
|
||||
@@ -502,6 +502,7 @@ void GCMClientImpl::StartGCM() {
|
||||
}
|
||||
|
||||
void GCMClientImpl::InitializeMCSClient() {
|
||||
+ return;
|
||||
std::vector<GURL> endpoints;
|
||||
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
|
||||
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
|
||||
@@ -699,6 +700,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
|
||||
}
|
||||
|
||||
void GCMClientImpl::StartCheckin() {
|
||||
+ return;
|
||||
// Make sure no checkin is in progress.
|
||||
if (checkin_request_.get())
|
||||
return;
|
||||
@@ -777,6 +779,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
|
||||
}
|
||||
|
||||
void GCMClientImpl::SchedulePeriodicCheckin() {
|
||||
+ return;
|
||||
// Make sure no checkin is in progress.
|
||||
if (checkin_request_.get() || !device_checkin_info_.accounts_set)
|
||||
return;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:37:52 +0100
|
||||
Subject: ungoogled-chromium: Disable Gaia
|
||||
|
||||
Disables Gaia code.
|
||||
Somehow it is still being activated even without being signed-in.
|
||||
|
||||
See also: https://github.com/Eloston/ungoogled-chromium/issues/104
|
||||
---
|
||||
chrome/browser/browser_resources.grd | 2 --
|
||||
.../component_extensions_whitelist/whitelist.cc | 1 -
|
||||
.../signin/gaia_auth_extension_loader.cc | 7 ------
|
||||
.../resources/component_extension_resources.grd | 2 --
|
||||
chrome/browser/ui/webui/signin/inline_login_ui.cc | 1 -
|
||||
google_apis/gaia/gaia_auth_fetcher.cc | 29 ----------------------
|
||||
6 files changed, 42 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
|
||||
--- a/chrome/browser/browser_resources.grd
|
||||
+++ b/chrome/browser/browser_resources.grd
|
||||
@@ -301,7 +301,6 @@
|
||||
<include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
||||
<include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" />
|
||||
- <include name="IDR_GAIA_AUTH_AUTHENTICATOR_JS" file="resources\gaia_auth_host\authenticator.js" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" />
|
||||
<include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
||||
<include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" />
|
||||
@@ -436,7 +435,6 @@
|
||||
</if>
|
||||
<include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" />
|
||||
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
|
||||
- <include name="IDR_GAIA_AUTH_MANIFEST" file="resources\gaia_auth\manifest.json" type="BINDATA" />
|
||||
<if expr="chromeos">
|
||||
<if expr="optimize_webui">
|
||||
<then>
|
||||
diff --git a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
--- a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
+++ b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
|
||||
@@ -68,7 +68,6 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
|
||||
#endif
|
||||
case IDR_CRYPTOTOKEN_MANIFEST:
|
||||
case IDR_FEEDBACK_MANIFEST:
|
||||
- case IDR_GAIA_AUTH_MANIFEST:
|
||||
#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
|
||||
case IDR_HANGOUT_SERVICES_MANIFEST:
|
||||
#endif
|
||||
diff --git a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
--- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
+++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
|
||||
@@ -42,18 +42,11 @@ extensions::ComponentLoader* GetComponentLoader(BrowserContext* context) {
|
||||
void LoadGaiaAuthExtension(BrowserContext* context) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
- extensions::ComponentLoader* component_loader = GetComponentLoader(context);
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
if (command_line->HasSwitch(switches::kAuthExtensionPath)) {
|
||||
- base::FilePath auth_extension_path =
|
||||
- command_line->GetSwitchValuePath(switches::kAuthExtensionPath);
|
||||
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path);
|
||||
return;
|
||||
}
|
||||
-
|
||||
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST,
|
||||
- base::FilePath(FILE_PATH_LITERAL("gaia_auth")));
|
||||
}
|
||||
|
||||
void UnloadGaiaAuthExtension(BrowserContext* context) {
|
||||
diff --git a/chrome/browser/resources/component_extension_resources.grd b/chrome/browser/resources/component_extension_resources.grd
|
||||
--- a/chrome/browser/resources/component_extension_resources.grd
|
||||
+++ b/chrome/browser/resources/component_extension_resources.grd
|
||||
@@ -40,8 +40,6 @@
|
||||
<include name="IDR_BOOKMARK_MANAGER_BOOKMARK_BMM_JS" file="bookmark_manager/js/bmm.js" type="BINDATA" />
|
||||
<!-- Material Design Bookmarks -->
|
||||
<include name="IDR_COMPONENT_MD_BOOKMARKS_BOOKMARKS_HTML" file="md_bookmarks/bookmarks.html" type="BINDATA" />
|
||||
- <!-- Gaia auth extension -->
|
||||
- <include name="IDR_GAIA_AUTH_SUCCESS" file="gaia_auth/success.html" allowexternalscript="true" type="BINDATA" />
|
||||
<!-- Hangout Services extension, included in Google Chrome builds only. -->
|
||||
<if expr="_google_chrome or enable_hangout_services_extension">
|
||||
<include name="IDR_HANGOUT_SERVICES_BACKGROUND_HTML" file="hangout_services/background.html" type="BINDATA" />
|
||||
diff --git a/chrome/browser/ui/webui/signin/inline_login_ui.cc b/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
--- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
|
||||
@@ -44,7 +44,6 @@ content::WebUIDataSource* CreateWebUIDataSource() {
|
||||
|
||||
source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS);
|
||||
source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS);
|
||||
- source->AddResourcePath("gaia_auth_host.js", IDR_GAIA_AUTH_AUTHENTICATOR_JS);
|
||||
|
||||
source->AddLocalizedString("title", IDS_CHROME_SIGNIN_TITLE);
|
||||
source->AddLocalizedString(
|
||||
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
--- a/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
|
||||
@@ -248,35 +248,6 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher(
|
||||
int load_flags,
|
||||
const net::NetworkTrafficAnnotationTag& traffic_annotation) {
|
||||
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
|
||||
- fetcher_ = net::URLFetcher::Create(
|
||||
- 0, gaia_gurl, body.empty() ? net::URLFetcher::GET : net::URLFetcher::POST,
|
||||
- this, traffic_annotation);
|
||||
- fetcher_->SetRequestContext(getter_);
|
||||
- fetcher_->SetUploadData("application/x-www-form-urlencoded", body);
|
||||
- gaia::MarkURLFetcherAsGaia(fetcher_.get());
|
||||
-
|
||||
- VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec();
|
||||
- VLOG(2) << "Gaia fetcher headers: " << headers;
|
||||
- VLOG(2) << "Gaia fetcher body: " << body;
|
||||
-
|
||||
- // The Gaia token exchange requests do not require any cookie-based
|
||||
- // identification as part of requests. We suppress sending any cookies to
|
||||
- // maintain a separation between the user's browsing and Chrome's internal
|
||||
- // services. Where such mixing is desired (MergeSession or OAuthLogin), it
|
||||
- // will be done explicitly.
|
||||
- fetcher_->SetLoadFlags(load_flags);
|
||||
-
|
||||
- // Fetchers are sometimes cancelled because a network change was detected,
|
||||
- // especially at startup and after sign-in on ChromeOS. Retrying once should
|
||||
- // be enough in those cases; let the fetcher retry up to 3 times just in case.
|
||||
- // http://crbug.com/163710
|
||||
- fetcher_->SetAutomaticallyRetryOnNetworkChanges(3);
|
||||
-
|
||||
- if (!headers.empty())
|
||||
- fetcher_->SetExtraRequestHeaders(headers);
|
||||
-
|
||||
- fetch_pending_ = true;
|
||||
- fetcher_->Start();
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 12 Feb 2018 21:45:21 +0100
|
||||
Subject: ungoogled-chromium: Clear HTTP cache menu item
|
||||
|
||||
Adds a menu item under "More tools" to clear the HTTP authentication cache on demand
|
||||
---
|
||||
chrome/app/chrome_command_ids.h | 1 +
|
||||
chrome/app/generated_resources.grd | 6 ++++++
|
||||
chrome/browser/ui/browser_command_controller.cc | 7 +++++++
|
||||
chrome/browser/ui/toolbar/app_menu_model.cc | 8 ++++++++
|
||||
chrome/browser/ui/toolbar/app_menu_model.h | 1 +
|
||||
chrome/browser/ui/views/frame/global_menu_bar_x11.cc | 1 +
|
||||
net/http/http_auth_cache.cc | 4 ++++
|
||||
net/http/http_auth_cache.h | 2 ++
|
||||
tools/metrics/histograms/enums.xml | 1 +
|
||||
tools/metrics/histograms/histograms.xml | 1 +
|
||||
10 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -152,6 +152,7 @@
|
||||
#define IDC_DEV_TOOLS_INSPECT 40023
|
||||
#define IDC_UPGRADE_DIALOG 40024
|
||||
#define IDC_VIEW_INCOMPATIBILITIES 40025
|
||||
+#define IDC_CLEAR_HTTP_AUTH_CACHE 40026
|
||||
#define IDC_SHOW_KEYBOARD_OVERLAY 40027
|
||||
#define IDC_PROFILING_ENABLED 40028
|
||||
#define IDC_BOOKMARKS_MENU 40029
|
||||
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -1053,6 +1053,9 @@ are declared in build/common.gypi.
|
||||
<message name="IDS_CLEAR_BROWSING_DATA" desc="The text label for the menu item for clearing of browsing data">
|
||||
&Clear browsing data...
|
||||
</message>
|
||||
+ <message name="IDS_CLEAR_HTTP_AUTH_CACHE" desc="The text label for the menu item for clearing the HTTP authentication cache">
|
||||
+ Clear &HTTP auth cache
|
||||
+ </message>
|
||||
<message name="IDS_SHOW_DOWNLOADS" desc="The show downloads menu in the app menu">
|
||||
&Downloads
|
||||
</message>
|
||||
@@ -1091,6 +1094,9 @@ are declared in build/common.gypi.
|
||||
<message name="IDS_CLEAR_BROWSING_DATA" desc="In Title Case: The text label for the menu item for clearing of browsing data">
|
||||
&Clear Browsing Data...
|
||||
</message>
|
||||
+ <message name="IDS_CLEAR_HTTP_AUTH_CACHE" desc="In Title Case: The text label for the menu item for clearing the HTTP authentication cache">
|
||||
+ Clear &HTTP Auth Cache
|
||||
+ </message>
|
||||
<message name="IDS_SHOW_DOWNLOADS" desc="In Title Case: The show downloads menu in the app menu">
|
||||
&Downloads
|
||||
</message>
|
||||
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -60,6 +60,9 @@
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "ui/events/keycodes/keyboard_codes.h"
|
||||
+#include "net/url_request/url_request_context.h"
|
||||
+#include "net/url_request/url_request_context_getter.h"
|
||||
+#include "net/http/http_transaction_factory.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "chrome/browser/ui/browser_commands_mac.h"
|
||||
@@ -629,6 +632,9 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
|
||||
case IDC_CLEAR_BROWSING_DATA:
|
||||
ShowClearBrowsingDataDialog(browser_);
|
||||
break;
|
||||
+ case IDC_CLEAR_HTTP_AUTH_CACHE:
|
||||
+ profile()->GetRequestContext()->GetURLRequestContext()->http_transaction_factory()->GetSession()->http_auth_cache()->Clear();
|
||||
+ break;
|
||||
case IDC_IMPORT_SETTINGS:
|
||||
ShowImportDialog(browser_);
|
||||
break;
|
||||
@@ -871,6 +877,7 @@ void BrowserCommandController::InitCommandState() {
|
||||
!profile()->IsOffTheRecord());
|
||||
command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA,
|
||||
!guest_session);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_CLEAR_HTTP_AUTH_CACHE, true);
|
||||
#if defined(OS_CHROMEOS)
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true);
|
||||
#else
|
||||
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -215,6 +215,7 @@ void ToolsMenuModel::Build(Browser* browser) {
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA);
|
||||
+ AddItemWithStringId(IDC_CLEAR_HTTP_AUTH_CACHE, IDS_CLEAR_HTTP_AUTH_CACHE);
|
||||
AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS);
|
||||
if (chrome::CanOpenTaskManager())
|
||||
AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
|
||||
@@ -475,6 +476,13 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
|
||||
}
|
||||
LogMenuAction(MENU_ACTION_CLEAR_BROWSING_DATA);
|
||||
break;
|
||||
+ case IDC_CLEAR_HTTP_AUTH_CACHE:
|
||||
+ if (!uma_action_recorded_) {
|
||||
+ UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ClearHttpAuthCache",
|
||||
+ delta);
|
||||
+ }
|
||||
+ LogMenuAction(MENU_ACTION_CLEAR_HTTP_AUTH_CACHE);
|
||||
+ break;
|
||||
case IDC_VIEW_SOURCE:
|
||||
if (!uma_action_recorded_)
|
||||
UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ViewSource", delta);
|
||||
diff --git a/chrome/browser/ui/toolbar/app_menu_model.h b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -76,6 +76,7 @@ enum AppMenuAction {
|
||||
MENU_ACTION_OPEN_IN_CHROME = 48,
|
||||
MENU_ACTION_SITE_SETTINGS = 49,
|
||||
MENU_ACTION_APP_INFO = 50,
|
||||
+ MENU_ACTION_CLEAR_HTTP_AUTH_CACHE = 51,
|
||||
LIMIT_MENU_ACTION
|
||||
};
|
||||
|
||||
diff --git a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
--- a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
+++ b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
|
||||
@@ -225,6 +225,7 @@ GlobalMenuBarCommand tools_menu[] = {
|
||||
|
||||
{IDS_TASK_MANAGER, IDC_TASK_MANAGER},
|
||||
{IDS_CLEAR_BROWSING_DATA, IDC_CLEAR_BROWSING_DATA},
|
||||
+ {IDS_CLEAR_HTTP_AUTH_CACHE, IDC_CLEAR_HTTP_AUTH_CACHE},
|
||||
|
||||
{MENU_SEPARATOR, MENU_SEPARATOR},
|
||||
|
||||
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc
|
||||
--- a/net/http/http_auth_cache.cc
|
||||
+++ b/net/http/http_auth_cache.cc
|
||||
@@ -250,6 +250,10 @@ bool HttpAuthCache::Remove(const GURL& origin,
|
||||
return false;
|
||||
}
|
||||
|
||||
+void HttpAuthCache::Clear() {
|
||||
+ entries_.clear();
|
||||
+}
|
||||
+
|
||||
void HttpAuthCache::ClearEntriesAddedWithin(base::TimeDelta duration) {
|
||||
base::TimeTicks begin_time = base::TimeTicks::Now() - duration;
|
||||
base::EraseIf(entries_, [begin_time](const Entry& entry) {
|
||||
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
|
||||
--- a/net/http/http_auth_cache.h
|
||||
+++ b/net/http/http_auth_cache.h
|
||||
@@ -166,6 +166,8 @@ class NET_EXPORT HttpAuthCache {
|
||||
HttpAuth::Scheme scheme,
|
||||
const AuthCredentials& credentials);
|
||||
|
||||
+ void Clear();
|
||||
+
|
||||
// Clears cache entries created within |duration| of base::TimeTicks::Now().
|
||||
void ClearEntriesAddedWithin(base::TimeDelta duration);
|
||||
|
||||
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
|
||||
--- a/tools/metrics/histograms/enums.xml
|
||||
+++ b/tools/metrics/histograms/enums.xml
|
||||
@@ -48315,6 +48315,7 @@ Full version information for the fingerprint enum values:
|
||||
<int value="48" label="Open in Chrome"/>
|
||||
<int value="49" label="Site Settings"/>
|
||||
<int value="50" label="App Info"/>
|
||||
+ <int value="51" label="Clear HTTP auth cache"/>
|
||||
</enum>
|
||||
|
||||
<enum name="XFrameOptions">
|
||||
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
|
||||
--- a/tools/metrics/histograms/histograms.xml
|
||||
+++ b/tools/metrics/histograms/histograms.xml
|
||||
@@ -107956,6 +107956,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
|
||||
<suffix name="Overestimate"
|
||||
label="Tracks when the compositor's estimates were too high and by how
|
||||
much."/>
|
||||
+ <suffix name="ClearHttpAuthCache" label="Clear HTTP authentication cache"/>
|
||||
<suffix name="Underestimate"
|
||||
label="Tracks when the compositor's estimates were too low and by how
|
||||
much."/>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Feb 2018 22:15:25 +0100
|
||||
Subject: Play videos in background
|
||||
|
||||
Break Page Visibility API and Fullscreen API for youtube.com and vimeo.com
|
||||
Original Javascript code by timdream
|
||||
---
|
||||
third_party/blink/renderer/core/dom/BUILD.gn | 1 +
|
||||
third_party/blink/renderer/core/dom/document.cc | 17 +++++++++++++----
|
||||
.../blink/renderer/core/dom/extensions/video_bg_play.h | 6 ++++++
|
||||
3 files changed, 20 insertions(+), 4 deletions(-)
|
||||
create mode 100644 third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/BUILD.gn b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
--- a/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/core/dom/BUILD.gn
|
||||
@@ -148,6 +148,7 @@ blink_core_sources("dom") {
|
||||
"events/window_event_context.cc",
|
||||
"events/window_event_context.h",
|
||||
"extensions/dont-track-me.h",
|
||||
+ "extensions/video-bg-play.h",
|
||||
"exception_code.h",
|
||||
"first_letter_pseudo_element.cc",
|
||||
"first_letter_pseudo_element.h",
|
||||
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
|
||||
@@ -221,6 +221,7 @@
|
||||
#include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h"
|
||||
#include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"
|
||||
#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
|
||||
+#include "extensions/video_bg_play.h"
|
||||
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
|
||||
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
|
||||
#include "third_party/blink/renderer/core/policy/document_policy.h"
|
||||
@@ -5848,17 +5849,25 @@ void Document::FinishedParsing() {
|
||||
|
||||
// determine whether this is a Google search results page
|
||||
const SecurityOrigin *origin = GetSecurityOrigin();
|
||||
- if (origin) {
|
||||
+ auto* bodyElement = body();
|
||||
+ if (origin && bodyElement) {
|
||||
WTF::String domain = origin->Domain();
|
||||
size_t pos = domain.Find(".google.");
|
||||
- auto* bodyElement = body();
|
||||
- if (bodyElement && (pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
+ if ((pos != WTF::kNotFound) && (domain.length() - pos - 8 < 4)) {
|
||||
LOG(INFO) << "injecting anti-AMP-cure Javascript payload";
|
||||
HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
e->setText(ANTI_AMP_CURE_JS);
|
||||
bodyElement->AppendChild(e);
|
||||
}
|
||||
- }
|
||||
+
|
||||
+ // check for eligibility of the video bg fix
|
||||
+ if ((WTF::kNotFound != domain.Find("youtube.com")) || (WTF::kNotFound != domain.Find("vimeo.com"))) {
|
||||
+ LOG(INFO) << "injecting video-bg-play Javascript payload";
|
||||
+ HTMLScriptElement* e = HTMLScriptElement::Create(*this, CreateElementFlags());
|
||||
+ e->setText(VIDEO_BG_PLAY_JS);
|
||||
+ bodyElement->AppendChild(e);
|
||||
+ }
|
||||
+ } // has origin and body element
|
||||
}
|
||||
|
||||
void Document::ElementDataCacheClearTimerFired(TimerBase*) {
|
||||
diff --git a/third_party/blink/renderer/core/dom/extensions/video_bg_play.h b/third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/dom/extensions/video_bg_play.h
|
||||
@@ -0,0 +1,6 @@
|
||||
+#ifndef video_bg_play_h
|
||||
+#define video_bg_play_h
|
||||
+
|
||||
+#define VIDEO_BG_PLAY_JS "'use strict';\n\n/* video background play fix - original version by timdream */\ndocument.videoBGFix = {};\n\n// Page Visibility API\nObject.defineProperties(document.videoBGFix,\n { 'hidden': {value: false}, 'visibilityState': {value: 'visible'} });\n\nwindow.addEventListener(\n 'visibilitychange', evt => evt.stopImmediatePropagation(), true);\nwindow.addEventListener(\n 'blur', evt => evt.stopImmediatePropagation(), true);\n\n// Fullscreen API\nwindow.addEventListener('fullscreenchange', evt => {\n Object.defineProperties(document.videoBGFix,\n { 'fullscreenEnabled': {value: true},\n 'fullscreen': {value: true},\n 'fullscreenElement': {value: document.fullscreenElement.videoBGFix}});\n window.addEventListener(\n 'fullscreenchange', evt => evt.stopImmediatePropagation(), true);\n}, { capture: true, once: true });\n"
|
||||
+
|
||||
+#endif // video_bg_play_h
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 2 Nov 2017 18:21:16 +0200
|
||||
Subject: Allow playing audio in background
|
||||
|
||||
---
|
||||
media/blink/webmediaplayer_impl.cc | 11 ++++++++++-
|
||||
media/blink/webmediaplayer_impl.h | 2 ++
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
|
||||
--- a/media/blink/webmediaplayer_impl.cc
|
||||
+++ b/media/blink/webmediaplayer_impl.cc
|
||||
@@ -853,6 +853,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());
|
||||
@@ -2877,7 +2883,10 @@ bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
|
||||
// If suspending background video, pause any video that's not remoted or
|
||||
// not unlocked to play in the background.
|
||||
if (IsBackgroundedSuspendEnabled()) {
|
||||
- if (!HasVideo())
|
||||
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
|
||||
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
|
||||
+ //streams be played in background.
|
||||
+ if (!HasVideoNonEmptySize())
|
||||
return false;
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
|
||||
--- a/media/blink/webmediaplayer_impl.h
|
||||
+++ b/media/blink/webmediaplayer_impl.h
|
||||
@@ -155,6 +155,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.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 11 Jan 2018 13:27:34 +0200
|
||||
Subject: Open YouTube links in Bromite
|
||||
|
||||
---
|
||||
.../chrome/browser/externalnav/ExternalNavigationHandler.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
|
||||
@@ -357,6 +357,13 @@ public class ExternalNavigationHandler {
|
||||
return OverrideUrlLoadingResult.NO_OVERRIDE;
|
||||
}
|
||||
|
||||
+ // Force to open YouTube urls in Bromite
|
||||
+ String intentPackageName = intent.getPackage();
|
||||
+ if (intentPackageName != null && intentPackageName.equals("com.google.android.youtube")) {
|
||||
+ if (DEBUG) Log.i(TAG, "NO_OVERRIDE: YouTube URL for YouTube app");
|
||||
+ return OverrideUrlLoadingResult.NO_OVERRIDE;
|
||||
+ }
|
||||
+
|
||||
// Sanitize the Intent, ensuring web pages can not bypass browser
|
||||
// security (only access to BROWSABLE activities).
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
From: NoChromo <nochromo@nochromo.com>
|
||||
Date: Sun, 3 Apr 2016 12:44:50 +0800
|
||||
Subject: url_request: hooks and ad url data
|
||||
|
||||
---
|
||||
net/BUILD.gn | 2 +
|
||||
net/url_request/nochromo_intercept.cc | 116 ++++++++++++++++++++++++++++++++++
|
||||
net/url_request/nochromo_intercept.h | 13 ++++
|
||||
net/url_request/url_request.cc | 4 ++
|
||||
4 files changed, 135 insertions(+)
|
||||
create mode 100644 net/url_request/nochromo_intercept.cc
|
||||
create mode 100644 net/url_request/nochromo_intercept.h
|
||||
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1756,6 +1756,8 @@ component("net") {
|
||||
"url_request/url_fetcher_response_writer.h",
|
||||
"url_request/url_range_request_job.cc",
|
||||
"url_request/url_range_request_job.h",
|
||||
+ "url_request/nochromo_intercept.cc",
|
||||
+ "url_request/nochromo_intercept.h",
|
||||
"url_request/url_request.cc",
|
||||
"url_request/url_request.h",
|
||||
"url_request/url_request_context.cc",
|
||||
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/nochromo_intercept.cc
|
||||
@@ -0,0 +1,116 @@
|
||||
+#include "url/gurl.h"
|
||||
+#include "net/url_request/nochromo_entries.h"
|
||||
+
|
||||
+#include <android/log.h>
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+#define NOCHROMO_LOG 0
|
||||
+#define NOCHROMO_LOG_MORE 0
|
||||
+
|
||||
+static char* strtolower(const char* str) {
|
||||
+ int len = strlen(str);
|
||||
+ char* ret = (char*)malloc(len + 1);
|
||||
+ ret[len] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static char* strtosep(const char* str) {
|
||||
+ int len = strlen(str);
|
||||
+ char* ret = (char*)malloc(len + 3);
|
||||
+ ret[0] = '^';
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
|
||||
+ ret[i + 1] = '^';
|
||||
+ } else {
|
||||
+ ret[i + 1] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int nochromo_intercept(const GURL& url) {
|
||||
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ const char* c_url = url.spec().c_str();
|
||||
+ char* c_url_lower = strtolower(c_url);
|
||||
+ char* c_url_sep = strtosep(c_url);
|
||||
+ char* c_url_lower_sep = strtosep(c_url_lower);
|
||||
+
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
|
||||
+
|
||||
+ bool intercept = false;
|
||||
+ for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
|
||||
+ nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
|
||||
+
|
||||
+ // no use checking rules when we're intercepting, or exceptions when not
|
||||
+ bool check =
|
||||
+ (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
|
||||
+ (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
|
||||
+
|
||||
+ if (check) {
|
||||
+ bool match = false;
|
||||
+
|
||||
+ // select comparison string based on case and separator presence (separator takes some shortcuts)
|
||||
+ bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
|
||||
+ bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
|
||||
+ const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
+
|
||||
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
|
||||
+
|
||||
+ // check for all match parts at >= position of last match
|
||||
+ const char* last = match_url;
|
||||
+ for (int m = 0; m < entry->matchcount; m++) {
|
||||
+ const char* pos = strstr(last, entry->matches[m]);
|
||||
+ match = (pos != NULL);
|
||||
+
|
||||
+ if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
+
|
||||
+ // check if the url starts with the first match part
|
||||
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
|
||||
+
|
||||
+ // check if the url ends with the last match part
|
||||
+ if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
|
||||
+
|
||||
+ // check domain match
|
||||
+ if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
|
||||
+
|
||||
+ // short circuit
|
||||
+ if (!match) break;
|
||||
+ }
|
||||
+
|
||||
+ if (match) {
|
||||
+ if (NOCHROMO_LOG) {
|
||||
+ if (!intercept) {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
|
||||
+ } else {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
|
||||
+ }
|
||||
+ }
|
||||
+ intercept = !intercept;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ free(c_url_sep);
|
||||
+ free(c_url_lower);
|
||||
+ free(c_url_lower_sep);
|
||||
+
|
||||
+ if (intercept) {
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
\ No newline at end of file
|
||||
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/nochromo_intercept.h
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
+
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+GURL nochromo_intercepted = GURL("http://127.0.0.1/");
|
||||
+int nochromo_intercept(const GURL& url);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
||||
--- a/net/url_request/url_request.cc
|
||||
+++ b/net/url_request/url_request.cc
|
||||
@@ -44,6 +44,8 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
+#include "net/url_request/nochromo_intercept.h"
|
||||
+
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
#include "net/network_error_logging/network_error_logging_service.h"
|
||||
#include "net/reporting/reporting_service.h"
|
||||
@@ -583,6 +585,8 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
+ if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
|
||||
+
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(
|
||||
NetLogEventType::REQUEST_ALIVE,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,584 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 28 Mar 2018 15:55:11 +0200
|
||||
Subject: Bromite adblock engine
|
||||
|
||||
Ported from NoChromo patch
|
||||
Make interception testable
|
||||
Add domain support
|
||||
Re-land: third-party filters support
|
||||
---
|
||||
net/BUILD.gn | 9 +-
|
||||
net/url_request/adblock_intercept.cc | 324 ++++++++++++++++++++++++++++++++++
|
||||
net/url_request/adblock_intercept.h | 16 ++
|
||||
net/url_request/nochromo_intercept.cc | 116 ------------
|
||||
net/url_request/nochromo_intercept.h | 13 --
|
||||
net/url_request/url_request.cc | 19 +-
|
||||
6 files changed, 364 insertions(+), 133 deletions(-)
|
||||
create mode 100644 net/url_request/adblock_intercept.cc
|
||||
create mode 100644 net/url_request/adblock_intercept.h
|
||||
delete mode 100644 net/url_request/nochromo_intercept.cc
|
||||
delete mode 100644 net/url_request/nochromo_intercept.h
|
||||
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1756,8 +1756,6 @@ component("net") {
|
||||
"url_request/url_fetcher_response_writer.h",
|
||||
"url_request/url_range_request_job.cc",
|
||||
"url_request/url_range_request_job.h",
|
||||
- "url_request/nochromo_intercept.cc",
|
||||
- "url_request/nochromo_intercept.h",
|
||||
"url_request/url_request.cc",
|
||||
"url_request/url_request.h",
|
||||
"url_request/url_request_context.cc",
|
||||
@@ -1815,6 +1813,13 @@ component("net") {
|
||||
"//third_party/zlib",
|
||||
]
|
||||
|
||||
+ if (is_android) {
|
||||
+ sources += [
|
||||
+ "url_request/adblock_intercept.cc",
|
||||
+ "url_request/adblock_intercept.h"
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
if (enable_reporting) {
|
||||
sources += [
|
||||
"network_error_logging/network_error_logging_delegate.cc",
|
||||
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.cc
|
||||
@@ -0,0 +1,324 @@
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+#include <cstddef>
|
||||
+#include <cstdlib>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include "log.h"
|
||||
+#include <tld.h>
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
+#include <android/log.h>
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#include "net/url_request/adblock_entries.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+const char *LOG_TAG = "Bromite";
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count() { return ADBLOCK_ENTRY_COUNT; }
|
||||
+#endif
|
||||
+
|
||||
+// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
|
||||
+// with a valid TLD. If |subdomain_permission| is ALLOW_SUBDOMAIN, we check
|
||||
+// against host "*.<domain_in_lower_case>.<TLD>" instead. Will return the TLD
|
||||
+// string in |tld|, if specified and the |host| can be parsed.
|
||||
+static bool is_first_party(char *l_host, char *l_url_host) {
|
||||
+ size_t tld_length;
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+ char *found_tld;
|
||||
+
|
||||
+ if (TLD_SUCCESS != tld_get_z(l_host, &found_tld))
|
||||
+ return false;
|
||||
+ tld_length = strlen(found_tld);
|
||||
+ if (tld_length == 0)
|
||||
+ return false;
|
||||
+#else
|
||||
+ tld_length = net::registry_controlled_domains::GetCanonicalHostRegistryLength(
|
||||
+ l_host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
||||
+ net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
||||
+ if ((tld_length == 0) || (tld_length == std::string::npos))
|
||||
+ return false;
|
||||
+#endif
|
||||
+
|
||||
+ int len = strlen(l_host);
|
||||
+ char *tld = l_host + len - tld_length;
|
||||
+
|
||||
+ // Removes any subdomain from origin host.
|
||||
+ int i = len - tld_length - 2, top_i = i;
|
||||
+ if (i < 0) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ char *domain = l_host;
|
||||
+ for (; i >= 0; i--) {
|
||||
+ if (l_host[i] == '.') {
|
||||
+ int p_len = top_i - i;
|
||||
+ // skip "co" in "co.uk", "org" in "org.uk"
|
||||
+ if (p_len <= 3) {
|
||||
+ tld -= p_len + 1;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // segment is long enough, accept it at as a domain
|
||||
+ domain = l_host + i;
|
||||
+ len -= i;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "%s: extracted domain suffix: \"%s\" (TLD=\"%s\")",
|
||||
+ l_host, domain, tld);
|
||||
+#endif
|
||||
+
|
||||
+ // Check if supplied URL host matches, including the dot.
|
||||
+ int b_len = strlen(l_url_host);
|
||||
+ if (b_len < len) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if (l_url_host[b_len - 1 - i] != domain[len - 1 - i])
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // pass with flying colors
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static char *strtolower(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 1);
|
||||
+ ret[len] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
+ ret[i] = str[i] + 32;
|
||||
+ } else {
|
||||
+ ret[i] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static char *strtosep(const char *str) {
|
||||
+ int len = strlen(str);
|
||||
+ char *ret = (char *)malloc(len + 3);
|
||||
+ ret[0] = '^';
|
||||
+ ret[len + 1] = '^';
|
||||
+ ret[len + 2] = '\0';
|
||||
+ for (int i = 0; i < len; i++) {
|
||||
+ if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') ||
|
||||
+ (str[i] == '&') || (str[i] == '=')) {
|
||||
+ ret[i + 1] = '^';
|
||||
+ } else {
|
||||
+ ret[i + 1] = str[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static bool url_matches(const char *c_url, char *c_url_sep, char *c_url_lower,
|
||||
+ char *c_url_lower_sep, adblock_entry *entry) {
|
||||
+ bool match = false;
|
||||
+ // select comparison string based on case and separator presence (separator
|
||||
+ // takes some shortcuts)
|
||||
+ bool match_case = ((entry->flags & ADBLOCK_FLAG_MATCH_CASE) != 0);
|
||||
+ bool match_separator = ((entry->flags & ADBLOCK_FLAG_HAS_SEPARATOR) != 0);
|
||||
+ const char *match_url =
|
||||
+ match_case ? (match_separator ? c_url_sep : c_url)
|
||||
+ : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[case:%d][sep:%d][%s]",
|
||||
+ match_case, match_separator, match_url);
|
||||
+#endif
|
||||
+ // check for all match parts at >= position of last match
|
||||
+ const char *last = match_url;
|
||||
+ for (int m = 0; const char *url_match = entry->matches[m]; m++) {
|
||||
+ bool is_last_match = entry->matches[m + 1] == NULL;
|
||||
+ const char *pos = strstr(last, url_match);
|
||||
+ match = (pos != NULL);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG_MORE
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s][found:%d][match:%d]",
|
||||
+ entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
+#endif
|
||||
+ // check if the url starts with the first match part
|
||||
+ if (match && (m == 0) && ((entry->flags & ADBLOCK_FLAG_MATCH_BEGIN) != 0) &&
|
||||
+ (pos != match_url))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check if the url ends with the last match part
|
||||
+ if (match && is_last_match &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_END) != 0) &&
|
||||
+ (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])]))
|
||||
+ match = false;
|
||||
+
|
||||
+ // check domain match
|
||||
+ if (match && (m == 0) &&
|
||||
+ ((entry->flags & ADBLOCK_FLAG_MATCH_DOMAIN) != 0) &&
|
||||
+ (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') &&
|
||||
+ (pos[-1] != '/'))
|
||||
+ match = false;
|
||||
+
|
||||
+ // short circuit
|
||||
+ if (!match)
|
||||
+ break;
|
||||
+ }
|
||||
+ return match;
|
||||
+}
|
||||
+
|
||||
+bool url_match_domain(adblock_entry *entry, const std::string &origin_host) {
|
||||
+ bool match_domain = true;
|
||||
+ // check for a negative domain match
|
||||
+ if (entry->domains_neg) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains_neg[d]; d++) {
|
||||
+ if (domain == origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // check for a required positive domain match
|
||||
+ if (entry->domains) {
|
||||
+ if (origin_host.empty()) {
|
||||
+ // skip this rule, cannot match on domain
|
||||
+ return false;
|
||||
+ }
|
||||
+ for (int d = 0; const char *domain = entry->domains[d]; d++) {
|
||||
+ if (domain != origin_host) {
|
||||
+ match_domain = false;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return match_domain;
|
||||
+}
|
||||
+
|
||||
+static bool url_match_party(adblock_entry *entry, const GURL &url,
|
||||
+ const std::string &origin_host, bool &checked_fp,
|
||||
+ bool &fp) {
|
||||
+ bool wanted_fp;
|
||||
+ if ((entry->flags & ADBLOCK_FLAG_THIRD_PARTY) != 0) {
|
||||
+ wanted_fp = false;
|
||||
+ } else if ((entry->flags & ADBLOCK_FLAG_FIRST_PARTY) != 0) {
|
||||
+ wanted_fp = true;
|
||||
+ } else {
|
||||
+ // no-op
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (origin_host.empty()) {
|
||||
+ // cannot match this rule, no origin host to determine first/third party
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+//__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "matchFirst=%d matchThird=%d",
|
||||
+// matchFirstParty, matchThirdParty);
|
||||
+#endif
|
||||
+ if (!checked_fp) {
|
||||
+ // lower-case version
|
||||
+ char *l_host = strtolower(origin_host.c_str()),
|
||||
+ *l_url_host = strtolower(url.host().c_str());
|
||||
+
|
||||
+ // is the URL a first-party to the current page's host?
|
||||
+ fp = is_first_party(l_host, l_url_host);
|
||||
+
|
||||
+ checked_fp = true;
|
||||
+#ifdef ADB_TESTER
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "is_first_party(\"%s\", \"%s\") = %s", l_host,
|
||||
+ l_url_host, fp ? "true" : "false");
|
||||
+#endif
|
||||
+ free(l_host);
|
||||
+ free(l_url_host);
|
||||
+ }
|
||||
+
|
||||
+ return fp == wanted_fp;
|
||||
+}
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host) {
|
||||
+ // if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ // return 0;
|
||||
+ // }
|
||||
+
|
||||
+ if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ const char *c_url = url.spec().c_str();
|
||||
+ char *c_url_lower = strtolower(c_url);
|
||||
+ char *c_url_sep = strtosep(c_url);
|
||||
+ char *c_url_lower_sep = strtosep(c_url_lower);
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "[%s with host '%s'] [%s]",
|
||||
+ c_url, url.host().c_str(), origin_host.c_str());
|
||||
+#endif
|
||||
+
|
||||
+ bool checked_fp = false, fp = false;
|
||||
+
|
||||
+ bool intercept = false;
|
||||
+ for (int i = 0; i < ADBLOCK_ENTRY_COUNT; i++) {
|
||||
+ adblock_entry *entry = &ADBLOCK_ENTRIES[i];
|
||||
+
|
||||
+ // no use checking rules when we're intercepting, or exceptions when not
|
||||
+ bool check =
|
||||
+ (!intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) == 0)) ||
|
||||
+ (intercept && ((entry->flags & ADBLOCK_FLAG_EXCEPTION) != 0));
|
||||
+ if (!check)
|
||||
+ continue;
|
||||
+
|
||||
+ // first check for domain matches, a quick branch out if matching
|
||||
+ if (!url_match_domain(entry, origin_host))
|
||||
+ continue;
|
||||
+
|
||||
+ // check on the URL matcher
|
||||
+ if (!url_matches(c_url, c_url_sep, c_url_lower, c_url_lower_sep, entry))
|
||||
+ continue;
|
||||
+
|
||||
+ // finally check first/third-party
|
||||
+ if (!url_match_party(entry, url, origin_host, checked_fp, fp))
|
||||
+ continue;
|
||||
+
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ if (!intercept) {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
|
||||
+ "--> intercept (#%d: \"%s\") (%x)", i,
|
||||
+ entry->matches[0], entry->flags);
|
||||
+ } else {
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "--> pass (%d) (#%d)", i,
|
||||
+ entry->flags);
|
||||
+ }
|
||||
+#endif
|
||||
+ intercept = !intercept;
|
||||
+ } // for each entry
|
||||
+
|
||||
+ free(c_url_sep);
|
||||
+ free(c_url_lower);
|
||||
+ free(c_url_lower_sep);
|
||||
+
|
||||
+ if (intercept) {
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "blocked");
|
||||
+#endif
|
||||
+ return 1;
|
||||
+ }
|
||||
+#ifdef ADBLOCK_LOG
|
||||
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "pass");
|
||||
+#endif
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+} // namespace net
|
||||
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/net/url_request/adblock_intercept.h
|
||||
@@ -0,0 +1,16 @@
|
||||
+#ifndef NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+#define NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
+
|
||||
+#include "url/gurl.h"
|
||||
+
|
||||
+namespace net {
|
||||
+
|
||||
+#ifdef ADB_TESTER
|
||||
+int adblock_rules_count();
|
||||
+#endif
|
||||
+
|
||||
+int adblock_intercept(const GURL &url, const std::string &origin_host);
|
||||
+
|
||||
+} // namespace net
|
||||
+
|
||||
+#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
diff --git a/net/url_request/nochromo_intercept.cc b/net/url_request/nochromo_intercept.cc
|
||||
deleted file mode 100644
|
||||
--- a/net/url_request/nochromo_intercept.cc
|
||||
+++ /dev/null
|
||||
@@ -1,116 +0,0 @@
|
||||
-#include "url/gurl.h"
|
||||
-#include "net/url_request/nochromo_entries.h"
|
||||
-
|
||||
-#include <android/log.h>
|
||||
-
|
||||
-namespace net {
|
||||
-
|
||||
-#define NOCHROMO_LOG 0
|
||||
-#define NOCHROMO_LOG_MORE 0
|
||||
-
|
||||
-static char* strtolower(const char* str) {
|
||||
- int len = strlen(str);
|
||||
- char* ret = (char*)malloc(len + 1);
|
||||
- ret[len] = '\0';
|
||||
- for (int i = 0; i < len; i++) {
|
||||
- if ((65 <= str[i]) && (str[i] <= 90)) {
|
||||
- ret[i] = str[i] + 32;
|
||||
- } else {
|
||||
- ret[i] = str[i];
|
||||
- }
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static char* strtosep(const char* str) {
|
||||
- int len = strlen(str);
|
||||
- char* ret = (char*)malloc(len + 3);
|
||||
- ret[0] = '^';
|
||||
- ret[len + 1] = '^';
|
||||
- ret[len + 2] = '\0';
|
||||
- for (int i = 0; i < len; i++) {
|
||||
- if ((str[i] == ':') || (str[i] == '/') || (str[i] == '?') || (str[i] == '&') || (str[i] == '=')) {
|
||||
- ret[i + 1] = '^';
|
||||
- } else {
|
||||
- ret[i + 1] = str[i];
|
||||
- }
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-int nochromo_intercept(const GURL& url) {
|
||||
- if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
|
||||
- const char* c_url = url.spec().c_str();
|
||||
- char* c_url_lower = strtolower(c_url);
|
||||
- char* c_url_sep = strtosep(c_url);
|
||||
- char* c_url_lower_sep = strtosep(c_url_lower);
|
||||
-
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s]", c_url);
|
||||
-
|
||||
- bool intercept = false;
|
||||
- for (int i = 0; i < NOCHROMO_ENTRY_COUNT; i++) {
|
||||
- nochromo_entry* entry = &NOCHROMO_ENTRIES[i];
|
||||
-
|
||||
- // no use checking rules when we're intercepting, or exceptions when not
|
||||
- bool check =
|
||||
- (!intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) == 0)) ||
|
||||
- (intercept && ((entry->flags & NOCHROMO_FLAG_EXCEPTION) != 0));
|
||||
-
|
||||
- if (check) {
|
||||
- bool match = false;
|
||||
-
|
||||
- // select comparison string based on case and separator presence (separator takes some shortcuts)
|
||||
- bool match_case = ((entry->flags & NOCHROMO_FLAG_MATCH_CASE) != 0);
|
||||
- bool match_separator = ((entry->flags & NOCHROMO_FLAG_HAS_SEPARATOR) != 0);
|
||||
- const char* match_url = match_case ? (match_separator ? c_url_sep : c_url) : (match_separator ? c_url_lower_sep : c_url_lower);
|
||||
-
|
||||
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[case:%d][sep:%d][%s]", match_case, match_separator, match_url);
|
||||
-
|
||||
- // check for all match parts at >= position of last match
|
||||
- const char* last = match_url;
|
||||
- for (int m = 0; m < entry->matchcount; m++) {
|
||||
- const char* pos = strstr(last, entry->matches[m]);
|
||||
- match = (pos != NULL);
|
||||
-
|
||||
- if (NOCHROMO_LOG || NOCHROMO_LOG_MORE) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "[%s][found:%d][match:%d]", entry->matches[m], pos == NULL ? 0 : 1, match ? 1 : 0);
|
||||
-
|
||||
- // check if the url starts with the first match part
|
||||
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_BEGIN) != 0) && (pos != match_url)) match = false;
|
||||
-
|
||||
- // check if the url ends with the last match part
|
||||
- if (match && (m == entry->matchcount - 1) && ((entry->flags & NOCHROMO_FLAG_MATCH_END) != 0) && (pos != &match_url[strlen(match_url) - strlen(entry->matches[m])])) match = false;
|
||||
-
|
||||
- // check domain match
|
||||
- if (match && (m == 0) && ((entry->flags & NOCHROMO_FLAG_MATCH_DOMAIN) != 0) && (pos != match_url) && (pos[-1] != '^') && (pos[-1] != '.') && (pos[-1] != '/')) match = false;
|
||||
-
|
||||
- // short circuit
|
||||
- if (!match) break;
|
||||
- }
|
||||
-
|
||||
- if (match) {
|
||||
- if (NOCHROMO_LOG) {
|
||||
- if (!intercept) {
|
||||
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> intercept (%d) (%d)", i, entry->flags);
|
||||
- } else {
|
||||
- __android_log_print(ANDROID_LOG_INFO, "NoChromo", "--> pass (%d) (%d)", i, entry->flags);
|
||||
- }
|
||||
- }
|
||||
- intercept = !intercept;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- free(c_url_sep);
|
||||
- free(c_url_lower);
|
||||
- free(c_url_lower_sep);
|
||||
-
|
||||
- if (intercept) {
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "intercepted!");
|
||||
- return 1;
|
||||
- }
|
||||
- if (NOCHROMO_LOG) __android_log_print(ANDROID_LOG_INFO, "NoChromo", "pass!");
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-} // namespace net
|
||||
\ No newline at end of file
|
||||
diff --git a/net/url_request/nochromo_intercept.h b/net/url_request/nochromo_intercept.h
|
||||
deleted file mode 100644
|
||||
--- a/net/url_request/nochromo_intercept.h
|
||||
+++ /dev/null
|
||||
@@ -1,13 +0,0 @@
|
||||
-#ifndef NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
-#define NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
-
|
||||
-#include "url/gurl.h"
|
||||
-
|
||||
-namespace net {
|
||||
-
|
||||
-GURL nochromo_intercepted = GURL("http://127.0.0.1/");
|
||||
-int nochromo_intercept(const GURL& url);
|
||||
-
|
||||
-} // namespace net
|
||||
-
|
||||
-#endif // NET_URL_REQUEST_NOCHROMO_INTERCEPT_H_
|
||||
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
||||
--- a/net/url_request/url_request.cc
|
||||
+++ b/net/url_request/url_request.cc
|
||||
@@ -44,7 +44,9 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
-#include "net/url_request/nochromo_intercept.h"
|
||||
+#if defined(OS_ANDROID)
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
+#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
#include "net/network_error_logging/network_error_logging_service.h"
|
||||
@@ -559,7 +561,9 @@ URLRequest::URLRequest(const GURL& url,
|
||||
: context->network_delegate()),
|
||||
net_log_(NetLogWithSource::Make(context->net_log(),
|
||||
NetLogSourceType::URL_REQUEST)),
|
||||
+#if !defined(OS_ANDROID)
|
||||
url_chain_(1, url),
|
||||
+#endif
|
||||
attach_same_site_cookies_(false),
|
||||
method_("GET"),
|
||||
referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE),
|
||||
@@ -585,7 +589,18 @@ URLRequest::URLRequest(const GURL& url,
|
||||
// Sanity check out environment.
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
- if (nochromo_intercept(url)) url_chain_.push_back(nochromo_intercepted);
|
||||
+#if defined(OS_ANDROID)
|
||||
+ std::string initiatorHost;
|
||||
+ if (initiator_.has_value()) {
|
||||
+ initiatorHost = initiator_.value().host();
|
||||
+ }
|
||||
+
|
||||
+ if (adblock_intercept(url, initiatorHost)) {
|
||||
+ url_chain_ = { url, GURL("http://127.0.0.1") };
|
||||
+ } else {
|
||||
+ url_chain_ = { url };
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
context->url_requests()->insert(this);
|
||||
net_log_.BeginEvent(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 21 Mar 2018 14:15:28 +0100
|
||||
Subject: User Agent: anonymize
|
||||
|
||||
Remove device name and build id
|
||||
---
|
||||
content/common/user_agent.cc | 25 ++-----------------------
|
||||
1 file changed, 2 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
|
||||
--- a/content/common/user_agent.cc
|
||||
+++ b/content/common/user_agent.cc
|
||||
@@ -79,26 +79,6 @@ std::string BuildOSCpuInfo() {
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
std::string android_version_str = base::SysInfo::OperatingSystemVersion();
|
||||
-
|
||||
- std::string android_info_str;
|
||||
-
|
||||
- // Send information about the device.
|
||||
- bool semicolon_inserted = false;
|
||||
- std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename();
|
||||
- std::string android_device_name = base::SysInfo::HardwareModelName();
|
||||
- if ("REL" == android_build_codename && android_device_name.size() > 0) {
|
||||
- android_info_str += "; " + android_device_name;
|
||||
- semicolon_inserted = true;
|
||||
- }
|
||||
-
|
||||
- // Append the build ID.
|
||||
- std::string android_build_id = base::SysInfo::GetAndroidBuildID();
|
||||
- if (android_build_id.size() > 0) {
|
||||
- if (!semicolon_inserted) {
|
||||
- android_info_str += ";";
|
||||
- }
|
||||
- android_info_str += " Build/" + android_build_id;
|
||||
- }
|
||||
#endif
|
||||
|
||||
base::StringAppendF(
|
||||
@@ -121,9 +101,8 @@ std::string BuildOSCpuInfo() {
|
||||
os_minor_version,
|
||||
os_bugfix_version
|
||||
#elif defined(OS_ANDROID)
|
||||
- "Android %s%s",
|
||||
- android_version_str.c_str(),
|
||||
- android_info_str.c_str()
|
||||
+ "Android %s",
|
||||
+ android_version_str.c_str()
|
||||
#else
|
||||
"%s %s",
|
||||
unixinfo.sysname, // e.g. Linux
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 24 Apr 2017 16:11:53 +0200
|
||||
Subject: Disable smooth scrolling on Linux
|
||||
|
||||
Smooth scrolling (while using mousewheel or arrow keys) is a really
|
||||
dumb idea. Text naturally appears as a blur while it moves, and the
|
||||
animation takes that-many milliseconds to finish, so it's a time
|
||||
waster too.
|
||||
|
||||
Only the fallback setting, which is used on Linux, is changed; on
|
||||
Windows/MacOS, smooth scrolling remains controlled by a system
|
||||
setting.
|
||||
---
|
||||
ui/gfx/animation/animation.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ui/gfx/animation/animation.cc b/ui/gfx/animation/animation.cc
|
||||
--- a/ui/gfx/animation/animation.cc
|
||||
+++ b/ui/gfx/animation/animation.cc
|
||||
@@ -111,7 +111,7 @@ bool Animation::ShouldRenderRichAnimationImpl() {
|
||||
// static
|
||||
bool Animation::ScrollAnimationsEnabledBySystem() {
|
||||
// Defined in platform specific files for Windows and OSX.
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -1175,10 +1175,8 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
||||
}
|
||||
|
||||
PluginData* LocalFrame::GetPluginData() const {
|
||||
- if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
|
||||
- return nullptr;
|
||||
- return GetPage()->GetPluginData(
|
||||
- Tree().Top().GetSecurityContext()->GetSecurityOrigin());
|
||||
+ // what about no
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
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 | 2 +-
|
||||
3 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
@@ -42,10 +42,10 @@ interface AnalyserNode : AudioNode {
|
||||
|
||||
// Copies the current frequency data into the passed array.
|
||||
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
|
||||
- void getFloatFrequencyData(Float32Array array);
|
||||
- void getByteFrequencyData(Uint8Array array);
|
||||
+ //void getFloatFrequencyData(Float32Array array);
|
||||
+ //void getByteFrequencyData(Uint8Array array);
|
||||
|
||||
// Real-time waveform data
|
||||
- void getFloatTimeDomainData(Float32Array array);
|
||||
- void getByteTimeDomainData(Uint8Array array);
|
||||
+ //void getFloatTimeDomainData(Float32Array array);
|
||||
+ //void getByteTimeDomainData(Uint8Array array);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
// Channel access
|
||||
readonly attribute unsigned long numberOfChannels;
|
||||
- [RaisesException] Float32Array getChannelData(unsigned long channelIndex);
|
||||
- [RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
+ //[RaisesException] Float32Array getChannelData(unsigned long channelIndex);
|
||||
+ //[RaisesException] void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
[RaisesException] void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
@@ -261,7 +261,7 @@ void AudioContext::StopRendering() {
|
||||
}
|
||||
|
||||
double AudioContext::baseLatency() const {
|
||||
- return FramesPerBuffer() / static_cast<double>(sampleRate());
|
||||
+ return 0.04;
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Fri, 30 Mar 2018 10:09:03 +0200
|
||||
Subject: Add fingerprinting mitigation for getClientRects,
|
||||
getBoundingClientRect
|
||||
|
||||
Scale the result of Range::getClientRects and Element::getBoundingClientRect
|
||||
by a random +/-3% of the original value for each float in the Rect/Quad.
|
||||
The random value is generated once for each Document and re-used for all the
|
||||
attached elements.
|
||||
The rationale is that such value, albeit constant within the rendered Document,
|
||||
is within the same order of magniture of the floating point precision being
|
||||
used for fingerprinting and sufficient to poison the well.
|
||||
|
||||
See also: http://www.gsd.inesc-id.pt/~mpc/pubs/fingerprinting-trustcom2016.pdf
|
||||
---
|
||||
third_party/blink/renderer/core/dom/document.cc | 14 ++++++++++++++
|
||||
third_party/blink/renderer/core/dom/document.h | 5 +++++
|
||||
third_party/blink/renderer/core/dom/element.cc | 7 +++++++
|
||||
third_party/blink/renderer/core/dom/range.cc | 8 +++++++-
|
||||
4 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -279,6 +279,8 @@
|
||||
|
||||
#include "extensions/anti_amp_cure.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+
|
||||
#ifndef NDEBUG
|
||||
using WeakDocumentSet =
|
||||
blink::PersistentHeapHashSet<blink::WeakMember<blink::Document>>;
|
||||
@@ -740,6 +742,10 @@ Document::Document(const DocumentInit& initializer,
|
||||
#ifndef NDEBUG
|
||||
liveDocumentSet().insert(this);
|
||||
#endif
|
||||
+
|
||||
+ // add +/- 3% noise against fingerprinting
|
||||
+ shuffleFactorX_ = 1 + (base::RandDouble() - 0.5) * 0.03;
|
||||
+ shuffleFactorY_ = 1 + (base::RandDouble() - 0.5) * 0.03;
|
||||
}
|
||||
|
||||
Document::~Document() {
|
||||
@@ -766,6 +772,14 @@ Range* Document::CreateRangeAdjustedToTreeScope(const TreeScope& tree_scope,
|
||||
Position::BeforeNode(*shadow_host));
|
||||
}
|
||||
|
||||
+double Document::GetShuffleFactorX() {
|
||||
+ return shuffleFactorX_;
|
||||
+}
|
||||
+
|
||||
+double Document::GetShuffleFactorY() {
|
||||
+ return shuffleFactorY_;
|
||||
+}
|
||||
+
|
||||
SelectorQueryCache& Document::GetSelectorQueryCache() {
|
||||
if (!selector_query_cache_)
|
||||
selector_query_cache_ = std::make_unique<SelectorQueryCache>();
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h
|
||||
--- a/third_party/blink/renderer/core/dom/document.h
|
||||
+++ b/third_party/blink/renderer/core/dom/document.h
|
||||
@@ -408,6 +408,9 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
String origin() const;
|
||||
|
||||
+ double GetShuffleFactorX();
|
||||
+ double GetShuffleFactorY();
|
||||
+
|
||||
String visibilityState() const;
|
||||
mojom::PageVisibilityState GetPageVisibilityState() const;
|
||||
bool hidden() const;
|
||||
@@ -1670,6 +1673,8 @@ class CORE_EXPORT Document : public ContainerNode,
|
||||
|
||||
double start_time_;
|
||||
|
||||
+ double shuffleFactorX_, shuffleFactorY_;
|
||||
+
|
||||
TraceWrapperMember<ScriptRunner> script_runner_;
|
||||
|
||||
HeapVector<Member<ScriptElementBase>> current_script_stack_;
|
||||
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc
|
||||
--- a/third_party/blink/renderer/core/dom/element.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/element.cc
|
||||
@@ -1348,6 +1348,11 @@ DOMRectList* Element::getClientRects() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatQuadsForScrollAndAbsoluteZoom(
|
||||
quads, *element_layout_object);
|
||||
+
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
@@ -1365,6 +1370,8 @@ DOMRect* Element::getBoundingClientRect() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustFloatRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
+ result.Scale(GetDocument().GetShuffleFactorX(), GetDocument().GetShuffleFactorY());
|
||||
+
|
||||
return DOMRect::FromFloatRect(result);
|
||||
}
|
||||
|
||||
diff --git a/third_party/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
|
||||
@@ -1575,11 +1575,17 @@ DOMRectList* Range::getClientRects() const {
|
||||
Vector<FloatQuad> quads;
|
||||
GetBorderAndTextQuads(quads);
|
||||
|
||||
+ for (FloatQuad& quad : quads) {
|
||||
+ quad.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
|
||||
+ }
|
||||
+
|
||||
return DOMRectList::Create(quads);
|
||||
}
|
||||
|
||||
DOMRect* Range::getBoundingClientRect() const {
|
||||
- return DOMRect::FromFloatRect(BoundingRect());
|
||||
+ auto rect = BoundingRect();
|
||||
+ rect.Scale(owner_document_->GetShuffleFactorX(), owner_document_->GetShuffleFactorY());
|
||||
+ return DOMRect::FromFloatRect(rect);
|
||||
}
|
||||
|
||||
// TODO(editing-dev): We should make
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+318
@@ -0,0 +1,318 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 24 Mar 2018 05:18:03 +0100
|
||||
Subject: Canvas: fingerprinting mitigations for image data, font metrics and
|
||||
webGL
|
||||
|
||||
Disable webGL renderer info, add shuffling to TextMetrics.
|
||||
Additionally, the color data returned by ToBlob, ToDataURL and getImageData
|
||||
will contain randomly manipulated pixels (maximum 10) 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.
|
||||
---
|
||||
.../renderer/core/html/canvas/text_metrics.cc | 20 +++
|
||||
.../blink/renderer/core/html/canvas/text_metrics.h | 2 +
|
||||
.../canvas/canvas2d/canvas_rendering_context_2d.cc | 6 +-
|
||||
.../modules/webgl/webgl_debug_renderer_info.cc | 4 +-
|
||||
.../platform/graphics/image_data_buffer.cc | 4 +
|
||||
.../platform/graphics/static_bitmap_image.cc | 151 +++++++++++++++++++++
|
||||
.../platform/graphics/static_bitmap_image.h | 2 +
|
||||
7 files changed, 186 insertions(+), 3 deletions(-)
|
||||
|
||||
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
|
||||
@@ -47,6 +47,26 @@ float TextMetrics::GetFontBaseline(const TextBaseline& text_baseline,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+void TextMetrics::Shuffle(const double amt) {
|
||||
+ double adjusted = 1 + amt;
|
||||
+
|
||||
+ // x-direction
|
||||
+ width_ *= adjusted;
|
||||
+ actual_bounding_box_left_ *= adjusted;
|
||||
+ actual_bounding_box_right_ *= adjusted;
|
||||
+
|
||||
+ // y-direction
|
||||
+ font_bounding_box_ascent_ *= adjusted;
|
||||
+ font_bounding_box_descent_ *= adjusted;
|
||||
+ actual_bounding_box_ascent_ *= adjusted;
|
||||
+ actual_bounding_box_descent_ *= adjusted;
|
||||
+ em_height_ascent_ *= adjusted;
|
||||
+ em_height_descent_ *= adjusted;
|
||||
+ hanging_baseline_ *= adjusted;
|
||||
+ alphabetic_baseline_ *= adjusted;
|
||||
+ ideographic_baseline_ *= adjusted;
|
||||
+}
|
||||
+
|
||||
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
|
||||
@@ -67,6 +67,8 @@ class CORE_EXPORT TextMetrics final : public ScriptWrappable {
|
||||
|
||||
static float GetFontBaseline(const TextBaseline&, const FontMetrics&);
|
||||
|
||||
+ void Shuffle(const double amt);
|
||||
+
|
||||
private:
|
||||
void Update(const Font&,
|
||||
const TextDirection&,
|
||||
diff --git a/third_party/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
|
||||
@@ -773,8 +773,12 @@ TextMetrics* CanvasRenderingContext2D::measureText(const String& text) {
|
||||
else
|
||||
direction = ToTextDirection(GetState().GetDirection(), canvas());
|
||||
|
||||
- return TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
+ TextMetrics* textMetrics = TextMetrics::Create(font, direction, GetState().GetTextBaseline(),
|
||||
GetState().GetTextAlign(), text);
|
||||
+
|
||||
+ textMetrics->Shuffle(canvas()->GetDocument().GetShuffleFactorX());
|
||||
+
|
||||
+ return textMetrics;
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::DrawTextInternal(
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_debug_renderer_info.cc
|
||||
@@ -37,11 +37,11 @@ WebGLExtensionName WebGLDebugRendererInfo::GetName() const {
|
||||
|
||||
WebGLDebugRendererInfo* WebGLDebugRendererInfo::Create(
|
||||
WebGLRenderingContextBase* context) {
|
||||
- return new WebGLDebugRendererInfo(context);
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
bool WebGLDebugRendererInfo::Supported(WebGLRenderingContextBase*) {
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
const char* WebGLDebugRendererInfo::ExtensionName() {
|
||||
diff --git a/third_party/blink/renderer/platform/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,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
+#include "base/rand_util.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/network/mime/mime_type_registry.h"
|
||||
@@ -121,6 +122,9 @@ bool ImageDataBuffer::EncodeImage(const String& mime_type,
|
||||
Vector<unsigned char>* encoded_image) const {
|
||||
DCHECK(is_valid_);
|
||||
|
||||
+ // shuffle subchannel color data within the pixmap
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(pixmap_.writable_addr(), pixmap_.info(), 0, 0);
|
||||
+
|
||||
if (mime_type == "image/jpeg") {
|
||||
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,7 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||
#include "skia/ext/texture_handle.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
|
||||
@@ -16,6 +17,7 @@
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
+#include "third_party/skia/src/core/SkColorData.h"
|
||||
#include "third_party/skia/include/gpu/GrContext.h"
|
||||
|
||||
namespace blink {
|
||||
@@ -149,15 +151,164 @@ bool StaticBitmapImage::ConvertToArrayBufferContents(
|
||||
rect.Width(), rect.Height(), color_type, kUnpremul_SkAlphaType,
|
||||
color_params.GetSkColorSpaceForSkSurfaces());
|
||||
sk_sp<SkImage> sk_image = src_image->PaintImageForCurrentFrame().GetSkImage();
|
||||
+
|
||||
bool read_pixels_successful = sk_image->readPixels(
|
||||
info, result.Data(), info.minRowBytes(), rect.X(), rect.Y());
|
||||
DCHECK(read_pixels_successful ||
|
||||
!sk_image->bounds().intersect(SkIRect::MakeXYWH(
|
||||
rect.X(), rect.Y(), info.width(), info.height())));
|
||||
+
|
||||
+ ShuffleSubchannelColorData(result.Data(), info, rect.X(), rect.Y());
|
||||
+
|
||||
result.Transfer(dest_contents);
|
||||
return true;
|
||||
}
|
||||
|
||||
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
|
||||
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
|
||||
+
|
||||
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
|
||||
+
|
||||
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
|
||||
+ auto w = info.width() - srcX, h = info.height() - srcY;
|
||||
+
|
||||
+ // skip tiny images
|
||||
+ if (w + h <= 16) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // generate the first random number here
|
||||
+ double shuffleX = base::RandDouble();
|
||||
+
|
||||
+ // cap maximum pixels to change
|
||||
+ auto pixels = (w + h) / 128;
|
||||
+ if (pixels > 10) {
|
||||
+ pixels = 10;
|
||||
+ } else if (pixels < 2) {
|
||||
+ pixels = 2;
|
||||
+ }
|
||||
+
|
||||
+ auto colorType = info.colorType();
|
||||
+ auto fRowBytes = info.minRowBytes(); // stride
|
||||
+
|
||||
+ // 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
|
||||
+ auto shuffleR = (uint8_t)base::RandInt(0, 4), shuffleG = (uint8_t)base::RandInt(0, 4), shuffleB = (uint8_t)base::RandInt(0, 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
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // keep bisecting or reset current width/height as needed
|
||||
+ if (x == 0) {
|
||||
+ currentW = w;
|
||||
+ } else {
|
||||
+ currentW = x;
|
||||
+ }
|
||||
+ if (y == 0) {
|
||||
+ currentH = h;
|
||||
+ } else {
|
||||
+ currentH = y;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#undef writable_addr
|
||||
+#undef shuffleComponent
|
||||
+
|
||||
const gpu::SyncToken& StaticBitmapImage::GetSyncToken() const {
|
||||
static const gpu::SyncToken sync_token;
|
||||
return sync_token;
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
@@ -46,6 +46,8 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
|
||||
static scoped_refptr<StaticBitmapImage> Create(WTF::ArrayBufferContents&,
|
||||
const SkImageInfo&);
|
||||
|
||||
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
|
||||
+
|
||||
bool IsStaticBitmapImage() const override { return true; }
|
||||
|
||||
// Methods overridden by all sub-classes
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -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
|
||||
@@ -526,7 +526,7 @@ void ChromeContentClient::AddContentDecryptionModules(
|
||||
bool supports_persistent_license = false;
|
||||
if (IsWidevineAvailable(&cdm_path, &video_codecs_supported,
|
||||
&supports_persistent_license)) {
|
||||
- const base::Version version(WIDEVINE_CDM_VERSION_STRING);
|
||||
+ const base::Version version("1.0.123.456");
|
||||
DCHECK(version.IsValid());
|
||||
|
||||
cdms->push_back(content::CdmInfo(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From: SergeyZhukovsky <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 15 Aug 2017 15:33:16 -0400
|
||||
Subject: Remove google account access permission on reboot
|
||||
|
||||
---
|
||||
chrome/android/BUILD.gn | 3 +--
|
||||
chrome/android/java/AndroidManifest.xml | 4 ++--
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -784,8 +784,7 @@ jinja_template_resources("chrome_public_apk_template_resources") {
|
||||
resources = [
|
||||
"java/res_template/xml/file_paths.xml",
|
||||
"java/res_template/xml/launchershortcuts.xml",
|
||||
- "java/res_template/xml/searchable.xml",
|
||||
- "java/res_template/xml/syncadapter.xml",
|
||||
+ "java/res_template/xml/searchable.xml"
|
||||
]
|
||||
res_dir = "java/res_template"
|
||||
variables = chrome_public_jinja_variables
|
||||
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
|
||||
--- a/chrome/android/java/AndroidManifest.xml
|
||||
+++ b/chrome/android/java/AndroidManifest.xml
|
||||
@@ -804,14 +804,14 @@ by a child template that "extends" this file.
|
||||
</provider>
|
||||
|
||||
<!-- Sync adapter for browser invalidation. -->
|
||||
- <service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
|
||||
+ <!--<service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.content.SyncAdapter"
|
||||
android:resource="@xml/syncadapter" />
|
||||
- </service>
|
||||
+ </service>-->
|
||||
|
||||
<!-- Broadcast receiver that will be notified of account changes -->
|
||||
<receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver">
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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/profiles/profile_io_data.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
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
|
||||
@@ -964,7 +964,7 @@ void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
|
||||
|
||||
bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
- return enable_metrics_.GetValue();
|
||||
+ return false;
|
||||
}
|
||||
|
||||
chrome_browser_net::Predictor* ProfileIOData::GetPredictor() {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 28 Apr 2018 08:30:26 +0200
|
||||
Subject: Add a flag for DNS-over-HTTPS
|
||||
|
||||
Allow selection between Google and Cloudflare endpoints.
|
||||
Serve DoH requests with maximum priority, remove traffic annotation.
|
||||
Reduce HTTP headers in DoH requests to bare minimum.
|
||||
|
||||
See also: https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-02.txt
|
||||
---
|
||||
chrome/browser/about_flags.cc | 12 +++++++++
|
||||
chrome/browser/flag_descriptions.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
chrome/browser/io_thread.cc | 14 +++++++----
|
||||
.../common/network_features.cc | 5 ++--
|
||||
.../common/network_features.h | 5 ++--
|
||||
.../common/network_switch_list.h | 4 +++
|
||||
net/base/load_flags_list.h | 6 +++++
|
||||
net/dns/dns_transaction.cc | 29 +++-------------------
|
||||
net/url_request/url_request_http_job.cc | 28 +++++++++++++--------
|
||||
10 files changed, 64 insertions(+), 45 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
|
||||
@@ -395,6 +395,12 @@ const FeatureEntry::Choice kChromeHomeSwipeLogicChoices[] = {
|
||||
switches::kChromeHomeSwipeLogicType, "velocity"},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kDnsOverHttpsChoices[] = {
|
||||
+ {features::kDnsOverHttpsChoiceDefault, "", ""},
|
||||
+ {features::kDnsOverHttpsChoiceGoogle, switches::kDnsOverHttpsServer, "https://dns.google.com/experimental"},
|
||||
+ {features::kDnsOverHttpsChoiceCloudflare, switches::kDnsOverHttpsServer, "https://1.1.1.1/dns-query"},
|
||||
+};
|
||||
+
|
||||
#endif // OS_ANDROID
|
||||
|
||||
const FeatureEntry::Choice kNumRasterThreadsChoices[] = {
|
||||
@@ -3544,6 +3550,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kAsyncDns)},
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+#if defined(OS_ANDROID)
|
||||
+ {"enable-dns-over-https", flag_descriptions::kDnsOverHttpsName,
|
||||
+ flag_descriptions::kDnsOverHttpsDescription, kOsAndroid,
|
||||
+ MULTI_VALUE_TYPE(kDnsOverHttpsChoices)},
|
||||
+#endif // defined(OS_ANDROID)
|
||||
+
|
||||
{"enable-overflow-icons-for-media-controls",
|
||||
flag_descriptions::kOverflowIconsForMediaControlsName,
|
||||
flag_descriptions::kOverflowIconsForMediaControlsDescription, kOsAll,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1849,6 +1849,9 @@ const char kAndroidPaymentAppsDescription[] =
|
||||
const char kAsyncDnsName[] = "Async DNS resolver";
|
||||
const char kAsyncDnsDescription[] = "Enables the built-in DNS resolver.";
|
||||
|
||||
+const char kDnsOverHttpsName[] = "DNS over HTTPS";
|
||||
+const char kDnsOverHttpsDescription[] = "Enables DNS-over-HTTPS (experimental).";
|
||||
+
|
||||
const char kAutofillAccessoryViewName[] =
|
||||
"Autofill suggestions as keyboard accessory view";
|
||||
const char kAutofillAccessoryViewDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1133,6 +1133,9 @@ extern const char kAndroidPaymentAppsDescription[];
|
||||
extern const char kAsyncDnsName[];
|
||||
extern const char kAsyncDnsDescription[];
|
||||
|
||||
+extern const char kDnsOverHttpsName[];
|
||||
+extern const char kDnsOverHttpsDescription[];
|
||||
+
|
||||
extern const char kAutofillAccessoryViewName[];
|
||||
extern const char kAutofillAccessoryViewDescription[];
|
||||
|
||||
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
|
||||
--- a/chrome/browser/io_thread.cc
|
||||
+++ b/chrome/browser/io_thread.cc
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "components/metrics/metrics_service.h"
|
||||
#include "components/net_log/chrome_net_log.h"
|
||||
#include "components/network_session_configurator/common/network_features.h"
|
||||
+#include "components/network_session_configurator/common/network_switches.h"
|
||||
#include "components/policy/core/common/policy_service.h"
|
||||
#include "components/policy/policy_constants.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
@@ -383,13 +384,16 @@ IOThread::IOThread(
|
||||
base::Unretained(this)));
|
||||
dns_client_enabled_.MoveToThread(io_thread_proxy);
|
||||
|
||||
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
|
||||
+ std::string dnsOverHttpsServer =
|
||||
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
+ switches::kDnsOverHttpsServer);
|
||||
+ if (!dnsOverHttpsServer.empty()) {
|
||||
base::Value specs(base::Value::Type::LIST);
|
||||
base::Value methods(base::Value::Type::LIST);
|
||||
- base::Value spec(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "server"));
|
||||
- base::Value method(variations::GetVariationParamValueByFeature(
|
||||
- features::kDnsOverHttps, "method"));
|
||||
+
|
||||
+ base::Value spec(dnsOverHttpsServer);
|
||||
+ base::Value method("POST");
|
||||
+
|
||||
if (spec.GetString().size() > 0) {
|
||||
specs.GetList().push_back(std::move(spec));
|
||||
methods.GetList().push_back(std::move(method));
|
||||
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
|
||||
@@ -9,7 +9,8 @@ namespace features {
|
||||
const base::Feature kTokenBinding{"token-binding",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
-const base::Feature kDnsOverHttps{"dns-over-https",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+const char kDnsOverHttpsChoiceDefault[] = "Disabled",
|
||||
+ kDnsOverHttpsChoiceGoogle[] = "Google",
|
||||
+ kDnsOverHttpsChoiceCloudflare[] = "Cloudflare";
|
||||
|
||||
} // 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
|
||||
@@ -14,9 +14,10 @@ namespace features {
|
||||
// (https://www.ietf.org/id/draft-ietf-tokbind-protocol-04.txt).
|
||||
NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kTokenBinding;
|
||||
|
||||
-// Enabled DNS over HTTPS
|
||||
+// DNS over HTTPS server endpoint choices
|
||||
// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-02.txt).
|
||||
-NETWORK_SESSION_CONFIGURATOR_EXPORT extern const base::Feature kDnsOverHttps;
|
||||
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kDnsOverHttpsChoiceDefault[],
|
||||
+ kDnsOverHttpsChoiceGoogle[], kDnsOverHttpsChoiceCloudflare[];
|
||||
|
||||
} // namespace features
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -35,6 +35,10 @@ NETWORK_SWITCH(kOriginToForceQuicOn, "origin-to-force-quic-on")
|
||||
// the server.
|
||||
NETWORK_SWITCH(kQuicConnectionOptions, "quic-connection-options")
|
||||
|
||||
+// Specifies an IETF DNS-over-HTTPS server endpoint
|
||||
+// (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-02.txt).
|
||||
+NETWORK_SWITCH(kDnsOverHttpsServer, "dns-over-https-server")
|
||||
+
|
||||
// Specifies the maximum length for a QUIC packet.
|
||||
NETWORK_SWITCH(kQuicMaxPacketLength, "quic-max-packet-length")
|
||||
|
||||
diff --git a/net/base/load_flags_list.h b/net/base/load_flags_list.h
|
||||
--- a/net/base/load_flags_list.h
|
||||
+++ b/net/base/load_flags_list.h
|
||||
@@ -92,3 +92,9 @@ LOAD_FLAG(DISABLE_CONNECTION_MIGRATION, 1 << 16)
|
||||
// Indicates that the cache should not check that the request matches the
|
||||
// response's vary header.
|
||||
LOAD_FLAG(SKIP_VARY_CHECK, 1 << 17)
|
||||
+
|
||||
+// This load will not send Accept-Language or User-Agent headers, and not
|
||||
+// advertise brotli encoding.
|
||||
+// Used to comply with IETF (draft) DNS-over-HTTPS:
|
||||
+// "Implementors SHOULD NOT set non-essential HTTP headers in DoH client requests."
|
||||
+LOAD_FLAG(MINIMAL_HEADERS, 1 << 18)
|
||||
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
|
||||
--- a/net/dns/dns_transaction.cc
|
||||
+++ b/net/dns/dns_transaction.cc
|
||||
@@ -391,30 +391,8 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
|
||||
HttpRequestHeaders extra_request_headers;
|
||||
extra_request_headers.SetHeader("Accept", kDnsOverHttpResponseContentType);
|
||||
-
|
||||
- request_ = url_request_context->CreateRequest(
|
||||
- url, request_priority_, this,
|
||||
- net::DefineNetworkTrafficAnnotation("dns_over_https", R"(
|
||||
- semantics {
|
||||
- sender: "DNS over HTTPS"
|
||||
- description: "Domain name resolution over HTTPS"
|
||||
- trigger: "User enters a navigates to a domain or Chrome otherwise "
|
||||
- "makes a connection to a domain whose IP address isn't cached"
|
||||
- data: "The domain name that is being requested"
|
||||
- destination: OTHER
|
||||
- destination_other: "The user configured DNS over HTTPS server, which"
|
||||
- "may be dns.google.com"
|
||||
- }
|
||||
- policy {
|
||||
- cookies_allowed: NO
|
||||
- setting:
|
||||
- "You can configure this feature via that 'dns_over_https_servers' and"
|
||||
- "'dns_over_https.method' prefs. Empty lists imply this feature is"
|
||||
- "disabled"
|
||||
- policy_exception_justification: "Experimental feature that"
|
||||
- "is disabled by default"
|
||||
- }
|
||||
- )"));
|
||||
+ //extra_request_headers.SetHeader(HttpRequestHeaders::kUserAgent, "DoH client");
|
||||
+ request_ = url_request_context->CreateRequest(url, request_priority_, this);
|
||||
net_log_ = request_->net_log();
|
||||
|
||||
if (use_post) {
|
||||
@@ -432,6 +410,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
|
||||
request_->SetLoadFlags(request_->load_flags() | LOAD_DISABLE_CACHE |
|
||||
LOAD_BYPASS_PROXY | LOAD_DO_NOT_SEND_COOKIES |
|
||||
LOAD_DO_NOT_SAVE_COOKIES |
|
||||
+ LOAD_IGNORE_LIMITS | LOAD_MINIMAL_HEADERS |
|
||||
LOAD_DO_NOT_SEND_AUTH_DATA);
|
||||
}
|
||||
|
||||
@@ -851,7 +830,7 @@ class DnsTransactionImpl : public DnsTransaction,
|
||||
had_tcp_attempt_(false),
|
||||
doh_attempt_(false),
|
||||
first_server_index_(0),
|
||||
- request_priority_(DEFAULT_PRIORITY) {
|
||||
+ request_priority_(MAXIMUM_PRIORITY) {
|
||||
DCHECK(session_.get());
|
||||
DCHECK(!hostname_.empty());
|
||||
DCHECK(!callback_.is_null());
|
||||
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
||||
--- a/net/url_request/url_request_http_job.cc
|
||||
+++ b/net/url_request/url_request_http_job.cc
|
||||
@@ -434,19 +434,23 @@ void URLRequestHttpJob::Start() {
|
||||
// plugin could set a referrer although sending the referrer is inhibited.
|
||||
request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kReferer);
|
||||
|
||||
- // Our consumer should have made sure that this is a safe referrer. See for
|
||||
- // instance WebCore::FrameLoader::HideReferrer.
|
||||
- if (referrer.is_valid()) {
|
||||
- request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
|
||||
- referrer.spec());
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ // Our consumer should have made sure that this is a safe referrer. See for
|
||||
+ // instance WebCore::FrameLoader::HideReferrer.
|
||||
+ if (referrer.is_valid()) {
|
||||
+ request_info_.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
|
||||
+ referrer.spec());
|
||||
+ }
|
||||
}
|
||||
|
||||
request_info_.token_binding_referrer = request_->token_binding_referrer();
|
||||
|
||||
- request_info_.extra_headers.SetHeaderIfMissing(
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ request_info_.extra_headers.SetHeaderIfMissing(
|
||||
HttpRequestHeaders::kUserAgent,
|
||||
http_user_agent_settings_ ?
|
||||
http_user_agent_settings_->GetUserAgent() : std::string());
|
||||
+ }
|
||||
|
||||
AddExtraHeaders();
|
||||
AddCookieHeaderAndStart();
|
||||
@@ -663,10 +667,12 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
HttpRequestHeaders::kAcceptEncoding)) {
|
||||
// Advertise "br" encoding only if transferred data is opaque to proxy.
|
||||
bool advertise_brotli = false;
|
||||
- if (request()->context()->enable_brotli()) {
|
||||
- if (request()->url().SchemeIsCryptographic() ||
|
||||
- IsLocalhost(request()->url())) {
|
||||
- advertise_brotli = true;
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS)) {
|
||||
+ if (request()->context()->enable_brotli()) {
|
||||
+ if (request()->url().SchemeIsCryptographic() ||
|
||||
+ IsLocalhost(request()->url())) {
|
||||
+ advertise_brotli = true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,7 +689,7 @@ void URLRequestHttpJob::AddExtraHeaders() {
|
||||
advertised_encodings);
|
||||
}
|
||||
|
||||
- if (http_user_agent_settings_) {
|
||||
+ if (!(request_info_.load_flags & LOAD_MINIMAL_HEADERS) && http_user_agent_settings_) {
|
||||
// Only add default Accept-Language if the request didn't have it
|
||||
// specified.
|
||||
std::string accept_language =
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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/io_thread.cc | 10 +---------
|
||||
components/cronet/url_request_context_config.cc | 3 ++-
|
||||
2 files changed, 3 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
|
||||
--- a/chrome/browser/io_thread.cc
|
||||
+++ b/chrome/browser/io_thread.cc
|
||||
@@ -258,15 +258,7 @@ void UpdateMetricsUsagePrefsOnUIThread(const std::string& service_name,
|
||||
// Check the AsyncDns field trial and return true if it should be enabled. On
|
||||
// Android this includes checking the Android version in the field trial.
|
||||
bool ShouldEnableAsyncDns() {
|
||||
- bool feature_can_be_enabled = true;
|
||||
-#if defined(OS_ANDROID)
|
||||
- int min_sdk =
|
||||
- base::GetFieldTrialParamByFeatureAsInt(features::kAsyncDns, "min_sdk", 0);
|
||||
- if (base::android::BuildInfo::GetInstance()->sdk_int() < min_sdk)
|
||||
- feature_can_be_enabled = false;
|
||||
-#endif
|
||||
- return feature_can_be_enabled &&
|
||||
- base::FeatureList::IsEnabled(features::kAsyncDns);
|
||||
+ return base::FeatureList::IsEnabled(features::kAsyncDns);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
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
|
||||
@@ -398,7 +398,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.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 2 May 2018 01:04:07 +0200
|
||||
Subject: Disable custom tab activities permanently
|
||||
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/LaunchIntentDispatcher.java | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
@@ -149,9 +149,10 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
recordIntentMetrics();
|
||||
|
||||
mIsVrIntent = VrIntentUtils.isVrIntent(mIntent);
|
||||
- boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
|
||||
- || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
|
||||
- mIsCustomTabIntent = isCustomTabIntent;
|
||||
+ //boolean isCustomTabIntent = (!mIsVrIntent && isCustomTabIntent(mIntent))
|
||||
+ // || (mIsVrIntent && VrIntentUtils.isCustomTabVrIntent(mIntent));
|
||||
+ //mIsCustomTabIntent = isCustomTabIntent;
|
||||
+ mIsCustomTabIntent = false;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,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(Void... params) {
|
||||
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.7.4
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From: Serg <serg.zhukovsky@gmail.com>
|
||||
Date: Tue, 31 Jan 2017 22:12:27 -0500
|
||||
Subject: Added exit menu item
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 2 ++
|
||||
.../android/java/src/org/chromium/chrome/browser/ChromeActivity.java | 2 ++
|
||||
chrome/android/java/strings/android_chrome_strings.grd | 3 +++
|
||||
3 files changed, 7 insertions(+)
|
||||
|
||||
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
|
||||
@@ -78,6 +78,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
|
||||
@@ -1951,6 +1951,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
RecordUserAction.record("MobileMenuSettings");
|
||||
} else if (id == R.id.show_menu) {
|
||||
showAppMenuForKeyboardEvent();
|
||||
+ } else if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
} else if (id == R.id.find_in_page_id) {
|
||||
if (mFindToolbarManager == null) return false;
|
||||
|
||||
diff --git a/chrome/android/java/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
|
||||
@@ -2563,6 +2563,9 @@ Google may use your browsing activity, content on some sites you visit, and othe
|
||||
<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.7.4
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 18 Oct 2017 21:26:53 +0200
|
||||
Subject: Add menu option to toggle global Javascript preference
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 13 ++++++++
|
||||
chrome/android/java/res/menu/main_menu.xml | 13 ++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 37 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
|
||||
.../java/strings/android_chrome_strings.grd | 11 +++++++
|
||||
7 files changed, 91 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -49,6 +49,7 @@
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:orderInCategory="2" />
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null"
|
||||
android:orderInCategory="2">
|
||||
@@ -61,6 +62,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_javascript_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_javascript_id"
|
||||
+ android:title="@string/menu_enable_javascript" />
|
||||
+ <item android:id="@+id/enable_javascript_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<!-- Title is intentionally left blank in xml and will be set in java. -->
|
||||
<item android:id="@+id/open_in_browser_id"
|
||||
android:title=""
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -59,6 +59,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>
|
||||
@@ -69,6 +70,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
|
||||
@@ -2054,6 +2054,14 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
final boolean usingDesktopUserAgent = currentTab.getUseDesktopUserAgent();
|
||||
currentTab.setUseDesktopUserAgent(!usingDesktopUserAgent, reloadOnChange);
|
||||
RecordUserAction.record("MobileMenuRequestDesktopSite");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
|
||||
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
|
||||
+ 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
|
||||
@@ -1710,6 +1710,14 @@ public class ChromeTabbedActivity
|
||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
|
||||
}
|
||||
RecordUserAction.record("MobileMenuDownloadManager");
|
||||
+ } else if (id == R.id.enable_javascript_id || id == R.id.enable_javascript_check_id) {
|
||||
+ final boolean reloadOnChange = !currentTab.isNativePage();
|
||||
+ final boolean jsEnabled = PrefServiceBridge.getInstance().javaScriptEnabled();
|
||||
+ PrefServiceBridge.getInstance().setJavaScriptEnabled(!jsEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableJavascript");
|
||||
} else if (id == R.id.open_recently_closed_tab) {
|
||||
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
|
||||
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -214,6 +214,8 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
+ updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
+
|
||||
// Only display reader mode settings menu option if the current page is in reader mode.
|
||||
menu.findItem(R.id.reader_mode_prefs_id)
|
||||
.setVisible(DomDistillerUrlUtils.isDistilledPage(currentTab.getUrl()));
|
||||
@@ -469,4 +471,39 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
return chromeHomeMenuItemFlagEnabled && !sHideChromeHomeMenuItems;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * 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().javaScriptEnabled();
|
||||
+
|
||||
+ // Mark the checkbox if Javascript is activated on this tab.
|
||||
+ enableMenuCheck.setChecked(jsEnabled);
|
||||
+
|
||||
+ // This title doesn't seem to be displayed by Android, but it is used to set up
|
||||
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
|
||||
+ enableMenuLabel.setTitleCondensed(jsEnabled
|
||||
+ ? mActivity.getString(R.string.menu_enable_javascript_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_javascript_off));
|
||||
+ }
|
||||
}
|
||||
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
|
||||
@@ -171,6 +171,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
|
||||
@@ -2548,6 +2548,17 @@ Google may use your browsing activity, content on some sites you visit, and othe
|
||||
<message name="IDS_MENU_FIND_IN_PAGE" desc="Menu item allowing users to find text within the current page. [CHAR-LIMIT=27]">
|
||||
Find in page
|
||||
</message>
|
||||
+
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable JavaScript support for the page. [CHAR-LIMIT=27]">
|
||||
+ Enable JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_ON" desc="Accessibility description for when Enable JavaScript is selected.">
|
||||
+ Turn off JavaScript
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_JAVASCRIPT_OFF" desc="Accessibility description for when Enable JavaScript is unselected.">
|
||||
+ Turn on JavaScript
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE" desc="Menu item in Chrome's overflow/options menu. By default, when a user navigates to a web page, Chrome shows the mobile site, that is, the version of the site designed for mobile phones. If this menu item is selected, however, Chrome will try to load the 'desktop' site instead, i.e. the site designed for desktop computers or laptop computers, which have larger screens. [CHAR-LIMIT=24]">
|
||||
Desktop site
|
||||
</message>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 26 Apr 2018 10:37:05 +0200
|
||||
Subject: Add menu option to toggle global Adblock preference
|
||||
|
||||
Allow toggling Chromium's "ads enabled" content settings option together with Bromite adblock engine.
|
||||
---
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 12 +++++++
|
||||
chrome/android/java/res/menu/main_menu.xml | 11 +++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 8 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 8 +++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 38 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 2 ++
|
||||
.../java/strings/android_chrome_strings.grd | 11 +++++++
|
||||
.../subresource_filter_content_settings_manager.cc | 3 ++
|
||||
net/url_request/adblock_intercept.cc | 2 ++
|
||||
net/url_request/adblock_intercept.h | 2 ++
|
||||
net/url_request/url_request.cc | 4 +++
|
||||
11 files changed, 101 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
|
||||
@@ -74,6 +74,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_adblock_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_adblock_id"
|
||||
+ android:title="@string/menu_enable_adblock" />
|
||||
+ <item android:id="@+id/enable_adblock_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<!-- Title is intentionally left blank in xml and will be set in java. -->
|
||||
<item android:id="@+id/open_in_browser_id"
|
||||
android:title=""
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -82,6 +82,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
|
||||
@@ -2064,6 +2064,14 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
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().adsEnabled();
|
||||
+ PrefServiceBridge.getInstance().setAllowAdsEnabled(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
|
||||
@@ -1724,6 +1724,14 @@ public class ChromeTabbedActivity
|
||||
RecordUserAction.record("MobileTabClosedUndoShortCut");
|
||||
} else if (id == R.id.enter_vr_id) {
|
||||
VrShellDelegate.enterVrIfNecessary();
|
||||
+ } 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().adsEnabled();
|
||||
+ PrefServiceBridge.getInstance().setAllowAdsEnabled(adBlockEnabled);
|
||||
+ if (reloadOnChange) {
|
||||
+ currentTab.reload();
|
||||
+ }
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableAdBlock");
|
||||
} else {
|
||||
return super.onMenuOrKeyboardAction(id, fromMenu);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -212,6 +212,8 @@ public class AppMenuPropertiesDelegate {
|
||||
&& !TextUtils.isEmpty(url);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
|
||||
|
||||
+ updateEnableAdBlockMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
@@ -445,6 +447,42 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Updates the enable AdBlock item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable adblock
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateEnableAdBlockMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_adblock_row_menu_id);
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_adblock_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_adblock_check_id);
|
||||
+
|
||||
+
|
||||
+ // Hide enable adblock on all chrome:// pages except for the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+ // Also hide enable javascsript on Reader Mode.
|
||||
+ boolean isDistilledPage = DomDistillerUrlUtils.isDistilledPage(url);
|
||||
+
|
||||
+ boolean itemVisible = (!isChromeScheme || currentTab.isNativePage()) && !isDistilledPage;
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean adBlockEnabled = !PrefServiceBridge.getInstance().adsEnabled();
|
||||
+
|
||||
+ // Mark the checkbox if adblock is globally activate.
|
||||
+ enableMenuCheck.setChecked(adBlockEnabled);
|
||||
+
|
||||
+ // This title doesn't seem to be displayed by Android, but it is used to set up
|
||||
+ // accessibility text in {@link AppMenuAdapter#setupMenuButton}.
|
||||
+ enableMenuLabel.setTitleCondensed(adBlockEnabled
|
||||
+ ? mActivity.getString(R.string.menu_enable_adblock_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_adblock_off));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* @return Whether bookmarks, downloads, and history should be shown in the menu.
|
||||
*/
|
||||
public static boolean shouldShowNavMenuItems() {
|
||||
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
|
||||
@@ -170,6 +170,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
|
||||
@@ -2568,6 +2568,17 @@ Google may use your browsing activity, content on some sites you visit, and othe
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
|
||||
Turn on Request desktop site
|
||||
</message>
|
||||
+
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK" desc="Menu item in Chrome's overflow/options menu. If this menu item is unselected, Bromite will disable AdBlock engine for the page. [CHAR-LIMIT=27]">
|
||||
+ Enable AdBlock
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_ON" desc="Accessibility description for when Enable AdBlock is selected.">
|
||||
+ Turn off AdBlock
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ADBLOCK_OFF" desc="Accessibility description for when Enable AdBlock is unselected.">
|
||||
+ Turn on AdBlock
|
||||
+ </message>
|
||||
+
|
||||
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR-LIMIT=27]">
|
||||
Appearance
|
||||
</message>
|
||||
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
--- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
+++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "components/keyed_service/core/service_access_type.h"
|
||||
#include "components/subresource_filter/core/browser/subresource_filter_features.h"
|
||||
#include "url/gurl.h"
|
||||
+#include "net/url_request/adblock_intercept.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -160,9 +161,11 @@ void SubresourceFilterContentSettingsManager::OnContentSettingChanged(
|
||||
if (global_setting == CONTENT_SETTING_ALLOW) {
|
||||
ChromeSubresourceFilterClient::LogAction(
|
||||
kActionContentSettingsAllowedGlobal);
|
||||
+ net::adblock_enabled = false;
|
||||
} else if (global_setting == CONTENT_SETTING_BLOCK) {
|
||||
ChromeSubresourceFilterClient::LogAction(
|
||||
kActionContentSettingsBlockedGlobal);
|
||||
+ net::adblock_enabled = true;
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
diff --git a/net/url_request/adblock_intercept.cc b/net/url_request/adblock_intercept.cc
|
||||
--- a/net/url_request/adblock_intercept.cc
|
||||
+++ b/net/url_request/adblock_intercept.cc
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
namespace net {
|
||||
|
||||
+bool adblock_enabled = true;
|
||||
+
|
||||
const char *LOG_TAG = "Bromite";
|
||||
|
||||
#ifdef ADB_TESTER
|
||||
diff --git a/net/url_request/adblock_intercept.h b/net/url_request/adblock_intercept.h
|
||||
--- a/net/url_request/adblock_intercept.h
|
||||
+++ b/net/url_request/adblock_intercept.h
|
||||
@@ -11,6 +11,8 @@ int adblock_rules_count();
|
||||
|
||||
int adblock_intercept(const GURL &url, const std::string &origin_host);
|
||||
|
||||
+extern bool adblock_enabled;
|
||||
+
|
||||
} // namespace net
|
||||
|
||||
#endif // NET_URL_REQUEST_ADBLOCK_INTERCEPT_H_
|
||||
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
|
||||
--- a/net/url_request/url_request.cc
|
||||
+++ b/net/url_request/url_request.cc
|
||||
@@ -590,6 +590,7 @@ URLRequest::URLRequest(const GURL& url,
|
||||
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
+ if (net::adblock_enabled) {
|
||||
std::string initiatorHost;
|
||||
if (initiator_.has_value()) {
|
||||
initiatorHost = initiator_.value().host();
|
||||
@@ -600,6 +601,9 @@ URLRequest::URLRequest(const GURL& url,
|
||||
} else {
|
||||
url_chain_ = { url };
|
||||
}
|
||||
+ } else {
|
||||
+ url_chain_ = { url };
|
||||
+ }
|
||||
#endif
|
||||
|
||||
context->url_requests()->insert(this);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 01:32:28 +0200
|
||||
Subject: Remove help menu item
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 2 --
|
||||
.../java/src/org/chromium/chrome/browser/ChromeActivity.java | 9 ---------
|
||||
.../java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 3 ---
|
||||
.../chromium/chrome/browser/customtabs/CustomTabActivity.java | 2 +-
|
||||
4 files changed, 1 insertion(+), 15 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -98,8 +98,6 @@
|
||||
android:icon="@drawable/reader_mode_prefs_icon" />
|
||||
<item android:id="@+id/preferences_id"
|
||||
android:title="@string/menu_preferences" />
|
||||
- <item android:id="@+id/help_id"
|
||||
- android:title="@string/menu_help" />
|
||||
<item android:id="@+id/enter_vr_id"
|
||||
android:title="@string/enter_vr" />
|
||||
<item android:id="@+id/exit_id"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -1975,15 +1975,6 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
|
||||
final Tab currentTab = getActivityTab();
|
||||
|
||||
- if (id == R.id.help_id) {
|
||||
- String url = currentTab != null ? currentTab.getUrl() : "";
|
||||
- Profile profile = mTabModelSelector.isIncognitoSelected()
|
||||
- ? Profile.getLastUsedProfile().getOffTheRecordProfile()
|
||||
- : Profile.getLastUsedProfile().getOriginalProfile();
|
||||
- startHelpAndFeedback(url, "MobileMenuFeedback", profile);
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
// All the code below assumes currentTab is not null, so return early if it is null.
|
||||
if (currentTab == null) {
|
||||
return false;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
@@ -338,9 +338,6 @@ public class KeyboardShortcuts {
|
||||
tab = activity.getActivityTab();
|
||||
if (tab != null && tab.canGoForward()) tab.goForward();
|
||||
return true;
|
||||
- case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+?
|
||||
- activity.onMenuOrKeyboardAction(R.id.help_id, false);
|
||||
- return true;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
@@ -1016,7 +1016,7 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
|
||||
// Disable creating new tabs, bookmark, history, print, help, focus_url, etc.
|
||||
if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id
|
||||
- || id == R.id.help_id || id == R.id.recent_tabs_menu_id
|
||||
+ || id == R.id.recent_tabs_menu_id
|
||||
|| id == R.id.new_incognito_tab_menu_id || id == R.id.new_tab_menu_id
|
||||
|| id == R.id.open_history_menu_id) {
|
||||
return true;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 27 Jun 2018 11:02:38 +0200
|
||||
Subject: Change default homepage to new tab page
|
||||
|
||||
Disable any partner-provided home page.
|
||||
---
|
||||
.../chrome/browser/partnercustomizations/HomepageManager.java | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
|
||||
@@ -102,8 +102,7 @@ public class HomepageManager {
|
||||
* @return Whether or not homepage setting should be shown.
|
||||
*/
|
||||
public static boolean shouldShowHomepageSetting() {
|
||||
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
|
||||
- || FeatureUtilities.isHomePageButtonForceEnabled();
|
||||
+ return FeatureUtilities.isHomePageButtonForceEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,9 +123,7 @@ public class HomepageManager {
|
||||
* if the homepage button is force enabled via flag.
|
||||
*/
|
||||
public static String getDefaultHomepageUri() {
|
||||
- return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
|
||||
- ? PartnerBrowserCustomizations.getHomePageUrl()
|
||||
- : UrlConstants.NTP_NON_NATIVE_URL;
|
||||
+ return UrlConstants.NTP_NON_NATIVE_URL;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.7.4
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 15 Sep 2014 10:52:32 +0200
|
||||
Subject: net/cert: increase default key length for newly-generated RSA keys
|
||||
|
||||
Should we add something for chrome://settings, or just leave
|
||||
it as hidden as it was before?
|
||||
---
|
||||
net/cert/x509_util.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/cert/x509_util.cc b/net/cert/x509_util.cc
|
||||
--- a/net/cert/x509_util.cc
|
||||
+++ b/net/cert/x509_util.cc
|
||||
@@ -190,7 +190,7 @@ bool GetTLSServerEndPointChannelBinding(const X509Certificate& certificate,
|
||||
}
|
||||
|
||||
// RSA keys created by CreateKeyAndSelfSignedCert will be of this length.
|
||||
-static const uint16_t kRSAKeyLength = 1024;
|
||||
+static const uint16_t kRSAKeyLength = 2048;
|
||||
|
||||
// Certificates made by CreateKeyAndSelfSignedCert will be signed using this
|
||||
// digest algorithm.
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Mon, 15 Sep 2014 10:58:42 +0200
|
||||
Subject: dns: send IPv6 connectivity probes to RIPE DNS rather than Google
|
||||
|
||||
Short of disabling the code (we may do that in a subsequent patch
|
||||
anyway), avoid sending to Google.
|
||||
---
|
||||
net/dns/host_resolver_impl.cc | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
|
||||
--- a/net/dns/host_resolver_impl.cc
|
||||
+++ b/net/dns/host_resolver_impl.cc
|
||||
@@ -109,10 +109,10 @@ const unsigned kMinimumTTLSeconds = kCacheEntryTTLSeconds;
|
||||
// cached.
|
||||
const int kIPv6ProbePeriodMs = 1000;
|
||||
|
||||
-// Google DNS address used for IPv6 probes.
|
||||
+/* RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted) */
|
||||
const uint8_t kIPv6ProbeAddress[] =
|
||||
- { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
|
||||
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
|
||||
+ { 0x20, 0x01, 0x07, 0xfd, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
|
||||
|
||||
// We use a separate histogram name for each platform to facilitate the
|
||||
// display of error codes by their symbolic name (since each platform has
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Tue, 28 Oct 2014 18:45:19 +0100
|
||||
Subject: profile-resetter: do not tick send-settings by default
|
||||
|
||||
When the user wishes to reset his preferences, Chromium would suggest
|
||||
to send over the old settings to Google. I presume that this is for
|
||||
Google to investigate into the setting combinations that led the user
|
||||
to issue a rest.
|
||||
|
||||
Of course, we cannot let that happen by default. Google is not to get
|
||||
any information.
|
||||
---
|
||||
chrome/browser/profile_resetter/reset_report_uploader.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/profile_resetter/reset_report_uploader.cc b/chrome/browser/profile_resetter/reset_report_uploader.cc
|
||||
--- a/chrome/browser/profile_resetter/reset_report_uploader.cc
|
||||
+++ b/chrome/browser/profile_resetter/reset_report_uploader.cc
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace {
|
||||
const char kResetReportUrl[] =
|
||||
- "https://sb-ssl.google.com/safebrowsing/clientreport/chrome-reset";
|
||||
+ "about:blank"; //https://sb-ssl.google.com/safebrowsing/clientreport/chrome-reset";
|
||||
|
||||
GURL GetClientReportUrl(const std::string& report_url) {
|
||||
GURL url(report_url);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
From: Joachim Bauch <bauch@struktur.de>
|
||||
Date: Tue, 9 Dec 2014 17:19:41 +0100
|
||||
Subject: browser-ui: disable warning about missing API keys
|
||||
|
||||
We do not want to use the services anyway ;)
|
||||
---
|
||||
chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
--- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
+++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
// static
|
||||
void GoogleApiKeysInfoBarDelegate::Create(InfoBarService* infobar_service) {
|
||||
+ return;
|
||||
infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
|
||||
std::unique_ptr<ConfirmInfoBarDelegate>(
|
||||
new GoogleApiKeysInfoBarDelegate())));
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 11 Sep 2014 16:37:32 +0200
|
||||
Subject: autofill: disable autofill download manager
|
||||
|
||||
Disables the autofill download manager (trk:158).
|
||||
---
|
||||
components/autofill/core/browser/autofill_download_manager.cc | 9 +--------
|
||||
components/autofill/core/browser/autofill_manager.cc | 2 ++
|
||||
2 files changed, 3 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/components/autofill/core/browser/autofill_download_manager.cc b/components/autofill/core/browser/autofill_download_manager.cc
|
||||
--- a/components/autofill/core/browser/autofill_download_manager.cc
|
||||
+++ b/components/autofill/core/browser/autofill_download_manager.cc
|
||||
@@ -133,12 +133,6 @@ const net::BackoffEntry::Policy kAutofillBackoffPolicy = {
|
||||
false,
|
||||
};
|
||||
|
||||
-#if defined(GOOGLE_CHROME_BUILD)
|
||||
-const char kClientName[] = "Google Chrome";
|
||||
-#else
|
||||
-const char kClientName[] = "Chromium";
|
||||
-#endif // defined(GOOGLE_CHROME_BUILD)
|
||||
-
|
||||
size_t CountActiveFieldsInForms(const std::vector<FormStructure*>& forms) {
|
||||
size_t active_field_count = 0;
|
||||
for (const auto* form : forms)
|
||||
@@ -158,8 +152,7 @@ std::string RequestTypeToString(AutofillDownloadManager::RequestType type) {
|
||||
}
|
||||
|
||||
GURL GetRequestUrl(AutofillDownloadManager::RequestType request_type) {
|
||||
- return GURL("https://clients1.google.com/tbproxy/af/" +
|
||||
- RequestTypeToString(request_type) + "?client=" + kClientName);
|
||||
+ return GURL("about:blank/");
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out,
|
||||
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
|
||||
@@ -1255,9 +1255,11 @@ AutofillManager::AutofillManager(
|
||||
weak_ptr_factory_(this) {
|
||||
DCHECK(driver);
|
||||
DCHECK(client_);
|
||||
+#if 0
|
||||
if (enable_download_manager == ENABLE_AUTOFILL_DOWNLOAD_MANAGER) {
|
||||
download_manager_.reset(new AutofillDownloadManager(driver, this));
|
||||
}
|
||||
+#endif
|
||||
CountryNames::SetLocaleString(app_locale_);
|
||||
if (personal_data_ && client_)
|
||||
personal_data_->OnSyncServiceInitialized(client_->GetSyncService());
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Sat, 13 Sep 2014 17:12:43 +0200
|
||||
Subject: first_run: deactivate autoupdate globally
|
||||
|
||||
We currently do not have any update service infrastructure in place
|
||||
(i.e. on our webserver), and sending update requests to Google also
|
||||
sounds meh (wrong provider, after all).
|
||||
|
||||
Also, there is no tunable in chrome://settings (or similar) yet to
|
||||
turn it back on.
|
||||
---
|
||||
chrome/browser/extensions/extension_system_impl.cc | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
|
||||
--- a/chrome/browser/extensions/extension_system_impl.cc
|
||||
+++ b/chrome/browser/extensions/extension_system_impl.cc
|
||||
@@ -206,8 +206,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
|
||||
// ExtensionService depends on RuntimeData.
|
||||
runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
|
||||
|
||||
- bool autoupdate_enabled = !profile_->IsGuestSession() &&
|
||||
- !profile_->IsSystemProfile();
|
||||
+ bool autoupdate_enabled = false;
|
||||
#if defined(OS_CHROMEOS)
|
||||
if (!extensions_enabled ||
|
||||
chromeos::ProfileHelper::IsLockScreenAppProfile(profile_)) {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Tue, 7 Jul 2015 17:02:09 +0200
|
||||
Subject: safe_browsing: disable incident reporting
|
||||
|
||||
Disables the safebrowsing incident reporting where you could upload
|
||||
information about a blocked URL to Google (also added a trk prefix to
|
||||
the URL so we get notified if this happens again in the future).
|
||||
---
|
||||
.../safe_browsing/incident_reporting/incident_report_uploader_impl.cc | 2 +-
|
||||
.../safe_browsing/incident_reporting/incident_reporting_service.cc | 3 +++
|
||||
chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | 3 +--
|
||||
chrome/browser/safe_browsing/safe_browsing_service.cc | 2 ++
|
||||
components/security_interstitials/core/safe_browsing_loud_error_ui.cc | 1 +
|
||||
5 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc b/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc
|
||||
--- a/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc
|
||||
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc
|
||||
@@ -22,7 +22,7 @@ namespace safe_browsing {
|
||||
namespace {
|
||||
|
||||
const char kSbIncidentReportUrl[] =
|
||||
- "https://sb-ssl.google.com/safebrowsing/clientreport/incident";
|
||||
+ "about:blank";
|
||||
|
||||
constexpr net::NetworkTrafficAnnotationTag
|
||||
kSafeBrowsingIncidentTrafficAnnotation =
|
||||
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
|
||||
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
|
||||
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
|
||||
@@ -310,11 +310,14 @@ IncidentReportingService::UploadContext::~UploadContext() {
|
||||
|
||||
// static
|
||||
bool IncidentReportingService::IsEnabledForProfile(Profile* profile) {
|
||||
+ return false;
|
||||
+#if 0
|
||||
if (profile->IsOffTheRecord())
|
||||
return false;
|
||||
if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled))
|
||||
return false;
|
||||
return IsExtendedReportingEnabled(*profile->GetPrefs());
|
||||
+#endif
|
||||
}
|
||||
|
||||
IncidentReportingService::IncidentReportingService(
|
||||
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
||||
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
||||
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
|
||||
@@ -58,8 +58,7 @@ class SafeBrowsingBlockingPageFactoryImpl
|
||||
PrefService* prefs =
|
||||
Profile::FromBrowserContext(web_contents->GetBrowserContext())
|
||||
->GetPrefs();
|
||||
- bool is_extended_reporting_opt_in_allowed =
|
||||
- IsExtendedReportingOptInAllowed(*prefs);
|
||||
+ bool is_extended_reporting_opt_in_allowed = false;
|
||||
bool is_proceed_anyway_disabled =
|
||||
prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled);
|
||||
|
||||
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
|
||||
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
|
||||
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
|
||||
@@ -353,8 +353,10 @@ SafeBrowsingDatabaseManager* SafeBrowsingService::CreateDatabaseManager() {
|
||||
|
||||
void SafeBrowsingService::RegisterAllDelayedAnalysis() {
|
||||
#if defined(FULL_SAFE_BROWSING)
|
||||
+#if 0
|
||||
RegisterBinaryIntegrityAnalysis();
|
||||
#endif
|
||||
+#endif
|
||||
}
|
||||
|
||||
SafeBrowsingProtocolConfig SafeBrowsingService::GetProtocolConfig() const {
|
||||
diff --git a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
|
||||
--- a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
|
||||
+++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
|
||||
@@ -23,6 +23,7 @@ namespace {
|
||||
// For malware interstitial pages, we link the problematic URL to Google's
|
||||
// diagnostic page.
|
||||
const char kSbDiagnosticUrl[] =
|
||||
+/* trk:227 */
|
||||
"https://transparencyreport.google.com/safe-browsing/search?url=%s";
|
||||
|
||||
// Constants for the V4 phishing string upgrades.
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Tue, 7 Jul 2015 18:28:46 +0200
|
||||
Subject: safe_browsing: disable reporting of safebrowsing override
|
||||
|
||||
Disables reporting of the safebrowsing override, i.e. the report sent
|
||||
if a user decides to visit a page that was flagged as "insecure".
|
||||
This prevents trk:148 (phishing) and trk:149 (malware).
|
||||
---
|
||||
.../browser/safe_browsing/client_side_detection_service.cc | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
@@ -62,11 +62,13 @@ enum MalwareReportTypes {
|
||||
REPORT_RESULT_MAX
|
||||
};
|
||||
|
||||
+#if 0
|
||||
void UpdateEnumUMAHistogram(MalwareReportTypes report_type) {
|
||||
DCHECK(report_type >= 0 && report_type < REPORT_RESULT_MAX);
|
||||
UMA_HISTOGRAM_ENUMERATION("SBClientMalware.SentReports", report_type,
|
||||
REPORT_RESULT_MAX);
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -283,6 +285,10 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
|
||||
return;
|
||||
}
|
||||
|
||||
+#if 1
|
||||
+ if (!callback.is_null())
|
||||
+ callback.Run(GURL(request->url()), false);
|
||||
+#else
|
||||
// Fill in metadata about which model we used.
|
||||
if (is_extended_reporting) {
|
||||
request->set_model_filename(model_loader_extended_->name());
|
||||
@@ -361,6 +367,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
|
||||
|
||||
// Record that we made a request
|
||||
phishing_report_times_.push(base::Time::Now());
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ClientSideDetectionService::StartClientReportMalwareRequest(
|
||||
@@ -375,6 +382,10 @@ void ClientSideDetectionService::StartClientReportMalwareRequest(
|
||||
return;
|
||||
}
|
||||
|
||||
+#if 1
|
||||
+ if (!callback.is_null())
|
||||
+ callback.Run(GURL(request->url()), GURL(request->url()), false);
|
||||
+#else
|
||||
std::string request_data;
|
||||
if (!request->SerializeToString(&request_data)) {
|
||||
UpdateEnumUMAHistogram(REPORT_FAILED_SERIALIZATION);
|
||||
@@ -444,6 +455,7 @@ void ClientSideDetectionService::StartClientReportMalwareRequest(
|
||||
|
||||
// Record that we made a malware request
|
||||
malware_report_times_.push(base::Time::Now());
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ClientSideDetectionService::HandlePhishingVerdict(
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Wed, 22 Jul 2015 12:24:15 +0200
|
||||
Subject: safe_browsing: disable cookie transmission
|
||||
|
||||
Disables sending/setting cookies for Safebrowsing requests. This
|
||||
prevents the long-living tracking cookie from being set.
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/37
|
||||
---
|
||||
chrome/browser/safe_browsing/client_side_detection_service.cc | 4 ++--
|
||||
.../download_protection/check_client_download_request.cc | 2 +-
|
||||
.../safe_browsing/download_protection/ppapi_download_request.cc | 2 +-
|
||||
chrome/browser/safe_browsing/protocol_manager.cc | 8 ++++----
|
||||
components/safe_browsing/browser/threat_details_cache.cc | 1 +
|
||||
5 files changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
|
||||
@@ -348,7 +348,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = GetClientReportUrl(kClientReportPhishingUrl);
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
auto loader = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
loader->AttachStringForUpload(request_data, "application/octet-stream");
|
||||
@@ -430,7 +430,7 @@ void ClientSideDetectionService::StartClientReportMalwareRequest(
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = GetClientReportUrl(kClientReportMalwareUrl);
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
auto loader = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
loader->AttachStringForUpload(request_data, "application/octet-stream");
|
||||
diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
|
||||
--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
|
||||
+++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
|
||||
@@ -1008,7 +1008,7 @@ void CheckClientDownloadRequest::SendRequest() {
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = PPAPIDownloadRequest::GetDownloadRequestUrl();
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
loader_->AttachStringForUpload(client_download_request_data_,
|
||||
diff --git a/chrome/browser/safe_browsing/download_protection/ppapi_download_request.cc b/chrome/browser/safe_browsing/download_protection/ppapi_download_request.cc
|
||||
--- a/chrome/browser/safe_browsing/download_protection/ppapi_download_request.cc
|
||||
+++ b/chrome/browser/safe_browsing/download_protection/ppapi_download_request.cc
|
||||
@@ -242,7 +242,7 @@ void PPAPIDownloadRequest::SendRequest() {
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = GetDownloadRequestUrl();
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
loader_->AttachStringForUpload(client_download_request_data_,
|
||||
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
|
||||
--- a/chrome/browser/safe_browsing/protocol_manager.cc
|
||||
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
|
||||
@@ -282,7 +282,7 @@ void SafeBrowsingProtocolManager::GetFullHash(
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = gethash_url;
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
auto loader_ptr = network::SimpleURLLoader::Create(
|
||||
std::move(resource_request), traffic_annotation);
|
||||
loader_ptr->AttachStringForUpload(FormatGetHash(prefixes), "text/plain");
|
||||
@@ -688,7 +688,7 @@ bool SafeBrowsingProtocolManager::IssueBackupUpdateRequest(
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = backup_update_url;
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
request_ = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
request_->AttachStringForUpload(update_list_data_, "text/plain");
|
||||
@@ -719,7 +719,7 @@ void SafeBrowsingProtocolManager::IssueChunkRequest() {
|
||||
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = chunk_url;
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
|
||||
request_ = network::SimpleURLLoader::Create(
|
||||
std::move(resource_request), kChunkBackupRequestTrafficAnnotation);
|
||||
request_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
|
||||
@@ -777,7 +777,7 @@ void SafeBrowsingProtocolManager::OnGetChunksComplete(
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = update_url;
|
||||
resource_request->method = "POST";
|
||||
- resource_request->load_flags = net::LOAD_DISABLE_CACHE;
|
||||
+ resource_request->load_flags = net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
|
||||
request_ = network::SimpleURLLoader::Create(
|
||||
std::move(resource_request), kChunkBackupRequestTrafficAnnotation);
|
||||
request_->AttachStringForUpload(update_list_data_, "text/plain");
|
||||
diff --git a/components/safe_browsing/browser/threat_details_cache.cc b/components/safe_browsing/browser/threat_details_cache.cc
|
||||
--- a/components/safe_browsing/browser/threat_details_cache.cc
|
||||
+++ b/components/safe_browsing/browser/threat_details_cache.cc
|
||||
@@ -113,6 +113,7 @@ void ThreatDetailsCacheCollector::OpenEntry() {
|
||||
// Only from cache, and don't save cookies.
|
||||
resource_request->load_flags = net::LOAD_ONLY_FROM_CACHE |
|
||||
net::LOAD_SKIP_CACHE_VALIDATION |
|
||||
+ net::LOAD_DO_NOT_SEND_COOKIES |
|
||||
net::LOAD_DO_NOT_SAVE_COOKIES;
|
||||
current_load_ = network::SimpleURLLoader::Create(std::move(resource_request),
|
||||
traffic_annotation);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Thu, 25 Jun 2015 15:34:10 +0200
|
||||
Subject: extensions: always show component extensions in the ext list
|
||||
|
||||
The attached patch makes sure that component extensions are always
|
||||
shown in "chrome://extensions".
|
||||
|
||||
Currently these are
|
||||
- Bookmark Manager
|
||||
- Chromium PDF Viewer
|
||||
- CryptoTokenExtension
|
||||
|
||||
References: https://github.com/iridium-browser/iridium-browser/issues/28
|
||||
---
|
||||
extensions/common/extension.cc | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
|
||||
--- a/extensions/common/extension.cc
|
||||
+++ b/extensions/common/extension.cc
|
||||
@@ -380,9 +380,12 @@ bool Extension::ShouldDisplayInExtensionSettings() const {
|
||||
}
|
||||
|
||||
bool Extension::ShouldExposeViaManagementAPI() const {
|
||||
+#if 0
|
||||
// Hide component extensions because they are only extensions as an
|
||||
// implementation detail of Chrome.
|
||||
return !extensions::Manifest::IsComponentLocation(location());
|
||||
+#endif
|
||||
+ return false;
|
||||
}
|
||||
|
||||
Extension::ManifestData* Extension::GetManifestData(const std::string& key)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From: Simon Eisenmann <simon@struktur.de>
|
||||
Date: Mon, 26 Oct 2015 14:18:05 +0100
|
||||
Subject: translate: disable fetching of translate languages from server
|
||||
|
||||
GH issue #18.
|
||||
---
|
||||
components/translate/core/browser/translate_language_list.cc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc
|
||||
--- a/components/translate/core/browser/translate_language_list.cc
|
||||
+++ b/components/translate/core/browser/translate_language_list.cc
|
||||
@@ -207,6 +207,7 @@ GURL TranslateLanguageList::TranslateLanguageUrl() {
|
||||
}
|
||||
|
||||
void TranslateLanguageList::RequestLanguageList() {
|
||||
+#if 0
|
||||
// If resource requests are not allowed, we'll get a callback when they are.
|
||||
if (!resource_requests_allowed_) {
|
||||
request_pending_ = true;
|
||||
@@ -233,6 +234,7 @@ void TranslateLanguageList::RequestLanguageList() {
|
||||
if (!result)
|
||||
NotifyEvent(__LINE__, "Request is omitted due to retry limit");
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
void TranslateLanguageList::SetResourceRequestsAllowed(bool allowed) {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 24 Jun 2018 01:51:49 +0200
|
||||
Subject: lint: suppress hardcoded text warnings
|
||||
|
||||
---
|
||||
build/android/lint/suppressions.xml | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml
|
||||
--- a/build/android/lint/suppressions.xml
|
||||
+++ b/build/android/lint/suppressions.xml
|
||||
@@ -96,10 +96,8 @@ Still reading?
|
||||
<ignore regexp="chromecast/internal" />
|
||||
<ignore regexp="remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java" />
|
||||
</issue>
|
||||
- <issue id="HardcodedDebugMode" severity="Fatal">
|
||||
- <ignore path="AndroidManifest.xml"/>
|
||||
- </issue>
|
||||
- <issue id="HardcodedText" severity="Error">
|
||||
+ <issue id="HardcodedDebugMode" severity="Fatal" />
|
||||
+ <issue id="HardcodedText" severity="ignore">
|
||||
<ignore regexp="chromecast/internal"/>
|
||||
<ignore regexp="remoting/android/host/res/layout/main.xml"/>
|
||||
</issue>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:04:43 +0200
|
||||
Subject: kill Vision
|
||||
|
||||
---
|
||||
services/shape_detection/BUILD.gn | 3 ---
|
||||
.../java/src/org/chromium/shape_detection/BitmapUtils.java | 12 ------------
|
||||
.../chromium/shape_detection/FaceDetectionProviderImpl.java | 2 +-
|
||||
.../src/org/chromium/shape_detection/InterfaceRegistrar.java | 2 --
|
||||
4 files changed, 1 insertion(+), 18 deletions(-)
|
||||
|
||||
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
|
||||
@@ -79,13 +79,10 @@ if (is_android) {
|
||||
|
||||
android_library("shape_detection_java") {
|
||||
java_files = [
|
||||
- "android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java",
|
||||
"android/java/src/org/chromium/shape_detection/FaceDetectionImpl.java",
|
||||
- "android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java",
|
||||
"android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java",
|
||||
"android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
|
||||
"android/java/src/org/chromium/shape_detection/BitmapUtils.java",
|
||||
- "android/java/src/org/chromium/shape_detection/TextDetectionImpl.java",
|
||||
]
|
||||
|
||||
deps = [
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
|
||||
@@ -6,8 +6,6 @@ package org.chromium.shape_detection;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
-import com.google.android.gms.vision.Frame;
|
||||
-
|
||||
import org.chromium.skia.mojom.ColorType;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -41,14 +39,4 @@ public class BitmapUtils {
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
-
|
||||
- public static Frame convertToFrame(org.chromium.skia.mojom.Bitmap bitmapData) {
|
||||
- Bitmap bitmap = convertToBitmap(bitmapData);
|
||||
- if (bitmap == null) {
|
||||
- return null;
|
||||
- }
|
||||
-
|
||||
- // This constructor implies a pixel format conversion to YUV.
|
||||
- return new Frame.Builder().setBitmap(bitmap).build();
|
||||
- }
|
||||
}
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
||||
@@ -30,7 +30,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
|
||||
== ConnectionResult.SUCCESS;
|
||||
|
||||
if (isGmsCoreSupported) {
|
||||
- FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
|
||||
+ //FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
|
||||
} else {
|
||||
FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
|
||||
}
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
|
||||
@@ -20,9 +20,7 @@ class InterfaceRegistrar {
|
||||
// is not necessary to hold on to a reference to it explicitly.
|
||||
InterfaceRegistry registry = InterfaceRegistry.create(
|
||||
CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
|
||||
- registry.addInterface(BarcodeDetection.MANAGER, new BarcodeDetectionImpl.Factory());
|
||||
registry.addInterface(
|
||||
FaceDetectionProvider.MANAGER, new FaceDetectionProviderImpl.Factory());
|
||||
- registry.addInterface(TextDetection.MANAGER, new TextDetectionImpl.Factory());
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,800 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:11:38 +0200
|
||||
Subject: kill GCM
|
||||
|
||||
---
|
||||
build/secondary/third_party/android_tools/BUILD.gn | 2 -
|
||||
.../third_party/android_tools/support/BUILD.gn | 5 --
|
||||
chrome/android/BUILD.gn | 1 -
|
||||
chrome/android/java/AndroidManifest.xml | 62 ----------------------
|
||||
.../chrome/browser/BackgroundSyncLauncher.java | 16 +++---
|
||||
.../invalidation/InvalidationController.java | 13 +----
|
||||
.../browser/ntp/snippets/SnippetsLauncher.java | 44 ---------------
|
||||
.../browser/services/gcm/GCMBackgroundTask.java | 2 -
|
||||
.../gcm/InvalidationGcmUpstreamSender.java | 3 +-
|
||||
chrome/android/java_sources.gni | 2 -
|
||||
components/background_task_scheduler/BUILD.gn | 1 -
|
||||
.../BackgroundTaskSchedulerGcmNetworkManager.java | 30 ++++-------
|
||||
components/gcm_driver/android/BUILD.gn | 1 -
|
||||
components/gcm_driver/instance_id/android/BUILD.gn | 1 -
|
||||
.../gcm_driver/instance_id/InstanceIDBridge.java | 29 ++--------
|
||||
components/sync/android/BUILD.gn | 1 -
|
||||
third_party/cacheinvalidation/BUILD.gn | 6 ---
|
||||
.../client/contrib/MultiplexingGcmListener.java | 49 ++---------------
|
||||
.../android2/channel/AndroidNetworkChannel.java | 18 +++----
|
||||
19 files changed, 34 insertions(+), 252 deletions(-)
|
||||
|
||||
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
|
||||
--- a/build/secondary/third_party/android_tools/BUILD.gn
|
||||
+++ b/build/secondary/third_party/android_tools/BUILD.gn
|
||||
@@ -43,8 +43,6 @@ if (enable_java_templates) {
|
||||
support_lib_alias("android_support_chromium_java") {
|
||||
testonly = true
|
||||
}
|
||||
- support_lib_alias("android_gcm_java") {
|
||||
- }
|
||||
support_lib_alias("emma_device_java") {
|
||||
}
|
||||
prebuilt_wrapper("android_arch_lifecycle_common_java") {
|
||||
diff --git a/build/secondary/third_party/android_tools/support/BUILD.gn b/build/secondary/third_party/android_tools/support/BUILD.gn
|
||||
--- a/build/secondary/third_party/android_tools/support/BUILD.gn
|
||||
+++ b/build/secondary/third_party/android_tools/support/BUILD.gn
|
||||
@@ -21,11 +21,6 @@ android_library("android_support_chromium_java") {
|
||||
visibility += [ "//third_party/android_tools:*" ]
|
||||
}
|
||||
|
||||
-android_java_prebuilt("android_gcm_java") {
|
||||
- jar_path = "//third_party/android_tools/sdk/extras/google/gcm/gcm-client/dist/gcm.jar"
|
||||
- visibility += [ "//third_party/android_tools:*" ]
|
||||
-}
|
||||
-
|
||||
android_java_prebuilt("emma_device_java") {
|
||||
jar_path = "//third_party/android_tools/sdk/tools/lib/emma_device.jar"
|
||||
include_java_resources = true
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -261,7 +261,6 @@ android_library("chrome_java") {
|
||||
"//third_party/android_swipe_refresh:android_swipe_refresh_java",
|
||||
"//third_party/android_tools:android_arch_lifecycle_common_java",
|
||||
"//third_party/android_tools:android_arch_lifecycle_runtime_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/android_tools:android_support_annotations_java",
|
||||
"//third_party/android_tools:android_support_compat_java",
|
||||
"//third_party/android_tools:android_support_design_java",
|
||||
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
|
||||
--- a/chrome/android/java/AndroidManifest.xml
|
||||
+++ b/chrome/android/java/AndroidManifest.xml
|
||||
@@ -72,22 +72,17 @@ by a child template that "extends" this file.
|
||||
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
|
||||
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
|
||||
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
|
||||
- <!-- Only chrome can receive the messages and registration result -->
|
||||
- <permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE"
|
||||
- android:protectionLevel="signature" />
|
||||
<permission android:name="{{ manifest_package }}.permission.DEBUG"
|
||||
android:label="Debug web pages"
|
||||
android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
- <uses-permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE" />
|
||||
<uses-permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" />
|
||||
<uses-permission android:name="{{ manifest_package }}.TOS_ACKED" />
|
||||
|
||||
<uses-permission android:name="com.chrome.permission.DEVICE_EXTRAS" />
|
||||
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
|
||||
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
|
||||
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
|
||||
|
||||
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
|
||||
@@ -886,43 +881,6 @@ by a child template that "extends" this file.
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
|
||||
android:hardwareAccelerated="false" />
|
||||
|
||||
- <!-- Receiver for GCM messages. -->
|
||||
- <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
|
||||
- android:exported="true"
|
||||
- android:permission="com.google.android.c2dm.permission.SEND">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
- <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||
- <category android:name="{{ manifest_package }}"/>
|
||||
- </intent-filter>
|
||||
- </receiver>
|
||||
- <!-- GcmTaskService for registration for Invalidations. -->
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.GcmRegistrationTaskService"
|
||||
- android:exported="true"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE" >
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <!-- InstanceIDListenerService for token refresh events from GCM. -->
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidInstanceIDListenerService"
|
||||
- android:exported="false">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.iid.InstanceID"/>
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <!-- GcmListenerService for messages from GCM. -->
|
||||
- <service android:name="org.chromium.chrome.browser.services.gcm.ChromeGcmListenerService"
|
||||
- android:exported="false" >
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
- <meta-data android:name="ipc.invalidation.ticl.gcm_upstream_service_class"
|
||||
- android:value="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender" />
|
||||
- <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
|
||||
- android:exported="false"/>
|
||||
-
|
||||
<!-- Notification service for sync. -->
|
||||
<meta-data android:name="ipc.invalidation.ticl.listener_service_class"
|
||||
android:value="org.chromium.chrome.browser.invalidation.ChromeInvalidationClientService"/>
|
||||
@@ -934,8 +892,6 @@ by a child template that "extends" this file.
|
||||
</service>
|
||||
<service android:name="com.google.ipc.invalidation.ticl.android2.TiclService"
|
||||
android:exported="false"/>
|
||||
- <service android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"
|
||||
- android:exported="false"/>
|
||||
<receiver android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"
|
||||
android:exported="false"/>
|
||||
<receiver android:name="com.google.ipc.invalidation.external.client.contrib.AndroidListener$AlarmReceiver"
|
||||
@@ -962,24 +918,6 @@ by a child template that "extends" this file.
|
||||
android:exported="false"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"/>
|
||||
|
||||
- <!-- Background Task Scheduler GCM task service -->
|
||||
- <service android:name="org.chromium.components.background_task_scheduler.BackgroundTaskGcmTaskService"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
|
||||
- android:exported="true">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
-
|
||||
- <!-- GcmTaskService implementation to wake Chrome on scheduled events -->
|
||||
- <service android:name="org.chromium.chrome.browser.ChromeBackgroundService"
|
||||
- android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
|
||||
- android:exported="true">
|
||||
- <intent-filter>
|
||||
- <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
|
||||
- </intent-filter>
|
||||
- </service>
|
||||
-
|
||||
<service android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService"
|
||||
android:exported="true"
|
||||
tools:ignore="ExportedService" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BackgroundSyncLauncher.java
|
||||
@@ -9,10 +9,6 @@ import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.StrictMode;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.OneoffTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -37,8 +33,6 @@ public class BackgroundSyncLauncher {
|
||||
// BackgroundSyncLauncherAndroid, if any. If it is non-null then the browser is running.
|
||||
private static BackgroundSyncLauncher sInstance;
|
||||
|
||||
- private GcmNetworkManager mScheduler;
|
||||
-
|
||||
/**
|
||||
* Disables the automatic use of the GCMNetworkManager. When disabled, the methods which
|
||||
* interact with GCM can still be used, but will not be called automatically on creation, or by
|
||||
@@ -123,6 +117,7 @@ public class BackgroundSyncLauncher {
|
||||
@VisibleForTesting
|
||||
@CalledByNative
|
||||
protected void launchBrowserIfStopped(final boolean shouldLaunch, final long minDelayMs) {
|
||||
+ /*
|
||||
mLaunchBrowserIfStoppedTask = new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
@@ -147,6 +142,7 @@ public class BackgroundSyncLauncher {
|
||||
}
|
||||
}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
+ */
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,7 +154,6 @@ public class BackgroundSyncLauncher {
|
||||
}
|
||||
|
||||
protected BackgroundSyncLauncher() {
|
||||
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
|
||||
launchBrowserIfStopped(false, 0);
|
||||
}
|
||||
|
||||
@@ -186,7 +181,7 @@ public class BackgroundSyncLauncher {
|
||||
}
|
||||
return !sGCMEnabled;
|
||||
}
|
||||
-
|
||||
+ /*
|
||||
private static boolean scheduleLaunchTask(GcmNetworkManager scheduler, long minDelayMs) {
|
||||
// Google Play Services may not be up to date, if the application was not installed through
|
||||
// the Play Store. In this case, scheduling the task will fail silently.
|
||||
@@ -229,7 +224,7 @@ public class BackgroundSyncLauncher {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
-
|
||||
+ */
|
||||
/**
|
||||
* Reschedule any required background sync tasks, if they have been removed due to an
|
||||
* application upgrade.
|
||||
@@ -239,6 +234,7 @@ public class BackgroundSyncLauncher {
|
||||
* This method is static so that it can be run without actually instantiating a
|
||||
* BackgroundSyncLauncher.
|
||||
*/
|
||||
+ /*
|
||||
protected static void rescheduleTasksOnUpgrade(final Context context) {
|
||||
final GcmNetworkManager scheduler = GcmNetworkManager.getInstance(context);
|
||||
BackgroundSyncLauncher.ShouldLaunchCallback callback = shouldLaunch -> {
|
||||
@@ -252,7 +248,7 @@ public class BackgroundSyncLauncher {
|
||||
};
|
||||
BackgroundSyncLauncher.shouldLaunchBrowserIfStopped(callback);
|
||||
}
|
||||
-
|
||||
+ */
|
||||
@VisibleForTesting
|
||||
static void setGCMEnabled(boolean enabled) {
|
||||
sGCMEnabled = enabled;
|
||||
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
|
||||
@@ -12,8 +12,6 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
|
||||
-import com.google.ipc.invalidation.ticl.android2.channel.AndroidGcmController;
|
||||
-
|
||||
import org.chromium.base.ApplicationState;
|
||||
import org.chromium.base.ApplicationStatus;
|
||||
import org.chromium.base.FieldTrialList;
|
||||
@@ -201,16 +199,7 @@ public class InvalidationController implements ApplicationStatus.ApplicationStat
|
||||
* Registers for Google Cloud Messaging (GCM) for Invalidations.
|
||||
*/
|
||||
private void ensureGcmIsInitialized() {
|
||||
- if (mGcmInitialized) return;
|
||||
- mGcmInitialized = true;
|
||||
- new AsyncTask<Void, Void, Void>() {
|
||||
- @Override
|
||||
- protected Void doInBackground(Void... arg0) {
|
||||
- boolean useGcmUpstream = true;
|
||||
- AndroidGcmController.get(mContext).initializeGcm(useGcmUpstream);
|
||||
- return null;
|
||||
- }
|
||||
- }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
+ mGcmInitialized = false;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
|
||||
@@ -7,15 +7,10 @@ package org.chromium.chrome.browser.ntp.snippets;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.PeriodicTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
-import org.chromium.chrome.browser.ChromeBackgroundService;
|
||||
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
|
||||
|
||||
/**
|
||||
@@ -40,8 +35,6 @@ public class SnippetsLauncher {
|
||||
// If it is non-null then the browser is running.
|
||||
private static SnippetsLauncher sInstance;
|
||||
|
||||
- private GcmNetworkManager mScheduler;
|
||||
-
|
||||
private boolean mGCMEnabled = true;
|
||||
|
||||
/**
|
||||
@@ -78,7 +71,6 @@ public class SnippetsLauncher {
|
||||
|
||||
protected SnippetsLauncher() {
|
||||
checkGCM();
|
||||
- mScheduler = GcmNetworkManager.getInstance(ContextUtils.getApplicationContext());
|
||||
}
|
||||
|
||||
private void checkGCM() {
|
||||
@@ -89,32 +81,7 @@ public class SnippetsLauncher {
|
||||
}
|
||||
}
|
||||
|
||||
- private static PeriodicTask buildFetchTask(
|
||||
- String tag, long periodSeconds, int requiredNetwork) {
|
||||
- // Add a bit of "flex" around the target period. This achieves the following:
|
||||
- // - It makes sure the task doesn't run (significantly) before its initial period has
|
||||
- // elapsed. In practice, the scheduler seems to behave like that anyway, but it doesn't
|
||||
- // guarantee that, so we shouldn't rely on it.
|
||||
- // - It gives the scheduler a bit of room to optimize for battery life.
|
||||
- long effectivePeriodSeconds = (long) (periodSeconds * (1.0 + FLEX_FACTOR));
|
||||
- long flexSeconds = (long) (periodSeconds * (2.0 * FLEX_FACTOR));
|
||||
- return new PeriodicTask.Builder()
|
||||
- .setService(ChromeBackgroundService.class)
|
||||
- .setTag(tag)
|
||||
- .setPeriod(effectivePeriodSeconds)
|
||||
- .setFlex(flexSeconds)
|
||||
- .setRequiredNetwork(requiredNetwork)
|
||||
- .setPersisted(true)
|
||||
- .setUpdateCurrent(true)
|
||||
- .build();
|
||||
- }
|
||||
-
|
||||
private void scheduleOrCancelFetchTask(String taskTag, long period, int requiredNetwork) {
|
||||
- if (period > 0) {
|
||||
- mScheduler.schedule(buildFetchTask(taskTag, period, requiredNetwork));
|
||||
- } else {
|
||||
- mScheduler.cancelTask(taskTag, ChromeBackgroundService.class);
|
||||
- }
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
@@ -127,23 +94,12 @@ public class SnippetsLauncher {
|
||||
.edit()
|
||||
.putBoolean(PREF_IS_SCHEDULED, isScheduled)
|
||||
.apply();
|
||||
-
|
||||
- // Google Play Services may not be up to date, if the application was not installed through
|
||||
- // the Play Store. In this case, scheduling the task will fail silently.
|
||||
- try {
|
||||
- scheduleOrCancelFetchTask(
|
||||
- TASK_TAG_WIFI, periodWifiSeconds, Task.NETWORK_STATE_UNMETERED);
|
||||
- scheduleOrCancelFetchTask(
|
||||
- TASK_TAG_FALLBACK, periodFallbackSeconds, Task.NETWORK_STATE_CONNECTED);
|
||||
- } catch (IllegalArgumentException e) {
|
||||
// Disable GCM for the remainder of this session.
|
||||
mGCMEnabled = false;
|
||||
|
||||
ContextUtils.getAppSharedPreferences().edit().remove(PREF_IS_SCHEDULED).apply();
|
||||
// Return false so that the failure will be logged.
|
||||
return false;
|
||||
- }
|
||||
- return true;
|
||||
}
|
||||
|
||||
@CalledByNative
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java
|
||||
@@ -39,8 +39,6 @@ public class GCMBackgroundTask implements BackgroundTask {
|
||||
Log.e(TAG, "The received bundle containing message data could not be validated.");
|
||||
return false;
|
||||
}
|
||||
-
|
||||
- ChromeGcmListenerService.dispatchMessageToDriver(context, new GCMMessage(extras));
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
|
||||
@@ -13,7 +13,6 @@ import android.os.Parcel;
|
||||
import android.support.annotation.MainThread;
|
||||
import android.util.Log;
|
||||
|
||||
-import com.google.android.gms.gcm.GoogleCloudMessaging;
|
||||
import com.google.ipc.invalidation.ticl.android2.channel.GcmUpstreamSenderService;
|
||||
|
||||
import org.chromium.base.ThreadUtils;
|
||||
@@ -92,6 +91,7 @@ public class InvalidationGcmUpstreamSender extends GcmUpstreamSenderService {
|
||||
* This function runs on a thread from the AsyncTask.THREAD_POOL_EXECUTOR.
|
||||
*/
|
||||
private void sendUpstreamMessage(String to, Bundle data, String token, Context context) {
|
||||
+ /*
|
||||
// Add the OAuth2 token to the bundle. The token should have the prefix Bearer added to it.
|
||||
data.putString("Authorization", "Bearer " + token);
|
||||
if (!isMessageWithinLimit(data)) {
|
||||
@@ -105,6 +105,7 @@ public class InvalidationGcmUpstreamSender extends GcmUpstreamSenderService {
|
||||
Log.w(TAG, "Send message failed");
|
||||
GcmUma.recordGcmUpstreamHistogram(context, GcmUma.UMA_UPSTREAM_SEND_FAILED);
|
||||
}
|
||||
+ */
|
||||
}
|
||||
|
||||
private boolean isMessageWithinLimit(Bundle data) {
|
||||
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
|
||||
--- a/chrome/android/java_sources.gni
|
||||
+++ b/chrome/android/java_sources.gni
|
||||
@@ -22,7 +22,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/ChromeActivity.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeApplication.java",
|
||||
- "java/src/org/chromium/chrome/browser/ChromeBackgroundService.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeBackupAgent.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
|
||||
"java/src/org/chromium/chrome/browser/ChromeFeatureList.java",
|
||||
@@ -1112,7 +1111,6 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java",
|
||||
"java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java",
|
||||
"java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java",
|
||||
- "java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java",
|
||||
"java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java",
|
||||
diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
|
||||
--- a/components/background_task_scheduler/BUILD.gn
|
||||
+++ b/components/background_task_scheduler/BUILD.gn
|
||||
@@ -23,7 +23,6 @@ if (is_android) {
|
||||
android_library("background_task_scheduler_java") {
|
||||
java_files = [
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTask.java",
|
||||
- "android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskGcmTaskService.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskJobService.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskReflection.java",
|
||||
"android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskScheduler.java",
|
||||
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
--- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java
|
||||
@@ -8,14 +8,6 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
-import com.google.android.gms.common.ConnectionResult;
|
||||
-import com.google.android.gms.common.GoogleApiAvailability;
|
||||
-import com.google.android.gms.gcm.GcmNetworkManager;
|
||||
-import com.google.android.gms.gcm.OneoffTask;
|
||||
-import com.google.android.gms.gcm.PeriodicTask;
|
||||
-import com.google.android.gms.gcm.Task;
|
||||
-import com.google.android.gms.gcm.TaskParams;
|
||||
-
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -33,7 +25,7 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
static final String BACKGROUND_TASK_CLASS_KEY = "_background_task_class";
|
||||
@VisibleForTesting
|
||||
static final String BACKGROUND_TASK_EXTRAS_KEY = "_background_task_extras";
|
||||
-
|
||||
+ /*
|
||||
static BackgroundTask getBackgroundTaskFromTaskParams(@NonNull TaskParams taskParams) {
|
||||
String backgroundTaskClassName = getBackgroundTaskClassFromTaskParams(taskParams);
|
||||
return BackgroundTaskReflection.getBackgroundTaskFromClassName(backgroundTaskClassName);
|
||||
@@ -44,7 +36,7 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
if (extras == null) return null;
|
||||
return extras.getString(BACKGROUND_TASK_CLASS_KEY);
|
||||
}
|
||||
-
|
||||
+ */
|
||||
/**
|
||||
* Retrieves the {@link TaskParameters} from the {@link TaskParams}, which are passed as
|
||||
* one of the keys. Only values valid for {@link android.os.BaseBundle} are supported, and other
|
||||
@@ -53,6 +45,8 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
* @param taskParams the {@link TaskParams} to extract the {@link TaskParameters} from.
|
||||
* @return the {@link TaskParameters} for the current job.
|
||||
*/
|
||||
+
|
||||
+ /*
|
||||
static TaskParameters getTaskParametersFromTaskParams(@NonNull TaskParams taskParams) {
|
||||
int taskId;
|
||||
try {
|
||||
@@ -132,6 +126,7 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
return Task.NETWORK_STATE_ANY;
|
||||
}
|
||||
|
||||
+ */
|
||||
@Override
|
||||
public boolean schedule(Context context, @NonNull TaskInfo taskInfo) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
@@ -142,6 +137,7 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
+ " has no parameterless public constructor.");
|
||||
return false;
|
||||
}
|
||||
+ /*
|
||||
|
||||
GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
|
||||
if (gcmNetworkManager == null) {
|
||||
@@ -158,14 +154,15 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
"GcmNetworkManager failed to schedule task, gcm message: " + gcmErrorMessage);
|
||||
return false;
|
||||
}
|
||||
-
|
||||
- return true;
|
||||
+ */
|
||||
+ return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(Context context, int taskId) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
|
||||
+ /*
|
||||
GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
|
||||
if (gcmNetworkManager == null) {
|
||||
Log.e(TAG, "GcmNetworkManager is not available.");
|
||||
@@ -178,14 +175,7 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.e(TAG, "GcmNetworkManager failed to cancel task.");
|
||||
}
|
||||
- }
|
||||
-
|
||||
- private GcmNetworkManager getGcmNetworkManager(Context context) {
|
||||
- if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
|
||||
- == ConnectionResult.SUCCESS) {
|
||||
- return GcmNetworkManager.getInstance(context);
|
||||
- }
|
||||
- return null;
|
||||
+ */
|
||||
}
|
||||
|
||||
private static String taskIdToTaskTag(int taskId) {
|
||||
diff --git a/components/gcm_driver/android/BUILD.gn b/components/gcm_driver/android/BUILD.gn
|
||||
--- a/components/gcm_driver/android/BUILD.gn
|
||||
+++ b/components/gcm_driver/android/BUILD.gn
|
||||
@@ -15,7 +15,6 @@ android_library("gcm_driver_java") {
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//content/public/android:content_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/jsr-305:jsr_305_javalib",
|
||||
]
|
||||
|
||||
diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
--- a/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
+++ b/components/gcm_driver/instance_id/android/BUILD.gn
|
||||
@@ -26,7 +26,6 @@ android_library("instance_id_driver_java") {
|
||||
|
||||
java_files = [
|
||||
"java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java",
|
||||
- "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java",
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
--- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
+++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
|
||||
@@ -26,7 +26,6 @@ public class InstanceIDBridge {
|
||||
* Underlying InstanceIDWithSubtype. May be shared by multiple InstanceIDBridges. Must be
|
||||
* initialized on a background thread.
|
||||
*/
|
||||
- private InstanceIDWithSubtype mInstanceID;
|
||||
|
||||
private static boolean sBlockOnAsyncTasksForTesting;
|
||||
|
||||
@@ -71,7 +70,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<String>() {
|
||||
@Override
|
||||
protected String doBackgroundWork() {
|
||||
- return mInstanceID.getId();
|
||||
+ return "";
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(String id) {
|
||||
@@ -86,7 +85,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Long>() {
|
||||
@Override
|
||||
protected Long doBackgroundWork() {
|
||||
- return mInstanceID.getCreationTime();
|
||||
+ return 0L;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Long creationTime) {
|
||||
@@ -107,11 +106,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<String>() {
|
||||
@Override
|
||||
protected String doBackgroundWork() {
|
||||
- try {
|
||||
- return mInstanceID.getToken(authorizedEntity, scope, extras);
|
||||
- } catch (IOException ex) {
|
||||
- return "";
|
||||
- }
|
||||
+ return "";
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(String token) {
|
||||
@@ -127,12 +122,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean doBackgroundWork() {
|
||||
- try {
|
||||
- mInstanceID.deleteToken(authorizedEntity, scope);
|
||||
- return true;
|
||||
- } catch (IOException ex) {
|
||||
- return false;
|
||||
- }
|
||||
+ return true;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Boolean success) {
|
||||
@@ -147,12 +137,7 @@ public class InstanceIDBridge {
|
||||
new BridgeAsyncTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean doBackgroundWork() {
|
||||
- try {
|
||||
- mInstanceID.deleteInstanceID();
|
||||
- return true;
|
||||
- } catch (IOException ex) {
|
||||
- return false;
|
||||
- }
|
||||
+ return true;
|
||||
}
|
||||
@Override
|
||||
protected void sendResultToNative(Boolean success) {
|
||||
@@ -192,10 +177,6 @@ public class InstanceIDBridge {
|
||||
@SuppressWarnings("NoSynchronizedThisCheck") // Only used/accessible by native.
|
||||
protected Result doInBackground(Void... params) {
|
||||
synchronized (InstanceIDBridge.this) {
|
||||
- if (mInstanceID == null) {
|
||||
- mInstanceID = InstanceIDWithSubtype.getInstance(
|
||||
- ContextUtils.getApplicationContext(), mSubtype);
|
||||
- }
|
||||
}
|
||||
return doBackgroundWork();
|
||||
}
|
||||
diff --git a/components/sync/android/BUILD.gn b/components/sync/android/BUILD.gn
|
||||
--- a/components/sync/android/BUILD.gn
|
||||
+++ b/components/sync/android/BUILD.gn
|
||||
@@ -10,7 +10,6 @@ android_library("sync_java") {
|
||||
"//base:base_java",
|
||||
"//components/signin/core/browser/android:java",
|
||||
"//net/android:net_java",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
"//third_party/android_tools:android_support_annotations_java",
|
||||
"//third_party/cacheinvalidation:cacheinvalidation_javalib",
|
||||
"//third_party/cacheinvalidation:cacheinvalidation_proto_java",
|
||||
diff --git a/third_party/cacheinvalidation/BUILD.gn b/third_party/cacheinvalidation/BUILD.gn
|
||||
--- a/third_party/cacheinvalidation/BUILD.gn
|
||||
+++ b/third_party/cacheinvalidation/BUILD.gn
|
||||
@@ -141,7 +141,6 @@ if (is_android) {
|
||||
"$google_play_services_package:google_play_services_iid_java",
|
||||
"$google_play_services_package:google_play_services_tasks_java",
|
||||
"//third_party/android_protobuf:protobuf_nano_javalib",
|
||||
- "//third_party/android_tools:android_gcm_java",
|
||||
]
|
||||
|
||||
java_files = [
|
||||
@@ -207,13 +206,8 @@ if (is_android) {
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/WakeLockManager.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelConstants.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidChannelPreferences.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidGcmController.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidInstanceIDListenerService.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/CommonUtils.java",
|
||||
- "src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/android2/channel/GcmUpstreamSenderService.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/proto/AndroidChannel.java",
|
||||
"src/java/com/google/ipc/invalidation/ticl/proto/AndroidListenerProtocol.java",
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package com.google.ipc.invalidation.external.client.contrib;
|
||||
|
||||
-import com.google.android.gcm.GCMBaseIntentService;
|
||||
-import com.google.android.gcm.GCMBroadcastReceiver;
|
||||
-import com.google.android.gcm.GCMRegistrar;
|
||||
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
|
||||
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
|
||||
import com.google.ipc.invalidation.ticl.android2.WakeLockManager;
|
||||
@@ -69,7 +66,7 @@ import android.content.pm.ServiceInfo;
|
||||
* there is nothing to do except log an error (which this class does).
|
||||
*
|
||||
*/
|
||||
-public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
+public class MultiplexingGcmListener {
|
||||
/* This class is public so that it can be instantiated by the Android runtime. */
|
||||
|
||||
/** Constants used in broadcast Intents. */
|
||||
@@ -106,18 +103,6 @@ public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
}
|
||||
|
||||
/**
|
||||
- * {@link GCMBroadcastReceiver} that forwards GCM intents to the {@code MultiplexingGcmListener}
|
||||
- * class.
|
||||
- */
|
||||
- public static class GCMReceiver extends GCMBroadcastReceiver {
|
||||
- /* This class is public so that it can be instantiated by the Android runtime. */
|
||||
- @Override
|
||||
- protected String getGCMIntentServiceClassName(Context context) {
|
||||
- return MultiplexingGcmListener.class.getName();
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
* Convenience base class for client implementations. It provides base classes for a broadcast
|
||||
* receiver and an intent service that work together to handle events from the
|
||||
* {@code MultiplexingGcmListener} while holding a wake lock.
|
||||
@@ -261,7 +246,7 @@ public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
private static final Logger logger = AndroidLogger.forTag("MplexGcmListener");
|
||||
|
||||
// All onYYY methods work by constructing an appropriate Intent and broadcasting it.
|
||||
-
|
||||
+ /*
|
||||
@Override
|
||||
protected void onMessage(Context context, Intent intent) {
|
||||
Intent newIntent = new Intent();
|
||||
@@ -304,35 +289,7 @@ public class MultiplexingGcmListener extends GCMBaseIntentService {
|
||||
protected String[] getSenderIds(Context context) {
|
||||
return readSenderIdsFromManifestOrDie(this);
|
||||
}
|
||||
-
|
||||
- /**
|
||||
- * Broadcasts {@code intent} with the action set to {@link Intents#ACTION} and the package name
|
||||
- * set to the package name of this service.
|
||||
- */
|
||||
- private void rebroadcast(Intent intent) {
|
||||
- intent.setAction(Intents.ACTION);
|
||||
- intent.setPackage(getPackageName());
|
||||
- sendBroadcast(intent);
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Registers with GCM if not already registered. Also verifies that the device supports GCM
|
||||
- * and that the manifest is correctly configured. Returns the existing registration id, if one
|
||||
- * exists, or the empty string if one does not.
|
||||
- *
|
||||
- * @throws UnsupportedOperationException if the device does not have all GCM dependencies
|
||||
- * @throws IllegalStateException if the manifest is not correctly configured
|
||||
- */
|
||||
- public static String initializeGcm(Context context) {
|
||||
- AndroidChannelPreferences.setGcmChannelType(context, GcmChannelType.DEFAULT);
|
||||
- GCMRegistrar.checkDevice(context);
|
||||
- GCMRegistrar.checkManifest(context);
|
||||
- final String regId = GCMRegistrar.getRegistrationId(context);
|
||||
- if (regId.isEmpty()) {
|
||||
- GCMRegistrar.register(context, readSenderIdsFromManifestOrDie(context));
|
||||
- }
|
||||
- return regId;
|
||||
- }
|
||||
+ */
|
||||
|
||||
/**
|
||||
* Returns the GCM sender ids from {@link #GCM_SENDER_IDS_METADATA_KEY} or throws a
|
||||
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java
|
||||
@@ -48,16 +48,12 @@ public class AndroidNetworkChannel implements TestableNetworkChannel {
|
||||
Intent intent = ProtocolIntents.newOutboundMessageIntent(outgoingMessage);
|
||||
|
||||
// Select the sender service to use for upstream message.
|
||||
- if (AndroidChannelPreferences.getGcmChannelType(context) == GcmChannelType.GCM_UPSTREAM){
|
||||
- String upstreamServiceClass = new AndroidTiclManifest(context).getGcmUpstreamServiceClass();
|
||||
- if (upstreamServiceClass == null || upstreamServiceClass.isEmpty()) {
|
||||
- logger.warning("GcmUpstreamSenderService class not found.");
|
||||
- return;
|
||||
- }
|
||||
- intent.setClassName(context, upstreamServiceClass);
|
||||
- } else {
|
||||
- intent.setClassName(context, AndroidMessageSenderService.class.getName());
|
||||
- }
|
||||
+ String upstreamServiceClass = new AndroidTiclManifest(context).getGcmUpstreamServiceClass();
|
||||
+ if (upstreamServiceClass == null || upstreamServiceClass.isEmpty()) {
|
||||
+ logger.warning("GcmUpstreamSenderService class not found.");
|
||||
+ return;
|
||||
+ }
|
||||
+ intent.setClassName(context, upstreamServiceClass);
|
||||
try {
|
||||
context.startService(intent);
|
||||
} catch (IllegalStateException exception) {
|
||||
@@ -77,6 +73,6 @@ public class AndroidNetworkChannel implements TestableNetworkChannel {
|
||||
|
||||
@Override
|
||||
public NetworkEndpointId getNetworkIdForTest() {
|
||||
- return AndroidMessageSenderService.getNetworkEndpointId(context, resources.getLogger());
|
||||
+ return null;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:06:15 +0200
|
||||
Subject: kill Auth
|
||||
|
||||
---
|
||||
.../org/chromium/chrome/browser/signin/SigninHelper.java | 6 ++----
|
||||
.../org/chromium/components/signin/AccountIdProvider.java | 9 +--------
|
||||
.../components/signin/SystemAccountManagerDelegate.java | 15 +++++++++------
|
||||
3 files changed, 12 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
|
||||
@@ -9,10 +9,6 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
-import com.google.android.gms.auth.AccountChangeEvent;
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
-
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
@@ -71,6 +67,7 @@ public class SigninHelper {
|
||||
@Override
|
||||
public List<String> getAccountChangeEvents(
|
||||
Context context, int index, String accountName) {
|
||||
+ /*
|
||||
try {
|
||||
List<AccountChangeEvent> list = GoogleAuthUtil.getAccountChangeEvents(
|
||||
context, index, accountName);
|
||||
@@ -88,6 +85,7 @@ public class SigninHelper {
|
||||
} catch (GoogleAuthException e) {
|
||||
Log.w(TAG, "Failed to get change events", e);
|
||||
}
|
||||
+ */
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
}
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
package org.chromium.components.signin;
|
||||
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
@@ -40,12 +38,7 @@ public class AccountIdProvider {
|
||||
* @param accountName The email address of a Google account.
|
||||
*/
|
||||
public String getAccountId(String accountName) {
|
||||
- try {
|
||||
- return GoogleAuthUtil.getAccountId(ContextUtils.getApplicationContext(), accountName);
|
||||
- } catch (IOException | GoogleAuthException ex) {
|
||||
- Log.e("cr.AccountIdProvider", "AccountIdProvider.getAccountId", ex);
|
||||
- return null;
|
||||
- }
|
||||
+ return null;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
|
||||
@@ -23,9 +23,6 @@ import android.os.PatternMatcher;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
|
||||
-import com.google.android.gms.auth.GoogleAuthException;
|
||||
-import com.google.android.gms.auth.GoogleAuthUtil;
|
||||
-import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
@@ -116,9 +113,9 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
// so don't report any accounts if Google Play Services are out of date.
|
||||
checkCanUseGooglePlayServices();
|
||||
|
||||
- if (!hasGetAccountsPermission()) {
|
||||
- return new Account[] {};
|
||||
- }
|
||||
+ return new Account[] {};
|
||||
+
|
||||
+ /*
|
||||
long now = SystemClock.elapsedRealtime();
|
||||
Account[] accounts = mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
|
||||
long elapsed = SystemClock.elapsedRealtime() - now;
|
||||
@@ -128,12 +125,15 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
"Signin.AndroidGetAccountsTimeUiThread_AccountManager", elapsed);
|
||||
}
|
||||
return accounts;
|
||||
+ */
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthToken(Account account, String authTokenScope) throws AuthException {
|
||||
assert !ThreadUtils.runningOnUiThread();
|
||||
assert AccountManagerFacade.GOOGLE_ACCOUNT_TYPE.equals(account.type);
|
||||
+ return null;
|
||||
+ /*
|
||||
try {
|
||||
return GoogleAuthUtil.getTokenWithNotification(
|
||||
ContextUtils.getApplicationContext(), account, authTokenScope, null);
|
||||
@@ -145,10 +145,12 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
} catch (IOException ex) {
|
||||
throw new AuthException(AuthException.TRANSIENT, ex);
|
||||
}
|
||||
+ */
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateAuthToken(String authToken) throws AuthException {
|
||||
+ /*
|
||||
try {
|
||||
GoogleAuthUtil.clearToken(ContextUtils.getApplicationContext(), authToken);
|
||||
} catch (GooglePlayServicesAvailabilityException ex) {
|
||||
@@ -158,6 +160,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
|
||||
} catch (IOException ex) {
|
||||
throw new AuthException(AuthException.TRANSIENT, ex);
|
||||
}
|
||||
+ */
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:13:38 +0200
|
||||
Subject: kill remaining Play Services checks
|
||||
|
||||
---
|
||||
.../chromium/chrome/browser/ChromeVersionInfo.java | 10 +-----
|
||||
.../browser/externalauth/ExternalAuthUtils.java | 41 ++--------------------
|
||||
.../externalauth/UserRecoverableErrorHandler.java | 10 ------
|
||||
.../chrome/browser/omaha/UpdateMenuItemHelper.java | 10 +-----
|
||||
chrome/android/java_sources.gni | 3 --
|
||||
.../components/signin/AccountIdProvider.java | 10 +-----
|
||||
.../signin/GmsAvailabilityException.java | 4 +--
|
||||
.../signin/SystemAccountManagerDelegate.java | 15 +-------
|
||||
.../shape_detection/FaceDetectionProviderImpl.java | 8 +----
|
||||
9 files changed, 9 insertions(+), 102 deletions(-)
|
||||
|
||||
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;
|
||||
@@ -88,7 +86,7 @@ public class ChromeVersionInfo {
|
||||
public static String getGmsInfo() {
|
||||
Context context = ContextUtils.getApplicationContext();
|
||||
|
||||
- final long sdkVersion = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
|
||||
+ final long sdkVersion = 0L;
|
||||
final long installedGmsVersion = getPlayServicesApkVersionNumber(context);
|
||||
|
||||
final String accessType;
|
||||
@@ -105,12 +103,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;
|
||||
- }
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -15,9 +15,6 @@ import android.os.SystemClock;
|
||||
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.ContextUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
@@ -164,12 +161,7 @@ public class ExternalAuthUtils {
|
||||
* when it is updating.
|
||||
*/
|
||||
public boolean isGooglePlayServicesMissing(final Context context) {
|
||||
- final int resultCode = checkGooglePlayServicesAvailable(context);
|
||||
- if (resultCode == ConnectionResult.SERVICE_MISSING
|
||||
- || resultCode == ConnectionResult.SERVICE_INVALID) {
|
||||
return true;
|
||||
- }
|
||||
- return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,23 +176,6 @@ public class ExternalAuthUtils {
|
||||
* @return true if and only if Google Play Services can be used
|
||||
*/
|
||||
public boolean canUseGooglePlayServices(final UserRecoverableErrorHandler errorHandler) {
|
||||
- Context context = ContextUtils.getApplicationContext();
|
||||
- final int resultCode = checkGooglePlayServicesAvailable(context);
|
||||
- recordConnectionResult(resultCode);
|
||||
- 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)) {
|
||||
- Runnable errorHandlerTask = new Runnable() {
|
||||
- @Override
|
||||
- public void run() {
|
||||
- errorHandler.handleError(context, resultCode);
|
||||
- }
|
||||
- };
|
||||
- ThreadUtils.runOnUiThread(errorHandlerTask);
|
||||
- }
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -262,17 +237,7 @@ public class ExternalAuthUtils {
|
||||
* @return The code produced by calling the external code
|
||||
*/
|
||||
protected int checkGooglePlayServicesAvailable(final Context context) {
|
||||
- // Temporarily allowing disk access. TODO: Fix. See http://crbug.com/577190
|
||||
- StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
|
||||
- try {
|
||||
- long time = SystemClock.elapsedRealtime();
|
||||
- int isAvailable =
|
||||
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
|
||||
- mRegistrationTimeHistogramSample.record(SystemClock.elapsedRealtime() - time);
|
||||
- return isAvailable;
|
||||
- } finally {
|
||||
- StrictMode.setThreadPolicy(oldPolicy);
|
||||
- }
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,7 +248,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,6 +258,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;
|
||||
import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample;
|
||||
@@ -113,7 +111,6 @@ public abstract class UserRecoverableErrorHandler {
|
||||
.record(ERROR_HANDLER_ACTION_IGNORED_AS_REDUNDANT);
|
||||
return;
|
||||
}
|
||||
- GoogleApiAvailability.getInstance().showErrorNotification(context, errorCode);
|
||||
sErrorHandlerActionHistogramSample.record(ERROR_HANDLER_ACTION_SYSTEM_NOTIFICATION);
|
||||
}
|
||||
}
|
||||
@@ -206,13 +203,6 @@ public abstract class UserRecoverableErrorHandler {
|
||||
if (mErrorCode != errorCode) {
|
||||
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()) {
|
||||
mDialog.setCancelable(mCancelable);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
|
||||
@@ -22,8 +22,6 @@ import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
|
||||
-import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
-
|
||||
import org.chromium.base.CommandLine;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
@@ -161,13 +159,7 @@ public class UpdateMenuItemHelper {
|
||||
}
|
||||
|
||||
private static boolean isGooglePlayStoreAvailable(Context context) {
|
||||
- try {
|
||||
- context.getPackageManager().getPackageInfo(
|
||||
- GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
|
||||
- } catch (PackageManager.NameNotFoundException e) {
|
||||
- return false;
|
||||
- }
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
|
||||
--- a/chrome/android/java_sources.gni
|
||||
+++ b/chrome/android/java_sources.gni
|
||||
@@ -485,10 +485,7 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java",
|
||||
"java/src/org/chromium/chrome/browser/fullscreen/FullscreenManager.java",
|
||||
"java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClient.java",
|
||||
- "java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java",
|
||||
"java/src/org/chromium/chrome/browser/gcore/ConnectedTask.java",
|
||||
- "java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java",
|
||||
- "java/src/org/chromium/chrome/browser/gcore/LifecycleHook.java",
|
||||
"java/src/org/chromium/chrome/browser/gsa/ContextReporter.java",
|
||||
"java/src/org/chromium/chrome/browser/gsa/GSAAccountChangeListener.java",
|
||||
"java/src/org/chromium/chrome/browser/gsa/GSAContextDisplaySelection.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 unused = 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/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/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
|
||||
@@ -23,9 +23,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: CFOSS",0);
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
||||
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
|
||||
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.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.mojo.bindings.InterfaceRequest;
|
||||
import org.chromium.mojo.system.MojoException;
|
||||
@@ -24,10 +21,7 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
|
||||
@Override
|
||||
public void createFaceDetection(
|
||||
InterfaceRequest<FaceDetection> request, FaceDetectorOptions options) {
|
||||
- final boolean isGmsCoreSupported =
|
||||
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
|
||||
- ContextUtils.getApplicationContext())
|
||||
- == ConnectionResult.SUCCESS;
|
||||
+ final boolean isGmsCoreSupported = false;
|
||||
|
||||
if (isGmsCoreSupported) {
|
||||
//FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:16:07 +0200
|
||||
Subject: kill TOS and metrics opt-out
|
||||
|
||||
---
|
||||
chrome/android/java/res/layout/fre_tosanduma.xml | 3 ++-
|
||||
.../src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java | 2 +-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/fre_tosanduma.xml b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
--- a/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
+++ b/chrome/android/java/res/layout/fre_tosanduma.xml
|
||||
@@ -62,7 +62,8 @@
|
||||
android:layout_marginBottom="@dimen/fre_vertical_spacing"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1.4"
|
||||
- android:textAppearance="@style/BlackBodyDefault" />
|
||||
+ android:textAppearance="@style/BlackBodyDefault"
|
||||
+ android:visibility="gone" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/send_report_checkbox"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
|
||||
@@ -36,7 +36,7 @@ public abstract class FirstRunActivityBase extends AsyncInitializationActivity {
|
||||
public static final String EXTRA_FIRST_RUN_ACTIVITY_RESULT = "Extra.FreActivityResult";
|
||||
public static final String EXTRA_FIRST_RUN_COMPLETE = "Extra.FreComplete";
|
||||
|
||||
- public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = true;
|
||||
+ public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = false;
|
||||
|
||||
private boolean mNativeInitialized;
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From: thermatk <thermatk@thermatk.com>
|
||||
Date: Fri, 22 Jun 2018 17:16:43 +0200
|
||||
Subject: kill Translate(doesn't work)
|
||||
|
||||
---
|
||||
chrome/android/java/res/xml/languages_preferences.xml | 3 ++-
|
||||
.../src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java | 2 ++
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/languages_preferences.xml b/chrome/android/java/res/xml/languages_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/languages_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/languages_preferences.xml
|
||||
@@ -14,6 +14,7 @@
|
||||
<org.chromium.chrome.browser.preferences.ChromeSwitchPreference
|
||||
android:key="translate_switch"
|
||||
android:summaryOn="@string/languages_offer_translate_switch"
|
||||
- android:summaryOff="@string/languages_offer_translate_switch" />
|
||||
+ android:summaryOff="@string/languages_offer_translate_switch"
|
||||
+ android:enabled="false" />
|
||||
|
||||
</PreferenceScreen>
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
|
||||
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.metrics.UmaUtils;
|
||||
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils;
|
||||
import org.chromium.chrome.browser.preferences.datareduction.DataReductionProxyUma;
|
||||
+import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
||||
import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider;
|
||||
import org.chromium.ui.base.LocalizationUtils;
|
||||
@@ -142,6 +143,7 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa
|
||||
if (mFreProperties.getBoolean(SHOW_DATA_REDUCTION_PAGE)) {
|
||||
mFreProgressStates.add(FRE_PROGRESS_DATA_SAVER_SHOWN);
|
||||
notifyAdapter = true;
|
||||
+ PrefServiceBridge.getInstance().setTranslateEnabled(false);
|
||||
}
|
||||
|
||||
// An optional page to select a default search engine.
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Wed, 2 May 2018 01:24:39 +0200
|
||||
Subject: Add Always Incognito option
|
||||
|
||||
---
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 12 ++++++++
|
||||
chrome/android/java/res/menu/main_menu.xml | 12 ++++++++
|
||||
.../chromium/chrome/browser/ChromeActivity.java | 4 +++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 4 +++
|
||||
.../org/chromium/chrome/browser/IntentHandler.java | 8 ++---
|
||||
.../chrome/browser/LaunchIntentDispatcher.java | 7 +++++
|
||||
.../browser/appmenu/AppMenuPropertiesDelegate.java | 35 ++++++++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 2 ++
|
||||
.../browser/preferences/PrefServiceBridge.java | 17 +++++++++++
|
||||
.../java/strings/android_chrome_strings.grd | 10 +++++++
|
||||
10 files changed, 106 insertions(+), 5 deletions(-)
|
||||
|
||||
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
|
||||
@@ -62,6 +62,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_always_incognito_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_always_incognito_id"
|
||||
+ android:title="@string/menu_enable_always_incognito" />
|
||||
+ <item android:id="@+id/enable_always_incognito_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null"
|
||||
android:orderInCategory="2">
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -72,6 +72,18 @@
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
+ <item android:id="@+id/enable_always_incognito_row_menu_id"
|
||||
+ android:title="@null"
|
||||
+ android:orderInCategory="2">
|
||||
+ <menu>
|
||||
+ <item android:id="@+id/enable_always_incognito_id"
|
||||
+ android:title="@string/menu_enable_always_incognito" />
|
||||
+ <item android:id="@+id/enable_always_incognito_check_id"
|
||||
+ android:title="@null"
|
||||
+ android:checkable="true" />
|
||||
+ </menu>
|
||||
+ </item>
|
||||
+
|
||||
<item android:id="@+id/request_desktop_site_row_menu_id"
|
||||
android:title="@null">
|
||||
<menu>
|
||||
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
|
||||
@@ -1905,6 +1905,10 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
RecordUserAction.record("MobileMenuSettings");
|
||||
} else if (id == R.id.show_menu) {
|
||||
showAppMenuForKeyboardEvent();
|
||||
+ } else if (id == R.id.enable_always_incognito_id || id == R.id.enable_always_incognito_check_id) {
|
||||
+ final boolean alwaysIncognito = PrefServiceBridge.getInstance().alwaysIncognitoEnabled();
|
||||
+ PrefServiceBridge.getInstance().setAlwaysIncognitoEnabled(!alwaysIncognito);
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableAlwaysIncognito");
|
||||
} else if (id == R.id.find_in_page_id) {
|
||||
if (mFindToolbarManager == null) return false;
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/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
|
||||
@@ -1753,6 +1753,10 @@ public class ChromeTabbedActivity
|
||||
reportNewTabShortcutUsed(true);
|
||||
getTabCreator(true).launchNTP();
|
||||
}
|
||||
+ } else if (id == R.id.enable_always_incognito_id || id == R.id.enable_always_incognito_check_id) {
|
||||
+ final boolean alwaysIncognito = PrefServiceBridge.getInstance().alwaysIncognitoEnabled();
|
||||
+ PrefServiceBridge.getInstance().setAlwaysIncognitoEnabled(!alwaysIncognito);
|
||||
+ RecordUserAction.record("MobileMenuRequestEnableAlwaysIncognito");
|
||||
} 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/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
|
||||
@@ -732,7 +732,6 @@ public class IntentHandler {
|
||||
// Determine if this intent came from a trustworthy source (either Chrome or Google
|
||||
// first party applications).
|
||||
boolean isInternal = isIntentChromeOrFirstParty(intent);
|
||||
- boolean isFromChrome = wasIntentSenderChrome(intent);
|
||||
|
||||
// "Open new incognito tab" is currently limited to Chrome.
|
||||
//
|
||||
@@ -741,11 +740,10 @@ public class IntentHandler {
|
||||
// from the list. In this case, we do not apply our Chrome token as the user has the
|
||||
// option to select apps outside of our control, so we rely on this in memory check
|
||||
// instead.
|
||||
- if (!isFromChrome
|
||||
- && IntentUtils.safeGetBooleanExtra(
|
||||
+ if (IntentUtils.safeGetBooleanExtra(
|
||||
intent, EXTRA_OPEN_NEW_INCOGNITO_TAB, false)
|
||||
- && (getPendingIncognitoUrl() == null
|
||||
- || !getPendingIncognitoUrl().equals(intent.getDataString()))) {
|
||||
+ && getPendingIncognitoUrl() != null
|
||||
+ && getPendingIncognitoUrl().equals(intent.getDataString())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
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
|
||||
@@ -36,6 +36,7 @@ import org.chromium.chrome.browser.instantapps.InstantAppsHandler;
|
||||
import org.chromium.chrome.browser.metrics.MediaNotificationUma;
|
||||
import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
|
||||
import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
|
||||
+import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
||||
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
|
||||
import org.chromium.chrome.browser.searchwidget.SearchActivity;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
@@ -185,6 +186,12 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
boolean incognito =
|
||||
mIntent.getBooleanExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false);
|
||||
|
||||
+ if (!incognito) {
|
||||
+ incognito = PrefServiceBridge.getInstance().alwaysIncognitoEnabled();
|
||||
+ if (incognito) {
|
||||
+ mIntent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true);
|
||||
+ }
|
||||
+ }
|
||||
// Check if a web search Intent is being handled.
|
||||
IntentHandler intentHandler = new IntentHandler(this, mActivity.getPackageName());
|
||||
String url = IntentHandler.getUrlFromIntent(mIntent);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -211,6 +211,8 @@ public class AppMenuPropertiesDelegate {
|
||||
&& !TextUtils.isEmpty(url);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
|
||||
|
||||
+ updateEnableAlwaysIncognitoMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
@@ -410,6 +412,39 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Updates the enable Always Incognito item's state.
|
||||
+ *
|
||||
+ * @param menu {@link Menu} for enable always incognito
|
||||
+ * @param currentTab Current tab being displayed.
|
||||
+ */
|
||||
+ protected void updateEnableAlwaysIncognitoMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem enableMenuRow = menu.findItem(R.id.enable_always_incognito_row_menu_id);
|
||||
+ MenuItem enableMenuLabel = menu.findItem(R.id.enable_always_incognito_id);
|
||||
+ MenuItem enableMenuCheck = menu.findItem(R.id.enable_always_incognito_check_id);
|
||||
+
|
||||
+ // Hide enable always incognito on all chrome:// pages and the NTP.
|
||||
+ String url = currentTab.getUrl();
|
||||
+ boolean isChromeScheme = url.startsWith(UrlConstants.CHROME_URL_PREFIX)
|
||||
+ || url.startsWith(UrlConstants.CHROME_NATIVE_URL_PREFIX);
|
||||
+
|
||||
+ boolean itemVisible = !isChromeScheme && !currentTab.isNativePage();
|
||||
+ enableMenuRow.setVisible(itemVisible);
|
||||
+ if (!itemVisible) return;
|
||||
+
|
||||
+ boolean alwaysIncognito = PrefServiceBridge.getInstance().alwaysIncognitoEnabled();
|
||||
+
|
||||
+ // Mark the checkbox if always incognito is activated on this tab.
|
||||
+ enableMenuCheck.setChecked(alwaysIncognito);
|
||||
+
|
||||
+ // 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(alwaysIncognito
|
||||
+ ? mActivity.getString(R.string.menu_enable_always_incognito_on)
|
||||
+ : mActivity.getString(R.string.menu_enable_always_incognito_off));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* Updates the request desktop site item's state.
|
||||
*
|
||||
* @param menu {@link Menu} for request desktop site.
|
||||
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
|
||||
@@ -163,6 +163,8 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
}
|
||||
|
||||
+ updateEnableAlwaysIncognitoMenuItem(menu, currentTab);
|
||||
+
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
updateEnableJavascriptMenuItem(menu, currentTab);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
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
|
||||
@@ -57,6 +57,8 @@ public class PrefServiceBridge {
|
||||
private static final String CONTEXTUAL_SEARCH_DISABLED = "false";
|
||||
private static final String CONTEXTUAL_SEARCH_ENABLED = "true";
|
||||
|
||||
+ private static boolean alwaysIncognito = false;
|
||||
+
|
||||
/**
|
||||
* Structure that holds all the version information about the current Chrome browser.
|
||||
*/
|
||||
@@ -359,6 +361,14 @@ public class PrefServiceBridge {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @return true if always-incognito is enabled.
|
||||
+ * The default is false.
|
||||
+ */
|
||||
+ public boolean alwaysIncognitoEnabled() {
|
||||
+ return alwaysIncognito;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* @return true if background sync is managed by policy.
|
||||
*/
|
||||
public boolean isBackgroundSyncManaged() {
|
||||
@@ -422,6 +432,13 @@ public class PrefServiceBridge {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Enable or disable always-incognito mode.
|
||||
+ */
|
||||
+ public void setAlwaysIncognitoEnabled(boolean enabled) {
|
||||
+ alwaysIncognito = enabled;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
* Enable or disable background sync.
|
||||
*/
|
||||
public void setBackgroundSyncEnabled(boolean enabled) {
|
||||
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
|
||||
@@ -2502,6 +2502,16 @@ To obtain new licenses, connect to the internet and play your downloaded content
|
||||
Turn on JavaScript
|
||||
</message>
|
||||
|
||||
+ <message name="IDS_MENU_ENABLE_ALWAYS_INCOGNITO" desc="Menu item in Chrome's overflow/options menu. If this menu item is selected, Bromite will always open new pages in incognito mode. [CHAR-LIMIT=27]">
|
||||
+ Always Incognito
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ALWAYS_INCOGNITO_ON" desc="Accessibility description for when Always Incognito is selected.">
|
||||
+ Turn off Always Incognito
|
||||
+ </message>
|
||||
+ <message name="IDS_MENU_ENABLE_ALWAYS_INCOGNITO_OFF" desc="Accessibility description for when Enable Always Incognito is unselected.">
|
||||
+ Turn on Always Incognito
|
||||
+ </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.7.4
|
||||
|
||||
@@ -0,0 +1,974 @@
|
||||
commit 56ab68688e7d2c7734e6190bf602dd584eae3222
|
||||
Author: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat Dec 9 23:03:50 2017 +0100
|
||||
|
||||
Incognito-only mode ported from CAF
|
||||
Some rework was needed, almost nothing applied cleanly.
|
||||
See below for the description of the two commits that were merged in this one.
|
||||
|
||||
Browser setting to switch to incognito only mode
|
||||
|
||||
- Added a setting to switch to incognito only mode in
|
||||
privacy settings
|
||||
- Upon enabling or disabling the switch, the browser will
|
||||
restart in the respective mode (regular or incognito only)
|
||||
|
||||
Change-Id: Ic42daa3e9bfdc0fcb4029d9df16ed57c5776d966
|
||||
|
||||
Fix issues seen in full incognito mode
|
||||
|
||||
- Fixes crashes seen in incognito mode.
|
||||
- Allow Custom Tabs, Web Apps to use the incognito only mode.
|
||||
- Ensure we notify the user of the incognito mode in the notification bar and remove the notification when all
|
||||
incognito tabs are closed.
|
||||
- Ensure the status bar for Custom Tabs and Web Apps are grey to give a visual notification to use.
|
||||
- Ensure the tabs are correctly ref counted for Custom Tabs, Web Apps when using incognito only mode.
|
||||
|
||||
CR-Fixed: SWE-8867, SWE-8802
|
||||
|
||||
Change-Id: I95a77016e7562d82359c7780771da4c7bb73aa06
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
index ce7db92..a85aea3 100644
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -31,6 +31,10 @@
|
||||
android:title="@string/network_predictions_title"
|
||||
android:summary="@string/network_predictions_summary"
|
||||
android:persistent="false" />
|
||||
+ <org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference
|
||||
+ android:key="incognito_only"
|
||||
+ android:title="@string/incognito_only_title"
|
||||
+ android:summary="@string/incognito_only_summary" />
|
||||
<Preference
|
||||
android:key="usage_and_crash_reports"
|
||||
android:title="@string/usage_and_crash_reports_title"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
index 49a3251..7445c9b 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
||||
@@ -51,6 +51,9 @@ import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
import org.chromium.chrome.R;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
+import org.chromium.chrome.browser.init.AsyncInitializationActivity;
|
||||
+import org.chromium.chrome.browser.preferences.AboutChromePreferences;
|
||||
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
|
||||
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
|
||||
import org.chromium.chrome.browser.appmenu.AppMenu;
|
||||
@@ -84,6 +87,7 @@ import org.chromium.chrome.browser.gsa.GSAAccountChangeListener;
|
||||
import org.chromium.chrome.browser.gsa.GSAState;
|
||||
import org.chromium.chrome.browser.help.HelpAndFeedback;
|
||||
import org.chromium.chrome.browser.history.HistoryManagerUtils;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.infobar.InfoBarContainer;
|
||||
import org.chromium.chrome.browser.init.AsyncInitializationActivity;
|
||||
import org.chromium.chrome.browser.init.ProcessInitializationHandler;
|
||||
@@ -130,6 +134,7 @@ import org.chromium.chrome.browser.toolbar.ToolbarManager;
|
||||
import org.chromium.chrome.browser.util.AccessibilityUtil;
|
||||
import org.chromium.chrome.browser.util.ColorUtils;
|
||||
import org.chromium.chrome.browser.util.FeatureUtilities;
|
||||
+
|
||||
import org.chromium.chrome.browser.vr_shell.VrIntentUtils;
|
||||
import org.chromium.chrome.browser.vr_shell.VrShellDelegate;
|
||||
import org.chromium.chrome.browser.webapps.AddToHomescreenManager;
|
||||
@@ -1312,6 +1317,9 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
* @param menu Menu that is going to be shown when the menu button is pressed.
|
||||
*/
|
||||
public void prepareMenu(Menu menu) {
|
||||
+ if (IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()) {
|
||||
+ menu.findItem(R.id.new_incognito_tab_menu_id).setVisible(false);
|
||||
+ }
|
||||
}
|
||||
|
||||
protected IntentHandlerDelegate createIntentHandlerDelegate() {
|
||||
@@ -1436,7 +1444,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
throw new IllegalStateException(
|
||||
"Attempting to access TabCreator before initialization");
|
||||
}
|
||||
- return incognito ? mIncognitoTabCreator : mRegularTabCreator;
|
||||
+ return incognito || IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()
|
||||
+ ? mIncognitoTabCreator : mRegularTabCreator;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
|
||||
index 44c9c8a..bcba76a 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/SingleTabActivity.java
|
||||
@@ -4,15 +4,28 @@
|
||||
|
||||
package org.chromium.chrome.browser;
|
||||
|
||||
+import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.util.Pair;
|
||||
|
||||
+import org.chromium.base.ThreadUtils;
|
||||
+import org.chromium.chrome.R;
|
||||
+import org.chromium.chrome.browser.ChromeActivity;
|
||||
+import org.chromium.chrome.browser.TabState;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationService;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
+import org.chromium.chrome.browser.metrics.PageLoadMetrics;
|
||||
+import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabDelegateFactory;
|
||||
import org.chromium.chrome.browser.tab.TabUma.TabCreationState;
|
||||
+import org.chromium.chrome.browser.tabmodel.EmptyTabModel;
|
||||
+import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver;
|
||||
import org.chromium.chrome.browser.tabmodel.SingleTabModelSelector;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType;
|
||||
+import org.chromium.chrome.browser.tabmodel.TabModelObserver;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
||||
import org.chromium.chrome.browser.tabmodel.document.TabDelegate;
|
||||
import org.chromium.content_public.browser.ChildProcessImportance;
|
||||
@@ -38,7 +51,8 @@ public abstract class SingleTabActivity extends ChromeActivity {
|
||||
|
||||
@Override
|
||||
protected TabModelSelector createTabModelSelector() {
|
||||
- return new SingleTabModelSelector(this, false, false) {
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ return new SingleTabModelSelector(this, incognitoOnly, false) {
|
||||
@Override
|
||||
public Tab openNewTab(LoadUrlParams loadUrlParams, TabLaunchType type, Tab parent,
|
||||
boolean incognito) {
|
||||
@@ -81,6 +95,7 @@ public abstract class SingleTabActivity extends ChromeActivity {
|
||||
*/
|
||||
protected Tab createTab() {
|
||||
Tab tab = null;
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
boolean unfreeze = false;
|
||||
|
||||
int tabId = Tab.INVALID_TAB_ID;
|
||||
@@ -93,13 +108,14 @@ public abstract class SingleTabActivity extends ChromeActivity {
|
||||
if (tabId != Tab.INVALID_TAB_ID && tabUrl != null && getActivityDirectory() != null) {
|
||||
// Restore the tab.
|
||||
TabState tabState = TabState.restoreTabState(getActivityDirectory(), tabId);
|
||||
- tab = new Tab(tabId, Tab.INVALID_TAB_ID, false, getWindowAndroid(),
|
||||
- TabLaunchType.FROM_RESTORE, TabCreationState.FROZEN_ON_RESTORE, tabState);
|
||||
+ tab = new Tab(tabId, Tab.INVALID_TAB_ID, incognitoOnly, this, getWindowAndroid(),
|
||||
+ TabLaunchType.FROM_RESTORE,
|
||||
+ TabCreationState.FROZEN_ON_RESTORE, tabState);
|
||||
unfreeze = true;
|
||||
}
|
||||
|
||||
if (tab == null) {
|
||||
- tab = new Tab(Tab.INVALID_TAB_ID, Tab.INVALID_TAB_ID, false, getWindowAndroid(),
|
||||
+ tab = new Tab(Tab.INVALID_TAB_ID, Tab.INVALID_TAB_ID, incognitoOnly, this, getWindowAndroid(),
|
||||
TabLaunchType.FROM_CHROME_UI, null, null);
|
||||
}
|
||||
|
||||
@@ -137,4 +153,31 @@ public abstract class SingleTabActivity extends ChromeActivity {
|
||||
|
||||
@Override
|
||||
public void onCheckForUpdate(boolean updateAvailable) {}
|
||||
+
|
||||
+ private void handleTabClose() {
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ if (incognitoOnly && isInitialized()) {
|
||||
+ destroyIncognitoIfNecessary();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected void destroyIncognitoIfNecessary() {
|
||||
+ ThreadUtils.assertOnUiThread();
|
||||
+
|
||||
+ Profile profile = getTabModelSelector().getModel(true).getProfile();
|
||||
+ // destroy the current tabmodel that will destroy tabs internally
|
||||
+ getCurrentTabModel().destroy();
|
||||
+ // Only delete the incognito profile if there are no incognito tabs open in any tab
|
||||
+ // model selector as the profile is shared between them.
|
||||
+ if (profile != null && !(IncognitoNotificationService.getIncognitoTabCount() > 0)) {
|
||||
+ profile.destroyWhenAppropriate();
|
||||
+ IncognitoNotificationManager.dismissIncognitoNotification();
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onDestroyInternal() {
|
||||
+ handleTabClose();
|
||||
+ }
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
index afc92bed..39caa0b 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.widget.ControlContainer;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
import org.chromium.content_public.browser.WebContentsObserver;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.MalformedURLException;
|
||||
@@ -289,8 +290,9 @@ public final class WarmupManager {
|
||||
public void createSpareWebContents() {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
if (!LibraryLoader.isInitialized()) return;
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
if (mSpareWebContents != null || SysUtils.isLowEndDevice()) return;
|
||||
- mSpareWebContents = WebContentsFactory.createWebContentsWithWarmRenderer(false, false);
|
||||
+ mSpareWebContents = WebContentsFactory.createWebContentsWithWarmRenderer(incognitoOnly, false);
|
||||
mObserver = new RenderProcessGoneObserver();
|
||||
mSpareWebContents.addObserver(mObserver);
|
||||
mWebContentsCreationTimeMs = SystemClock.elapsedRealtime();
|
||||
@@ -316,7 +318,7 @@ public final class WarmupManager {
|
||||
*/
|
||||
public WebContents takeSpareWebContents(boolean incognito, boolean initiallyHidden) {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
- if (incognito || initiallyHidden) return null;
|
||||
+ if ((incognito != mSpareWebContents.isIncognito()) || initiallyHidden) return null;
|
||||
WebContents result = mSpareWebContents;
|
||||
if (result == null) return null;
|
||||
mSpareWebContents = null;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
index e48a3e8..5435958 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegate.java
|
||||
@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.UrlConstants;
|
||||
import org.chromium.chrome.browser.banners.AppBannerManager;
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
|
||||
import org.chromium.chrome.browser.download.DownloadUtils;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
|
||||
import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
|
||||
import org.chromium.chrome.browser.preferences.ManagedPreferencesUtils;
|
||||
@@ -175,6 +176,8 @@ public class AppMenuPropertiesDelegate {
|
||||
|
||||
MenuItem allBookmarksMenuItem = menu.findItem(R.id.all_bookmarks_menu_id);
|
||||
// Hide 'History' in incognito only browser
|
||||
+ boolean isIncognitoOnlyBrowser = IncognitoOnlyModeUtil.getInstance()
|
||||
+ .isIncognitoOnlyBrowser();
|
||||
menu.findItem(R.id.open_history_menu_id).setVisible(!isIncognitoOnlyBrowser);
|
||||
|
||||
allBookmarksMenuItem.setTitle(mActivity.getString(R.string.menu_bookmarks));
|
||||
@@ -201,7 +204,7 @@ public class AppMenuPropertiesDelegate {
|
||||
// is not persisted when adding to the homescreen.
|
||||
// * If creating shortcuts it not supported by the current home screen.
|
||||
boolean canShowHomeScreenMenuItem = ShortcutHelper.isAddToHomeIntentSupported()
|
||||
- && !isChromeScheme && !isFileScheme && !isContentScheme && !isIncognito
|
||||
+ && !isChromeScheme && !isFileScheme && !isContentScheme && (!isIncognito || isIncognitoOnlyBrowser)
|
||||
&& !TextUtils.isEmpty(url);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, canShowHomeScreenMenuItem);
|
||||
|
||||
@@ -224,7 +227,8 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
if (isOverviewMenu) {
|
||||
- if (isIncognito) {
|
||||
+ if (isIncognito
|
||||
+ && !(IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled())) {
|
||||
// Hide normal close all tabs item.
|
||||
menu.findItem(R.id.close_all_tabs_menu_id).setVisible(false);
|
||||
// Enable close incognito tabs only if there are incognito tabs.
|
||||
@@ -244,6 +248,7 @@ public class AppMenuPropertiesDelegate {
|
||||
}
|
||||
|
||||
boolean incognitoMenuItemVisible = !isBottomSheetNtpMenu || !isIncognito;
|
||||
+ incognitoMenuItemVisible &= !(IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled());
|
||||
// Disable new incognito tab when it is blocked (e.g. by a policy).
|
||||
// findItem(...).setEnabled(...)" is not enough here, because of the inflated
|
||||
// main_menu.xml contains multiple items with the same id in different groups
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java
|
||||
index 03edf2d..fb2cc2e 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java
|
||||
@@ -33,6 +33,7 @@ import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer;
|
||||
import org.chromium.chrome.browser.compositor.scene_layer.TabListSceneLayer;
|
||||
import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
|
||||
import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
||||
@@ -328,8 +329,10 @@ public class StackLayout extends Layout implements Animatable<StackLayout.Proper
|
||||
@Override
|
||||
public void setTabModelSelector(TabModelSelector modelSelector, TabContentManager manager) {
|
||||
super.setTabModelSelector(modelSelector, manager);
|
||||
- mStacks[0].setTabModel(modelSelector.getModel(false));
|
||||
- mStacks[1].setTabModel(modelSelector.getModel(true));
|
||||
+ mStacks[0].setTabModel(modelSelector
|
||||
+ .getModel(IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()));
|
||||
+ mStacks[1].setTabModel(modelSelector
|
||||
+ .getModel(!IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()));
|
||||
resetScrollData();
|
||||
}
|
||||
|
||||
@@ -341,6 +344,9 @@ public class StackLayout extends Layout implements Animatable<StackLayout.Proper
|
||||
* @VisibleForTesting
|
||||
*/
|
||||
public Stack getTabStack(boolean incognito) {
|
||||
+ if (IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()) {
|
||||
+ return mStacks[incognito ? 0 : 1];
|
||||
+ }
|
||||
return mStacks[incognito ? 1 : 0];
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/Stack.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/Stack.java
|
||||
index 8230bc2..687c8a4 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/Stack.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/Stack.java
|
||||
@@ -21,6 +21,7 @@ import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab;
|
||||
import org.chromium.chrome.browser.compositor.layouts.eventfilter.ScrollDirection;
|
||||
import org.chromium.chrome.browser.compositor.layouts.phone.StackLayout;
|
||||
import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimation.OverviewAnimationType;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
|
||||
@@ -436,7 +437,9 @@ public class Stack {
|
||||
* @return Whether or not the TabModel represented by this TabStackState should be displayed.
|
||||
*/
|
||||
public boolean isDisplayable() {
|
||||
- return !mTabModel.isIncognito() || (!mIsDying && mTabModel.getCount() > 0);
|
||||
+ return (!mTabModel.isIncognito()
|
||||
+ && !IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled())
|
||||
+ || (!mIsDying && mTabModel.getCount() > 0);
|
||||
}
|
||||
|
||||
private float getDefaultDiscardDirection() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
index 25f1fd7..6257c82 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.compositor.layouts.eventfilter.GestureHandler
|
||||
import org.chromium.chrome.browser.compositor.overlays.SceneOverlay;
|
||||
import org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer;
|
||||
import org.chromium.chrome.browser.compositor.scene_layer.TabStripSceneLayer;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel;
|
||||
@@ -377,7 +378,8 @@ public class StripLayoutHelperManager implements SceneOverlay {
|
||||
mModelSelectorButton.setIncognito(mIsIncognito);
|
||||
if (mTabModelSelector != null) {
|
||||
boolean isVisible = mTabModelSelector.getModel(true).getCount() != 0;
|
||||
- mModelSelectorButton.setVisible(isVisible);
|
||||
+ mModelSelectorButton.setVisible(isVisible
|
||||
+ && !IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled());
|
||||
|
||||
float endMargin = isVisible
|
||||
? MODEL_SELECTOR_BUTTON_WIDTH_DP + MODEL_SELECTOR_BUTTON_END_PADDING_DP
|
||||
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
|
||||
index 43b556f..2b92e83 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
|
||||
@@ -59,9 +59,13 @@ import org.chromium.chrome.browser.browserservices.BrowserSessionContentUtils;
|
||||
import org.chromium.chrome.browser.compositor.layouts.LayoutManager;
|
||||
import org.chromium.chrome.browser.datausage.DataUseTabUIManager;
|
||||
import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor;
|
||||
import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate;
|
||||
import org.chromium.chrome.browser.gsa.GSAState;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationService;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.metrics.PageLoadMetrics;
|
||||
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.page_info.PageInfoPopup;
|
||||
@@ -334,7 +338,12 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
if (mConnection.shouldHideDomainForSession(mSession)) {
|
||||
getToolbarManager().setUrlBarHidden(true);
|
||||
}
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
int toolbarColor = mIntentDataProvider.getToolbarColor();
|
||||
+ if (incognitoOnly) {
|
||||
+ toolbarColor = ApiCompatibilityUtils.getColor(getResources(),
|
||||
+ R.color.incognito_primary_color);
|
||||
+ }
|
||||
getToolbarManager().updatePrimaryColor(toolbarColor, false);
|
||||
if (!mIntentDataProvider.isOpenedByChrome()) {
|
||||
getToolbarManager().setShouldUpdateToolbarPrimaryColor(false);
|
||||
@@ -390,7 +399,8 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
mConnection.cancelSpeculation(mSession);
|
||||
}
|
||||
|
||||
- getTabModelSelector().getModel(false).addObserver(mTabModelObserver);
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ getTabModelSelector().getModel(incognitoOnly).addObserver(mTabModelObserver);
|
||||
|
||||
boolean successfulStateRestore = false;
|
||||
// Attempt to restore the previous tab state if applicable.
|
||||
@@ -412,7 +422,7 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
} else {
|
||||
mMainTab = createMainTab();
|
||||
}
|
||||
- getTabModelSelector().getModel(false).addTab(mMainTab, 0, mMainTab.getLaunchType());
|
||||
+ getTabModelSelector().getModel(incognitoOnly).addTab(mMainTab, 0, mMainTab.getLaunchType());
|
||||
}
|
||||
|
||||
// This cannot be done before because we want to do the reparenting only
|
||||
@@ -550,7 +560,9 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
getIntent(), IntentHandler.EXTRA_TAB_ID, Tab.INVALID_TAB_ID);
|
||||
int parentTabId = IntentUtils.safeGetIntExtra(
|
||||
getIntent(), IntentHandler.EXTRA_PARENT_TAB_ID, Tab.INVALID_TAB_ID);
|
||||
- Tab tab = new Tab(assignedTabId, parentTabId, false, getWindowAndroid(),
|
||||
+
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ Tab tab = new Tab(assignedTabId, parentTabId, incognitoOnly, getWindowAndroid(),
|
||||
TabLaunchType.FROM_EXTERNAL_APP, null, null);
|
||||
if (getIntent().getIntExtra(
|
||||
CustomTabIntentDataProvider.EXTRA_BROWSER_LAUNCH_SOURCE, ACTIVITY_TYPE_OTHER)
|
||||
@@ -588,12 +600,12 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
webContentsStateOnLaunch = WEBCONTENTS_STATE_TRANSFERRED_WEBCONTENTS;
|
||||
webContents.resumeLoadingCreatedWebContents();
|
||||
} else {
|
||||
- webContents = WarmupManager.getInstance().takeSpareWebContents(false, false);
|
||||
+ webContents = WarmupManager.getInstance().takeSpareWebContents(IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled(), false);
|
||||
if (webContents != null) {
|
||||
webContentsStateOnLaunch = WEBCONTENTS_STATE_SPARE_WEBCONTENTS;
|
||||
} else {
|
||||
webContents =
|
||||
- WebContentsFactory.createWebContentsWithWarmRenderer(false, false);
|
||||
+ WebContentsFactory.createWebContentsWithWarmRenderer(IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled(), false);
|
||||
webContentsStateOnLaunch = WEBCONTENTS_STATE_NO_WEBCONTENTS;
|
||||
}
|
||||
}
|
||||
@@ -835,6 +847,13 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
if (getAppMenuHandler() != null) getAppMenuHandler().hideAppMenu();
|
||||
|
||||
super.finish();
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ if (incognitoOnly) {
|
||||
+ int incognitoCount = IncognitoNotificationService.getIncognitoTabCount();
|
||||
+ if (incognitoCount == 0) {
|
||||
+ IncognitoNotificationManager.dismissIncognitoNotification();
|
||||
+ }
|
||||
+ }
|
||||
if (mIntentDataProvider != null && mIntentDataProvider.shouldAnimateOnFinish()) {
|
||||
mShouldOverridePackage = true;
|
||||
overridePendingTransition(mIntentDataProvider.getAnimationEnterRes(),
|
||||
@@ -853,7 +872,8 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
public final void finishAndClose(boolean reparenting) {
|
||||
if (mIsClosing) return;
|
||||
mIsClosing = true;
|
||||
- if (!reparenting) {
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ if (!reparenting && !incognitoOnly) {
|
||||
// Closing the activity destroys the renderer as well. Re-create a spare renderer some
|
||||
// time after, so that we have one ready for the next tab open. This does not increase
|
||||
// memory consumption, as the current renderer goes away. We create a renderer as a lot
|
||||
@@ -1025,7 +1045,8 @@ public class CustomTabActivity extends ChromeActivity {
|
||||
protected void setStatusBarColor(Tab tab, int color) {
|
||||
// Intentionally do nothing as CustomTabActivity explicitly sets status bar color. Except
|
||||
// for Custom Tabs opened by Chrome.
|
||||
- if (mIntentDataProvider.isOpenedByChrome()) super.setStatusBarColor(tab, color);
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ if (mIntentDataProvider.isOpenedByChrome() && !incognitoOnly) super.setStatusBarColor(tab, color);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java
|
||||
index f9e91ad..3e9bd1c 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java
|
||||
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.incognito;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
+import android.util.SparseArray;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManager.AppTask;
|
||||
import android.app.ActivityManager.RecentTaskInfo;
|
||||
@@ -24,15 +25,21 @@ import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.base.library_loader.LibraryProcessType;
|
||||
+import org.chromium.chrome.browser.ChromeActivity;
|
||||
+import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.ChromeTabbedActivity;
|
||||
import org.chromium.chrome.browser.TabState;
|
||||
+import org.chromium.chrome.browser.customtabs.CustomTabActivity;
|
||||
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
||||
import org.chromium.chrome.browser.document.DocumentUtils;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
+import org.chromium.chrome.browser.tabmodel.AsyncTabParams;
|
||||
+import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager;
|
||||
import org.chromium.chrome.browser.tabmodel.TabWindowManager;
|
||||
import org.chromium.chrome.browser.tabmodel.TabbedModeTabPersistencePolicy;
|
||||
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
|
||||
import org.chromium.content.browser.BrowserStartupController;
|
||||
+import org.chromium.chrome.browser.webapps.WebappActivity;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -189,7 +196,9 @@ public class IncognitoNotificationService extends IntentService {
|
||||
for (int i = 0; i < runningActivities.size(); i++) {
|
||||
Activity activity = runningActivities.get(i).get();
|
||||
if (activity == null) continue;
|
||||
- if (!(activity instanceof ChromeTabbedActivity)) continue;
|
||||
+ if (!(activity instanceof ChromeTabbedActivity ||
|
||||
+ activity instanceof CustomTabActivity ||
|
||||
+ activity instanceof WebappActivity)) continue;
|
||||
|
||||
ChromeTabbedActivity tabbedActivity = (ChromeTabbedActivity) activity;
|
||||
if (tabbedActivity.isActivityDestroyed()) continue;
|
||||
@@ -205,7 +214,7 @@ public class IncognitoNotificationService extends IntentService {
|
||||
BottomSheet.SHEET_STATE_PEEK, false);
|
||||
}
|
||||
|
||||
- tabbedActivity.getTabModelSelector().getModel(true).closeAllTabs(
|
||||
+ chromeActivity.getTabModelSelector().getModel(true).closeAllTabs(
|
||||
false, false);
|
||||
}
|
||||
}
|
||||
@@ -229,4 +238,30 @@ public class IncognitoNotificationService extends IntentService {
|
||||
return deletionSuccessful;
|
||||
}
|
||||
|
||||
+ public static int getIncognitoTabCount() {
|
||||
+ int count = 0;
|
||||
+ List<WeakReference<Activity>> runningActivities =
|
||||
+ ApplicationStatus.getRunningActivities();
|
||||
+ for (int i = 0; i < runningActivities.size(); i++) {
|
||||
+ Activity activity = runningActivities.get(i).get();
|
||||
+ if (activity == null) continue;
|
||||
+ if (!(activity instanceof ChromeTabbedActivity ||
|
||||
+ activity instanceof CustomTabActivity ||
|
||||
+ activity instanceof WebappActivity)) continue;
|
||||
+
|
||||
+ ChromeActivity chromeActivity = (ChromeActivity) activity;
|
||||
+ if (chromeActivity.isActivityDestroyed()) continue;
|
||||
+
|
||||
+ count += chromeActivity.getTabModelSelector().getModel(true).getCount();
|
||||
+ }
|
||||
+ // Count tabs that are moving between activities (e.g. a tab that was recently reparented
|
||||
+ // and hasn't been attached to its new activity yet).
|
||||
+ SparseArray<AsyncTabParams> asyncTabParams = AsyncTabParamsManager.getAsyncTabParams();
|
||||
+ for (int i = 0; i < asyncTabParams.size(); i++) {
|
||||
+ Tab tab = asyncTabParams.valueAt(i).getTabToReparent();
|
||||
+ if (tab != null && tab.isIncognito()) count++;
|
||||
+ }
|
||||
+ return count;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoOnlyModeUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoOnlyModeUtil.java
|
||||
new file mode 100644
|
||||
index 0000000..f6b17e7
|
||||
--- /dev/null
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/incognito/IncognitoOnlyModeUtil.java
|
||||
@@ -0,0 +1,73 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions are
|
||||
+ * met:
|
||||
+ * * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ * * Redistributions in binary form must reproduce the above
|
||||
+ * copyright notice, this list of conditions and the following
|
||||
+ * disclaimer in the documentation and/or other materials provided
|
||||
+ * with the distribution.
|
||||
+ * * Neither the name of The Linux Foundation nor the names of its
|
||||
+ * contributors may be used to endorse or promote products derived
|
||||
+ * from this software without specific prior written permission.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.chrome.browser.incognito;
|
||||
+
|
||||
+import org.chromium.base.CommandLine;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.chrome.browser.ChromeSwitches;
|
||||
+import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
|
||||
+
|
||||
+/**
|
||||
+ * Utility class for incognito only mode
|
||||
+ */
|
||||
+public class IncognitoOnlyModeUtil {
|
||||
+ private static IncognitoOnlyModeUtil sInstance;
|
||||
+
|
||||
+ private IncognitoOnlyModeUtil() {}
|
||||
+
|
||||
+ public static IncognitoOnlyModeUtil getInstance() {
|
||||
+ if (sInstance == null) {
|
||||
+ sInstance = new IncognitoOnlyModeUtil();
|
||||
+ }
|
||||
+ return sInstance;
|
||||
+ }
|
||||
+ /**
|
||||
+ * @return whether incognito only browser
|
||||
+ */
|
||||
+ public boolean isIncognitoOnlyBrowser() {
|
||||
+ return CommandLine.getInstance().hasSwitch(ChromeSwitches.INCOGNITO_ONLY_MODE);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return whether incognito only mode preference is enabled
|
||||
+ */
|
||||
+ public boolean isIncognitoOnlyPreferenceEnabled() {
|
||||
+ return PrivacyPreferencesManager.getInstance(ContextUtils.getApplicationContext()).
|
||||
+ isIncognitoOnlyEnabled();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return whether incognito only browser or incognito only mode preference is enabled
|
||||
+ */
|
||||
+ public boolean isIncognitoOnlyModeEnabled() {
|
||||
+ return isIncognitoOnlyBrowser() || isIncognitoOnlyPreferenceEnabled();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
|
||||
index e594c57..def79eb 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
|
||||
@@ -20,6 +20,7 @@ import android.widget.FrameLayout;
|
||||
import org.chromium.base.ApiCompatibilityUtils;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.WindowDelegate;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.ntp.NewTabPage;
|
||||
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
|
||||
import org.chromium.chrome.browser.util.MathUtils;
|
||||
@@ -271,7 +272,8 @@ public class LocationBarPhone extends LocationBarLayout {
|
||||
|
||||
boolean showIncognitoBadge =
|
||||
getToolbarDataProvider() != null && getToolbarDataProvider().isIncognito();
|
||||
- mIncognitoBadge.setVisibility(showIncognitoBadge ? VISIBLE : GONE);
|
||||
+ mIncognitoBadge.setVisibility(showIncognitoBadge
|
||||
+ && !IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled() ? VISIBLE : GONE);
|
||||
updateIncognitoBadgePadding();
|
||||
}
|
||||
|
||||
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
|
||||
index 0d78e7c..b1b9f67 100644
|
||||
--- 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,8 @@
|
||||
|
||||
package org.chromium.chrome.browser.preferences.privacy;
|
||||
|
||||
+import android.app.AlertDialog;
|
||||
+import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
@@ -18,8 +20,11 @@ import org.chromium.base.SysUtils;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ChromeFeatureList;
|
||||
+import org.chromium.chrome.browser.ApplicationLifetime;
|
||||
+import org.chromium.chrome.browser.ChromeSwitches;
|
||||
import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
|
||||
import org.chromium.chrome.browser.help.HelpAndFeedback;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.physicalweb.PhysicalWeb;
|
||||
import org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference;
|
||||
import org.chromium.chrome.browser.preferences.ManagedPreferenceDelegate;
|
||||
@@ -41,6 +46,7 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
private static final String PREF_SAFE_BROWSING = "safe_browsing";
|
||||
private static final String PREF_CONTEXTUAL_SEARCH = "contextual_search";
|
||||
private static final String PREF_NETWORK_PREDICTIONS = "network_predictions";
|
||||
+ private static final String PREF_INCOGNITO_ONLY = "incognito_only";
|
||||
private static final String PREF_DO_NOT_TRACK = "do_not_track";
|
||||
private static final String PREF_USAGE_AND_CRASH_REPORTING = "usage_and_crash_reports";
|
||||
private static final String PREF_PHYSICAL_WEB = "physical_web";
|
||||
@@ -129,6 +135,18 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
recordNetworkPredictionEnablingUMA((boolean) newValue);
|
||||
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
|
||||
PrefServiceBridge.getInstance().setResolveNavigationErrorEnabled((boolean) newValue);
|
||||
+ } else if (PREF_INCOGNITO_ONLY.equals(key)) {
|
||||
+ incognitoOnlyPreferenceDialog(preference, (boolean) newValue).show();
|
||||
+ }
|
||||
+
|
||||
+ boolean isIncognitoOnlyBrowser = IncognitoOnlyModeUtil.getInstance()
|
||||
+ .isIncognitoOnlyBrowser();
|
||||
+ ChromeBaseCheckBoxPreference incognitoOnlyPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_INCOGNITO_ONLY);
|
||||
+ if (isIncognitoOnlyBrowser) {
|
||||
+ preferenceScreen.removePreference(incognitoOnlyPref);
|
||||
+ } else {
|
||||
+ incognitoOnlyPref.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -189,6 +207,13 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
doNotTrackPref.setSummary(prefServiceBridge.isDoNotTrackEnabled() ? textOn : textOff);
|
||||
}
|
||||
|
||||
+ Preference incognitoOnlyPref = findPreference(PREF_INCOGNITO_ONLY);
|
||||
+ if (incognitoOnlyPref != null) {
|
||||
+ boolean isIncognitoOnlyEnabled = privacyPrefManager.isIncognitoOnlyEnabled();
|
||||
+ incognitoOnlyPref.setChecked(isIncognitoOnlyEnabled);
|
||||
+ incognitoOnlyPref.setSummary(isIncognitoOnlyEnabled ? textOn : textOff);
|
||||
+ }
|
||||
+
|
||||
Preference contextualPref = findPreference(PREF_CONTEXTUAL_SEARCH);
|
||||
if (contextualPref != null) {
|
||||
boolean isContextualSearchEnabled = !prefServiceBridge.isContextualSearchDisabled();
|
||||
@@ -254,4 +279,38 @@ public class PrivacyPreferences extends PreferenceFragment
|
||||
}
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ private AlertDialog incognitoOnlyPreferenceDialog(final Preference preference,
|
||||
+ final boolean isChecked) {
|
||||
+ AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
|
||||
+ .setTitle(isChecked ? R.string.incognito_only_turn_on_title
|
||||
+ : R.string.incognito_only_turn_off_title)
|
||||
+ .setMessage(isChecked ? R.string.incognito_only_turn_on_confirmation
|
||||
+ : R.string.incognito_only_turn_off_confirmation)
|
||||
+ .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
+ @Override
|
||||
+ public void onClick(DialogInterface dialog, int id) {
|
||||
+ ((ChromeBaseCheckBoxPreference) preference).setChecked(!isChecked);
|
||||
+ dialog.dismiss();
|
||||
+ }
|
||||
+ })
|
||||
+ .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
+ @Override
|
||||
+ public void onClick(DialogInterface dialog, int which) {
|
||||
+ PrivacyPreferencesManager.getInstance(getActivity()).
|
||||
+ setIncognitoOnlyEnabled((boolean) isChecked);
|
||||
+ dialog.dismiss();
|
||||
+ ApplicationLifetime.terminate(true);
|
||||
+ }
|
||||
+ })
|
||||
+ .setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
+ @Override
|
||||
+ public void onCancel(DialogInterface dialog) {
|
||||
+ ((ChromeBaseCheckBoxPreference) preference).setChecked(!isChecked);
|
||||
+ }
|
||||
+ })
|
||||
+ .create();
|
||||
+
|
||||
+ return dialog;
|
||||
+ }
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
||||
index 4ddbd4d..9e2a163 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/PrivacyPreferencesManager.java
|
||||
@@ -38,6 +38,7 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
|
||||
private static final String PREF_BANDWIDTH_NO_CELLULAR_OLD = "prefetch_bandwidth_no_cellular";
|
||||
private static final String ALLOW_PRERENDER_OLD = "allow_prefetch";
|
||||
private static final String PREF_PHYSICAL_WEB = "physical_web";
|
||||
+ private static final String INCOGNITO_ONLY_PREFERENCE = "incognito_only_preference";
|
||||
private static final int PHYSICAL_WEB_OFF = 0;
|
||||
private static final int PHYSICAL_WEB_ON = 1;
|
||||
private static final int PHYSICAL_WEB_ONBOARDING = 2;
|
||||
@@ -339,4 +340,23 @@ public class PrivacyPreferencesManager implements CrashReportingPermissionManage
|
||||
int state = mSharedPreferences.getInt(PREF_PHYSICAL_WEB, PHYSICAL_WEB_ONBOARDING);
|
||||
return (state == PHYSICAL_WEB_ON);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Check whether Incognito Only preference is enabled
|
||||
+ *
|
||||
+ * @return whether Incognito Only preference is enabled, false by default
|
||||
+ */
|
||||
+ public boolean isIncognitoOnlyEnabled() {
|
||||
+ return mSharedPreferences.getBoolean(INCOGNITO_ONLY_PREFERENCE, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the Incognito Only preference, which enables the browser to switch to incognito only
|
||||
+ * mode
|
||||
+ *
|
||||
+ * @param enabled A boolean indicating whether to switch to incognito only mode.
|
||||
+ */
|
||||
+ public void setIncognitoOnlyEnabled(boolean enabled) {
|
||||
+ mSharedPreferences.edit().putBoolean(INCOGNITO_ONLY_PREFERENCE, enabled).apply();
|
||||
+ }
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
index 344a2ed..d54accf 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
|
||||
@@ -17,6 +17,7 @@ import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||
import org.chromium.chrome.browser.preferences.LocationSettings;
|
||||
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
||||
import org.chromium.chrome.browser.preferences.PreferenceUtils;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -110,6 +111,13 @@ public class SiteSettingsPreferences extends PreferenceFragment
|
||||
}
|
||||
|
||||
private void configurePreferences() {
|
||||
+ // Remove 'All sites' menu for incognito only browser
|
||||
+ boolean isIncognitoOnlyBrowser = IncognitoOnlyModeUtil.getInstance()
|
||||
+ .isIncognitoOnlyBrowser();
|
||||
+ if (isIncognitoOnlyBrowser) {
|
||||
+ getPreferenceScreen().removePreference(findPreference(ALL_SITES_KEY));
|
||||
+ }
|
||||
+
|
||||
if (mMediaSubMenu) {
|
||||
// The Media sub-menu only contains Protected Content and Autoplay, so remove all other
|
||||
// menus.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
|
||||
index d90ccc3..ddc30f2 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java
|
||||
@@ -9,6 +9,7 @@ import android.content.Context;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.device.DeviceClassManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.snackbar.Snackbar;
|
||||
import org.chromium.chrome.browser.snackbar.SnackbarManager;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
@@ -64,7 +65,8 @@ public class UndoBarController implements SnackbarManager.SnackbarController {
|
||||
mTabModelObserver = new EmptyTabModelObserver() {
|
||||
private boolean disableUndo() {
|
||||
return AccessibilityUtil.isAccessibilityEnabled()
|
||||
- || DeviceClassManager.enableAccessibilityLayout();
|
||||
+ || DeviceClassManager.enableAccessibilityLayout()
|
||||
+ || IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModel.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModel.java
|
||||
index c3e7aa0..b1d758c 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModel.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/IncognitoTabModel.java
|
||||
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.tabmodel;
|
||||
import org.chromium.base.ObserverList;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationService;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
|
||||
@@ -82,7 +83,7 @@ public class IncognitoTabModel implements TabModel {
|
||||
|
||||
// Only delete the incognito profile if there are no incognito tabs open in any tab
|
||||
// model selector as the profile is shared between them.
|
||||
- if (profile != null && !mDelegate.doIncognitoTabsExist()) {
|
||||
+ if (profile != null && !(IncognitoNotificationService.getIncognitoTabCount() > 0)) {
|
||||
IncognitoNotificationManager.dismissIncognitoNotification();
|
||||
|
||||
profile.destroyWhenAppropriate();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
index 5221244..c976cd4 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
@@ -5,6 +5,7 @@
|
||||
package org.chromium.chrome.browser.tabmodel;
|
||||
|
||||
import org.chromium.base.ObserverList;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType;
|
||||
@@ -40,7 +41,8 @@ public abstract class TabModelSelectorBase implements TabModelSelector {
|
||||
for (int i = 0; i < models.length; i++) {
|
||||
tabModels.add(models[i]);
|
||||
}
|
||||
- mActiveModelIndex = startIncognito ? INCOGNITO_TAB_MODEL_INDEX : NORMAL_TAB_MODEL_INDEX;
|
||||
+ mActiveModelIndex = (startIncognito ||
|
||||
+ IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled()) ? INCOGNITO_TAB_MODEL_INDEX : NORMAL_TAB_MODEL_INDEX;
|
||||
mTabModels = Collections.unmodifiableList(tabModels);
|
||||
|
||||
TabModelObserver tabModelObserver = new EmptyTabModelObserver() {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java
|
||||
index e69d43c..71893ff 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java
|
||||
@@ -14,6 +14,7 @@ import android.os.Build;
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.VisibleForTesting;
|
||||
import org.chromium.chrome.browser.document.DocumentUtils;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationService;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabIdManager;
|
||||
import org.chromium.chrome.browser.tabmodel.IncognitoTabModel.IncognitoTabModelDelegate;
|
||||
@@ -105,7 +106,7 @@ public class DocumentTabModelSelector extends TabModelSelectorBase implements Ta
|
||||
public boolean doIncognitoTabsExist() {
|
||||
// TODO(dfalcantara): Devices in document mode do not trigger the TabWindowManager.
|
||||
// Revisit this when we have a Samsung L multi-instance device.
|
||||
- return mIncognitoTabModel.getCount() > 0;
|
||||
+ return IncognitoNotificationService.getIncognitoTabCount() > 0;
|
||||
}
|
||||
}, mActivityDelegate);
|
||||
initializeTabIdCounter();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
|
||||
index 26bb763..b01a165 100644
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
|
||||
@@ -52,6 +52,7 @@ import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
|
||||
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
|
||||
import org.chromium.chrome.browser.document.DocumentUtils;
|
||||
import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoOnlyModeUtil;
|
||||
import org.chromium.chrome.browser.tab.EmptyTabObserver;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabDelegateFactory;
|
||||
@@ -814,6 +815,12 @@ public class WebappActivity extends SingleTabActivity {
|
||||
mBrandColor = (int) mWebappInfo.themeColor();
|
||||
}
|
||||
|
||||
+ boolean incognitoOnly = IncognitoOnlyModeUtil.getInstance().isIncognitoOnlyModeEnabled();
|
||||
+ if (incognitoOnly) {
|
||||
+ mBrandColor = ApiCompatibilityUtils.getColor(getResources(),
|
||||
+ R.color.incognito_primary_color);
|
||||
+ }
|
||||
+
|
||||
int taskDescriptionColor =
|
||||
ApiCompatibilityUtils.getColor(getResources(), R.color.default_primary_color);
|
||||
|
||||
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
index a81975d..f14b395 100644
|
||||
--- a/chrome/android/java/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/android/java/strings/android_chrome_strings.grd
|
||||
@@ -225,6 +225,26 @@ CHAR-LIMIT guidelines:
|
||||
Retry
|
||||
</message>
|
||||
|
||||
+ <!-- Incognito Only mode -->
|
||||
+ <message name="IDS_INCOGNITO_ONLY_TITLE" desc="The label for incognito-only toggle option.">
|
||||
+ "Incognito Only" mode
|
||||
+ </message>
|
||||
+ <message name="IDS_INCOGNITO_ONLY_SUMMARY" desc="The summary for incognito-only toggle option.">
|
||||
+ Browse using only incognito tabs
|
||||
+ </message>
|
||||
+ <message name="IDS_INCOGNITO_ONLY_TURN_ON_TITLE" desc="The tooltip for enabling incognito-only mode.">
|
||||
+ Enable "Incognito Only" mode
|
||||
+ </message>
|
||||
+ <message name="IDS_INCOGNITO_ONLY_TURN_OFF_TITLE" desc="The tooltip for disabling incognito-only mode.">
|
||||
+ Disable "Incognito Only" mode
|
||||
+ </message>
|
||||
+ <message name="IDS_INCOGNITO_ONLY_TURN_ON_CONFIRMATION" desc="The confirmation message for turning on incognito-only mode.">
|
||||
+ Browser will <ph name="BEGIN_BOLD"><b></ph>restart<ph name="END_BOLD"></b></ph> in incognito-only mode. All opened tabs will be closed.
|
||||
+ </message>
|
||||
+ <message name="IDS_INCOGNITO_ONLY_TURN_OFF_CONFIRMATION" desc="The confirmation message for turning off incognito-only mode.">
|
||||
+ Browser will <ph name="BEGIN_BOLD"><b></ph>restart<ph name="END_BOLD"></b></ph> in regular mode. All opened tabs will be closed.
|
||||
+ </message>
|
||||
+
|
||||
<!-- Main Preferences -->
|
||||
<message name="IDS_PREFERENCES" desc="Title for Chrome's Settings.">
|
||||
Settings
|
||||
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
|
||||
index ba24b98..a576f9d 100644
|
||||
--- a/chrome/android/java_sources.gni
|
||||
+++ b/chrome/android/java_sources.gni
|
||||
@@ -491,6 +491,7 @@ chrome_java_sources = [
|
||||
"java/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGenerator.java",
|
||||
"java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java",
|
||||
"java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationService.java",
|
||||
+ "java/src/org/chromium/chrome/browser/incognito/IncognitoOnlyModeUtil.java",
|
||||
"java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java",
|
||||
"java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarDelegateAndroid.java",
|
||||
"java/src/org/chromium/chrome/browser/infobar/AutofillCreditCardFillingInfoBar.java",
|
||||
Reference in New Issue
Block a user