Compare commits

..
Author SHA1 Message Date
uazoandGitHub 97ffe2b779 Update check-git-apply.yaml 2023-06-20 05:45:09 -06:00
uazoandGitHub a38b47280d Added reading of base commit in pulls 2023-06-20 05:43:18 -06:00
uazoandGitHub e0e30eda51 Update check-git-apply.yaml 2022-11-09 21:33:37 +05:00
uazoandGitHub b78a5bdafe Update check-git-apply.yaml 2022-10-28 07:00:14 -02:00
uazoandGitHub 9484a27256 Update check-git-apply.yaml 2022-10-28 06:55:42 -02:00
uazoandGitHub 9011196bae Update check-git-apply.yaml 2022-10-28 06:54:52 -02:00
uazoandGitHub 7204ed9bf7 Update check-git-apply.yaml 2022-10-28 06:52:46 -02:00
uazoandGitHub 9c7592a4a6 Update check-git-apply.yaml 2022-10-28 06:47:26 -02:00
uazoandGitHub 601be8fbb3 Update check-git-apply.yaml 2022-10-28 06:46:27 -02:00
uazoandGitHub 6f2d3fc50e Update check-git-apply.yaml 2022-10-28 06:43:02 -02:00
uazoandGitHub d2324589c3 fix format 2022-10-28 06:40:31 -02:00
uazoandGitHub afd28067c1 test on push actions 2022-10-28 06:39:30 -02:00
uazoandGitHub a47f939a7d Update check-git-apply.yaml 2022-04-12 10:18:39 +02:00
uazoandGitHub 339a4b70c0 Update check-git-apply.yaml 2022-04-12 10:07:41 +02:00
uazoandGitHub af541a77c3 Update check-git-apply.yaml 2022-04-08 13:37:46 +02:00
uazoandGitHub e1dcf7a478 fix missing folder 2022-04-08 13:31:20 +02:00
uazoandGitHub 062e6a0d27 fix getting branch name 2022-03-24 17:59:47 +01:00
uazoandGitHub 172d3b361e Update check-git-apply.yaml 2022-01-20 09:20:55 +01:00
uazoandGitHub 029c891e1b Update check-git-apply.yaml 2022-01-18 10:36:07 +01:00
uazoandGitHub f19eedc9e4 Delete release.yaml 2022-01-17 17:41:57 +01:00
uazoandGitHub 0c31cd222c Create release.yaml 2022-01-17 17:41:03 +01:00
uazoandGitHub 585bb059a9 Update check-git-apply.yaml 2022-01-15 12:23:47 +01:00
uazoandGitHub 527fe50f9f Update check-git-apply.yaml 2022-01-15 12:19:17 +01:00
uazoandGitHub 19d55cbafe Update check-git-apply.yaml 2022-01-15 12:01:28 +01:00
uazoandGitHub 20e1016fdd Update check-git-apply.yaml 2022-01-15 11:55:33 +01:00
uazoandGitHub b34aa8105c Update check-git-apply.yaml 2022-01-15 11:30:58 +01:00
uazoandGitHub 5551c6070c added permissions explicitly 2022-01-15 09:13:44 +01:00
uazoandGitHub d9b7ffa145 Update check-git-apply.yaml 2022-01-15 09:00:50 +01:00
uazoandGitHub 285944dcab use actions/checkout 2022-01-15 08:46:13 +01:00
uazoandGitHub 9113b2fca2 Update check-git-apply.yaml 2022-01-14 18:01:09 +01:00
uazoandGitHub fa891eeb82 Update check-git-apply.yaml 2022-01-14 18:00:08 +01:00
uazoandGitHub d757d6c066 Update check-git-apply.yaml 2022-01-14 17:51:51 +01:00
uazoandGitHub 784770e386 Update check-git-apply.yaml 2022-01-14 17:35:27 +01:00
uazoandGitHub e0550c0591 Update check-git-apply.yaml 2022-01-14 17:32:28 +01:00
uazoandGitHub 93cd060c77 Update check-git-apply.yaml 2022-01-14 17:20:08 +01:00
uazoandGitHub 6b2d290129 Update check-git-apply.yaml 2022-01-14 17:09:10 +01:00
uazoandGitHub 4dc6db7bcf Update check-git-apply.yaml 2022-01-14 15:37:43 +01:00
uazoandGitHub a5f6339d5e Update check-git-apply.yaml 2022-01-14 15:31:44 +01:00
uazoandGitHub 8b1f11683f Update check-git-apply.yaml 2022-01-14 14:46:48 +01:00
uazoandGitHub fff5958814 Update check-git-apply.yaml 2022-01-14 14:40:40 +01:00
uazoandGitHub 1899895fae Create check-git-apply.yaml 2022-01-14 12:52:45 +01:00
Carmelo Messina 2d1539e968 Initial commit 2022-01-14 12:45:08 +01:00
179 changed files with 148 additions and 83342 deletions
-4
View File
@@ -1,4 +0,0 @@
# These are supported funding model platforms
liberapay: csagan5
custom: https://www.bromite.org/#donate
-89
View File
@@ -1,89 +0,0 @@
---
name: Bug report
about: Create a Bromite bug report
---
<!-- Welcome! Thanks for taking time to submit a bug report.
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
Are you sure this is not a Chromium bug? You have to test with Chromium before submitting a bug.
Are you using the latest version of Bromite?
If instead of a bug report you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
-->
### Bromite version
Version: `89.0...`
Arch: `arm` or `arm64` or `x86`
Android version: (example: `9.0`)
Device model: (example: `SM-G960UZKABST`)
### Flags
These are the flags changed under `chrome://flags`:
<!-- Report all the blue-highlighted flags here, those are the flags with non-default configuration -->
### Is this bug about the SystemWebView?
<!-- No support for SystemWebView installations is provided. -->
Yes/No
### Is the bug reproducible with latest version?
<!-- Do not report bugs which are not reproducible with latest version. -->
Yes/No
### Can the bug be reproduced with corresponding Chromium version?
<!--
Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
If the bug is related to functionality that does not exist in Chromium then answer "No".
-->
Yes/No
### Is this bug happening in an incognito tab?
Yes/No
### Allow ads for the site; is the bug caused by the adblocker?
Yes/No
### Is the bug a crash?
No
-- or --
Yes, this is the crash dump:
```
<paste here logcat dump individuated with 'adb logcat | grep chromium'>
```
### Describe the bug
<!-- Write here a clear and concise description of the bug. -->
### Steps to reproduce the bug
Steps to reproduce the bug:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
Do not write "any website", specify which URLs can be used to reproduce the issue.
### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
### Screenshots
<!-- If applicable, add screenshots to help explain your problem. Otherwise remove this section. -->
-35
View File
@@ -1,35 +0,0 @@
---
name: Feature request
about: Suggest a privacy-related idea for this project
---
<!-- Welcome! Thanks for taking time to submit a feature request.
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
Have you read the F.A.Q.s? https://github.com/bromite/bromite/blob/master/FAQ.md
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
Have you read the Wiki? https://github.com/bromite/bromite/wiki
If instead of a feature request you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
-->
<!-- Do not submit feature requests for extensions support or adding a search engine. -->
### Is your feature request related to privacy?
<!-- Features that are not related to privacy are not considered. -->
### Is there a patch available for this feature somewhere?
<!-- If yes then provide URL and license information. -->
### Describe the solution you would like
<!-- A clear and concise description of what you want to happen.
Do not ask "I would like feature X which is available in browser Y"; such issues are closed immediately. -->
### Describe alternatives you have considered
<!-- A clear and concise description of any alternative solutions or features you have considered. -->
+141
View File
@@ -0,0 +1,141 @@
name: Check git apply
#permissions:
# actions: none
# checks: none
# contents: none
# deployments: none
# issues: none
# packages: none
# pull-requests: write
# repository-projects: none
# security-events: none
# statuses: none
on:
push:
branches-ignore:
- 'ci'
workflow_dispatch:
inputs:
rtag:
description: 'uazo/bromite TAG or COMMIT'
required: true
default: ''
env:
RTAG: ${{ github.event.inputs.rtag }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Get value from dispatch"
run: |
if [ -z "${RTAG}" ]; then
echo "RTAG=$GITHUB_SHA" >> $GITHUB_ENV
echo "RTAG=$RTAG"
fi
- name: Prepare container
run: |
sudo apt update
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl
wget https://github.com/uazo/superpatch/releases/latest/download/SuperPatchUtils.tar.gz
tar xfz SuperPatchUtils.tar.gz
rm SuperPatchUtils.tar.gz
git clone https://github.com/uazo/bromite-buildtools
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
unzip pup_v0.4.0_linux_amd64.zip
rm pup_v0.4.0_linux_amd64.zip
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$RTAG | ./pup -p li.branch:last-child a text{})
if [ -z "${BRANCH}" ]; then
BRANCH=$(curl https://github.com/uazo/bromite/branch_commits/$RTAG a | ./pup -p li.branch:first-child a text{})
fi
if [ -z "${BRANCH}" ]; then
echo "Impossible to recover the base commit"
exit 1
fi
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Checkout 'uazo/bromite' ${{ env.BRANCH }}
uses: actions/checkout@v2
with:
repository: 'uazo/bromite'
ref: ${{ github.event.inputs.rtag }}
path: 'bromite'
fetch-depth: 1
- name: Check chromium version
run: |
VERSION=$(cat bromite/build/RELEASE)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Download chromium ${{ env.VERSION }} sources
run: |
./bin/SuperPatchUtils bromite $RTAG chromium/src
cd chromium/src
git init
git config user.email "you@example.com"
git config user.name "Your Name"
git add .
git commit -m $VERSION
git tag -a $VERSION -m $VERSION
cd ../..
- name: Apply patches ${{ github.event.inputs.rtag }}
run: |
export HOME=$(pwd)
cd ~/chromium/src
export SILENT=true
export SKIPAUTOGENERATED=true
bash ~/bromite-buildtools/apply-all-patch.sh || exit 1
rm -rf ~/bromite/build/patches-new/
rm ~/bromite/build/bromite_patches_list_new.txt
- name: Export patches
run: |
export HOME=$(pwd)
cd ~/chromium/src
bash ~/bromite-buildtools/export-all-patch.sh
cd ~/bromite
rm -rf build/patches/*
mv build/patches-new/* build/patches
rm -rf build/patches-new/
- name: Check differences CHANGES=${{ env.CHANGES }}
run: |
cd bromite
CHANGES=0 && git diff --quiet || CHANGES=1
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
if [[ CHANGES -eq 1 ]]; then
git add build/patches/*.patch
git diff --name-only --staged
# MESSAGE=$(git diff --name-only --staged)
# echo "MESSAGE='$MESSAGE'" >> $GITHUB_ENV
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a #v3.12.0
if: env.CHANGES == '1'
with:
path: bromite
base: ${{ env.BRANCH }}
#push-to-fork: uazo/bromite
add-paths: |
build/patches/*.patch
commit-message: 'AUTOMATED - git apply results'
title: Git apply result for ${{ env.BRANCH }} branch
body: ${{ env.MESSAGE }}
delete-branch: true
branch-suffix: short-commit-hash
+7
View File
@@ -0,0 +1,7 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################
*.sqlite
/.vs/ProjectSettings.json
/.vs
-949
View File
@@ -1,949 +0,0 @@
# 94.0.4606.102
* add flag to disable pull-to-refresh effect
* add recents, offlinepage and send to home screen for always incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182 and https://github.com/bromite/bromite/issues/1362)
* prompt to restart when always-incognito is enabled (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1474)
* merge patches for custom tab intents
# 94.0.4606.94
* Bromite auto-update feature, disabled by default (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/706)
* add site setting for images (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1339)
* use SM-G960U as model provided via client hints and Javascript
* drop patches already merged upstream
# 93.0.4577.110
* set enable_reporting to false (thanks to @nikolowry)
* backported patches for security issues https://crbug.com/1245578 and https://crbug.com/1251787
* disable AGSA by default
* disable UA client hint for model
* disable lock icon in address bar by default
* enable share intent (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1062)
* allow forcing external links to open in incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/728)
* avoid double restart for default tab groups flags status
# 93.0.4577.83
* dropped patch for FLoC (already disabled by upstream)
* dropped patch for build with system sysroots
* disable tab groups by default (needs restart)
* added 'services/network/public/mojom' to ad blocker patch to avoid a build error
# 92.0.4515.176
* use upstream feature to prevent default search engine permissions grants
* slightly improve error message for gateway attacks prevention error
# 92.0.4515.134
# 92.0.4515.125
* replace patch for missing API keys warning
* fix subresource filter not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1299)
# 92.0.4515.103
* disable User Agent client hints
* fix builds with system sysroots
* force text/x-suse-ymp to be downloaded
# 91.0.4472.158
* added x64 releases
# 91.0.4472.146
* removed flags for device motion/orientation (fixes https://github.com/bromite/bromite/issues/1204)
* prevent crash on download on API level 21 (fixes https://github.com/bromite/bromite/issues/1184)
* fix crash reporting garbled UI for small screens (thanks to @uazo, https://github.com/bromite/bromite/pull/1236)
* add flag to enable/disable vibration API (fixes https://github.com/bromite/bromite/issues/1045)
# 91.0.4472.143
* add support for ISupportHelpAndFeedback
* JIT-less toggle (fixes https://github.com/bromite/bromite/issues/1235)
* enable crash reporting UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/944)
# 91.0.4472.102
* fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154)
# 91.0.4472.97
* add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152)
* enable IntentBlockExternalFormRedirectsNoGesture by default
* add flag to disable external intent requests
* fix for tab collection temporary/non-exportable (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1138)
# 91.0.4472.50
* unexpire tab group flags `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
* replace known good hostname used for DoH test (fixes https://github.com/bromite/bromite/issues/1148)
* drop patch to disable preview fetching
* drop patch to restore horizontal tab switcher
# 90.0.4430.204
* fix for custom tab intent tab crashes when in always incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1116)
# 90.0.4430.101
* disable RTCGetCurrentBrowsingContextMedia by default
* disable FLoC by default
# 90.0.4430.92
* restore horizontal tab switcher feature (fixes https://github.com/bromite/bromite/issues/1077)
* fix a couple of bugs in proxy saving UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1072)
* disable feeds V2 toggle (fixes https://github.com/bromite/bromite/issues/1070)
* allow fetching field trials from flags (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1021)
* add AllowUserCertificates flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/921)
* add IsCleartextPermitted flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1068)
# 90.0.4430.74
* re-added patch for User agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1049)
* fix always-incognito custom tab intents issues (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1047 and https://github.com/bromite/bromite/issues/1051)
* prevent Omnibox URL elisions by default
# 90.0.4430.59
* fix menu items not properly displayed with tab overflow menu regroup (fixes https://github.com/bromite/bromite/issues/963)
* fix text displayed for menu entry to bookmark all tabs
* bookmarks import/export: disable SAF by default (fixes https://github.com/bromite/bromite/issues/1039)
* disable offline measurement background task
* dropped patch to show warnings for TSLv1.0/v1.1 connections (upstream now disallows them)
* disable AImageReader by default on Android 9 and below for Qualcomm (fixes https://github.com/bromite/bromite/issues/1005)
# 89.0.4389.117
* disable AImageReader by default on Android 9 and below for ARM (fixes https://github.com/bromite/bromite/issues/1005)
* log checksum of AdBlock filters
# 89.0.4389.100
* enable AImageReader by default (fixes https://github.com/bromite/bromite/issues/1005)
* fix missing flag for AImageReader
* move incognito snapshots flag to proper section (fixes https://github.com/bromite/bromite/issues/1006)
* add missing icon for exit menu
* implement SAF for bookmarks export functionality (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/831)
# 89.0.4389.92
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/1000)
* introduce Alt+D hotkey to focus address bar (fixes https://github.com/bromite/bromite/issues/979)
* use 64-bit ABI for webview processes (fixes https://github.com/bromite/bromite/issues/997)
* use dedicated folder for bookmark all tabs
* fix Javascript and cookies permissions missing (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/990)
* fix missing enable save data header flag (fixes https://github.com/bromite/bromite/issues/989)
* fix menu items not properly displayed with tab overflow menu regroup (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/963)
# 89.0.4389.78
* make all favicon requests on-demand
* restored older icon for view source menu item
* prevent adblock filters update check on app start (fixes https://github.com/bromite/bromite/issues/967)
* removed UI for adblock filters (fixes https://github.com/bromite/bromite/issues/941)
* dropped patch for swapped favicons bug
* dropped patch to enable reduced-referrer-granularity by default (already present upstream)
* dropped password reuse detection patch
* dropped UA customization patch
* enabled PartitionExpectCTStateByNetworkIsolationKey and PartitionDomainReliabilityByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/985)
# 88.0.4324.207
* add flag for save-data-header
* add option to force tablet UI
* fix bug with adblock filters not being downloaded correctly (fixes https://github.com/bromite/bromite/issues/960)
* move up bookmark all tabs menu item (fixes https://github.com/bromite/bromite/issues/943)
* fix icons for exit and view source menu items
# 88.0.4324.187
* fix exit menu item not working in tablet mode
* add menu item to bookmark all tabs (fixes https://github.com/bromite/bromite/issues/570)
* enable app overflow menu icons by default
* UI for adblock filters (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/811)
* dropped patch to not permit user-installed certificates
* ignore enterprise policies for secure DNS (fixes https://github.com/bromite/bromite/issues/832)
# 88.0.4324.185
* fix favicons fallback search (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/788)
* fix potential DIAL crash when network state changes (thanks to @Ahrotahn)
* fix crash when opening links in incognito-only mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/899)
* disallow empty custom user agent (thanks to @uazo)
# 88.0.4324.149
* fix proxy PAC URL option not working (fixes https://github.com/bromite/bromite/issues/908)
* store proxy configuration in LocalState instead of Profile (thanks to @uazo)
* fix toggle for reversing the meaning of bypass rules (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/884)
* do not permit user-installed certificates
# 88.0.4324.141
* fix bookmarks not opening (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/891)
* fix proxy page not loading (fixes https://github.com/bromite/bromite/issues/890)
# 88.0.4324.95
* fix broken recent tabs behaviour (fixes https://github.com/bromite/bromite/issues/886)
* re-introduce flags for number of raster threads (fixes https://github.com/bromite/bromite/issues/875)
* avoid initializing histogram data for the WebView (https://github.com/bromite/bromite/issues/873)
* dropped patch for manifest changes for Q/R (already present upstream)
* fix check for HTML extension in bookmark import dialog
# 87.0.4280.131
* enable all network isolation features (fixes https://github.com/bromite/bromite/issues/836)
* disable unified autoplay feature (fixes https://github.com/bromite/bromite/issues/804)
# 87.0.4280.106
* enable SplitCacheByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/836)
* fix random timezone option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/828)
* disable autofill server communication by default
* ask permission to play protected media by default
* disable SystemWebView variations support
# 87.0.4280.81
* fix text fragment not disabled by default, unexpire flag (fixes https://github.com/bromite/bromite/issues/803)
* turn AImageReader off by default on ARM64 (fixes https://github.com/bromite/bromite/issues/814)
* fix issue with global autoplay settings (thanks to @uazo, https://github.com/bromite/bromite/pull/825)
* fix issues with user agent customization (thanks to @uazo, https://github.com/bromite/bromite/pull/823)
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/821)
# 87.0.4280.68
* user agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/798)
* fix for intent handling for local apps on Android 11 (https://github.com/bromite/bromite/pull/816)
# 87.0.4280.67
# 86.0.4240.194
* fix native pages displaying incorrectly with the sticky desktop mode (thanks to @uazo)
* re-introduce simplified NTP (fixes https://github.com/bromite/bromite/issues/701)
* re-introduce site settings to block autoplay (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/791)
* fix Omnibox flag not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/789)
# 86.0.4240.181
* allow sticky desktop mode for all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/780)
# 86.0.4240.112
* fix crash in new overflow menu (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/771)
# 86.0.4240.99
# 86.0.4240.92
* upstream fix for video playback audio issue (fixes https://github.com/bromite/bromite/issues/755)
* fix order of entries in privacy settings (fixes https://github.com/bromite/bromite/issues/758)
# 86.0.4240.73
* re-introduce ARM64 AImageReader mitigations (fixes https://github.com/bromite/bromite/issues/766)
* re-introduce menu items for autocomplete, autofill assistant and contextual search (fixes https://github.com/bromite/bromite/issues/763)
# 86.0.4240.70
* fixed crash on unused menu item tap (fixes https://github.com/bromite/bromite/issues/760)
* fixed issue on new installations without DoH configuration (fixes https://github.com/bromite/bromite/issues/761)
# 86.0.4240.66
* switch to upstream UI for DoH URL customization
* remove weblayer dependency on Play Services
* build fixes for password service
* removed obsolete patch to kill Translate
* removed patch to revert unified consent code
* removed patch for dav1d library
* removed patch for improved cookie controls defaults
* removed patches for ARM64 AImageReader issues
# 85.0.4183.114
# 85.0.4183.110
* hardening against incognito mode detection
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/734)
# 85.0.4183.94
* disable the DIAL repeating discovery
* removed patch for session-only cookies support
* add timezone customization patch (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/331)
* fixed bug happening when configuring proxies in incognito mode (thanks to @uazo)
# 85.0.4183.86
* fix LocationBarPhone app crash at startup (fixes https://github.com/bromite/bromite/issues/565)
# 85.0.4183.84
* fix crash in About page (fixes https://github.com/bromite/bromite/issues/710)
* fix adding more than one proxy (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/679)
* fix system proxy configuration (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/377)
# 85.0.4183.82
* fixes bookmark button not working with always-incognito (fixes https://github.com/bromite/bromite/issues/654)
* disable scroll-to-text-fragment
* remove NTP blocklisted URLs when adding an URL as bookmark
* removed duet flags
* unexpire `#darken-websites-checkbox-in-themes-setting` flag
* rollback dav1d upgrade which breaks x86
# 84.0.4147.132
* fix exit menu item not always working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/673)
* session-only cookies site settings option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/142)
* add setting to enable history on incognito mode (thanks to @uazo)
* removed old non-working site settings patches
# 84.0.4147.121
* removed Qwant search engine
* fixed zh_CN translations
* added patch to not embed non-free unrar library (fixes https://github.com/bromite/bromite/issues/674)
* enable improved cookie controls by default
# 84.0.4147.119
* update zh_CN translations
* disable CORS RFC1918 (fixes https://github.com/bromite/bromite/issues/664)
* restore duet flags (fixes https://github.com/bromite/bromite/issues/667)
# 84.0.4147.113
* block gateway attacks via websockets (fixes https://github.com/bromite/bromite/issues/590)
* enable prefetch-privacy-changes by default (fixes https://github.com/bromite/bromite/issues/659)
* enable reduced-referrer-granularity by default (fixes https://github.com/bromite/bromite/issues/659)
# 84.0.4147.106
* fixed bug with Javascript site settings not showing
* add exit menu item to overview menu (fixes https://github.com/bromite/bromite/issues/619)
# 84.0.4147.95
* show warnings for TLSv1.0/TLSv1.1 connections (fixes https://github.com/bromite/bromite/issues/645)
* fix bug with unconfigured DoH (fixes https://github.com/bromite/bromite/issues/646)
# 84.0.4147.90
* added menu item to view source of current page
* fixed dialog for SSL/TLS errors (fixes https://github.com/bromite/bromite/issues/638)
* build with feeds support due to upstream build flags combination bugs
# 83.0.4103.119
* restored non-CFI builds for x86
# 83.0.4103.101
* enable HEVC and Dolby Vision
# 83.0.4103.93
* fix undesired replacement for search engines (fixes https://github.com/bromite/bromite/issues/595)
* fix resume flag not visible
# 83.0.4103.76
* fixed inverted Omnibox flag
* fixed LocationBarPhone/LocationBarTablet crash (fixes https://github.com/bromite/bromite/issues/565)
# 83.0.4103.53
* updated zh_CN translations
* mitigation for LocationBarPhone crash (https://github.com/bromite/bromite/issues/565)
# 83.0.4103.46
* add zh_CN missing translations (fixes https://github.com/bromite/bromite/issues/546)
* change default mode for WebRTC (fixes https://github.com/bromite/bromite/issues/553)
* add flag to allow screenshots of incognito tabs (fixes https://github.com/bromite/bromite/issues/551)
* reintroduced patches for disabling AImageReader
* fixed DevTools issue with domain substitution (fixes https://github.com/bromite/bromite/issues/526)
* drop patch to disable QUIC by default
* drop patch for DoH minimum timeout (upstream also implemented it)
* dropped patch for removal of support of CCT dynamic modules (upstream also removed it)
* removed upstream patch for SD card not found issue (upstream merged it)
* enable reporting because of COEP
# 81.0.4044.127
* fix always-incognito crashes (https://github.com/bromite/bromite/issues/135 and https://github.com/bromite/bromite/pull/529)
* improved crash uploader mock by calling done callback
# 81.0.4044.106
* remove option to add NTP as homepage (fixes https://github.com/bromite/bromite/issues/517)
# 81.0.4044.97
* disable browser auto-login by default
* show download prompt again
# 81.0.4044.83
# 81.0.4044.76
# 81.0.4044.70
* backport surface control fix (fixes https://github.com/bromite/bromite/issues/445)
# 81.0.4044.63
* use upstream fix for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
* do not compile QR code sharing
* remove obsolete patch for GCM experiment status
* drop 2 patches for AImageReader crash fix (upstream has the same revert patches)
# 80.0.3987.118
* disable AImageReader for all ARM64 devices (fixes https://github.com/bromite/bromite/issues/497)
* use upstream possible workaround for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
# 80.0.3987.109
* restored GPU workaround for the ARM/ARM64 AImageReader crash (https://github.com/bromite/bromite/issues/445)
# 80.0.3987.95
* enable user-agent freeze (fixes https://github.com/bromite/bromite/issues/483)
* fix issue with AMP (fixes https://github.com/bromite/bromite/issues/488)
* fix crash on home page (fixes https://github.com/bromite/bromite/issues/484)
# 80.0.3987.78
* removed ungoogled-chromium patch for non-remote developer tools resources
* removed patch for 64-bit webview (it is now a default from upstream)
* removed patch for enabling dark mode menu entry by default (it is now a default from upstream)
* removed patch for enabling download rename by default (it is now a default from upstream)
* removed some redundant Iridium safe browsing patches
# 79.0.3945.139
* remove patch to automatically disable video decoding acceleration on Android 10+ and arm64
* fix referral headers bug in non-DoH requests (fixes https://github.com/bromite/bromite/issues/470)
* disable smart selection by default, enable web search in incognito mode
* disable DRM media pre-provisioning (fixes https://github.com/bromite/bromite/issues/471)
# 79.0.3945.123
* updated User-agent version
* increase minimum DoH timeout to 400ms (fixes https://github.com/bromite/bromite/issues/437)
# 79.0.3945.111
* automatically disable video decoding acceleration on Android 10+ and arm64
* restore enable-horizontal-tab-switcher flag
* remove non-working contextual search settings
* disable QUIC by default
* remove logging for DoH timeouts
# 79.0.3945.107
* always show cookies, javascript and ads site settings (fixes https://github.com/bromite/bromite/issues/133)
* remove global ads and javascript menu options
# 79.0.3945.100
* log timeout values for DoH
* enable DFM (fixes https://github.com/bromite/bromite/issues/441)
* updated User-agent version
# 79.0.3945.94
* removed patches which do not apply anymore (Widevine version punting, always show homepage settings, network errors UMA recording)
* removed split APKs support (Play integration)
* disabled password reuse functionality (Play integration)
* re-introduced minimal headers for DoH
* removed Startpage
* disable feed support
* updated User-agent version
# 78.0.3904.130
* support user-specified subresources filter URL (fixes https://github.com/bromite/bromite/issues/2)
* revert removal of flag for disabling pull-to-refresh effect
* fix crash when entering no DoH URL (fixes https://github.com/bromite/bromite/issues/430)
* added Peter Lowe's Ad and tracking server list (fixes https://github.com/bromite/bromite/issues/423)
* enabled dav1d_decoder
# 78.0.3904.119
* replace fixed DNS-over-HTTPS feature flag with user-customizable option
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/424)
# 78.0.3904.105
* add flag to disable WebGL (fixes https://github.com/bromite/bromite/issues/411)
* more selective AMP sanitization (fixes https://github.com/bromite/bromite/issues/410)
* build optimizations to disable debug information
# 78.0.3904.93
* introduce flags to disable browser fingerprinting capabilities (fixes https://github.com/bromite/bromite/issues/402)
* major enhancements to AMP sanitization for news/images
* remove duplicate network predictions privacy setting
* disable some signed exchanges features
* ungoogled-chromium-android: patches to block all GCM/GMS/PlayServices integrations
* ungoogled-chromium: block all connection requests to substituted domains
* disable GVR services build flag
* disable HEAD requests for single words typed and clicked in Omnibar
* increase number of autocomplete matches from 5 to 10
* replace DoH probe domain with RIPE domain
* merged fixes for adblock/javascript menu text (https://github.com/bromite/bromite/pull/398)
* updated User-agent phone model and version
# 78.0.3904.72
* updated User-agent phone model and version
* fix network predictions bug (fixes https://github.com/bromite/bromite/issues/387)
* fix crash in settings (fixes https://github.com/bromite/bromite/issues/388)
# 78.0.3904.63
* replace Beta DoH service URL for Google (https://developers.google.com/speed/public-dns/docs/doh/migration)
* disable AImageReaderMediaPlayer until upstream bug is fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=977583)
* disabled face detection provider
* removed non-working SystemWebView adblock patch (not working since v77)
* bring back some privacy options which upstream moved to Sync settings (fixes https://github.com/bromite/bromite/issues/383)
# 77.0.3865.104
* revert upstream commit for search privacy options and related translations removal (fixes https://github.com/bromite/bromite/issues/375)
* remove unused patch for enabling subresource filter on all sites
# 77.0.3865.95
# 77.0.3865.81
* use native subresource filtering instead of Bromite engine
* introduce Bromite AdBlockUpdate service
* keep using Bromite engine for SystemWebView
* enable subresource filter for all sites
* disable subresource filter popup
* enable IPv6 probing by default
* drop DnsTransaction default security level patch
* drop patch to visualize all type of extensions
* drop patches for Network Service
* enable CFI for all architectures except x86
# 76.0.3809.129
* disable CFI to fix x86 crashes (fixes https://github.com/bromite/bromite/issues/357)
# 76.0.3809.115
* disable search-ready omnibox by default
* disable unified consent
# 76.0.3809.100
* use default feature flags for autofill (fixes https://github.com/bromite/bromite/issues/348)
# 76.0.3809.91
# 76.0.3809.85
* add flag to toggle Network Service
* disable Network Service by default
* do not record UMA for network errors
* use fixed User Agent and Android OS version
* dropped patch for history requirement of user gesture
# 75.0.3770.139
* disable media router and remoting by default (fixes https://github.com/bromite/bromite/issues/281)
* enable CFI in GN build flags
# 75.0.3770.132
# 75.0.3770.109
* disable payment support by default
* disable background sync by default
* better patch from GrapheneOS/Vanadium for disabling sensors access (fixes https://github.com/bromite/bromite/issues/319)
* use new patch for content settings sensors allow/block (fixes https://github.com/bromite/bromite/issues/319)
* fix impossible values in Battery Status API (fixes https://github.com/bromite/bromite/issues/322)
# 75.0.3770.86
# 75.0.3770.82
# 75.0.3770.70
* enable changing default downloads storage location by default
* enable download rename option by default
* disable offline pages in the downloads home to be opened in CCT by default
* increase minimum SDK from 17 to 19 (fixes https://github.com/bromite/bromite/issues/310)
* prefs: disable SigninAllowed by default
* prefs: always prompt for download directory by default
* build: remove calling untrusted hooks
# 75.0.3770.53
* fix crash when downloading or from browser-initiated requests (fixes https://github.com/bromite/bromite/issues/309)
# 75.0.3770.50
* disable dynamic module loading
* more fixes to allow building for SDK 17
# 74.0.3729.162
* remove recent tabs signin
# 74.0.3729.154
# 74.0.3729.141
# 74.0.3729.122
* remove more unnecessary permissions
# 74.0.3729.106
* remove account/sync menu entries (fixes https://github.com/bromite/bromite/issues/285)
* fix failed debug builds
# 74.0.3729.86
* enable dark mode settings entry by default
* fix permission request for Play services on reboot (fixes https://github.com/bromite/bromite/issues/281)
# 74.0.3729.80
* increase minimum SDK version to 17 (Jelly Bean 4.2)
* dropped obsolete patch for hyperlink auditing disable
# 73.0.3683.107
* dropped patch to disable smooth scrolling
* fixed custom tab intents issue (fixes https://github.com/bromite/bromite/issues/279)
# 73.0.3683.105
* removed Fanboy's Annoyance List and Peter Lowe's adservers list from filters
# 73.0.3683.97
* dropped redundant patch to hide NTP tiles (use home page + about:blank)
# 73.0.3683.88
* add option to use home page as NTP
# 73.0.3683.82
* remove force home page button flag
* enable site per process isolation for devices with memory > 1GB
* use 64-bit processes for SystemWebView
* disable local field trials seed (redundant)
* fix patch for classic new tab page (redundant)
# 73.0.3683.79
* add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
* DoH: include upstream patch for DNS secure mode
* DoH: enable DNS secure mode by default
# 73.0.3683.70
# 73.0.3683.61
* drop patches with functionality now available from upstream (DuckDuckGo and Qwant search engines, TLS 1.3 final)
* add only DuckDuckGo Lite search engine
* provide image URL for Qwant
* disable safe browsing subresource filter by default
* fix PAC URL support in proxy configuration
# 72.0.3626.120
* add support for resource type in adblock engine (fixes https://github.com/bromite/bromite/issues/115)
* adblock engine speed optimizations
* use adblock engine also in SystemWebView
* add back uBlock Origin and EasyList filters
* added Fanboy's Annoyance List
* remove AdGuard filters
# 72.0.3626.119
* use AdGuard filters
* fixes for new tile rows usage
* re-introduce patch to hide NTP tiles
* disable NTP tile metrics collection
# 72.0.3626.114
* use 4 tile rows instead of 2 in the new tab page
* do not grant geolocation permission to default search engine (fixes https://github.com/bromite/bromite/issues/250)
# 72.0.3626.108
# 72.0.3626.99
# 72.0.3626.87
* update bookmarks view after import
# 72.0.3626.81
* serve empty content for blocked scripts/images (fixes https://github.com/bromite/bromite/issues/238)
* keep support of Jelly Bean (workaround for upstream https://bugs.chromium.org/p/chromium/issues/detail?id=923477)
# 72.0.3626.73
# 72.0.3626.68
* do not ignore save prompt for users without SD card (workaround for upstream wontfix https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
* remove third_party/analytics patch (now fixed upstream in https://chromium.googlesource.com/chromium/src.git/+/64d6a56f094efbab83802c07ad3ddffa014f9903)
* AV1 codec support
# 71.0.3578.132
* add patches from AndroidHardening project (fixes https://github.com/bromite/bromite/issues/226)
# 71.0.3578.123
* disable jumbo builds (fixes https://github.com/bromite/bromite/issues/216 and https://github.com/bromite/bromite/issues/219)
* disable preview fetching
* do not consider Android Jelly Bean unsupported
# 71.0.3578.120
* fix breakage of translate quick answers by anti-AMP (fixes https://github.com/bromite/bromite/issues/210)
# 71.0.3578.115
* add AdGuard DNS-over-HTTPS option
* use green icon for SystemWebView
# 71.0.3578.110
# 71.0.3578.104
* fix AMP links sanitisation; have it working for news as well (fixes https://github.com/bromite/bromite/issues/202)
* revert upstream patch responsible for the broken save dialog prompt (upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
# 71.0.3578.101
# 71.0.3578.98
* do not ask permissions for camera when importing bookmarks (fixes https://github.com/bromite/bromite/issues/200)
# 71.0.3578.88
* add proxy configuration page (see https://github.com/bromite/bromite/wiki/ProxyConfiguration)
* use more recent versions in User-Agent (fixes https://github.com/bromite/bromite/issues/156)
# 71.0.3578.85
* fix blurry adaptive icon (fixes https://github.com/bromite/bromite/issues/197)
# 71.0.3578.76
# 71.0.3578.72
* add flag to disable IPv6 probes
# 70.0.3538.107
* added adaptive icon (fixes https://github.com/bromite/bromite/issues/181)
* do not change randomisation at each call (fixes https://github.com/bromite/bromite/issues/177)
* do not enable #enable-scroll-anchor-serialization by default
# 70.0.3538.102
* do not grant notifications to default search engine
* remove all promos from bookmark manager page
* re-introduced various patches to eradicate binary blob dependencies (only Cast left)
* remove contacts picker permission
# 70.0.3538.95
* fix crash on bookmark edit activity (fixes https://github.com/bromite/bromite/issues/172)
* fix slow chrome://flags (fixes https://github.com/bromite/bromite/issues/173)
* enable TLS 1.3 final support by default (fixes https://github.com/bromite/bromite/issues/174)
* dropped some patches related to GCM/GMS on suspicion of being related to random crashes
# 70.0.3538.87
* enable history requirement of user gesture (fixes https://github.com/bromite/bromite/issues/171)
* enable serialization of scroll position changes while loading (fixes https://github.com/bromite/bromite/issues/171)
* remove passwords keyboard accessory option (fixes https://github.com/bromite/bromite/issues/171)
* some improvements to bookmark import/export interaction
* add flag to disable orientation API, disabled by default
* disable device motion API by default (fixes https://github.com/bromite/bromite/issues/171)
# 70.0.3538.83
* fix keep session cookies option showing on all site settings views
* fix blank site settings entry showing (fixes https://github.com/bromite/bromite/issues/166)
* offer builtin autocomplete for chrome://flags quick access
# 70.0.3538.80
* add flag to disable video resume functionality, allowing to not pause video playback on tab switch (fixes https://github.com/bromite/bromite/issues/108)
* prevent "are you there" prompts from appearing when playing videos
* completely disable update scheduler checks to fix a related crash
# 70.0.3538.77
* disable generic sensor APIs by default (fixes https://github.com/bromite/bromite/issues/160)
* introduce flag to disable device motion API (fixes https://github.com/bromite/bromite/issues/160)
* add Quad9 as a DNS-over-HTTPS (DoH) option (fixes https://github.com/bromite/bromite/issues/140)
# 70.0.3538.71
* fix bug with canvas fingerprinting (fixes https://github.com/bromite/bromite/issues/154)
# 70.0.3538.67
* re-enabled DNS-over-HTTPS (DoH) flag (fixes https://github.com/bromite/bromite/issues/139)
* dropped GCM removal patch
* disable kSigninAllowedOnNextStartup by default
* permanently disable query-in-omnibox (fixes https://github.com/bromite/bromite/issues/143)
# 69.0.3497.113
* disabled DNS-over-HTTPS (DoH) flag, not working since 69.0.3497.73 (see https://github.com/bromite/bromite/issues/139)
# 69.0.3497.109
# 69.0.3497.102
* ungoogled-chromium: disable network time tracker
* ungoogled-chromium: remove third-party/analytics
* ungoogled-chromium: always use local Devtools instead of remote files
* build without safebrowsing
* drop "Hide NTP tiles" flag
# 69.0.3497.91
* fixed crash when accessing site settings media preferences (fixes https://github.com/bromite/bromite/issues/122)
# 69.0.3497.73
* enabled WebRTC
* drop clear HTTP cache patch
# 68.0.3440.126
* add option to disallow custom tab intents (fixes https://github.com/bromite/bromite/issues/117)
* add option to keep local data until browser exit (fixes https://github.com/bromite/bromite/issues/56)
* remember preference for tabs persistence option
* extend anti-AMP to all search results
# 68.0.3440.121
* add option to not persist tabs across sessions (fixes https://github.com/bromite/bromite/issues/106)
* always incognito mode (fixes https://github.com/bromite/bromite/issues/18)
* disable domain reliability (ungoogled-chromium)
* more efficient adblock interception by using proper handler
* fix log message about default maximum connections
* improvement for exit menu patch
# 68.0.3440.110
* add import action to Bookmarks activity page
* use different user-agent version based on Android OS version
# 68.0.3440.90
* reduce rects randomisation by factor of 100
* use a fixed user-agent (fixes https://github.com/bromite/bromite/issues/103)
# 68.0.3440.87
* add export action to Bookmarks activity page
# 68.0.3440.81
* fix issue with filters with an excluded domain option
# 68.0.3440.72
* fix crash during some canvas rendering (fixes https://github.com/bromite/bromite/issues/95)
* new approach to adblock filtering (fixes https://github.com/bromite/bromite/issues/90)
* add a flag to enable higher maximum connections per host limit (fixes https://github.com/bromite/bromite/issues/61)
* add a flag to disable custom tab intents (fixes https://github.com/bromite/bromite/issues/81)
* add a flag to have an always-empty new tab page (fixes https://github.com/bromite/bromite/issues/82)
* reduced randomization of TextMetrics and ClientRects results
* disable ads metrics by default
* disable all field trials (fixes https://github.com/bromite/bromite/issues/83)
* re-introduced own battery API patch (fixes https://github.com/bromite/bromite/issues/80)
# 67.0.3396.107
* removed patch to use Android Media Player for URLs (fixes https://github.com/bromite/bromite/issues/71)
# 67.0.3396.101
* set home page to new tab page
* adjust order of new menu entries, remove help menu item (fixes https://github.com/bromite/bromite/issues/76)
* remove some Play Services integrations: Auth, Vision, GCM
* remove TOS/metrics and translate
* net/cert: increase default key length for newly-generated RSA keys
* dns: send IPv6 connectivity probes to RIPE DNS rather than Google
* profile-resetter: do not tick send-settings by default
* autofill: disable autofill download manager
* first_run: deactivate autoupdate globally
* safe_browsing: disable incident reporting
* safe_browsing: disable reporting of safebrowsing override
* safe_browsing: disable cookie transmission
* extensions: always show component extensions in the ext list
* translate: disable fetching of translate languages from server
# 67.0.3396.95
* reduce headers sent in DoH requests (fixes https://github.com/bromite/bromite/issues/70)
* serve DoH requests with maximum priority
* `CloudFlare` -> `Cloudflare` (fixes https://github.com/bromite/bromite/issues/73)
* fingerprint mitigations: cover also `ConvertToArrayBufferContents`
* removed redundant own patch for battery API
# 67.0.3396.92
* improve randomization for each retrieved Canvas data (fixes https://github.com/bromite/bromite/issues/69)
# 67.0.3396.88
* add flag for DNS-over-HTTPS (Google experimental DNS) (fixes https://github.com/bromite/bromite/issues/68)
* disable signin, translate and data saver UI/internal components (fixes https://github.com/bromite/bromite/issues/67)
* rename `GoogleEN` -> `Google In English` (fixes https://github.com/bromite/bromite/issues/66)
* re-enabled text metrics and ToDataURL, ToBlob with randomization of color data (fixes https://github.com/bromite/bromite/issues/52)
* open YouTube links in Bromite
* use Android Media Player for URLs
* add exit menu item
* hide "send reports to Google" menu item
# 67.0.3396.82
# 67.0.3396.76
# 67.0.3396.72
* add global toggle for adblock engine (https://github.com/bromite/bromite/issues/53)
# 67.0.3396.67
# 66.0.3359.202
* fix DevTools integration (https://github.com/bromite/bromite/issues/23)
* allow toggling of Javascript from New Tab Page (fixes https://github.com/bromite/bromite/issues/60)
# 66.0.3359.200
# 66.0.3359.196
# 66.0.3359.188
* increase max (persistent) connections per server from 6 to 15
* preliminary work for better canvas fingerprinting mitigations
# 66.0.3359.161
# 66.0.3359.148
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
* reduce randomization for client rects from 5% to 3%
# 65.0.3325.230
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
# 65.0.3325.218
* always set WideVine version
# 65.0.3325.204
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
* set audio latency to fixed number
# 65.0.3325.198
* re-landed support for third-party AdBlock filters
* completed patches cleanup
# 65.0.3325.190
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
# 65.0.3325.176
* block plugins enumeration API
* block battery API
* remove device name and build id from User Agent
* added Qwant search engine
* disable non-working 3rd-party filters support
# 64.0.3282.204
* use H264 NEON optimizations also for arm64
* fix build of Stable channel
* started building vanilla Chromium releases as well
# 64.0.3282.193
* disable reporting
# 64.0.3282.182
* add support for domain-based adblock filters
* optimized memory allocation for filters
# 64.0.3282.168
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
* never fetch most popular sites for new tab initialization, disable logo on new tab page
* some improvements to adblock filters
* disabled signin (ungoogled-chromium) (https://github.com/bromite/bromite/issues/31 and https://github.com/bromite/bromite/issues/11)
* disabled webRTC and crash uploaders (ungoogled-chromium)
* disabled translate (ungoogled-chromium)
* disabled Gaia & GCM (ungoogled-chromium)
* added clear HTTP cache menu item (ungoogled-chromium)
* disabled Google host detection (ungoogled-chromium)
* disabled profile avatar downloading (ungoogled-chromium)
* disabled intranet redirect detector (ungoogled-chromium)
* disabled plugin untraceable URLs (ungoogled-chromium)
# 64.0.3282.149
# 63.0.3239.150
* fixed crash when clicking on address bar lock (page info) or opening site settings (https://github.com/bromite/bromite/issues/28)
* build H264 with NEON optimizations for ARMv7
* more builds for arm64 architecture
# 63.0.3239.144
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
# 63.0.3239.129
# 63.0.3239.122
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
* hyperlinks sanitization fixed and now accessible from Google logo click
* now building and publishing SystemWebView apks
# 63.0.3239.118
* limit impact of AMP-removal to not break tabs (https://github.com/bromite/bromite/issues/20)
* fix DuckDuckGo and StartPage suggestions (https://github.com/bromite/bromite/issues/19)
* revert /deep/ and ::shadow feature drop to attempt fixing DevTools support (https://github.com/bromite/bromite/issues/23)
* remove also ads from search results
* add Google search engine with English-only results, no RLZ and field trials
* fix build of x86 version (was broken in previous version)
# 63.0.3239.85
* no suggest URL for DuckDuckGo (https://github.com/bromite/bromite/issues/19)
* fixed 4chan blocking rule
* limit AMP links cleanup to search results only (fixes broken images/news result tabs)
# 63.0.3239.78
* correctly set version and build numbers
# 63.0.3239.73
# 63.0.3239.64
* fixed an issue with incognito new tab
* permanent disable for ToS/metrics and unused auto-updates check
# 63.0.3239.46
* removed search engine geolocation default patch
# 63.0.3239.38
# 63.0.3239.27
# 63.0.3239.24
* convert AMP search results to regular search results
# 63.0.3239.15
* remove URL tracking from Google search results
* disable webRTC by default (https://github.com/bromite/bromite/issues/9, still not working proper)
* do not enable search engine geolocation by default
* use own package name (closes https://github.com/bromite/bromite/issues/1)
* use 64bit WebView process
# 63.0.3239.10
* attempt enabling API keys (didn't work)
* added StartPage search engine (closes https://github.com/bromite/bromite/issues/3)
# 63.0.3239.6
* added Bromite patch for Google search results click-tracking removal
* added x86 target CPU
* fixed red blink frame
# 63.0.3235.2
* first release with NoChromo adblocking patch
* Bromite patch: disable NTP remote suggestions
* added some Inox/Iridium/Ungoogled-Chromium patches, namely:
* DuckDuckGo search engine
* disable battery status service
* disable formatting in OmniBox
* disable GCM status checks
* use local fonts instead of fonts from Google servers
* disable updater pings
* do not enable Google integrations by default (translation, lookup, etc)
* disable the ad promo system
* do not store passwords by default
* do not fetch Google promotions
* restore classic NTP
* only keep cookies until exit
* block third-party cookies
-82
View File
@@ -1,82 +0,0 @@
# Frequently Asked Questions
## Does Google Sync/Translate/Data saver work?
No.
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
Additionally, these features would not be privacy-friendly.
## Does Bromite require root?
No.
## Is Bromite de-googled?
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
Bromite uses [ungoogled-chromium's python script](https://github.com/Eloston/ungoogled-chromium/blob/master/utils/domain_substitution.py) to disable URLs in the codebase since version `78.0.3904.93`.
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
## Does Bromite support DRM media?
Yes, in order to play protected/encrypted media content the browser will use Android's DRM media framework to automatically negotiate access (same as Chromium).
This means for example that requests to Android license servers will be performed (`www.googleapis.com`), see https://w3c.github.io/encrypted-media/#direct-individualization
To disable this functionality you should disable protected content playback from Site settings -> Multimedia.
## What is the SystemWebView?
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
Ad-blocking was present and always enabled in the SystemWebView from version `72.0.3626.120` till version `77.0.3865.104`, when it stopped working due to [upstream NetworkService changes](https://docs.google.com/document/d/1TZEuPvr2KAbP4_TZpuuwtEEArQsyAkc2HDu68l66YwU/edit?ts=598244df#heading=h.ougoi5i6508y).
## How to enable DNS-over-HTTPS?
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
## Can you add HTTPS everywhere?
No.
We cannot add add-ons to Bromite (merely some features).
## Is Bromite on Play Store?
No, and this is unlikely to change. Many limitations apply for submissions there, including which ads are allowed to be blocked.
Bromite favors user freedom in software choice: the device is yours so you get to choose which software to run on it, end of the story.
## Is Bromite on F-Droid?
It is not on the official F-Droid repository and there are no (more) plans to submit it.
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
## Does Bromite support WebRTC?
Yes, since version 69. While the desktop version of Chromium has an option to disable it (video/audio site settings), the Android version cannot.
The WebRTC functionality has always been using safe defaults to prevent leaks (disabled multiple routes and non-proxied UDP).
## Using Bromite will favour the monopoly of the Chromium/Blink engine, why do you develop and maintain Bromite?
In short, to show what a Chromium-based engine could do **for the user** if the user experience and needs were the main focus of modern browser design.
For an Android browser using an alternative engine see [Fennec F-Droid](https://f-droid.org/en/packages/org.mozilla.fennec_fdroid/).
## Does Bromite support extensions?
No; Bromite will support extensions only if upstream (Chromium) does, or similarly another project maintains the patch and functionality.
## Why do push notifications not work on this website?
The [Chromium Blink engine](https://www.chromium.org/blink) uses [GCM](https://en.wikipedia.org/wiki/Google_Cloud_Messaging) to deliver messages
when websites use the [Push API](https://w3c.github.io/push-api/); this will not work in Bromite because cloud integrations are disabled (GCM in this case).
[ServiceWorker notifications](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification) do work instead since they use
[android.app.Notification](https://developer.android.com/guide/topics/ui/notifiers/notifications).
## Can PWAs be installed?
PWAs are only supported as home shortcuts; WebAPKs will not work because they are generated server-side on googleapis.com (which is not allowed in Bromite).
## Does Bromite support the Android autofill framework?
No; the only autofill available in Chromium browsers requires integration with the Play Store binary blobs.
Some apps use accessibility services as a workaround.
## Does Bromite support casting media content?
No; this would require Play Store binary blobs.
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-218
View File
@@ -1,218 +0,0 @@
# Bromite - Take back your browser
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
Bromite is only available for Android Lollipop (v5.0, API level 21) and above.
<img src="https://fdroid.bromite.org/fdroid/bromite_bromite_gh_downloads.svg" alt="Downloads on Github" title="Downloads on Github" />
For the Frequently Asked Questions see [F.A.Q.](./FAQ.md).
For documentation see the [wiki](https://github.com/bromite/bromite/wiki).
# Goals
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
# Donate
Please donate to support development of Bromite and the costs for the build system.
[&rarr; Support development with a donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2): [![paypal](https://www.bromite.org/assets/img/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
<a href="bitcoin:bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel">BTC donations address</a>: `bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel`
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
# Features
* customizable adblock filters via user-provided URL (see https://www.bromite.org/custom-filters)
* remove click-tracking and AMP from search results
* DNS-over-HTTPS support with any valid IETF DoH endpoint
* always-incognito mode
* disable all field trials permanently
* disable smart search by default, allow web search from incognito mode
* always-visible cookies, javascript and ads site settings
* remove Play integration binary blobs
* use [CFI](https://en.wikipedia.org/wiki/Control-flow_integrity) on all architectures except x86
* disable media router and remoting by default
* disable dynamic module loading
* show warnings for TLSv1.0/TLSv1.1 pages
* enable site-per-process isolation for all devices with memory > 1GB
* completely remove safe browsing and other privacy-unfriendly features
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
* settings to disable custom intents and clear session on exit
* flags to toggle anti-fingerprinting mitigations for canvas, audio, client rects, webGL and sensor APIs (see full list below for all the new flags)
* use frozen User-Agent to conceal real model and browser version
* privacy enhancement patches from [Iridium](https://iridiumbrowser.de/), [Inox patchset](https://github.com/gcarq/inox-patchset), [Brave](https://brave.com/) and [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) projects
* security enhancement patches from [GrapheneOS](https://github.com/GrapheneOS) project
* disable scroll-to-text-fragment
* reduced referer granularity
* block gateway attacks via websockets
* use 64-bit ABI for webview processes
* make all favicon requests on-demand ([supercookie](https://supercookie.me/) mitigation)
* enable all network isolation features (`PartitionConnectionsByNetworkIsolationKey`, `PartitionHttpServerPropertiesByNetworkIsolationKey`, `SplitHostCacheByNetworkIsolationKey`, `AppendFrameOriginToNetworkIsolationKey`, `SplitCacheByNetworkIsolationKey`, `UseRegistrableDomainInNetworkIsolationKey`, `PartitionSSLSessionsByNetworkIsolationKey`, `PartitionExpectCTStateByNetworkIsolationKey`, `PartitionDomainReliabilityByNetworkIsolationKey`)
* ignore enterprise policies that disallow secure DNS
* ask permission to play protected media
* disable the DIAL repeating discovery
* disable RTCGetCurrentBrowsingContextMedia by default
* disable FLoC by default
* disable feeds
* disable reporting of certificate errors
* use pre-defined phone model for client hints and Javascript
* site settings to disable images
* allow forcing external links to open in incognito
* disable AGSA by default
* allow disabling JIT
## Features not related to privacy
* import/export bookmarks
* bookmark all tabs from tabs regroup menu
* flag to allow screenshots of incognito tabs
* allow playing videos in background tabs and disable pause on switching tabs
* all codecs included (proprietary, open H.264 etc.)
* [AV1 codec support](https://github.com/bromite/bromite/wiki/AV1-support)
* [dav1d](https://code.videolan.org/videolan/dav1d) decoder enabled by default
* built with official speed optimizations
* increase number of autocomplete matches from 5 to 10
* allow changing default download storage location
* do not ignore save prompt for users without SD cards
* disable articles and increase number of icons on new tab page
* adding an URL as bookmark will clear its blocked status for the NTP tiles
* history support in incognito mode
* view source of pages
* timezone customization
* sticky desktop mode setting
* disable video autoplay by default, reintroduce site settings
* mobile/desktop user agent customization
* accessibility preference to force tablet UI
* use Alt+D to focus address bar
* allow sharing to Bromite
* browser automatic updates
* UI for crash information collection
You can inspect all functionality/privacy changes by reading the [patches](https://github.com/bromite/bromite/tree/master/build/patches) and/or the [CHANGELOG](./CHANGELOG.md).
### Flags
Flags which have been retired from upstream Chromium but are still available in Bromite.
* `#pull-to-refresh`
* `#enable-search-ready-omnibox`
* `#darken-websites-checkbox-in-themes-setting`
* `#simplified-ntp`, enabled by default
* `#enable-text-fragment-anchor`, disabled by default
* `#num-raster-threads`
* `#enable-image-reader`, enabled by default
* `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
New flags:
* `#fingerprinting-canvas-image-data-noise`, `#fingerprinting-client-rects-noise` and `#fingerprinting-canvas-measuretext-noise`, enabled by default
* `#enable-incognito-snapshots-in-android-recents`, disabled by default
* `#max-connections-per-host`
* `#resume-background-video`
* `#ipv6-probing`
* `#disable-webgl`
* `#enable-device-motion` and `#enable-device-orientation`
* `#show-legacy-tls-warnings`
* `#save-data-header`, disabled by default
* `#export-bookmarks-use-saf`, disabled by default
* `#allow-user-certificates`, disabled by default
* `#cleartext-permitted`, enabled by default, can be used to disable all cleartext-HTTP traffic
* `#omnibox-autocomplete-filtering`, can be used to restrict omnibox autocomplete results
* `#disable-external-intent-requests`
# Privacy limitations
Bromite's privacy features, including anti-fingerprinting mitigations (which are not comprehensive), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://www.torproject.org/download/) in such cases.
# Releases
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically highlight the one apt for your device (or none otherwise).
Each tag corresponds to a Chromium Stable release tag.
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 19 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
For every Bromite build you can always find a matching [vanilla Chromium](https://www.bromite.org/chromium) build which is used for example to verify which issues are specific to Bromite or not.
You can automatically receive notifications about new updates (and install them) by enabling the auto updater functionality, see [related wiki page](https://github.com/bromite/bromite/wiki/AutomaticUpdates).
All official releases are also available through the [official third-party F-Droid repository](https://www.bromite.org/fdroid).
## Integrity and authenticity
You can verify the integrity of a downloaded APK file from this project with any `sha256sum`-compatible tool by downloading the corresponding `brm_X.Y.Z.sha256.txt` or `chr_X.Y.Z.sha256.txt` file, where X.Y.Z is the release version number. Example:
```
$ sha256sum --check brm_68.0.3440.54.sha256.txt
arm64_SystemWebView.apk: OK
arm64_ChromePublic.apk: OK
arm64_ChromeModernPublic.apk: OK
```
You can verify authenticity, e.g. that the author ([csagan5](https://github.com/csagan5)) released the file, by using gpg2:
```
$ gpg2 --quiet --verify brm_68.0.3440.54.sha256.txt.asc
gpg: assuming signed data in 'brm_68.0.3440.54.sha256.txt'
gpg: Signature made Sun 08 Jul 2018 04:22:52 PM CEST using RSA key ID D85DC0C5
gpg: Good signature from "csagan5 <32685696+csagan5@users.noreply.github.com>"
```
You can download csagan5's public GnuPG key from here: [csagan5.asc](./csagan5.asc).
# How to build
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
The Chromium version tag used as base for the patches is available here: [RELEASE](./build/RELEASE); this is always corresponding to the git tag for every release.
The GN args used to build Bromite are available here: [GN_ARGS](./build/GN_ARGS).
The patches are to be applied second the order specified in the `bromite_patches_list.txt` file (you can use `git am`).
## How to build the filters
See upstream documentation: https://github.com/chromium/chromium/blob/master/components/subresource_filter/FILTER_LIST_GENERATION.md
Bromite uses an unindexed filter file, which is periodically published at https://github.com/bromite/filters
# Contributing
Please submit issues following the issue template; beware that GitHub does not display the templates from mobile.
Patches are welcome and accepted if they match the project goals.
For any usage or development discussion please use GitHub Discussions: https://github.com/bromite/bromite/discussions
# Credits
* [Chromium project](https://www.chromium.org/Home) and developers
* [Iridium project](https://github.com/iridium-browser) for some patches
* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches
* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches
* [GrapheneOS](https://github.com/GrapheneOS) for some security patches
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
* [Brave Browser](https://github.com/brave/brave-core) for some patches
* [Vadim Pleshkov](http://vadimpleshkov.me/) for Bromite's logo
# Filters credits
* [EasyList](https://easylist.to/#easylist)
* [EasyPrivacy](https://easylist.to/#easyprivacy)
* [uBlock Origin](https://github.com/uBlockOrigin)
* [Peter Lowe's Ad and tracking server list](https://pgl.yoyo.org/adservers/)
The URLs of the lists used are available at: https://github.com/bromite/filters/blob/master/lists.txt
# 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
-42
View File
@@ -1,42 +0,0 @@
android_channel="stable"
blink_symbol_level=1
chrome_pgo_phase=0
dcheck_always_on=false
debuggable_apks=false
dfmify_dev_ui=false
disable_android_lint=true
disable_autofill_assistant_dfm=true
disable_fieldtrial_testing_config=true
disable_tab_ui_dfm=true
enable_av1_decoder=true
enable_dav1d_decoder=true
enable_gvr_services=false
enable_hangout_services_extension=false
enable_iterator_debugging=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_platform_dolby_vision=true
enable_platform_hevc=true
enable_remoting=false
enable_reporting=false
enable_vr=false
exclude_unwind_tables=false
ffmpeg_branding="Chrome"
icu_use_data_file=true
is_component_build=false
is_debug=false
is_official_build=true
proprietary_codecs=true
rtc_build_examples=false
safe_browsing_mode=0
symbol_level=1
target_os="android"
use_debug_fission=true
use_errorprone_java_compiler=false
use_gnome_keyring=false
use_official_google_api_keys=false
use_rtti=false
use_sysroot=false
webview_includes_weblayer=false
-1
View File
@@ -1 +0,0 @@
94.0.4606.102
-164
View File
@@ -1,164 +0,0 @@
Disable-third-party-cookies-by-default.patch
AV1-codec-support.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
Restore-classic-new-tab-page.patch
Always-use-new-tab-page-for-default-home-page.patch
Always-allow-partner-customisation.patch
battery_status_service-disable-more-privacy-nightmares.patch
Battery-API-return-nothing.patch
updater-disable-updater-pings.patch
Remove-EV-certificates.patch
promo-disable-Google-promotion-fetching.patch
Disable-omission-of-URL-elements-in-Omnibox.patch
Modify-default-preferences.patch
Do-not-hide-component-extensions.patch
Do-not-store-passwords-by-default.patch
Disable-NTP-remote-suggestions-by-default.patch
Disable-references-to-fonts.googleapis.com.patch
Change-default-webRTC-policy-to-not-use-any-address.patch
Never-send-any-crash-upload-data.patch
Hide-send-reports-checkbox.patch
Never-fetch-popular-sites.patch
ungoogled-chromium-Disable-webRTC-log-uploader.patch
ungoogled-chromium-Disable-untraceable-URLs.patch
ungoogled-chromium-Disable-translate-integration.patch
ungoogled-chromium-Disable-profile-avatar.patch
ungoogled-chromium-Disable-intranet-redirect-detector.patch
ungoogled-chromium-Disable-Google-host-detection.patch
ungoogled-chromium-Disable-Gaia.patch
ungoogled-chromium-Disable-domain-reliability.patch
ungoogled-chromium-Disable-Network-Time-Tracker.patch
Disable-safe-browsing.patch
Skip-the-first-run-and-metrics.patch
Disable-all-promo-dialogs.patch
Remove-signin-and-data-saver-integrations.patch
Hide-passwords-manager-link.patch
Disable-update-scheduler.patch
Add-English-only-search-engine.patch
Add-DuckDuckGo-Lite-search-engine.patch
openH264-enable-ARM-ARM64-optimizations.patch
build-remove-calling-untrusted-hooks.patch
Inject-scripts-for-AMP-tracking-ads-and-video.patch
Allow-playing-audio-in-background.patch
Add-flag-to-control-video-playback-resume-feature.patch
Open-YouTube-links-in-Bromite.patch
Add-exit-menu-item.patch
Remove-help-menu-item.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Multiple-fingerprinting-mitigations.patch
Disable-metrics-on-all-I-O-threads.patch
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
Add-flag-to-configure-maximum-connections-per-host.patch
Do-not-ignore-download-location-prompt-setting.patch
Add-bookmark-import-export-actions.patch
Add-an-always-incognito-mode.patch
Add-option-to-not-persist-tabs-across-sessions.patch
Disable-fetching-of-all-field-trials.patch
Disable-seed-based-field-trials.patch
Disable-plugins-enumeration.patch
net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
profile-resetter-do-not-tick-send-settings-by-default.patch
Do-not-build-API-keys-infobar.patch
autofill-disable-autofill-download-manager.patch
first_run-deactivate-autoupdate-globally.patch
translate-disable-fetching-of-translate-languages-from-server.patch
kill-TOS-and-metrics-opt-out.patch
kill-Vision.patch
kill-Location-fall-back-to-system.patch
kill-Auth.patch
Remove-binary-blob-integrations.patch
Remove-SMS-integration.patch
Do-not-compile-QR-code-sharing.patch
Allow-website-sign-in-without-account-sign-in.patch
Offer-builtin-autocomplete-for-chrome-flags.patch
Disable-search-engine-DSE-automatic-permission.patch
Add-flag-to-disable-IPv6-probes.patch
Add-a-proxy-configuration-page.patch
Use-4-tile-rows-never-show-logo.patch
Disable-metrics-collection-for-NTP-tiles.patch
Enable-SPPI-for-devices-with-enough-memory.patch
Use-64-bit-WebView-processes.patch
prefs-disable-signinallowed-by-default.patch
prefs-always-prompt-for-download-directory-by-default.patch
Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
disable-payment-support-by-default.patch
disable-background-sync-by-default.patch
disable-sensors-access-site-setting-by-default.patch
Disable-media-router-and-remoting-by-default.patch
Restore-Search-Ready-Omnibox-flag.patch
disable-AdsBlockedInfoBar.patch
Bromite-AdBlockUpdaterService.patch
Replace-DoH-probe-domain-with-RIPE-domain.patch
Increase-number-of-autocomplete-matches-from-5-to-10.patch
Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
Disable-some-signed-exchange-features.patch
Add-flag-to-disable-WebGL.patch
DoH-secure-mode-by-default.patch
Reduce-HTTP-headers-in-DoH-requests-to-bare-minimum.patch
Revert-flags-remove-disable-pull-to-refresh-effect.patch
Use-dummy-DFM-installer.patch
Disable-feeds-support-by-default.patch
Disable-autofill-assistant-by-default.patch
Show-site-settings-for-cookies-javascript-and-ads.patch
Disable-DRM-media-origin-IDs-preprovisioning.patch
Disable-smart-selection-by-default.patch
Enable-user-agent-freeze-by-default.patch
disable-browser-autologin-by-default.patch
AImageReader-CFI-crash-mitigations.patch
Update-i18n-zh_CN-support.patch
Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
Add-menu-item-to-view-source.patch
Block-gateway-attacks-via-websockets.patch
Enable-prefetch-privacy-changes-by-default.patch
Disable-support-for-RAR-files-inspection.patch
Add-history-support-in-incognito-mode.patch
Enable-darken-websites-checkbox-in-themes.patch
Remove-blocklisted-URLs-upon-bookmark-creation.patch
Disable-the-DIAL-repeating-discovery.patch
Block-qjz9zk-or-trk-requests.patch
Hardening-against-incognito-mode-detection.patch
Remove-weblayer-dependency-on-Play-Services.patch
Timezone-customization.patch
Move-some-account-settings-back-to-privacy-settings.patch
Restore-Simplified-NTP-launch.patch
Revert-the-removal-of-an-option-to-block-autoplay.patch
Disable-text-fragments-by-default.patch
disable-WebView-variations-support.patch
disable-autofill-server-communication-by-default.patch
ask-permission-to-play-protected-media-by-default.patch
Enable-network-isolation-features.patch
Disable-unified-autoplay-feature.patch
Revert-flags-remove-num-raster-threads.patch
webview-Hard-no-to-persistent-histograms.patch
Ignore-enterprise-policies-for-secure-DNS.patch
Add-menu-item-to-bookmark-all-tabs.patch
Add-flag-for-save-data-header.patch
Add-option-to-force-tablet-UI.patch
Make-all-favicon-requests-on-demand.patch
Add-Alt-D-hotkey-to-focus-address-bar.patch
Remove-offline-measurement-background-task.patch
User-agent-customization.patch
Add-AllowUserCertificates-flag.patch
Add-IsCleartextPermitted-flag.patch
Unexpire-tab-groups-flags.patch
Add-flag-for-omnibox-autocomplete-filtering.patch
Enable-IntentBlockExternalFormRedirectsNoGesture-by-default.patch
Add-flag-to-disable-external-intent-requests.patch
Logcat-crash-reports-UI.patch
Add-support-for-ISupportHelpAndFeedback.patch
JIT-less-toggle.patch
API-level-21-prevent-crash-on-download.patch
Add-flag-to-disable-vibration.patch
mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
Override-UA-client-hint-for-model.patch
Disable-AGSA-by-default.patch
Allow-building-without-enable_reporting.patch
Disable-lock-icon-in-address-bar-by-default.patch
Add-custom-tab-intents-privacy-option.patch
Enable-share-intent.patch
Site-setting-for-images.patch
Bromite-auto-updater.patch
Add-flag-to-disable-pull-to-refresh-effect.patch
Automated-domain-substitution.patch
-4
View File
@@ -1,4 +0,0 @@
AV1-codec-support.patch
Switch-to-fstack-protector-strong.patch
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
Disable-feeds-support-by-default.patch
@@ -1,252 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 5 May 2020 07:22:20 +0200
Subject: AImageReader CFI crash mitigations
Revert "gpu/android: Remove setup for disabling AImageReader."
This reverts commit dcd5a39518246eb999f1cc63bf1ec95d93fd5b2f.
Revert "Remove flags to enable/disable AImageReader."
This reverts commit 463fa0f2e3b9e418bc26e2c8954463f0b0f76634.
Restore GPU bug blacklist for AImageReader on ARM and Qualcomm CPUs
Restore the AImageReader blacklist for ARM/Qualcomm chipsets which causes
crashes on Android 9 and 10 (at different code locations).
See discussions at:
* https://github.com/bromite/bromite/issues/445
* https://github.com/bromite/bromite/issues/814
* https://github.com/bromite/bromite/issues/1005
---
base/android/android_image_reader_compat.cc | 8 +++++++-
base/android/android_image_reader_compat.h | 4 ++++
chrome/browser/flag-metadata.json | 2 +-
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
gpu/config/gpu_finch_features.cc | 5 +++++
gpu/config/gpu_finch_features.h | 1 +
gpu/config/gpu_util.cc | 8 ++++++++
gpu/config/gpu_workaround_list.txt | 1 +
gpu/ipc/service/gpu_init.cc | 5 +++++
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
media/base/media_switches.cc | 4 ++++
media/base/media_switches.h | 1 +
12 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
--- a/base/android/android_image_reader_compat.cc
+++ b/base/android/android_image_reader_compat.cc
@@ -23,6 +23,8 @@
namespace base {
namespace android {
+bool AndroidImageReader::disable_support_ = false;
+
AndroidImageReader& AndroidImageReader::GetInstance() {
// C++11 static local variable initialization is
// thread-safe.
@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() {
return instance;
}
+void AndroidImageReader::DisableSupport() {
+ disable_support_ = true;
+}
+
bool AndroidImageReader::IsSupported() {
- return is_supported_;
+ return !disable_support_ && is_supported_;
}
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
--- a/base/android/android_image_reader_compat.h
+++ b/base/android/android_image_reader_compat.h
@@ -22,6 +22,9 @@ class BASE_EXPORT AndroidImageReader {
// Thread safe GetInstance.
static AndroidImageReader& GetInstance();
+ // Disable image reader support.
+ static void DisableSupport();
+
// Check if the image reader usage is supported. This function returns TRUE
// if android version is >=OREO, image reader support is not disabled and all
// the required functions are loaded.
@@ -59,6 +62,7 @@ class BASE_EXPORT AndroidImageReader {
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
private:
+ static bool disable_support_;
friend class base::NoDestructor<AndroidImageReader>;
AndroidImageReader();
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2017,7 +2017,7 @@
{
"name": "enable-image-reader",
"owners": [ "vikassoni", "liberato" ],
- "expiry_milestone": 95
+ "expiry_milestone": -1
},
{
"name": "enable-immersive-fullscreen-toolbar",
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
--- a/gpu/config/gpu_driver_bug_list.json
+++ b/gpu/config/gpu_driver_bug_list.json
@@ -3191,6 +3191,22 @@
"dont_delete_source_texture_for_egl_image"
]
},
+ {
+ "id":335,
+ "cr_bugs": [1051705],
+ "description": "Disable AImageReader on ARM GPUs",
+ "os": {
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "10"
+ }
+ },
+ "gl_vendor": "ARM.*|Qualcomm.*",
+ "features": [
+ "disable_aimagereader"
+ ]
+ },
{
"id": 336,
"cr_bugs": [625785],
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -51,6 +51,11 @@ bool IsDeviceBlocked(const char* field, const std::string& block_list) {
} // namespace
#if defined(OS_ANDROID)
+
+// Use android AImageReader when playing videos with MediaPlayer.
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// Used to limit GL version to 2.0 for skia raster on Android.
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
--- a/gpu/config/gpu_finch_features.h
+++ b/gpu/config/gpu_finch_features.h
@@ -17,6 +17,7 @@ namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID)
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
GPU_EXPORT extern const base::Feature kWebViewSurfaceControl;
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -114,6 +114,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
#if !defined(OS_ANDROID)
return kGpuFeatureStatusDisabled;
#else
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
+ return kGpuFeatureStatusBlocklisted;
+
if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;
@@ -319,6 +322,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusBlocklisted;
}
+
+ if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
+ gpu_feature_info->status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
+ kGpuFeatureStatusBlocklisted;
+ }
}
// Estimates roughly user total disk space by counting in the drives where
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
--- a/gpu/config/gpu_workaround_list.txt
+++ b/gpu/config/gpu_workaround_list.txt
@@ -13,6 +13,7 @@ decode_encode_srgb_for_generatemipmap
depth_stencil_renderbuffer_resize_emulation
disable_2d_canvas_auto_flush
disable_accelerated_av1_decode
+disable_aimagereader
disable_accelerated_av1_decode_d3d11
disable_accelerated_h264_encode
disable_accelerated_vp8_decode
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -517,6 +517,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
}
}
+ // Disable AImageReader if the workaround is enabled.
+ if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
+ base::android::AndroidImageReader::DisableSupport();
+ }
+
if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] !=
kGpuFeatureStatusEnabled ||
!InitializeVulkan()) {
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
--- a/gpu/ipc/service/stream_texture_android.cc
+++ b/gpu/ipc/service/stream_texture_android.cc
@@ -6,6 +6,7 @@
#include <string.h>
+#include "base/android/android_image_reader_compat.h"
#include "base/android/scoped_hardware_buffer_fence_sync.h"
#include "base/bind.h"
#include "base/feature_list.h"
@@ -50,7 +51,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
}
TextureOwner::Mode GetTextureOwnerMode() {
- return features::IsAImageReaderEnabled()
+ const bool a_image_reader_supported =
+ base::android::AndroidImageReader::GetInstance().IsSupported();
+
+ // TODO(vikassoni) : Currently we have 2 different flags to enable/disable
+ // AImageReader - one for MCVD and other for MediaPlayer here. Merge those 2
+ // flags into a single flag. Keeping the 2 flags separate for now since finch
+ // experiment using this flag is in progress.
+ return a_image_reader_supported && features::IsAImageReaderEnabled() &&
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer)
? TextureOwner::Mode::kAImageReaderInsecure
: TextureOwner::Mode::kSurfaceTextureInsecure;
}
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -668,6 +668,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
// Note: Has no effect if kMediaDrmPreprovisioning feature is disabled.
const base::Feature kMediaDrmPreprovisioningAtStartup{
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// Enable picture in picture web api for android.
const base::Feature kPictureInPictureAPI{"PictureInPictureAPI",
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -219,6 +219,7 @@ MEDIA_EXPORT extern const base::Feature kForceHardwareAudioDecoders;
MEDIA_EXPORT extern const base::Feature kAllowNonSecureOverlays;
MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
--
2.17.1
@@ -1,38 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 16:53:48 +0200
Subject: API level 21: prevent crash on download
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
This patch ignores boolean settings for them and prevents the crash.
See also: https://github.com/bromite/bromite/issues/1184
---
.../internal/BundleToPersistableBundleConverter.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -85,9 +85,17 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);
} else if (obj instanceof Boolean) {
- persistableBundle.putBoolean(key, (Boolean) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBoolean(key, (Boolean) obj);
+ }
} else if (obj instanceof boolean[]) {
- persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ }
} else if (obj instanceof Double) {
persistableBundle.putDouble(key, (Double) obj);
} else if (obj instanceof double[]) {
--
2.17.1
-215
View File
@@ -1,215 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 16 Dec 2018 15:24:19 +0100
Subject: AV1 codec support
libaom build fixes (requires -fPIC)
Report AV1 as playable on Android
---
third_party/libaom/BUILD.gn | 6 ++++--
third_party/libaom/libaom_srcs.gni | 5 +++++
.../config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
.../config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
.../source/config/linux/arm-neon/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
.../libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm/config/aom_config.h | 2 +-
.../libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
.../source/config/linux/generic/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/generic/config/aom_config.h | 2 +-
.../libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
.../libaom/source/config/linux/x64/config/aom_config.h | 2 +-
14 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
--- a/third_party/libaom/BUILD.gn
+++ b/third_party/libaom/BUILD.gn
@@ -82,7 +82,7 @@ if (enable_libaom) {
sources += aom_dsp_encoder_asm_sse2_x86_64
sources += aom_dsp_encoder_asm_ssse3_x86_64
}
- defines = [ "CHROMIUM" ]
+ defines = [ "CHROMIUM", "PIC" ]
include_dirs = libaom_include_dirs
}
@@ -193,7 +193,7 @@ if (enable_libaom) {
configs += [ "//build/config/compiler:no_chromium_code" ]
if (current_cpu == "arm") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
- cflags = [ "-mfpu=neon" ]
+ cflags = [ "-mfpu=neon", "-fPIC" ]
}
configs += [ ":libaom_config" ]
@@ -256,6 +256,8 @@ if (enable_libaom) {
if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
cpu_arch_full == "arm-neon-cpu-detect") {
deps += [ ":libaom_intrinsics_neon" ]
+ # will detect CPU
+ sources += aom_ports_arm_sources
}
if (is_android) {
deps += [ "//third_party/android_ndk:cpu_features" ]
diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
--- a/third_party/libaom/libaom_srcs.gni
+++ b/third_party/libaom/libaom_srcs.gni
@@ -634,6 +634,11 @@ aom_mem_sources = [
aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/float.asm" ]
+aom_ports_arm_sources = [
+ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
+ "//third_party/libaom/source/libaom/aom_ports/arm.h",
+ ]
+
aom_rtcd_sources = [
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
"//third_party/libaom/source/libaom/aom_scale/aom_scale_rtcd.c",
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OPTICAL_FLOW_API equ 0
CONFIG_OS_SUPPORT equ 1
CONFIG_PARTITION_SEARCH_ORDER equ 0
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_COMMAND equ 0
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY equ 1
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OPTICAL_FLOW_API equ 0
CONFIG_OS_SUPPORT equ 1
CONFIG_PARTITION_SEARCH_ORDER equ 0
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_COMMAND equ 0
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY equ 1
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OPTICAL_FLOW_API equ 0
CONFIG_OS_SUPPORT equ 1
CONFIG_PARTITION_SEARCH_ORDER equ 0
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_COMMAND equ 0
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY equ 1
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OPTICAL_FLOW_API equ 0
CONFIG_OS_SUPPORT equ 1
CONFIG_PARTITION_SEARCH_ORDER equ 0
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_COMMAND equ 0
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY equ 1
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
CONFIG_OPTICAL_FLOW_API equ 0
CONFIG_OS_SUPPORT equ 1
CONFIG_PARTITION_SEARCH_ORDER equ 0
-CONFIG_PIC equ 0
+CONFIG_PIC equ 1
CONFIG_RD_COMMAND equ 0
CONFIG_RD_DEBUG equ 0
CONFIG_REALTIME_ONLY equ 1
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
@@ -38,7 +38,7 @@
%define CONFIG_OPTICAL_FLOW_API 0
%define CONFIG_OS_SUPPORT 1
%define CONFIG_PARTITION_SEARCH_ORDER 0
-%define CONFIG_PIC 0
+%define CONFIG_PIC 1
%define CONFIG_RD_COMMAND 0
%define CONFIG_RD_DEBUG 0
%define CONFIG_REALTIME_ONLY 1
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
@@ -50,7 +50,7 @@
#define CONFIG_OPTICAL_FLOW_API 0
#define CONFIG_OS_SUPPORT 1
#define CONFIG_PARTITION_SEARCH_ORDER 0
-#define CONFIG_PIC 0
+#define CONFIG_PIC 1
#define CONFIG_RD_COMMAND 0
#define CONFIG_RD_DEBUG 0
#define CONFIG_REALTIME_ONLY 1
--
2.17.1
@@ -1,169 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Mon, 26 Apr 2021 13:28:24 +0000
Subject: Add AllowUserCertificates flag
---
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 3 +++
.../chromium/chrome/browser/app/flags/ChromeCachedFlags.java | 1 +
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
chrome/browser/flags/android/chrome_feature_list.cc | 4 ++++
chrome/browser/flags/android/chrome_feature_list.h | 1 +
.../chromium/chrome/browser/flags/CachedFeatureFlags.java | 1 +
.../org/chromium/chrome/browser/flags/ChromeFeatureList.java | 1 +
net/android/java/src/org/chromium/net/X509Util.java | 5 +++++
10 files changed, 28 insertions(+)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -223,6 +223,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
import org.chromium.content_public.browser.SelectionPopupController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.ContentSwitches;
+import org.chromium.net.X509Util;
import org.chromium.printing.PrintManagerDelegateImpl;
import org.chromium.printing.PrintingController;
import org.chromium.printing.PrintingControllerImpl;
@@ -976,6 +977,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
UpdateMenuItemHelper.getInstance().onStart();
ChromeActivitySessionTracker.getInstance().onStartWithNative();
ChromeCachedFlags.getInstance().cacheNativeFlags();
+ X509Util.AllowUserCertificates = ChromeFeatureList.isEnabled(
+ ChromeFeatureList.ALLOW_USER_CERTIFICATES);
OfflineIndicatorController.initialize();
// postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever#onLoadStopped(),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
@@ -88,6 +88,7 @@ public class ChromeCachedFlags {
add(ChromeFeatureList.EARLY_LIBRARY_LOAD);
add(ChromeFeatureList.ELASTIC_OVERSCROLL);
add(ChromeFeatureList.IMMERSIVE_UI_MODE);
+ add(ChromeFeatureList.ALLOW_USER_CERTIFICATES);
add(ChromeFeatureList.INSTANT_START);
add(ChromeFeatureList.INSTANCE_SWITCHER);
add(ChromeFeatureList.INTEREST_FEED_V2);
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
@@ -2781,6 +2781,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kCSSContainerQueriesDescription, kOsAll,
FEATURE_VALUE_TYPE(blink::features::kCSSContainerQueries)},
#if defined(OS_ANDROID)
+ {"allow-user-certificates",
+ flag_descriptions::kAllowUserCertificatesName,
+ flag_descriptions::kAllowUserCertificatesDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(chrome::android::kAllowUserCertificates)},
{"contextual-search-debug", flag_descriptions::kContextualSearchDebugName,
flag_descriptions::kContextualSearchDebugDescription, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kContextualSearchDebug)},
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
@@ -11,6 +11,11 @@
namespace flag_descriptions {
+const char kAllowUserCertificatesName[] = "Allow user certificates";
+const char kAllowUserCertificatesDescription[] =
+ "Allow user CA certificates during "
+ "validation of the certificate chain";
+
const char kAccelerated2dCanvasName[] = "Accelerated 2D canvas";
const char kAccelerated2dCanvasDescription[] =
"Enables the use of the GPU to perform 2d canvas rendering instead of "
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
@@ -46,6 +46,9 @@ namespace flag_descriptions {
// Cross-platform -------------------------------------------------------------
+extern const char kAllowUserCertificatesName[];
+extern const char kAllowUserCertificatesDescription[];
+
extern const char kAccelerated2dCanvasName[];
extern const char kAccelerated2dCanvasDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -139,6 +139,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&feed::kFeedInteractiveRefresh,
&feed::kInterestFeedContentSuggestions,
&feed::kInterestFeedSpinnerAlwaysAnimate,
+ &kAllowUserCertificates,
&feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
&feed::kInterestFeedV2,
&feed::kInterestFeedV2Autoplay,
@@ -373,6 +374,9 @@ const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2{
"AdaptiveButtonInTopToolbarCustomizationV2",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kAllowUserCertificates = {
+ "AllowUserCertificates", base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kAddToHomescreenIPH{"AddToHomescreenIPH",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -12,6 +12,7 @@
namespace chrome {
namespace android {
+extern const base::Feature kAllowUserCertificates;
// Alphabetical:
extern const base::Feature kAdaptiveButtonInTopToolbar;
extern const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -48,6 +48,7 @@ public class CachedFeatureFlags {
*/
private static Map<String, Boolean> sDefaults =
ImmutableMap.<String, Boolean>builder()
+ .put(ChromeFeatureList.ALLOW_USER_CERTIFICATES, false)
.put(ChromeFeatureList.ANDROID_PARTNER_CUSTOMIZATION_PHENOTYPE, true)
.put(ChromeFeatureList.BOOKMARK_BOTTOM_SHEET, false)
.put(ChromeFeatureList.CONDITIONAL_TAB_STRIP_ANDROID, false)
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -211,6 +211,7 @@ public abstract class ChromeFeatureList {
}
/* Alphabetical: */
+ public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates";
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR = "AdaptiveButtonInTopToolbar";
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_CUSTOMIZATION_V2 =
"AdaptiveButtonInTopToolbarCustomizationV2";
diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java
--- a/net/android/java/src/org/chromium/net/X509Util.java
+++ b/net/android/java/src/org/chromium/net/X509Util.java
@@ -488,6 +488,8 @@ public class X509Util {
return false;
}
+ public static boolean AllowUserCertificates = false;
+
public static AndroidCertVerifyResult verifyServerCertificates(byte[][] certChain,
String authType,
String host)
@@ -568,6 +570,9 @@ public class X509Util {
isIssuedByKnownRoot = isKnownRoot(root);
}
+ if (AllowUserCertificates == false && isIssuedByKnownRoot == false)
+ return new AndroidCertVerifyResult(CertVerifyStatusAndroid.NO_TRUSTED_ROOT);
+
return new AndroidCertVerifyResult(CertVerifyStatusAndroid.OK,
isIssuedByKnownRoot, verifiedChain);
}
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 9 Mar 2021 19:43:00 +0100
Subject: Add Alt+D hotkey to focus address bar
---
.../java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 2 ++
1 file changed, 2 insertions(+)
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
@@ -156,6 +156,8 @@ public class KeyboardShortcuts {
KeyEvent.KEYCODE_F, KeyEvent.META_CTRL_ON);
addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON);
+ addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
+ KeyEvent.KEYCODE_D, KeyEvent.META_ALT_ON);
shortcutGroups.add(chromeFeatureShortcutGroup);
KeyboardShortcutGroup webpageShortcutGroup = new KeyboardShortcutGroup(
--
2.17.1
@@ -1,926 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 11:06:18 +0200
Subject: Add DuckDuckGo Lite search engine
---
.../search_engines/prepopulated_engines.json | 10 +
.../search_engines/search_engine_type.h | 1 +
.../template_url_prepopulate_data.cc | 196 +++++++++---------
3 files changed, 109 insertions(+), 98 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
@@ -102,6 +102,16 @@
"id": 92
},
+ "duckduckgo_light": {
+ "name": "DuckDuckGo Light",
+ "keyword": "duckduckgo.com/lite",
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
+ "id": 12
+ },
+
"ecosia": {
"name": "Ecosia",
"keyword": "ecosia.org",
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 = 48,
SEARCH_ENGINE_COCCOC = 49,
SEARCH_ENGINE_DUCKDUCKGO = 50,
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
SEARCH_ENGINE_PARSIJOO = 51,
SEARCH_ENGINE_QWANT = 52,
SEARCH_ENGINE_GIVERO = 53,
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
@@ -41,7 +41,7 @@ const PrepopulatedEngine* const engines_AE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -50,7 +50,7 @@ const PrepopulatedEngine* const engines_AL[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -59,7 +59,7 @@ const PrepopulatedEngine* const engines_AR[] = {
&googleen, &google,
&bing,
&yahoo_ar,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -67,7 +67,7 @@ const PrepopulatedEngine* const engines_AR[] = {
const PrepopulatedEngine* const engines_AT[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_at,
&ecosia,
};
@@ -77,7 +77,7 @@ const PrepopulatedEngine* const engines_AU[] = {
&googleen, &google,
&bing,
&yahoo_au,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -86,7 +86,7 @@ const PrepopulatedEngine* const engines_BA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Belgium
@@ -95,7 +95,7 @@ const PrepopulatedEngine* const engines_BE[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Bulgaria
@@ -103,7 +103,7 @@ const PrepopulatedEngine* const engines_BG[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -112,7 +112,7 @@ const PrepopulatedEngine* const engines_BH[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -121,7 +121,7 @@ const PrepopulatedEngine* const engines_BI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -130,7 +130,7 @@ const PrepopulatedEngine* const engines_BN[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -139,7 +139,7 @@ const PrepopulatedEngine* const engines_BO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -148,7 +148,7 @@ const PrepopulatedEngine* const engines_BR[] = {
&googleen, &google,
&bing,
&yahoo_br,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -158,7 +158,7 @@ const PrepopulatedEngine* const engines_BY[] = {
&yandex_by,
&mail_ru,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Belize
@@ -166,7 +166,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -175,7 +175,7 @@ const PrepopulatedEngine* const engines_CA[] = {
&googleen, &google,
&bing,
&yahoo_ca,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -183,7 +183,7 @@ const PrepopulatedEngine* const engines_CA[] = {
const PrepopulatedEngine* const engines_CH[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
&yahoo_ch,
};
@@ -193,7 +193,7 @@ const PrepopulatedEngine* const engines_CL[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -212,7 +212,7 @@ const PrepopulatedEngine* const engines_CO[] = {
&bing,
&yahoo_es,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Costa Rica
@@ -220,7 +220,7 @@ const PrepopulatedEngine* const engines_CR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -230,14 +230,14 @@ const PrepopulatedEngine* const engines_CZ[] = {
&seznam_cz,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Germany
const PrepopulatedEngine* const engines_DE[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
&yahoo_de,
};
@@ -247,7 +247,7 @@ const PrepopulatedEngine* const engines_DK[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -256,7 +256,7 @@ const PrepopulatedEngine* const engines_DO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -266,7 +266,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
&yahoo_uk,
&bing,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Ecuador
@@ -274,7 +274,7 @@ const PrepopulatedEngine* const engines_EC[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -293,7 +293,7 @@ const PrepopulatedEngine* const engines_EG[] = {
&yahoo,
&bing,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Spain
@@ -301,7 +301,7 @@ const PrepopulatedEngine* const engines_ES[] = {
&googleen, &google,
&bing,
&yahoo_es,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -310,7 +310,7 @@ const PrepopulatedEngine* const engines_FI[] = {
&googleen, &google,
&bing,
&yahoo_fi,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -319,7 +319,7 @@ const PrepopulatedEngine* const engines_FO[] = {
&googleen, &google,
&bing,
&yahoo_dk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -337,7 +337,7 @@ const PrepopulatedEngine* const engines_GB[] = {
&googleen, &google,
&bing,
&yahoo_uk,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -346,7 +346,7 @@ const PrepopulatedEngine* const engines_GR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -355,7 +355,7 @@ const PrepopulatedEngine* const engines_GT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -365,7 +365,7 @@ const PrepopulatedEngine* const engines_HK[] = {
&yahoo_hk,
&bing,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Honduras
@@ -373,7 +373,7 @@ const PrepopulatedEngine* const engines_HN[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -382,7 +382,7 @@ const PrepopulatedEngine* const engines_HR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -391,7 +391,7 @@ const PrepopulatedEngine* const engines_HU[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -400,7 +400,7 @@ const PrepopulatedEngine* const engines_ID[] = {
&googleen, &google,
&yahoo_id,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -409,7 +409,7 @@ const PrepopulatedEngine* const engines_IE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -419,7 +419,7 @@ const PrepopulatedEngine* const engines_IL[] = {
&bing,
&yandex_ru,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// India
@@ -427,7 +427,7 @@ const PrepopulatedEngine* const engines_IN[] = {
&googleen, &google,
&bing,
&yahoo_in,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -437,7 +437,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
&bing,
&yahoo_uk,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Iran
@@ -454,7 +454,7 @@ const PrepopulatedEngine* const engines_IS[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -463,7 +463,7 @@ const PrepopulatedEngine* const engines_IT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -472,7 +472,7 @@ const PrepopulatedEngine* const engines_JM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -481,7 +481,7 @@ const PrepopulatedEngine* const engines_JO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -491,7 +491,7 @@ const PrepopulatedEngine* const engines_JP[] = {
&yahoo_jp,
&bing,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Kenya
@@ -499,7 +499,7 @@ const PrepopulatedEngine* const engines_KE[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -517,7 +517,7 @@ const PrepopulatedEngine* const engines_KW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -535,7 +535,7 @@ const PrepopulatedEngine* const engines_LB[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -543,7 +543,7 @@ const PrepopulatedEngine* const engines_LB[] = {
const PrepopulatedEngine* const engines_LI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -554,14 +554,14 @@ const PrepopulatedEngine* const engines_LT[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
&ecosia,
};
@@ -572,7 +572,7 @@ const PrepopulatedEngine* const engines_LV[] = {
&bing,
&yandex_ru,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Libya
@@ -581,7 +581,7 @@ const PrepopulatedEngine* const engines_LY[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Morocco
@@ -590,7 +590,7 @@ const PrepopulatedEngine* const engines_MA[] = {
&yahoo_fr,
&bing,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Monaco
@@ -598,7 +598,7 @@ const PrepopulatedEngine* const engines_MC[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&qwant,
};
@@ -617,7 +617,7 @@ const PrepopulatedEngine* const engines_ME[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Macedonia
@@ -625,7 +625,7 @@ const PrepopulatedEngine* const engines_MK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -634,7 +634,7 @@ const PrepopulatedEngine* const engines_MX[] = {
&googleen, &google,
&bing,
&yahoo_mx,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -643,7 +643,7 @@ const PrepopulatedEngine* const engines_MY[] = {
&googleen, &google,
&bing,
&yahoo_my,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -652,7 +652,7 @@ const PrepopulatedEngine* const engines_NI[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -660,7 +660,7 @@ const PrepopulatedEngine* const engines_NI[] = {
const PrepopulatedEngine* const engines_NL[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo_nl,
&ecosia,
};
@@ -670,7 +670,7 @@ const PrepopulatedEngine* const engines_NO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -679,7 +679,7 @@ const PrepopulatedEngine* const engines_NZ[] = {
&googleen, &google,
&bing,
&yahoo_nz,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -688,7 +688,7 @@ const PrepopulatedEngine* const engines_OM[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
@@ -697,7 +697,7 @@ const PrepopulatedEngine* const engines_PA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -707,7 +707,7 @@ const PrepopulatedEngine* const engines_PE[] = {
&bing,
&yahoo_es,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Philippines
@@ -716,7 +716,7 @@ const PrepopulatedEngine* const engines_PH[] = {
&bing,
&yahoo,
&ecosia,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Pakistan
@@ -724,7 +724,7 @@ const PrepopulatedEngine* const engines_PK[] = {
&googleen, &google,
&yahoo,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_com,
};
@@ -733,7 +733,7 @@ const PrepopulatedEngine* const engines_PL[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Puerto Rico
@@ -741,7 +741,7 @@ const PrepopulatedEngine* const engines_PR[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -750,7 +750,7 @@ const PrepopulatedEngine* const engines_PT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -759,7 +759,7 @@ const PrepopulatedEngine* const engines_PY[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -768,7 +768,7 @@ const PrepopulatedEngine* const engines_QA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -777,7 +777,7 @@ const PrepopulatedEngine* const engines_RO[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -786,7 +786,7 @@ const PrepopulatedEngine* const engines_RS[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -796,7 +796,7 @@ const PrepopulatedEngine* const engines_RU[] = {
&yandex_ru,
&mail_ru,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Rwanda
@@ -804,7 +804,7 @@ const PrepopulatedEngine* const engines_RW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -814,7 +814,7 @@ const PrepopulatedEngine* const engines_SA[] = {
&bing,
&yahoo,
&yandex_com,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Sweden
@@ -822,7 +822,7 @@ const PrepopulatedEngine* const engines_SE[] = {
&googleen, &google,
&bing,
&yahoo_se,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -832,14 +832,14 @@ const PrepopulatedEngine* const engines_SG[] = {
&bing,
&yahoo,
&baidu,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Slovenia
const PrepopulatedEngine* const engines_SI[] = {
&googleen, &google,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
};
@@ -848,7 +848,7 @@ const PrepopulatedEngine* const engines_SK[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&seznam_cz,
};
@@ -857,7 +857,7 @@ const PrepopulatedEngine* const engines_SV[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -867,7 +867,7 @@ const PrepopulatedEngine* const engines_SY[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Thailand
@@ -875,7 +875,7 @@ const PrepopulatedEngine* const engines_TH[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&baidu,
};
@@ -884,7 +884,7 @@ const PrepopulatedEngine* const engines_TN[] = {
&googleen, &google,
&yahoo_fr,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yandex_ru,
};
@@ -894,7 +894,7 @@ const PrepopulatedEngine* const engines_TR[] = {
&yandex_tr,
&yahoo_tr,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// Trinidad and Tobago
@@ -902,7 +902,7 @@ const PrepopulatedEngine* const engines_TT[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -920,7 +920,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -929,7 +929,7 @@ const PrepopulatedEngine* const engines_UA[] = {
&googleen, &google,
&yandex_ua,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&yahoo,
};
@@ -938,7 +938,7 @@ const PrepopulatedEngine* const engines_US[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -947,7 +947,7 @@ const PrepopulatedEngine* const engines_UY[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -956,7 +956,7 @@ const PrepopulatedEngine* const engines_VE[] = {
&googleen, &google,
&yahoo_ve,
&bing,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -975,7 +975,7 @@ const PrepopulatedEngine* const engines_YE[] = {
&bing,
&yahoo,
&yandex_ru,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
};
// South Africa
@@ -983,7 +983,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ecosia,
};
@@ -992,7 +992,7 @@ const PrepopulatedEngine* const engines_ZW[] = {
&googleen, &google,
&bing,
&yahoo,
- &duckduckgo,
+ &duckduckgo, &duckduckgo_light,
&ask,
};
// ----------------------------------------------------------------------------
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,97 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Mon, 26 Apr 2021 15:04:11 +0000
Subject: Add IsCleartextPermitted flag
---
chrome/browser/about_flags.cc | 5 +++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
net/base/features.cc | 3 +++
net/base/features.h | 2 ++
net/url_request/url_request_http_job.cc | 4 ++++
6 files changed, 21 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7617,6 +7617,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
chrome::android::kBookmarksExportUseSaf)},
+ {"cleartext-permitted",
+ flag_descriptions::kIsCleartextPermittedName,
+ flag_descriptions::kIsCleartextPermittedDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)},
+
// NOTE: Adding a new flag requires adding a corresponding entry to enum
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
// Histograms" in tools/metrics/histograms/README.md (run the
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
@@ -1407,6 +1407,10 @@ const char kHttpsOnlyModeDescription[] =
"Adds a setting under chrome://settings/security to opt-in to HTTPS-First "
"Mode.";
+const char kIsCleartextPermittedName[] = "Allow cleartext traffic";
+const char kIsCleartextPermittedDescription[] =
+ "Allow insecure connections over HTTP";
+
const char kIgnoreGpuBlocklistName[] = "Override software rendering list";
const char kIgnoreGpuBlocklistDescription[] =
"Overrides the built-in software rendering list and enables "
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
@@ -814,6 +814,9 @@ extern const char kHostedAppShimCreationDescription[];
extern const char kHttpsOnlyModeName[];
extern const char kHttpsOnlyModeDescription[];
+extern const char kIsCleartextPermittedName[];
+extern const char kIsCleartextPermittedDescription[];
+
extern const char kIgnoreGpuBlocklistName[];
extern const char kIgnoreGpuBlocklistDescription[];
diff --git a/net/base/features.cc b/net/base/features.cc
--- a/net/base/features.cc
+++ b/net/base/features.cc
@@ -89,6 +89,9 @@ const base::FeatureParam<int> kUseDnsHttpsSvcbExtraTimePercent{
const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kIsCleartextPermitted{"IsCleartextPermitted",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
const base::Feature kNetworkQualityEstimator{"NetworkQualityEstimator",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/net/base/features.h b/net/base/features.h
--- a/net/base/features.h
+++ b/net/base/features.h
@@ -37,6 +37,8 @@ NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
// Enables TLS 1.3 early data.
NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
+NET_EXPORT extern const base::Feature kIsCleartextPermitted;
+
// Support for altering the parameters used for DNS transaction timeout. See
// ResolveContext::SecureTransactionTimeout().
NET_EXPORT extern const base::Feature kDnsTransactionDynamicTimeouts;
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
@@ -214,6 +214,10 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
}
#if defined(OS_ANDROID)
+ if (base::FeatureList::IsEnabled(net::features::kIsCleartextPermitted) == false) {
+ return std::make_unique<URLRequestErrorJob>(request,
+ ERR_CLEARTEXT_NOT_PERMITTED);
+ }
// Check whether the app allows cleartext traffic to this host, and return
// ERR_CLEARTEXT_NOT_PERMITTED if not.
if (request->context()->check_cleartext_permitted() &&
--
2.17.1
@@ -1,101 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 9 May 2020 08:33:15 +0200
Subject: Add a flag to allow screenshots in Incognito mode
See also:
* https://github.com/bromite/bromite/issues/551
* https://bugs.chromium.org/p/chromium/issues/detail?id=920762
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
.../flags/android/java_templates/ChromeSwitches.java.tmpl | 4 ----
chrome/common/chrome_switches.cc | 3 +++
chrome/common/chrome_switches.h | 1 +
6 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7518,6 +7518,12 @@ const FeatureEntry kFeatureEntries[] = {
"AndroidDynamicColor")},
#endif // defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+ {switches::kEnableIncognitoSnapshotsInAndroidRecents, flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsName,
+ flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsDescription, kOsAndroid,
+ SINGLE_VALUE_TYPE(switches::kEnableIncognitoSnapshotsInAndroidRecents)},
+#endif
+
#if defined(OS_WIN)
{"win-10-tab-search-caption-button",
flag_descriptions::kWin10TabSearchCaptionButtonName,
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
@@ -635,6 +635,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
"authenticator (if available) to verify card ownership when retrieving "
"credit cards from Google Payments.";
+const char kEnableIncognitoSnapshotsInAndroidRecentsName[] =
+ "Enable Incognito snapshots in Android Recents";
+const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[] =
+ "Enable the secure flag for Incognito tabs which prevent taking screenshots and seeing snapshots in Android Recents.";
+
const char
kEnableAutofillInfoBarAccountIndicationFooterForSingleAccountUsersName[] =
"Display InfoBar footers with account indication information for "
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
@@ -404,6 +404,9 @@ extern const char kEnableAutofillSaveCardInfoBarAccountIndicationFooterName[];
extern const char
kEnableAutofillSaveCardInfoBarAccountIndicationFooterDescription[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsName[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[];
+
extern const char kEnableExperimentalCookieFeaturesName[];
extern const char kEnableExperimentalCookieFeaturesDescription[];
diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
--- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
+++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
@@ -129,10 +129,6 @@ public abstract class ChromeSwitches {{
/** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */
public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey";
- /** Switch to enable incognito tabs to be seen in Android Recents. */
- public static final String ENABLE_INCOGNITO_SNAPSHOTS_IN_ANDROID_RECENTS =
- "enable-incognito-snapshots-in-android-recents";
-
/** Open all custom tabs in a new task. Used only for experimental purposes. */
public static final String OPEN_CUSTOM_TABS_IN_NEW_TASK = "open-custom-tabs-in-new-task";
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -344,6 +344,9 @@ const char kHomePage[] = "homepage";
// Causes the browser to launch directly in incognito mode.
const char kIncognito[] = "incognito";
+// Allows incognito tabs to be seen in Android Recents and thus user screenshots.
+const char kEnableIncognitoSnapshotsInAndroidRecents[] = "enable-incognito-snapshots-in-android-recents";
+
// Installs an autogenerated theme based on the given RGB value.
// The format is "r,g,b", where r, g, b are a numeric values from 0 to 255.
const char kInstallAutogeneratedTheme[] = "install-autogenerated-theme";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -114,6 +114,7 @@ extern const char kForceStackedTabStripLayout[];
extern const char kHideCrashRestoreBubble[];
extern const char kHomePage[];
extern const char kIncognito[];
+extern const char kEnableIncognitoSnapshotsInAndroidRecents[];
extern const char kInstallAutogeneratedTheme[];
extern const char kInstallChromeApp[];
extern const char kInstantProcess[];
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,660 +0,0 @@
From: Ryan Archer <ryan.bradley.archer@gmail.com>
Date: Wed, 2 Aug 2017 01:41:28 -0400
Subject: Add an always-incognito mode
More specifically, add a preference that causes all new tabs and all
clicked links to launch as incognito.
Make sure initial incognito status is correctly recognized.
Enable incognito custom tabs and fix crashes for incognito/custom tab intents (credits to @uazo)
---
chrome/android/chrome_java_sources.gni | 1 +
.../java/res/xml/privacy_preferences.xml | 5 ++
.../AlwaysIncognitoLinkInterceptor.java | 80 +++++++++++++++++++
.../chrome/browser/ChromeTabbedActivity.java | 6 +-
.../chrome/browser/app/ChromeActivity.java | 4 +
.../AppMenuPropertiesDelegateImpl.java | 6 ++
.../ChromeContextMenuPopulator.java | 8 +-
.../CustomTabActivityLifecycleUmaTracker.java | 25 ------
.../CustomTabIntentDataProvider.java | 5 +-
.../browser/init/StartupTabPreloader.java | 14 +++-
.../privacy/settings/PrivacySettings.java | 37 ++++++++-
.../browser/settings/SettingsActivity.java | 4 +
.../browser/tabmodel/ChromeTabCreator.java | 16 +++-
.../browser/tabmodel/TabPersistentStore.java | 10 +++
.../webapps/WebappIntentDataProvider.java | 14 ++++
.../flags/android/chrome_feature_list.cc | 2 +-
.../strings/android_chrome_strings.grd | 13 +++
chrome/browser/ui/messages/android/BUILD.gn | 1 +
.../snackbar/INeedSnackbarManager.java | 27 +++++++
19 files changed, 243 insertions(+), 35 deletions(-)
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
create mode 100644 chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -3,6 +3,7 @@
# found in the LICENSE file.
chrome_java_sources = [
+ "java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java",
"java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java",
"java/src/org/chromium/chrome/browser/ActivityTabProvider.java",
"java/src/org/chromium/chrome/browser/ActivityUtils.java",
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -28,6 +28,11 @@
android:key="secure_dns"
android:title="@string/settings_secure_dns_title"
android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings"/>
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="always_incognito"
+ android:title="@string/always_incognito_title"
+ android:summary="@string/always_incognito_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
@@ -0,0 +1,80 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.chromium.chrome.browser;
+
+import android.content.SharedPreferences;
+
+import org.chromium.chrome.browser.tab.EmptyTabObserver;
+import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.tab.TabImpl;
+import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
+import org.chromium.chrome.browser.tab.TabLaunchType;
+import org.chromium.chrome.browser.tabmodel.TabModel;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.url.GURL;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+/**
+ * A {@link TabObserver} that implements the always-incognito preference behavior for links. When the preference is set
+ * to true, it intercepts links opened within observed {@link Tab}s and opens them in new incognito <code>Tab</code>s instead.
+ */
+public class AlwaysIncognitoLinkInterceptor extends EmptyTabObserver {
+
+ public static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
+
+ private final SharedPreferences alwaysIncognitoContainer;
+ private final Map<Tab, String> lastUrls;
+ private final Set<Tab> revertingTabs;
+
+ public AlwaysIncognitoLinkInterceptor(final SharedPreferences alwaysIncognitoContainer) {
+
+ assert alwaysIncognitoContainer != null;
+
+ this.alwaysIncognitoContainer = alwaysIncognitoContainer;
+ lastUrls = new HashMap<Tab, String>();
+ revertingTabs = new HashSet<Tab>();
+ }
+
+ @Override
+ public void onDestroyed(final Tab tab)
+ {
+ lastUrls.remove(tab);
+ revertingTabs.remove(tab);
+ }
+
+ @Override
+ public void onUpdateUrl(Tab tab, GURL gurl) {
+
+ if (tab == null) return;
+ if (gurl == null) return;
+ if (tab.isIncognito()) return;
+ if (alwaysIncognitoContainer == null) return;
+
+ String spec = gurl.getValidSpecOrEmpty();
+ if (spec == null) return;
+
+ final String lastUrl = lastUrls.put(tab, spec);
+
+ if (!alwaysIncognitoContainer.getBoolean(PREF_ALWAYS_INCOGNITO, false)) return;
+ if (revertingTabs.contains(tab)) {
+ revertingTabs.remove(tab);
+ return;
+ }
+
+ ((ChromeTabbedActivity)tab.getWindowAndroid().getActivity().get())
+ .getTabCreator(true)
+ .createNewTab(new LoadUrlParams(spec), TabLaunchType.FROM_LINK, tab);
+
+ if ((spec.equals(lastUrl)) || (!tab.canGoBack())) {
+ // this call was triggered by a reload
+ } else {
+ revertingTabs.add(tab);
+ tab.goBack();
+ }
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/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
@@ -56,6 +56,7 @@ import org.chromium.base.supplier.UnownedUserDataSupplier;
import org.chromium.base.task.PostTask;
import org.chromium.cc.input.BrowserControlsState;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout;
@@ -1756,8 +1757,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
Bundle savedInstanceState = getSavedInstanceState();
// We determine the model as soon as possible so every systems get initialized coherently.
- boolean startIncognito = savedInstanceState != null
- && savedInstanceState.getBoolean(IS_INCOGNITO_SELECTED, false);
+ boolean startIncognito = ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)
+ || (savedInstanceState != null
+ && savedInstanceState.getBoolean(IS_INCOGNITO_SELECTED, false));
mNextTabPolicySupplier = new ChromeNextTabPolicySupplier(mOverviewModeBehaviorSupplier);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -101,6 +101,7 @@ import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager.ContextualSearchTabPromotionDelegate;
import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.dependency_injection.ChromeActivityComponent;
import org.chromium.chrome.browser.dependency_injection.ModuleFactoryOverrides;
import org.chromium.chrome.browser.device.DeviceClassManager;
@@ -1872,6 +1873,9 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
throw new IllegalStateException(
"Attempting to access TabCreator before initialization");
}
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ incognito = true;
+ }
return mTabCreatorManagerSupplier.get().getTabCreator(incognito);
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
@@ -378,6 +378,12 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
}
private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
+ if (ContextUtils.getAppSharedPreferences().getBoolean("always_incognito", false)) {
+ final MenuItem newTabOption = menu.findItem(R.id.new_tab_menu_id);
+ if (newTabOption != null)
+ newTabOption.setVisible(false);
+ }
+
// We have to iterate all menu items since same menu item ID may be associated with more
// than one menu items.
boolean isMenuGroupTabsVisible = TabUiFeatureUtilities.isTabGroupsAndroidEnabled(mContext)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -31,6 +31,7 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.supplier.Supplier;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator;
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item;
import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator.ListItemType;
@@ -409,6 +410,10 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
boolean hasSaveImage = false;
mShowEphemeralTabNewLabel = null;
+ boolean always_incognito =
+ ContextUtils.getAppSharedPreferences().getBoolean(
+ AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
+
List<Pair<Integer, ModelList>> groupedItems = new ArrayList<>();
if (mParams.isAnchor()) {
@@ -427,6 +432,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
}
}
+
if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) {
linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB));
}
@@ -451,7 +457,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
}
}
if (FirstRunStatus.getFirstRunFlowComplete()) {
- if (!mItemDelegate.isIncognito()
+ if ((always_incognito || !mItemDelegate.isIncognito())
&& UrlUtilities.isDownloadableScheme(mParams.getLinkUrl())) {
linkGroup.add(createListItem(Item.SAVE_LINK_AS));
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java
@@ -39,31 +39,6 @@ public class CustomTabActivityLifecycleUmaTracker implements PauseResumeWithNati
private boolean mIsInitialResume = true;
private void recordIncognitoLaunchReason() {
- IncognitoCustomTabIntentDataProvider incognitoProvider =
- (IncognitoCustomTabIntentDataProvider) mIntentDataProvider;
-
- @IntentHandler.IncognitoCCTCallerId
- int incognitoCCTCallerId = incognitoProvider.getFeatureIdForMetricsCollection();
- RecordHistogram.recordEnumeratedHistogram("CustomTabs.IncognitoCCTCallerId",
- incognitoCCTCallerId, IntentHandler.IncognitoCCTCallerId.NUM_ENTRIES);
-
- // Record which 1P app launched Incognito CCT.
- if (incognitoCCTCallerId == IntentHandler.IncognitoCCTCallerId.GOOGLE_APPS) {
- String sendersPackageName = incognitoProvider.getSendersPackageName();
- @IntentHandler.ExternalAppId
- int externalId = IntentHandler.mapPackageToExternalAppId(sendersPackageName);
- if (externalId != IntentHandler.ExternalAppId.OTHER) {
- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ClientAppId.Incognito",
- externalId, IntentHandler.ExternalAppId.NUM_ENTRIES);
- } else {
- // Using package name didn't give any meaningful insight on who launched the
- // Incognito CCT, falling back to check if they provided EXTRA_APPLICATION_ID.
- externalId =
- IntentHandler.determineExternalIntentSource(incognitoProvider.getIntent());
- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ClientAppId.Incognito",
- externalId, IntentHandler.ExternalAppId.NUM_ENTRIES);
- }
- }
}
private void recordUserAction() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -50,6 +50,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.device.mojom.ScreenOrientationLockType;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -727,7 +730,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
@Override
public boolean isIncognito() {
- return false;
+ return ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
}
@Nullable
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
@@ -34,6 +34,9 @@ import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.url.GURL;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
/**
* This class attempts to preload the tab if the url is known from the intent when the profile
* is created. This is done to improve startup latency.
@@ -185,17 +188,22 @@ public class StartupTabPreloader implements ProfileManager.Observer, DestroyObse
Intent intent = mIntentSupplier.get();
GURL url = UrlFormatter.fixupUrl(getUrlFromIntent(intent));
+ boolean isIncognito = ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
+
+ Profile profile = Profile.getLastUsedRegularProfile();
ChromeTabCreator chromeTabCreator =
- (ChromeTabCreator) mTabCreatorManager.getTabCreator(false);
+ (ChromeTabCreator) mTabCreatorManager.getTabCreator(isIncognito);
WebContents webContents =
- WebContentsFactory.createWebContents(Profile.getLastUsedRegularProfile(), false);
+ WebContentsFactory.createWebContents(
+ isIncognito ? profile.getPrimaryOTRProfile(true /* createIfNeeded */) : profile,
+ false);
mLoadUrlParams = mIntentHandler.createLoadUrlParamsForIntent(url.getSpec(), intent);
// Create a detached tab, but don't add it to the tab model yet. We'll do that
// later if the loadUrlParams etc... match.
mTab = TabBuilder.createLiveTab(false)
- .setIncognito(false)
+ .setIncognito(isIncognito)
.setLaunchType(TabLaunchType.FROM_EXTERNAL_APP)
.setWindow(mWindowAndroid)
.setWebContents(webContents)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -27,6 +27,10 @@ import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
+import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
+import org.chromium.chrome.browser.ApplicationLifetime;
import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
@@ -41,7 +45,12 @@ import org.chromium.ui.text.SpanApplier;
* Fragment to keep track of the all the privacy related preferences.
*/
public class PrivacySettings
- extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
+ extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener,
+ INeedSnackbarManager {
+ private SnackbarManager mSnackbarManager;
+ private Snackbar mSnackbar;
+
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_NETWORK_PREDICTIONS = "preload_pages";
private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
@@ -84,6 +93,25 @@ public class PrivacySettings
(ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
canMakePaymentPref.setOnPreferenceChangeListener(this);
+ ChromeSwitchPreference alwaysIncognitoPref =
+ (ChromeSwitchPreference) findPreference(PREF_ALWAYS_INCOGNITO);
+ alwaysIncognitoPref.setOnPreferenceChangeListener(this);
+
+ mSnackbar = Snackbar.make(getActivity().getString(R.string.ui_relaunch_notice),
+ new SnackbarManager.SnackbarController() {
+ @Override
+ public void onDismissNoAction(Object actionData) { }
+
+ @Override
+ public void onAction(Object actionData) {
+ ApplicationLifetime.terminate(true);
+ }
+ }, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_UNKNOWN)
+ .setSingleLine(false)
+ .setAction(getActivity().getString(R.string.relaunch),
+ /*actionData*/null)
+ .setDuration(/*durationMs*/70000);
+
ChromeSwitchPreference networkPredictionPref =
(ChromeSwitchPreference) findPreference(PREF_NETWORK_PREDICTIONS);
networkPredictionPref.setChecked(
@@ -115,6 +143,9 @@ public class PrivacySettings
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrivacyPreferencesManagerImpl.getInstance().setNetworkPredictionEnabled(
(boolean) newValue);
+ } else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
+ if (!mSnackbarManager.isShowing())
+ mSnackbarManager.showSnackbar(mSnackbar);
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
@@ -192,4 +223,8 @@ public class PrivacySettings
}
return false;
}
+
+ public void setSnackbarManager(SnackbarManager manager) {
+ mSnackbarManager = manager;
+ }
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -51,6 +51,7 @@ import org.chromium.chrome.browser.safety_check.SafetyCheckSettingsFragment;
import org.chromium.chrome.browser.safety_check.SafetyCheckUpdatesDelegateImpl;
import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings;
import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate;
+import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
@@ -171,6 +172,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
.getSiteSettingsDelegate());
delegate.setSnackbarManager(mSnackbarManager);
}
+ if (fragment instanceof INeedSnackbarManager) {
+ ((INeedSnackbarManager)fragment).setSnackbarManager(mSnackbarManager);
+ }
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
@@ -44,6 +44,10 @@ import org.chromium.url.GURL;
import java.nio.ByteBuffer;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+import org.chromium.chrome.browser.tab.TabObserver;
+
/**
* This class creates various kinds of new tabs and adds them to the right {@link TabModel}.
*/
@@ -74,6 +78,7 @@ public class ChromeTabCreator extends TabCreator {
private final Activity mActivity;
private final StartupTabPreloader mStartupTabPreloader;
private final boolean mIncognito;
+ private final TabObserver mExtraLogic;
private WindowAndroid mNativeWindow;
private TabModel mTabModel;
@@ -96,6 +101,10 @@ public class ChromeTabCreator extends TabCreator {
mNativeWindow = nativeWindow;
mTabDelegateFactorySupplier = tabDelegateFactory;
mIncognito = incognito;
+ if (!mIncognito)
+ mExtraLogic = new AlwaysIncognitoLinkInterceptor(ContextUtils.getAppSharedPreferences());
+ else
+ mExtraLogic = null;
mOverviewNTPCreator = overviewNTPCreator;
mAsyncTabParamsManager = asyncTabParamsManager;
mTabModelSelectorSupplier = tabModelSelectorSupplier;
@@ -259,6 +268,8 @@ public class ChromeTabCreator extends TabCreator {
if (creationState == TabCreationState.LIVE_IN_FOREGROUND && !openInForeground) {
creationState = TabCreationState.LIVE_IN_BACKGROUND;
}
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
mTabModel.addTab(tab, position, type, creationState);
return tab;
} finally {
@@ -293,6 +304,8 @@ public class ChromeTabCreator extends TabCreator {
@TabCreationState
int creationState = openInForeground ? TabCreationState.LIVE_IN_FOREGROUND
: TabCreationState.LIVE_IN_BACKGROUND;
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
mTabModel.addTab(tab, position, type, creationState);
return true;
}
@@ -333,7 +346,6 @@ public class ChromeTabCreator extends TabCreator {
// TODO(crbug.com/1081924): Clean up the launches from SearchActivity/Chrome.
public Tab launchUrlFromExternalApp(
LoadUrlParams loadUrlParams, String appId, boolean forceNewTab, Intent intent) {
- assert !mIncognito;
// Don't re-use tabs for intents from Chrome. Note that this can be spoofed so shouldn't be
// relied on for anything security sensitive.
boolean isLaunchedFromChrome = TextUtils.equals(appId, mActivity.getPackageName());
@@ -428,6 +440,8 @@ public class ChromeTabCreator extends TabCreator {
.setSerializedCriticalPersistedTabData(serializedCriticalPersistedTabData)
.build();
}
+ if (mExtraLogic != null)
+ tab.addObserver(mExtraLogic);
if (isIncognito != mIncognito) {
throw new IllegalStateException("Incognito state mismatch. TabState: "
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
@@ -18,6 +18,7 @@ import androidx.core.util.AtomicFile;
import org.chromium.base.Callback;
import org.chromium.base.CallbackController;
+import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.ObserverList;
import org.chromium.base.StreamUtil;
@@ -56,6 +57,8 @@ import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.url.GURL;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -687,6 +690,13 @@ public class TabPersistentStore {
}
}
}
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ if (!isIncognito) {
+ Log.w(TAG, "Failed to restore tab: not in incognito mode.");
+ return;
+ }
+ }
+
TabModel model = mTabModelSelector.getModel(isIncognito);
if (model.isIncognito() != isIncognito) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
@@ -28,6 +28,9 @@ import org.chromium.chrome.browser.browserservices.intents.WebappExtras;
import org.chromium.chrome.browser.flags.ActivityType;
import org.chromium.components.browser_ui.widget.TintedDrawable;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+
/**
* Stores info about a web app.
*/
@@ -41,6 +44,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
private final Intent mIntent;
private final ColorProviderImpl mColorProvider;
+ private boolean mIsIncognito = false;
+
/**
* Returns the toolbar color to use if a custom color is not specified by the webapp.
*/
@@ -62,6 +67,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
mWebappExtras = webappExtras;
mWebApkExtras = webApkExtras;
mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP;
+
+ if (ContextUtils.getAppSharedPreferences().getBoolean(AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false)) {
+ mIsIncognito = true;
+ }
}
@Override
@@ -150,6 +159,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
return mWebApkExtras;
}
+ @Override
+ public boolean isIncognito() {
+ return mIsIncognito;
+ }
+
@Override
public int getDefaultOrientation() {
return mWebappExtras.orientation;
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -447,7 +447,7 @@ const base::Feature kCCTIncognito{"CCTIncognito",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTIncognitoAvailableToThirdParty{
- "CCTIncognitoAvailableToThirdParty", base::FEATURE_DISABLED_BY_DEFAULT};
+ "CCTIncognitoAvailableToThirdParty", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTPostMessageAPI{"CCTPostMessageAPI",
base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -907,6 +907,19 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SYNCED_NO_LINK" desc="A text for the basic tab explaining browsing history for users with history sync. This version is shown when the link to MyActivity is displayed separately.">
Clears history from all synced devices.
</message>
+ <!-- always incognito -->
+ <message name="IDS_ALWAYS_INCOGNITO_TITLE" desc="Title for always incognito mode">
+ Open links in incognito tabs always
+ </message>
+ <message name="IDS_ALWAYS_INCOGNITO_SUMMARY" desc="Summary for always incognito mode">
+ Opens links in incognito tabs when you click on new tab or on a link
+ </message>
+ <message name="IDS_RELAUNCH" desc="Summary for always incognito mode">
+ Relaunch
+ </message>
+ <message name="IDS_UI_RELAUNCH_NOTICE" desc="Summary for always incognito mode">
+ Your changes will take effect the next time you relaunch Bromite.
+ </message>
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SIGNED_IN" desc="A text explaining other forms of activity for signed in users.">
Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <ph name="BEGIN_LINK">&lt;link&gt;</ph>myactivity.google.com<ph name="END_LINK">&lt;/link&gt;</ph>.
</message>
diff --git a/chrome/browser/ui/messages/android/BUILD.gn b/chrome/browser/ui/messages/android/BUILD.gn
--- a/chrome/browser/ui/messages/android/BUILD.gn
+++ b/chrome/browser/ui/messages/android/BUILD.gn
@@ -22,6 +22,7 @@ android_resources("java_resources") {
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java",
+ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollection.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java",
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java
new file mode 100644
--- /dev/null
+++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java
@@ -0,0 +1,27 @@
+/*
+ This file is part of Bromite.
+
+ Bromite is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bromite is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+package org.chromium.chrome.browser.ui.messages.snackbar;
+
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
+
+/**
+ * An interface that allows using snackbars in the settings
+ */
+public interface INeedSnackbarManager {
+ void setSnackbarManager(SnackbarManager manager);
+}
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,175 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 29 Aug 2018 11:03:44 +0200
Subject: Add custom tab intents privacy option
Add custom tab intents privacy option and force
open external links in incognito flag.
Flags are mutually exclusive.
See also: https://github.com/bromite/bromite/issues/1474
---
.../java/res/xml/privacy_preferences.xml | 10 ++++++
.../browser/LaunchIntentDispatcher.java | 19 ++++++++++
.../privacy/settings/PrivacySettings.java | 36 +++++++++++++++++++
.../strings/android_chrome_strings.grd | 15 ++++++++
4 files changed, 80 insertions(+)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -56,6 +56,16 @@
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
android:title="@string/do_not_track_title"/>
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="allow_custom_tab_intents"
+ android:title="@string/allow_custom_tab_intents_title"
+ android:summary="@string/allow_custom_tab_intents_summary"
+ android:defaultValue="false" />
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="open_external_links_incognito"
+ android:title="@string/open_external_links_incognito_title"
+ android:summary="@string/open_external_links_incognito_summary"
+ android:defaultValue="false" />
<Preference
android:key="privacy_sandbox"
android:title="@string/prefs_privacy_sandbox"
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
@@ -59,6 +59,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Set;
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
+
/**
* Dispatches incoming intents to the appropriate activity based on the current configuration and
* Intent fired.
@@ -279,6 +281,12 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
*/
public static boolean isCustomTabIntent(Intent intent) {
if (intent == null) return false;
+ if (ContextUtils.getAppSharedPreferences()
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
+ return false;
+ if (!ContextUtils.getAppSharedPreferences()
+ .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+ return false;
if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
|| !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
return false;
@@ -417,6 +425,17 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
if (Intent.ACTION_VIEW.equals(newIntent.getAction())
&& !IntentHandler.wasIntentSenderChrome(newIntent)) {
+
+ if (ContextUtils.getAppSharedPreferences().getBoolean(
+ PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false)) {
+ Context applicationContext = ContextUtils.getApplicationContext();
+ newIntent = IntentHandler.createTrustedOpenNewTabIntent(applicationContext,
+ /*incognito*/true);
+ newIntent.setData(mIntent.getData());
+ newIntent.setPackage(applicationContext.getPackageName());
+ newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ }
+
long time = SystemClock.elapsedRealtime();
if (!chromeTabbedTaskExists()) {
newIntent.putExtra(IntentHandler.EXTRA_STARTED_TABBED_CHROME_TASK, true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -90,6 +90,9 @@ public class PrivacySettings
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
+ private ChromeSwitchPreference allowCustomTabIntentsPref;
+ private ChromeSwitchPreference openExternalLinksPref;
+
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
PrivacyPreferencesManagerImpl privacyPrefManager =
@@ -191,6 +194,9 @@ public class PrivacySettings
updateSummaries();
}
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
+ public static final String PREF_OPEN_EXTERNAL_LINKS_INCOGNITO = "open_external_links_incognito";
+
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
@@ -222,6 +228,26 @@ public class PrivacySettings
} else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED, (boolean) newValue);
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
+ sharedPreferencesEditor.apply();
+
+ // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
+ // are mutually exclusive
+ if((boolean)newValue && ContextUtils.getAppSharedPreferences()
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
+ openExternalLinksPref.setChecked(!(boolean)newValue);
+ } else if (PREF_OPEN_EXTERNAL_LINKS_INCOGNITO.equals(key)) {
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+ sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
+ sharedPreferencesEditor.apply();
+
+ // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
+ // are mutually exclusive
+ if((boolean)newValue && ContextUtils.getAppSharedPreferences()
+ .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
+ allowCustomTabIntentsPref.setChecked(false);
}
return true;
@@ -257,6 +283,16 @@ public class PrivacySettings
canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
}
+ allowCustomTabIntentsPref =
+ (ChromeSwitchPreference) findPreference(PREF_ALLOW_CUSTOM_TAB_INTENTS);
+ allowCustomTabIntentsPref.setOnPreferenceChangeListener(this);
+ allowCustomTabIntentsPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
+ openExternalLinksPref =
+ (ChromeSwitchPreference) findPreference(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO);
+ openExternalLinksPref.setOnPreferenceChangeListener(this);
+ openExternalLinksPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+
Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
if (doNotTrackPref != null) {
doNotTrackPref.setSummary(prefService.getBoolean(Pref.ENABLE_DO_NOT_TRACK)
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -4496,6 +4496,21 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_NEAR_OOM_REDUCTION_DECLINE" desc="The text of the button letting the user decline the browser's intervention, so that the page can be reloaded.">
Show original
</message>
+ <!-- Allow custom tab intents -->
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_TITLE" desc="Text for 'Allow custom tab intents' settings-privacy option.">
+ Allow custom tab intents
+ </message>
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
+ Allow applications to open custom tab intents, similar to webview.
+ </message>
+
+ <!-- Open External Links in Incognito -->
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_TITLE" desc="Text for 'Open external links in incognito' settings-privacy option.">
+ Open external links in incognito
+ </message>
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_SUMMARY" desc="Summary text for 'Open external links in incognito' settings-privacy option.">
+ Force the opening of all external links in incognito mode
+ </message>
<!-- Autofill Assistant preferences -->
<!-- TODO(b/168178344): Move to Assistant settings strings section below. -->
--
2.17.1
-112
View File
@@ -1,112 +0,0 @@
From: Serg <serg.zhukovsky@gmail.com>
Date: Tue, 31 Jan 2017 22:12:27 -0500
Subject: Add exit menu item
Corrected Exit functionality
---
chrome/android/java/res/menu/main_menu.xml | 6 ++++++
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++++
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 6 ++++++
.../chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
.../browser/ui/android/strings/android_chrome_strings.grd | 3 +++
5 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -124,6 +124,9 @@
android:icon="@drawable/gm_filled_cardboard_24" />
<item android:id="@+id/managed_by_menu_id"
android:title="@string/managed" />
+ <item android:id="@+id/exit_id"
+ android:title="@string/menu_exit"
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
</group>
<!-- Items shown only in the tab switcher -->
@@ -150,6 +153,9 @@
<item android:id="@id/preferences_id"
android:title="@string/menu_settings"
android:icon="@drawable/settings_cog" />
+ <item android:id="@+id/exit_id"
+ android:title="@string/menu_exit"
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
</group>
<!-- Items shown only in the tab switcher when start surface is enabled -->
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
@@ -206,6 +206,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import org.chromium.chrome.browser.ApplicationLifetime;
+
/**
* This is the main activity for ChromeMobile when not running in document mode. All the tabs
* are accessible via a chrome specific tab switching UI.
@@ -2008,6 +2010,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
} else if (id == R.id.close_tab) {
getCurrentTabModel().closeTab(currentTab, true, false, true);
RecordUserAction.record("MobileTabClosed");
+ } else if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
} else if (id == R.id.close_all_tabs_menu_id) {
// Close both incognito and normal tabs
getTabModelSelector().closeAllTabs();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -66,6 +66,7 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.ActivityTabProvider;
import org.chromium.chrome.browser.ActivityUtils;
import org.chromium.chrome.browser.AppHooks;
+import org.chromium.chrome.browser.ApplicationLifetime;
import org.chromium.chrome.browser.ChromeActivitySessionTracker;
import org.chromium.chrome.browser.ChromeApplicationImpl;
import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
@@ -2303,6 +2304,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
return true;
}
+ if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
+ return true;
+ }
+
if (id == R.id.update_menu_id) {
UpdateMenuItemHelper.getInstance().onMenuItemClicked(this);
return true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
@@ -82,7 +82,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
// Kick off a timer to kill the process after a delay, which fires only if the Activities
// take too long to be finished.
- mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
+ if (restart) {
+ mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
+ } else {
+ fireBrowserRestartActivityIntent();
+ }
}
@Override
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -3144,6 +3144,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
Turn on Request desktop site
</message>
+ <message name="IDS_MENU_EXIT" desc="Menu item for exit browser. [CHAR-LIMIT=27]">
+ Exit
+ </message>
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR_LIMIT=27]">
Appearance
</message>
--
2.17.1
@@ -1,138 +0,0 @@
From: Blaise <BlaiseD@GMail.com>
Date: Sat, 22 Aug 2020 08:52:40 -0500
Subject: Add flag for omnibox autocomplete filtering
Adds a flag that restricts whether search history, clipboard, bookmarks
and internal chrome:// pages will be used for the autocomplete results.
---
chrome/browser/about_flags.cc | 21 +++++++++++++++++++
.../browser/autocomplete_controller.cc | 11 ++++++++++
.../omnibox/browser/history_url_provider.cc | 3 +++
components/omnibox/browser/search_provider.cc | 4 ++++
components/url_formatter/url_fixer.cc | 4 ++++
5 files changed, 43 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -449,6 +449,22 @@ const FeatureEntry::FeatureVariation kReaderModeDiscoverabilityVariations[] = {
base::size(kReaderModeOfferInSettings), nullptr}};
#endif // OS_ANDROID
+const FeatureEntry::Choice kOmniboxAutocompleteFiltering[] = {
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
+ {"Search suggestions only",
+ "omnibox-autocomplete-filtering",
+ "search"},
+ {"Search suggestions and bookmarks",
+ "omnibox-autocomplete-filtering",
+ "search-bookmarks"},
+ {"Search suggestions and internal chrome pages",
+ "omnibox-autocomplete-filtering",
+ "search-chrome"},
+ {"Search suggestions, bookmarks, and internal chrome pages",
+ "omnibox-autocomplete-filtering",
+ "search-bookmarks-chrome"},
+};
+
#if defined(OS_ANDROID)
const FeatureEntry::FeatureParam kAdaptiveButton_AlwaysNone[] = {
{"mode", "always-none"}};
@@ -4766,6 +4782,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
#endif // !defined(OS_ANDROID)
+ {"omnibox-autocomplete-filtering",
+ "Omnibox Autocomplete Filtering",
+ "Restrict omnibox autocomplete results to a combination of search suggestions (if enabled), bookmarks, and internal chrome pages. ungoogled-chromium flag.",
+ kOsAll, MULTI_VALUE_TYPE(kOmniboxAutocompleteFiltering)},
+
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
{"webui-feedback", flag_descriptions::kWebuiFeedbackName,
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
--- a/components/omnibox/browser/autocomplete_controller.cc
+++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -15,6 +15,8 @@
#include "base/bind.h"
#include "base/check_op.h"
+#include "base/containers/contains.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/format_macros.h"
#include "base/metrics/histogram.h"
@@ -276,6 +278,15 @@ AutocompleteController::AutocompleteController(
search_service_worker_signal_sent_(false),
template_url_service_(provider_client_->GetTemplateURLService()) {
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering")) {
+ const std::string flag_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering");
+ provider_types &= AutocompleteProvider::TYPE_KEYWORD | AutocompleteProvider::TYPE_SEARCH |
+ AutocompleteProvider::TYPE_HISTORY_URL | AutocompleteProvider::TYPE_BOOKMARK | AutocompleteProvider::TYPE_BUILTIN;
+ if (!base::Contains(flag_value, "bookmarks"))
+ provider_types &= ~AutocompleteProvider::TYPE_BOOKMARK;
+ if (!base::Contains(flag_value, "chrome"))
+ provider_types &= ~AutocompleteProvider::TYPE_BUILTIN;
+ }
if (provider_types & AutocompleteProvider::TYPE_BOOKMARK)
providers_.push_back(new BookmarkProvider(provider_client_.get()));
if (provider_types & AutocompleteProvider::TYPE_BUILTIN)
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
--- a/components/omnibox/browser/history_url_provider.cc
+++ b/components/omnibox/browser/history_url_provider.cc
@@ -553,6 +553,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
matches_.push_back(what_you_typed_match);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
+ return;
+
// We'll need the history service to run both passes, so try to obtain it.
history::HistoryService* const history_service =
client()->GetHistoryService();
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -12,6 +12,7 @@
#include "base/base64.h"
#include "base/bind.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/i18n/break_iterator.h"
#include "base/i18n/case_conversion.h"
@@ -647,6 +648,9 @@ void SearchProvider::Run(bool query_is_private) {
}
void SearchProvider::DoHistoryQuery(bool minimal_changes) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
+ return;
+
// The history query results are synchronous, so if minimal_changes is true,
// we still have the last results and don't need to do anything.
if (minimal_changes)
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
--- a/components/url_formatter/url_fixer.cc
+++ b/components/url_formatter/url_fixer.cc
@@ -9,6 +9,8 @@
#include <algorithm>
#include "base/check_op.h"
+#include "base/containers/contains.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/ranges/algorithm.h"
@@ -607,6 +609,8 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url);
if (chrome_url && !parts.host.is_valid())
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering") ||
+ base::Contains(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering"), "chrome"))
url.append(kChromeUIDefaultHost);
FixupPort(trimmed, parts.port, &url);
FixupPath(trimmed, parts.path, &url);
--
2.17.1
@@ -1,98 +0,0 @@
From: Wengling Chen <feiyu2817@gmail.com>
Date: Mon, 1 Feb 2021 19:18:55 +0200
Subject: Add flag for save-data-header
---
chrome/browser/about_flags.cc | 3 +++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
content/browser/loader/browser_initiated_resource_request.cc | 5 +++--
services/network/public/cpp/features.cc | 4 ++++
services/network/public/cpp/features.h | 2 ++
6 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4500,6 +4500,9 @@ const FeatureEntry kFeatureEntries[] = {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
+ {"enable-save-data-header", flag_descriptions::kEnableSaveDataHeaderName,
+ flag_descriptions::kEnableSaveDataHeaderDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(network::features::kEnableSaveDataHeader)},
{"enable-command-line-on-non-rooted-devices",
flag_descriptions::kEnableCommandLineOnNonRootedName,
flag_descriptions::kEnableCommandLineOnNoRootedDescription, kOsAndroid,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1035,6 +1035,10 @@ const char kDisableKeepaliveFetchDescription[] =
"Disable fetch with keepalive set "
"(https://fetch.spec.whatwg.org/#request-keepalive-flag).";
+const char kEnableSaveDataHeaderName[] = "Enable save-data header";
+const char kEnableSaveDataHeaderDescription[] =
+ "Enable save-data header without enabling Data Saver.";
+
const char kExperimentalAccessibilityLanguageDetectionName[] =
"Experimental accessibility language detection";
const char kExperimentalAccessibilityLanguageDetectionDescription[] =
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
@@ -564,6 +564,9 @@ extern const char kDiagnosticsAppNavigationDescription[];
extern const char kDisableKeepaliveFetchName[];
extern const char kDisableKeepaliveFetchDescription[];
+extern const char kEnableSaveDataHeaderName[];
+extern const char kEnableSaveDataHeaderDescription[];
+
extern const char kMemlogName[];
extern const char kMemlogDescription[];
extern const char kMemlogModeMinimal[];
diff --git a/content/browser/loader/browser_initiated_resource_request.cc b/content/browser/loader/browser_initiated_resource_request.cc
--- a/content/browser/loader/browser_initiated_resource_request.cc
+++ b/content/browser/loader/browser_initiated_resource_request.cc
@@ -40,9 +40,10 @@ void UpdateAdditionalHeadersForBrowserInitiatedRequest(
// Set the Save-Data header if appropriate.
// https://tools.ietf.org/html/draft-grigorik-http-client-hints-03#section-7
- if (GetContentClient()->browser()->IsDataSaverEnabled(browser_context) &&
+ if ((GetContentClient()->browser()->IsDataSaverEnabled(browser_context) &&
!base::GetFieldTrialParamByFeatureAsBool(features::kDataSaverHoldback,
- "holdback_web", false)) {
+ "holdback_web", false)) ||
+ base::FeatureList::IsEnabled(network::features::kEnableSaveDataHeader)) {
if (should_update_existing_headers) {
headers->RemoveHeader("Save-Data");
}
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -156,6 +156,10 @@ const base::FeatureParam<std::string>
"DisabledProviders", ""};
// Disable special treatment on requests with keepalive set (see
+// Enable save-data header seprately, without enabled data reduction service
+const base::Feature kEnableSaveDataHeader{"EnableSaveDataHeader",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// https://fetch.spec.whatwg.org/#request-keepalive-flag). This is introduced
// for investigation on the memory usage, and should not be enabled widely.
const base::Feature kDisableKeepaliveFetch{"DisableKeepaliveFetch",
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -60,6 +60,8 @@ extern const base::FeatureParam<std::string>
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kDisableKeepaliveFetch;
+extern const base::Feature kEnableSaveDataHeader;
+COMPONENT_EXPORT(NETWORK_CPP)
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kTrustTokens;
--
2.17.1
@@ -1,157 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 8 Jul 2018 22:42:04 +0200
Subject: Add flag to configure maximum connections per host
With the introduction of this flag it is possible to increase the maximum
allowed connections per host; this can however be detrimental to devices
with limited CPU/memory resources and it is disabled by default.
---
chrome/browser/about_flags.cc | 8 ++++++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
.../common/network_features.cc | 3 +++
.../common/network_features.h | 4 ++++
.../common/network_switch_list.h | 4 ++++
.../spoof_checks/top_domains/BUILD.gn | 1 +
net/socket/client_socket_pool_manager.cc | 17 +++++++++++++++++
8 files changed, 44 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -837,6 +837,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
net::kEffectiveConnectionType4G},
};
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
+};
+
// Ensure that all effective connection types returned by Network Quality
// Estimator (NQE) are also exposed via flags.
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
@@ -3792,6 +3797,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAndroidPictureInPictureAPIName,
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
{"reengagement-notification",
flag_descriptions::kReengagementNotificationName,
flag_descriptions::kReengagementNotificationDescription, kOsAndroid,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1524,6 +1524,10 @@ const char kMediaHistoryDescription[] =
"Enables Media History which records data around media playbacks on "
"websites.";
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
+const char kMaxConnectionsPerHostDescription[] =
+ "Customize maximum allowed connections per host.";
+
const char kMediaRouterCastAllowAllIPsName[] =
"Connect to Cast devices on all IP addresses";
const char kMediaRouterCastAllowAllIPsDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -877,6 +877,9 @@ extern const char kLogJsConsoleMessagesDescription[];
extern const char kMediaHistoryName[];
extern const char kMediaHistoryDescription[];
+extern const char kMaxConnectionsPerHostName[];
+extern const char kMaxConnectionsPerHostDescription[];
+
extern const char kMediaRouterCastAllowAllIPsName[];
extern const char kMediaRouterCastAllowAllIPsDescription[];
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
--- a/components/network_session_configurator/common/network_features.cc
+++ b/components/network_session_configurator/common/network_features.cc
@@ -8,4 +8,7 @@
namespace features {
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
+ kMaxConnectionsPerHostChoice15[] = "15";
+
} // namespace features
diff --git a/components/network_session_configurator/common/network_features.h b/components/network_session_configurator/common/network_features.h
--- a/components/network_session_configurator/common/network_features.h
+++ b/components/network_session_configurator/common/network_features.h
@@ -10,6 +10,10 @@
namespace features {
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kMaxConnectionsPerHostChoiceDefault[],
+ kMaxConnectionsPerHostChoice6[],
+ kMaxConnectionsPerHostChoice15[];
+
} // namespace features
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
diff --git a/components/network_session_configurator/common/network_switch_list.h b/components/network_session_configurator/common/network_switch_list.h
--- a/components/network_session_configurator/common/network_switch_list.h
+++ b/components/network_session_configurator/common/network_switch_list.h
@@ -19,6 +19,10 @@ NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
// Enables the QUIC protocol. This is a temporary testing flag.
NETWORK_SWITCH(kEnableQuic, "enable-quic")
+// Allows specifying a higher number of maximum connections per host
+// (15 instead of 6, mirroring the value Mozilla uses).
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
+
// Ignores certificate-related errors.
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
@@ -73,6 +73,7 @@ executable("make_top_domain_list_variables") {
"//base:i18n",
"//components/url_formatter/spoof_checks/common_words:common",
"//third_party/icu",
+ "//components/network_session_configurator/common"
]
if (is_ios) {
frameworks = [ "UIKit.framework" ]
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
--- a/net/socket/client_socket_pool_manager.cc
+++ b/net/socket/client_socket_pool_manager.cc
@@ -20,6 +20,10 @@
#include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool.h"
#include "net/socket/connect_job.h"
+#include "components/network_session_configurator/common/network_switches.h"
+
+#include "base/command_line.h"
+#include "base/strings/string_number_conversions.h"
#include "net/ssl/ssl_config.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
@@ -173,6 +177,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
int ClientSocketPoolManager::max_sockets_per_group(
HttpNetworkSession::SocketPoolType pool_type) {
DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES);
+
+ if (pool_type == HttpNetworkSession::NORMAL_SOCKET_POOL) {
+ int maxConnectionsPerHost = 0;
+ auto value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kMaxConnectionsPerHost);
+ if (!value.empty() && !base::StringToInt(value, &maxConnectionsPerHost)) {
+ LOG(DFATAL) << "--" << switches::kMaxConnectionsPerHost << " only accepts integers as arguments (\"" << value << "\" is invalid)";
+ }
+ if (maxConnectionsPerHost != 0) {
+ return maxConnectionsPerHost;
+ }
+ // fallthrough for default value
+ }
+
return g_max_sockets_per_group[pool_type];
}
--
2.17.1
@@ -1,73 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 25 Oct 2018 23:13:34 +0200
Subject: Add flag to control video playback resume feature
Disable it by default on Android as it is everywhere else
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
media/base/media_switches.cc | 6 +-----
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2708,6 +2708,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kWebRtcRemoteEventLogName,
flag_descriptions::kWebRtcRemoteEventLogDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kWebRtcRemoteEventLog)},
+ {"resume-background-video",
+ flag_descriptions::kResumeBackgroundVideoName,
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
#endif
{"enable-webrtc-srtp-aes-gcm", flag_descriptions::kWebrtcSrtpAesGcmName,
flag_descriptions::kWebrtcSrtpAesGcmDescription, 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
@@ -1120,6 +1120,11 @@ const char kEnablePenetratingImageSelectionDescription[] =
"Enables image options to be surfaced in the context menu for nodes "
"covered by transparent overlays.";
+const char kResumeBackgroundVideoName[] = "Resume background video.";
+const char kResumeBackgroundVideoDescription[] =
+ "Resume background video playback when tab re-gains focus; additionally, "
+ "it will pause video playback every single time you switch tabs.";
+
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
const char kEnablePixelCanvasRecordingDescription[] =
"Pixel canvas recording allows the compositor to raster contents aligned "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -632,6 +632,9 @@ extern const char kEnablePortalsDescription[];
extern const char kEnablePortalsCrossOriginName[];
extern const char kEnablePortalsCrossOriginDescription[];
+extern const char kResumeBackgroundVideoName[];
+extern const char kResumeBackgroundVideoDescription[];
+
extern const char kEnablePixelCanvasRecordingName[];
extern const char kEnablePixelCanvasRecordingDescription[];
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -276,11 +276,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
// when in background.
const base::Feature kResumeBackgroundVideo {
"resume-background-video",
-#if defined(OS_ANDROID)
- base::FEATURE_ENABLED_BY_DEFAULT
-#else
- base::FEATURE_DISABLED_BY_DEFAULT
-#endif
+ base::FEATURE_DISABLED_BY_DEFAULT
};
// When enabled, MediaCapabilities will check with GPU Video Accelerator
--
2.17.1
@@ -1,156 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 18 Nov 2018 13:06:49 +0100
Subject: Add flag to disable IPv6 probes
---
chrome/browser/about_flags.cc | 5 +++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
components/subresource_filter/tools/BUILD.gn | 6 ++++++
.../url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
net/dns/host_resolver_manager.cc | 9 ++++++++-
services/network/public/cpp/features.cc | 4 ++++
services/network/public/cpp/features.h | 2 ++
8 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4742,6 +4742,11 @@ const FeatureEntry kFeatureEntries[] = {
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)
+ {"ipv6-probing",
+ flag_descriptions::kIPv6ProbingName,
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
+
#if !defined(OS_ANDROID)
{"ntp-cache-one-google-bar", flag_descriptions::kNtpCacheOneGoogleBarName,
flag_descriptions::kNtpCacheOneGoogleBarDescription, kOsDesktop,
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
@@ -3015,6 +3015,10 @@ const char kContextualSearchRankerQueryDescription[] =
const char kContextualSearchSecondTapName[] =
"Contextual Search second tap triggering";
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
+const char kIPv6ProbingDescription[] =
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
+
const char kContextualSearchSecondTapDescription[] =
"Enables triggering on a second tap gesture even when Ranker would "
"normally suppress that tap.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -689,6 +689,9 @@ extern const char kEnableWasmLazyCompilationName[];
extern const char kEnableWasmLazyCompilationDescription[];
extern const char kEnableWasmTieringName[];
+extern const char kIPv6ProbingName[];
+extern const char kIPv6ProbingDescription[];
+
extern const char kEnableWasmTieringDescription[];
extern const char kEvDetailsInPageInfoName[];
diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
--- a/components/subresource_filter/tools/BUILD.gn
+++ b/components/subresource_filter/tools/BUILD.gn
@@ -50,6 +50,8 @@ if (!is_ios) {
deps = [
":tools_lib",
"//base",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp"
]
}
@@ -61,6 +63,8 @@ if (!is_ios) {
":tools_lib",
"../core/common",
"//base",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp",
]
}
@@ -70,6 +74,8 @@ if (!is_ios) {
"ruleset_converter:support",
"//base",
"//third_party/protobuf:protobuf_lite",
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp"
]
}
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
@@ -73,7 +73,8 @@ executable("make_top_domain_list_variables") {
"//base:i18n",
"//components/url_formatter/spoof_checks/common_words:common",
"//third_party/icu",
- "//components/network_session_configurator/common"
+ "//components/network_session_configurator/common",
+ "//services/network/public/cpp",
]
if (is_ios) {
frameworks = [ "UIKit.framework" ]
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
--- a/net/dns/host_resolver_manager.cc
+++ b/net/dns/host_resolver_manager.cc
@@ -86,6 +86,7 @@
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source.h"
#include "net/log/net_log_source_type.h"
+#include "services/network/public/cpp/features.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/datagram_client_socket.h"
@@ -3512,8 +3513,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
if (last_ipv6_probe_time_.is_null() ||
(tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
kIPv6ProbePeriodMs) {
- SetLastIPv6ProbeResult(
+
+ if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
+ // pretend IPv6 connectivy probe is successful when probing is disabled
+ SetLastIPv6ProbeResult(true);
+ } else {
+ SetLastIPv6ProbeResult(
IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
+ }
cached = false;
}
net_log.AddEvent(
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -42,6 +42,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kThrottleDelayable{"ThrottleDelayable",
base::FEATURE_ENABLED_BY_DEFAULT};
+// Enable IPv6 ping probes to RIPE DNS.
+const base::Feature kIPv6Probing{"IPv6Probing",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kNetworkService;
COMPONENT_EXPORT(NETWORK_CPP)
+extern const base::Feature kIPv6Probing;
+COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kReporting;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::Feature kThrottleDelayable;
--
2.17.1
@@ -1,53 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 16 Nov 2019 11:18:09 +0100
Subject: Add flag to disable WebGL
---
chrome/browser/about_flags.cc | 3 +++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
3 files changed, 10 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2643,6 +2643,9 @@ const FeatureEntry::FeatureVariation kReadLaterVariations[] = {
// When adding a new choice, add it to the end of the list.
const FeatureEntry kFeatureEntries[] = {
// Include generated flags for flag unexpiry; see //docs/flag_expiry.md and
+ {switches::kDisableWebGL, flag_descriptions::kDisableWebGLName,
+ flag_descriptions::kDisableWebGLDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebGL)},
// //tools/flags/generate_unexpire_flags.py.
#include "build/chromeos_buildflags.h"
#include "chrome/browser/unexpire_flags_gen.inc"
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
@@ -613,6 +613,10 @@ const char kEnableAudioFocusEnforcementName[] = "Audio Focus Enforcement";
const char kEnableAudioFocusEnforcementDescription[] =
"Enables enforcement of a single media session having audio focus at "
"any one time. Requires #enable-media-session-service to be enabled too.";
+const char kDisableWebGLName[] = "WebGL";
+
+const char kDisableWebGLDescription[] = "Enable or disable all versions of WebGL";
+
const char kEnableAutofillAccountWalletStorageName[] =
"Enable the account data storage for autofill";
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
@@ -341,6 +341,9 @@ extern const char kForceColorProfileSRGB[];
extern const char kForceColorProfileP3[];
extern const char kForceColorProfileColorSpin[];
extern const char kForceColorProfileSCRGBLinear[];
+extern const char kDisableWebGLName[];
+extern const char kDisableWebGLDescription[];
+
extern const char kForceColorProfileHDR10[];
extern const char kForceColorProfileName[];
--
2.17.1
@@ -1,55 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 25 May 2021 19:46:14 +0200
Subject: Add flag to disable external intent requests
---
chrome/browser/about_flags.cc | 3 +++
chrome/browser/flag_descriptions.cc | 6 ++++++
chrome/browser/flag_descriptions.h | 3 +++
3 files changed, 12 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2697,6 +2697,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kWebrtcCaptureMultiChannelApmName,
flag_descriptions::kWebrtcCaptureMultiChannelApmDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kWebRtcEnableCaptureMultiChannelApm)},
+ {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName,
+ flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")},
{"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
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
@@ -3272,6 +3272,12 @@ const char kProcessSharingWithStrictSiteInstancesDescription[] =
"separated like strict site isolation, but process selection puts multiple "
"site instances in a single process.";
+const char kDisableExternalIntentRequestsName[] =
+ "Never forward URL requests to external intents";
+const char kDisableExternalIntentRequestsDescription[] =
+ "URL requests will never"
+ "allow for redirecting to an external intent.";
+
const char kQueryTilesName[] = "Show query tiles";
const char kQueryTilesDescription[] = "Shows query tiles in Chrome";
const char kQueryTilesNTPName[] = "Show query tiles in NTP";
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
@@ -1883,6 +1883,9 @@ extern const char kQueryTilesNTPDescription[];
extern const char kQueryTilesOmniboxName[];
extern const char kQueryTilesOmniboxDescription[];
extern const char kQueryTilesSingleTierName[];
+extern const char kDisableExternalIntentRequestsName[];
+extern const char kDisableExternalIntentRequestsDescription[];
+
extern const char kQueryTilesSingleTierDescription[];
extern const char kQueryTilesEnableQueryEditingName[];
extern const char kQueryTilesEnableQueryEditingDescription[];
--
2.17.1
@@ -1,58 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 18 Oct 2021 20:50:48 +0200
Subject: Add flag to disable pull to refresh effect
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 6 ++++++
chrome/browser/flag_descriptions.h | 3 +++
3 files changed, 15 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7477,6 +7477,12 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kPrivacyReviewDescription, kOsDesktop | kOsAndroid,
FEATURE_VALUE_TYPE(features::kPrivacyReview)},
+#if defined(OS_ANDROID)
+ {switches::kDisablePullToRefreshEffect, flag_descriptions::kDisablePullToRefreshEffectName,
+ flag_descriptions::kDisablePullToRefreshEffectDescription, kOsAndroid,
+ SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)},
+#endif
+
#if defined(OS_ANDROID)
{"google-mobile-services-passwords",
flag_descriptions::kUnifiedPasswordManagerAndroidName,
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
@@ -1451,6 +1451,12 @@ const char kIncognitoClearBrowsingDataDialogForDesktopDescription[] =
"When enabled, clear browsing data option would be enabled in Incognito "
"which upon clicking would show a dialog to close all Incognito windows.";
+const char kDisablePullToRefreshEffectName[] =
+ "Disable the pull-to-refresh effect when vertically overscrolling content.";
+const char kDisablePullToRefreshEffectDescription[] =
+ "Disable the pull-to-refresh effect with the elastic overscroll feature "
+ "used to indicate that the user is scrolling beyond the range of the scrollable area.";
+
const char kUpdateHistoryEntryPointsInIncognitoName[] =
"Update history entry points in Incognito.";
const char kUpdateHistoryEntryPointsInIncognitoDescription[] =
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
@@ -564,6 +564,9 @@ extern const char kDiagnosticsAppDescription[];
extern const char kDiagnosticsAppNavigationName[];
extern const char kDiagnosticsAppNavigationDescription[];
+extern const char kDisablePullToRefreshEffectName[];
+extern const char kDisablePullToRefreshEffectDescription[];
+
extern const char kDisableKeepaliveFetchName[];
extern const char kDisableKeepaliveFetchDescription[];
--
2.17.1
@@ -1,155 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 17:35:39 +0200
Subject: Add flag to disable vibration
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 3 +++
content/child/runtime_features.cc | 1 +
content/public/common/content_features.cc | 3 +++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 1 +
.../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
10 files changed, 28 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -6207,6 +6207,10 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
#endif
+ {"enable-vibration", flag_descriptions::kEnableVibrationName,
+ flag_descriptions::kEnableVibrationDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kVibration)},
+
#if BUILDFLAG(IS_CHROMEOS_ASH)
{"exo-gamepad-vibration", flag_descriptions::kExoGamepadVibrationName,
flag_descriptions::kExoGamepadVibrationDescription, kOsCrOS,
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
@@ -5127,6 +5127,9 @@ const char kDefaultMeetWebAppDescription[] =
"Enables the Meet web app to be installed by default.";
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+const char kEnableVibrationName[] = "Vibration";
+const char kEnableVibrationDescription[] = "Enable vibration API; an user gesture will still be needed.";
+
#if defined(OS_CHROMEOS)
const char kDeprecateLowUsageCodecsName[] = "Deprecates low usage media codecs";
const char kDeprecateLowUsageCodecsDescription[] =
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
@@ -2968,6 +2968,9 @@ extern const char kDefaultMeetWebAppName[];
extern const char kDefaultMeetWebAppDescription[];
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
+extern const char kEnableVibrationName[];
+extern const char kEnableVibrationDescription[];
+
#if defined(OS_CHROMEOS)
extern const char kDeprecateLowUsageCodecsName[];
extern const char kDeprecateLowUsageCodecsDescription[];
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -102,6 +102,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
#if defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
WebRuntimeFeatures::EnableMediaSession(false);
+ WebRuntimeFeatures::EnableVibration(base::FeatureList::IsEnabled(features::kVibration));
#endif
#if defined(OS_ANDROID)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -103,6 +103,9 @@ const base::Feature kBackForwardCacheSameSiteForBots{
// BackForwardCacheMemoryControls is enabled only on Android to disable
// BackForwardCache for lower memory devices due to memory limiations.
#if defined(OS_ANDROID)
+// Enables vibration; an user gesture will still be required if enabled.
+const base::Feature kVibration{"Vibration",
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kBackForwardCacheMemoryControls{
"BackForwardCacheMemoryControls", base::FEATURE_ENABLED_BY_DEFAULT};
#else
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -266,6 +266,8 @@ CONTENT_EXPORT extern const base::Feature kWarmUpNetworkProcess;
CONTENT_EXPORT extern const base::Feature kWebNfc;
#endif // defined(OS_ANDROID)
+CONTENT_EXPORT extern const base::Feature kVibration;
+
#if defined(OS_MAC)
CONTENT_EXPORT extern const base::Feature kDeviceMonitorMac;
CONTENT_EXPORT extern const base::Feature kIOSurfaceCapturer;
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -90,6 +90,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableBlockingFocusWithoutUserActivation(
bool);
BLINK_PLATFORM_EXPORT static void EnableCacheInlineScriptCode(bool);
+ BLINK_PLATFORM_EXPORT static void EnableVibration(bool);
BLINK_PLATFORM_EXPORT static void EnableCapabilityDelegationPaymentRequest(
bool enable);
BLINK_PLATFORM_EXPORT static void EnableClickPointerEvent(bool enable);
diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
--- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc
+++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/mojo/mojo_helper.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
// Maximum number of entries in a vibration pattern.
const unsigned kVibrationPatternLengthMax = 99;
@@ -149,6 +150,8 @@ bool VibrationController::vibrate(Navigator& navigator,
// reference to |window| or |navigator| was retained in another window.
if (!navigator.DomWindow())
return false;
+ if (!RuntimeEnabledFeatures::VibrationEnabled())
+ return false;
return From(navigator).Vibrate(pattern);
}
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -182,6 +182,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
}
+void WebRuntimeFeatures::EnableVibration(bool enable) {
+ RuntimeEnabledFeatures::SetVibrationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableKeyboardAccessibleTooltip(bool enable) {
RuntimeEnabledFeatures::SetKeyboardAccessibleTooltipEnabled(enable);
}
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1537,6 +1537,10 @@
name: "OrientationEvent",
status: {"Android": "stable"},
},
+ {
+ name: "Vibration",
+ status: "stable",
+ },
{
name: "OriginIsolationHeader",
status: "stable",
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,728 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 18 Feb 2021 21:22:52 +0100
Subject: Add menu item to bookmark all tabs
---
chrome/android/java/res/menu/main_menu.xml | 7 ++
.../chrome/browser/ChromeTabbedActivity.java | 26 +++++++
.../browser/bookmarks/BookmarkBridge.java | 71 +++++++++++++++++--
.../browser/bookmarks/BookmarkUtils.java | 4 ++
.../android/bookmarks/bookmark_bridge.cc | 17 +++++
.../android/bookmarks/bookmark_bridge.h | 4 ++
.../browser/bookmarks/bookmark_html_writer.cc | 8 ++-
.../bookmarks/chrome_bookmark_client.cc | 2 +
.../dialogs/DownloadLocationCustomView.java | 4 +-
.../strings/android_chrome_strings.grd | 3 +
components/bookmark_bar_strings.grdp | 6 ++
.../bookmarks/browser/bookmark_codec.cc | 24 +++++--
components/bookmarks/browser/bookmark_codec.h | 7 +-
.../browser/bookmark_load_details.cc | 4 ++
.../bookmarks/browser/bookmark_load_details.h | 2 +
.../bookmarks/browser/bookmark_model.cc | 3 +-
components/bookmarks/browser/bookmark_model.h | 7 ++
components/bookmarks/browser/bookmark_node.cc | 15 ++++
components/bookmarks/browser/bookmark_node.h | 5 ++
components/bookmarks/browser/model_loader.cc | 3 +-
.../bookmark_specifics_conversions.cc | 1 +
21 files changed, 208 insertions(+), 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
@@ -64,6 +64,10 @@
<item android:id="@+id/all_bookmarks_menu_id"
android:title="@string/menu_bookmarks"
android:icon="@drawable/btn_star_filled" />
+ <item android:id="@+id/bookmark_all_tabs_menu_id"
+ android:title="@string/menu_bookmark_all_tabs"
+ android:titleCondensed="@string/menu_bookmark_all_tabs"
+ android:icon="@drawable/ic_folder_blue_24dp" />
<item android:id="@+id/recent_tabs_menu_id"
android:title="@string/menu_recent_tabs"
android:icon="@drawable/devices_black_24dp" />
@@ -147,6 +151,9 @@
<item android:id="@+id/menu_group_tabs"
android:title="@string/menu_group_tabs"
android:icon="@drawable/ic_widgets" />
+ <item android:id="@+id/bookmark_all_tabs_menu_id"
+ android:title="@string/menu_bookmark_all_tabs"
+ android:icon="@drawable/ic_folder_blue_24dp" />
<item android:id="@+id/track_prices_row_menu_id"
android:title="@string/menu_track_prices"
android:icon="@drawable/ic_trending_down_black" />
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
@@ -68,6 +68,8 @@ import org.chromium.chrome.browser.app.tabmodel.ChromeNextTabPolicySupplier;
import org.chromium.chrome.browser.app.tabmodel.TabModelOrchestrator;
import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton;
import org.chromium.chrome.browser.app.tabmodel.TabbedModeTabModelOrchestrator;
+import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
+import org.chromium.chrome.browser.bookmarks.BookmarkModel;
import org.chromium.chrome.browser.bookmarks.BookmarkUtils;
import org.chromium.chrome.browser.browserservices.intents.WebappConstants;
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
@@ -2020,6 +2022,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
// Close both incognito and normal tabs
getTabModelSelector().closeAllTabs();
RecordUserAction.record("MobileMenuCloseAllTabs");
+ } else if (id == R.id.bookmark_all_tabs_menu_id) {
+ bookmarkAllTabs();
} else if (id == R.id.close_all_incognito_tabs_menu_id) {
// Close only incognito tabs
getTabModelSelector().getModel(true).closeAllTabs();
@@ -2069,6 +2073,28 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
mTabModalHandler.onOmniboxFocusChanged(hasFocus);
}
+ private void bookmarkAllTabs() {
+ TabModel tabModel = getTabModelSelector().getCurrentModel();
+ int count = tabModel.getCount();
+ Log.i(TAG, "bookmarkAllTabs(): %d tabs to bookmark", count);
+ if (count == 0) {
+ return;
+ }
+
+ final BookmarkBridge bridge = mBookmarkBridgeSupplier.get();
+ final BookmarkModel bookmarkModel = new BookmarkModel();
+ bookmarkModel.finishLoadingBookmarkModel(() -> {
+ for (int i = 0; i < tabModel.getCount(); i++) {
+ Tab tab = tabModel.getTabAt(i);
+ if (tab.isNativePage()) {
+ continue;
+ }
+ bridge.addToTabsCollection(this, tab);
+ }
+ bridge.finishedAddingToTabsCollection(this, getSnackbarManager());
+ });
+ }
+
private void recordLauncherShortcutAction(boolean isIncognito) {
if (isIncognito) {
RecordUserAction.record("Android.LauncherShortcut.NewIncognitoTab");
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.bookmarks;
+import android.app.Activity;
import android.content.Intent;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -24,6 +25,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import org.chromium.base.ContextUtils;
+import org.chromium.base.Log;
import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative;
@@ -32,6 +34,10 @@ import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController;
+import org.chromium.chrome.R;
import org.chromium.components.bookmarks.BookmarkId;
import org.chromium.components.bookmarks.BookmarkType;
import org.chromium.components.url_formatter.SchemeDisplay;
@@ -72,6 +78,7 @@ import java.io.File;
* bookmark model stored in native.
*/
public class BookmarkBridge {
+ private static final String TAG = "BookmarkBridge";
private final Profile mProfile;
private boolean mIsDoingExtensiveChanges;
private long mNativeBookmarkBridge;
@@ -553,6 +560,16 @@ public class BookmarkBridge {
mNativeBookmarkBridge, BookmarkBridge.this);
}
+ /**
+ * @return The BookmarkId for the Tabs collecction folder node
+ */
+ public BookmarkId getTabsCollectionFolderId() {
+ ThreadUtils.assertOnUiThread();
+ assert mIsNativeBookmarkModelLoaded;
+ return BookmarkBridgeJni.get().getTabsCollectionFolderId(
+ mNativeBookmarkBridge, BookmarkBridge.this);
+ }
+
/**
* @return Id representing the special "other" folder from bookmark model.
*/
@@ -770,14 +787,14 @@ public class BookmarkBridge {
if (mDialogModel != null) return;
// Actually show the dialog.
- mCustomView = (DownloadLocationCustomView) LayoutInflater.from(mContext).inflate(
+ mCustomView = (DownloadLocationCustomView) LayoutInflater.from(context).inflate(
R.layout.download_location_dialog, null);
- mCustomView.initialize(
- DownloadLocationDialogType.DEFAULT, new File(standardBoorkmarkName),
- /*totalBytes*/ 0, context.getString(R.string.export_bookmarks_alert_title));
+ mCustomView.initialize(DownloadLocationDialogType.DEFAULT, /*totalBytes*/ 0);
+ mCustomView.setTitle(context.getString(R.string.export_bookmarks_alert_title));
+ mCustomView.setFileName(standardBoorkmarkName);
mCustomView.mDontShowAgain.setVisibility(View.GONE);
- Resources resources = mContext.getResources();
+ Resources resources = context.getResources();
mDialogModel = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
.with(ModalDialogProperties.CONTROLLER, this)
.with(ModalDialogProperties.CUSTOM_VIEW, mCustomView)
@@ -1099,6 +1116,49 @@ public class BookmarkBridge {
mNativeBookmarkBridge, BookmarkBridge.this, title, url);
}
+ // Used to bookmark all tabs in a specific folder, created if not existing
+ public BookmarkId addToTabsCollection(Context context, Tab tab) {
+ BookmarkId parent = getTabsCollectionFolderId();
+ long existingId = getUserBookmarkIdForTab(tab);
+ if (existingId != BookmarkId.INVALID_ID) {
+ BookmarkId existingBookmarkId = new BookmarkId(existingId, BookmarkType.NORMAL);
+ BookmarkItem existingBookmark = getBookmarkById(existingBookmarkId);
+ if (parent.equals(existingBookmark.getParentId())) {
+ // bookmark already exists in the tabs collection folder
+ return existingBookmarkId;
+ }
+ }
+ BookmarkId bookmarkId =
+ addBookmark(parent, getChildCount(parent), tab.getTitle(), tab.getUrl().getSpec());
+
+ if (bookmarkId == null) {
+ Log.e(TAG,
+ "Failed to add bookmarks: parentTypeAndId %s", parent);
+ }
+ return bookmarkId;
+ }
+
+ public void finishedAddingToTabsCollection(Activity activity, SnackbarManager snackbarManager) {
+ BookmarkId parent = getTabsCollectionFolderId();
+
+ BookmarkItem bookmarkItem = getBookmarkById(parent);
+ String folderName;
+ if (bookmarkItem != null) {
+ folderName = bookmarkItem.getTitle();
+ } else {
+ folderName = "";
+ }
+ SnackbarController snackbarController = new SnackbarController() {
+ @Override
+ public void onAction(Object actionData) {
+ }
+ };
+ Snackbar snackbar = Snackbar.make(folderName, snackbarController, Snackbar.TYPE_ACTION,
+ Snackbar.UMA_BOOKMARK_ADDED)
+ .setTemplateText(activity.getString(R.string.bookmark_page_saved_folder));
+ snackbarManager.showSnackbar(snackbar);
+ }
+
/**
* @param url The URL of the reading list item.
* @return The reading list item with the URL, or null if no such reading list item.
@@ -1355,6 +1415,7 @@ public class BookmarkBridge {
void getAllFoldersWithDepths(long nativeBookmarkBridge, BookmarkBridge caller,
List<BookmarkId> folderList, List<Integer> depthList);
BookmarkId getRootFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
+ BookmarkId getTabsCollectionFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
BookmarkId getMobileFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
BookmarkId getOtherFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
BookmarkId getDesktopFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java
@@ -516,6 +516,7 @@ public class BookmarkUtils {
List<BookmarkId> topLevelFolders = new ArrayList<>();
BookmarkId desktopNodeId = bookmarkModel.getDesktopFolderId();
BookmarkId mobileNodeId = bookmarkModel.getMobileFolderId();
+ BookmarkId tabsCollectionNodeId = bookmarkModel.getTabsCollectionFolderId();
BookmarkId othersNodeId = bookmarkModel.getOtherFolderId();
List<BookmarkId> specialFoldersIds =
@@ -541,6 +542,9 @@ public class BookmarkUtils {
if (bookmarkModel.isFolderVisible(mobileNodeId)) {
topLevelFolders.add(mobileNodeId);
}
+ if (bookmarkModel.isFolderVisible(tabsCollectionNodeId)) {
+ topLevelFolders.add(tabsCollectionNodeId);
+ }
if (bookmarkModel.isFolderVisible(desktopNodeId)) {
topLevelFolders.add(desktopNodeId);
}
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
@@ -424,6 +424,11 @@ void BookmarkBridge::GetTopLevelFolderIDs(
top_level_folders.push_back(node.get());
}
+ for (const auto& node : bookmark_model_->tabs_collection_node()->children()) {
+ if (node->is_folder())
+ top_level_folders.push_back(node.get());
+ }
+
for (const auto& node : bookmark_model_->bookmark_bar_node()->children()) {
if (node->is_folder())
top_level_folders.push_back(node.get());
@@ -462,6 +467,7 @@ void BookmarkBridge::GetAllFoldersWithDepths(
// Vector to temporarily contain all child bookmarks at same level for sorting
std::vector<const BookmarkNode*> bookmarks = {
bookmark_model_->mobile_node(),
+ bookmark_model_->tabs_collection_node(),
bookmark_model_->bookmark_bar_node(),
bookmark_model_->other_node(),
};
@@ -516,6 +522,17 @@ ScopedJavaLocalRef<jobject> BookmarkBridge::GetMobileFolderId(
return folder_id_obj;
}
+ScopedJavaLocalRef<jobject> BookmarkBridge::GetTabsCollectionFolderId(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ const BookmarkNode* tabs_collection_node = bookmark_model_->tabs_collection_node();
+ ScopedJavaLocalRef<jobject> folder_id_obj =
+ JavaBookmarkIdCreateBookmarkId(
+ env, tabs_collection_node->id(), GetBookmarkType(tabs_collection_node));
+ return folder_id_obj;
+}
+
ScopedJavaLocalRef<jobject> BookmarkBridge::GetOtherFolderId(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser/android/bookmarks/bookmark_bridge.h
--- a/chrome/browser/android/bookmarks/bookmark_bridge.h
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
@@ -110,6 +110,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
+ base::android::ScopedJavaLocalRef<jobject> GetTabsCollectionFolderId(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
base::android::ScopedJavaLocalRef<jobject> GetOtherFolderId(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -186,6 +186,8 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
roots->FindDictKey(BookmarkCodec::kOtherBookmarkFolderNameKey);
base::Value* mobile_folder_value =
roots->FindDictKey(BookmarkCodec::kMobileBookmarkFolderNameKey);
+ base::Value* tabs_collection_value =
+ roots->FindDictKey(BookmarkCodec::kTabsBookmarkFolderNameKey);
DCHECK(root_folder_value);
DCHECK(other_folder_value);
DCHECK(mobile_folder_value);
@@ -197,7 +199,9 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
!WriteNode(*static_cast<base::DictionaryValue*>(other_folder_value),
BookmarkNode::OTHER_NODE) ||
!WriteNode(*static_cast<base::DictionaryValue*>(mobile_folder_value),
- BookmarkNode::MOBILE)) {
+ BookmarkNode::MOBILE) ||
+ !WriteNode(*static_cast<base::DictionaryValue*>(tabs_collection_value),
+ BookmarkNode::TABS_COLLECTION)) {
NotifyOnFinish(BookmarksExportObserver::Result::kCouldNotWriteNodes);
return;
}
@@ -464,6 +468,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() {
BookmarkModelFactory::GetForBrowserContext(profile_)->other_node());
ExtractUrls(
BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node());
+ ExtractUrls(
+ BookmarkModelFactory::GetForBrowserContext(profile_)->tabs_collection_node());
if (!bookmark_urls_.empty())
FetchNextFavicon();
else
diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.cc b/chrome/browser/bookmarks/chrome_bookmark_client.cc
--- a/chrome/browser/bookmarks/chrome_bookmark_client.cc
+++ b/chrome/browser/bookmarks/chrome_bookmark_client.cc
@@ -105,6 +105,8 @@ bool ChromeBookmarkClient::IsPermanentNodeVisibleWhenEmpty(
return !is_mobile;
case bookmarks::BookmarkNode::MOBILE:
return is_mobile;
+ case bookmarks::BookmarkNode::TABS_COLLECTION:
+ return is_mobile;
}
return false;
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java
@@ -75,7 +75,7 @@ public class DownloadLocationCustomView
mDirectoryAdapter.update();
}
- void setTitle(CharSequence title) {
+ public void setTitle(CharSequence title) {
mTitle.setText(title);
}
@@ -83,7 +83,7 @@ public class DownloadLocationCustomView
mSubtitleView.setText(subtitle);
}
- void setFileName(CharSequence fileName) {
+ public void setFileName(CharSequence fileName) {
mFileName.setText(fileName);
}
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -3224,6 +3224,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_MENU_TRACK_PRICES" desc="Menu item for tracking prices on tabs. [CHAR_LIMIT=27]">
Track prices
</message>
+ <message name="IDS_MENU_BOOKMARK_ALL_TABS" desc="Menu item to bookmark all tabs. [CHAR-LIMIT=27]">
+ Bookmark all tabs
+ </message>
<message name="IDS_MENU_GET_IMAGE_DESCRIPTIONS" desc="Menu item to start getting alt text accessibility image labels/descriptions [CHAR_LIMIT=27]">
Get image descriptions
</message>
diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_strings.grdp
--- a/components/bookmark_bar_strings.grdp
+++ b/components/bookmark_bar_strings.grdp
@@ -20,6 +20,9 @@
<message name="IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME" desc="Name shown in the tree for the mobile bookmarks folder">
Mobile bookmarks
</message>
+ <message name="IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME" desc="Name shown in the tree for the tabs collection bookmarks folder">
+ Tabs collection
+ </message>
<message name="IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME" desc="Name shown in the tree for the other bookmarks folder">
Other bookmarks
</message>
@@ -34,6 +37,9 @@
<message name="IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME" desc="In Title Case: Name shown in the tree for the mobile bookmarks folder">
Mobile Bookmarks
</message>
+ <message name="IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME" desc="Name shown in the tree for the tabs collection bookmarks folder">
+ Tabs Collection
+ </message>
<message name="IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME" desc="In Title Case: Name shown in the tree for the other bookmarks folder">
Other Bookmarks
</message>
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc
--- a/components/bookmarks/browser/bookmark_codec.cc
+++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -33,6 +33,7 @@ const char BookmarkCodec::kRootFolderNameKey[] = "bookmark_bar";
const char BookmarkCodec::kOtherBookmarkFolderNameKey[] = "other";
// The value is left as 'synced' for historical reasons.
const char BookmarkCodec::kMobileBookmarkFolderNameKey[] = "synced";
+const char BookmarkCodec::kTabsBookmarkFolderNameKey[] = "tabs";
const char BookmarkCodec::kVersionKey[] = "version";
const char BookmarkCodec::kChecksumKey[] = "checksum";
const char BookmarkCodec::kIdKey[] = "id";
@@ -62,7 +63,8 @@ BookmarkCodec::~BookmarkCodec() = default;
base::Value BookmarkCodec::Encode(BookmarkModel* model,
const std::string& sync_metadata_str) {
return Encode(model->bookmark_bar_node(), model->other_node(),
- model->mobile_node(), model->root_node()->GetMetaInfoMap(),
+ model->mobile_node(), model->tabs_collection_node(),
+ model->root_node()->GetMetaInfoMap(),
sync_metadata_str);
}
@@ -70,6 +72,7 @@ base::Value BookmarkCodec::Encode(
const BookmarkNode* bookmark_bar_node,
const BookmarkNode* other_folder_node,
const BookmarkNode* mobile_folder_node,
+ const BookmarkNode* tabs_folder_node,
const BookmarkNode::MetaInfoMap* model_meta_info_map,
const std::string& sync_metadata_str) {
ids_reassigned_ = false;
@@ -79,6 +82,7 @@ base::Value BookmarkCodec::Encode(
roots.SetKey(kRootFolderNameKey, EncodeNode(bookmark_bar_node));
roots.SetKey(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node));
roots.SetKey(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node));
+ roots.SetKey(kTabsBookmarkFolderNameKey, EncodeNode(tabs_folder_node));
if (model_meta_info_map)
roots.SetKey(kMetaInfo, EncodeMetaInfo(*model_meta_info_map));
base::Value main(base::Value::Type::DICTIONARY);
@@ -102,6 +106,7 @@ bool BookmarkCodec::Decode(const base::Value& value,
BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
+ BookmarkNode* tabs_folder_node,
int64_t* max_id,
std::string* sync_metadata_str) {
ids_.clear();
@@ -109,7 +114,8 @@ bool BookmarkCodec::Decode(const base::Value& value,
base::GUID::ParseLowercase(BookmarkNode::kBookmarkBarNodeGuid),
base::GUID::ParseLowercase(BookmarkNode::kOtherBookmarksNodeGuid),
base::GUID::ParseLowercase(BookmarkNode::kMobileBookmarksNodeGuid),
- base::GUID::ParseLowercase(BookmarkNode::kManagedNodeGuid)};
+ base::GUID::ParseLowercase(BookmarkNode::kManagedNodeGuid),
+ base::GUID::ParseLowercase(BookmarkNode::kTabsCollectionBookmarksNodeGuid)};
ids_reassigned_ = false;
guids_reassigned_ = false;
ids_valid_ = true;
@@ -117,12 +123,13 @@ bool BookmarkCodec::Decode(const base::Value& value,
stored_checksum_.clear();
InitializeChecksum();
bool success = DecodeHelper(bb_node, other_folder_node, mobile_folder_node,
+ tabs_folder_node,
value, sync_metadata_str);
FinalizeChecksum();
// If either the checksums differ or some IDs were missing/not unique,
// reassign IDs.
if (!ids_valid_ || computed_checksum() != stored_checksum())
- ReassignIDs(bb_node, other_folder_node, mobile_folder_node);
+ ReassignIDs(bb_node, other_folder_node, mobile_folder_node, tabs_folder_node);
*max_id = maximum_id_ + 1;
return success;
}
@@ -172,6 +179,7 @@ base::Value BookmarkCodec::EncodeMetaInfo(
bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
+ BookmarkNode* tabs_folder_node,
const base::Value& value,
std::string* sync_metadata_str) {
if (!value.is_dict())
@@ -203,6 +211,12 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node,
DecodeNode(*root_folder_value, nullptr, bb_node);
DecodeNode(*other_folder_value, nullptr, other_folder_node);
+ const base::DictionaryValue* tabs_folder_d_value = nullptr;
+ const base::Value* tabs_folder_value =
+ roots->FindDictKey(kTabsBookmarkFolderNameKey);
+ if (tabs_folder_value && tabs_folder_value->GetAsDictionary(&tabs_folder_d_value))
+ DecodeNode(*tabs_folder_d_value, nullptr, tabs_folder_node);
+
// Fail silently if we can't deserialize mobile bookmarks. We can't require
// them to exist in order to be backwards-compatible with older versions of
// chrome.
@@ -452,11 +466,13 @@ void BookmarkCodec::DecodeMetaInfoHelper(
void BookmarkCodec::ReassignIDs(BookmarkNode* bb_node,
BookmarkNode* other_node,
- BookmarkNode* mobile_node) {
+ BookmarkNode* mobile_node,
+ BookmarkNode* tabs_folder_node) {
maximum_id_ = 0;
ReassignIDsHelper(bb_node);
ReassignIDsHelper(other_node);
ReassignIDsHelper(mobile_node);
+ ReassignIDsHelper(tabs_folder_node);
ids_reassigned_ = true;
}
diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h
--- a/components/bookmarks/browser/bookmark_codec.h
+++ b/components/bookmarks/browser/bookmark_codec.h
@@ -46,6 +46,7 @@ class BookmarkCodec {
base::Value Encode(const BookmarkNode* bookmark_bar_node,
const BookmarkNode* other_folder_node,
const BookmarkNode* mobile_folder_node,
+ const BookmarkNode* tabs_folder_node,
const BookmarkNode::MetaInfoMap* model_meta_info_map,
const std::string& sync_metadata_str);
@@ -58,6 +59,7 @@ class BookmarkCodec {
BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
+ BookmarkNode* tabs_folder_node,
int64_t* max_node_id,
std::string* sync_metadata_str);
@@ -103,6 +105,7 @@ class BookmarkCodec {
// Allows the BookmarkClient to read and a write a string blob from the JSON
// file. That string captures the bookmarks sync metadata.
static const char kSyncMetadata[];
+ static const char kTabsBookmarkFolderNameKey[];
// Possible values for kTypeKey.
static const char kTypeURL[];
@@ -119,6 +122,7 @@ class BookmarkCodec {
bool DecodeHelper(BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
+ BookmarkNode* tabs_folder_node,
const base::Value& value,
std::string* sync_metadata_str);
@@ -130,7 +134,8 @@ class BookmarkCodec {
// Reassigns bookmark IDs for all nodes.
void ReassignIDs(BookmarkNode* bb_node,
BookmarkNode* other_node,
- BookmarkNode* mobile_node);
+ BookmarkNode* mobile_node,
+ BookmarkNode* tabs_folder_node);
// Helper to recursively reassign IDs.
void ReassignIDsHelper(BookmarkNode* node);
diff --git a/components/bookmarks/browser/bookmark_load_details.cc b/components/bookmarks/browser/bookmark_load_details.cc
--- a/components/bookmarks/browser/bookmark_load_details.cc
+++ b/components/bookmarks/browser/bookmark_load_details.cc
@@ -36,6 +36,10 @@ BookmarkLoadDetails::BookmarkLoadDetails(BookmarkClient* client)
root_node_->Add(BookmarkPermanentNode::CreateMobileBookmarks(
max_id_++,
client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::MOBILE))));
+ tabs_collection_folder_node_ = static_cast<BookmarkPermanentNode*>(
+ root_node_->Add(BookmarkPermanentNode::CreateTabsCollectionBookmarks(
+ max_id_++,
+ client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::TABS_COLLECTION))));
}
BookmarkLoadDetails::~BookmarkLoadDetails() = default;
diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/bookmarks/browser/bookmark_load_details.h
--- a/components/bookmarks/browser/bookmark_load_details.h
+++ b/components/bookmarks/browser/bookmark_load_details.h
@@ -42,6 +42,7 @@ class BookmarkLoadDetails {
BookmarkPermanentNode* bb_node() { return bb_node_; }
BookmarkPermanentNode* mobile_folder_node() { return mobile_folder_node_; }
BookmarkPermanentNode* other_folder_node() { return other_folder_node_; }
+ BookmarkPermanentNode* tabs_collection_folder_node() { return tabs_collection_folder_node_; }
TitledUrlIndex* index() { return index_.get(); }
std::unique_ptr<TitledUrlIndex> owned_index() { return std::move(index_); }
@@ -96,6 +97,7 @@ class BookmarkLoadDetails {
BookmarkPermanentNode* bb_node_ = nullptr;
BookmarkPermanentNode* other_folder_node_ = nullptr;
BookmarkPermanentNode* mobile_folder_node_ = nullptr;
+ BookmarkPermanentNode* tabs_collection_folder_node_ = nullptr;
LoadManagedNodeCallback load_managed_node_callback_;
std::unique_ptr<TitledUrlIndex> index_;
BookmarkNode::MetaInfoMap model_meta_info_map_;
diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc
--- a/components/bookmarks/browser/bookmark_model.cc
+++ b/components/bookmarks/browser/bookmark_model.cc
@@ -562,7 +562,7 @@ bool BookmarkModel::HasBookmarks() {
bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return bookmark_bar_node_->children().empty() &&
- other_node_->children().empty() && mobile_node_->children().empty();
+ other_node_->children().empty() && mobile_node_->children().empty() && tabs_collection_node_->children().empty();
}
bool BookmarkModel::IsBookmarked(const GURL& url) {
@@ -804,6 +804,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr<BookmarkLoadDetails> details) {
bookmark_bar_node_ = details->bb_node();
other_node_ = details->other_folder_node();
mobile_node_ = details->mobile_folder_node();
+ tabs_collection_node_ = details->tabs_collection_folder_node();
titled_url_index_->SetNodeSorter(
std::make_unique<TypedCountSorter>(client_.get()));
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
--- a/components/bookmarks/browser/bookmark_model.h
+++ b/components/bookmarks/browser/bookmark_model.h
@@ -116,6 +116,12 @@ class BookmarkModel : public BookmarkUndoProvider,
return mobile_node_;
}
+ // Returns the 'mobile' node. This is NULL until loaded.
+ const BookmarkNode* tabs_collection_node() const {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ return tabs_collection_node_;
+ }
+
bool is_root_node(const BookmarkNode* node) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return node == root_;
@@ -391,6 +397,7 @@ class BookmarkModel : public BookmarkUndoProvider,
BookmarkPermanentNode* bookmark_bar_node_ = nullptr;
BookmarkPermanentNode* other_node_ = nullptr;
BookmarkPermanentNode* mobile_node_ = nullptr;
+ BookmarkPermanentNode* tabs_collection_node_ = nullptr;
// The maximum ID assigned to the bookmark nodes in the model.
int64_t next_node_id_ = 1;
diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmarks/browser/bookmark_node.cc
--- a/components/bookmarks/browser/bookmark_node.cc
+++ b/components/bookmarks/browser/bookmark_node.cc
@@ -60,6 +60,10 @@ const char BookmarkNode::kOtherBookmarksNodeGuid[] =
const char BookmarkNode::kMobileBookmarksNodeGuid[] =
"4cf2e351-0e85-532b-bb37-df045d8f8d0f";
+// static
+const char BookmarkNode::kTabsCollectionBookmarksNodeGuid[] =
+ "00000000-0000-4000-a000-000000000006";
+
// static
const char BookmarkNode::kManagedNodeGuid[] =
"323123f4-9381-5aee-80e6-ea5fca2f7672";
@@ -225,6 +229,17 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id,
visible_when_empty));
}
+// static
+std::unique_ptr<BookmarkPermanentNode>
+BookmarkPermanentNode::CreateTabsCollectionBookmarks(int64_t id,
+ bool visible_when_empty) {
+ // base::WrapUnique() used because the constructor is private.
+ return base::WrapUnique(new BookmarkPermanentNode(
+ id, TABS_COLLECTION, base::GUID::ParseLowercase(kTabsCollectionBookmarksNodeGuid),
+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME),
+ visible_when_empty));
+}
+
BookmarkPermanentNode::BookmarkPermanentNode(int64_t id,
Type type,
const base::GUID& guid,
diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks/browser/bookmark_node.h
--- a/components/bookmarks/browser/bookmark_node.h
+++ b/components/bookmarks/browser/bookmark_node.h
@@ -36,6 +36,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
FOLDER,
BOOKMARK_BAR,
OTHER_NODE,
+ TABS_COLLECTION,
MOBILE
};
@@ -53,6 +54,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
static const char kBookmarkBarNodeGuid[];
static const char kOtherBookmarksNodeGuid[];
static const char kMobileBookmarksNodeGuid[];
+ static const char kTabsCollectionBookmarksNodeGuid[];
static const char kManagedNodeGuid[];
// A bug in sync caused some problematic GUIDs to be produced.
@@ -247,6 +249,9 @@ class BookmarkPermanentNode : public BookmarkNode {
static std::unique_ptr<BookmarkPermanentNode> CreateMobileBookmarks(
int64_t id,
bool visible_when_empty);
+ static std::unique_ptr<BookmarkPermanentNode> CreateTabsCollectionBookmarks(
+ int64_t id,
+ bool visible_when_empty);
// Constructor is private to disallow the construction of permanent nodes
// other than the well-known ones, see factory methods.
diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks/browser/model_loader.cc
--- a/components/bookmarks/browser/model_loader.cc
+++ b/components/bookmarks/browser/model_loader.cc
@@ -54,7 +54,8 @@ void LoadBookmarks(const base::FilePath& path,
std::string sync_metadata_str;
BookmarkCodec codec;
codec.Decode(*root, details->bb_node(), details->other_folder_node(),
- details->mobile_folder_node(), &max_node_id,
+ details->mobile_folder_node(),
+ details->tabs_collection_folder_node(), &max_node_id,
&sync_metadata_str);
details->set_sync_metadata_str(std::move(sync_metadata_str));
details->set_max_id(std::max(max_node_id, details->max_id()));
diff --git a/components/sync_bookmarks/bookmark_specifics_conversions.cc b/components/sync_bookmarks/bookmark_specifics_conversions.cc
--- a/components/sync_bookmarks/bookmark_specifics_conversions.cc
+++ b/components/sync_bookmarks/bookmark_specifics_conversions.cc
@@ -400,6 +400,7 @@ sync_pb::BookmarkSpecifics::Type GetProtoTypeFromBookmarkNode(
case bookmarks::BookmarkNode::BOOKMARK_BAR:
case bookmarks::BookmarkNode::OTHER_NODE:
case bookmarks::BookmarkNode::MOBILE:
+ case bookmarks::BookmarkNode::TABS_COLLECTION:
DCHECK(node->is_folder());
return sync_pb::BookmarkSpecifics::FOLDER;
}
--
2.17.1
@@ -1,126 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 13 Jul 2020 00:37:06 +0200
Subject: Add menu item to view source
---
chrome/android/java/res/menu/custom_tabs_menu.xml | 3 +++
chrome/android/java/res/menu/main_menu.xml | 3 +++
.../chrome/browser/ChromeTabbedActivity.java | 2 ++
.../chrome/browser/app/ChromeActivity.java | 5 +++++
.../app/appmenu/AppMenuPropertiesDelegateImpl.java | 14 ++++++++++++++
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
.../ui/android/strings/android_chrome_strings.grd | 4 ++++
7 files changed, 32 insertions(+)
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
@@ -46,6 +46,9 @@
<item android:id="@+id/add_to_homescreen_id"
android:title="@string/menu_add_to_homescreen"
android:orderInCategory="2" />
+ <item android:id="@+id/view_source_id"
+ android:title="@string/view_source"
+ android:orderInCategory="2" />
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk"
android:orderInCategory="2" />
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -88,6 +88,9 @@
<item android:id="@+id/add_to_homescreen_id"
android:title="@string/menu_add_to_homescreen"
android:icon="@drawable/ic_add_to_home_screen" />
+ <item android:id="@+id/view_source_id"
+ android:title="@string/view_source"
+ android:icon="@drawable/ic_drive_document_24dp" />
<item android:id="@+id/open_webapk_id"
android:title="@string/menu_open_webapk"
android:icon="@drawable/ic_add_to_home_screen" />
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
@@ -2043,6 +2043,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
}
RecordUserAction.record("MobileMenuDownloadManager");
+ } else if (id == R.id.view_source_id) {
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrl().getSpec()));
} else if (id == R.id.open_recently_closed_tab) {
TabModel currentModel = mTabModelSelector.getCurrentModel();
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -2429,6 +2429,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
return true;
}
+ if (id == R.id.view_source_id) {
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrl().getSpec()));
+ return true;
+ }
+
if (id == R.id.request_desktop_site_id || id == R.id.request_desktop_site_check_id) {
boolean usingDesktopUserAgent =
currentTab.getWebContents().getNavigationController().getUseDesktopUserAgent();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
@@ -355,6 +355,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
isChromeScheme, isFileScheme, isContentScheme, isIncognito, url));
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
+ updateViewSourceMenuItem(menu, currentTab);
// Only display reader mode settings menu option if the current page is in reader mode.
menu.findItem(R.id.reader_mode_prefs_id).setVisible(shouldShowReaderModePrefs(currentTab));
@@ -845,6 +846,19 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
}
}
+ /**
+ * Updates the view source menu item's state.
+ *
+ * @param menu {@link Menu} for view source.
+ * @param currentTab Current tab being displayed.
+ */
+ protected void updateViewSourceMenuItem(
+ Menu menu, Tab currentTab) {
+ MenuItem viewSourceMenuItem = menu.findItem(R.id.view_source_id);
+ String url = currentTab.getUrl().getSpec();
+ viewSourceMenuItem.setVisible(!url.isEmpty() && !url.startsWith("view-source:"));
+ }
+
/**
* Updates the request desktop site item's state.
*
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
@@ -214,6 +214,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
}
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
+ updateViewSourceMenuItem(menu, currentTab);
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
}
}
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -299,6 +299,10 @@ CHAR_LIMIT guidelines:
Sign-in verifications
</message>
+ <message name="IDS_VIEW_SOURCE" desc="Title for the menu command to view the source of the current page. [CHAR-LIMIT=40]">
+ View source
+ </message>
+
<message name="IDS_UNSUPPORTED" desc="Message displayed to the user when an attempted action is not supported.">
Unsupported
</message>
--
2.17.1
@@ -1,186 +0,0 @@
From: Wengling Chen <feiyu2817@gmail.com>
Date: Mon, 1 Feb 2021 19:18:55 +0200
Subject: Add option to force tablet UI
---
.../android/java/res/xml/accessibility_preferences.xml | 5 +++++
.../accessibility/settings/AccessibilitySettings.java | 10 ++++++++++
.../browser/preferences/ChromePreferenceKeys.java | 1 +
.../preferences/LegacyChromePreferenceKeys.java | 1 +
.../chrome/browser/omnibox/LocationBarCoordinator.java | 2 +-
.../ui/android/strings/android_chrome_strings.grd | 6 ++++++
.../browser/toolbar/top/ToolbarControlContainer.java | 2 +-
components/BUILD.gn | 4 ++--
ui/android/BUILD.gn | 2 ++
.../src/org/chromium/ui/base/DeviceFormFactor.java | 5 +++++
10 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/chrome/android/java/res/xml/accessibility_preferences.xml b/chrome/android/java/res/xml/accessibility_preferences.xml
--- a/chrome/android/java/res/xml/accessibility_preferences.xml
+++ b/chrome/android/java/res/xml/accessibility_preferences.xml
@@ -29,6 +29,11 @@
android:key="captions"
android:title="@string/accessibility_captions_title"/>
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
+ android:key="force_tablet_ui"
+ android:summary="@string/force_tablet_ui_summary"
+ android:title="@string/force_tablet_ui_title" />
+
<Preference
android:fragment="org.chromium.chrome.browser.image_descriptions.ImageDescriptionsSettings"
android:key="image_descriptions"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
@@ -37,6 +37,7 @@ public class AccessibilitySettings
static final String PREF_IMAGE_DESCRIPTIONS = "image_descriptions";
static final String PREF_ACCESSIBILITY_PAGE_ZOOM = "accessibility_page_zoom";
+ static final String PREF_FORCE_TABLET_UI = "force_tablet_ui";
private TextScalePreference mTextScalePref;
private ChromeBaseCheckBoxPreference mForceEnableZoomPref;
private boolean mRecordFontSizeChangeOnStop;
@@ -82,6 +83,12 @@ public class AccessibilitySettings
.getBoolean(Pref.READER_FOR_ACCESSIBILITY));
readerForAccessibilityPref.setOnPreferenceChangeListener(this);
+ ChromeBaseCheckBoxPreference forceTabletUiPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_FORCE_TABLET_UI);
+ forceTabletUiPref.setChecked(SharedPreferencesManager.getInstance().readBoolean(
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false));
+ forceTabletUiPref.setOnPreferenceChangeListener(this);
+
ChromeBaseCheckBoxPreference mAccessibilityTabSwitcherPref =
(ChromeBaseCheckBoxPreference) findPreference(
ChromePreferenceKeys.ACCESSIBILITY_TAB_SWITCHER);
@@ -137,6 +144,9 @@ public class AccessibilitySettings
mFontSizePrefs.setUserFontScaleFactor((Float) newValue);
} else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) {
mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue);
+ } else if (PREF_FORCE_TABLET_UI.equals(preference.getKey())) {
+ SharedPreferencesManager.getInstance().writeBoolean(
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, (Boolean) newValue);
} else if (PREF_READER_FOR_ACCESSIBILITY.equals(preference.getKey())) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.READER_FOR_ACCESSIBILITY, (Boolean) newValue);
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@@ -536,6 +536,7 @@ public final class ChromePreferenceKeys {
public static final String FONT_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable_zoom";
public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info";
+ public static final String FLAGS_FORCE_TABLET_UI_ENABLED = "force_tablet_ui_enabled";
/** Keys used to save settings related to homepage. */
public static final String HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
@@ -99,6 +99,7 @@ public class LegacyChromePreferenceKeys {
ChromePreferenceKeys.FLAGS_CACHED_SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT,
ChromePreferenceKeys.FLAGS_CACHED_TAB_GROUPS_ANDROID_ENABLED,
ChromePreferenceKeys.FONT_USER_FONT_SCALE_FACTOR,
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED,
ChromePreferenceKeys.FONT_USER_SET_FORCE_ENABLE_ZOOM,
ChromePreferenceKeys.HISTORY_SHOW_HISTORY_INFO,
ChromePreferenceKeys.HOMEPAGE_CUSTOM_URI,
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
@@ -348,7 +348,7 @@ public final class LocationBarCoordinator implements LocationBar, NativeInitObse
// OmniboxSuggestionsDropdownEmbedder implementation
@Override
public boolean isTablet() {
- return DeviceFormFactor.isWindowOnTablet(mWindowAndroid);
+ return DeviceFormFactor.isWindowOnTablet(mWindowAndroid) || isTabletLayout();
}
@Override
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -1200,6 +1200,12 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_SAFE_BROWSING_NO_PROTECTION_CONFIRMATION_DIALOG_CONFIRM" desc="Message for Safe Browsing no protection confirmation button.">
Turn off
</message>
+ <message name="IDS_FORCE_TABLET_UI_SUMMARY" desc="Summary of the preference that allows the user to force chromium to use tablet UI.">
+ Open chromium in Tablet Mode
+ </message>
+ <message name="IDS_FORCE_TABLET_UI_TITLE" desc="Title of the preference that allows the user to update force tablet UI settings.">
+ Force Tablet Mode
+ </message>
<!-- Accessibility preferences -->
<message name="IDS_PREFS_ACCESSIBILITY" desc="Title of Accessibility settings, which allows the user to change webpage font sizes. [CHAR_LIMIT=32]">
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
@@ -109,7 +109,7 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
// On tablet, draw a fake tab strip and toolbar until the compositor is
// ready to draw the real tab strip. (On phone, the toolbar is made entirely
// of Android views, which are already initialized.)
- setBackgroundResource(R.drawable.toolbar_background);
+// setBackgroundResource(R.drawable.toolbar_background);
}
}
diff --git a/components/BUILD.gn b/components/BUILD.gn
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -542,7 +542,7 @@ test("components_unittests") {
# On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
# On other platforms, no components should depend on Chrome.
- if (!is_chromeos_lacros) {
+ if (!is_chromeos_lacros && !is_android) {
assert_no_deps = [ "//chrome/*" ]
}
@@ -789,7 +789,7 @@ if (!is_ios) {
# On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
# On other platforms, no components should depend on Chrome.
- if (!is_chromeos_lacros) {
+ if (!is_chromeos_lacros && !is_android) {
assert_no_deps = [ "//chrome/*" ]
}
}
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
--- a/ui/android/BUILD.gn
+++ b/ui/android/BUILD.gn
@@ -370,6 +370,8 @@ android_library("ui_no_recycler_view_java") {
":ui_java_resources",
":ui_utils_java",
"//base:base_java",
+ # dependency for ui_no_recycler_view_java
+ "//chrome/browser/preferences:java",
"//components/url_formatter/android:url_formatter_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_appcompat_appcompat_java",
diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
--- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
+++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
@@ -11,6 +11,8 @@ import androidx.annotation.UiThread;
import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative;
+import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
+import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.ui.R;
import org.chromium.ui.display.DisplayAndroid;
import org.chromium.ui.display.DisplayUtil;
@@ -60,6 +62,9 @@ public class DeviceFormFactor {
* E.g. http://developer.samsung.com/samsung-dex/testing
*/
public static boolean isNonMultiDisplayContextOnTablet(Context context) {
+ if (SharedPreferencesManager.getInstance().readBoolean(
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false))
+ return true;
return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
}
--
2.17.1
@@ -1,114 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 7 Sep 2019 15:07:42 +0200
Subject: Add option to not persist tabs across sessions
---
.../android/java/res/xml/privacy_preferences.xml | 5 +++++
.../chrome/browser/ChromeTabbedActivity.java | 4 +++-
.../privacy/settings/PrivacySettings.java | 16 +++++++++++++++-
.../android/strings/android_chrome_strings.grd | 6 ++++++
4 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -33,6 +33,11 @@
android:title="@string/always_incognito_title"
android:summary="@string/always_incognito_summary"
android:defaultValue="false" />
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="close_tabs_on_exit"
+ android:title="@string/close_tabs_on_exit_title"
+ android:summary="@string/close_tabs_on_exit_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -1188,8 +1188,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
boolean hadCipherData =
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
+ String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
boolean noRestoreState =
- CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE);
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE) ||
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
if (noRestoreState) {
// Clear the state files because they are inconsistent and useless from now on.
mTabModelOrchestrator.clearState();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.privacy.settings;
import android.os.Build;
+import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.SpannableString;
import android.view.Menu;
@@ -15,6 +16,8 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
+import org.chromium.base.ContextUtils;
+import org.chromium.base.BuildInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
@@ -59,6 +62,8 @@ public class PrivacySettings
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
+
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
@Override
@@ -137,7 +142,11 @@ public class PrivacySettings
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
- if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
+ if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
+ sharedPreferencesEditor.apply();
+ } else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
@@ -189,6 +198,11 @@ public class PrivacySettings
privacySandboxPreference.setSummary(
PrivacySandboxSettingsFragment.getStatusString(getContext()));
}
+
+ ChromeSwitchPreference closeTabsOnExitPref =
+ (ChromeSwitchPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
}
private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -4032,6 +4032,12 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
IMAGE
</message>
+ <message name="IDS_CLOSE_TABS_ON_EXIT_TITLE" desc="Text for 'Close tabs on exit' settings-privacy option.">
+ Close all open tabs on exit
+ </message>
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
+ Don't persist tabs between browsing sessions
+ </message>
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
LINK
</message>
--
2.17.1
@@ -1,52 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Mon, 17 May 2021 12:30:12 +0000
Subject: Add support for ISupportHelpAndFeedback
---
.../chrome/browser/settings/SettingsActivity.java | 11 ++++++++---
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
+import org.chromium.components.browser_ui.settings.SettingsUtils;
import org.chromium.components.browser_ui.site_settings.SiteSettingsPreferenceFragment;
import org.chromium.ui.UiUtils;
@@ -252,9 +253,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
finish();
return true;
} else if (item.getItemId() == R.id.menu_id_general_help) {
- HelpAndFeedbackLauncherImpl.getInstance().show(this,
- getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
- null);
+ if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) {
+ ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed();
+ } else {
+ HelpAndFeedbackLauncherImpl.getInstance().show(this,
+ getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
+ null);
+ }
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
--- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
+++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
@@ -126,4 +126,8 @@ public class SettingsUtils {
ImageView imageButton = (ImageView) button;
return imageButton.getDrawable() == parentMenu.getOverflowIcon();
}
+
+ public interface ISupportHelpAndFeedback {
+ void onHelpAndFeebackPressed();
+ }
}
--
2.17.1
@@ -1,211 +0,0 @@
From: Zoraver Kang <Zoraver@users.noreply.github.com>
Date: Fri, 22 May 2020 22:43:27 -0400
Subject: Allow building without enable_reporting
---
content/browser/BUILD.gn | 8 ++++----
.../common/content_switch_dependent_feature_overrides.cc | 3 +++
third_party/blink/renderer/core/frame/local_frame.cc | 3 +++
third_party/blink/renderer/core/frame/local_frame.h | 6 +++---
.../blink/renderer/core/frame/reporting_context.cc | 9 +++++++++
.../blink/renderer/core/frame/reporting_context.h | 7 +++++--
6 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -1240,6 +1240,10 @@ source_set("browser") {
"net/browser_online_state_observer.cc",
"net/browser_online_state_observer.h",
"net/cookie_store_factory.cc",
+ "net/cross_origin_embedder_policy_reporter.cc",
+ "net/cross_origin_embedder_policy_reporter.h",
+ "net/cross_origin_opener_policy_reporter.cc",
+ "net/cross_origin_opener_policy_reporter.h",
"net/network_errors_listing_ui.cc",
"net/network_errors_listing_ui.h",
"net/network_quality_observer_impl.cc",
@@ -2989,10 +2993,6 @@ source_set("browser") {
if (enable_reporting) {
sources += [
- "net/cross_origin_embedder_policy_reporter.cc",
- "net/cross_origin_embedder_policy_reporter.h",
- "net/cross_origin_opener_policy_reporter.cc",
- "net/cross_origin_opener_policy_reporter.h",
"net/reporting_service_proxy.cc",
"net/reporting_service_proxy.h",
]
diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc
--- a/content/public/common/content_switch_dependent_feature_overrides.cc
+++ b/content/public/common/content_switch_dependent_feature_overrides.cc
@@ -7,6 +7,7 @@
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "net/base/features.h"
+#include "net/net_buildflags.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "third_party/blink/public/common/features.h"
@@ -46,9 +47,11 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
{switches::kEnableExperimentalWebPlatformFeatures,
std::cref(features::kDocumentPolicyNegotiation),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
+#if BUILDFLAG(ENABLE_REPORTING)
{switches::kEnableExperimentalWebPlatformFeatures,
std::cref(net::features::kDocumentReporting),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
+#endif
{switches::kEnableExperimentalWebPlatformFeatures,
std::cref(features::kExperimentalContentSecurityPolicyFeatures),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
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
@@ -39,6 +39,7 @@
#include "base/values.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/system/message_pipe.h"
+#include "net/net_buildflags.h"
#include "services/data_decoder/public/mojom/resource_snapshot_for_web_bundle.mojom-blink.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
@@ -2282,9 +2283,11 @@ const base::UnguessableToken& LocalFrame::GetAgentClusterId() const {
return base::UnguessableToken::Null();
}
+#if BUILDFLAG(ENABLE_REPORTING)
mojom::blink::ReportingServiceProxy* LocalFrame::GetReportingService() {
return mojo_handler_->ReportingService();
}
+#endif
// static
void LocalFrame::NotifyUserActivation(
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -33,9 +33,9 @@
#include "base/time/default_tick_clock.h"
#include "base/unguessable_token.h"
-#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
+#include "net/net_buildflags.h"
#include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h"
#include "services/network/public/mojom/fetch_api.mojom-blink-forward.h"
#include "third_party/blink/public/common/frame/frame_ad_evidence.h"
@@ -543,9 +543,9 @@ class CORE_EXPORT LocalFrame final : public Frame,
}
SmoothScrollSequencer& GetSmoothScrollSequencer();
-
+#if BUILDFLAG(ENABLE_REPORTING)
mojom::blink::ReportingServiceProxy* GetReportingService();
-
+#endif
// Returns the frame host ptr. The interface returned is backed by an
// associated interface with the legacy Chrome IPC channel.
mojom::blink::LocalFrameHost& GetLocalFrameHostRemote() const;
diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_party/blink/renderer/core/frame/reporting_context.cc
--- a/third_party/blink/renderer/core/frame/reporting_context.cc
+++ b/third_party/blink/renderer/core/frame/reporting_context.cc
@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/core/frame/reporting_context.h"
+#include "net/net_buildflags.h"
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/task_type.h"
@@ -54,7 +55,9 @@ const char ReportingContext::kSupplementName[] = "ReportingContext";
ReportingContext::ReportingContext(ExecutionContext& context)
: Supplement<ExecutionContext>(context),
execution_context_(context),
+#if BUILDFLAG(ENABLE_REPORTING)
reporting_service_(&context),
+#endif
receiver_(this, &context) {}
// static
@@ -118,7 +121,9 @@ void ReportingContext::Trace(Visitor* visitor) const {
visitor->Trace(observers_);
visitor->Trace(report_buffer_);
visitor->Trace(execution_context_);
+#if BUILDFLAG(ENABLE_REPORTING)
visitor->Trace(reporting_service_);
+#endif
visitor->Trace(receiver_);
Supplement<ExecutionContext>::Trace(visitor);
}
@@ -140,6 +145,7 @@ void ReportingContext::CountReport(Report* report) {
UseCounter::Count(execution_context_, feature);
}
+#if BUILDFLAG(ENABLE_REPORTING)
const HeapMojoRemote<mojom::blink::ReportingServiceProxy>&
ReportingContext::GetReportingService() const {
if (!reporting_service_.is_bound()) {
@@ -149,6 +155,7 @@ ReportingContext::GetReportingService() const {
}
return reporting_service_;
}
+#endif
void ReportingContext::NotifyInternal(Report* report) {
// Buffer the report.
@@ -171,6 +178,7 @@ void ReportingContext::NotifyInternal(Report* report) {
void ReportingContext::SendToReportingAPI(Report* report,
const String& endpoint) const {
+#if BUILDFLAG(ENABLE_REPORTING)
const String& type = report->type();
if (!(type == ReportType::kCSPViolation || type == ReportType::kDeprecation ||
type == ReportType::kPermissionsPolicyViolation ||
@@ -226,6 +234,7 @@ void ReportingContext::SendToReportingAPI(Report* report,
url, endpoint, body->featureId(), body->disposition(), body->message(),
body->sourceFile(), line_number, column_number);
}
+#endif
}
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_party/blink/renderer/core/frame/reporting_context.h
--- a/third_party/blink/renderer/core/frame/reporting_context.h
+++ b/third_party/blink/renderer/core/frame/reporting_context.h
@@ -5,6 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_
+#include "net/net_buildflags.h"
#include "third_party/blink/public/mojom/frame/reporting_observer.mojom-blink.h"
#include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h"
#include "third_party/blink/renderer/core/core_export.h"
@@ -53,10 +54,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
private:
// Counts the use of a report type via UseCounter.
void CountReport(Report*);
-
+#if BUILDFLAG(ENABLE_REPORTING)
const HeapMojoRemote<mojom::blink::ReportingServiceProxy>&
GetReportingService() const;
-
+#endif
void NotifyInternal(Report* report);
// Send |report| via the Reporting API to |endpoint|.
void SendToReportingAPI(Report* report, const String& endpoint) const;
@@ -67,8 +68,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
// This is declared mutable so that the service endpoint can be cached by
// const methods.
+#if BUILDFLAG(ENABLE_REPORTING)
mutable HeapMojoRemote<mojom::blink::ReportingServiceProxy>
reporting_service_;
+#endif
HeapMojoReceiver<mojom::blink::ReportingObserver, ReportingContext> receiver_;
};
--
2.17.1
@@ -1,54 +0,0 @@
From: AlexeyBarabash <alexey@brave.com>
Date: Thu, 2 Nov 2017 18:21:16 +0200
Subject: Allow playing audio in background
---
.../public/platform/media/web_media_player_impl.h | 3 +++
.../renderer/platform/media/web_media_player_impl.cc | 12 +++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/third_party/blink/public/platform/media/web_media_player_impl.h b/third_party/blink/public/platform/media/web_media_player_impl.h
--- a/third_party/blink/public/platform/media/web_media_player_impl.h
+++ b/third_party/blink/public/platform/media/web_media_player_impl.h
@@ -159,6 +159,9 @@ class BLINK_PLATFORM_EXPORT WebMediaPlayerImpl
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 WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) override;
void SelectedVideoTrackChanged(
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
--- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
+++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
@@ -1118,6 +1118,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 WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
@@ -3490,7 +3496,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
// Audio only stream is allowed to play when in background.
// TODO: We should check IsBackgroundOptimizationCandidate here. But we need
// to move the logic of checking video frames out of that function.
- if (!HasVideo())
+
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
+ //streams be played in background.
+ if (!HasVideoNonEmptySize())
return false;
if (using_media_player_renderer_ &&
--
2.17.1
@@ -1,24 +0,0 @@
From: xsmile <xsmile@users.noreply.github.com>
Date: Thu, 11 Oct 2018 21:29:35 +0200
Subject: Allow website sign-in without account sign-in
Disable prefs::kSigninAllowedOnNextStartup by default. The setting can be found in chrome://settings
---
chrome/browser/signin/account_consistency_mode_manager.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
@@ -127,7 +127,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
registry->RegisterBooleanPref(kDiceMigrationCompletePref, false);
#endif
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
}
// static
--
2.17.1
@@ -1,37 +0,0 @@
From: samartnik <artem@brave.com>
Date: Thu, 14 Dec 2017 16:19:50 +0200
Subject: Always allow partner customisation
---
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
@@ -324,14 +324,14 @@ public class PartnerBrowserCustomizations {
@Override
protected Void doInBackground() {
try {
- boolean systemOrPreStable =
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
- || !ChromeVersionInfo.isStableBuild();
- if (!systemOrPreStable) {
- // Only allow partner customization if this browser is a system package, or
- // is in pre-stable channels.
- return null;
- }
+ //boolean systemOrPreStable =
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
+ // || !ChromeVersionInfo.isStableBuild();
+ //if (!systemOrPreStable) {
+ // // Only allow partner customization if this browser is a system package, or
+ // // is in pre-stable channels.
+ // return null;
+ //}
if (isCancelled()) return null;
Provider provider = AppHooks.get().getCustomizationProvider();
--
2.17.1
@@ -1,38 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 5 Jun 2018 13:46:40 +0200
Subject: Always respect async dns flag (regardless of SDK version)
Do not read experiment value for cronet async DNS configuration
---
chrome/browser/net/system_network_context_manager.cc | 2 +-
components/cronet/url_request_context_config.cc | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
--- a/chrome/browser/net/system_network_context_manager.cc
+++ b/chrome/browser/net/system_network_context_manager.cc
@@ -157,7 +157,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams(
local_state->GetBoolean(prefs::kNtlmV2Enabled);
#endif // defined(OS_POSIX)
-#if defined(OS_ANDROID)
+#if 0
auth_dynamic_params->android_negotiate_account_type =
local_state->GetString(prefs::kAuthAndroidNegotiateAccountType);
#endif // defined(OS_ANDROID)
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
--- a/components/cronet/url_request_context_config.cc
+++ b/components/cronet/url_request_context_config.cc
@@ -592,7 +592,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
effective_experimental_options->RemoveKey(it.key());
continue;
}
- async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
+ bool ignored;
+ async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
} else if (it.key() == kStaleDnsFieldTrialName) {
const base::DictionaryValue* stale_dns_args = nullptr;
if (!it.value().GetAsDictionary(&stale_dns_args)) {
--
2.17.1
@@ -1,25 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 27 Jun 2018 11:02:38 +0200
Subject: Always use new tab page for default home page
Ignore any partner-provided home page.
---
.../org/chromium/chrome/browser/homepage/HomepageManager.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
@@ -146,9 +146,6 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat
* if the homepage button is force enabled via flag.
*/
public static String getDefaultHomepageUri() {
- if (PartnerBrowserCustomizations.getInstance().isHomepageProviderAvailableAndEnabled()) {
- return PartnerBrowserCustomizations.getInstance().getHomePageUrl();
- }
return UrlConstants.NTP_NON_NATIVE_URL;
}
--
2.17.1
@@ -1,62 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:49:37 +0200
Subject: AudioBuffer, AnalyserNode: fp mitigations
Truncate base latency precision to two digits
---
.../blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
.../blink/renderer/modules/webaudio/audio_buffer.idl | 6 ------
.../blink/renderer/modules/webaudio/audio_context.cc | 4 +++-
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
@@ -40,10 +40,10 @@
// Copies the current frequency data into the passed array.
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
- [HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
- [HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
+ //[HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
+ //[HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
// Real-time waveform data
- [HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
- [HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
+ //[HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
+ //[HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
};
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
@@ -37,12 +37,6 @@
// Channel access
readonly attribute unsigned long numberOfChannels;
- [HighEntropy=Direct, Measure, RaisesException] Float32Array getChannelData(
- unsigned long channelIndex);
- [HighEntropy, Measure, RaisesException] void copyFromChannel(
- Float32Array destination,
- unsigned long channelNumber,
- optional unsigned long bufferOffset = 0);
[RaisesException] void copyToChannel(
Float32Array source,
unsigned long channelNumber,
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
@@ -458,7 +458,9 @@ double AudioContext::baseLatency() const {
DCHECK(IsMainThread());
DCHECK(destination());
- return base_latency_;
+ // remove precision past two decimal digits
+ int l = base_latency_ * 100;
+ return double(l)/100;
}
MediaElementAudioSourceNode* AudioContext::createMediaElementSource(
--
2.17.1
File diff suppressed because one or more lines are too long
@@ -1,66 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 22 Mar 2018 22:11:57 +0100
Subject: Battery API: return nothing
Include @thestinger's fix for correct charging/unknown values
---
.../modules/battery/battery_manager.cc | 26 +++----------------
1 file changed, 4 insertions(+), 22 deletions(-)
diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc
--- a/third_party/blink/renderer/modules/battery/battery_manager.cc
+++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
@@ -70,46 +70,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) {
}
bool BatteryManager::charging() {
- return battery_status_.Charging();
+ return true;
}
double BatteryManager::chargingTime() {
- return battery_status_.charging_time();
+ return 0.0;
}
double BatteryManager::dischargingTime() {
- return battery_status_.discharging_time();
+ return std::numeric_limits<double>::infinity();
}
double BatteryManager::level() {
- return battery_status_.Level();
+ return 1.0;
}
void BatteryManager::DidUpdateData() {
DCHECK(battery_property_);
- BatteryStatus old_status = battery_status_;
- battery_status_ = *battery_dispatcher_->LatestData();
-
if (battery_property_->GetState() == BatteryProperty::kPending) {
battery_property_->Resolve(this);
return;
}
-
- DCHECK(GetExecutionContext());
- if (GetExecutionContext()->IsContextPaused() ||
- GetExecutionContext()->IsContextDestroyed()) {
- return;
- }
-
- if (battery_status_.Charging() != old_status.Charging())
- DispatchEvent(*Event::Create(event_type_names::kChargingchange));
- if (battery_status_.charging_time() != old_status.charging_time())
- DispatchEvent(*Event::Create(event_type_names::kChargingtimechange));
- if (battery_status_.discharging_time() != old_status.discharging_time())
- DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange));
- if (battery_status_.Level() != old_status.Level())
- DispatchEvent(*Event::Create(event_type_names::kLevelchange));
}
void BatteryManager::RegisterWithDispatcher() {
--
2.17.1
@@ -1,211 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 28 Jul 2020 12:28:58 +0200
Subject: Block gateway attacks via websockets
---
.../renderer/core/loader/base_fetch_context.h | 1 +
.../core/loader/frame_fetch_context.cc | 18 +++++++++++++
.../core/loader/frame_fetch_context.h | 1 +
.../core/loader/worker_fetch_context.cc | 19 +++++++++++++
.../core/loader/worker_fetch_context.h | 1 +
.../background_fetch_manager.cc | 2 --
.../websockets/websocket_channel_impl.cc | 5 ++++
.../modules/websockets/websocket_common.cc | 27 +++++++++++++++++++
.../modules/websockets/websocket_common.h | 4 +++
9 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.h b/third_party/blink/renderer/core/loader/base_fetch_context.h
--- a/third_party/blink/renderer/core/loader/base_fetch_context.h
+++ b/third_party/blink/renderer/core/loader/base_fetch_context.h
@@ -82,6 +82,7 @@ class CORE_EXPORT BaseFetchContext : public FetchContext {
virtual SubresourceFilter* GetSubresourceFilter() const = 0;
virtual bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const = 0;
+ virtual bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const = 0;
virtual std::unique_ptr<WebSocketHandshakeThrottle>
CreateWebSocketHandshakeThrottle() = 0;
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
--- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc
+++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -568,6 +568,24 @@ bool FrameFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
return should_block_request;
}
+bool FrameFetchContext::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
+ // all this up to //net and //content in order to have any real impact on
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
+ network::mojom::IPAddressSpace target_space =
+ network::mojom::IPAddressSpace::kPublic;
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
+ target_space = network::mojom::IPAddressSpace::kPrivate;
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
+ target_space = network::mojom::IPAddressSpace::kLocal;
+
+ bool is_external_request = requestor_space > target_space;
+ if (is_external_request)
+ return true;
+
+ return false;
+}
+
void FrameFetchContext::DispatchDidBlockRequest(
const ResourceRequest& resource_request,
const ResourceLoaderOptions& options,
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.h b/third_party/blink/renderer/core/loader/frame_fetch_context.h
--- a/third_party/blink/renderer/core/loader/frame_fetch_context.h
+++ b/third_party/blink/renderer/core/loader/frame_fetch_context.h
@@ -165,6 +165,7 @@ class CORE_EXPORT FrameFetchContext final : public BaseFetchContext,
bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const override;
std::unique_ptr<WebSocketHandshakeThrottle> CreateWebSocketHandshakeThrottle()
override;
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const override;
bool ShouldBlockFetchByMixedContentCheck(
mojom::blink::RequestContextType request_context,
const absl::optional<ResourceRequest::RedirectInfo>& redirect_info,
diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.cc b/third_party/blink/renderer/core/loader/worker_fetch_context.cc
--- a/third_party/blink/renderer/core/loader/worker_fetch_context.cc
+++ b/third_party/blink/renderer/core/loader/worker_fetch_context.cc
@@ -24,6 +24,7 @@
#include "third_party/blink/renderer/platform/loader/fetch/resource_timing_info.h"
#include "third_party/blink/renderer/platform/loader/fetch/worker_resource_timing_notifier.h"
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
+#include "third_party/blink/renderer/platform/network/network_utils.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/supplementable.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
@@ -90,6 +91,24 @@ bool WorkerFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
return should_block_request;
}
+bool WorkerFetchContext::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
+ // all this up to //net and //content in order to have any real impact on
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
+ network::mojom::IPAddressSpace target_space =
+ network::mojom::IPAddressSpace::kPublic;
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
+ target_space = network::mojom::IPAddressSpace::kPrivate;
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
+ target_space = network::mojom::IPAddressSpace::kLocal;
+
+ bool is_external_request = requestor_space > target_space;
+ if (is_external_request)
+ return true;
+
+ return false;
+}
+
void WorkerFetchContext::DispatchDidBlockRequest(
const ResourceRequest& resource_request,
const ResourceLoaderOptions& options,
diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.h b/third_party/blink/renderer/core/loader/worker_fetch_context.h
--- a/third_party/blink/renderer/core/loader/worker_fetch_context.h
+++ b/third_party/blink/renderer/core/loader/worker_fetch_context.h
@@ -62,6 +62,7 @@ class WorkerFetchContext final : public BaseFetchContext {
bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const override;
std::unique_ptr<WebSocketHandshakeThrottle> CreateWebSocketHandshakeThrottle()
override;
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL&) const override;
bool ShouldBlockFetchByMixedContentCheck(
mojom::blink::RequestContextType request_context,
const absl::optional<ResourceRequest::RedirectInfo>& redirect_info,
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
--- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
+++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
@@ -103,7 +103,6 @@ bool ShouldBlockDanglingMarkup(const KURL& request_url) {
bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
const KURL& request_url) {
- if (RuntimeEnabledFeatures::CorsRFC1918Enabled()) {
network::mojom::IPAddressSpace requestor_space =
execution_context->AddressSpace();
@@ -120,7 +119,6 @@ bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
bool is_external_request = requestor_space > target_space;
if (is_external_request)
return true;
- }
return false;
}
diff --git a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
--- a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
+++ b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
@@ -274,6 +274,11 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) {
return false;
}
+ if (GetBaseFetchContext()->ShouldBlockGateWayAttacks(execution_context_->AddressSpace(), url)) {
+ has_initiated_opening_handshake_ = false;
+ return false;
+ }
+
if (auto* scheduler = execution_context_->GetScheduler()) {
feature_handle_for_scheduler_ = scheduler->RegisterFeature(
SchedulingPolicy::Feature::kWebSocket,
diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.cc b/third_party/blink/renderer/modules/websockets/websocket_common.cc
--- a/third_party/blink/renderer/modules/websockets/websocket_common.cc
+++ b/third_party/blink/renderer/modules/websockets/websocket_common.cc
@@ -124,9 +124,36 @@ WebSocketCommon::ConnectResult WebSocketCommon::Connect(
return ConnectResult::kException;
}
+ network::mojom::IPAddressSpace requestor_space =
+ execution_context->AddressSpace();
+ if (ShouldBlockGateWayAttacks(requestor_space, url_)) {
+ state_ = kClosed;
+ exception_state.ThrowSecurityError(
+ "Access to address of '" + url_.Host() + "' is not allowed from '" + execution_context->addressSpaceForBindings() + "' address space.");
+ return ConnectResult::kException;
+ }
+
return ConnectResult::kSuccess;
}
+bool WebSocketCommon::ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& request_url) const {
+ // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
+ // all this up to //net and //content in order to have any real impact on
+ // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
+ network::mojom::IPAddressSpace target_space =
+ network::mojom::IPAddressSpace::kPublic;
+ if (network_utils::IsReservedIPAddress(request_url.Host()))
+ target_space = network::mojom::IPAddressSpace::kPrivate;
+ if (SecurityOrigin::Create(request_url)->IsLocalhost())
+ target_space = network::mojom::IPAddressSpace::kLocal;
+
+ bool is_external_request = requestor_space > target_space;
+ if (is_external_request)
+ return true;
+
+ return false;
+}
+
void WebSocketCommon::CloseInternal(int code,
const String& reason,
WebSocketChannel* channel,
diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/third_party/blink/renderer/modules/websockets/websocket_common.h
--- a/third_party/blink/renderer/modules/websockets/websocket_common.h
+++ b/third_party/blink/renderer/modules/websockets/websocket_common.h
@@ -8,6 +8,8 @@
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_COMMON_H_
#include "base/macros.h"
+#include "services/network/public/mojom/ip_address_space.mojom.h"
+#include "third_party/blink/renderer/platform/network/network_utils.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
@@ -51,6 +53,8 @@ class MODULES_EXPORT WebSocketCommon {
void SetState(State state) { state_ = state; }
const KURL& Url() const { return url_; }
+ bool ShouldBlockGateWayAttacks(network::mojom::IPAddressSpace requestor_space, const KURL& url) const;
+
// The following methods are public for testing.
// Returns true if |protocol| is a valid WebSocket subprotocol name.
--
2.17.1
@@ -1,288 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 30 Oct 2019 11:50:13 +0100
Subject: Block 'qjz9zk' or 'trk:' requests
An info bar is displayed unless the --disable-trkbar command-line flag or the chrome://flag option is used.
This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved'
---
.../chrome_autocomplete_scheme_classifier.cc | 1 +
chrome/browser/history/history_utils.cc | 1 +
chrome/browser/ui/singleton_tabs.cc | 3 +-
.../omnibox/browser/autocomplete_input.cc | 8 ++++-
components/url_formatter/url_fixer.cc | 4 +++
.../child_process_security_policy_impl.cc | 1 +
net/BUILD.gn | 2 ++
net/url_request/trk_protocol_handler.cc | 25 +++++++++++++++
net/url_request/trk_protocol_handler.h | 31 +++++++++++++++++++
net/url_request/url_request.cc | 8 +++++
.../url_request_context_builder.cc | 3 ++
url/url_constants.cc | 1 +
url/url_constants.h | 1 +
url/url_util.cc | 2 ++
14 files changed, 89 insertions(+), 2 deletions(-)
create mode 100644 net/url_request/trk_protocol_handler.cc
create mode 100644 net/url_request/trk_protocol_handler.h
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
--- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
@@ -56,6 +56,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
if (base::IsStringASCII(scheme) &&
(ProfileIOData::IsHandledProtocol(scheme) ||
base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) ||
+ base::LowerCaseEqualsASCII(scheme, url::kTraceScheme) ||
base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) ||
base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) {
return metrics::OmniboxInputType::URL;
diff --git a/chrome/browser/history/history_utils.cc b/chrome/browser/history/history_utils.cc
--- a/chrome/browser/history/history_utils.cc
+++ b/chrome/browser/history/history_utils.cc
@@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url) {
url.SchemeIs(content::kChromeDevToolsScheme) ||
url.SchemeIs(content::kChromeUIScheme) ||
url.SchemeIs(content::kViewSourceScheme) ||
+ url.SchemeIs(url::kTraceScheme) ||
url.SchemeIs(chrome::kChromeNativeScheme) ||
url.SchemeIs(chrome::kChromeSearchScheme) ||
url.SchemeIs(dom_distiller::kDomDistillerScheme))
diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc
--- a/chrome/browser/ui/singleton_tabs.cc
+++ b/chrome/browser/ui/singleton_tabs.cc
@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
// Skip view-source tabs. This is needed because RewriteURLIfNecessary
// removes the "view-source:" scheme which leads to incorrect matching.
- if (tab_url.SchemeIs(content::kViewSourceScheme))
+ if (tab_url.SchemeIs(content::kViewSourceScheme) ||
+ tab_url.SchemeIs(url::kTraceScheme))
continue;
GURL rewritten_tab_url = tab_url;
diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc
--- a/components/omnibox/browser/autocomplete_input.cc
+++ b/components/omnibox/browser/autocomplete_input.cc
@@ -81,10 +81,15 @@ void OffsetComponentsExcludingScheme(url::Parsed* parts, int offset) {
bool HasScheme(const std::u16string& input, const char* scheme) {
std::string utf8_input(base::UTF16ToUTF8(input));
url::Component view_source_scheme;
+
+ if (url::FindAndCompareScheme(utf8_input, url::kTraceScheme, &view_source_scheme)) {
+ return false;
+ }
if (url::FindAndCompareScheme(utf8_input, kViewSourceScheme,
&view_source_scheme)) {
utf8_input.erase(0, view_source_scheme.end() + 1);
}
+
return url::FindAndCompareScheme(utf8_input, scheme, nullptr);
}
@@ -532,7 +537,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
// For the view-source and blob schemes, we should emphasize the host of the
// URL qualified by the view-source or blob prefix.
if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) ||
- base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme)) &&
+ base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme) ||
+ base::LowerCaseEqualsASCII(scheme_str, url::kTraceScheme)) &&
(static_cast<int>(text.length()) > after_scheme_and_colon)) {
// Obtain the URL prefixed by view-source or blob and parse it.
std::u16string real_url(text.substr(after_scheme_and_colon));
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
--- a/components/url_formatter/url_fixer.cc
+++ b/components/url_formatter/url_fixer.cc
@@ -562,6 +562,10 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
}
}
+ if (scheme == url::kTraceScheme) {
+ return GURL();
+ }
+
// We handle the file scheme separately.
if (scheme == url::kFileScheme)
return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -819,6 +819,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl()
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
RegisterWebSafeScheme(url::kFtpScheme);
RegisterWebSafeScheme(url::kDataScheme);
+ RegisterWebSafeScheme(url::kTraceScheme);
RegisterWebSafeScheme("feed");
// TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
diff --git a/net/BUILD.gn b/net/BUILD.gn
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -1042,6 +1042,8 @@ component("net") {
"url_request/url_request_http_job.cc",
"url_request/url_request_http_job.h",
"url_request/url_request_interceptor.cc",
+ "url_request/trk_protocol_handler.cc",
+ "url_request/trk_protocol_handler.h",
"url_request/url_request_interceptor.h",
"url_request/url_request_job.cc",
"url_request/url_request_job.h",
diff --git a/net/url_request/trk_protocol_handler.cc b/net/url_request/trk_protocol_handler.cc
new file mode 100644
--- /dev/null
+++ b/net/url_request/trk_protocol_handler.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/url_request/trk_protocol_handler.h"
+
+#include "base/logging.h"
+#include "net/base/net_errors.h"
+#include "net/url_request/url_request_error_job.h"
+
+namespace net {
+
+TrkProtocolHandler::TrkProtocolHandler() = default;
+
+std::unique_ptr<URLRequestJob> TrkProtocolHandler::CreateJob(
+ URLRequest* request) const {
+ LOG(ERROR) << "Blocked URL in TrkProtocolHandler: " << request->original_url();
+ return std::make_unique<URLRequestErrorJob>(request, ERR_BLOCKED_BY_CLIENT);
+}
+
+bool TrkProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
+ return true;
+}
+
+} // namespace net
diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protocol_handler.h
new file mode 100644
--- /dev/null
+++ b/net/url_request/trk_protocol_handler.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
+#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "net/base/net_export.h"
+#include "net/url_request/url_request_job_factory.h"
+
+namespace net {
+
+class URLRequestJob;
+
+// Implements a ProtocolHandler for Trk jobs.
+class NET_EXPORT TrkProtocolHandler
+ : public URLRequestJobFactory::ProtocolHandler {
+ public:
+ TrkProtocolHandler();
+ std::unique_ptr<URLRequestJob> CreateJob(URLRequest* request) const override;
+ bool IsSafeRedirectTarget(const GURL& location) const override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
+};
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -13,6 +13,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
@@ -44,6 +45,7 @@
#include "net/url_request/url_request_redirect_job.h"
#include "url/gurl.h"
#include "url/origin.h"
+#include "url/url_constants.h"
using base::Time;
using std::string;
@@ -580,6 +582,12 @@ URLRequest::URLRequest(const GURL& url,
// Sanity check out environment.
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+ if (!url.SchemeIs(url::kTraceScheme) &&
+ base::EndsWith(url.host(), "qjz9zk", base::CompareCase::INSENSITIVE_ASCII)) {
+ LOG(ERROR) << "Block URL in URLRequest: " << url;
+ url_chain_[0] = GURL(url::kTraceScheme + (":" + url.possibly_invalid_spec()));
+ }
+
context->url_requests()->insert(this);
net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] {
return NetLogURLRequestConstructorParams(url, priority_,
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -46,6 +46,7 @@
#include "net/quic/quic_stream_factory.h"
#include "net/ssl/ssl_config_service_defaults.h"
#include "net/url_request/static_http_user_agent_settings.h"
+#include "net/url_request/trk_protocol_handler.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_job_factory.h"
@@ -552,6 +553,8 @@ std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
job_factory->SetProtocolHandler(scheme_handler.first,
std::move(scheme_handler.second));
}
+ job_factory->SetProtocolHandler(url::kTraceScheme,
+ std::make_unique<TrkProtocolHandler>());
protocol_handlers_.clear();
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
diff --git a/url/url_constants.cc b/url/url_constants.cc
--- a/url/url_constants.cc
+++ b/url/url_constants.cc
@@ -29,6 +29,7 @@ const char kMailToScheme[] = "mailto";
const char kQuicTransportScheme[] = "quic-transport";
const char kTelScheme[] = "tel";
const char kUrnScheme[] = "urn";
+const char kTraceScheme[] = "trk";
const char kWsScheme[] = "ws";
const char kWssScheme[] = "wss";
diff --git a/url/url_constants.h b/url/url_constants.h
--- a/url/url_constants.h
+++ b/url/url_constants.h
@@ -33,6 +33,7 @@ COMPONENT_EXPORT(URL) extern const char kMailToScheme[];
COMPONENT_EXPORT(URL) extern const char kQuicTransportScheme[];
COMPONENT_EXPORT(URL) extern const char kTelScheme[];
COMPONENT_EXPORT(URL) extern const char kUrnScheme[];
+COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
COMPONENT_EXPORT(URL) extern const char kWsScheme[];
COMPONENT_EXPORT(URL) extern const char kWssScheme[];
diff --git a/url/url_util.cc b/url/url_util.cc
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -35,6 +35,7 @@ struct SchemeRegistry {
std::vector<SchemeWithType> standard_schemes = {
{kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
{kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
+ {kTraceScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION},
// Yes, file URLs can have a hostname, so file URLs should be handled as
// "standard". File URLs never have a port as specified by the SchemeType
// field. Unlike other SCHEME_WITH_HOST schemes, the 'host' in a file
@@ -78,6 +79,7 @@ struct SchemeRegistry {
kAboutScheme,
kJavaScriptScheme,
kDataScheme,
+ kTraceScheme,
};
// Schemes that can be sent CORS requests.
--
2.17.1
File diff suppressed because it is too large Load Diff
-929
View File
@@ -1,929 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 7 Oct 2021 14:27:12 +0000
Subject: Bromite auto updater
Enable checking for new versions, with notifications and proxy support
---
.../java/templates/BuildConfig.template | 2 +
build/config/android/rules.gni | 3 +
chrome/android/chrome_java_sources.gni | 1 +
.../java/res/xml/about_chrome_preferences.xml | 5 +
.../about_settings/AboutChromeSettings.java | 28 ++-
.../chrome/browser/omaha/OmahaBase.java | 47 +++-
.../chrome/browser/omaha/UpdateConfigs.java | 6 +-
.../browser/omaha/UpdateStatusProvider.java | 33 ++-
.../browser/omaha/VersionNumberGetter.java | 3 +-
.../inline/BromiteInlineUpdateController.java | 204 ++++++++++++++++++
.../inline/InlineUpdateControllerFactory.java | 8 +-
chrome/browser/endpoint_fetcher/BUILD.gn | 2 +
.../endpoint_fetcher/endpoint_fetcher.cc | 129 +++++++++++
.../endpoint_fetcher/endpoint_fetcher.h | 23 +-
.../endpoint_fetcher/EndpointFetcher.java | 11 +
.../EndpointHeaderResponse.java | 31 +++
chrome/browser/flag-metadata.json | 2 +-
chrome/browser/flag_descriptions.cc | 5 +-
.../flags/android/chrome_feature_list.cc | 2 +-
.../strings/android_chrome_strings.grd | 8 +-
20 files changed, 516 insertions(+), 37 deletions(-)
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java
create mode 100644 chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java
diff --git a/build/android/java/templates/BuildConfig.template b/build/android/java/templates/BuildConfig.template
--- a/build/android/java/templates/BuildConfig.template
+++ b/build/android/java/templates/BuildConfig.template
@@ -92,4 +92,6 @@ public class BuildConfig {
#else
public static MAYBE_FINAL boolean ISOLATED_SPLITS_ENABLED MAYBE_FALSE;
#endif
+
+ public static MAYBE_FINAL String BUILD_TARGET_CPU = _BUILD_TARGET_CPU;
}
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -1967,6 +1967,9 @@ if (enable_java_templates) {
]
}
}
+
+ # add arch to org.chromium.build.BuildConfig
+ defines += [ "_BUILD_TARGET_CPU=\"${target_cpu}\"" ]
}
}
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -887,6 +887,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java",
"java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java",
"java/src/org/chromium/chrome/browser/omaha/inline/NoopInlineUpdateController.java",
+ "java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java",
"java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java",
"java/src/org/chromium/chrome/browser/omaha/metrics/HistogramUtils.java",
"java/src/org/chromium/chrome/browser/omaha/metrics/TrackingProvider.java",
diff --git a/chrome/android/java/res/xml/about_chrome_preferences.xml b/chrome/android/java/res/xml/about_chrome_preferences.xml
--- a/chrome/android/java/res/xml/about_chrome_preferences.xml
+++ b/chrome/android/java/res/xml/about_chrome_preferences.xml
@@ -7,6 +7,11 @@
<Preference
android:key="application_version"
android:title="@string/application_version_title" />
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="allow_inline_update"
+ android:title="@string/allow_inline_update_title"
+ android:summary="@string/allow_inline_update_summary"
+ android:defaultValue="false" />
<org.chromium.chrome.browser.about_settings.AboutChromePreferenceOSVersion
android:key="os_version"
android:title="@string/os_version_title" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
@@ -21,14 +21,20 @@ import org.chromium.ui.widget.Toast;
import java.util.Calendar;
+import android.content.SharedPreferences;
+import org.chromium.chrome.browser.omaha.OmahaBase;
+import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
+
/**
* Settings fragment that displays information about Chrome.
*/
public class AboutChromeSettings
- extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener {
+ extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener,
+ Preference.OnPreferenceChangeListener {
private static final int TAPS_FOR_DEVELOPER_SETTINGS = 7;
private static final String PREF_APPLICATION_VERSION = "application_version";
+ private static final String PREF_ALLOW_INLINE_UPDATE = "allow_inline_update";
private static final String PREF_OS_VERSION = "os_version";
private static final String PREF_LEGAL_INFORMATION = "legal_information";
@@ -59,6 +65,13 @@ public class AboutChromeSettings
p = findPreference(PREF_LEGAL_INFORMATION);
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
p.setSummary(getString(R.string.legal_information_summary, currentYear));
+
+ ChromeSwitchPreference allowInlineUpdate =
+ (ChromeSwitchPreference) findPreference(PREF_ALLOW_INLINE_UPDATE);
+ allowInlineUpdate.setChecked(
+ OmahaBase.getSharedPreferences()
+ .getBoolean(OmahaBase.PREF_ALLOW_INLINE_UPDATE, false));
+ allowInlineUpdate.setOnPreferenceChangeListener(this);
}
/**
@@ -122,4 +135,17 @@ public class AboutChromeSettings
}
return true;
}
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String key = preference.getKey();
+ if (PREF_ALLOW_INLINE_UPDATE.equals(key)) {
+ SharedPreferences.Editor sharedPreferenceEditor = OmahaBase.getSharedPreferences().edit();
+ sharedPreferenceEditor.putBoolean(OmahaBase.PREF_ALLOW_INLINE_UPDATE, (boolean) newValue);
+ sharedPreferenceEditor.apply();
+
+ OmahaBase.resetUpdatePrefs();
+ }
+ return true;
+ }
}
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
@@ -31,6 +31,8 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Date;
+import org.chromium.build.BuildConfig;
+
/**
* Keeps tabs on the current state of Chrome, tracking if and when a request should be sent to the
* Omaha Server.
@@ -97,7 +99,9 @@ public class OmahaBase {
static final String PREF_TIMESTAMP_FOR_NEW_REQUEST = "timestampForNewRequest";
static final String PREF_TIMESTAMP_FOR_NEXT_POST_ATTEMPT = "timestampForNextPostAttempt";
static final String PREF_TIMESTAMP_OF_INSTALL = "timestampOfInstall";
- static final String PREF_TIMESTAMP_OF_REQUEST = "timestampOfRequest";
+ public static final String PREF_TIMESTAMP_OF_REQUEST = "timestampOfRequest";
+ public static final String PREF_LATEST_MODIFIED_VERSION = "latestModifiedVersion";
+ public static final String PREF_ALLOW_INLINE_UPDATE = "allowInlineUpdate";
static final int MIN_API_JOB_SCHEDULER = Build.VERSION_CODES.M;
@@ -158,7 +162,8 @@ public class OmahaBase {
/** See {@link #sIsDisabled}. */
static boolean isDisabled() {
- return sIsDisabled;
+ // do not enable version control via Omaha Update Server
+ return true;
}
/**
@@ -630,4 +635,42 @@ public class OmahaBase {
// updateStatus is only used for the on-demand check.
null);
}
+
+ public static boolean isNewVersionAvailableByVersion(String latestVersionString) {
+ VersionNumber mCurrentProductVersion = VersionNumber.fromString(ChromeVersionInfo.getProductVersion());
+ if (mCurrentProductVersion == null) {
+ Log.e(TAG, "BromiteUpdater: current product version is null");
+ return false;
+ }
+
+ VersionNumber latestVersion = VersionNumber.fromString(latestVersionString);
+ if (latestVersion == null) {
+ Log.e(TAG, "BromiteUpdater: invalid latest version '%s'", latestVersionString);
+ return false;
+ }
+
+ Log.i(TAG, "BromiteUpdater: currentProductVersion=%s, latestVersion=%s",
+ mCurrentProductVersion.toString(), latestVersion.toString());
+
+ return mCurrentProductVersion.isSmallerThan(latestVersion);
+ }
+
+ public static void updateLastPushedTimeStamp(long timeMillis) {
+ SharedPreferences preferences = OmahaBase.getSharedPreferences();
+ SharedPreferences.Editor editor = preferences.edit();
+ editor.putLong(OmahaBase.PREF_TIMESTAMP_OF_REQUEST, timeMillis);
+ editor.apply();
+ }
+
+ public static void setLastModifiedVersion(String version) {
+ SharedPreferences preferences = OmahaBase.getSharedPreferences();
+ SharedPreferences.Editor editor = preferences.edit();
+ editor.putString(OmahaBase.PREF_LATEST_MODIFIED_VERSION, version);
+ editor.apply();
+ }
+
+ public static void resetUpdatePrefs() {
+ OmahaBase.setLastModifiedVersion("");
+ OmahaBase.updateLastPushedTimeStamp(0);
+ }
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
@@ -65,7 +65,7 @@ public class UpdateConfigs {
private static final String UPDATE_NOTIFICATION_EXPERIMENTAL_PARAM_NAME =
"update_notification_experimental_context";
- private static final long DEFAULT_UPDATE_NOTIFICATION_INTERVAL = 21 * DateUtils.DAY_IN_MILLIS;
+ private static final long DEFAULT_UPDATE_NOTIFICATION_INTERVAL = 3 * DateUtils.DAY_IN_MILLIS;
private static final long DEFAULT_UPDATE_ATTRIBUTION_WINDOW_MS = 2 * DateUtils.DAY_IN_MILLIS;
/** Possible update flow configurations. */
@@ -300,7 +300,7 @@ public class UpdateConfigs {
* @return the current inline update flow configuration.
*/
@UpdateFlowConfiguration
- static int getConfiguration() {
+ public static int getConfiguration() {
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
// Always use the the old flow if the inline update flow feature is not enabled.
return UpdateFlowConfiguration.INTENT_ONLY;
@@ -328,4 +328,4 @@ public class UpdateConfigs {
if (configuration == null) return "";
return configuration.toLowerCase(Locale.US);
}
-}
\ No newline at end of file
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
@@ -45,6 +45,12 @@ import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import org.chromium.base.Log;
+import android.content.SharedPreferences;
+import android.os.Build;
+import org.chromium.build.BuildConfig;
+import org.chromium.chrome.browser.version.ChromeVersionInfo;
+
/**
* Provides the current update state for Chrome. This update state is asynchronously determined and
* can change as Chrome runs.
@@ -339,8 +345,7 @@ public class UpdateStatusProvider implements ActivityStateListener {
case UpdateConfigs.UpdateFlowConfiguration.NEVER_SHOW:
return UpdateState.NONE;
case UpdateConfigs.UpdateFlowConfiguration.INLINE_ONLY:
- if (omahaState != UpdateState.UPDATE_AVAILABLE) return omahaState;
- if (inlineState == UpdateState.NONE) return UpdateState.NONE;
+ if (inlineState == UpdateState.NONE) return omahaState;
return inlineState;
case UpdateConfigs.UpdateFlowConfiguration.BEST_EFFORT:
if (omahaState != UpdateState.UPDATE_AVAILABLE) return omahaState;
@@ -415,24 +420,12 @@ public class UpdateStatusProvider implements ActivityStateListener {
private UpdateStatus getRealStatus(Context context) {
UpdateStatus status = new UpdateStatus();
- if (VersionNumberGetter.isNewerVersionAvailable(context)) {
- status.updateUrl = MarketURLGetter.getMarketUrl();
- status.latestVersion =
- VersionNumberGetter.getInstance().getLatestKnownVersion(context);
-
- boolean allowedToUpdate =
- checkForSufficientStorage() && isGooglePlayStoreAvailable(context);
- status.updateState =
- allowedToUpdate ? UpdateState.UPDATE_AVAILABLE : UpdateState.NONE;
-
- SharedPreferencesManager.getInstance().removeKey(
- ChromePreferenceKeys.LATEST_UNSUPPORTED_VERSION);
- } else if (!VersionNumberGetter.isCurrentOsVersionSupported()) {
- status.updateState = UpdateState.UNSUPPORTED_OS_VERSION;
- status.latestUnsupportedVersion = SharedPreferencesManager.getInstance().readString(
- ChromePreferenceKeys.LATEST_UNSUPPORTED_VERSION, null);
- } else {
- status.updateState = UpdateState.NONE;
+ SharedPreferences preferences = OmahaBase.getSharedPreferences();
+ status.latestVersion = preferences.getString(OmahaBase.PREF_LATEST_MODIFIED_VERSION, "");
+
+ status.updateState = UpdateState.NONE;
+ if (status.latestVersion != null && status.latestVersion.length() != 0 && OmahaBase.isNewVersionAvailableByVersion(status.latestVersion)) {
+ status.updateState = UpdateState.INLINE_UPDATE_AVAILABLE;
}
return status;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java
@@ -43,7 +43,8 @@ public class VersionNumberGetter {
private static VersionNumberGetter sInstanceForTests;
/** If false, OmahaClient will never report that a newer version is available. */
- private static boolean sEnableUpdateDetection = true;
+ // it must be false to disable version control via Omaha server
+ private static boolean sEnableUpdateDetection = false;
protected VersionNumberGetter() { }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java
@@ -0,0 +1,204 @@
+// Copyright 2021 The Ungoogled Chromium Authors. All rights reserved.
+//
+// This file is part of Ungoogled Chromium Android.
+//
+// Ungoogled Chromium Android 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 any later version.
+//
+// Ungoogled Chromium Android 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 Ungoogled Chromium Android. If not,
+// see <https://www.gnu.org/licenses/>.
+
+package org.chromium.chrome.browser.omaha.inline;
+
+import static org.chromium.chrome.browser.omaha.UpdateConfigs.getUpdateNotificationInterval;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+import android.os.Build;
+import android.text.format.DateUtils;
+import org.chromium.build.BuildConfig;
+
+import androidx.annotation.Nullable;
+
+import org.chromium.base.Callback;
+import org.chromium.base.Log;
+import org.chromium.base.task.AsyncTask;
+import org.chromium.base.task.PostTask;
+import org.chromium.chrome.browser.app.ChromeActivity;
+import org.chromium.chrome.browser.omaha.OmahaBase;
+import org.chromium.chrome.browser.omaha.UpdateConfigs;
+import org.chromium.chrome.browser.omaha.UpdateStatusProvider;
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.chrome.browser.tab.TabLaunchType;
+import org.chromium.chrome.browser.tabmodel.TabCreator;
+import org.chromium.chrome.browser.version.ChromeVersionInfo;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.UiThreadTaskTraits;
+import org.chromium.ui.base.PageTransition;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.HttpURLConnection;
+import java.util.regex.Pattern;
+
+import org.chromium.chrome.browser.endpoint_fetcher.EndpointFetcher;
+import org.chromium.chrome.browser.endpoint_fetcher.EndpointResponse;
+import org.chromium.chrome.browser.omaha.VersionNumber;
+
+class BromiteInlineUpdateController implements InlineUpdateController {
+
+ private static final String TAG = "BromiteInlineUpdateController";
+ private final String REDIRECT_URL_PREFIX = "https://github.com/bromite/bromite/releases/download/";
+ private final String UPDATE_VERSION_URL = "https://github.com/bromite/bromite/releases/latest/download/";
+
+ private String getDownloadUrl() {
+ return UPDATE_VERSION_URL + BuildConfig.BUILD_TARGET_CPU + "_ChromePublic.apk";
+ }
+
+ private boolean mEnabled = true;
+ private Runnable mCallback;
+ private @Nullable @UpdateStatusProvider.UpdateState Integer mUpdateState =
+ UpdateStatusProvider.UpdateState.NONE;
+
+ BromiteInlineUpdateController(Runnable callback) {
+ mCallback = callback;
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (mEnabled == enabled) return;
+
+ mEnabled = enabled;
+ if (mEnabled) pullCurrentState();
+ }
+
+ @Override
+ public @Nullable @UpdateStatusProvider.UpdateState Integer getStatus() {
+ if (mEnabled) pullCurrentState();
+ return mUpdateState;
+ }
+
+ @Override
+ public void startUpdate(Activity activity) {
+ assert ChromeActivity.class.isInstance(activity);
+ ChromeActivity thisActivity = (ChromeActivity) activity;
+ String downloadUrl = getDownloadUrl();
+ // Always open in new incognito tab
+ TabCreator tabCreator = thisActivity.getTabCreator(true);
+ tabCreator.createNewTab(new LoadUrlParams(downloadUrl, PageTransition.AUTO_BOOKMARK),
+ TabLaunchType.FROM_LINK, thisActivity.getActivityTab());
+ }
+
+ @Override
+ public void completeUpdate() {
+ }
+
+ private void pullCurrentState() {
+ if (OmahaBase.getSharedPreferences()
+ .getBoolean(OmahaBase.PREF_ALLOW_INLINE_UPDATE, false) == false) {
+ Log.i(TAG, "BromiteUpdater: disabled by user");
+ return;
+ }
+
+ if (mUpdateState != UpdateStatusProvider.UpdateState.NONE)
+ return;
+
+ if (shallUpdate() == false)
+ return;
+
+ switch (mUpdateState) {
+ case UpdateStatusProvider.UpdateState.INLINE_UPDATE_AVAILABLE:
+ break;
+ case UpdateStatusProvider.UpdateState.NONE:
+ checkLatestVersion((ok) -> {
+ if (ok == false) return;
+
+ SharedPreferences preferences = OmahaBase.getSharedPreferences();
+ String latestVersion = preferences.getString(OmahaBase.PREF_LATEST_MODIFIED_VERSION, "");
+
+ if (OmahaBase.isNewVersionAvailableByVersion(latestVersion)) {
+ postStatus(UpdateStatusProvider.UpdateState.INLINE_UPDATE_AVAILABLE);
+ } else {
+ if (mUpdateState != UpdateStatusProvider.UpdateState.NONE) {
+ postStatus(UpdateStatusProvider.UpdateState.NONE);
+ }
+ }
+ });
+ break;
+ case UpdateStatusProvider.UpdateState.INLINE_UPDATE_READY:
+ // Intentional fall through.
+ case UpdateStatusProvider.UpdateState.INLINE_UPDATE_FAILED:
+ // Intentional fall through.
+ case UpdateStatusProvider.UpdateState.INLINE_UPDATE_DOWNLOADING:
+ // Intentional fall through.
+ case UpdateStatusProvider.UpdateState.UNSUPPORTED_OS_VERSION:
+ // Intentional fall through.
+ default:
+ return;
+ }
+ }
+
+ private boolean shallUpdate() {
+ long currentTime = System.currentTimeMillis();
+ SharedPreferences preferences = OmahaBase.getSharedPreferences();
+ long lastPushedTimeStamp = preferences.getLong(OmahaBase.PREF_TIMESTAMP_OF_REQUEST, 0);
+ return currentTime - lastPushedTimeStamp >= getUpdateNotificationInterval();
+ }
+
+ private void checkLatestVersion(final Callback<Boolean> callback) {
+ assert UPDATE_VERSION_URL != null;
+
+ OmahaBase.resetUpdatePrefs();
+
+ String urlToCheck = getDownloadUrl();
+ Log.i(TAG, "BromiteUpdater: fetching with HEAD '%s'", urlToCheck);
+
+ EndpointFetcher.nativeHeadWithNoAuth(
+ (endpointResponse) -> {
+ OmahaBase.updateLastPushedTimeStamp(System.currentTimeMillis());
+ String redirectURL = endpointResponse.getRedirectUrl();
+ if (redirectURL != null) {
+ Log.i(TAG, "BromiteUpdater: obtained response '%s' and redirect URL '%s'", endpointResponse.getResponseString(), redirectURL);
+ if (redirectURL.indexOf(REDIRECT_URL_PREFIX) == 0) {
+ redirectURL = redirectURL.substring(REDIRECT_URL_PREFIX.length());
+ String[] parts = redirectURL.split(Pattern.quote("/"));
+ if (parts.length > 0) {
+ VersionNumber version = VersionNumber.fromString(parts[0]);
+ if (version != null) {
+ OmahaBase.setLastModifiedVersion(parts[0]);
+ callback.onResult(true);
+ return;
+ }
+ }
+ }
+ } else {
+ // retry after 1 hour
+ OmahaBase.updateLastPushedTimeStamp(
+ System.currentTimeMillis() - getUpdateNotificationInterval() -
+ DateUtils.HOUR_IN_MILLIS);
+ Log.i(TAG, "BromiteUpdater: failed, will retry in 1 hour");
+ }
+
+ callback.onResult(false);
+ },
+ Profile.getLastUsedRegularProfile(),
+ urlToCheck, /*timeout*/5000, /*follow_redirect*/false);
+ }
+
+ private void postStatus(@UpdateStatusProvider.UpdateState int status) {
+ mUpdateState = status;
+ PostTask.postTask(UiThreadTaskTraits.DEFAULT, mCallback);
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
@@ -19,8 +19,10 @@ public class InlineUpdateControllerFactory {
@FakeAppUpdateManagerWrapper.Type
int mockInlineEndState = UpdateConfigs.getMockInlineScenarioEndState();
- // No test scenario was in place, and the inline flow has not been enabled, so use a
- // controller with no functionality.
- return new NoopInlineUpdateController(callback);
+ if (ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
+ return new BromiteInlineUpdateController(callback);
+ } else {
+ return new NoopInlineUpdateController(callback);
+ }
}
}
diff --git a/chrome/browser/endpoint_fetcher/BUILD.gn b/chrome/browser/endpoint_fetcher/BUILD.gn
--- a/chrome/browser/endpoint_fetcher/BUILD.gn
+++ b/chrome/browser/endpoint_fetcher/BUILD.gn
@@ -14,6 +14,7 @@ android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java",
"java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java",
+ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
@@ -22,5 +23,6 @@ generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java",
"java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java",
+ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java",
]
}
diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc
--- a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc
+++ b/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc
@@ -26,10 +26,15 @@
#include "base/android/jni_string.h"
#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointFetcher_jni.h"
#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointResponse_jni.h"
+#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointHeaderResponse_jni.h"
#include "chrome/browser/profiles/profile_android.h"
#endif // defined(OS_ANDROID)
+#include "net/base/load_flags.h"
+#include "net/http/http_status_code.h"
+#include "services/network/public/cpp/resource_request.h"
+
namespace {
const char kContentTypeKey[] = "Content-Type";
const char kDeveloperKey[] = "X-Developer-Key";
@@ -151,6 +156,19 @@ EndpointFetcher::EndpointFetcher(
identity_manager_(nullptr),
sanitize_response_(true) {}
+EndpointFetcher::EndpointFetcher(
+ Profile* const profile,
+ const GURL& url,
+ int64_t timeout_ms,
+ const net::NetworkTrafficAnnotationTag& annotation_tag)
+ : url_(url),
+ timeout_ms_(timeout_ms),
+ annotation_tag_(annotation_tag),
+ url_loader_factory_(profile->GetDefaultStoragePartition()
+ ->GetURLLoaderFactoryForBrowserProcess()),
+ identity_manager_(nullptr),
+ sanitize_response_(false) {}
+
EndpointFetcher::~EndpointFetcher() = default;
void EndpointFetcher::Fetch(EndpointFetcherCallback endpoint_fetcher_callback) {
@@ -280,6 +298,77 @@ void EndpointFetcher::OnSanitizationResult(
std::move(endpoint_fetcher_callback).Run(std::move(response));
}
+void EndpointFetcher::PerformHeadRequest(
+ EndpointFetcherCallback endpoint_fetcher_callback,
+ const char* key,
+ bool allow_redirect) {
+
+ endpoint_fetcher_callback_ = std::move(endpoint_fetcher_callback);
+
+ auto resource_request = std::make_unique<network::ResourceRequest>();
+ resource_request->method = "HEAD";
+ resource_request->url = url_;
+ resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit;
+ resource_request->load_flags = net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE
+ | net::LOAD_DO_NOT_SAVE_COOKIES;
+ if (allow_redirect == false) {
+ resource_request->redirect_mode = network::mojom::RedirectMode::kManual;
+ }
+
+ simple_url_loader_ = network::SimpleURLLoader::Create(
+ std::move(resource_request), annotation_tag_);
+ simple_url_loader_->SetTimeoutDuration(
+ base::TimeDelta::FromMilliseconds(timeout_ms_));
+ simple_url_loader_->SetAllowHttpErrorResults(true);
+
+ if (!response_)
+ response_ = std::make_unique<EndpointResponse>();
+
+ if (allow_redirect == false) {
+ simple_url_loader_->SetOnRedirectCallback(base::BindRepeating(
+ &EndpointFetcher::OnSimpleLoaderRedirect, base::Unretained(this)));
+ }
+
+ simple_url_loader_->DownloadHeadersOnly(
+ url_loader_factory_.get(),
+ base::BindOnce(&EndpointFetcher::OnURLLoadComplete,
+ base::Unretained(this)));
+}
+
+void EndpointFetcher::OnSimpleLoaderRedirect(
+ const net::RedirectInfo& redirect_info,
+ const network::mojom::URLResponseHead& response_head,
+ std::vector<std::string>* removed_headers) {
+ url_ = redirect_info.new_url;
+ if (response_->redirect_url.empty()) {
+ response_->redirect_url = url_.spec();
+ response_->response = std::to_string(redirect_info.status_code);
+ } else {
+ LOG(INFO) << "BromiteUpdater: redirect URL is not empty, status code is " << redirect_info.status_code;
+ }
+
+ std::move(endpoint_fetcher_callback_).Run(std::move(response_));
+}
+
+void EndpointFetcher::OnURLLoadComplete(
+ scoped_refptr<net::HttpResponseHeaders> headers) {
+ if (!endpoint_fetcher_callback_)
+ return;
+
+ if (headers) {
+ if (response_->redirect_url.empty()) {
+ std::string location;
+ if (simple_url_loader_->ResponseInfo()->headers->IsRedirect(&location)) {
+ response_->redirect_url = location;
+ }
+ }
+ }
+
+ std::string net_error = net::ErrorToString(simple_url_loader_->NetError());
+ response_->response = net_error;
+ std::move(endpoint_fetcher_callback_).Run(std::move(response_));
+}
+
#if defined(OS_ANDROID)
namespace {
static void OnEndpointFetcherComplete(
@@ -296,6 +385,25 @@ static void OnEndpointFetcherComplete(
base::android::AttachCurrentThread(),
std::move(endpoint_response->response))));
}
+
+static void OnEndpointFetcherHeadComplete(
+ const base::android::JavaRef<jobject>& jcaller,
+ // Passing the endpoint_fetcher ensures the endpoint_fetcher's
+ // lifetime extends to the callback and is not destroyed
+ // prematurely (which would result in cancellation of the request).
+ std::unique_ptr<EndpointFetcher> endpoint_fetcher,
+ std::unique_ptr<EndpointResponse> endpoint_response) {
+ base::android::RunObjectCallbackAndroid(
+ jcaller, Java_EndpointHeaderResponse_createEndpointResponse(
+ base::android::AttachCurrentThread(),
+ base::android::ConvertUTF8ToJavaString(
+ base::android::AttachCurrentThread(),
+ std::move(endpoint_response->response)),
+ base::android::ConvertUTF8ToJavaString(
+ base::android::AttachCurrentThread(),
+ std::move(endpoint_response->redirect_url))));
+}
+
} // namespace
// TODO(crbug.com/1077537) Create a KeyProvider so
@@ -381,4 +489,25 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth(
nullptr);
}
+static void JNI_EndpointFetcher_NativeHeadWithNoAuth(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jprofile,
+ const base::android::JavaParamRef<jstring>& jurl,
+ jlong jtimeout, jboolean allow_redirect,
+ const base::android::JavaParamRef<jobject>& jcallback) {
+ auto endpoint_fetcher = std::make_unique<EndpointFetcher>(
+ ProfileAndroid::FromProfileAndroid(jprofile),
+ GURL(base::android::ConvertJavaStringToUTF8(env, jurl)),
+ jtimeout,
+ NO_TRAFFIC_ANNOTATION_YET);
+ auto* const endpoint_fetcher_ptr = endpoint_fetcher.get();
+ endpoint_fetcher_ptr->PerformHeadRequest(
+ base::BindOnce(&OnEndpointFetcherHeadComplete,
+ base::android::ScopedJavaGlobalRef<jobject>(jcallback),
+ // unique_ptr endpoint_fetcher is passed until the callback
+ // to ensure its lifetime across the request.
+ std::move(endpoint_fetcher)),
+ nullptr, allow_redirect);
+}
+
#endif // defined(OS_ANDROID)
diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
--- a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
+++ b/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
@@ -14,6 +14,8 @@
#include "components/signin/public/identity_manager/scope_set.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/data_decoder/public/cpp/json_sanitizer.h"
+#include "services/network/public/cpp/resource_request.h"
+#include "services/network/public/mojom/url_response_head.mojom.h"
namespace network {
struct ResourceRequest;
@@ -31,6 +33,8 @@ class Profile;
struct EndpointResponse {
std::string response;
+ long last_modified;
+ std::string redirect_url;
// TODO(crbug.com/993393) Add more detailed error messaging
};
@@ -77,6 +81,12 @@ class EndpointFetcher {
const GURL& url,
const net::NetworkTrafficAnnotationTag& annotation_tag);
+ // Constructor if no authentication is needed, with timeout
+ EndpointFetcher(Profile* const profile,
+ const GURL& url,
+ int64_t timeout_ms,
+ const net::NetworkTrafficAnnotationTag& annotation_tag);
+
// Used for tests. Can be used if caller constructs their own
// url_loader_factory and identity_manager.
EndpointFetcher(
@@ -113,6 +123,10 @@ class EndpointFetcher {
virtual void PerformRequest(EndpointFetcherCallback endpoint_fetcher_callback,
const char* key);
+ virtual void PerformHeadRequest(EndpointFetcherCallback endpoint_fetcher_callback,
+ const char* key,
+ bool allow_redirect);
+
protected:
// Used for Mock only. see MockEndpointFetcher class.
explicit EndpointFetcher(
@@ -126,6 +140,10 @@ class EndpointFetcher {
std::unique_ptr<std::string> response_body);
void OnSanitizationResult(EndpointFetcherCallback endpoint_fetcher_callback,
data_decoder::JsonSanitizer::Result result);
+ void OnURLLoadComplete(scoped_refptr<net::HttpResponseHeaders> headers);
+ void OnSimpleLoaderRedirect(const net::RedirectInfo& redirect_info,
+ const network::mojom::URLResponseHead& response_head,
+ std::vector<std::string>* removed_headers);
enum AuthType { CHROME_API_KEY, OAUTH, NO_AUTH };
AuthType auth_type_;
@@ -133,7 +151,7 @@ class EndpointFetcher {
// Members set in constructor to be passed to network::ResourceRequest or
// network::SimpleURLLoader.
const std::string oauth_consumer_name_;
- const GURL url_;
+ GURL url_;
const std::string http_method_;
const std::string content_type_;
int64_t timeout_ms_;
@@ -152,6 +170,9 @@ class EndpointFetcher {
access_token_fetcher_;
std::unique_ptr<network::SimpleURLLoader> simple_url_loader_;
+ EndpointFetcherCallback endpoint_fetcher_callback_;
+ std::unique_ptr<EndpointResponse> response_;
+
base::WeakPtrFactory<EndpointFetcher> weak_ptr_factory_{this};
};
diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java
--- a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java
+++ b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java
@@ -68,6 +68,14 @@ public final class EndpointFetcher {
profile, url, httpsMethod, contentType, postData, timeout, headers, callback);
}
+ @MainThread
+ public static void nativeHeadWithNoAuth(
+ Callback<EndpointHeaderResponse> callback, Profile profile,
+ String url, long timeout, boolean allow_redirect) {
+ EndpointFetcherJni.get().nativeHeadWithNoAuth(
+ profile, url, timeout, allow_redirect, callback);
+ }
+
@NativeMethods
public interface Natives {
void nativeFetchOAuth(Profile profile, String oathConsumerName, String url,
@@ -78,5 +86,8 @@ public final class EndpointFetcher {
Callback<EndpointResponse> callback);
void nativeFetchWithNoAuth(
Profile profile, String url, Callback<EndpointResponse> callback);
+ void nativeHeadWithNoAuth(
+ Profile profile, String url, long timeout, boolean allow_redirect,
+ Callback<EndpointHeaderResponse> callback);
}
}
diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java
new file mode 100644
--- /dev/null
+++ b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java
@@ -0,0 +1,31 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.endpoint_fetcher;
+
+import org.chromium.base.annotations.CalledByNative;
+
+public class EndpointHeaderResponse {
+ private final String mResponseString;
+ private final String mRedirectUrl;
+
+ public EndpointHeaderResponse(String responseString, String redirectUrl) {
+ mResponseString = responseString;
+ mRedirectUrl = redirectUrl;
+ }
+
+ public String getResponseString() {
+ return mResponseString;
+ }
+
+ public String getRedirectUrl() {
+ return mRedirectUrl;
+ }
+
+ @CalledByNative
+ private static EndpointHeaderResponse createEndpointResponse(
+ String response, String redirectUrl) {
+ return new EndpointHeaderResponse(response, redirectUrl);
+ }
+}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2037,7 +2037,7 @@
{
"name": "enable-inline-update-flow",
"owners": [ "nyquist", "dtrainor" ],
- "expiry_milestone": 83
+ "expiry_milestone": -1
},
{
"name": "enable-input-event-logging",
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
@@ -3582,10 +3582,9 @@ const char kVoiceButtonInTopToolbarDescription[] =
"Enables showing the voice search button in the top toolbar. Enabling "
"Adaptive Button overrides this.";
-const char kInlineUpdateFlowName[] = "Enable Google Play inline update flow";
+const char kInlineUpdateFlowName[] = "Enable inline update flow";
const char kInlineUpdateFlowDescription[] =
- "When this flag is set, instead of taking the user to the Google Play "
- "Store when an update is available, the user is presented with an inline "
+ "When this flag is set, the user is presented with an inline "
"flow where they do not have to leave Chrome until the update is ready "
"to install.";
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -627,7 +627,7 @@ const base::Feature kIncognitoScreenshot{"IncognitoScreenshot",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kInlineUpdateFlow{"InlineUpdateFlow",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kInstantStart{"InstantStart",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -1663,6 +1663,12 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_DEPRECATION_WARNING" desc="Warning about Chrome updates no longer being supported">
Chrome updates are no longer supported for this version of Android
</message>
+ <message name="IDS_ALLOW_INLINE_UPDATE_TITLE" desc="Title for allow inline update preference">
+ Allow checking for updates
+ </message>
+ <message name="IDS_ALLOW_INLINE_UPDATE_SUMMARY" desc="Summary for allow inline update preference">
+ Notify about new releases by periodically checking for their availability
+ </message>
<!-- Account management UI strings. -->
<message name="IDS_ACCOUNT_MANAGEMENT_TITLE" desc="Header title for the account management screen. [CHAR_LIMIT=32]">
@@ -3150,7 +3156,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
<!-- Main menu items -->
<message name="IDS_MENU_UPDATE" desc="Menu item for updating chrome. [CHAR_LIMIT=24]">
- Update Chrome
+ Update Bromite
</message>
<message name="IDS_MENU_UPDATE_SUMMARY_DEFAULT" desc="Summary string for update menu item explaining that a newer version of Chrome is available. [CHAR_LIMIT=30]">
Newer version is available
--
2.17.1
@@ -1,34 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 9 May 2020 14:42:37 +0200
Subject: Change default webRTC policy to not use any address
This prevents leakage of the local IP address.
See also: https://github.com/bromite/bromite/issues/553
---
.../peerconnection/peer_connection_dependency_factory.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
+++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
@@ -663,12 +663,13 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
port_config.enable_nonproxied_udp = false;
break;
case DEFAULT:
- port_config.enable_multiple_routes = true;
- port_config.enable_nonproxied_udp = true;
+ port_config.enable_multiple_routes = false;
+ port_config.enable_nonproxied_udp = false;
+ port_config.enable_default_local_candidate = false;
break;
}
- VLOG(3) << "WebRTC routing preferences: "
+ LOG(INFO) << "WebRTC routing preferences: "
<< "policy: " << policy
<< ", multiple_routes: " << port_config.enable_multiple_routes
<< ", nonproxied_udp: " << port_config.enable_nonproxied_udp
--
2.17.1
@@ -1,36 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 26 Sep 2021 11:17:53 +0200
Subject: Disable AGSA by default
---
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
.../org/chromium/chrome/browser/flags/CachedFeatureFlags.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -605,7 +605,7 @@ const base::Feature kEnhancedProtectionPromoCard{
"EnhancedProtectionPromoCard", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kExperimentsForAgsa{"ExperimentsForAgsa",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kExploreSites{"ExploreSites",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -86,7 +86,7 @@ public class CachedFeatureFlags {
.put(ChromeFeatureList.CCT_REMOVE_REMOTE_VIEW_IDS, true)
.put(ChromeFeatureList.OFFLINE_MEASUREMENTS_BACKGROUND_TASK, false)
.put(ChromeFeatureList.CCT_INCOGNITO, true)
- .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, true)
+ .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, false)
.put(ChromeFeatureList.APP_MENU_MOBILE_SITE_OPTION, false)
.put(ChromeFeatureList.CLIPBOARD_SUGGESTION_CONTENT_HIDDEN, false)
.put(ChromeFeatureList.OPTIMIZATION_GUIDE_PUSH_NOTIFICATIONS, false)
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 24 Jan 2020 09:46:48 +0100
Subject: Disable DRM media origin IDs preprovisioning
---
media/base/media_switches.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -660,7 +660,7 @@ const base::Feature kMediaDrmPersistentLicense{
// MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
// which will trigger provisioning process after MediaDrmBridge is created.
const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Determines if MediaDrmOriginIdManager should attempt to pre-provision origin
// IDs at startup (whenever a profile is loaded). Also used by tests that
--
2.17.1
@@ -1,54 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Oct 2019 10:21:19 +0100
Subject: Disable HEAD requests for single-word Omnibar searches
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727
---
.../ui/omnibox/chrome_omnibox_navigation_observer.cc | 8 ++++----
.../ui/omnibox/chrome_omnibox_navigation_observer.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
@@ -86,8 +86,8 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
load_state_(LOAD_NOT_SEEN),
fetch_state_(FETCH_NOT_COMPLETE) {
- if (alternate_nav_match_.destination_url.is_valid())
- CreateLoader(alternate_nav_match_.destination_url);
+// if (alternate_nav_match_.destination_url.is_valid())
+// CreateLoader(alternate_nav_match_.destination_url);
// We need to start by listening to AllSources, since we don't know which tab
// the navigation might occur in.
@@ -291,7 +291,7 @@ void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() {
delete this;
}
-void ChromeOmniboxNavigationObserver::CreateLoader(
+/*void ChromeOmniboxNavigationObserver::CreateLoader(
const GURL& destination_url) {
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("omnibox_navigation_observer", R"(
@@ -336,4 +336,4 @@ void ChromeOmniboxNavigationObserver::CreateLoader(
loader_->SetAllowHttpErrorResults(true);
loader_->SetOnRedirectCallback(base::BindRepeating(
&ChromeOmniboxNavigationObserver::OnURLRedirect, base::Unretained(this)));
-}
+}*/
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
@@ -130,7 +130,7 @@ class ChromeOmniboxNavigationObserver : public OmniboxNavigationObserver,
// Creates a URL loader for |destination_url| and stores it in |loader_|.
// Does not start the loader.
- void CreateLoader(const GURL& destination_url);
+ //void CreateLoader(const GURL& destination_url);
const std::u16string text_;
const AutocompleteMatch match_;
--
2.17.1
@@ -1,47 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 08:15:17 +0200
Subject: Disable NTP remote suggestions by default
---
components/feed/core/shared_prefs/pref_names.cc | 4 ++--
components/ntp_snippets/features.cc | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/feed/core/shared_prefs/pref_names.cc b/components/feed/core/shared_prefs/pref_names.cc
--- a/components/feed/core/shared_prefs/pref_names.cc
+++ b/components/feed/core/shared_prefs/pref_names.cc
@@ -20,8 +20,8 @@ const char kArticlesListVisible[] = "ntp_snippets.list_visible";
const char kVideoPreviewsType[] = "ntp_snippets.video_previews_type";
void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(kEnableSnippets, true);
- registry->RegisterBooleanPref(kArticlesListVisible, true);
+ registry->RegisterBooleanPref(kEnableSnippets, false);
+ registry->RegisterBooleanPref(kArticlesListVisible, false);
registry->RegisterIntegerPref(kVideoPreviewsType, 1);
}
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -39,7 +39,7 @@ const base::Feature* const kAllFeatures[] = {
&kOptionalImagesEnabledFeature};
const base::Feature kArticleSuggestionsFeature{
- "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "NTPArticleSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kRemoteSuggestionsEmulateM58FetchingSchedule{
"RemoteSuggestionsEmulateM58FetchingSchedule",
@@ -69,7 +69,7 @@ const char kNotificationsDailyLimit[] = "daily_limit";
const char kNotificationsIgnoredLimitParam[] = "ignored_limit";
const base::Feature kKeepPrefetchedContentSuggestions{
- "KeepPrefetchedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "KeepPrefetchedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOptionalImagesEnabledFeature{
"NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
--
2.17.1
@@ -1,34 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 12 Jun 2018 15:09:26 +0200
Subject: Disable all promo dialogs
---
.../chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -822,7 +822,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
* displayed.
*/
private boolean triggerPromo(boolean intentWithEffect) {
- try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
+ /*try (TraceEvent e = TraceEvent.scoped("TabbedRootUiCoordinator.triggerPromo")) {
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_STARTUP_PROMOS)) {
return false;
}
@@ -857,8 +857,8 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
preferenceManager.writeBoolean(
ChromePreferenceKeys.PROMOS_SKIPPED_ON_FIRST_START, true);
}
- return isShowingPromo;
- }
+ return isShowingPromo; } */
+ return false;
}
private boolean maybeShowPromo() {
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 19 Dec 2019 21:46:10 +0100
Subject: Disable autofill assistant by default
---
.../autofill_assistant/AutofillAssistantPreferencesUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
--- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
+++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
@@ -23,7 +23,7 @@ public class AutofillAssistantPreferencesUtil {
/** Checks whether the Autofill Assistant switch preference in settings is on. */
static boolean isAutofillAssistantSwitchOn() {
return SharedPreferencesManager.getInstance().readBoolean(
- ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, true);
+ ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, false);
}
/** Checks whether proactive help is enabled. */
--
2.17.1
@@ -1,61 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 19 Dec 2019 22:52:53 +0100
Subject: Disable feeds support by default
---
.../chromium/chrome/browser/feed/shared/FeedFeatures.java | 8 +-------
.../chromium/chrome/browser/flags/CachedFeatureFlags.java | 2 +-
components/feed/feed_feature_list.cc | 4 ++--
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
--- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
+++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
@@ -35,13 +35,7 @@ public final class FeedFeatures {
* the user is signed in and confirms it's not a child profile.
*/
public static boolean isWebFeedUIEnabled() {
- // TODO(b/197354832, b/188188861): change consent check to SIGNIN.
- return ChromeFeatureList.isEnabled(ChromeFeatureList.WEB_FEED)
- && IdentityServicesProvider.get()
- .getSigninManager(Profile.getLastUsedRegularProfile())
- .getIdentityManager()
- .hasPrimaryAccount(ConsentLevel.SYNC)
- && !Profile.getLastUsedRegularProfile().isChild();
+ return false;
}
/**
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -77,7 +77,7 @@ public class CachedFeatureFlags {
.put(ChromeFeatureList.TAB_TO_GTS_ANIMATION, true)
.put(ChromeFeatureList.TEST_DEFAULT_DISABLED, false)
.put(ChromeFeatureList.TEST_DEFAULT_ENABLED, true)
- .put(ChromeFeatureList.INTEREST_FEED_V2, true)
+ .put(ChromeFeatureList.INTEREST_FEED_V2, false)
.put(ChromeFeatureList.THEME_REFACTOR_ANDROID, false)
.put(ChromeFeatureList.USE_CHIME_ANDROID_SDK, false)
.put(ChromeFeatureList.CCT_INCOGNITO_AVAILABLE_TO_THIRD_PARTY, false)
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc
--- a/components/feed/feed_feature_list.cc
+++ b/components/feed/feed_feature_list.cc
@@ -12,12 +12,12 @@
namespace feed {
const base::Feature kInterestFeedContentSuggestions{
- "InterestFeedContentSuggestions", base::FEATURE_ENABLED_BY_DEFAULT};
+ "InterestFeedContentSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
// InterestFeedV2 takes precedence over InterestFeedContentSuggestions.
// InterestFeedV2 is cached in ChromeCachedFlags. If the default value here is
// changed, please update the cached one's default value in CachedFeatureFlags.
const base::Feature kInterestFeedV2{"InterestFeedV2",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kInterestFeedV2Autoplay{"InterestFeedV2Autoplay",
base::FEATURE_DISABLED_BY_DEFAULT};
--
2.17.1
@@ -1,42 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 8 Jul 2018 18:16:34 +0200
Subject: Disable fetching of all field trials
---
.../variations/service/variations_service.cc | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -240,17 +240,7 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers,
// Variations seed fetching is only enabled in official Chrome builds, if a URL
// is specified on the command line, and for testing.
bool IsFetchingEnabled() {
-#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kVariationsServerURL) &&
- !g_should_fetch_for_testing) {
- DVLOG(1)
- << "Not performing repeated fetching in unofficial build without --"
- << switches::kVariationsServerURL << " specified.";
- return false;
- }
-#endif
- return true;
+ return false;
}
std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(
@@ -610,7 +600,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) {
// debugger or if the machine was suspended) and OnURLFetchComplete() hasn't
// had a chance to run yet from the previous request. In this case, don't
// start a new request and just let the previous one finish.
- if (pending_seed_request_)
+ if ((true) || pending_seed_request_)
return false;
last_request_was_http_retry_ = is_http_retry;
--
2.17.1
@@ -1,21 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 8 Oct 2021 00:30:26 +0200
Subject: Disable lock icon in address bar by default
---
chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
--- a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
@@ -313,5 +313,5 @@ TemplateURLService* ChromeLocationBarModelDelegate::GetTemplateURLService() {
void ChromeLocationBarModelDelegate::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(omnibox::kPreventUrlElisionsInOmnibox, true);
- registry->RegisterBooleanPref(omnibox::kLockIconInAddressBarEnabled, false);
+ registry->RegisterBooleanPref(omnibox::kLockIconInAddressBarEnabled, true);
}
--
2.17.1
@@ -1,82 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: Disable media router and remoting by default
---
.../media/router/media_router_feature.cc | 25 ++++++-------------
chrome/browser/profiles/profile.cc | 2 +-
chrome/browser/profiles/profile_impl.cc | 2 +-
3 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -37,26 +37,15 @@ const base::Feature kAllowAllSitesToInitiateMirroring{
"AllowAllSitesToInitiateMirroring", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // !defined(OS_ANDROID)
-namespace {
-const PrefService::Preference* GetMediaRouterPref(
- content::BrowserContext* context) {
- return user_prefs::UserPrefs::Get(context)->FindPreference(
- ::prefs::kEnableMediaRouter);
-}
-
-base::flat_map<content::BrowserContext*, bool>& GetStoredPrefValues() {
- static base::NoDestructor<base::flat_map<content::BrowserContext*, bool>>
- stored_pref_values;
-
- return *stored_pref_values;
-}
-} // namespace
-
-void ClearMediaRouterStoredPrefsForTesting() {
+/*void ClearMediaRouterStoredPrefsForTesting() {
GetStoredPrefValues().clear();
-}
+}*/
bool MediaRouterEnabled(content::BrowserContext* context) {
+ return false;
+}
+
+/*
#if !defined(OS_ANDROID)
if (!base::FeatureList::IsEnabled(kMediaRouter))
return false;
@@ -80,7 +69,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
return allowed;
}
return true;
-}
+}*/
#if !defined(OS_ANDROID)
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
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
@@ -356,7 +356,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
media_router::prefs::kMediaRouterEnableCloudServices, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
- media_router::prefs::kMediaRouterMediaRemotingEnabled, true);
+ media_router::prefs::kMediaRouterMediaRemotingEnabled, false);
registry->RegisterListPref(
media_router::prefs::kMediaRouterTabMirroringSources);
#endif
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -434,7 +434,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if !defined(OS_ANDROID)
registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
#endif // !defined(OS_ANDROID)
--
2.17.1
@@ -1,87 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 20 Feb 2019 21:41:26 +0100
Subject: Disable metrics collection for NTP tiles
---
.../browser/android/ntp/most_visited_sites_bridge.cc | 10 ++--------
components/ntp_tiles/BUILD.gn | 3 ---
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/profiles/profile_android.h"
#include "components/favicon_base/favicon_types.h"
#include "components/history/core/browser/history_service.h"
-#include "components/ntp_tiles/metrics.h"
#include "components/ntp_tiles/most_visited_sites.h"
#include "components/ntp_tiles/section_type.h"
#include "ui/gfx/android/java_bitmap.h"
@@ -45,7 +44,6 @@ using ntp_tiles::NTPTilesVector;
using ntp_tiles::SectionType;
using ntp_tiles::TileTitleSource;
using ntp_tiles::TileSource;
-using ntp_tiles::TileVisualType;
namespace {
@@ -233,7 +231,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
jint jtiles_count) {
- ntp_tiles::metrics::RecordPageImpression(jtiles_count);
}
void MostVisitedSitesBridge::RecordTileImpression(
@@ -245,6 +242,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
jint jtitle_source,
jint jsource,
const JavaParamRef<jobject>& jurl) {
+#if 0
std::unique_ptr<GURL> url = url::GURLAndroid::ToNativeGURL(env, jurl);
TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
TileSource source = static_cast<TileSource>(jsource);
@@ -254,6 +252,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
ntp_tiles::metrics::RecordTileImpression(ntp_tiles::NTPTileImpression(
jindex, source, title_source, visual_type, icon_type, *url));
+#endif
}
void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
@@ -263,11 +262,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
jint tile_type,
jint title_source,
jint source) {
- ntp_tiles::metrics::RecordTileClick(ntp_tiles::NTPTileImpression(
- index, static_cast<TileSource>(source),
- static_cast<TileTitleSource>(title_source),
- static_cast<TileVisualType>(tile_type), favicon_base::IconType::kInvalid,
- /*url_for_rappor=*/GURL()));
}
static jlong JNI_MostVisitedSitesBridge_Init(
diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
--- a/components/ntp_tiles/BUILD.gn
+++ b/components/ntp_tiles/BUILD.gn
@@ -20,8 +20,6 @@ static_library("ntp_tiles") {
"icon_cacher.h",
"icon_cacher_impl.cc",
"icon_cacher_impl.h",
- "metrics.cc",
- "metrics.h",
"most_visited_sites.cc",
"most_visited_sites.h",
"ntp_tile.cc",
@@ -83,7 +81,6 @@ source_set("unit_tests") {
"custom_links_manager_impl_unittest.cc",
"custom_links_store_unittest.cc",
"icon_cacher_impl_unittest.cc",
- "metrics_unittest.cc",
"most_visited_sites_unittest.cc",
"popular_sites_impl_unittest.cc",
]
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 25 Apr 2018 10:23:51 +0200
Subject: Disable metrics on all I/O threads
---
chrome/browser/browser_process_impl.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -965,7 +965,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled,
- GoogleUpdateSettings::GetCollectStatsConsent());
+ false);
registry->RegisterBooleanPref(prefs::kDevToolsRemoteDebuggingAllowed, true);
}
--
2.17.1
@@ -1,24 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 30 May 2019 03:37:45 +0200
Subject: Disable offline pages in the downloads home to be opened in CCT by
default
---
components/offline_pages/core/offline_page_feature.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc
--- a/components/offline_pages/core/offline_page_feature.cc
+++ b/components/offline_pages/core/offline_page_feature.cc
@@ -39,7 +39,7 @@ const base::Feature kOfflinePagesDescriptivePendingStatusFeature{
"OfflinePagesDescriptivePendingStatus", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature{
- "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_ENABLED_BY_DEFAULT};
+ "OfflinePagesInDownloadHomeOpenInCct", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kOfflineIndicatorFeature{"OfflineIndicator",
base::FEATURE_DISABLED_BY_DEFAULT};
--
2.17.1
@@ -1,49 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 23:24:58 +0200
Subject: Disable omission of URL elements in Omnibox
Disable all omissions because they are used throughout the code without
a corresponding user option to individually disable their usage.
---
.../toolbar/chrome_location_bar_model_delegate.cc | 2 +-
components/url_formatter/url_formatter.cc | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
--- a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
@@ -312,6 +312,6 @@ TemplateURLService* ChromeLocationBarModelDelegate::GetTemplateURLService() {
// static
void ChromeLocationBarModelDelegate::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
- registry->RegisterBooleanPref(omnibox::kPreventUrlElisionsInOmnibox, false);
+ registry->RegisterBooleanPref(omnibox::kPreventUrlElisionsInOmnibox, true);
registry->RegisterBooleanPref(omnibox::kLockIconInAddressBarEnabled, false);
}
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
@@ -463,13 +463,13 @@ ComponentResult IDNToUnicodeOneComponent(
} // namespace
const FormatUrlType kFormatUrlOmitNothing = 0;
-const FormatUrlType kFormatUrlOmitUsernamePassword = 1 << 0;
-const FormatUrlType kFormatUrlOmitHTTP = 1 << 1;
-const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 1 << 2;
-const FormatUrlType kFormatUrlOmitHTTPS = 1 << 3;
-const FormatUrlType kFormatUrlOmitTrivialSubdomains = 1 << 5;
-const FormatUrlType kFormatUrlTrimAfterHost = 1 << 6;
-const FormatUrlType kFormatUrlOmitFileScheme = 1 << 7;
+const FormatUrlType kFormatUrlOmitUsernamePassword = 0 << 0;
+const FormatUrlType kFormatUrlOmitHTTP = 0 << 1;
+const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname = 0 << 2;
+const FormatUrlType kFormatUrlOmitHTTPS = 0 << 3;
+const FormatUrlType kFormatUrlOmitTrivialSubdomains = 0 << 5;
+const FormatUrlType kFormatUrlTrimAfterHost = 0 << 6;
+const FormatUrlType kFormatUrlOmitFileScheme = 0 << 7;
const FormatUrlType kFormatUrlOmitMailToScheme = 1 << 8;
const FormatUrlType kFormatUrlOmitDefaults =
--
2.17.1
@@ -1,27 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 22 Mar 2018 22:38:00 +0100
Subject: Disable plugins enumeration
---
third_party/blink/renderer/core/frame/local_frame.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1851,10 +1851,8 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
}
PluginData* LocalFrame::GetPluginData() const {
- if (!Loader().AllowPlugins())
- return nullptr;
- return GetPage()->GetPluginData(
- Tree().Top().GetSecurityContext()->GetSecurityOrigin());
+ // what about no
+ return nullptr;
}
void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
--
2.17.1
@@ -1,63 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 15 Oct 2017 21:45:46 +0200
Subject: Disable references to fonts.googleapis.com
---
.../content/browser/dom_distiller_viewer_source.cc | 2 +-
components/dom_distiller/core/html/preview.html | 2 +-
.../dom_distiller/core/javascript/dom_distiller_viewer.js | 2 +-
third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css | 3 +--
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -300,7 +300,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
std::string DomDistillerViewerSource::GetContentSecurityPolicy(
network::mojom::CSPDirectiveName directive) {
if (directive == network::mojom::CSPDirectiveName::StyleSrc) {
- return "style-src 'self' https://fonts.googleapis.com;";
+ return "style-src 'self';";
} else if (directive == network::mojom::CSPDirectiveName::ChildSrc) {
return "child-src *;";
} else if (directive ==
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
@@ -109,7 +109,7 @@ function maybeSetWebFont() {
}
const e = document.createElement('link');
- e.href = 'https://fonts.googleapis.com/css?family=Roboto';
+ e.href = 'chrome://resources/css/roboto.css';
e.rel = 'stylesheet';
e.type = 'text/css';
document.head.appendChild(e);
diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
--- a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
+++ b/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css
@@ -12,8 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License. */
-@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext";
-@import "https://fonts.googleapis.com/css?family=Source+Code+Pro";
+@import "chrome://resources/css/roboto.css";
body,
table,
--
2.17.1
File diff suppressed because it is too large Load Diff
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 19 Aug 2021 23:11:16 +0200
Subject: Disable search engine DSE automatic permission
---
components/permissions/features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/permissions/features.cc b/components/permissions/features.cc
--- a/components/permissions/features.cc
+++ b/components/permissions/features.cc
@@ -76,7 +76,7 @@ const base::Feature kRevisedOriginHandling{"PermissionsRevisedOriginHandling",
// When enabled, the Default Search Engine does not automatically receive the
// "geolocation" and "notifications" permissions. DSE only applies to Android.
const base::Feature kRevertDSEAutomaticPermissions{
- "RevertDSEAutomaticPermissions", base::FEATURE_DISABLED_BY_DEFAULT};
+ "RevertDSEAutomaticPermissions", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_ANDROID)
} // namespace features
--
2.17.1
@@ -1,37 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Tue, 25 Dec 2018 16:19:51 -0500
Subject: Disable seed-based field trials
---
.../variations/service/variations_field_trial_creator.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
--- a/components/variations/service/variations_field_trial_creator.cc
+++ b/components/variations/service/variations_field_trial_creator.cc
@@ -258,8 +258,8 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
// instance is set.
feature_list->RegisterExtraFeatureOverrides(extra_overrides);
- bool used_testing_config = false;
#if BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
+ bool used_testing_config = false;
if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
!command_line->HasSwitch(::switches::kForceFieldTrials) &&
!command_line->HasSwitch(switches::kVariationsServerURL)) {
@@ -273,10 +273,12 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
}
#endif // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
bool used_seed = false;
+#if defined(FIELDTRIAL_SEED_ENABLED)
if (!used_testing_config) {
used_seed = CreateTrialsFromSeed(low_entropy_provider.get(),
feature_list.get(), safe_seed_manager);
}
+#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
platform_field_trials->SetupFeatureControllingFieldTrials(
used_seed, low_entropy_provider.get(), feature_list.get());
--
2.17.1
@@ -1,125 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 24 Jan 2020 19:17:22 +0100
Subject: Disable smart selection by default
Allow web search in incognito mode (reverts
commit 48d4ae54f7565c429bf29cd63806aee5d7e93e69)
Partial revert of da1d809c003749846cb4ade8c11b6d038e44416b to restore
the ChromeSmartSelection feature flag.
Notice that re-enabling smart selection would make incognito mode potentially
leak information through the TextClassifier set by OEM, if any
---
.../contextualsearch/SelectionClientManager.java | 4 +++-
.../browser/flags/android/chrome_feature_list.cc | 4 ++++
.../browser/flags/android/chrome_feature_list.h | 1 +
.../chrome/browser/flags/ChromeFeatureList.java | 1 +
.../selection/SelectionPopupControllerImpl.java | 2 +-
testing/variations/fieldtrial_testing_config.json | 15 +++++++++++++++
6 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/SelectionClientManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/SelectionClientManager.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/SelectionClientManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/SelectionClientManager.java
@@ -10,6 +10,7 @@ import android.view.textclassifier.TextClassifier;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.content_public.browser.SelectionClient;
import org.chromium.content_public.browser.SelectionEventProcessor;
import org.chromium.content_public.browser.SelectionPopupController;
@@ -44,7 +45,8 @@ public class SelectionClientManager {
* @param webContents The {@link WebContents} that will show popups for this client.
*/
SelectionClientManager(WebContents webContents) {
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
+ if (ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_SMART_SELECTION)
+ && Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
assert webContents != null;
mOptionalSelectionClient = SelectionClient.createSmartSelectionClient(webContents);
SelectionPopupController controller =
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -172,6 +172,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&kCCTClientDataHeader,
&kCCTExternalLinkHandling,
&kCCTIncognito,
+ &kChromeSmartSelection,
&kCCTIncognitoAvailableToThirdParty,
&kCCTPostMessageAPI,
&kCCTRedirectPreconnect,
@@ -492,6 +493,9 @@ const base::Feature kChromeSharingHub{"ChromeSharingHub",
const base::Feature kChromeSurveyNextAndroid{"ChromeSurveyNextAndroid",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kChromeSmartSelection{"ChromeSmartSelection",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kCommandLineOnNonRooted{"CommandLineOnNonRooted",
base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -52,6 +52,7 @@ extern const base::Feature kChromeShareHighlightsAndroid;
extern const base::Feature kChromeShareLongScreenshot;
extern const base::Feature kChromeShareScreenshot;
extern const base::Feature kChromeSharingHub;
+extern const base::Feature kChromeSmartSelection;
extern const base::Feature kChromeSurveyNextAndroid;
extern const base::Feature kCommandLineOnNonRooted;
extern const base::Feature kConditionalTabStripAndroid;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -277,6 +277,7 @@ public abstract class ChromeFeatureList {
public static final String CCT_EXTERNAL_LINK_HANDLING = "CCTExternalLinkHandling";
public static final String CCT_POST_MESSAGE_API = "CCTPostMessageAPI";
public static final String CCT_REDIRECT_PRECONNECT = "CCTRedirectPreconnect";
+ public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection";
public static final String CCT_REMOVE_REMOTE_VIEW_IDS = "CCTRemoveRemoteViewIds";
public static final String CCT_RESIZABLE_FOR_FIRST_PARTIES = "CCTResizableForFirstParties";
public static final String CCT_RESIZABLE_FOR_THIRD_PARTIES = "CCTResizableForThirdParties";
diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
--- a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
@@ -839,7 +839,7 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper
menu.removeItem(R.id.select_action_menu_share);
}
- if (isFocusedNodeEditable() || isIncognito()
+ if (isFocusedNodeEditable()
|| !isSelectActionModeAllowed(MENU_ITEM_WEB_SEARCH)) {
menu.removeItem(R.id.select_action_menu_web_search);
}
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -1951,6 +1951,21 @@
]
}
],
+ "ChromeSmartSelection": [
+ {
+ "platforms": [
+ "android"
+ ],
+ "experiments": [
+ {
+ "name": "Enabled_Launch",
+ "enable_features": [
+ "ChromeSmartSelection"
+ ]
+ }
+ ]
+ }
+ ],
"ChromeStart": [
{
"platforms": [
--
2.17.1
@@ -1,32 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 2 Nov 2019 16:22:56 +0100
Subject: Disable some signed exchange features
---
content/public/common/content_features.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -704,7 +704,7 @@ const base::Feature kSignedExchangePrefetchCacheForNavigations{
// Signed Exchange Reporting for distributors
// https://www.chromestatus.com/features/5687904902840320
const base::Feature kSignedExchangeReportingForDistributors{
- "SignedExchangeReportingForDistributors", base::FEATURE_ENABLED_BY_DEFAULT};
+ "SignedExchangeReportingForDistributors", base::FEATURE_DISABLED_BY_DEFAULT};
// Subresource prefetching+loading via Signed HTTP Exchange
// https://www.chromestatus.com/features/5126805474246656
@@ -714,7 +714,7 @@ const base::Feature kSignedExchangeSubresourcePrefetch{
// Origin-Signed HTTP Exchanges (for WebPackage Loading)
// https://www.chromestatus.com/features/5745285984681984
const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Whether to send a ping to the inner URL upon navigation or not.
const base::Feature kSignedHTTPExchangePingValidity{
--
2.17.1
@@ -1,96 +0,0 @@
From: Michael Gilbert <mgilbert@debian.org>
Date: Wed, 21 Nov 2018 02:37:35 +0000
Subject: Disable support for RAR files inspection
---
.../download_protection/file_analyzer.cc | 2 +-
chrome/common/safe_browsing/BUILD.gn | 33 -------------------
.../file_util/safe_archive_analyzer.cc | 4 +--
3 files changed, 2 insertions(+), 37 deletions(-)
diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
--- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
+++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
@@ -90,7 +90,7 @@ void FileAnalyzer::Start(const base::FilePath& target_path,
if (inspection_type == DownloadFileType::ZIP) {
StartExtractZipFeatures();
} else if (inspection_type == DownloadFileType::RAR) {
- StartExtractRarFeatures();
+ LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build";
#if defined(OS_MAC)
} else if (inspection_type == DownloadFileType::DMG) {
StartExtractDmgFeatures();
diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
--- a/chrome/common/safe_browsing/BUILD.gn
+++ b/chrome/common/safe_browsing/BUILD.gn
@@ -41,38 +41,6 @@ if (safe_browsing_mode == 1) {
public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ]
}
- source_set("rar_analyzer") {
- sources = [
- "rar_analyzer.cc",
- "rar_analyzer.h",
- ]
-
- deps = [
- ":archive_analyzer_results",
- ":download_type_util",
- "//base",
- "//base:i18n",
- "//components/safe_browsing/core/common",
- "//third_party/unrar:unrar",
- ]
-
- defines = [
- "_FILE_OFFSET_BITS=64",
- "LARGEFILE_SOURCE",
- "RAR_SMP",
- "SILENT",
-
- # The following is set to disable certain macro definitions in the unrar
- # source code.
- "CHROMIUM_UNRAR",
-
- # Disables exceptions in unrar, replaces them with process termination.
- "UNRAR_NO_EXCEPTIONS",
- ]
-
- public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ]
- }
-
if (is_mac) {
source_set("disk_image_type_sniffer_mac") {
sources = [
@@ -142,7 +110,6 @@ source_set("safe_browsing") {
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
- ":rar_analyzer",
"//components/safe_browsing/core/common",
]
diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
--- a/chrome/services/file_util/safe_archive_analyzer.cc
+++ b/chrome/services/file_util/safe_archive_analyzer.cc
@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
#if defined(OS_MAC)
@@ -47,8 +46,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
AnalyzeRarFileCallback callback) {
DCHECK(rar_file.IsValid());
+ LOG(FATAL) << "AnalyzeRarFile is disabled in this build";
safe_browsing::ArchiveAnalyzerResults results;
- safe_browsing::rar_analyzer::AnalyzeRarFile(
- std::move(rar_file), std::move(temporary_file), &results);
std::move(callback).Run(results);
}
--
2.17.1
@@ -1,160 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 22 Aug 2020 12:46:20 +0200
Subject: Disable text fragments by default
Revert "[Text Fragment] Unflag fragment directive removal."
---
chrome/browser/about_flags.cc | 1 +
chrome/browser/flag-metadata.json | 2 +-
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +-
content/child/runtime_features.cc | 1 +
third_party/blink/common/features.cc | 2 +-
.../blink/renderer/core/dom/document.cc | 5 ++++
.../text_fragment_anchor_metrics_test.cc | 29 +++++++------------
.../platform/runtime_enabled_features.json5 | 3 +-
8 files changed, 21 insertions(+), 24 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
@@ -5377,6 +5377,7 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSharingHubDesktopOmniboxDescription, kOsDesktop,
FEATURE_VALUE_TYPE(sharing_hub::kSharingHubDesktopOmnibox)},
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
+ // will override runtime text fragment identifiers setting too
#if BUILDFLAG(IS_CHROMEOS_ASH)
{"ash-enable-pip-rounded-corners",
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2941,7 +2941,7 @@
{
"name": "ev-details-in-page-info",
"owners": [ "cthomp" ],
- "expiry_milestone": 83
+ "expiry_milestone": -1
},
{
"name": "exo-gamepad-vibration",
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -360,7 +360,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
prefs::kEnableReferrers,
!base::FeatureList::IsEnabled(features::kNoReferrers));
registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
- registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, true);
+ registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, false);
#if defined(OS_ANDROID)
registry->RegisterDoublePref(prefs::kWebKitFontScaleFactor, 1.0);
registry->RegisterBooleanPref(prefs::kWebKitForceEnableZoom,
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -263,6 +263,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{wf::EnableMouseSubframeNoImplicitCapture,
features::kMouseSubframeNoImplicitCapture},
{wf::EnableNeverSlowMode, features::kNeverSlowMode},
+ // will set the TextFragmentIdentifiers runtime feature
{wf::EnableNotificationContentImage, features::kNotificationContentImage,
kSetOnlyIfOverridden},
{wf::EnableParseUrlProtocolHandler,
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -370,7 +370,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
// Enable text snippets in URL fragments. https://crbug.com/919204.
const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// File handling integration. https://crbug.com/829689
const base::Feature kFileHandlingAPI{"FileHandlingAPI",
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
@@ -4070,6 +4070,10 @@ void Document::SetURL(const KURL& url) {
}
}
+ // If text fragment identifiers are enabled, we strip the fragment directive
+ // from the URL fragment.
+ // E.g. "#id:~:text=a" --> "#id"
+ if (RuntimeEnabledFeatures::TextFragmentIdentifiersEnabled(domWindow())) {
// Strip the fragment directive from the URL fragment. E.g. "#id:~:text=a"
// --> "#id". See https://github.com/WICG/scroll-to-text-fragment.
String fragment = new_url.FragmentIdentifier();
@@ -4083,6 +4087,7 @@ void Document::SetURL(const KURL& url) {
else
new_url.SetFragmentIdentifier(fragment.Substring(0, start_pos));
}
+ }
url_ = new_url;
access_entry_from_url_ = nullptr;
diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
--- a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
+++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
@@ -1249,34 +1249,25 @@ TEST_P(TextFragmentRelatedMetricTest, ElementIdSuccessFailureCounts) {
// result of the element-id fragment if a text directive is successfully
// parsed. If the feature is off we treat the text directive as an element-id
// and should count the result.
+ const int kUncountedOrNotFound = GetParam() ? kUncounted : kNotFound;
const int kUncountedOrFound = GetParam() ? kUncounted : kFound;
- // Note: We'll strip the fragment directive (i.e. anything after :~:) leaving
- // just the element anchor. The fragment directive stripping behavior is now
- // shipped unflagged so it should always be performed.
+ // When the TextFragmentAnchors feature is on, we'll strip the fragment
+ // directive (i.e. anything after :~:) leaving just the element anchor.
+ const int kFoundIfDirectiveStripped = GetParam() ? kFound : kNotFound;
Vector<std::pair<String, int>> test_cases = {
{"", kUncounted},
{"#element", kFound},
{"#doesntExist", kNotFound},
- // `:~:foo` will be stripped so #element will be found and #doesntexist
- // ##element will be not found.
- {"#element:~:foo", kFound},
+ {"#element:~:foo", kFoundIfDirectiveStripped},
{"#doesntexist:~:foo", kNotFound},
{"##element", kNotFound},
- // If the feature is on, `:~:text=` will parse so we shouldn't count.
- // Otherwise, it'll just be stripped so #element will be found.
- {"#element:~:text=doesntexist", kUncountedOrFound},
- {"#element:~:text=page", kUncountedOrFound},
- // If the feature is on, `:~:text` is parsed so we don't count. If it's
- // off the entire fragment is a directive that's stripped so no search is
- // performed either.
- {"#:~:text=doesntexist", kUncounted},
- {"#:~:text=page", kUncounted},
- {"#:~:text=name", kUncounted},
- // If the feature is enabled, `:~:text` parses and we don't count the
- // element-id. If the feature is off, we still strip the :~: directive
- // and the remaining fragment does match an element id.
+ {"#element:~:text=doesntexist", kUncountedOrNotFound},
+ {"#element:~:text=page", kUncountedOrNotFound},
+ {"#:~:text=doesntexist", kUncountedOrNotFound},
+ {"#:~:text=page", kUncountedOrNotFound},
+ {"#:~:text=name", kUncountedOrFound},
{"#element:~:text=name", kUncountedOrFound}};
const int kNotFoundSample = 0;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2130,8 +2130,7 @@
},
{
name: "TextFragmentIdentifiers",
- origin_trial_feature_name: "TextFragmentIdentifiers",
- status: "stable",
+ origin_trial_feature_name: "TextFragmentIdentifiers"
},
{
name: "TextFragmentTapOpensContextMenu",
--
2.17.1
@@ -1,35 +0,0 @@
From: Blaise <BlaiseD@GMail.com>
Date: Sun, 23 Aug 2020 14:32:55 -0500
Subject: Disable the DIAL repeating discovery
This causes unnecessary SSDP network spam
---
chrome/browser/media/router/discovery/dial/dial_registry.cc | 6 ------
1 file changed, 6 deletions(-)
diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrome/browser/media/router/discovery/dial/dial_registry.cc
--- a/chrome/browser/media/router/discovery/dial/dial_registry.cc
+++ b/chrome/browser/media/router/discovery/dial/dial_registry.cc
@@ -191,10 +191,6 @@ void DialRegistry::StartPeriodicDiscovery() {
dial_ = CreateDialService();
dial_->AddObserver(this);
- DoDiscovery();
- repeating_timer_ = std::make_unique<base::RepeatingTimer>();
- repeating_timer_->Start(FROM_HERE, refresh_interval_delta_, this,
- &DialRegistry::DoDiscovery);
}
void DialRegistry::DoDiscovery() {
@@ -208,8 +204,6 @@ void DialRegistry::StopPeriodicDiscovery() {
if (!dial_)
return;
- repeating_timer_->Stop();
- repeating_timer_.reset();
dial_->RemoveObserver(this);
ClearDialService();
}
--
2.17.1
@@ -1,24 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 22:50:10 +0200
Subject: Disable third-party cookies by default
author: Chad Miller <chad.miller@canonical.com>
---
chrome/browser/prefs/browser_prefs.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -698,7 +698,7 @@ void RegisterProfilePrefsForMigration(
chrome_browser_net::secure_dns::RegisterProbesSettingBackupPref(registry);
- registry->RegisterBooleanPref(kBlockThirdPartyCookies, false);
+ registry->RegisterBooleanPref(kBlockThirdPartyCookies, true);
registry->RegisterTimePref(kPluginsDeprecationInfobarLastShown, base::Time());
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 19 Dec 2020 20:04:14 +0100
Subject: Disable unified autoplay feature
---
media/base/media_switches.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -498,7 +498,7 @@ const base::Feature kUseR16Texture{"use-r16-texture",
// Enables the Unified Autoplay policy by overriding the platform's default
// autoplay policy.
const base::Feature kUnifiedAutoplay{"UnifiedAutoplay",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_LINUX)
// Enable vaapi video decoding on linux. This is already enabled by default on
--
2.17.1
@@ -1,25 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 27 Oct 2018 17:54:01 +0200
Subject: Disable update scheduler
---
.../components/component_updater/UpdateScheduler.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java b/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
--- a/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
+++ b/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
@@ -34,9 +34,7 @@ public class UpdateScheduler {
@CalledByNative
/* package */ static boolean isAvailable() {
- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
- || ChromiumPlayServicesAvailability.isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext());
+ return false;
}
/* package */ void onStartTaskBeforeNativeLoaded(TaskFinishedCallback callback) {
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 23 Jul 2021 15:05:19 +0200
Subject: Do not build API keys infobar
---
chrome/browser/ui/BUILD.gn | 2 --
1 file changed, 2 deletions(-)
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1195,8 +1195,6 @@ static_library("ui") {
"singleton_tabs.h",
"startup/automation_infobar_delegate.cc",
"startup/automation_infobar_delegate.h",
- "startup/google_api_keys_infobar_delegate.cc",
- "startup/google_api_keys_infobar_delegate.h",
"startup/launch_mode_recorder.cc",
"startup/launch_mode_recorder.h",
"startup/obsolete_system_infobar_delegate.cc",
--
2.17.1
@@ -1,104 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 27 Feb 2020 23:23:59 +0100
Subject: Do not compile QR code sharing
---
.../chrome/browser/ui/RootUiCoordinator.java | 5 -----
.../ChromeProvidedSharingOptionsProvider.java | 17 -----------------
chrome/browser/share/android/java_sources.gni | 18 ------------------
3 files changed, 40 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
@@ -78,7 +78,6 @@ import org.chromium.chrome.browser.share.ShareButtonController;
import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.chrome.browser.share.ShareDelegate.ShareOrigin;
import org.chromium.chrome.browser.share.ShareUtils;
-import org.chromium.chrome.browser.share.qrcode.QrCodeDialog;
import org.chromium.chrome.browser.tab.AccessibilityVisibilityHandler;
import org.chromium.chrome.browser.tab.AutofillSessionLifetimeController;
import org.chromium.chrome.browser.tab.Tab;
@@ -401,10 +400,6 @@ public class RootUiCoordinator
}
public void onAttachFragment(Fragment fragment) {
- if (fragment instanceof QrCodeDialog) {
- QrCodeDialog qrCodeDialog = (QrCodeDialog) fragment;
- qrCodeDialog.setAndroidPermissionDelegate(mWindowAndroid);
- }
}
@Override
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
--- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
+++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.share.link_to_text.LinkToTextCoordinator;
import org.chromium.chrome.browser.share.link_to_text.LinkToTextCoordinator.LinkGeneration;
import org.chromium.chrome.browser.share.link_to_text.LinkToTextMetricsHelper;
import org.chromium.chrome.browser.share.long_screenshots.LongScreenshotsCoordinator;
-import org.chromium.chrome.browser.share.qrcode.QrCodeCoordinator;
import org.chromium.chrome.browser.share.screenshot.ScreenshotCoordinator;
import org.chromium.chrome.browser.share.send_tab_to_self.SendTabToSelfCoordinator;
import org.chromium.chrome.browser.share.share_sheet.ShareSheetPropertyModelBuilder.ContentType;
@@ -257,9 +256,6 @@ public class ChromeProvidedSharingOptionsProvider {
ChromeFeatureList.PREEMPTIVE_LINK_TO_TEXT_GENERATION)) {
mOrderedFirstPartyOptions.add(createHighlightsFirstPartyOption());
}
- if (!mTabProvider.get().getWebContents().isIncognito()) {
- mOrderedFirstPartyOptions.add(createQrCodeFirstPartyOption());
- }
if (UserPrefs.get(Profile.getLastUsedRegularProfile()).getBoolean(Pref.PRINTING_ENABLED)) {
mOrderedFirstPartyOptions.add(createPrintingFirstPartyOption());
}
@@ -408,19 +404,6 @@ public class ChromeProvidedSharingOptionsProvider {
.build();
}
- private FirstPartyOption createQrCodeFirstPartyOption() {
- return new FirstPartyOptionBuilder(
- ContentType.LINK_PAGE_VISIBLE, ContentType.LINK_PAGE_NOT_VISIBLE, ContentType.IMAGE)
- .setIcon(R.drawable.qr_code, R.string.qr_code_share_icon_label)
- .setFeatureNameForMetrics("SharingHubAndroid.QRCodeSelected")
- .setOnClickCallback((view) -> {
- QrCodeCoordinator qrCodeCoordinator = new QrCodeCoordinator(
- mActivity, mUrl, mTabProvider.get().getWindowAndroid());
- qrCodeCoordinator.show();
- })
- .build();
- }
-
private FirstPartyOption createPrintingFirstPartyOption() {
return new FirstPartyOptionBuilder(ContentType.LINK_PAGE_VISIBLE)
.setIcon(R.drawable.sharing_print, R.string.print_share_activity_title)
diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/share/android/java_sources.gni
--- a/chrome/browser/share/android/java_sources.gni
+++ b/chrome/browser/share/android/java_sources.gni
@@ -21,24 +21,6 @@ share_java_sources = [
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabService.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabServiceFactory.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/ScreenshotBoundsManager.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QRCodeGenerationRequest.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeDialog.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodeDialogTab.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QrCodePageAdapter.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/TabLayoutPageListener.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/CameraPreview.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/CameraPreviewOverlay.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanMediator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanView.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanViewBinder.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanViewProperties.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareCoordinator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareMediator.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareView.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareViewBinder.java",
- "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/share_tab/QrCodeShareViewProperties.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/EditorScreenshotSource.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/EditorScreenshotTask.java",
"//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/ScreenshotCoordinator.java",
--
2.17.1
@@ -1,26 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 12 Oct 2017 08:09:24 +0200
Subject: Do not hide component extensions
---
extensions/common/extension.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -439,9 +439,8 @@ bool Extension::ShouldDisplayInNewTabPage() const {
}
bool Extension::ShouldExposeViaManagementAPI() const {
- // Hide component extensions because they are only extensions as an
- // implementation detail of Chrome.
- return !extensions::Manifest::IsComponentLocation(location());
+ // do not hide component extensions
+ return true;
}
Extension::ManifestData* Extension::GetManifestData(const std::string& key)
--
2.17.1
@@ -1,40 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 20 Jan 2019 06:20:10 +0100
Subject: Do not ignore download location prompt setting
Upstream has decided that it works as intended (https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
but users would like to decide where to save a file even when there is no SD card available;
do not skip the prompt in such cases.
Do not tick "Don't show again" by default
---
.../dialogs/DownloadLocationDialogCoordinator.java | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
@@ -128,20 +128,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
* @param dirs An list of available download directories.
*/
private void onDirectoryOptionsRetrieved(ArrayList<DirectoryOption> dirs) {
- // If there is only one directory available, don't show the default dialog, and set the
- // download directory to default. Dialog will still show for other types of dialogs, like
- // name conflict or disk error.
- if (dirs.size() == 1 && !mLocationDialogManaged
- && mDialogType == DownloadLocationDialogType.DEFAULT) {
- final DirectoryOption dir = dirs.get(0);
- if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) {
- assert (!TextUtils.isEmpty(dir.location));
- DownloadDialogBridge.setDownloadAndSaveFileDefaultDirectory(dir.location);
- mController.onDownloadLocationDialogComplete(mSuggestedPath);
- }
- return;
- }
-
// Already showing the dialog.
if (mDialogModel != null) return;
--
2.17.1
@@ -1,27 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 11 Oct 2017 23:17:17 +0200
Subject: Do not store passwords by default
---
components/password_manager/core/browser/password_manager.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -204,10 +204,10 @@ bool HasMutedCredentials(base::span<const InsecureCredential> credentials,
void PasswordManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableService, true,
+ prefs::kCredentialsEnableService, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterBooleanPref(
- prefs::kCredentialsEnableAutosignin, true,
+ prefs::kCredentialsEnableAutosignin, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
PrefRegistry::NO_REGISTRATION_FLAGS);
--
2.17.1
@@ -1,46 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 26 Sep 2020 14:23:19 +0100
Subject: DoH secure mode by default
---
.../browser/net/stub_resolver_config_reader.cc | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/net/stub_resolver_config_reader.cc
--- a/chrome/browser/net/stub_resolver_config_reader.cc
+++ b/chrome/browser/net/stub_resolver_config_reader.cc
@@ -154,7 +154,7 @@ StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state,
if (entries.count("dns-over-https@1")) {
// The user has "Enabled" selected.
local_state_->SetString(prefs::kDnsOverHttpsMode,
- SecureDnsConfig::kModeAutomatic);
+ SecureDnsConfig::kModeSecure);
} else if (entries.count("dns-over-https@2")) {
// The user has "Disabled" selected.
local_state_->SetString(prefs::kDnsOverHttpsMode,
@@ -334,22 +334,7 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration(
check_parental_controls = false;
}
- // Check parental controls last because it can be expensive and should only be
- // checked if necessary for the otherwise-determined mode.
if (check_parental_controls) {
- if (ShouldDisableDohForParentalControls()) {
- forced_management_mode =
- SecureDnsConfig::ManagementMode::kDisabledParentalControls;
- secure_dns_mode = net::SecureDnsMode::kOff;
- mode_details =
- SecureDnsModeDetailsForHistogram::kOffByDetectedParentalControls;
-
- // If parental controls had not previously been checked, need to update
- // network service.
- if (!parental_controls_checked_)
- update_network_service = true;
- }
-
parental_controls_checked_ = true;
}
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Tue, 25 May 2021 19:33:41 +0200
Subject: Enable IntentBlockExternalFormRedirectsNoGesture by default
---
.../external_intents/android/external_intents_features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/external_intents/android/external_intents_features.cc b/components/external_intents/android/external_intents_features.cc
--- a/components/external_intents/android/external_intents_features.cc
+++ b/components/external_intents/android/external_intents_features.cc
@@ -26,7 +26,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
// Alphabetical:
const base::Feature kIntentBlockExternalFormRedirectsNoGesture{
"IntentBlockExternalFormRedirectsNoGesture",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
static jlong JNI_ExternalIntentsFeatures_GetFeature(JNIEnv* env, jint ordinal) {
return reinterpret_cast<jlong>(kFeaturesExposedToJava[ordinal]);
--
2.17.1
@@ -1,39 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 17 Mar 2019 19:09:00 +0100
Subject: Enable SPPI for devices with enough memory
---
chrome/common/chrome_features.cc | 4 ----
components/site_isolation/features.cc | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -896,11 +896,7 @@ const base::Feature kShow10_10ObsoleteInfobar{
// browser_features, as they are only used on the browser side.
const base::Feature kSitePerProcess {
"site-per-process",
-#if defined(OS_ANDROID)
- base::FEATURE_DISABLED_BY_DEFAULT
-#else
base::FEATURE_ENABLED_BY_DEFAULT
-#endif
};
#if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/components/site_isolation/features.cc b/components/site_isolation/features.cc
--- a/components/site_isolation/features.cc
+++ b/components/site_isolation/features.cc
@@ -50,7 +50,7 @@ const base::Feature kSiteIsolationForOAuthSites{
// base::SysInfo::AmountOfPhysicalMemoryMB().
const base::Feature kSitePerProcessOnlyForHighMemoryClients{
"site-per-process-only-for-high-memory-clients",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const char kSitePerProcessOnlyForHighMemoryClientsParamName[] =
"site-per-process-low-memory-cutoff-mb";
--
2.17.1
@@ -1,569 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 21 Oct 2021 07:06:08 +0000
Subject: [wip] enable android backup
---
chrome/android/chrome_public_apk_tmpl.gni | 1 +
.../java/res/xml/about_chrome_preferences.xml | 11 ++
.../chrome/browser/ChromeBackupAgentImpl.java | 122 ++++++++++++++++--
.../about_settings/AboutChromeSettings.java | 70 +++++++++-
chrome/browser/android/chrome_backup_agent.cc | 97 ++++++++++++++
.../strings/android_chrome_strings.grd | 12 ++
components/prefs/json_pref_store.cc | 5 +
components/prefs/json_pref_store.h | 2 +
components/prefs/persistent_pref_store.h | 3 +
components/prefs/pref_service.cc | 4 +
components/prefs/pref_service.h | 2 +
11 files changed, 316 insertions(+), 13 deletions(-)
diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni
--- a/chrome/android/chrome_public_apk_tmpl.gni
+++ b/chrome/android/chrome_public_apk_tmpl.gni
@@ -22,6 +22,7 @@ default_chrome_public_jinja_variables = [
"channel=$android_channel",
"enable_vr=$enable_vr",
"include_arcore_manifest_flag=false",
+ "backup_key=unused" # see https://developer.android.com/guide/topics/data/keyvaluebackup#BackupManifest
]
# Enable stack unwinding only on official build with specific channels. It is
diff --git a/chrome/android/java/res/xml/about_chrome_preferences.xml b/chrome/android/java/res/xml/about_chrome_preferences.xml
--- a/chrome/android/java/res/xml/about_chrome_preferences.xml
+++ b/chrome/android/java/res/xml/about_chrome_preferences.xml
@@ -19,4 +19,15 @@
android:fragment="org.chromium.chrome.browser.about_settings.LegalInformationSettings"
android:key="legal_information"
android:title="@string/legal_information_title" />
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="allow_android_backup"
+ android:title="@string/allow_android_backup_title"
+ android:summary="@string/allow_android_backup_summary"
+ android:defaultValue="false" />
+ <Preference
+ android:key="backup_now"
+ android:title="@string/backup_now_title"/>
+ <Preference
+ android:key="restore_now"
+ android:title="@string/restore_now_title"/>
</PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
@@ -48,6 +48,9 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.Map;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
/**
* Backup agent for Chrome, using Android key/value backup.
@@ -57,6 +60,11 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
private static final String ANDROID_DEFAULT_PREFIX = "AndroidDefault.";
private static final String NATIVE_PREF_PREFIX = "native.";
+ private static final String NATIVE_LOCALSTATE_PREF_JSON = "localstate_prefs_json";
+ private static final String NATIVE_PROFILE_PREF_JSON = "profile_prefs_json";
+ private static final String SHARED_PREFS_PREFIX = "shared.";
+ private static final String PREF_ALLOW_ANDROID_BACKUP = "allow_android_backup";
+
private static final String TAG = "ChromeBackupAgent";
@VisibleForTesting
@@ -175,9 +183,30 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
return bytes[0] != 0;
}
+ private static byte[] convertToBytes(Object object) throws IOException {
+ try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos)) {
+ out.writeObject(object);
+ return bos.toByteArray();
+ }
+ }
+
+ private static Object convertFromBytes(byte[] bytes) throws IOException, ClassNotFoundException {
+ try (ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
+ ObjectInputStream in = new ObjectInputStream(bis)) {
+ return in.readObject();
+ }
+ }
+
@Override
public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
ParcelFileDescriptor newState) throws IOException {
+ SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
+ if (sharedPrefs.getBoolean(PREF_ALLOW_ANDROID_BACKUP, false) == false) {
+ Log.i(TAG, "Backup disabled by user");
+ return;
+ }
+
final ArrayList<String> backupNames = new ArrayList<>();
final ArrayList<byte[]> backupValues = new ArrayList<>();
final AtomicReference<CoreAccountInfo> syncAccount = new AtomicReference<>();
@@ -203,9 +232,20 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
for (boolean val : nativeBackupValues) {
backupValues.add(booleanToBytes(val));
}
+
+ // serialize local state and prefs as json string
+ String jsonPrefs = ChromeBackupAgentImplJni.get().getLocalStatePrefJson(this);
+ Log.i(TAG, "--- local state prefs %s", jsonPrefs);
+ backupNames.add(NATIVE_LOCALSTATE_PREF_JSON);
+ backupValues.add(jsonPrefs.getBytes());
+
+ jsonPrefs = ChromeBackupAgentImplJni.get().getProfilePrefsJson(this);
+ Log.i(TAG, "--- prefs %s", jsonPrefs);
+ backupNames.add(NATIVE_PROFILE_PREF_JSON);
+ backupValues.add(jsonPrefs.getBytes());
+
return true;
});
- SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
if (!nativePrefsRead) {
// Something went wrong reading the native preferences, skip the backup, but try again
@@ -244,6 +284,17 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
}
}
+ // Serialize all java SharedPreferences
+ Map<String, ?> allValues = sharedPrefs.getAll();
+ for (Map.Entry<String, ?> entry : allValues.entrySet()) {
+ String prefName = entry.getKey();
+ Object value = entry.getValue();
+ byte[] serialized = convertToBytes(value);
+
+ backupNames.add(SHARED_PREFS_PREFIX + prefName);
+ backupValues.add(serialized);
+ }
+
// Finally add the user id.
backupNames.add(ANDROID_DEFAULT_PREFIX + SIGNED_IN_ACCOUNT_KEY);
backupValues.add(ApiCompatibilityUtils.getBytesUtf8(
@@ -286,10 +337,11 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
// Check that the user hasn't already seen FRE (not sure if this can ever happen, but if it
// does then restoring the backup will overwrite the user's choices).
SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
- if (FirstRunStatus.getFirstRunFlowComplete()
- || FirstRunStatus.getLightweightFirstRunFlowComplete()) {
- setRestoreStatus(RestoreStatus.RESTORE_AFTER_FIRST_RUN);
- Log.w(TAG, "Restore attempted after first run");
+ if (sharedPrefs.getBoolean(PREF_ALLOW_ANDROID_BACKUP, false) == false) {
+ // this is currently a problem.
+ // when the application is reinstalled, this method is launched automatically, and, since the default flag is false, I exit.
+ // a possible alternative is to check the flag in the backup.
+ Log.i(TAG, "Restore disabled by user");
return;
}
@@ -347,13 +399,6 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
return;
}
- // If the user hasn't signed in, or can't sign in, then don't restore anything.
- if (!accountExistsOnDevice(restoredUserName)) {
- setRestoreStatus(RestoreStatus.NOT_SIGNED_IN);
- Log.i(TAG, "Chrome was not signed in with a known account name, not restoring");
- return;
- }
-
// Restore the native preferences on the UI thread
PostTask.runSynchronously(UiThreadTaskTraits.DEFAULT, () -> {
ArrayList<String> nativeBackupNames = new ArrayList<>();
@@ -363,9 +408,34 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
for (int i = 0; i < backupNames.size(); i++) {
String name = backupNames.get(i);
if (name.startsWith(NATIVE_PREF_PREFIX)) {
+ Log.i(TAG, "Restore attempted for %s", name);
nativeBackupNames.add(name.substring(prefixLength));
nativeBackupValues[count] = bytesToBoolean(backupValues.get(i));
count++;
+ } else if (name.equals(NATIVE_LOCALSTATE_PREF_JSON)) {
+ try {
+ String value = new String(backupValues.get(i));
+ if (ChromeBackupAgentImplJni.get().setLocalStatePrefJson(this,
+ value) == false) {
+ Log.e(TAG, "Failed to restore local state from native.");
+ } else {
+ Log.i(TAG, "Local state restored.");
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to restore local state: %s", e.toString());
+ }
+ } else if (name.equals(NATIVE_PROFILE_PREF_JSON)) {
+ try {
+ String value = new String(backupValues.get(i));
+ if (ChromeBackupAgentImplJni.get().setProfilePrefsJson(this,
+ value) == false) {
+ Log.e(TAG, "Failed to restore profile prefs from native.");
+ } else {
+ Log.i(TAG, "Profile prefs restored.");
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to restore profile prefs: %s", e.toString());
+ }
}
}
ChromeBackupAgentImplJni.get().setBoolBackupPrefs(this,
@@ -386,6 +456,30 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
editor.putBoolean(
name.substring(prefixLength), bytesToBoolean(backupValues.get(i)));
}
+ else if (name.startsWith(SHARED_PREFS_PREFIX)) {
+ String prefName = name.substring(SHARED_PREFS_PREFIX.length());
+ try {
+ if (sharedPrefs.contains(prefName)) {
+ Log.i(TAG, "Restoring %s", prefName);
+ Object value = convertFromBytes(backupValues.get(i));
+ if (value instanceof String) {
+ editor.putString(prefName, (String)value);
+ } else if (value instanceof Integer) {
+ editor.putInt(prefName, (int)value);
+ } else if (value instanceof Long) {
+ editor.putLong(prefName, (long)value);
+ } else if (value instanceof Float) {
+ editor.putFloat(prefName, (float)value);
+ } else if (value instanceof Boolean) {
+ editor.putBoolean(prefName, (boolean)value);
+ } else {
+ Log.e(TAG, "Unknow type for %s", prefName);
+ }
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to restore shared pref %s: %s", prefName, e.toString());
+ }
+ }
}
// Because FirstRunSignInProcessor.FIRST_RUN_FLOW_SIGNIN_COMPLETE is not restored Chrome
@@ -467,5 +561,9 @@ public class ChromeBackupAgentImpl extends ChromeBackupAgent.Impl {
String[] getBoolBackupNames(ChromeBackupAgentImpl caller);
boolean[] getBoolBackupValues(ChromeBackupAgentImpl caller);
void setBoolBackupPrefs(ChromeBackupAgentImpl caller, String[] name, boolean[] value);
+ String getLocalStatePrefJson(ChromeBackupAgentImpl caller);
+ boolean setLocalStatePrefJson(ChromeBackupAgentImpl caller, String json);
+ String getProfilePrefsJson(ChromeBackupAgentImpl caller);
+ boolean setProfilePrefsJson(ChromeBackupAgentImpl caller, String json);
}
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/about_settings/AboutChromeSettings.java
@@ -4,6 +4,17 @@
package org.chromium.chrome.browser.about_settings;
+import android.app.backup.BackupManager;
+import android.app.backup.RestoreObserver;
+import org.chromium.base.ContextUtils;
+import org.chromium.base.StrictModeContext;
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
+import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
+import org.chromium.chrome.browser.ApplicationLifetime;
+import android.os.Build;
+import android.os.Build.VERSION_CODES;
+
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -30,13 +41,15 @@ import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
*/
public class AboutChromeSettings
extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener,
- Preference.OnPreferenceChangeListener {
+ Preference.OnPreferenceChangeListener,
+ INeedSnackbarManager {
private static final int TAPS_FOR_DEVELOPER_SETTINGS = 7;
private static final String PREF_APPLICATION_VERSION = "application_version";
private static final String PREF_ALLOW_INLINE_UPDATE = "allow_inline_update";
private static final String PREF_OS_VERSION = "os_version";
private static final String PREF_LEGAL_INFORMATION = "legal_information";
+ private static final String PREF_ALLOW_ANDROID_BACKUP = "allow_android_backup";
// Non-translated strings:
private static final String MSG_DEVELOPER_ENABLE_COUNTDOWN =
@@ -51,6 +64,9 @@ public class AboutChromeSettings
DeveloperSettings.shouldShowDeveloperSettings() ? -1 : TAPS_FOR_DEVELOPER_SETTINGS;
private Toast mToast;
+ private SnackbarManager mSnackbarManager;
+ private Snackbar mSnackbar;
+
@Override
public void onCreatePreferences(Bundle bundle, String s) {
getActivity().setTitle(R.string.prefs_about_chrome);
@@ -72,6 +88,58 @@ public class AboutChromeSettings
OmahaBase.getSharedPreferences()
.getBoolean(OmahaBase.PREF_ALLOW_INLINE_UPDATE, false));
allowInlineUpdate.setOnPreferenceChangeListener(this);
+
+ mSnackbar = Snackbar.make(getActivity().getString(R.string.ui_relaunch_notice),
+ new SnackbarManager.SnackbarController() {
+ @Override
+ public void onDismissNoAction(Object actionData) { }
+
+ @Override
+ public void onAction(Object actionData) {
+ ApplicationLifetime.terminate(true);
+ }
+ }, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_UNKNOWN)
+ .setSingleLine(false)
+ .setAction(getActivity().getString(R.string.relaunch),
+ /*actionData*/null)
+ .setDuration(/*durationMs*/70000);
+
+ Preference backupNow = findPreference("backup_now");
+ backupNow.setOnPreferenceClickListener(preference -> {
+ // make a backup request
+ BackupManager backupManager = new BackupManager(ContextUtils.getApplicationContext());
+ try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {
+ // note: this is a request
+ // it is not possible to know when android decides to actually launch the backup
+ backupManager.dataChanged();
+ }
+ mToast = Toast.makeText(getActivity(), "Backup requested.", Toast.LENGTH_LONG);
+ mToast.show();
+ return true;
+ });
+
+ Preference restoreNow = findPreference("restore_now");
+ restoreNow.setOnPreferenceClickListener(preference -> {
+ // make a restore request
+ BackupManager backupManager = new BackupManager(ContextUtils.getApplicationContext());
+ backupManager.requestRestore(
+ new RestoreObserver() {
+ public void restoreFinished(int error) {
+ if (!mSnackbarManager.isShowing())
+ mSnackbarManager.showSnackbar(mSnackbar);
+ }
+ }
+ );
+ return true;
+ });
+
+ // Since Android P app can no longer request restoring of its backup.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
+ restoreNow.getParent().removePreference(restoreNow);
+ }
+
+ public void setSnackbarManager(SnackbarManager manager) {
+ mSnackbarManager = manager;
}
/**
diff --git a/chrome/browser/android/chrome_backup_agent.cc b/chrome/browser/android/chrome_backup_agent.cc
--- a/chrome/browser/android/chrome_backup_agent.cc
+++ b/chrome/browser/android/chrome_backup_agent.cc
@@ -15,6 +15,10 @@
#include "components/prefs/pref_service.h"
#include "components/sync/base/pref_names.h"
+#include "base/android/jni_string.h"
+#include "base/json/json_string_value_serializer.h"
+#include "chrome/browser/browser_process.h"
+
namespace {
const char* backed_up_preferences_[] = {
@@ -77,6 +81,99 @@ static void JNI_ChromeBackupAgentImpl_SetBoolBackupPrefs(
prefs->CommitPendingWrite();
}
+static base::android::ScopedJavaLocalRef<jstring>
+ JNI_ChromeBackupAgentImpl_GetLocalStatePrefJson(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller)
+{
+ // Extract the local state and serialize to a string.
+ base::Value local_state =
+ g_browser_process->local_state()->GetPreferenceValues(
+ PrefService::EXCLUDE_DEFAULTS);
+ std::string serialized_settings;
+ JSONStringValueSerializer serializer(&serialized_settings);
+ serializer.set_pretty_print(false);
+ if (!serializer.Serialize(local_state))
+ return base::android::ConvertUTF8ToJavaString(env, {});
+
+ return base::android::ConvertUTF8ToJavaString(env, serialized_settings);
+}
+
+static jboolean JNI_ChromeBackupAgentImpl_SetLocalStatePrefJson(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller,
+ const base::android::JavaParamRef<jstring>& json_java)
+{
+ std::string json = base::android::ConvertJavaStringToUTF8(json_java);
+
+ JSONStringValueDeserializer deserializer(json);
+
+ int error_code = 0;
+ std::string error_message;
+ std::unique_ptr<base::Value> value =
+ deserializer.Deserialize(&error_code, &error_message);
+ if (error_code != 0) {
+ LOG(ERROR) << "Failed to deserialize json: " << error_code
+ << ": " << error_message;
+ return false;
+ }
+
+ auto unfiltered_prefs = std::make_unique<base::DictionaryValue>();
+ unfiltered_prefs.reset(
+ static_cast<base::DictionaryValue*>(value.release()));
+ g_browser_process->local_state()->OverridePrefs(
+ std::move(unfiltered_prefs));
+
+ return true;
+}
+
+static base::android::ScopedJavaLocalRef<jstring>
+ JNI_ChromeBackupAgentImpl_GetProfilePrefsJson(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller)
+{
+ // Extract the profile prefs and serialize to a string.
+ PrefService* prefs =
+ ProfileManager::GetLastUsedProfile()->GetOriginalProfile()->GetPrefs();
+ base::Value prefs_state =
+ prefs->GetPreferenceValues(
+ PrefService::EXCLUDE_DEFAULTS);
+ std::string serialized_settings;
+ JSONStringValueSerializer serializer(&serialized_settings);
+ if (!serializer.Serialize(prefs_state))
+ return base::android::ConvertUTF8ToJavaString(env, {});
+
+ return base::android::ConvertUTF8ToJavaString(env, serialized_settings);
+}
+
+static jboolean JNI_ChromeBackupAgentImpl_SetProfilePrefsJson(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jcaller,
+ const base::android::JavaParamRef<jstring>& json_java)
+{
+ std::string json = base::android::ConvertJavaStringToUTF8(json_java);
+
+ JSONStringValueDeserializer deserializer(json);
+
+ int error_code = 0;
+ std::string error_message;
+ std::unique_ptr<base::Value> value =
+ deserializer.Deserialize(&error_code, &error_message);
+ if (error_code != 0) {
+ LOG(ERROR) << "Failed to deserialize json: " << error_code
+ << ": " << error_message;
+ return false;
+ }
+
+ auto unfiltered_prefs = std::make_unique<base::DictionaryValue>();
+ unfiltered_prefs.reset(
+ static_cast<base::DictionaryValue*>(value.release()));
+ ProfileManager::GetLastUsedProfile()->GetOriginalProfile()
+ ->GetPrefs()->OverridePrefs(std::move(unfiltered_prefs));
+
+ return true;
+}
+
namespace android {
std::vector<std::string> GetBackupPrefNames() {
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -1669,6 +1669,18 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_ALLOW_INLINE_UPDATE_SUMMARY" desc="Summary for allow inline update preference">
Check for updates by contacting the Bromite repo
</message>
+ <message name="IDS_ALLOW_ANDROID_BACKUP_TITLE" desc="Title for allow android backup">
+ Allow Android Backup
+ </message>
+ <message name="IDS_ALLOW_ANDROID_BACKUP_SUMMARY" desc="Summary for allow android backup">
+ Activate Android backup manager
+ </message>
+ <message name="IDS_BACKUP_NOW_TITLE" desc="Summary for backup now button">
+ Backup now
+ </message>
+ <message name="IDS_RESTORE_NOW_TITLE" desc="Summary for restore now button">
+ Restore now
+ </message>
<!-- Account management UI strings. -->
<message name="IDS_ACCOUNT_MANAGEMENT_TITLE" desc="Header title for the account management screen. [CHAR_LIMIT=32]">
diff --git a/components/prefs/json_pref_store.cc b/components/prefs/json_pref_store.cc
--- a/components/prefs/json_pref_store.cc
+++ b/components/prefs/json_pref_store.cc
@@ -558,6 +558,11 @@ void JsonPrefStore::FinalizeFileRead(
return;
}
+void JsonPrefStore::OverridePrefs(
+ std::unique_ptr<base::DictionaryValue> new_values) {
+ prefs_ = std::move(new_values);
+}
+
void JsonPrefStore::ScheduleWrite(uint32_t flags) {
if (read_only_)
return;
diff --git a/components/prefs/json_pref_store.h b/components/prefs/json_pref_store.h
--- a/components/prefs/json_pref_store.h
+++ b/components/prefs/json_pref_store.h
@@ -123,6 +123,8 @@ class COMPONENTS_PREFS_EXPORT JsonPrefStore
void OnStoreDeletionFromDisk() override;
+ void OverridePrefs(std::unique_ptr<base::DictionaryValue> new_values) override;
+
#if defined(UNIT_TEST)
base::ImportantFileWriter& get_writer() { return writer_; }
#endif
diff --git a/components/prefs/persistent_pref_store.h b/components/prefs/persistent_pref_store.h
--- a/components/prefs/persistent_pref_store.h
+++ b/components/prefs/persistent_pref_store.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "components/prefs/prefs_export.h"
#include "components/prefs/writeable_pref_store.h"
+#include "base/values.h"
// This interface is complementary to the PrefStore interface, declaring
// additional functionality that adds support for setting values and persisting
@@ -89,6 +90,8 @@ class COMPONENTS_PREFS_EXPORT PersistentPrefStore : public WriteablePrefStore {
// Cleans preference data that may have been saved outside of the store.
virtual void OnStoreDeletionFromDisk() = 0;
+ virtual void OverridePrefs(std::unique_ptr<base::DictionaryValue> new_values) {}
+
// TODO(crbug.com/942491) Remove this after fixing the bug.
virtual bool IsInMemoryPrefStore() const;
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc
--- a/components/prefs/pref_service.cc
+++ b/components/prefs/pref_service.cc
@@ -405,6 +405,10 @@ void PrefService::OnStoreDeletionFromDisk() {
user_pref_store_->OnStoreDeletionFromDisk();
}
+void PrefService::OverridePrefs(std::unique_ptr<base::DictionaryValue> new_values) {
+ user_pref_store_->OverridePrefs(std::move(new_values));
+}
+
void PrefService::ChangePrefValueStore(
PrefStore* managed_prefs,
PrefStore* supervised_user_prefs,
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h
--- a/components/prefs/pref_service.h
+++ b/components/prefs/pref_service.h
@@ -380,6 +380,8 @@ class COMPONENTS_PREFS_EXPORT PrefService {
void AddPrefObserverAllPrefs(PrefObserver* obs);
void RemovePrefObserverAllPrefs(PrefObserver* obs);
+ void OverridePrefs(std::unique_ptr<base::DictionaryValue> new_values);
+
#if defined(OS_ANDROID)
base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
#endif
--
2.17.1
@@ -1,37 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 20 Aug 2020 20:15:34 +0200
Subject: Enable darken websites checkbox in themes
Unexpire #darken-websites-checkbox-in-themes-setting
---
chrome/browser/flag-metadata.json | 2 +-
chrome/browser/flags/android/chrome_feature_list.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -903,7 +903,7 @@
{
"name": "darken-websites-checkbox-in-themes-setting",
"owners": [ "lazzzis@google.com", "twellington" ],
- "expiry_milestone": 98
+ "expiry_milestone": -1
},
{
"name": "dcheck-is-fatal",
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -560,7 +560,7 @@ const base::Feature kContextualSearchTranslations{
"ContextualSearchTranslations", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDarkenWebsitesCheckboxInThemesSetting{
- "DarkenWebsitesCheckboxInThemesSetting", base::FEATURE_DISABLED_BY_DEFAULT};
+ "DarkenWebsitesCheckboxInThemesSetting", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kQuickActionSearchWidgetAndroidDinoVariant{
"QuickActionSearchWidgetAndroidDinoVariant",
--
2.17.1
@@ -1,58 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Thu, 22 Dec 2016 07:15:34 -0500
Subject: Enable -fwrapv in Clang for non-UBSan builds
Using -fwrapv (notably only when not using signed integer overflow checking -
since it will override it and result in not performing checks) is just common
sense since it eliminates the chance of security vulnerabilities being
introduced by optimizations based on signed overflow being undefined.
That has happened before, and those optimizations don't even add up to a 0.1%
performance increase for this kind of software. It's not worth having.
The Linux kernel passes -fwrapv and also -fno-strict-aliasing to disable those
dangerous optimizations (since there is so much incorrect code they can break).
In fact, it is easy to point to dozens of known examples of invalid code that
could potentially be broken by those optimizations.
It is not acceptable for projects to be using optimizations that are known to
be broken with a bunch of code in their tree.
They put barely any effort into even fixing the known cases.
Chromium has blacklists for UBSan for 'false positives' (none of which are
actually false positives, but rather "undefined, but not a bug beyond
potentially being broken by optimizations or even code generation without
them") and also for components too full of these bugs for them to currently
want to bother with it. That includes a bunch of signed overflow issues
(there is sadly no detection for aliasing violations, which are fairly common,
but not that common).
Ideally, -fwrapv could be always passed, but unfortunately the way it is
implemented has silly interactions with other switches.
The reason it would still make sense to pass it is because due to their UBSan
blacklists, they get far from full coverage with it, so -fwrapv would still
be better than nothing where it's not being used.
Since -fwrapv makes signed integer overflow well-defined, Clang will disable
the UBSan checks for signed integer overflow, including in the
production-oriented trapping mode used for hardening.
Excerpt from https://github.com/bromite/bromite/issues/226
---
build/config/compiler/BUILD.gn | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -349,6 +349,10 @@ config("compiler") {
}
}
+ if (is_clang && !is_ubsan && !is_ubsan_security) {
+ cflags += [ "-fwrapv" ]
+ }
+
# Linker warnings.
if (fatal_linker_warnings && !is_apple && current_os != "aix") {
ldflags += [ "-Wl,--fatal-warnings" ]
--
2.17.1
@@ -1,56 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 10 Dec 2020 21:52:35 +0100
Subject: Enable network isolation features
Enable SplitCacheByNetworkIsolationKey, kSplitHostCacheByNetworkIsolationKey,
kPartitionConnectionsByNetworkIsolationKey, kPartitionHttpServerPropertiesByNetworkIsolationKey,
kPartitionSSLSessionsByNetworkIsolationKey, PartitionExpectCTStateByNetworkIsolationKey,
PartitionNelAndReportingByNetworkIsolationKey
---
net/base/features.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/base/features.cc b/net/base/features.cc
--- a/net/base/features.cc
+++ b/net/base/features.cc
@@ -93,30 +93,30 @@ const base::Feature kNetworkQualityEstimator{"NetworkQualityEstimator",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSplitCacheByNetworkIsolationKey{
- "SplitCacheByNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT};
+ "SplitCacheByNetworkIsolationKey", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSplitHostCacheByNetworkIsolationKey{
- "SplitHostCacheByNetworkIsolationKey", base::FEATURE_DISABLED_BY_DEFAULT};
+ "SplitHostCacheByNetworkIsolationKey", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kPartitionConnectionsByNetworkIsolationKey{
"PartitionConnectionsByNetworkIsolationKey",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kPartitionHttpServerPropertiesByNetworkIsolationKey{
"PartitionHttpServerPropertiesByNetworkIsolationKey",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kPartitionSSLSessionsByNetworkIsolationKey{
"PartitionSSLSessionsByNetworkIsolationKey",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kPartitionExpectCTStateByNetworkIsolationKey{
"PartitionExpectCTStateByNetworkIsolationKey",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kPartitionNelAndReportingByNetworkIsolationKey{
"PartitionNelAndReportingByNetworkIsolationKey",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kExpectCTPruning{"ExpectCTPruning",
base::FEATURE_ENABLED_BY_DEFAULT};
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 31 Jul 2020 08:27:26 +0200
Subject: Enable prefetch-privacy-changes by default
---
third_party/blink/common/features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -399,7 +399,7 @@ const base::Feature kComputePressure{"ComputePressure",
// Prefetch request properties are updated to be privacy-preserving. See
// crbug.com/988956.
const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
// format in the image decode cache. See crbug.com/919627 for details on the
--
2.17.1
-414
View File
@@ -1,414 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Sun, 3 Oct 2021 16:18:24 +0000
Subject: Enable share intent
This patch allows to activate the management of android.intent.action.SEND
with new flag "shared-intent-ui" default active.
See also: https://github.com/bromite/bromite/issues/1062
---
chrome/android/chrome_java_resources.gni | 1 +
chrome/android/chrome_java_sources.gni | 1 +
chrome/android/java/AndroidManifest.xml | 18 +++
.../res/layout/sharing_intent_content.xml | 83 +++++++++++++
.../init/ProcessInitializationHandler.java | 3 +
.../SharedIntentShareActivity.java | 114 ++++++++++++++++++
chrome/browser/about_flags.cc | 4 +
chrome/browser/flag_descriptions.cc | 5 +
chrome/browser/flag_descriptions.h | 3 +
.../flags/android/chrome_feature_list.cc | 4 +
.../flags/android/chrome_feature_list.h | 1 +
.../browser/flags/ChromeFeatureList.java | 1 +
.../strings/android_chrome_strings.grd | 13 ++
13 files changed, 251 insertions(+)
create mode 100644 chrome/android/java/res/layout/sharing_intent_content.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_intent/SharedIntentShareActivity.java
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -719,6 +719,7 @@ chrome_java_resources = [
"java/res/layout/share_sheet_content.xml",
"java/res/layout/share_sheet_item.xml",
"java/res/layout/sharing_device_picker.xml",
+ "java/res/layout/sharing_intent_content.xml",
"java/res/layout/sheet_tab_toolbar.xml",
"java/res/layout/signin_activity.xml",
"java/res/layout/status_indicator_container.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1053,6 +1053,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardMessageHandler.java",
"java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardMetrics.java",
"java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardShareActivity.java",
+ "java/src/org/chromium/chrome/browser/sharing/shared_intent/SharedIntentShareActivity.java",
"java/src/org/chromium/chrome/browser/sharing/sms_fetcher/SmsFetcherMessageHandler.java",
"java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java",
"java/src/org/chromium/chrome/browser/site_settings/CookieControlsServiceBridge.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
@@ -810,6 +810,24 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
+ <activity
+ android:name="org.chromium.chrome.browser.sharing.shared_intent.SharedIntentShareActivity"
+ android:icon="@drawable/ic_launcher"
+ android:roundIcon="@drawable/ic_launcher_round"
+ android:label="@string/shared_intent_share_activity_title"
+ android:enabled="false"
+ android:excludeFromRecents="true"
+ android:exported="true"
+ android:noHistory="true"
+ android:theme="@style/Theme.Chromium.Activity.TranslucentNoAnimations"
+ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" >
+ <intent-filter>
+ <action android:name="android.intent.action.SEND" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:mimeType="text/plain" />
+ </intent-filter>
+ </activity>
+
<activity
android:name="org.chromium.chrome.browser.vr.VrCancelAnimationActivity"
android:exported="false"
diff --git a/chrome/android/java/res/layout/sharing_intent_content.xml b/chrome/android/java/res/layout/sharing_intent_content.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/layout/sharing_intent_content.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2019 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <View
+ android:id="@+id/mask"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@android:color/transparent"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:background="@color/sheet_bg_color">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="32dp"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_height="wrap_content"
+ android:layout_width ="match_parent"
+ app:srcCompat="@drawable/ic_launcher"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/min_touch_target_size"
+ android:gravity="center"
+ android:paddingStart="30dp"
+ android:paddingEnd="30dp"
+ android:paddingTop="16dp"
+ android:ellipsize="end"
+ android:textAppearance="@style/TextAppearance.BlackToolbarTitle"
+ android:text="@string/shared_intent_share_activity_title"/>
+
+ <TextView
+ android:id="@+id/share_message_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingStart="30dp"
+ android:paddingEnd="30dp"
+ android:paddingTop="16dp"
+ android:ellipsize="end"
+ android:textAppearance="@style/TextAppearance.TextLarge.Secondary"
+ android:text="@string/shared_intent_share_activity_text"/>
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/open_url_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginTop="16dp"
+ android:text="@string/shared_intent_share_activity_open_text"
+ android:visibility="gone"
+ style="@style/FilledButton"/>
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/open_url_incognito_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginTop="16dp"
+ android:text="@string/shared_intent_share_activity_openincognito_text"
+ android:visibility="gone"
+ style="@style/TextButton"/>
+
+ </LinearLayout>
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
@@ -72,6 +72,7 @@ import org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidg
import org.chromium.chrome.browser.rlz.RevenueStats;
import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider;
import org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardShareActivity;
+import org.chromium.chrome.browser.sharing.shared_intent.SharedIntentShareActivity;
import org.chromium.chrome.browser.tab.state.ShoppingPersistedTabData;
import org.chromium.chrome.browser.util.AfterStartupTaskUtils;
import org.chromium.chrome.browser.webapps.WebApkVersionManager;
@@ -405,6 +406,8 @@ public class ProcessInitializationHandler {
deferredStartupHandler.addDeferredTask(
() -> IncognitoTabLauncher.updateComponentEnabledState());
+ deferredStartupHandler.addDeferredTask(
+ () -> SharedIntentShareActivity.updateComponentEnabledState());
deferredStartupHandler.addDeferredTask(
() -> SharedClipboardShareActivity.updateComponentEnabledState());
deferredStartupHandler.addDeferredTask(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_intent/SharedIntentShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_intent/SharedIntentShareActivity.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_intent/SharedIntentShareActivity.java
@@ -0,0 +1,114 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.sharing.shared_intent;
+
+import org.chromium.base.Log;
+
+import android.content.res.Resources;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.view.View;
+import android.widget.TextView;
+import android.net.Uri;
+
+import org.chromium.base.ContextUtils;
+import org.chromium.base.IntentUtils;
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.task.PostTask;
+import org.chromium.base.task.TaskTraits;
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
+import org.chromium.chrome.browser.init.AsyncInitializationActivity;
+import org.chromium.chrome.browser.LaunchIntentDispatcher;
+import org.chromium.chrome.browser.IntentHandler;
+import org.chromium.ui.widget.ButtonCompat;
+
+/**
+ * Activity to display device targets to share text.
+ */
+public class SharedIntentShareActivity
+ extends AsyncInitializationActivity {
+
+ /**
+ * Checks whether sending shared clipboard message is enabled for the user and enables/disables
+ * the SharedIntentShareActivity appropriately. This call requires native to be loaded.
+ */
+ public static void updateComponentEnabledState() {
+ boolean enabled = ChromeFeatureList.isEnabled(ChromeFeatureList.SHARED_INTENT_UI);
+ PostTask.postTask(TaskTraits.USER_VISIBLE, () -> setComponentEnabled(enabled));
+ }
+
+ /**
+ * Sets whether or not the SharedIntentShareActivity should be enabled. This may trigger a
+ * StrictMode violation so shouldn't be called on the UI thread.
+ */
+ private static void setComponentEnabled(boolean enabled) {
+ ThreadUtils.assertOnBackgroundThread();
+ Context context = ContextUtils.getApplicationContext();
+ PackageManager packageManager = context.getPackageManager();
+ ComponentName componentName =
+ new ComponentName(context, SharedIntentShareActivity.class);
+
+ int newState = enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+ : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
+
+ // This indicates that we don't want to kill Chrome when changing component enabled state.
+ int flags = PackageManager.DONT_KILL_APP;
+
+ if (packageManager.getComponentEnabledSetting(componentName) != newState) {
+ packageManager.setComponentEnabledSetting(componentName, newState, flags);
+ }
+ }
+
+ @Override
+ protected void triggerLayoutInflation() {
+ setContentView(R.layout.sharing_intent_content);
+
+ String linkUrl = IntentUtils.safeGetStringExtra(getIntent(), Intent.EXTRA_TEXT);
+ Resources resources = ContextUtils.getApplicationContext().getResources();
+ TextView share_message_text = findViewById(R.id.share_message_text);
+ share_message_text.setText(
+ resources.getString(R.string.shared_intent_share_activity_text, linkUrl));
+
+ View mask = findViewById(R.id.mask);
+ mask.setOnClickListener(v -> finish());
+
+ ButtonCompat open_url_button = findViewById(R.id.open_url_button);
+ open_url_button.setVisibility(View.VISIBLE);
+ open_url_button.setOnClickListener(view -> {
+ Context applicationContext = ContextUtils.getApplicationContext();
+ Intent chromeIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(linkUrl));
+ chromeIntent.setPackage(applicationContext.getPackageName());
+ chromeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ LaunchIntentDispatcher.dispatch(this, chromeIntent);
+ finish();
+ });
+
+ ButtonCompat open_url_incognito_button = findViewById(R.id.open_url_incognito_button);
+ open_url_incognito_button.setVisibility(View.VISIBLE);
+ open_url_incognito_button.setOnClickListener(view -> {
+ Context applicationContext = ContextUtils.getApplicationContext();
+ Intent chromeIntent = IntentHandler.createTrustedOpenNewTabIntent(applicationContext,
+ /*incognito*/true);
+
+ chromeIntent.setData(Uri.parse(linkUrl));
+ chromeIntent.setPackage(applicationContext.getPackageName());
+ chromeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ LaunchIntentDispatcher.dispatch(this, chromeIntent);
+ finish();
+ });
+
+ onInitialLayoutInflationComplete();
+ }
+
+ @Override
+ public boolean shouldStartGpuProcess() {
+ return false;
+ }
+}
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
@@ -5402,6 +5402,10 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(sharing_hub::kDesktopScreenshots)},
#endif
+ {"shared-intent-ui", flag_descriptions::kSharedIntentUIName,
+ flag_descriptions::kSharedIntentUIDescription, kOsAll,
+ FEATURE_VALUE_TYPE(chrome::android::kSharedIntentUI)},
+
{"sharing-prefer-vapid", flag_descriptions::kSharingPreferVapidName,
flag_descriptions::kSharingPreferVapidDescription, kOsAll,
FEATURE_VALUE_TYPE(kSharingPreferVapid)},
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
@@ -2275,6 +2275,11 @@ const char kSharingDesktopScreenshotsDescription[] =
"Enables taking"
" screenshots from the desktop sharing hub.";
+const char kSharedIntentUIName[] =
+ "Enable shared feature";
+const char kSharedIntentUIDescription[] =
+ "Enables shared feature";
+
const char kSharingHubDesktopAppMenuName[] = "Desktop Sharing Hub in App Menu";
const char kSharingHubDesktopAppMenuDescription[] =
"Enables the Chrome Sharing Hub in the 3-dot menu for desktop.";
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
@@ -1307,6 +1307,9 @@ extern const char kSharedClipboardUIDescription[];
extern const char kSharingDesktopScreenshotsName[];
extern const char kSharingDesktopScreenshotsDescription[];
+extern const char kSharedIntentUIName[];
+extern const char kSharedIntentUIDescription[];
+
extern const char kSharingHubDesktopAppMenuName[];
extern const char kSharingHubDesktopAppMenuDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -256,6 +256,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&kServiceManagerForDownload,
&kShareButtonInTopToolbar,
&kSharedClipboardUI,
+ &kSharedIntentUI,
&kSharingHubLinkToggle,
&kSingleTouchSelect,
&kSpannableInlineAutocomplete,
@@ -640,6 +641,9 @@ const base::Feature kSearchEnginePromoExistingDevice{
const base::Feature kSearchEnginePromoNewDevice{
"SearchEnginePromo.NewDevice", base::FEATURE_ENABLED_BY_DEFAULT};
+const base::Feature kSharedIntentUI{
+ "SharedIntentUI", base::FEATURE_ENABLED_BY_DEFAULT};
+
const base::Feature kNewWindowAppMenu{"NewWindowAppMenu",
base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -123,6 +123,7 @@ extern const base::Feature kRelatedSearchesSimplifiedUx;
extern const base::Feature kRelatedSearchesUi;
extern const base::Feature kSearchEnginePromoExistingDevice;
extern const base::Feature kSearchEnginePromoNewDevice;
+extern const base::Feature kSharedIntentUI;
extern const base::Feature kSearchReadyOmniboxFeature;
extern const base::Feature kServiceManagerForBackgroundPrefetch;
extern const base::Feature kServiceManagerForDownload;
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -495,6 +495,7 @@ public abstract class ChromeFeatureList {
public static final String SHARE_USAGE_RANKING = "ShareUsageRanking";
public static final String SHARE_USAGE_RANKING_FIXED_MORE = "ShareUsageRankingFixedMore";
public static final String SHARED_CLIPBOARD_UI = "SharedClipboardUI";
+ public static final String SHARED_INTENT_UI = "SharedIntentUI";
public static final String SHARED_HIGHLIGHTING_V2 = "SharedHighlightingV2";
public static final String SHARED_HIGHLIGHTING_AMP = "SharedHighlightingAmp";
public static final String SHARING_HUB_LINK_TOGGLE = "SharingHubLinkToggle";
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -4459,6 +4459,19 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Send text to Your Devices
</message>
+ <message name="IDS_SHARED_INTENT_SHARE_ACTIVITY_TITLE" desc="Text that will appear in the Android share dialog to open an URL with Bromite.">
+ Open URL with Bromite
+ </message>
+ <message name="IDS_SHARED_INTENT_SHARE_ACTIVITY_TEXT" desc="Text to show for opening with Bromite.">
+ Will open <ph name="URL">%1$s</ph> with Bromite
+ </message>
+ <message name="IDS_SHARED_INTENT_SHARE_ACTIVITY_OPEN_TEXT" desc="Text to show in the button for opening with Bromite.">
+ Open with Bromite
+ </message>
+ <message name="IDS_SHARED_INTENT_SHARE_ACTIVITY_OPENINCOGNITO_TEXT" desc="Text to show in the button for opening with Bromite in incognito.">
+ Open with Bromite Incognito
+ </message>
+
<!-- Sms Fetcher -->
<message name="IDS_SMS_FETCHER_NOTIFICATION_TITLE" desc="Title text shown when the Android Chrome receives a ONE_TIME_CODE from an incoming SMS and ask users for permission to submit the code to their linked Desktop Chrome">
Submit <ph name="ONE_TIME_CODE">%1$s<ex>123</ex></ph> on <ph name="CLIENT_NAME">%2$s<ex>Zoe's Macbook</ex></ph>?
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 10 Feb 2020 23:13:13 +0100
Subject: Enable user-agent freeze by default
---
third_party/blink/common/features.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -77,7 +77,7 @@ const base::Feature kFreezePurgeMemoryAllPagesFrozen{
// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
const base::Feature kReduceUserAgent{"ReduceUserAgent",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the frequency capping for detecting overlay popups. Overlay-popups
// are the interstitials that pop up and block the main content of the page.
--
2.17.1
@@ -1,23 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 5 Sep 2020 21:38:15 +0200
Subject: Hardening against incognito mode detection
---
storage/browser/quota/quota_settings.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/storage/browser/quota/quota_settings.cc b/storage/browser/quota/quota_settings.cc
--- a/storage/browser/quota/quota_settings.cc
+++ b/storage/browser/quota/quota_settings.cc
@@ -29,7 +29,7 @@ const int64_t kMBytes = 1024 * 1024;
const int kRandomizedPercentage = 10;
const double kDefaultPerHostRatio = 0.75;
const double kIncognitoQuotaRatioLowerBound = 0.15;
-const double kIncognitoQuotaRatioUpperBound = 0.2;
+const double kIncognitoQuotaRatioUpperBound = 0.3;
// Skews |value| by +/- |percent|.
int64_t RandomizeByPercent(int64_t value, int percent) {
--
2.17.1
@@ -1,32 +0,0 @@
From: Daniel Micay <danielmicay@gmail.com>
Date: Sun, 13 Aug 2017 19:33:04 -0400
Subject: Hide passwords manager link
---
.../browser/password_manager/settings/PasswordSettings.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
@@ -326,7 +326,7 @@ public class PasswordSettings extends PreferenceFragmentCompat
return;
}
- displayManageAccountLink();
+ //displayManageAccountLink();
PreferenceGroup passwordParent;
if (mSearchQuery == null) {
@@ -406,7 +406,7 @@ public class PasswordSettings extends PreferenceFragmentCompat
return;
}
- displayManageAccountLink();
+ //displayManageAccountLink();
PreferenceCategory profileCategory = new PreferenceCategory(getStyledContext());
profileCategory.setKey(PREF_KEY_CATEGORY_EXCEPTIONS);
--
2.17.1

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