Browse Source

Update to 80.0.3987.106-1

master
wchen342 2 years ago
parent
commit
76d59b18b6
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 3
      .gclient
  2. 15
      CHANGELOG.md
  3. 5
      android_flags.gn
  4. 110
      build.sh
  5. 10761
      domain_sub_2.list
  6. 14
      misc/android_studio_setup.sh
  7. 61
      patches/Bromite/Add-exit-menu-item.patch
  8. 47
      patches/Bromite/Add-flag-to-disable-WebGL.patch
  9. 171
      patches/Bromite/Add-flags-to-disable-device-motion-and-orientation-APIs.patch
  10. 121
      patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch
  11. 194
      patches/Bromite/Add-option-to-use-home-page-as-NTP.patch
  12. 500
      patches/Bromite/Add-user-setting-for-DNS-over-HTTPS-DoH-custom-URL.patch
  13. 103
      patches/Bromite/Remove-SMS-integration.patch
  14. 64
      patches/Bromite/Revert-flags-remove-disable-pull-to-refresh-effect.patch
  15. 44
      patches/Bromite/Use-a-minimum-DoH-timeout-of-400ms.patch
  16. 43
      patches/Bromite/updater-disable-updater-pings.patch
  17. 24
      patches/Unobtainium/kill-Auth.patch
  18. 114
      patches/Unobtainium/kill-GCM.patch
  19. 11
      patches/Unobtainium/kill-Location-fall-back-to-system.patch
  20. 14
      patches/Unobtainium/kill-Translate.patch
  21. 10
      patches/Vanadium/0021-disable-media-router-by-default.patch
  22. 10
      patches/android-prune-fix.patch
  23. 21
      patches/remove-jdk.patch
  24. 15
      patches/series
  25. 68
      patches/src-fix/fix-extra-safe-browsing.patch
  26. 27
      patches/src-fix/fix-prefs.patch
  27. 61
      patches/src-fix/fix-safe-browsing-prefs.patch
  28. 3
      patches/src-fix/fix-unkown-warning-clang-9.patch
  29. 62
      patches/src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.patch
  30. 19
      patches/ungoogled-chromium-android/Disable-contextual-search.patch
  31. 25
      patches/ungoogled-chromium-android/Disable-lite-mode-prompt.patch
  32. 69
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
  33. 196
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch
  34. 228
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
  35. 92
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.fido-com.google.android.gms.iid-com.google.android.gms.instantapps-com.google.android.gms.location.patch
  36. 18
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.flags-com.google.android.gms.location.places-com.google.android.gms.stats.patch
  37. 100
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch
  38. 74
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
  39. 58
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.core.splitcompat-com.google.android.play.core.splitinstall.patch
  40. 41
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
  41. 8
      patches/ungoogled-chromium-android/change-package-name-chromium.patch
  42. 19
      patches/ungoogled-chromium-android/disable-context-search-by-default.patch
  43. 24
      patches/ungoogled-chromium-android/linker-android-support-remove.patch
  44. 2
      pruning_2.list

3
.gclient

@ -51,17 +51,16 @@ solutions = [
"src/chrome/test/data/xr/webxr_samples": None,
"src/third_party/spirv-cross/spirv-cross": None,
"src/third_party/spirv-headers/src": None,
"src/third_party/SPIRV-Tools/src": None,
"src/third_party/shaderc/src": None,
"src/third_party/dav1d/libdav1d": None,
"src/third_party/glfw/src": None,
"src/third_party/devtools-node-modules": None,
"src/third_party/hunspell_dictionaries": None,
"src/third_party/jdk": None,
"src/third_party/libFuzzer/src": None,
"src/third_party/libaom/source/libaom": None,
"src/third_party/libprotobuf-mutator/src": None,
"src/third_party/openh264/src": None,
"src/third_party/openscreen/src": None,
"src/third_party/pyftpdlib/src": None,
"src/third_party/quic_trace/src": None,
"src/third_party/pywebsocket/src": None,

15
CHANGELOG.md

@ -1,3 +1,18 @@
# 80.0.3987.106-1
* Port some privacy related functionality from `Bromite`, including:
* flag to disable WebGL
* flag to disable motion sensors
* exit button and do not persist option
* use blank page as homepage
* setting for DNS-over-HTTPS (DoH)
* flag to disable pull-to-refresh
* Set contextual search to `false` in native code instead of Java
* Disable lite mode prompt
* Build time change (not affecting users):
* Exclude unit tests from domain substitution
* Using system JDK instead of bundled one. Requires both Java-8 and Java-10 on Arch Linux.
* Now build with SDK 29
# 79.0.3945.117-2
* Add ChromePublic target (API 19)
* Fix build failure for safe browsing

5
android_flags.gn

@ -4,7 +4,7 @@ android_ndk_version = "r20b"
android_ndk_major_version = 20
android_sdk_build_tools_version="29.0.2"
android_sdk_tools_version_suffix="-26.2.0-dev"
android_sdk_version=28
android_sdk_version=29
clang_base_path="/usr"
disable_android_lint=true
enable_gvr_services=false
@ -12,9 +12,6 @@ enable_resource_whitelist_generation=false
ffmpeg_branding="Chrome"
is_clang=true
is_component_build=false
jumbo_file_merge_limit=40
rtc_build_examples=false
target_os="android"
use_jumbo_build=true
use_lld=true
use_sysroot=false

110
build.sh

@ -1,12 +1,15 @@
#!/usr/bin/env bash
set -eux -o pipefail
# Required tools: protobuf python python2 gperf wget rsync tar unzip curl gnupg maven yasm npm ninja gn nodejs git clang lld gn llvm jdk8-openjdk jre8-openjdk-headless jdk10-openjdk lib32-glibc multilib-devel
# Assuming default python to be python2.
chrome_target=chrome_public_apk
mono_target=monochrome_public_apk
webview_target=system_webview_apk
chromium_version=79.0.3945.130
ungoogled_chromium_revision=2
chromium_version=80.0.3987.106
ungoogled_chromium_revision=1
# Argument parser from https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash/29754866#29754866
# -allow a command to fail with !’s side effect on errexit
@ -73,9 +76,6 @@ fi
echo "arch: $ARCH, target: $TARGET, debug: $DEBUG"
# Required tools: protobuf python python2 gperf wget rsync tar unzip curl gnupg maven yasm npm ninja git clang lld gn llvm openjdk lib32-glibc multilib-devel
# Assuming default python to be python2.
## Clone ungoogled-chromium repo
git clone https://github.com/Eloston/ungoogled-chromium.git -b ${chromium_version}-${ungoogled_chromium_revision}
@ -91,6 +91,7 @@ git remote add origin https://chromium.googlesource.com/chromium/tools/depot_too
git fetch --depth 1 --no-tags origin "${depot_tools_commit}"
git reset --hard FETCH_HEAD
popd
OLD_PATH=$PATH
export PATH="$(pwd -P)/depot_tools:$PATH"
pushd src/third_party
ln -s ../../depot_tools
@ -103,15 +104,6 @@ gclient.py sync --nohooks --no-history --shallow --revision=${chromium_version}
## Fix repos
feed_commit=$(grep "'feed_revision':" src/DEPS | cut -d\' -f4)
mkdir src/third_party/feed/src
pushd src/third_party/feed/src
git init
git remote add origin https://chromium.googlesource.com/feed
git fetch --depth 1 --no-tags origin "${feed_commit}"
git reset --hard FETCH_HEAD
popd
webrtc_commit=$(grep 'webrtc_git.*/src\.git' src/DEPS | cut -d\' -f8)
mkdir src/third_party/webrtc
pushd src/third_party/webrtc
@ -130,22 +122,25 @@ git fetch --depth 1 --no-tags origin "${libsync_commit}"
git reset --hard FETCH_HEAD
popd
gn_commit=2426c173819e74a9dad7a2ab647cfa1506f6007f
mv src/tools/gn src/tools/gn.bak
git clone https://gn.googlesource.com/gn src/tools/gn
pushd src/tools/gn
git checkout ${gn_commit}
popd
cp -r src/tools/gn.bak/bootstrap src/tools/gn
## Hooks
python src/build/util/lastchange.py -o src/build/util/LASTCHANGE
python src/tools/download_cros_provided_profile.py --newest_state=src/chrome/android/profiles/newest.txt --local_state=src/chrome/android/profiles/local.txt --output_name=src/chrome/android/profiles/afdo.prof --gs_url_base=chromeos-prebuilt/afdo-job/llvm
python src/build/util/lastchange.py -m GPU_LISTS_VERSION --revision-id-only --header src/gpu/config/gpu_lists_version.h
python src/build/util/lastchange.py -m SKIA_COMMIT_HASH -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
# New binary dependency: node, caused by webui
src/third_party/node/update_node_binaries
mkdir -p src/third_party/node/linux/node-linux-x64/bin
ln -s /usr/bin/node src/third_party/node/linux/node-linux-x64/bin/
src/third_party/node/update_npm_deps
# Remove bundled jdk
# java8 bundled with Arch seems to be a little outdated, so actually need to use java and javac from java10
pushd src && patch -p1 --ignore-whitespace -i ../patches/remove-jdk.patch --no-backup-if-mismatch && popd
rm -rf src/third_party/jdk
mkdir -p src/third_party/jdk/current/bin
ln -s /usr/bin/java src/third_party/jdk/current/bin/
ln -s /usr/bin/javac src/third_party/jdk/current/bin/
# jre
mkdir -p src/third_party/jdk/extras/java_8
ln -s /usr/lib/jvm/java-8-openjdk/jre src/third_party/jdk/extras/java_8
## Run ungoogled-chromium scripts
@ -170,10 +165,10 @@ cp safe_browsing_proto_files/webprotect.pb.h src/components/safe_browsing/proto/
## Prepare Android SDK/NDK
SDK_DIR="android-sdk_eng.10.0.0_r14_linux-x86"
# Create symbol links to sdk folders
# The rebuild sdk has a different folder structure from the checked out version, so it is easier to create symbol links
# Old aapt no longer works. Need to use Maven version until a rebuild of SDK 29 exists.
#pushd src/third_party/android_build_tools
#rm -rf aapt2
#ln -s ../../../android-sdk/android-sdk_user.9.0.0_r21_linux-x86/build-tools/android-9 aapt2
@ -184,21 +179,19 @@ if [[ -d "$DIRECTORY" ]]; then
fi
mkdir "${DIRECTORY}" && pushd ${DIRECTORY}
# rm -rf add-ons emulator licenses platforms sources tools-lint build-tools ndk-bundle platform-tools tools
mkdir build-tools && ln -s ../../../../../android-sdk/android-sdk_user.9.0.0_r21_linux-x86/build-tools/android-9 build-tools/29.0.2
mkdir build-tools && ln -s ../../../../../android-sdk/${SDK_DIR}/build-tools/android-10 build-tools/29.0.2
mkdir platforms
ln -s ../../../../../android-sdk/android-sdk_user.9.0.0_r21_linux-x86/platforms/android-9 platforms/android-28
ln -s ../../../../android-sdk/android-sdk_user.9.0.0_r21_linux-x86/platform-tools platform-tools
ln -s ../../../../android-sdk/android-sdk_user.9.0.0_r21_linux-x86/tools tools
ln -s ../../../../../android-sdk/${SDK_DIR}/platforms/android-10 platforms/android-29
ln -s ../../../../android-sdk/${SDK_DIR}/platform-tools platform-tools
ln -s ../../../../android-sdk/${SDK_DIR}/tools tools
popd
# remove ndk folders
DIRECTORY="src/third_party/android_ndk"
gn_file="BUILD.gn"
mkdir "temp"
#cp -a "${DIRECTORY}/${gn_file}" android-ndk/android-ndk-r20b
#cp -ar "${DIRECTORY}/toolchains/llvm/prebuilt/linux-x86_64" android-ndk/android-ndk-r20b/toolchains/llvm/prebuilt # Need libgcc.a otherwise compilation will fail
cp -a "${DIRECTORY}/${gn_file}" temp
cp -ar "${DIRECTORY}/toolchains/llvm/prebuilt/linux-x86_64" temp # Need libgcc.a otherwise compilation will fail
mkdir "ndk_temp"
cp -a "${DIRECTORY}/${gn_file}" ndk_temp
cp -ar "${DIRECTORY}/toolchains/llvm/prebuilt/linux-x86_64" ndk_temp # Need libgcc.a otherwise compilation will fail
pushd "${DIRECTORY}"
cd ..
rm -rf android_ndk
@ -206,10 +199,7 @@ ln -s ../../android-ndk/android-ndk-r20b android_ndk
popd
# This is Sylvain Beucler's libre Android rebuild
sdk_link="https://android-rebuilds.beuc.net/dl/bundles/android-sdk_user.9.0.0_r21_linux-x86.zip"
sdk_tools_link="https://android-rebuilds.beuc.net/dl/repository/sdk-repo-linux-tools-26.1.1.zip"
ndk_link="https://android-rebuilds.beuc.net/dl/repository/android-ndk-r20b-linux-x86_64.tar.bz2"
sdk_link="https://android-rebuilds.beuc.net/dl/bundles/android-sdk_eng.10.0.0_r14_linux-x86.zip"
sdk_tools_link="https://android-rebuilds.beuc.net/dl/repository/sdk-repo-linux-tools-26.1.1.zip"
ndk_link="https://android-rebuilds.beuc.net/dl/repository/android-ndk-r20b-linux-x86_64.tar.bz2"
@ -217,37 +207,19 @@ mkdir android-rebuilds
mkdir android-sdk
mkdir android-ndk
pushd android-rebuilds
for i in $(seq 1 5); do curl -O ${sdk_link} && unzip -qqo android-sdk_user.9.0.0_r21_linux-x86.zip -d ../android-sdk && rm -f android-sdk_user.9.0.0_r21_linux-x86.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${sdk_tools_link} && unzip -qqo sdk-repo-linux-tools-26.1.1.zip -d ../android-sdk/android-sdk_user.9.0.0_r21_linux-x86 && rm -f sdk-repo-linux-tools-26.1.1.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${sdk_link} && unzip -qqo android-sdk_eng.10.0.0_r14_linux-x86.zip -d ../android-sdk && rm -f android-sdk_eng.10.0.0_r14_linux-x86.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${sdk_tools_link} && unzip -qqo sdk-repo-linux-tools-26.1.1.zip -d ../android-sdk/android-sdk_eng.10.0.0_r14_linux-x86 && rm -f sdk-repo-linux-tools-26.1.1.zip && s=0 && break || s=$? && sleep 15; done; (exit $s)
for i in $(seq 1 5); do curl -O ${ndk_link} && tar xjf android-ndk-r20b-linux-x86_64.tar.bz2 -C ../android-ndk && rm -f android-ndk-r20b-linux-x86_64.tar.bz2 && s=0 && break || s=$? && sleep 15; done; (exit $s)
popd
# Move ndk files into place
cp -a "temp/${gn_file}" android-ndk/android-ndk-r20b
cp -ar "temp/linux-x86_64" android-ndk/android-ndk-r20b/toolchains/llvm/prebuilt
rm -rf "temp"
cp -a "ndk_temp/${gn_file}" android-ndk/android-ndk-r20b
cp -ar "ndk_temp/linux-x86_64" android-ndk/android-ndk-r20b/toolchains/llvm/prebuilt
rm -rf "ndk_temp"
## Compile third-party binaries
# error-prone, from Maven repo
mkdir -p src/third_party/errorprone/lib
pushd src/third_party/errorprone/lib
version=2.3.1
mvn_url="https://repo1.maven.org/maven2/com/google/errorprone/error_prone_ant/${version}"
curl "${mvn_url}/error_prone_ant-${version}.jar" -O
curl "${mvn_url}/error_prone_ant-${version}.jar.asc" -O
echo -e "\033[0;33mThis will add a new key to your GPG keyring! \033[0m"
gpg --recv-keys EE9E7DC9D92FC896
gpg --verify "error_prone_ant-${version}.jar.asc" "error_prone_ant-${version}.jar"
popd
# closure-compiler
DIRECTORY="src/third_party/closure_compiler"
mkdir "${DIRECTORY}"/temp && pushd ${DIRECTORY}/temp
git clone https://github.com/google/closure-compiler && cd closure-compiler
mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml
cp -a target/closure-compiler-1.0-SNAPSHOT.jar ../../compiler/compiler.jar
cd ../.. && rm -rf temp
popd
# eu-strip can be re-compiled with -Wno-error, but it is probably not a good idea
# eu-strip is re-compiled with -Wno-error
patch -p1 --ignore-whitespace -i patches/eu-strip-build-script.patch --no-backup-if-mismatch
pushd src/buildtools/third_party/eu-strip
./build.sh
@ -272,14 +244,8 @@ fi
python3 ungoogled-chromium/utils/domain_substitution.py apply -r ungoogled-chromium/domain_regex.list -f ${substitution_list_2} -c ${cache_file} src
## Genarate gn file
pushd src/tools/gn
build/gen.py
/usr/bin/ninja -C out gn
popd
## Configure output folder
export PATH=$OLD_PATH # remove depot_tools from PATH
pushd src
mkdir -p out/Default
if [ "$DEBUG" = n ] ; then
@ -287,8 +253,8 @@ if [ "$DEBUG" = n ] ; then
else
cat ../android_flags.gn ../android_flags.debug.gn > out/Default/args.gn
fi
printf '\ntarget_cpu="'"$ARCH"'"' >> out/Default/args.gn
tools/gn/out/gn gen out/Default --fail-on-unused-args
printf '\ntarget_cpu="'"$ARCH"'"\n' >> out/Default/args.gn
gn gen out/Default --fail-on-unused-args
popd
@ -303,5 +269,5 @@ patch -p1 --ignore-whitespace -i patches/ignore-aidl-assertion-error.patch --no-
## Build
pushd src
/usr/bin/ninja -C out/Default $TARGET
ninja -C out/Default $TARGET
popd

10761
domain_sub_2.list

File diff suppressed because it is too large

14
misc/android_studio_setup.sh

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eux -o pipefail
chromium_version=79.0.3945.117
chromium_version=80.0.3987.106
chrome_target=chrome_public_apk
monochrome_target=monochrome_public_apk
webview_target=system_webview_apk
@ -9,7 +9,7 @@ webview_target=system_webview_apk
# Create symbol links to gn, depot-tools
pushd src
pushd buildtools/linux64
ln -s ../../tools/gn/out/gn
ln -s /usr/bin/gn
popd
pushd third_party
@ -23,12 +23,6 @@ export NM=${NM:=llvm-nm}
export CC=${CC:=clang}
export CXX=${CXX:=clang++}
## Genarate gn file
pushd src/tools/gn
build/gen.py
/usr/bin/ninja -C out gn
popd
# Need different GN flags than a release build
pushd src
output_folder=out/Debug_apk
@ -36,7 +30,7 @@ mkdir -p ${output_folder}
cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn
# Run gn first
tools/gn/out/gn gen ${output_folder} --fail-on-unused-args
gn gen ${output_folder} --fail-on-unused-args
# Compile apk
/usr/bin/ninja -C ${output_folder} ${monochrome_target}
@ -50,7 +44,7 @@ mkdir -p ${output_folder}
cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn
# Run gn first
tools/gn/out/gn gen ${output_folder} --fail-on-unused-args
gn gen ${output_folder} --fail-on-unused-args
# Generate gradle files
# patch generate_gradle.py to use system ninja instead of depot_tools

61
patches/Bromite/Add-exit-menu-item.patch

@ -0,0 +1,61 @@
From: Serg <[email protected]>
Date: Tue, 31 Jan 2017 22:12:27 -0500
Subject: Add exit menu item
Corrected Exit functionality
---
chrome/android/java/res/menu/main_menu.xml | 2 ++
chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | 2 ++
chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
chrome/browser/ui/android/strings/android_chrome_strings.grd | 3 +++
4 files changed, 12 insertions(+), 1 deletion(-)
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -85,6 +85,8 @@
android:title="@string/menu_help" />
<item android:id="@+id/enter_vr_id"
android:title="@string/enter_vr" />
+ <item android:id="@+id/exit_id"
+ android:title="@string/menu_exit" />
</group>
<!-- Items shown only in the tab switcher -->
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -2211,6 +2211,8 @@ public abstract class ChromeActivity<C e
AddToHomescreenCoordinator.showForAppMenu(
this, getWindowAndroid(), getModalDialogManager(), currentTab.getWebContents());
RecordUserAction.record("MobileMenuAddToHomescreen");
+ } else if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
} else if (id == R.id.open_webapk_id) {
Context context = ContextUtils.getApplicationContext();
String packageName =
--- 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 implement
// 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
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -2939,6 +2939,9 @@ To change this setting, <ph name="BEGIN_
<message name="IDS_MENU_PREFERENCES" desc="Menu item for opening browser preferences. [CHAR-LIMIT=27]">
Settings
</message>
+ <message name="IDS_MENU_EXIT" desc="Menu item for exit browser. [CHAR-LIMIT=27]">
+ Exit
+ </message>
<message name="IDS_MENU_CLOSE_ALL_TABS" desc="Menu item for closing all open tabs. [CHAR-LIMIT=27]">
Close all tabs
</message>

47
patches/Bromite/Add-flag-to-disable-WebGL.patch

@ -0,0 +1,47 @@
From: csagan5 <[email protected]>
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(+)
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1537,6 +1537,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAccelerated2dCanvasName,
flag_descriptions::kAccelerated2dCanvasDescription, kOsAll,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)},
+ {switches::kDisableWebGL, flag_descriptions::kDisableWebGLName,
+ flag_descriptions::kDisableWebGLDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebGL)},
{"composited-layer-borders", flag_descriptions::kCompositedLayerBordersName,
flag_descriptions::kCompositedLayerBordersDescription, kOsAll,
SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)},
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -446,6 +446,10 @@ const char kDisableAudioForDesktopShareD
"With this flag on, desktop share picker window will not let the user "
"choose whether to share audio.";
+const char kDisableWebGLName[] = "Disable all versions of WebGL";
+
+const char kDisableWebGLDescription[] = "Disable all versions of WebGL";
+
const char kDisableBestEffortTasksName[] = "Skip best effort tasks";
const char kDisableBestEffortTasksDescription[] =
"With this flag on, tasks of the lowest priority will not be executed "
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -287,6 +287,9 @@ extern const char kDevtoolsExperimentsDe
extern const char kDisableAudioForDesktopShareName[];
extern const char kDisableAudioForDesktopShareDescription[];
+extern const char kDisableWebGLName[];
+extern const char kDisableWebGLDescription[];
+
extern const char kDisableBestEffortTasksName[];
extern const char kDisableBestEffortTasksDescription[];

171
patches/Bromite/Add-flags-to-disable-device-motion-and-orientation-APIs.patch

@ -0,0 +1,171 @@
From: csagan5 <[email protected]>
Date: Mon, 22 Oct 2018 21:29:53 +0200
Subject: Add flags to disable device motion and orientation APIs
Both flags will be disabled by default and prevent usage of gyroscope and
legacy acceleration events.
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 8 ++++++++
chrome/browser/flag_descriptions.h | 6 ++++++
content/child/runtime_features.cc | 3 +++
content/public/common/content_features.cc | 10 ++++++++++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 2 ++
third_party/blink/renderer/modules/modules_initializer.cc | 9 ++++++---
third_party/blink/renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
third_party/blink/renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
10 files changed, 59 insertions(+), 3 deletions(-)
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1767,6 +1767,12 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-gpu-rasterization", flag_descriptions::kGpuRasterizationName,
flag_descriptions::kGpuRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)},
+ {"enable-device-motion", flag_descriptions::kEnableDeviceMotionName,
+ flag_descriptions::kEnableDeviceMotionDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceMotion)},
+ {"enable-device-orientation", flag_descriptions::kEnableDeviceOrientationName,
+ flag_descriptions::kEnableDeviceOrientationDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceOrientation)},
{"enable-oop-rasterization", flag_descriptions::kOopRasterizationName,
flag_descriptions::kOopRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableOopRasterizationChoices)},
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -671,6 +671,14 @@ const char kWinrtSensorsImplementationDe
"Enables usage of the Windows.Devices.Sensors WinRT APIs on Windows for "
"sensors";
+const char kEnableDeviceMotionName[] = "Enable device motion";
+const char kEnableDeviceMotionDescription[] =
+ "Enable device motion API which is used to detect changes in acceleration";
+
+const char kEnableDeviceOrientationName[] = "Enable device orientation";
+const char kEnableDeviceOrientationDescription[] =
+ "Enable device orientation API which is used to detect changes in orientation";
+
const char kEnableGenericSensorExtraClassesName[] =
"Generic Sensor Extra Classes";
const char kEnableGenericSensorExtraClassesDescription[] =
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -412,6 +412,12 @@ extern const char kWinrtGeolocationImple
extern const char kWinrtSensorsImplementationName[];
extern const char kWinrtSensorsImplementationDescription[];
+extern const char kEnableDeviceMotionName[];
+extern const char kEnableDeviceMotionDescription[];
+
+extern const char kEnableDeviceOrientationName[];
+extern const char kEnableDeviceOrientationDescription[];
+
extern const char kEnableGenericSensorExtraClassesName[];
extern const char kEnableGenericSensorExtraClassesDescription[];
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -87,6 +87,9 @@ void SetRuntimeFeatureDefaultsForPlatfor
command_line.HasSwitch(
switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisableWebGLImageChromium) &&
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
+
!command_line.HasSwitch(switches::kDisableGpu) &&
base::FeatureList::IsEnabled(features::kWebGLImageChromium);
#else
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -690,6 +690,16 @@ const base::Feature kExperimentalProduct
// TODO(rouslan): Remove this.
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the device motion API used to track device acceleration;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceMotion{"DeviceMotion",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables the device orientation API used to track device orientation;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceOrientation{"DeviceOrientation",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Makes WebRTC use ECDSA certs by default (i.e., when no cert type was
// specified in JS).
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -157,6 +157,8 @@ CONTENT_EXPORT extern const base::Featur
CONTENT_EXPORT extern const base::Feature kFeaturePolicyForClientHints;
CONTENT_EXPORT extern const base::Feature kVideoPlaybackQuality;
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
+
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const base::Feature kAndroidAutofillAccessibility;
CONTENT_EXPORT extern const base::Feature
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -96,6 +96,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableCSSHexAlphaColor(bool);
BLINK_PLATFORM_EXPORT static void EnableSameSiteByDefaultCookies(bool);
BLINK_PLATFORM_EXPORT static void EnableScrollTopLeftInterop(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
BLINK_PLATFORM_EXPORT static void EnableKeyboardFocusableScrollers(bool);
BLINK_PLATFORM_EXPORT static void EnableDatabase(bool);
BLINK_PLATFORM_EXPORT static void EnableDecodeJpeg420ImagesToYUV(bool);
--- a/third_party/blink/renderer/modules/modules_initializer.cc
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
@@ -235,9 +235,12 @@ void ModulesInitializer::InitInspectorAg
void ModulesInitializer::OnClearWindowObjectInMainWorld(
Document& document,
const Settings& settings) const {
- DeviceMotionController::From(document);
- DeviceOrientationController::From(document);
- DeviceOrientationAbsoluteController::From(document);
+ if (RuntimeEnabledFeatures::DeviceMotionEnabled())
+ DeviceMotionController::From(document);
+ if (RuntimeEnabledFeatures::DeviceOrientationEnabled()) {
+ DeviceOrientationController::From(document);
+ DeviceOrientationAbsoluteController::From(document);
+ }
NavigatorGamepad::From(document);
NavigatorServiceWorker::From(document);
DOMWindowStorageController::From(document);
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -173,6 +173,14 @@ void WebRuntimeFeatures::EnableScrollTop
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
}
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableKeyboardFocusableScrollers(bool enable) {
RuntimeEnabledFeatures::SetKeyboardFocusableScrollersEnabled(enable);
}
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1163,6 +1163,14 @@
status: "experimental",
},
{
+ name: "DeviceMotion",
+ status: "stable",
+ },
+ {
+ name: "DeviceOrientation",
+ status: "stable",
+ },
+ {
name: "OnDeviceChange",
// Android does not yet support SystemMonitor.
status: {"Android": "", "default": "stable"},

121
patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch

@ -0,0 +1,121 @@
From: csagan5 <[email protected]>
Date: Sat, 7 Sep 2019 15:07:42 +0200
Subject: Add option to not persist tabs across sessions
---
chrome/android/java/res/values/values.xml | 3 ++
chrome/android/java/res/xml/privacy_preferences.xml | 5 ++++
chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++-
chrome/android/java/src/org/chromium/chrome/browser/settings/privacy/PrivacyPreferences.java | 12 ++++++++++
chrome/browser/ui/android/strings/android_chrome_strings.grd | 6 +++++
5 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -57,6 +57,9 @@
<!-- TODO(peconn): Add help section. -->
<!-- <string name="help_context_suggestions">mobile_content_suggestions</string> -->
+ <string name="close_tabs_on_exit_title">Close tabs on exit</string>
+ <string name="close_tabs_on_exit_summary">Don\'t persist tabs between browsing sessions</string>
+
<!-- Our manage space activity. Default pre-KitKat to be nothing. -->
<string name="manage_space_activity"></string>
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -15,6 +15,11 @@
android:title="@string/preload_pages_title"
android:summary="@string/preload_pages_summary"
android:persistent="false" />
+ <org.chromium.chrome.browser.settings.ChromeBaseCheckBoxPreference
+ android:key="close_tabs_on_exit"
+ android:title="@string/close_tabs_on_exit_title"
+ android:summary="@string/close_tabs_on_exit_summary"
+ android:defaultValue="false" />
<org.chromium.chrome.browser.settings.ChromeBasePreference
android:key="usage_stats_reporting"
android:title="@string/usage_stats_setting_title"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -1143,8 +1143,10 @@ public class ChromeTabbedActivity extend
boolean hadCipherData =
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
+ String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
boolean noRestoreState =
- CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE);
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE) ||
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
if (noRestoreState) {
// Clear the state files because they are inconsistent and useless from now on.
mTabModelSelectorImpl.clearState();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/privacy/PrivacyPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/privacy/PrivacyPreferences.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/privacy/PrivacyPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/privacy/PrivacyPreferences.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.settings.privacy;
+import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.preference.CheckBoxPreference;
@@ -13,6 +14,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import org.chromium.base.ContextUtils;
import org.chromium.base.BuildInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.help.HelpAndFeedback;
@@ -35,6 +37,7 @@ public class PrivacyPreferences
extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
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_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
private static final String PREF_USAGE_STATS = "usage_stats_reporting";
private static final String PREF_DO_NOT_TRACK = "do_not_track";
private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link";
@@ -82,6 +85,10 @@ public class PrivacyPreferences
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((boolean) newValue);
+ } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) {
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
+ sharedPreferencesEditor.apply();
}
return true;
@@ -130,6 +137,11 @@ public class PrivacyPreferences
} else {
getPreferenceScreen().removePreference(usageStatsPref);
}
+
+ ChromeBaseCheckBoxPreference closeTabsOnExitPref =
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
}
}
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
@@ -3746,6 +3746,12 @@ The site does NOT gain access to the cam
<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>

194
patches/Bromite/Add-option-to-use-home-page-as-NTP.patch

@ -0,0 +1,194 @@
cFrom: csagan5 <[email protected]>
Date: Mon, 18 Mar 2019 21:47:12 +0100
Subject: Add option to use home page as NTP
Use about:blank as default homepage
---
chrome/android/java/res/xml/homepage_preferences.xml | 5 ++
chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java | 24 +++++++++-
chrome/android/java/src/org/chromium/chrome/browser/settings/HomepagePreferences.java | 10 ++++
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java | 11 +++-
chrome/browser/ui/android/strings/android_chrome_strings.grd | 3 +
chrome/browser/ui/browser_ui_prefs.cc | 2
chrome/common/pref_names.cc | 4 +
chrome/common/pref_names.h | 1
8 files changed, 56 insertions(+), 4 deletions(-)
--- a/chrome/android/java/res/xml/homepage_preferences.xml
+++ b/chrome/android/java/res/xml/homepage_preferences.xml
@@ -7,6 +7,11 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<org.chromium.chrome.browser.settings.ChromeSwitchPreference
+ android:key="ntp_is_homepage_switch"
+ android:summaryOn="@string/options_ntp_is_homepage_label"
+ android:summaryOff="@string/options_ntp_is_homepage_label" />
+
+ <org.chromium.chrome.browser.settings.ChromeSwitchPreference
android:key="homepage_switch"
android:summaryOn="@string/text_on"
android:summaryOff="@string/text_off" />
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
@@ -31,6 +31,7 @@ public class HomepageManager {
}
private static final String PREF_HOMEPAGE_ENABLED = "homepage";
+ public static final String PREF_NTP_IS_HOMEPAGE = "newtabpage_is_homepage";
private static final String PREF_HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
private static final String PREF_HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled";
@@ -90,7 +91,8 @@ public class HomepageManager {
*/
public static boolean shouldCloseAppWithZeroTabs() {
return HomepageManager.isHomepageEnabled()
- && !NewTabPage.isNTPUrl(HomepageManager.getHomepageUri());
+ && !NewTabPage.isNTPUrl(HomepageManager.getHomepageUri())
+ && (HomepageManager.getHomepageUri() != "about:blank");
}
/**
@@ -113,7 +115,7 @@ public class HomepageManager {
public static String getDefaultHomepageUri() {
return PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
? PartnerBrowserCustomizations.getHomePageUrl()
- : UrlConstants.NTP_NON_NATIVE_URL;
+ : "about:blank";
}
/**
@@ -127,6 +129,14 @@ public class HomepageManager {
}
/**
+ * Returns the user preference for whether the New Tab Page is the homepage or not.
+ *
+ */
+ public boolean getPrefNTPIsHomepageEnabled() {
+ return mSharedPreferences.getBoolean(PREF_NTP_IS_HOMEPAGE, false);
+ }
+
+ /**
* Sets the user preference for whether the homepage is enabled.
*/
public void setPrefHomepageEnabled(boolean enabled) {
@@ -139,6 +149,16 @@ public class HomepageManager {
notifyHomepageUpdated();
}
+ /**
+ * Sets the user preference for whether the new tab page is the homepage or not.
+ */
+ public void setPrefNTPIsHomepageEnabled(boolean enabled) {
+ SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
+ sharedPreferencesEditor.putBoolean(PREF_NTP_IS_HOMEPAGE, enabled);
+ sharedPreferencesEditor.apply();
+ notifyHomepageUpdated();
+ }
+
/**
* @return User specified homepage custom URI string.
*/
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/HomepagePreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/HomepagePreferences.java
@@ -21,6 +21,7 @@ public class HomepagePreferences extends
@VisibleForTesting
public static final String PREF_HOMEPAGE_SWITCH = "homepage_switch";
private static final String PREF_HOMEPAGE_EDIT = "homepage_edit";
+ private static final String PREF_NTP_HOMEPAGE_SWITCH = "ntp_is_homepage_switch";
private HomepageManager mHomepageManager;
private Preference mHomepageEdit;
@@ -46,6 +47,15 @@ public class HomepagePreferences extends
});
}
+ ChromeSwitchPreference mNTPIsHomepageSwitch =
+ (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
+ boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
+ mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
+ mNTPIsHomepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
+ mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
+ return true;
+ });
+
mHomepageEdit = findPreference(PREF_HOMEPAGE_EDIT);
updateCurrentHomepageUrl();
}
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
@@ -12,6 +12,7 @@ import org.chromium.chrome.browser.tab.T
import org.chromium.chrome.browser.util.UrlConstants;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;
+import org.chromium.chrome.browser.partnercustomizations.HomepageManager;
/**
* An interface to return a {@link TabCreator} either for regular or incognito tabs.
@@ -85,12 +86,18 @@ public interface TabCreatorManager {
}
/**
- * Creates a new tab and loads the NTP.
+ * Creates a new tab and loads the NTP or the homepage, depending on user preferences.
*/
public final void launchNTP() {
try {
+ String newTabURL;
+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
+ newTabURL = HomepageManager.getHomepageUri();
+ } else {
+ newTabURL = UrlConstants.NTP_URL;
+ }
TraceEvent.begin("TabCreator.launchNTP");
- launchUrl(UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI);
+ launchUrl(newTabURL, TabLaunchType.FROM_CHROME_UI);
} finally {
TraceEvent.end("TabCreator.launchNTP");
}
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -702,6 +702,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_OPTIONS_HOMEPAGE_EDIT_LABEL" desc="The label for the edit text field that allows the user to change the URL that is opened when they tap on the home page button in the omnibox.">
Open this page
</message>
+ <message name="IDS_OPTIONS_NTP_IS_HOMEPAGE_LABEL" desc="The label for switch that allows the user to toggle whether opening a new tab leads to the new tab page or the home page.">
+ Use for new tabs
+ </message>
<!-- Notifications preferences -->
<message name="IDS_PREFS_NOTIFICATIONS" desc="Title for Notification preferences.">
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -55,6 +55,8 @@ void RegisterBrowserUserPrefs(user_prefs
GetHomeButtonAndHomePageIsNewTabPageFlags());
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
GetHomeButtonAndHomePageIsNewTabPageFlags());
+ registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false,
+ GetHomeButtonAndHomePageIsNewTabPageFlags());
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
bool reset_check_default = false;
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -59,6 +59,10 @@ const char kForceEphemeralProfiles[] = "
// A boolean specifying whether the New Tab page is the home page or not.
const char kHomePageIsNewTabPage[] = "homepage_is_newtabpage";
+// A boolean specifying whether opening a new tab should open the Home page
+// instead of the New Tab page.
+const char kNewTabPageIsHomePage[] = "newtabpage_is_homepage";
+
// This is the URL of the page to load when opening new tabs.
const char kHomePage[] = "homepage";
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -323,6 +323,7 @@ extern const char kSettingsShowOSBanner[
extern const char kDeviceLoginScreenWebUsbAllowDevicesForUrls[];
#endif // defined(OS_CHROMEOS)
extern const char kShowHomeButton[];
+extern const char kNewTabPageIsHomePage[];
extern const char kSpeechRecognitionFilterProfanities[];
extern const char kAllowDeletingBrowserHistory[];
#if !defined(OS_ANDROID)

500
patches/Bromite/Add-user-setting-for-DNS-over-HTTPS-DoH-custom-URL.patch

@ -0,0 +1,500 @@
From: csagan5 <[email protected]>
Date: Sat, 23 Nov 2019 10:55:16 +0100
Subject: Add user setting for DNS-over-HTTPS (DoH) custom URL
---
chrome/android/chrome_java_sources.gni | 2
chrome/android/java/res/layout/doh_editor.xml | 65 +++++++
chrome/android/java/res/values/values.xml | 2
chrome/android/java/res/xml/doh_preferences.xml | 25 ++
chrome/android/java/res/xml/privacy_preferences.xml | 5
chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java | 24 ++
chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java | 92 ++++++++++
chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java | 54 +++++
chrome/app/generated_resources.grd | 6
chrome/browser/android/feature_utilities.cc | 23 ++
chrome/browser/net/system_network_context_manager.cc | 46 +----
chrome/browser/ui/android/strings/android_chrome_strings.grd | 11 +
chrome/common/chrome_features.cc | 4
13 files changed, 322 insertions(+), 37 deletions(-)
create mode 100644 chrome/android/java/res/layout/doh_editor.xml
create mode 100644 chrome/android/java/res/xml/doh_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1345,6 +1345,8 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/settings/ChromeSwitchPreference.java",
"java/src/org/chromium/chrome/browser/settings/ClearBrowsingDataCheckBoxPreference.java",
"java/src/org/chromium/chrome/browser/settings/ExpandablePreferenceGroup.java",
+ "java/src/org/chromium/chrome/browser/settings/DoHEditor.java",
+ "java/src/org/chromium/chrome/browser/settings/DoHPreferences.java",
"java/src/org/chromium/chrome/browser/settings/HomepageEditor.java",
"java/src/org/chromium/chrome/browser/settings/HomepagePreferences.java",
"java/src/org/chromium/chrome/browser/settings/HyperlinkPreference.java",
--- /dev/null
+++ b/chrome/android/java/res/layout/doh_editor.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2015 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. -->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scroll_view"
+ android:fillViewport="true" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:focusableInTouchMode="true" >
+
+ <org.chromium.chrome.browser.widget.ChromeTextInputLayout
+ android:id="@+id/doh_url"
+ style="@style/PreferenceScreenLayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+ <!-- TODO(crbug.com/900912): Fix and remove lint ignore -->
+ <EditText
+ tools:ignore="Autofill"
+ android:id="@+id/doh_url_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="textUri"
+ android:singleLine="true"
+ android:hint="@string/options_doh_edit_label" />
+ </org.chromium.chrome.browser.widget.ChromeTextInputLayout>
+
+ <Space style="@style/ButtonBarTopSpacer" />
+ <View style="@style/ButtonBarTopDivider" />
+
+ <LinearLayout style="@style/ButtonBar" >
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_reset"
+ style="@style/ButtonBarButton"
+ android:text="@string/reset" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_cancel"
+ style="@style/ButtonBarButton"
+ android:text="@string/cancel" />
+
+ <org.chromium.ui.widget.ButtonCompat
+ android:id="@+id/doh_save"
+ style="@style/ButtonBarButton"
+ android:text="@string/save" />
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+
+ <include layout="@layout/preferences_action_bar_shadow"/>
+
+</FrameLayout>
--- a/chrome/android/java/res/values/values.xml
+++ b/chrome/android/java/res/values/values.xml
@@ -80,6 +80,8 @@
<integer name="download_infobar_bar_fill_in_delay">400</integer>
<integer name="download_infobar_bar_fill_out_delay">200</integer>
+ <string name="doh_help_url">https://www.bromite.org/doh</string>
+
<!-- Bottom navigation bar styling. -->
<bool name="window_light_navigation_bar">true</bool>
--- /dev/null
+++ b/chrome/android/java/res/xml/doh_preferences.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2015 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. -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <org.chromium.chrome.browser.settings.ChromeSwitchPreference
+ android:key="doh_switch"
+ android:summaryOn="@string/text_on"
+ android:summaryOff="@string/text_off" />
+
+ <org.chromium.chrome.browser.settings.HyperlinkPreference
+ android:key="doh_help"
+ android:title="@string/doh_help"
+ app:url="@string/doh_help_url" />
+
+ <Preference
+ android:key="doh_edit"
+ android:title="@string/options_doh_edit_label"
+ android:fragment="org.chromium.chrome.browser.settings.DoHEditor" />
+
+</PreferenceScreen>
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -10,6 +10,11 @@
android:key="can_make_payment"
android:title="@string/can_make_payment_title"
android:summary="@string/settings_can_make_payment_toggle_label" />
+ <Preference
+ android:fragment="org.chromium.chrome.browser.settings.DoHPreferences"
+ android:key="doh"
+ android:title="@string/options_doh_title"
+ android:summary="@string/options_doh_summary" />
<org.chromium.chrome.browser.settings.ChromeBaseCheckBoxPreference
android:key="preload_pages"
android:title="@string/preload_pages_title"
--- a/chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java
@@ -95,6 +95,26 @@ public class FeatureUtilities {
FeatureUtilitiesJni.get().setCustomTabVisible(visible);
}
+ /**
+ * Records whether custom URL for DoH is enabled with native-side feature utilities.
+ * @param url Whether custom URL is enabled or not.
+ */
+ public static void setDoHEnabled(boolean enabled) {
+ FeatureUtilitiesJni.get().setDoHEnabled(enabled);
+ }
+
+ public static boolean getDoHEnabled() {
+ return FeatureUtilitiesJni.get().getDoHEnabled();
+ }
+
+ public static void setDoHTemplates(String t) {
+ FeatureUtilitiesJni.get().setDoHTemplates(t);
+ }
+
+ public static String getDoHTemplates() {
+ return FeatureUtilitiesJni.get().getDoHTemplates();
+ }
+
/**
* Records whether the activity is in multi-window mode with native-side feature utilities.
* @param isInMultiWindowMode Whether the activity is in Android N multi-window mode.
@@ -728,6 +748,10 @@ public class FeatureUtilities {
void setCustomTabVisible(boolean visible);
void setActivityType(@ActivityType int type);
void setIsInMultiWindowMode(boolean isInMultiWindowMode);
+ void setDoHEnabled(boolean enabled);
+ boolean getDoHEnabled();
+ void setDoHTemplates(String templates);
+ String getDoHTemplates();
boolean isNetworkServiceWarmUpEnabled();
}
}
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHEditor.java
@@ -0,0 +1,92 @@
+// Copyright 2015 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.settings;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.EditText;
+
+import org.chromium.chrome.browser.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.FeatureUtilities;
+import org.chromium.chrome.R;
+import org.chromium.components.url_formatter.UrlFormatter;
+
+/**
+ * Provides the Java-UI for editing the DNS-over-HTTPS (DoH) preference.
+ */
+public class DoHEditor extends Fragment implements TextWatcher {
+ private EditText mDoHUrlEdit;
+ private Button mSaveButton;
+ private Button mResetButton;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getActivity().setTitle(R.string.options_doh_edit_title);
+
+ View v = inflater.inflate(R.layout.doh_editor, container, false);
+ View scrollView = v.findViewById(R.id.scroll_view);
+ scrollView.getViewTreeObserver().addOnScrollChangedListener(
+ SettingsUtils.getShowShadowOnScrollListener(v, v.findViewById(R.id.shadow)));
+ mDoHUrlEdit = (EditText) v.findViewById(R.id.doh_url_edit);
+ mDoHUrlEdit.setText(FeatureUtilities.getDoHTemplates());
+ mDoHUrlEdit.addTextChangedListener(this);
+ mDoHUrlEdit.requestFocus();
+
+ initializeSaveCancelResetButtons(v);
+ return v;
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ mSaveButton.setEnabled(s.length() != 0);
+ mResetButton.setEnabled(true);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+
+ private void initializeSaveCancelResetButtons(View v) {
+ mResetButton = (Button) v.findViewById(R.id.doh_reset);
+ mResetButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mDoHUrlEdit.setText(FeatureUtilities.getDoHTemplates());
+ getActivity().finish();
+ }
+ });
+
+ mSaveButton = (Button) v.findViewById(R.id.doh_save);
+ mSaveButton.setEnabled(false);
+ mSaveButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ FeatureUtilities.setDoHTemplates(
+ mDoHUrlEdit.getText().toString());
+ getActivity().finish();
+ }
+ });
+
+ Button button = (Button) v.findViewById(R.id.doh_cancel);
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().finish();
+ }
+ });
+ }
+}
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/DoHPreferences.java
@@ -0,0 +1,54 @@
+// Copyright 2015 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.settings;
+
+import android.os.Bundle;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceFragmentCompat;
+import org.chromium.chrome.browser.settings.ChromeSwitchPreference;
+
+import org.chromium.chrome.browser.settings.SettingsUtils;
+import org.chromium.chrome.browser.flags.FeatureUtilities;
+import androidx.annotation.VisibleForTesting;
+import org.chromium.chrome.R;
+
+/**
+ * Fragment that allows the user to configure DoH related preferences.
+ */
+public class DoHPreferences extends PreferenceFragmentCompat {
+ @VisibleForTesting
+ public static final String PREF_DOH_SWITCH = "doh_switch";
+ private static final String PREF_DOH_EDIT = "doh_edit";
+
+ private Preference mDoHEdit;
+
+ @Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+ getActivity().setTitle(R.string.options_doh_title);
+ SettingsUtils.addPreferencesFromResource(this, R.xml.doh_preferences);
+
+ ChromeSwitchPreference mDoHSwitch =
+ (ChromeSwitchPreference) findPreference(PREF_DOH_SWITCH);
+ boolean isDoHEnabled = FeatureUtilities.getDoHEnabled();
+ mDoHSwitch.setChecked(isDoHEnabled);
+ mDoHSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
+ FeatureUtilities.setDoHEnabled((boolean) newValue);
+ return true;
+ });
+
+ mDoHEdit = findPreference(PREF_DOH_EDIT);
+ updateCurrentDoHUrl();
+ }
+
+ private void updateCurrentDoHUrl() {
+ mDoHEdit.setSummary(FeatureUtilities.getDoHTemplates());
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ updateCurrentDoHUrl();
+ }
+}
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6699,6 +6699,12 @@ the Bookmarks menu.">
<message name="IDS_OPTIONS_HOMEPAGE_TITLE" desc="The title of the home page overlay on Android" formatter_data="android_java">
Home page
</message>
+ <message name="IDS_OPTIONS_DOH_TITLE" desc="The title of the DNS-over-HTTPS option on Android" formatter_data="android_java">
+ Secure DNS
+ </message>
+ <message name="IDS_OPTIONS_DOH_SUMMARY" desc="The title of the DNS-over-HTTPS summary on Android" formatter_data="android_java">
+ Configure DNS-over-HTTPS (DoH) secure DNS
+ </message>
</if>
<!-- Autofill dialog: field labels. -->
--- a/chrome/browser/android/feature_utilities.cc
+++ b/chrome/browser/android/feature_utilities.cc
@@ -7,6 +7,9 @@
#include "chrome/android/chrome_jni_headers/FeatureUtilities_jni.h"
#include "base/android/jni_string.h"
+#include "chrome/browser/browser_process.h"
+#include "components/prefs/pref_service.h"
+#include "chrome/common/pref_names.h"
#include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/ntp_snippets/content_suggestions_service.h"
@@ -79,3 +82,23 @@ static jboolean JNI_FeatureUtilities_IsN
return content::IsOutOfProcessNetworkService() &&
base::FeatureList::IsEnabled(features::kWarmUpNetworkProcess);
}
+
+static jboolean JNI_FeatureUtilities_GetDoHEnabled(JNIEnv* env) {
+ std::string doh_mode = g_browser_process->local_state()->GetString(prefs::kDnsOverHttpsMode);
+ return ((doh_mode == "secure") || (doh_mode == "auto"));
+}
+
+static void JNI_FeatureUtilities_SetDoHEnabled(JNIEnv* env, jboolean enabled) {
+ if (enabled)
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsMode, "secure");
+ else
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsMode, "off");
+}
+
+static ScopedJavaLocalRef<jstring> JNI_FeatureUtilities_GetDoHTemplates(JNIEnv* env) {
+ return base::android::ConvertUTF8ToJavaString(env, g_browser_process->local_state()->GetString(prefs::kDnsOverHttpsTemplates));
+}
+
+static void JNI_FeatureUtilities_SetDoHTemplates(JNIEnv* env, const JavaParamRef<jstring>& templates) {
+ g_browser_process->local_state()->SetString(prefs::kDnsOverHttpsTemplates, base::android::ConvertJavaStringToUTF8(env, templates));
+}
--- a/chrome/browser/net/system_network_context_manager.cc
+++ b/chrome/browser/net/system_network_context_manager.cc
@@ -139,9 +139,14 @@ void GetStubResolverConfig(
std::string doh_templates =
local_state->GetString(prefs::kDnsOverHttpsTemplates);
- std::string server_method;
- if (!doh_templates.empty() &&
- *secure_dns_mode != net::DnsConfig::SecureDnsMode::OFF) {
+ if (doh_templates.empty()) {
+ *secure_dns_mode = net::DnsConfig::SecureDnsMode::OFF;
+ doh_mode = chrome_browser_net::kDnsOverHttpsModeOff;
+ }
+
+ LOG(INFO) << "DoH templates: '" << doh_templates << "' with mode " << doh_mode;
+ if (*secure_dns_mode != net::DnsConfig::SecureDnsMode::OFF) {
+ std::string server_method;
for (const std::string& server_template :
SplitString(doh_templates, " ", base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY)) {
@@ -427,40 +432,11 @@ SystemNetworkContextManager::SystemNetwo
// features before registering change callbacks for these preferences.
local_state_->SetDefaultPrefValue(prefs::kBuiltInDnsClientEnabled,
base::Value(ShouldEnableAsyncDns()));
- std::string default_doh_mode = chrome_browser_net::kDnsOverHttpsModeOff;
- std::string default_doh_templates = "";
- if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
- if (features::kDnsOverHttpsFallbackParam.Get()) {
- default_doh_mode = chrome_browser_net::kDnsOverHttpsModeAutomatic;
- } else {
- default_doh_mode = chrome_browser_net::kDnsOverHttpsModeSecure;
- }
- default_doh_templates = features::kDnsOverHttpsTemplatesParam.Get();
- }
+ //NOTE: DoH fallback feature to insecure mode is not evaluated
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsMode,
- base::Value(default_doh_mode));
+ base::Value(chrome_browser_net::kDnsOverHttpsModeOff));
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsTemplates,
- base::Value(default_doh_templates));
-
- // If the user has explicitly enabled or disabled the DoH experiment in
- // chrome://flags, store that choice in the user prefs so that it can be
- // persisted after the experiment ends. Also make sure to remove the stored
- // prefs value if the user has changed their chrome://flags selection to the
- // default.
- flags_ui::PrefServiceFlagsStorage flags_storage(local_state_);
- std::set<std::string> entries = flags_storage.GetFlags();
- if (entries.count("[email protected]")) {
- // The user has "Enabled" selected.
- local_state_->SetString(prefs::kDnsOverHttpsMode,
- chrome_browser_net::kDnsOverHttpsModeAutomatic);
- } else if (entries.count("[email protected]")) {
- // The user has "Disabled" selected.
- local_state_->SetString(prefs::kDnsOverHttpsMode,
- chrome_browser_net::kDnsOverHttpsModeOff);
- } else {
- // The user has "Default" selected.
- local_state_->ClearPref(prefs::kDnsOverHttpsMode);
- }
+ base::Value(features::kDnsOverHttpsTemplatesParam.Get()));
PrefChangeRegistrar::NamedChangeCallback dns_pref_callback =
base::BindRepeating(&OnStubResolverConfigChanged,
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -695,6 +695,17 @@ CHAR-LIMIT guidelines:
Chrome Passwords
</message>
+ <!-- DoH preferences -->
+ <message name="IDS_OPTIONS_DOH_EDIT_TITLE" desc="The title of the screen that allows users to change the URL that is used for DNS-over-HTTPS queries.">
+ Edit DoH template URLs
+ </message>
+ <message name="IDS_OPTIONS_DOH_EDIT_LABEL" desc="The label for the edit text field that allows the user to change the URL that is used for DNS-over-HTTPS queries.">
+ DoH template URLs
+ </message>
+ <message name="IDS_DOH_HELP" desc="The title of the hyperlink that allows users to visit the wiki page with instructions for DNS-over-HTTPS configuration.">
+ Visit help page
+ </message>
+
<!-- Homepage preferences -->
<message name="IDS_OPTIONS_HOMEPAGE_EDIT_TITLE" desc="The title of the screen that allows users to change the URL that opens when they tap on the home page button in the omnibox.">
Edit home page
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -303,12 +303,12 @@ const char kDisallowUnsafeHttpDownloadsP
// Enable DNS over HTTPS (DoH).
const base::Feature kDnsOverHttps{"DnsOverHttps",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Set whether fallback to insecure DNS is allowed by default. This setting may
// be overridden for individual transactions.
const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
- "Fallback", true};
+ "Fallback", false};
// Supply one or more space-separated DoH server URI templates to use when this
// feature is enabled. If no templates are specified, then a hardcoded mapping

103
patches/Bromite/Remove-SMS-integration.patch

@ -1,103 +0,0 @@
From: csagan5 <[email protected]>
Date: Sun, 3 Nov 2019 08:22:29 +0100
Subject: Remove SMS integration
---
content/public/android/BUILD.gn | 2 -
.../org/chromium/content/browser/sms/Wrappers.java | 74 ----------------------
2 files changed, 76 deletions(-)
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@@ -232,8 +232,6 @@ android_library("content_java") {
"java/src/org/chromium/content/browser/selection/SmartSelectionClient.java",
"java/src/org/chromium/content/browser/selection/SmartSelectionMetricsLogger.java",
"java/src/org/chromium/content/browser/selection/SmartSelectionProvider.java",
- "java/src/org/chromium/content/browser/sms/SmsReceiver.java",
- "java/src/org/chromium/content/browser/sms/Wrappers.java",
"java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java",
"java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java",
"java/src/org/chromium/content/common/ContentSwitchUtils.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
deleted file mode 100644
--- a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content.browser.sms;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.Intent;
-import android.content.IntentFilter;
-
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
-import com.google.android.gms.tasks.Task;
-
-class Wrappers {
- // Prevent instantiation.
- private Wrappers() {}
-
- /**
- * Wraps com.google.android.gms.auth.api.phone.SmsRetrieverClient.
- */
- static class SmsRetrieverClientWrapper {
- private final SmsRetrieverClient mSmsRetrieverClient;
- private SmsReceiverContext mContext;
-
- public SmsRetrieverClientWrapper(SmsRetrieverClient smsRetrieverClient) {
- mSmsRetrieverClient = smsRetrieverClient;
- }
-
- public void setContext(SmsReceiverContext context) {
- mContext = context;
- }
-
- public SmsReceiverContext getContext() {
- return mContext;
- }
-
- public Task<Void> startSmsRetriever() {
- return mSmsRetrieverClient.startSmsRetriever();
- }
- }
-
- /**
- * Extends android.content.ContextWrapper to store and retrieve the
- * registered BroadcastReceiver.
- */
- static class SmsReceiverContext extends ContextWrapper {
- private BroadcastReceiver mReceiver;
-
- public SmsReceiverContext(Context context) {
- super(context);
- }
-
- public BroadcastReceiver getRegisteredReceiver() {
- return mReceiver;
- }
-
- // ---------------------------------------------------------------------
- // Context overrides:
-
- @Override
- public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
- mReceiver = receiver;
- return super.registerReceiver(receiver, filter);
- }
-
- @Override
- public void unregisterReceiver(BroadcastReceiver receiver) {
- mReceiver = null;
- super.unregisterReceiver(receiver);
- }
- }
-}
--
2.11.0

64
patches/Bromite/Revert-flags-remove-disable-pull-to-refresh-effect.patch

@ -0,0 +1,64 @@
From: csagan5 <[email protected]>
Date: Mon, 2 Dec 2019 21:15:32 +0100
Subject: Revert "flags: remove disable-pull-to-refresh-effect"
This reverts commit 4e598f38a0e6dd3dbede009c6a99b2a520a94e1f.
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag-metadata.json | 5 +++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
4 files changed, 16 insertions(+)
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2094,6 +2094,10 @@ const FeatureEntry kFeatureEntries[] = {
SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
#endif // OS_MACOSX
#if defined(OS_ANDROID)
+ {"disable-pull-to-refresh-effect",
+ flag_descriptions::kPullToRefreshEffectName,
+ flag_descriptions::kPullToRefreshEffectDescription, kOsAndroid,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)},
{"translate-force-trigger-on-english",
flag_descriptions::kTranslateForceTriggerOnEnglishName,
flag_descriptions::kTranslateForceTriggerOnEnglishDescription, kOsAndroid,
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -777,6 +777,11 @@
"expiry_milestone": 88
},
{
+ "name": "disable-pull-to-refresh-effect",
+ // "owners": [ "your-team" ],
+ "expiry_milestone": -1
+ },
+ {
// See https://crbug.com/882238.
"name": "disable-pushstate-throttle",
"owners": [ "[email protected]", "[email protected]" ],
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2746,6 +2746,10 @@ extern const char kProcessSharingWithStr
"separated like strict site isolation, but process selection puts multiple "
"site instances in a single process.";
+const char kPullToRefreshEffectName[] = "The pull-to-refresh effect";
+const char kPullToRefreshEffectDescription[] =
+ "Page reloads triggered by vertically overscrolling content.";
+
const char kReaderModeHeuristicsName[] = "Reader Mode triggering";
const char kReaderModeHeuristicsDescription[] =
"Determines what pages the Reader Mode infobar is shown on.";
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1613,6 +1613,9 @@ extern const char kProcessSharingWithDef
extern const char kProcessSharingWithStrictSiteInstancesName[];
extern const char kProcessSharingWithStrictSiteInstancesDescription[];
+extern const char kPullToRefreshEffectName[];
+extern const char kPullToRefreshEffectDescription[];
+
extern const char kReaderModeHeuristicsName[];
extern const char kReaderModeHeuristicsDescription[];
extern const char kReaderModeHeuristicsMarkup[];

44
patches/Bromite/Use-a-minimum-DoH-timeout-of-400ms.patch

@ -0,0 +1,44 @@
From: csagan5 <[email protected]>
Date: Thu, 9 Jan 2020 19:59:08 +0100
Subject: Use a minimum DoH timeout of 400ms
---
net/dns/dns_session.cc | 7 ++++++-
net/dns/dns_session.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
--- a/net/dns/dns_session.cc
+++ b/net/dns/dns_session.cc
@@ -118,6 +118,8 @@ DnsSession::DnsSession(const DnsConfig&
socket_pool_->Initialize(&config_.nameservers, net_log);
UMA_HISTOGRAM_CUSTOM_COUNTS("AsyncDNS.ServerCount",
config_.nameservers.size(), 1, 10, 11);
+ // minimum timeout for all DoH requests
+ min_doh_timeout_ = base::TimeDelta::FromMilliseconds(400);
UpdateTimeouts(NetworkChangeNotifier::GetConnectionType());
InitializeServerStats();
}
@@ -325,9 +327,12 @@ base::TimeDelta DnsSession::NextTimeout(
}
base::TimeDelta DnsSession::NextDohTimeout(unsigned doh_server_index) {
- return NextTimeoutHelper(
+ base::TimeDelta timeout = NextTimeoutHelper(
GetServerStats(doh_server_index, true /* is _doh_server */),
0 /* num_backoffs */);
+ if (timeout < min_doh_timeout_)
+ return min_doh_timeout_;
+ return timeout;
}
base::TimeDelta DnsSession::NextTimeoutHelper(ServerStats* server_stats,
--- a/net/dns/dns_session.h
+++ b/net/dns/dns_session.h
@@ -167,6 +167,7 @@ class NET_EXPORT_PRIVATE DnsSession : pu
base::TimeDelta initial_timeout_;
base::TimeDelta max_timeout_;
+ base::TimeDelta min_doh_timeout_;
// Track runtime statistics of each insecure DNS server.
std::vector<std::unique_ptr<ServerStats>> server_stats_;

43
patches/Bromite/updater-disable-updater-pings.patch

@ -0,0 +1,43 @@
From: Jan Engelhardt <[email protected]>
Date: Tue, 2 Jun 2015 11:01:50 +0200
Subject: updater: disable updater pings
Despite auto-updater being arguably disabled (see previous commit),
Chromium would still send background requests. Kill it.
(trk:170, trk:171)
---
components/component_updater/configurator_impl.cc | 5 +----
components/component_updater/configurator_impl.h | 1 -
2 files changed, 1 insertion(+), 5 deletions(-)
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -42,8 +42,7 @@ ConfiguratorImpl::ConfiguratorImpl(
: background_downloads_enabled_(config_policy.BackgroundDownloadsEnabled()),
deltas_enabled_(config_policy.DeltaUpdatesEnabled()),
fast_update_(config_policy.FastUpdate()),
- pings_enabled_(config_policy.PingsEnabled()),
- require_encryption_(require_encryption),
+ pings_enabled_(false),
url_source_override_(config_policy.UrlSourceOverride()),
initial_delay_(config_policy.InitialDelay()) {
if (config_policy.TestRequest()) {
@@ -78,8 +77,6 @@ std::vector<GURL> ConfiguratorImpl::Upda
std::vector<GURL> urls{GURL(kUpdaterJSONDefaultUrl),
GURL(kUpdaterJSONFallbackUrl)};
- if (require_encryption_)
- update_client::RemoveUnsecureUrls(&urls);
return urls;
}
--- a/components/component_updater/configurator_impl.h
+++ b/components/component_updater/configurator_impl.h
@@ -98,7 +98,6 @@ class ConfiguratorImpl {
const bool deltas_enabled_;
const bool fast_update_;
const bool pings_enabled_;
- const bool require_encryption_;
const GURL url_source_override_;
const int initial_delay_;

24
patches/Unobtainium/kill-Auth.patch

@ -8,12 +8,11 @@ Subject: kill Auth
.../signin/SystemAccountManagerDelegate.java | 50 ++--------------------
3 files changed, 5 insertions(+), 76 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
@@ -11,10 +11,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
@@ -12,10 +12,6 @@ import android.content.SharedPreferences
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.auth.AccountChangeEvent;
-import com.google.android.gms.auth.GoogleAuthException;
@ -21,7 +20,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHe
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.task.AsyncTask;
@@ -73,23 +69,7 @@ public class SigninHelper {
@Override
public List<String> getAccountChangeEvents(
@ -47,19 +46,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHe
return new ArrayList<>(0);
}
}
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
@@ -4,8 +4,6 @@
@@ -6,8 +6,6 @@ package org.chromium.components.signin;
package org.chromium.components.signin;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
@@ -40,12 +38,7 @@ public class AccountIdProvider {
@@ -41,12 +39,7 @@ public class AccountIdProvider {
* @param accountName The email address of a Google account.
*/
public String getAccountId(String accountName) {
@ -73,7 +71,6 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
}
/**
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
@@ -24,9 +24,6 @@ import android.os.PatternMatcher;
@ -86,7 +83,7 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
@@ -116,48 +113,18 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
@@ -116,48 +113,18 @@ public class SystemAccountManagerDelegat
// so don't report any accounts if Google Play Services are out of date.
checkCanUseGooglePlayServices();
@ -138,7 +135,7 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
}
@Override
@@ -197,17 +164,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
@@ -197,17 +164,6 @@ public class SystemAccountManagerDelegat
@SuppressLint("MissingPermission")
@Override
public void createAddAccountIntent(Callback<Intent> callback) {
@ -156,6 +153,3 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
}
// No permission is needed on 23+ and Chrome always has MANAGE_ACCOUNTS permission on lower APIs
--
2.11.0

114
patches/Unobtainium/kill-GCM.patch

@ -3,28 +3,27 @@ Date: Fri, 22 Jun 2018 17:11:38 +0200
Subject: kill GCM
---
chrome/android/BUILD.gn | 1 -
chrome/android/chrome_java_sources.gni | 6 -
chrome/android/java/AndroidManifest.xml | 64 -------
.../ChromeBackgroundTaskFactory.java | 3 -
.../browser/ntp/snippets/SnippetsLauncher.java | 45 +----
.../browser/services/gcm/GCMBackgroundTask.java | 2 +-
.../gcm/InvalidationGcmUpstreamSender.java | 18 --
components/background_task_scheduler/BUILD.gn | 1 -
.../BackgroundTaskSchedulerGcmNetworkManager.java | 206 +--------------------
components/gcm_driver/android/BUILD.gn | 1 -
components/gcm_driver/instance_id/android/BUILD.gn | 1 -
.../gcm_driver/instance_id/InstanceIDBridge.java | 52 +-----
components/sync/android/BUILD.gn | 1 -
third_party/cacheinvalidation/BUILD.gn | 6 -
.../client/contrib/MultiplexingGcmListener.java | 91 +--------
.../android2/channel/AndroidNetworkChannel.java | 6 +-
chrome/android/BUILD.gn | 1
chrome/android/chrome_java_sources.gni | 6
chrome/android/java/AndroidManifest.xml | 64 ---
chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java | 3
chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java | 45 --
chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java | 2
chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java | 18
components/background_task_scheduler/BUILD.gn | 1
components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java | 206 ----------
components/gcm_driver/android/BUILD.gn | 1
components/gcm_driver/instance_id/android/BUILD.gn | 1
components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java | 52 --
components/sync/android/BUILD.gn | 1
third_party/cacheinvalidation/BUILD.gn | 6
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/contrib/MultiplexingGcmListener.java | 91 ----
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidNetworkChannel.java | 6
16 files changed, 10 insertions(+), 494 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -370,7 +370,6 @@ android_library("chrome_java") {
@@ -337,7 +337,6 @@ android_library("chrome_java") {
"//third_party/android_deps:com_google_protobuf_protobuf_lite_java",
"//third_party/android_deps:javax_inject_javax_inject_java",
"//third_party/android_media:android_media_java",
@ -32,7 +31,6 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//third_party/android_sdk/androidx_browser:androidx_browser_java",
"//third_party/android_swipe_refresh:android_swipe_refresh_java",
"//third_party/blink/public:blink_headers_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
@@ -16,7 +16,6 @@ chrome_java_sources = [
@ -43,7 +41,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java
"java/src/org/chromium/chrome/browser/ChromeBackupAgent.java",
"java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
"java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java",
@@ -1437,11 +1436,6 @@ chrome_java_sources = [
@@ -1338,11 +1337,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java",
"java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java",
"java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java",
@ -53,12 +51,11 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java
- "java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java",
- "java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java",
"java/src/org/chromium/chrome/browser/sessions/SessionTabHelper.java",
"java/src/org/chromium/chrome/browser/share/LensUtils.java",
"java/src/org/chromium/chrome/browser/share/OptionalShareTargetsManager.java",
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
"java/src/org/chromium/chrome/browser/settings/ButtonPreference.java",
"java/src/org/chromium/chrome/browser/settings/ChromeBaseCheckBoxPreference.java",
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -81,22 +81,17 @@ by a child template that "extends" this file.
@@ -81,22 +81,17 @@ by a child template that "extends" this
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
<permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
<permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
@ -81,7 +78,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
@@ -1038,50 +1033,9 @@ by a child template that "extends" this file.
@@ -1056,50 +1051,9 @@ by a child template that "extends" this
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
android:hardwareAccelerated="false" />
@ -132,7 +129,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<receiver android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"
android:exported="false"/>
<receiver android:name="com.google.ipc.invalidation.external.client.contrib.AndroidListener$AlarmReceiver"
@@ -1108,24 +1062,6 @@ by a child template that "extends" this file.
@@ -1126,24 +1080,6 @@ by a child template that "extends" this
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
@ -157,10 +154,9 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<service android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService"
android:exported="true"
tools:ignore="ExportedService" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.offlinepages.OfflineBackgroundTask;
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.offli
import org.chromium.chrome.browser.offlinepages.prefetch.OfflineNotificationBackgroundTask;
import org.chromium.chrome.browser.offlinepages.prefetch.PrefetchBackgroundTask;
import org.chromium.chrome.browser.omaha.OmahaService;
@ -168,7 +164,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/background_task
import org.chromium.chrome.browser.webapps.WebApkUpdateTask;
import org.chromium.components.background_task_scheduler.BackgroundTask;
import org.chromium.components.background_task_scheduler.BackgroundTaskFactory;
@@ -48,8 +47,6 @@ public class ChromeBackgroundTaskFactory implements BackgroundTaskFactory {
@@ -48,8 +47,6 @@ public class ChromeBackgroundTaskFactory
switch (taskId) {
case TaskIds.OMAHA_JOB_ID:
return new OmahaService();
@ -177,12 +173,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/background_task
case TaskIds.OFFLINE_PAGES_BACKGROUND_JOB_ID:
return new OfflineBackgroundTask();
case TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsLauncher.java
@@ -7,15 +7,10 @@ package org.chromium.chrome.browser.ntp.snippets;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -9,14 +9,9 @@ import android.net.ConnectivityManager;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.gcm.GcmNetworkManager;
-import com.google.android.gms.gcm.PeriodicTask;
@ -190,13 +185,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/Sn