diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b96a3f40767d3accb074ceebc03c3badff798d39..4fc43f0292280725a604a5cd302e0f1161746437 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ build-docker: - docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:latest ${CI_PROJECT_DIR} - docker push $CONTAINER_IMAGE:latest -.build-bromite: +.build-cromite: image: $CONTAINER_IMAGE tags: - build-browser @@ -30,26 +30,26 @@ build-docker: paths: - apks/* -build-bromite-arm: +build-cromite-arm: stage: build - extends: .build-bromite + extends: .build-cromite script: - $CI_PROJECT_DIR/build.sh -c -s -a arm -build-bromite-arm64: +build-cromite-arm64: stage: build - extends: .build-bromite + extends: .build-cromite script: - $CI_PROJECT_DIR/build.sh -c -s -a arm64 -build-bromite-x86: +build-cromite-x86: stage: build - extends: .build-bromite + extends: .build-cromite script: - $CI_PROJECT_DIR/build.sh -c -s -a x86 -build-bromite-x64: +build-cromite-x64: stage: build - extends: .build-bromite + extends: .build-cromite script: - $CI_PROJECT_DIR/build.sh -c -s -a x64 diff --git a/Dockerfile b/Dockerfile index 476b21ded2bddd2e35e081f4e1bafb40b9562114..88ef1456d30f82bd84a704b241ac935acb6a046b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update &&\ RUN mkdir ${CHROMIUM_DIR} -RUN curl -s https://raw.githubusercontent.com/chromium/chromium/main/build/install-build-deps.py \ +RUN curl -s https://raw.githubusercontent.com/chromium/chromium/121.0.6167.164/build/install-build-deps.py \ | python - --android --lib32 --no-chromeos-fonts --no-prompt RUN git config --global user.name "John Doe" diff --git a/README.md b/README.md index a5792864a06d344011184a4a51957a09d7570da5..ab31274a4430471d36fea5a8c793fbca5154ac2b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ /e/OS Browser is an open-source fork of [Cromite](https://github.com/uazo/cromite) (Fork of bromite) which is based on [Chromium](https://www.chromium.org/Home) licensed and distributed under [The GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). It has several additional changes to improve user experience, security, and privacy. It is shipped as the default browser on /e/OS. ## Enhancements -Following are the enhancements offered by Browser over bromite: +Following are the enhancements offered by Browser over cromite: - Disabled by default: - Autofill, - Async DNS diff --git a/build.sh b/build.sh index 2a9350d3c170bbecba22a5d5ee1bf451660248fc..ecc12abd5497807cd13196af314ea73369a32c43 100755 --- a/build.sh +++ b/build.sh @@ -7,13 +7,12 @@ root_dir=$(dirname "$(readlink -f "$0")") if [ ! -d "$chromium_dir" ]; then chromium_dir=$root_dir fi -chromium_version="119.0.6045.200" +chromium_version="121.0.6167.164" chromium_code=$(echo "$chromium_version" | tr -d '.' | cut -c5-) chromium_url=https://github.com/chromium/chromium.git clean=0 gsync=0 history=1 -test=0 arch="" usage() { @@ -26,7 +25,6 @@ usage() { echo " -u Show this message" echo " -s Sync source" echo " -h Sync without history" - echo " -t Sign with AOSP test-key" echo exit 1 } @@ -52,15 +50,6 @@ build() { build_args+=' android_default_version_name="'$chromium_version'"' build_args+=' android_default_version_code="'$code'"' - if [ $test -eq 1 ]; then - echo ">> [$(date)] Using AOSP test-key to sign" - keystore_path="${root_dir}/platform.jks" - build_args+=' android_keystore_path="'$keystore_path'"' - build_args+=' android_keystore_name="platform"' - build_args+=' android_keystore_password="platform"' - build_args+=' trichrome_certdigest="c8a2e9bccf597c2fb6dc66bee293fc13f2fc47ec77bc6b2b0d52c11f51192ab8"' - fi - if [ $clean -eq 1 ]; then if [ -d "out/$1" ]; then rm -rf "out/$1" @@ -80,15 +69,34 @@ build() { build_targets="trichrome_webview_apk trichrome_chrome_apk trichrome_library_apk" fi + mkdir -p "${root_dir}/apks/${apk_arch}" + + echo ">> [$(date)] Using chromium test-key for release build" ninja -C out/$1 $build_targets for apk in $apks; do if [ -f "out/${1}/apks/$apk.apk" ]; then - echo ">> [$(date)] Moving $apk for ${apk_arch} to output folder" - mkdir -p "${root_dir}/apks/${apk_arch}" + echo ">> [$(date)] Moving release $apk for ${apk_arch} to output folder" mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/${apk_arch}/$(echo "$apk" | sed 's/[0-9]*//g').apk" fi done + + keystore_path="${root_dir}/platform.jks" + build_args+=' android_keystore_path="'$keystore_path'"' + build_args+=' android_keystore_name="platform"' + build_args+=' android_keystore_password="platform"' + build_args+=' trichrome_certdigest="c8a2e9bccf597c2fb6dc66bee293fc13f2fc47ec77bc6b2b0d52c11f51192ab8"' + + echo ">> [$(date)] Using AOSP test-key for debug build" + gn gen "out/$1" --args="$build_args" + ninja -C out/$1 $build_targets + + for apk in $apks; do + if [ -f "out/${1}/apks/$apk.apk" ]; then + echo ">> [$(date)] Moving debug $apk for ${apk_arch} to output folder" + mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/${apk_arch}/$(echo "$apk" | sed 's/[0-9]*//g')_debug.apk" + fi + done } setup_ccache() { @@ -104,11 +112,11 @@ setup_ccache() { patch() { cd $chromium_dir/src - echo ">> [$(date)] Applying bromite and /e/ patches" + echo ">> [$(date)] Applying cromite and /e/ patches" - bromite_patches_list=$(cat "${root_dir}/build/bromite_patches_list.txt") - for file in $bromite_patches_list; do - git am -C0 -3 --ignore-whitespace "${root_dir}/build/bromite_patches/$file" + cromite_patches_list=$(cat "${root_dir}/build/cromite_patches_list.txt") + for file in $cromite_patches_list; do + git am -C0 -3 --ignore-whitespace "${root_dir}/build/cromite_patches/$file" done e_patches_list=$(cat "${root_dir}/build/e_patches_list.txt") @@ -200,14 +208,13 @@ init_repo(){ fi } -while getopts ":a:cur:sht" opt; do +while getopts ":a:cur:sh" opt; do case $opt in a) arch="$OPTARG" ;; c) clean=1 ;; u) usage ;; s) gsync=1 ;; h) history=0 ;; - t) test=1 ;; :) echo "Option -$OPTARG requires an argument" echo diff --git a/build/bromite_patches/Disable-Accessibility-service-by-default.patch b/build/bromite_patches/Disable-Accessibility-service-by-default.patch deleted file mode 100644 index b807e12b6ab99ad85a2480841f10b8de13fe115c..0000000000000000000000000000000000000000 --- a/build/bromite_patches/Disable-Accessibility-service-by-default.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: uazo -Date: Mon, 8 Nov 2021 09:47:23 +0000 -Subject: Disable Accessibility service by default - -Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - .../browser/ui/android/strings/android_chrome_strings.grd | 6 ++++++ - .../android/java/res/xml/accessibility_preferences.xml | 5 +++++ - .../browser_ui/accessibility/AccessibilitySettings.java | 3 +++ - .../browser/accessibility/WebContentsAccessibilityImpl.java | 5 +++++ - 4 files changed, 19 insertions(+) - -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 -@@ -1826,6 +1826,12 @@ Your Google account may have other forms of browsing history like searches and a - - Check now - -+ -+ Enable Accessibility Service -+ -+ -+ Activates or deactivates the communication of all user activities in ui to the Accessibility provider -+ - - An error occurred. - -diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml ---- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml -+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml -@@ -7,6 +7,11 @@ found in the LICENSE file. - - - -+ -+ - -Date: Wed, 28 Sep 2022 00:54:10 +0200 -Subject: Disable add to home screen prompt - -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - .../webapps/AddToHomescreenMostVisitedTileClickObserver.java | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java ---- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java -+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java -@@ -43,10 +43,7 @@ public class AddToHomescreenMostVisitedTileClickObserver implements MostVisitedT - ntp.addMostVisitedTileClickObserver( - AddToHomescreenMostVisitedTileClickObserver.this); - } else { -- // If it is a regular web page, and started from a most visited tile, show IPH. -- if (url.getOrigin().equals(mLastClickedMostVisitedTileUrl)) { -- addToHomescreenIPHController.showAddToHomescreenIPH(tab); -- } -+ // do not show any add to home screen IPH in Bromite - removeObserver(tab); - } - mLastClickedMostVisitedTileUrl = null; --- -2.25.1 diff --git a/build/bromite_patches/Disable-idle-detection.patch b/build/bromite_patches/Disable-idle-detection.patch deleted file mode 100644 index 0e5eca2010c466e3e29bc93d37f5223e58a32bbd..0000000000000000000000000000000000000000 --- a/build/bromite_patches/Disable-idle-detection.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: csagan5 <32685696+csagan5@users.noreply.github.com> -Date: Sat, 19 Feb 2022 12:01:33 +0100 -Subject: Disable idle detection - -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - .../common/content_features_cc/Disable-idle-detection.inc | 1 + - .../blink/renderer/platform/runtime_enabled_features.json5 | 7 +++---- - 2 files changed, 4 insertions(+), 4 deletions(-) - create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc - -diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc b/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc -new file mode 100644 ---- /dev/null -+++ b/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc -@@ -0,0 +1 @@ -+SET_CROMITE_FEATURE_DISABLED(kIdleDetection); -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 -@@ -2068,10 +2068,9 @@ - base_feature: "none", - }, - { -- name: "IdleDetection", -- public: true, -- status: "stable", -- base_feature: "none", -+ name: "IdleDetection", // disabled -+ public: true, // by -+ base_feature: "none", // default - }, - { - name: "ImplicitRootScroller", --- -2.25.1 diff --git a/build/bromite_patches/Do-not-hide-component-extensions.patch b/build/bromite_patches/Do-not-hide-component-extensions.patch deleted file mode 100644 index 6d50956927ed8aef5cd3ab39225a8f6c57928309..0000000000000000000000000000000000000000 --- a/build/bromite_patches/Do-not-hide-component-extensions.patch +++ /dev/null @@ -1,24 +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 - -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - extensions/browser/api/management/management_api.cc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/extensions/browser/api/management/management_api.cc b/extensions/browser/api/management/management_api.cc ---- a/extensions/browser/api/management/management_api.cc -+++ b/extensions/browser/api/management/management_api.cc -@@ -75,7 +75,8 @@ AutoConfirmForTest auto_confirm_for_test = DO_NOT_SKIP; - // Returns true if the extension should be exposed via the chrome.management - // API. - bool ShouldExposeViaManagementAPI(const Extension& extension) { -- return !Manifest::IsComponentLocation(extension.location()); -+ // do not hide component extensions -+ return true; - } - - std::vector CreateWarningsList(const Extension* extension) { --- -2.25.1 diff --git a/build/bromite_patches/first_run-deactivate-autoupdate-globally.patch b/build/bromite_patches/first_run-deactivate-autoupdate-globally.patch deleted file mode 100644 index f40794c43f42b45a95c03ae988ee5cea1851da88..0000000000000000000000000000000000000000 --- a/build/bromite_patches/first_run-deactivate-autoupdate-globally.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Jan Engelhardt -Date: Sat, 13 Sep 2014 17:12:43 +0200 -Subject: first_run: deactivate autoupdate globally - -We currently do not have any update service infrastructure in place -(i.e. on our webserver), and sending update requests to Google also -sounds meh (wrong provider, after all). - -Also, there is no tunable in chrome://settings (or similar) yet to -turn it back on. - -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - chrome/browser/extensions/extension_system_impl.cc | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc ---- a/chrome/browser/extensions/extension_system_impl.cc -+++ b/chrome/browser/extensions/extension_system_impl.cc -@@ -198,8 +198,7 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { - - user_script_manager_ = std::make_unique(profile_); - -- bool autoupdate_enabled = !profile_->IsGuestSession() && -- !profile_->IsSystemProfile(); -+ bool autoupdate_enabled = false; - #if BUILDFLAG(IS_CHROMEOS_ASH) - if (!extensions_enabled || - ash::ProfileHelper::IsLockScreenAppProfile(profile_)) { --- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch b/build/bromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch deleted file mode 100644 index 52869f630cb4ae69c8bf246bef7d8a30b23157ab..0000000000000000000000000000000000000000 --- a/build/bromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch +++ /dev/null @@ -1,89 +0,0 @@ -From: csagan5 <32685696+csagan5@users.noreply.github.com> -Date: Mon, 12 Feb 2018 21:21:36 +0100 -Subject: ungoogled-chromium: Disable webRTC log uploader - -License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ---- - .../media/webrtc/webrtc_log_uploader.cc | 36 ++++--------------- - .../media/webrtc/webrtc_logging_controller.cc | 1 + - chrome/browser/ui/browser_ui_prefs.cc | 2 +- - 3 files changed, 8 insertions(+), 31 deletions(-) - -diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc ---- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc -+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -128,36 +128,7 @@ void WebRtcLogUploader::OnLoggingStopped( - DCHECK(meta_data.get()); - DCHECK(!upload_done_data.paths.directory.empty()); - -- std::string compressed_log = CompressLog(log_buffer.get()); -- -- std::string local_log_id; -- -- if (base::PathExists(upload_done_data.paths.directory)) { -- webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.paths.directory); -- -- local_log_id = base::NumberToString(base::Time::Now().ToDoubleT()); -- base::FilePath log_file_path = -- upload_done_data.paths.directory.AppendASCII(local_log_id) -- .AddExtension(FILE_PATH_LITERAL(".gz")); -- WriteCompressedLogToFile(compressed_log, log_file_path); -- -- base::FilePath log_list_path = -- webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory( -- upload_done_data.paths.directory); -- AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id); -- } -- -- upload_done_data.local_log_id = local_log_id; -- -- if (is_text_log_upload_allowed) { -- PrepareMultipartPostData(compressed_log, std::move(meta_data), -- std::move(upload_done_data)); -- } else { -- main_task_runner_->PostTask( -- FROM_HERE, -- base::BindOnce(&WebRtcLogUploader::NotifyUploadDisabled, -- base::Unretained(this), std::move(upload_done_data))); -- } -+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data)); - } - - void WebRtcLogUploader::PrepareMultipartPostData( -@@ -168,6 +139,11 @@ void WebRtcLogUploader::PrepareMultipartPostData( - DCHECK(!compressed_log.empty()); - DCHECK(meta_data.get()); - -+ if ((true)) { -+ NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data)); -+ return; -+ } -+ - std::unique_ptr post_data(new std::string()); - SetupMultipart(post_data.get(), compressed_log, - upload_done_data.paths.incoming_rtp_dump, -diff --git a/chrome/browser/media/webrtc/webrtc_logging_controller.cc b/chrome/browser/media/webrtc/webrtc_logging_controller.cc ---- a/chrome/browser/media/webrtc/webrtc_logging_controller.cc -+++ b/chrome/browser/media/webrtc/webrtc_logging_controller.cc -@@ -603,6 +603,7 @@ content::BrowserContext* WebRtcLoggingController::GetBrowserContext() const { - // static - bool WebRtcLoggingController::IsWebRtcTextLogAllowed( - content::BrowserContext* browser_context) { -+ if ((true)) return false; - // Historically by default webrtc text logs are always uploaded. - if (!browser_context) { - return true; -diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc ---- a/chrome/browser/ui/browser_ui_prefs.cc -+++ b/chrome/browser/ui/browser_ui_prefs.cc -@@ -99,7 +99,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false); - registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls); - registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false); -- registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, true); -+ registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, false); - - // Dictionaries to keep track of default tasks in the file browser. - registry->RegisterDictionaryPref( --- -2.25.1 diff --git a/build/browser.gn_args b/build/browser.gn_args index a6f9b3ec545432928cfe7020d1a2eca9b1301177..2031a1d5896e0973097ae50d484d7a8113884464 100644 --- a/build/browser.gn_args +++ b/build/browser.gn_args @@ -1,7 +1,7 @@ android_channel="stable" blink_symbol_level=1 build_contextual_search=false -build_with_tflite_lib=true +build_with_tflite_lib=false chrome_pgo_phase=0 dcheck_always_on=false debuggable_apks=false @@ -28,14 +28,12 @@ exclude_unwind_tables=false ffmpeg_branding="Chrome" icu_use_data_file=true is_cfi=false -use_relative_vtables_abi=true is_component_build=false is_debug=false is_official_build=true proprietary_codecs=true rtc_build_examples=false symbol_level=1 -#system_webview_package_name="org.bromite.webview" target_os="android" treat_warnings_as_errors=true use_cfi_cast=true diff --git a/build/bromite_patches/AImageReader-CFI-crash-mitigations.patch b/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch similarity index 95% rename from build/bromite_patches/AImageReader-CFI-crash-mitigations.patch rename to build/cromite_patches/AImageReader-CFI-crash-mitigations.patch index e6688de6894bacdee0c4654b1a50448636c4260a..86c2a6ffe49022a31d5cd7a5ddef60357e79750f 100644 --- a/build/bromite_patches/AImageReader-CFI-crash-mitigations.patch +++ b/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch @@ -86,15 +86,15 @@ diff --git a/base/android/android_image_reader_compat.h b/base/android/android_i 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 -@@ -3028,9 +3028,9 @@ +@@ -2923,9 +2923,9 @@ "expiry_milestone": 125 }, { - "name": "enable-image-reader", -- "owners": [ "vikassoni", "liberato" ], +- "owners": [ "vikassoni@chromium.org", "liberato@chromium.org" ], - "expiry_milestone": 125 + "name": "enable-image-reader", // Bromite: do not expire -+ "owners": [ "vikassoni", "liberato" ], // flag ++ "owners": [ "vikassoni@chromium.org", "liberato@chromium.org" ], // flag + "expiry_milestone": -1 }, { @@ -117,7 +117,7 @@ new file mode 100644 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 -@@ -3212,6 +3212,22 @@ +@@ -2689,6 +2689,22 @@ "no_downscaled_overlay_promotion" ] }, @@ -179,7 +179,7 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc if (!gpu_preferences.enable_android_surface_control) return kGpuFeatureStatusDisabled; -@@ -347,6 +350,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) { +@@ -355,6 +358,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) { gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] = kGpuFeatureStatusBlocklisted; } @@ -194,8 +194,8 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc 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 @@ count_all_in_varyings_packing - decode_encode_srgb_for_generatemipmap +@@ -11,6 +11,7 @@ clamp_texture_base_level_and_max_level + clear_pixel_unpack_buffer_before_copyteximage disable_2d_canvas_auto_flush disable_accelerated_av1_decode +disable_aimagereader @@ -205,7 +205,7 @@ diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list 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 -@@ -628,6 +628,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, +@@ -675,6 +675,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, } #endif // BUILDFLAG(IS_WIN) @@ -248,4 +248,3 @@ diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_ : TextureOwner::Mode::kSurfaceTextureInsecure; } -- -2.25.1 diff --git a/build/bromite_patches/00AdblockPlus-add-blocking-in-service-workers.patch b/build/cromite_patches/AdblockPlus-add-blocking-in-service-workers.patch similarity index 97% rename from build/bromite_patches/00AdblockPlus-add-blocking-in-service-workers.patch rename to build/cromite_patches/AdblockPlus-add-blocking-in-service-workers.patch index d37667d5d3ba8f43eb30f2aee9170bc3148fc217..1d62f37f4c7d009d28cc9b6cd09511cac72c7d50 100644 --- a/build/bromite_patches/00AdblockPlus-add-blocking-in-service-workers.patch +++ b/build/cromite_patches/AdblockPlus-add-blocking-in-service-workers.patch @@ -401,7 +401,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -6330,7 +6330,9 @@ ChromeContentBrowserClient:: +@@ -6305,7 +6305,9 @@ ChromeContentBrowserClient:: } bool ChromeContentBrowserClient::WillInterceptWebSocket( @@ -412,7 +412,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch #if BUILDFLAG(ENABLE_EXTENSIONS) if (!frame) { return false; -@@ -6351,9 +6353,11 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket( +@@ -6328,9 +6330,11 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket( } void ChromeContentBrowserClient::CreateWebSocket( @@ -427,7 +427,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h -@@ -624,11 +624,15 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -642,11 +642,15 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { CreateURLLoaderHandlerForServiceWorkerNavigationPreload( int frame_tree_node_id, const network::ResourceRequest& resource_request) override; @@ -447,7 +447,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chr diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/components/adblock/content/browser/adblock_url_loader_factory.cc --- a/components/adblock/content/browser/adblock_url_loader_factory.cc +++ b/components/adblock/content/browser/adblock_url_loader_factory.cc -@@ -342,12 +342,6 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestError( +@@ -343,12 +343,6 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestError( void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( CheckFilterMatchCallback callback) { @@ -460,7 +460,7 @@ diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/ auto subscription_service = factory_->config_.subscription_service; if (is_document_request_) { auto* host = content::RenderFrameHost::FromID(factory_->host_id_); -@@ -386,7 +380,7 @@ void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( +@@ -387,7 +381,7 @@ void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( } else { factory_->config_.resource_classifier->CheckRequestFilterMatch( subscription_service->GetCurrentSnapshot(), request_url_, @@ -469,7 +469,7 @@ diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/ base::BindOnce( &AdblockURLLoaderFactory::InProgressRequest::OnRequestUrlClassified, weak_factory_.GetWeakPtr(), -@@ -675,12 +669,14 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestFilterMatchResult( +@@ -676,12 +670,14 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestFilterMatchResult( AdblockURLLoaderFactory::AdblockURLLoaderFactory( AdblockURLLoaderFactoryConfig config, @@ -662,7 +662,7 @@ diff --git a/components/adblock/content/browser/resource_classification_runner_i diff --git a/content/browser/websockets/websocket_connector_impl.cc b/content/browser/websockets/websocket_connector_impl.cc --- a/content/browser/websockets/websocket_connector_impl.cc +++ b/content/browser/websockets/websocket_connector_impl.cc -@@ -87,14 +87,14 @@ void WebSocketConnectorImpl::Connect( +@@ -88,14 +88,14 @@ void WebSocketConnectorImpl::Connect( const uint32_t options = GetContentClient()->browser()->GetWebSocketOptions(frame); @@ -672,8 +672,8 @@ diff --git a/content/browser/websockets/websocket_connector_impl.cc b/content/br - frame, + process, frame, base::BindOnce(ConnectCalledByContentBrowserClient, requested_protocols, - site_for_cookies, isolation_info_, process_id_, - frame_id_, origin_, options, + site_for_cookies, has_storage_access, isolation_info_, + process_id_, frame_id_, origin_, options, std::move(throttling_profile_id)), - url, site_for_cookies, user_agent, std::move(handshake_client)); + url, origin_, site_for_cookies, user_agent, std::move(handshake_client)); @@ -683,7 +683,7 @@ diff --git a/content/browser/websockets/websocket_connector_impl.cc b/content/br diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -998,7 +998,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory( +@@ -1023,7 +1023,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory( return false; } @@ -692,7 +692,7 @@ diff --git a/content/public/browser/content_browser_client.cc b/content/public/b return false; } -@@ -1007,9 +1007,11 @@ uint32_t ContentBrowserClient::GetWebSocketOptions(RenderFrameHost* frame) { +@@ -1032,9 +1032,11 @@ uint32_t ContentBrowserClient::GetWebSocketOptions(RenderFrameHost* frame) { } void ContentBrowserClient::CreateWebSocket( @@ -707,7 +707,7 @@ diff --git a/content/public/browser/content_browser_client.cc b/content/public/b diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -1791,7 +1791,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1859,7 +1859,7 @@ class CONTENT_EXPORT ContentBrowserClient { scoped_refptr navigation_response_task_runner); // Returns true when the embedder wants to intercept a websocket connection. @@ -716,7 +716,7 @@ diff --git a/content/public/browser/content_browser_client.h b/content/public/br // Returns the WebSocket creation options. virtual uint32_t GetWebSocketOptions(RenderFrameHost* frame); -@@ -1813,9 +1813,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1881,9 +1881,11 @@ class CONTENT_EXPORT ContentBrowserClient { // Always called on the UI thread and only when the Network Service is // enabled. virtual void CreateWebSocket( @@ -729,4 +729,3 @@ diff --git a/content/public/browser/content_browser_client.h b/content/public/br const absl::optional& user_agent, mojo::PendingRemote -- -2.25.1 diff --git a/build/cromite_patches/AdblockPlus-connect-popup-blocker.patch b/build/cromite_patches/AdblockPlus-connect-popup-blocker.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c1bd528c3a8d4318207ba63f1c70c3225a83b01 --- /dev/null +++ b/build/cromite_patches/AdblockPlus-connect-popup-blocker.patch @@ -0,0 +1,169 @@ +From: uazo +Date: Tue, 9 Jan 2024 13:37:05 +0000 +Subject: AdblockPlus connect popup blocker + +activates the pop-up blocking management present in adblockplus +but not active in upstream. +added "enable-stricter-popup-blocker" flag for the global +deactivation of all pop-ups (default disabled) +--- + .../adblock/adblock_content_browser_client.cc | 52 +++++++++++++++++++ + .../adblock/adblock_content_browser_client.h | 14 +++++ + components/blocked_content/popup_blocker.cc | 9 +++- + components/blocked_content/popup_blocker.h | 3 ++ + .../about_flags_cc/Stricter-popup-blocker.inc | 14 +++++ + 5 files changed, 91 insertions(+), 1 deletion(-) + create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Stricter-popup-blocker.inc + +diff --git a/chrome/browser/adblock/adblock_content_browser_client.cc b/chrome/browser/adblock/adblock_content_browser_client.cc +--- a/chrome/browser/adblock/adblock_content_browser_client.cc ++++ b/chrome/browser/adblock/adblock_content_browser_client.cc +@@ -330,6 +330,58 @@ void AdblockContentBrowserClient::OnWebTransportFilterCheckCompleted( + "Blocked", false)); + } + ++bool AdblockContentBrowserClient::CanCreateWindow( ++ content::RenderFrameHost* opener, ++ const GURL& opener_url, ++ const GURL& opener_top_level_frame_url, ++ const url::Origin& source_origin, ++ content::mojom::WindowContainerType container_type, ++ const GURL& target_url, ++ const content::Referrer& referrer, ++ const std::string& frame_name, ++ WindowOpenDisposition disposition, ++ const blink::mojom::WindowFeatures& features, ++ bool user_gesture, ++ bool opener_suppressed, ++ bool* no_javascript_access) { ++ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); ++ DCHECK(opener); ++ ++ if (IsFilteringNeeded(opener)) { ++ content::WebContents* web_contents = ++ content::WebContents::FromRenderFrameHost(opener); ++ auto* subscription_service = ++ adblock::SubscriptionServiceFactory::GetForBrowserContext( ++ web_contents->GetBrowserContext()); ++ ++ GURL popup_url(target_url); ++ web_contents->GetPrimaryMainFrame()->GetProcess()->FilterURL(false, ++ &popup_url); ++ auto* classification_runner = ++ adblock::ResourceClassificationRunnerFactory::GetForBrowserContext( ++ web_contents->GetBrowserContext()); ++ const auto popup_blocking_decision = ++ classification_runner->ShouldBlockPopup( ++ subscription_service->GetCurrentSnapshot(), popup_url, opener); ++ if (popup_blocking_decision == adblock::FilterMatchResult::kAllowRule) { ++ return true; ++ } ++ if (popup_blocking_decision == adblock::FilterMatchResult::kBlockRule) { ++ return false; ++ } ++ // Otherwise, if eyeo adblocking is disabled or there is no rule that ++ // explicitly allows or blocks a popup, fall back on Chromium's built-in ++ // popup blocker. ++ DCHECK(popup_blocking_decision == adblock::FilterMatchResult::kDisabled || ++ popup_blocking_decision == adblock::FilterMatchResult::kNoRule); ++ } ++ ++ return ChromeContentBrowserClient::CanCreateWindow( ++ opener, opener_url, opener_top_level_frame_url, source_origin, ++ container_type, target_url, referrer, frame_name, disposition, features, ++ user_gesture, opener_suppressed, no_javascript_access); ++} ++ + bool AdblockContentBrowserClient::WillCreateURLLoaderFactory( + content::BrowserContext* browser_context, + content::RenderFrameHost* frame, +diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/browser/adblock/adblock_content_browser_client.h +--- a/chrome/browser/adblock/adblock_content_browser_client.h ++++ b/chrome/browser/adblock/adblock_content_browser_client.h +@@ -82,6 +82,20 @@ class AdblockContentBrowserClient : public ChromeContentBrowserClient { + scoped_refptr navigation_response_task_runner) + override; + ++ bool CanCreateWindow(content::RenderFrameHost* opener, ++ const GURL& opener_url, ++ const GURL& opener_top_level_frame_url, ++ const url::Origin& source_origin, ++ content::mojom::WindowContainerType container_type, ++ const GURL& target_url, ++ const content::Referrer& referrer, ++ const std::string& frame_name, ++ WindowOpenDisposition disposition, ++ const blink::mojom::WindowFeatures& features, ++ bool user_gesture, ++ bool opener_suppressed, ++ bool* no_javascript_access) override; ++ + private: + void CreateWebSocketInternal( + content::RenderProcessHost* process, +diff --git a/components/blocked_content/popup_blocker.cc b/components/blocked_content/popup_blocker.cc +--- a/components/blocked_content/popup_blocker.cc ++++ b/components/blocked_content/popup_blocker.cc +@@ -20,6 +20,11 @@ + #include "third_party/blink/public/mojom/frame/frame.mojom-shared.h" + + namespace blocked_content { ++ ++CROMITE_FEATURE(kStrictPopupBlocker, ++ "StrictPopupBlocker", ++ base::FEATURE_DISABLED_BY_DEFAULT); ++ + namespace { + + content::Page& GetSourcePageForPopup( +@@ -88,7 +93,9 @@ PopupBlockType ShouldBlockPopup(content::WebContents* web_contents, + GetSourcePageForPopup(open_url_params, web_contents))) { + return PopupBlockType::kAbusive; + } +- return PopupBlockType::kNotBlocked; ++ return base::FeatureList::IsEnabled(kStrictPopupBlocker) ++ ? PopupBlockType::kAbusive ++ : PopupBlockType::kNotBlocked; + } + + } // namespace +diff --git a/components/blocked_content/popup_blocker.h b/components/blocked_content/popup_blocker.h +--- a/components/blocked_content/popup_blocker.h ++++ b/components/blocked_content/popup_blocker.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_BLOCKED_CONTENT_POPUP_BLOCKER_H_ + #define COMPONENTS_BLOCKED_CONTENT_POPUP_BLOCKER_H_ + ++#include "base/feature_list.h" + #include "components/content_settings/core/browser/host_content_settings_map.h" + #include "third_party/blink/public/mojom/window_features/window_features.mojom-forward.h" + #include "ui/base/window_open_disposition.h" +@@ -18,6 +19,8 @@ struct OpenURLParams; + } // namespace content + + namespace blocked_content { ++BASE_DECLARE_FEATURE(kStrictPopupBlocker); ++ + class PopupNavigationDelegate; + + // Classifies what caused a popup to be blocked. +diff --git a/cromite_flags/chrome/browser/about_flags_cc/Stricter-popup-blocker.inc b/cromite_flags/chrome/browser/about_flags_cc/Stricter-popup-blocker.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/chrome/browser/about_flags_cc/Stricter-popup-blocker.inc +@@ -0,0 +1,14 @@ ++#ifdef ABOUT_FLAG_INCLUDE_SECTION ++ ++#include "components/blocked_content/popup_blocker.h" ++ ++#endif ++ ++#ifdef FLAG_SECTION ++ ++ {"enable-stricter-popup-blocker", ++ "Enable Stricter popup blocker", ++ "Blocks all pop-ups, even those with user gestures.", kOsAll, ++ FEATURE_VALUE_TYPE(blocked_content::kStrictPopupBlocker)}, ++ ++#endif // ifdef FLAG_SECTION +-- diff --git a/build/bromite_patches/Add-AllowUserCertificates-flag.patch b/build/cromite_patches/Add-AllowUserCertificates-flag.patch similarity index 84% rename from build/bromite_patches/Add-AllowUserCertificates-flag.patch rename to build/cromite_patches/Add-AllowUserCertificates-flag.patch index 86e113f50a01c779fb5a9d8481a4cfea6bb0390d..90340f25144813f6d783d17f5a3b4ae417476007 100644 --- a/build/bromite_patches/Add-AllowUserCertificates-flag.patch +++ b/build/cromite_patches/Add-AllowUserCertificates-flag.patch @@ -20,7 +20,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -227,6 +227,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider; +@@ -228,6 +228,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; @@ -28,7 +28,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv import org.chromium.printing.PrintManagerDelegateImpl; import org.chromium.printing.PrintingController; import org.chromium.printing.PrintingControllerImpl; -@@ -984,6 +985,8 @@ public abstract class ChromeActivity +@@ -1097,6 +1098,8 @@ public abstract class ChromeActivity super.onStartWithNative(); ChromeActivitySessionTracker.getInstance().onStartWithNative(); ChromeCachedFlags.getInstance().cacheNativeFlags(); @@ -40,7 +40,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv 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 -@@ -147,6 +147,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -144,6 +144,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { &feed::kFeedShowSignInCommand, &feed::kFeedSignedOutViewDemotion, &feed::kFeedUserInteractionReliabilityReport, @@ -51,7 +51,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse 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 -@@ -98,6 +98,7 @@ public abstract class ChromeFeatureList { +@@ -103,6 +103,7 @@ public abstract class ChromeFeatureList { } /* Alphabetical: */ @@ -59,23 +59,23 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR = "AdaptiveButtonInTopToolbar"; public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_TRANSLATE = "AdaptiveButtonInTopToolbarTranslate"; -@@ -501,6 +502,8 @@ public abstract class ChromeFeatureList { - /* Alphabetical: */ +@@ -522,6 +523,8 @@ public abstract class ChromeFeatureList { public static final CachedFlag sAndroidAppIntegration = new CachedFlag(ANDROID_APP_INTEGRATION, false); + public static final CachedFlag sAndroidHub = new CachedFlag(ANDROID_HUB, false); + public static final CachedFlag sAllowUserCertificates = + new CachedFlag(ALLOW_USER_CERTIFICATES, false); public static final CachedFlag sAppMenuMobileSiteOption = new CachedFlag(APP_MENU_MOBILE_SITE_OPTION, false); - public static final CachedFlag sBackGestureActivityTabProvider = -@@ -642,6 +645,7 @@ public abstract class ChromeFeatureList { - public static final List sFlagsCachedFullBrowser = List.of( - // clang-format off - sAndroidAppIntegration, -+ sAllowUserCertificates, - sAppMenuMobileSiteOption, - sBackGestureActivityTabProvider, - sBackGestureRefactorActivityAndroid, + public static final CachedFlag sArchiveTabService = new CachedFlag(ARCHIVE_TAB_SERVICE, false); +@@ -662,6 +665,7 @@ public abstract class ChromeFeatureList { + + public static final List sFlagsCachedFullBrowser = + List.of( ++ sAllowUserCertificates, + sAndroidAppIntegration, + sAndroidHub, + sAppMenuMobileSiteOption, diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc new file mode 100644 --- /dev/null @@ -111,24 +111,23 @@ new file mode 100644 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 -@@ -545,6 +545,8 @@ public class X509Util { +@@ -525,6 +525,8 @@ public class X509Util { return userRootBytes.toArray(new byte[0][]); } + public static boolean AllowUserCertificates = false; + - public static AndroidCertVerifyResult verifyServerCertificates(byte[][] certChain, - String authType, - String host) -@@ -631,6 +633,9 @@ public class X509Util { + public static AndroidCertVerifyResult verifyServerCertificates( + byte[][] certChain, String authType, String host) + throws KeyStoreException, NoSuchAlgorithmException { +@@ -613,6 +615,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); + return new AndroidCertVerifyResult( + CertVerifyStatusAndroid.OK, isIssuedByKnownRoot, verifiedChain); } -- -2.25.1 diff --git a/build/bromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch b/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch similarity index 70% rename from build/bromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch rename to build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch index 72323e7dcacb7dc1a0f3a0061f48e867c3175940..fa2a0be844dd1944580119d6d096d60539fd3257 100644 --- a/build/bromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch +++ b/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch @@ -10,14 +10,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -152,6 +152,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); +@@ -198,6 +198,8 @@ public class KeyboardShortcuts { + 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( + KeyboardShortcutGroup webpageShortcutGroup = -- -2.25.1 diff --git a/build/bromite_patches/Add-IsCleartextPermitted-flag.patch b/build/cromite_patches/Add-IsCleartextPermitted-flag.patch similarity index 94% rename from build/bromite_patches/Add-IsCleartextPermitted-flag.patch rename to build/cromite_patches/Add-IsCleartextPermitted-flag.patch index 084b195cd7dbac2cb4d6a56d6f8571623ac14fb8..6bdfae8b59af66c88df17a0c7143343042b41cae 100644 --- a/build/bromite_patches/Add-IsCleartextPermitted-flag.patch +++ b/build/cromite_patches/Add-IsCleartextPermitted-flag.patch @@ -44,8 +44,8 @@ new file mode 100644 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 -@@ -232,6 +232,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { - RedirectUtil::ResponseCode::REDIRECT_307_TEMPORARY_REDIRECT, "HSTS"); +@@ -287,6 +287,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { + } } + if (base::FeatureList::IsEnabled(net::features::kIsCleartextPermitted) == false) { @@ -57,4 +57,3 @@ diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_reque // Check whether the app allows cleartext traffic to this host, and return // ERR_CLEARTEXT_NOT_PERMITTED if not. -- -2.25.1 diff --git a/build/bromite_patches/Add-a-proxy-configuration-page.patch b/build/cromite_patches/Add-a-proxy-configuration-page.patch similarity index 98% rename from build/bromite_patches/Add-a-proxy-configuration-page.patch rename to build/cromite_patches/Add-a-proxy-configuration-page.patch index cbbf552092e915274a6a48509076a943b089df94..283ddce191082e4efd339aa347f3ed88ac3872c5 100644 --- a/build/bromite_patches/Add-a-proxy-configuration-page.patch +++ b/build/cromite_patches/Add-a-proxy-configuration-page.patch @@ -50,7 +50,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -27,6 +27,9 @@ found in the LICENSE file. +@@ -25,6 +25,9 @@ found in the LICENSE file. true @@ -63,10 +63,10 @@ diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res 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 -@@ -9,6 +9,10 @@ found in the LICENSE file. - - +@@ -10,6 +10,10 @@ found in the LICENSE file. + + @@ -197,7 +197,7 @@ diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/pro 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 -@@ -185,6 +185,8 @@ +@@ -191,6 +191,8 @@ #include "rlz/buildflags/buildflags.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -206,7 +206,7 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" #endif -@@ -1389,6 +1391,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1451,6 +1453,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { component_updater::RegisterPrefs(registry); domain_reliability::RegisterPrefs(registry); embedder_support::OriginTrialPrefs::RegisterPrefs(registry); @@ -397,7 +397,7 @@ new file mode 100644 + along with Bromite. If not, see . +*/ + -+import {$} from 'chrome://resources/js/util_ts.js'; ++import {$} from 'chrome://resources/js/util.js'; + +/** + * Main entry point called once the page has loaded. @@ -673,7 +673,7 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -@@ -63,6 +63,7 @@ +@@ -56,6 +56,7 @@ #include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h" #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" #include "chrome/browser/ui/webui/policy/policy_ui.h" @@ -681,7 +681,7 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom #include "chrome/browser/ui/webui/predictors/predictors_ui.h" #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h" #include "chrome/browser/ui/webui/signin_internals_ui.h" -@@ -496,6 +497,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, +@@ -489,6 +490,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, return &NewWebUI; if (url.host_piece() == chrome::kChromeUINetExportHost) return &NewWebUI; @@ -1127,7 +1127,7 @@ new file mode 100644 diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc -@@ -56,6 +56,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert"; +@@ -51,6 +51,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert"; const char kChromeUICertificateViewerURL[] = "chrome://view-cert/"; const char kChromeUIChromeSigninHost[] = "chrome-signin"; const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/"; @@ -1136,15 +1136,15 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons const char kChromeUIChromeURLsHost[] = "chrome-urls"; const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/"; const char kChromeUIComponentsHost[] = "components"; -@@ -450,6 +452,7 @@ bool IsSystemWebUIHost(base::StringPiece host) { - kChromeUILockScreenNetworkHost, - kChromeUILockScreenStartReauthHost, - kChromeUIMobileSetupHost, -+ kChromeUIProxyConfigHost, - kChromeUIMultiDeviceSetupHost, - kChromeUINetworkHost, - kChromeUINotificationTesterHost, -@@ -759,6 +762,7 @@ const char* const kChromeHostURLs[] = { +@@ -454,6 +456,7 @@ bool IsSystemWebUIHost(base::StringPiece host) { + kChromeUILockScreenNetworkHost, + kChromeUILockScreenStartReauthHost, + kChromeUIMobileSetupHost, ++ kChromeUIProxyConfigHost, + kChromeUIMultiDeviceSetupHost, + kChromeUINetworkHost, + kChromeUINotificationTesterHost, +@@ -758,6 +761,7 @@ const char* const kChromeHostURLs[] = { #if !BUILDFLAG(IS_ANDROID) #if !BUILDFLAG(IS_CHROMEOS) kChromeUIAppLauncherPageHost, @@ -1155,7 +1155,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h -@@ -142,6 +142,8 @@ extern const char kChromeUINTPTilesInternalsHost[]; +@@ -137,6 +137,8 @@ extern const char kChromeUINTPTilesInternalsHost[]; extern const char kChromeUINaClHost[]; extern const char kChromeUINetExportHost[]; extern const char kChromeUINetExportURL[]; @@ -1413,4 +1413,3 @@ diff --git a/net/proxy_resolution/proxy_config.h b/net/proxy_resolution/proxy_co // Returns one of {&proxies_for_http, &proxies_for_https, &proxies_for_ftp, // &fallback_proxies}, or NULL if there is no proxy to use. -- -2.25.1 diff --git a/build/bromite_patches/Add-an-always-incognito-mode.patch b/build/cromite_patches/Add-an-always-incognito-mode.patch similarity index 87% rename from build/bromite_patches/Add-an-always-incognito-mode.patch rename to build/cromite_patches/Add-an-always-incognito-mode.patch index e6e3d372d6c1d6998769663430787fa993119ef5..2d94d8a1f791f55a684934bef77e03791acd3604 100644 --- a/build/bromite_patches/Add-an-always-incognito-mode.patch +++ b/build/cromite_patches/Add-an-always-incognito-mode.patch @@ -26,9 +26,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../AlwaysIncognitoLinkInterceptor.java | 53 ++++++ .../chrome/browser/ChromeTabbedActivity.java | 20 ++- .../chrome/browser/app/ChromeActivity.java | 4 + - .../AppMenuPropertiesDelegateImpl.java | 26 ++- + .../AppMenuPropertiesDelegateImpl.java | 27 ++- .../ChromeContextMenuPopulator.java | 7 +- - .../CustomTabActivityLifecycleUmaTracker.java | 25 --- + .../CustomTabActivityLifecycleUmaTracker.java | 31 ---- .../CustomTabAppMenuPropertiesDelegate.java | 4 + .../CustomTabIntentDataProvider.java | 5 +- .../browser/download/DownloadUtils.java | 16 +- @@ -46,7 +46,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/tabmodel/ChromeTabCreator.java | 5 +- .../tabmodel/TabModelSelectorImpl.java | 3 + .../browser/tabmodel/TabPersistentStore.java | 9 + - .../browser/toolbar/ToolbarManager.java | 4 +- + .../browser/toolbar/ToolbarManager.java | 3 +- .../webapps/WebappIntentDataProvider.java | 14 ++ .../browser/android/historical_tab_saver.cc | 24 ++- .../chrome_autocomplete_provider_client.cc | 9 + @@ -59,8 +59,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../android/offline_page_model_factory.cc | 20 ++- .../android/request_coordinator_factory.cc | 34 +++- .../offline_page_model_factory.h | 1 + - .../offline_pages/recent_tab_helper.cc | 19 ++- - .../browser/offline_pages/recent_tab_helper.h | 3 + + .../offline_pages/recent_tab_helper.cc | 31 +++- + .../browser/offline_pages/recent_tab_helper.h | 5 + .../request_coordinator_factory.h | 4 +- chrome/browser/prefs/browser_prefs.cc | 5 + chrome/browser/profiles/profile_selections.cc | 10 ++ @@ -84,7 +84,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../add-an-always-incognito-mode.inc | 1 + .../add-an-always-incognito-mode.inc | 3 + .../add-an-always-incognito-mode.inc | 1 + - 65 files changed, 762 insertions(+), 92 deletions(-) + net/base/file_stream_context.cc | 2 +- + 66 files changed, 773 insertions(+), 103 deletions(-) create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java @@ -97,14 +98,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -659,6 +659,7 @@ chrome_java_resources = [ +@@ -649,6 +649,7 @@ chrome_java_resources = [ "java/res/xml/main_preferences.xml", "java/res/xml/manage_sync_preferences.xml", "java/res/xml/phone_as_a_security_key_accessory_filter.xml", + "java/res/xml/incognito_preferences.xml", "java/res/xml/privacy_preferences.xml", - "java/res/xml/privacy_preferences_v2.xml", "java/res/xml/search_widget_info.xml", + "java/res/xml/tracing_preferences.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 @@ -116,10 +117,10 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_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", -@@ -967,6 +968,7 @@ chrome_java_sources = [ - "java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerImpl.java", +@@ -968,6 +969,7 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/ChromeTrackingProtectionDelegate.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java", + "java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java", "java/src/org/chromium/chrome/browser/provider/BaseColumns.java", "java/src/org/chromium/chrome/browser/provider/BookmarkColumns.java", @@ -169,18 +170,18 @@ new file mode 100644 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,11 @@ found in the LICENSE file. +@@ -66,6 +66,11 @@ found in the LICENSE file. android:key="secure_dns" android:title="@string/settings_secure_dns_title" - android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings"/> + android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings" /> + - 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 @@ -242,7 +243,7 @@ new file mode 100644 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 -@@ -62,6 +62,10 @@ import org.chromium.base.task.TaskTraits; +@@ -63,6 +63,10 @@ import org.chromium.base.task.TaskTraits; import org.chromium.build.annotations.UsedByReflection; import org.chromium.cc.input.BrowserControlsState; import org.chromium.chrome.R; @@ -253,7 +254,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.chrome.browser.IntentHandler.TabOpenType; import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.app.metrics.LaunchCauseMetrics; -@@ -590,9 +594,14 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2005,6 +2006,9 @@ public abstract class ChromeActivity throw new IllegalStateException( "Attempting to access TabCreator before initialization"); } @@ -312,10 +313,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; - import org.chromium.chrome.browser.banners.AppMenuVerbiage; import org.chromium.chrome.browser.bookmarks.BookmarkFeatures; import org.chromium.chrome.browser.bookmarks.BookmarkModel; -@@ -102,6 +103,10 @@ import java.lang.annotation.RetentionPolicy; + import org.chromium.chrome.browser.bookmarks.PowerBookmarkUtils; +@@ -100,6 +101,10 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; @@ -326,7 +327,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App /** * Base implementation of {@link AppMenuPropertiesDelegate} that handles hiding and showing menu * items based on activity state. -@@ -569,6 +574,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -597,6 +602,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) { @@ -340,14 +341,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App // We have to iterate all menu items since same menu item ID may be associated with more // than one menu items. boolean isOverviewModeMenu = menuGroup == MenuGroup.OVERVIEW_MODE_MENU; -@@ -626,7 +638,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -659,7 +671,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } if (item.getItemId() == R.id.recent_tabs_menu_id) { - item.setVisible(!isIncognito); + if (always_incognito) { + PrefService prefService = -+ UserPrefs.get(Profile.getLastUsedRegularProfile()); ++ UserPrefs.get(Profile.getLastUsedRegularProfile()); + boolean historyEnabledInIncognito = + prefService.getBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED); + item.setVisible(historyEnabledInIncognito); @@ -357,12 +358,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App } if (item.getItemId() == R.id.menu_select_tabs) { item.setVisible(isMenuSelectTabsVisible); -@@ -840,7 +860,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate - // is not persisted when adding to the homescreen. - // * If creating shortcuts it not supported by the current home screen. - return WebappsUtils.isAddToHomeIntentSupported() && !isChromeScheme && !isFileScheme -- && !isContentScheme && !isIncognito && !url.isEmpty(); -+ && !isContentScheme && !url.isEmpty() +@@ -865,8 +885,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate + && !isChromeScheme + && !isFileScheme + && !isContentScheme +- && !isIncognito +- && !url.isEmpty(); ++ && !url.isEmpty() + && (!isIncognito || + AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()); } @@ -371,15 +373,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App 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 -@@ -28,6 +28,7 @@ import org.chromium.base.Callback; - import org.chromium.base.ContextUtils; +@@ -29,6 +29,7 @@ import org.chromium.base.ContextUtils; + import org.chromium.base.shared_preferences.SharedPreferencesManager; 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; -@@ -231,6 +232,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -258,6 +259,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { public List> buildContextMenu() { mShowEphemeralTabNewLabel = null; @@ -389,7 +391,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr List> groupedItems = new ArrayList<>(); if (mParams.isAnchor()) { -@@ -240,6 +244,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -268,6 +272,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { if (mMode == ContextMenuMode.NORMAL) { linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP)); linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB)); @@ -397,7 +399,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) { linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB)); } -@@ -264,7 +269,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -292,7 +297,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { } } if (FirstRunStatus.getFirstRunFlowComplete()) { @@ -409,7 +411,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr 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 -@@ -67,31 +67,6 @@ public class CustomTabActivityLifecycleUmaTracker +@@ -70,37 +70,6 @@ public class CustomTabActivityLifecycleUmaTracker private boolean mIsInitialResume = true; private void recordIncognitoLaunchReason() { @@ -418,8 +420,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust - - @IntentHandler.IncognitoCCTCallerId - int incognitoCCTCallerId = incognitoProvider.getFeatureIdForMetricsCollection(); -- RecordHistogram.recordEnumeratedHistogram("CustomTabs.IncognitoCCTCallerId", -- incognitoCCTCallerId, IntentHandler.IncognitoCCTCallerId.NUM_ENTRIES); +- RecordHistogram.recordEnumeratedHistogram( +- "CustomTabs.IncognitoCCTCallerId", +- incognitoCCTCallerId, +- IntentHandler.IncognitoCCTCallerId.NUM_ENTRIES); - - // Record which 1P app launched Incognito CCT. - if (incognitoCCTCallerId == IntentHandler.IncognitoCCTCallerId.GOOGLE_APPS) { @@ -427,15 +431,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust - @IntentHandler.ExternalAppId - int externalId = IntentHandler.mapPackageToExternalAppId(sendersPackageName); - if (externalId != IntentHandler.ExternalAppId.OTHER) { -- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ClientAppId.Incognito", -- externalId, IntentHandler.ExternalAppId.NUM_ENTRIES); +- 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); +- RecordHistogram.recordEnumeratedHistogram( +- "CustomTabs.ClientAppId.Incognito", +- externalId, +- IntentHandler.ExternalAppId.NUM_ENTRIES); - } - } } @@ -452,7 +460,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust import org.chromium.chrome.browser.DefaultBrowserInfo; import org.chromium.chrome.browser.app.appmenu.AppMenuPropertiesDelegateImpl; import org.chromium.chrome.browser.app.appmenu.DividerLineMenuItemViewBinder; -@@ -179,6 +180,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat +@@ -195,6 +196,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat downloadItemVisible = false; openInChromeItemVisible = false; } @@ -460,12 +468,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust + downloadItemVisible = true; + } - boolean isChromeScheme = url.getScheme().equals(UrlConstants.CHROME_SCHEME) - || url.getScheme().equals(UrlConstants.CHROME_NATIVE_SCHEME); + boolean isChromeScheme = + url.getScheme().equals(UrlConstants.CHROME_SCHEME) 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 -@@ -66,6 +66,9 @@ import org.chromium.components.embedder_support.util.UrlConstants; +@@ -83,6 +83,9 @@ import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.version_info.VersionInfo; import org.chromium.device.mojom.ScreenOrientationLockType; @@ -475,7 +483,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; -@@ -1263,7 +1266,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid +@@ -1294,7 +1297,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid @Override public boolean isIncognito() { @@ -487,15 +495,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java -@@ -35,6 +35,7 @@ import org.chromium.base.annotations.NativeMethods; - import org.chromium.base.metrics.RecordHistogram; - import org.chromium.base.metrics.RecordUserAction; +@@ -34,6 +34,7 @@ import org.chromium.base.FileUtils; + import org.chromium.base.IntentUtils; + import org.chromium.base.Log; import org.chromium.chrome.R; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.app.download.home.DownloadActivity; -@@ -77,6 +78,10 @@ import org.chromium.url.GURL; +@@ -74,6 +75,10 @@ import org.chromium.url.GURL; import java.io.File; @@ -503,10 +511,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo +import org.chromium.components.user_prefs.UserPrefs; +import org.chromium.chrome.browser.preferences.Pref; + - /** - * A class containing some utility static methods. - */ -@@ -353,7 +358,16 @@ public class DownloadUtils { + /** A class containing some utility static methods. */ + public class DownloadUtils { + private static final String TAG = "download"; +@@ -311,7 +316,16 @@ public class DownloadUtils { // Offline pages isn't supported in Incognito. This should be checked before calling // OfflinePageBridge.getForProfile because OfflinePageBridge instance will not be found // for incognito profile. @@ -527,7 +535,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java -@@ -231,7 +231,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver +@@ -243,7 +243,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver mHistoryAdapter.generateFooterItems(); // Listen to changes in sign in state. @@ -538,7 +546,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History // Create PrefChangeRegistrar to receive notifications on preference changes. mPrefChangeRegistrar = new PrefChangeRegistrar(); -@@ -266,7 +268,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver +@@ -278,7 +280,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver mHistoryAdapter.onDestroyed(); mLargeIconBridge.destroy(); mLargeIconBridge = null; @@ -569,10 +577,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History +import org.chromium.components.user_prefs.UserPrefs; +import org.chromium.chrome.browser.preferences.Pref; + - /** - * Combines and manages the different UI components of browsing history. - */ -@@ -158,7 +165,7 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve + /** Combines and manages the different UI components of browsing history. */ + public class HistoryManager + implements OnMenuItemClickListener, +@@ -164,7 +171,7 @@ public class HistoryManager recordUserAction("Show"); // If incognito placeholder is shown, we don't need to create History UI elements. @@ -581,7 +589,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History mSelectableListLayout = null; mRootView = getIncognitoHistoryPlaceholderView(); return; -@@ -601,7 +608,7 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve +@@ -672,7 +679,7 @@ public class HistoryManager private void swapContentView() { boolean toHistoryClusters; @@ -590,7 +598,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History return; } else if (isHistoryClustersUIShowing()) { toHistoryClusters = false; -@@ -664,11 +671,24 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve +@@ -736,9 +743,22 @@ public class HistoryManager && mContentView == mHistoryClustersCoordinator.getActivityContentView(); } @@ -607,16 +615,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History + return mIsIncognito; + } + - /** - * Called when the activity/native page is destroyed. - */ + /** Called when the activity/native page is destroyed. */ public void onDestroyed() { - if (mIsIncognito) { + if (shouldShowIncognitoPlaceholder()) { // If Incognito placeholder is shown no need to call any destroy method. return; } -@@ -688,7 +708,7 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve +@@ -758,7 +778,7 @@ public class HistoryManager * @return True if manager handles this event, false if it decides to ignore. */ public boolean onBackPressed() { @@ -646,11 +652,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History +import org.chromium.components.user_prefs.UserPrefs; +import org.chromium.chrome.browser.preferences.Pref; + - /** - * Native page for managing browsing history. - */ -@@ -39,6 +46,14 @@ public class HistoryPage extends BasicNativePage { - Profile profile, Supplier tabSupplier, String url) { + /** Native page for managing browsing history. */ + public class HistoryPage extends BasicNativePage { + private HistoryManager mHistoryManager; +@@ -42,6 +49,14 @@ public class HistoryPage extends BasicNativePage { + String url) { super(host); + if (profile.isOffTheRecord() && @@ -675,7 +681,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.app.download.home.DownloadPage; import org.chromium.chrome.browser.bookmarks.BookmarkPage; -@@ -232,7 +233,8 @@ public class NativePageFactory { +@@ -276,7 +277,8 @@ public class NativePageFactory { String url, NativePage candidatePage, Tab tab, boolean isIncognito) { NativePage page; @@ -704,17 +710,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsM import java.util.HashMap; import java.util.List; import java.util.Map; -@@ -99,7 +108,8 @@ public class RecentTabsManager implements SyncService.SyncStateChangedListener, - */ - public RecentTabsManager(Tab tab, TabModelSelector tabModelSelector, Profile profile, - Context context, Runnable showHistoryManager) { +@@ -101,7 +110,8 @@ public class RecentTabsManager + Profile profile, + Context context, + Runnable showHistoryManager) { - mProfile = profile; + mProfile = profile.getOriginalProfile(); + profile = mProfile; mActiveTab = tab; mTabModelSelector = tabModelSelector; mShowHistoryManager = showHistoryManager; -@@ -251,6 +261,22 @@ public class RecentTabsManager implements SyncService.SyncStateChangedListener, +@@ -258,6 +268,22 @@ public class RecentTabsManager */ public void openRecentlyClosedTab(RecentlyClosedTab tab, int windowDisposition) { if (mIsDestroyed) return; @@ -905,7 +911,7 @@ new file mode 100644 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 -@@ -75,6 +75,7 @@ import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; +@@ -74,6 +74,7 @@ import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate; import org.chromium.chrome.browser.sync.SyncServiceFactory; import org.chromium.chrome.browser.ui.device_lock.MissingDeviceLockLauncher; @@ -913,7 +919,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin 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.accessibility.AccessibilitySettings; -@@ -329,6 +330,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -359,6 +360,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity ((PrivacySandboxSettingsBaseFragment) fragment) .setSnackbarManager(getSnackbarManager()); } @@ -932,10 +938,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; + - /** - * A tab model observer for managing bulk closures. - */ -@@ -40,7 +42,8 @@ public class HistoricalTabModelObserver implements TabModelObserver { + /** A tab model observer for managing bulk closures. */ + public class HistoricalTabModelObserver implements TabModelObserver { + private final TabModel mTabModel; +@@ -38,7 +40,8 @@ public class HistoricalTabModelObserver implements TabModelObserver { if (tabs.isEmpty()) return; if (tabs.size() == 1) { @@ -945,7 +951,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore return; } -@@ -71,7 +74,6 @@ public class HistoricalTabModelObserver implements TabModelObserver { +@@ -69,7 +72,6 @@ public class HistoricalTabModelObserver implements TabModelObserver { entries.add(historicalGroup); idToGroup.put(groupId, historicalGroup); } @@ -956,7 +962,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaver.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaver.java -@@ -16,7 +16,7 @@ public interface HistoricalTabSaver { +@@ -14,7 +14,7 @@ public interface HistoricalTabSaver { * Creates a Tab entry in TabRestoreService. * @param tab The {@link Tab} to create an entry for. */ @@ -968,16 +974,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaverImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaverImpl.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaverImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabSaverImpl.java -@@ -25,6 +25,8 @@ import java.util.Arrays; +@@ -26,6 +26,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; + - /** - * Creates historical entries in TabRestoreService. - */ -@@ -58,10 +60,10 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { + /** Creates historical entries in TabRestoreService. */ + @JNINamespace("historical_tab_saver") + public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -64,10 +66,10 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { // HistoricalTabSaver implementation. @Override @@ -990,7 +996,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore } @Override -@@ -113,7 +115,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -119,7 +121,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { // If there is only a single valid tab remaining save it individually. if (validEntries.size() == 1 && validEntries.get(0).isSingleTab()) { @@ -999,22 +1005,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore return; } -@@ -139,11 +141,12 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { - CollectionUtil.integerCollectionToIntArray(savedStateVersions)); +@@ -155,14 +157,15 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { + CollectionUtil.integerCollectionToIntArray(savedStateVersions)); } - private void createHistoricalTabInternal(Tab tab) { + private void createHistoricalTabInternal(Tab tab, boolean is_always_incognito) { - RecordHistogram.recordEnumeratedHistogram("Tabs.RecentlyClosed.HistoricalSaverCloseType", - HistoricalSaverCloseType.TAB, HistoricalSaverCloseType.COUNT); - HistoricalTabSaverImplJni.get().createHistoricalTab( -- tab, getWebContentsState(tab).buffer(), getWebContentsState(tab).version()); -+ tab, getWebContentsState(tab).buffer(), getWebContentsState(tab).version(), + RecordHistogram.recordEnumeratedHistogram( + "Tabs.RecentlyClosed.HistoricalSaverCloseType", + HistoricalSaverCloseType.TAB, + HistoricalSaverCloseType.COUNT); + HistoricalTabSaverImplJni.get() + .createHistoricalTab( +- tab, getWebContentsState(tab).buffer(), getWebContentsState(tab).version()); ++ tab, getWebContentsState(tab).buffer(), getWebContentsState(tab).version(), + is_always_incognito); } /** -@@ -151,7 +154,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -170,7 +173,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { * internal Chrome scheme, about:blank, or a native page and it cannot be incognito. */ private boolean shouldSave(Tab tab) { @@ -1023,20 +1032,20 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore // {@link GURL#getScheme()} is not available in unit tests. if (mIgnoreUrlSchemesForTesting) return true; -@@ -223,7 +226,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -243,7 +246,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { @NativeMethods interface Natives { - void createHistoricalTab(Tab tab, ByteBuffer state, int savedStateVersion); + void createHistoricalTab(Tab tab, ByteBuffer state, int savedStateVersion, boolean is_always_incognito); - void createHistoricalGroup(TabModel model, String title, Tab[] tabs, - ByteBuffer[] byteBuffers, int[] savedStationsVersions); - void createHistoricalBulkClosure(TabModel model, int[] groupIds, String[] titles, + + void createHistoricalGroup( + TabModel model, 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 -@@ -123,6 +123,8 @@ import org.chromium.components.webapps.bottomsheet.PwaBottomSheetControllerFacto - import org.chromium.content_public.browser.WebContents; +@@ -129,6 +129,8 @@ import org.chromium.components.webapps.bottomsheet.PwaBottomSheetController; + import org.chromium.components.webapps.bottomsheet.PwaBottomSheetControllerFactory; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.base.DeviceFormFactor; +import org.chromium.base.ContextUtils; @@ -1044,19 +1053,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/Tab import org.chromium.ui.base.IntentRequestTracker; import org.chromium.ui.modaldialog.ModalDialogManager; -@@ -790,7 +792,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { - mAppMenuCoordinator.getAppMenuHandler(), mActivityTabProvider, - mToolbarManager.getMenuButtonView(), () -> { - mTabCreatorManagerSupplier.get() -- .getTabCreator(/*incognito=*/false) -+ .getTabCreator(AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()) - .launchUrl(NewTabPageUtils.encodeNtpUrl( - NewTabPageLaunchOrigin.WEB_FEED), - TabLaunchType.FROM_CHROME_UI); +@@ -942,7 +944,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { + () -> { + mTabCreatorManagerSupplier + .get() +- .getTabCreator(/* incognito= */ false) ++ .getTabCreator(AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()) + .launchUrl( + NewTabPageUtils.encodeNtpUrl( + NewTabPageLaunchOrigin.WEB_FEED), 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 -@@ -53,6 +53,10 @@ import org.chromium.ui.base.PageTransition; +@@ -50,6 +50,10 @@ import org.chromium.ui.base.PageTransition; import org.chromium.ui.base.WindowAndroid; import org.chromium.url.GURL; @@ -1064,10 +1073,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/Chrome +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}. - */ -@@ -517,7 +521,6 @@ public class ChromeTabCreator extends TabCreator { + /** This class creates various kinds of new tabs and adds them to the right {@link TabModel}. */ + public class ChromeTabCreator extends TabCreator { + /** Interface to handle showing overview instead of NTP if needed. */ +@@ -499,7 +503,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) { @@ -1081,14 +1090,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabMod @@ -10,6 +10,7 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; - import org.chromium.base.supplier.Supplier; + import org.chromium.base.supplier.OneshotSupplier; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; import org.chromium.chrome.browser.flags.ActivityType; import org.chromium.chrome.browser.ntp.RecentlyClosedBridge; -@@ -109,6 +110,8 @@ public class TabModelSelectorImpl extends TabModelSelectorBase implements TabMod - public void onNativeLibraryReady(TabContentManager tabContentProvider) { - assert mTabContentManager == null : "onNativeLibraryReady called twice!"; +@@ -107,6 +108,8 @@ public class TabModelSelectorImpl extends TabModelSelectorBase implements TabMod + ProfileProvider profileProvider = mProfileProviderSupplier.get(); + assert profileProvider != null; + AlwaysIncognitoLinkInterceptor.migrateSettingToNative(); + @@ -1098,7 +1107,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabMod 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 -@@ -50,6 +50,8 @@ import org.chromium.components.embedder_support.util.UrlUtilities; +@@ -51,6 +51,8 @@ import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.url.GURL; @@ -1107,7 +1116,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -@@ -651,6 +653,13 @@ public class TabPersistentStore { +@@ -673,6 +675,13 @@ public class TabPersistentStore { } } } @@ -1132,13 +1141,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/Toolbar import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.app.tab_activity_glue.TabReparentingController; import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton; -@@ -556,7 +557,8 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve - return ret; - } - }, -- SearchEngineLogoUtils.getInstance()); -+ SearchEngineLogoUtils.getInstance(), -+ AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()); +@@ -590,7 +591,7 @@ public class ToolbarManager + TraceEvent.end("isOfflinePage"); + return ret; + } +- }); ++ }, AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()); mControlContainer = controlContainer; assert mControlContainer != null; @@ -1152,19 +1160,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI +import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; + - /** - * Stores info about a web app. - */ -@@ -47,6 +50,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider + /** Stores info about a web app. */ + public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider { + private final Drawable mCloseButtonIcon; +@@ -45,6 +48,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider private final ColorProviderImpl mColorProvider; private final ColorProviderImpl mDarkColorProvider; + private boolean mIsIncognito = false; + - /** - * Returns the toolbar color to use if a custom color is not specified by the webapp. - */ -@@ -78,6 +83,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider + /** Returns the toolbar color to use if a custom color is not specified by the webapp. */ + public static int getDefaultToolbarColor() { + return Color.WHITE; +@@ -80,6 +85,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider mWebappExtras = webappExtras; mWebApkExtras = webApkExtras; mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP; @@ -1175,7 +1183,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI } @Override -@@ -172,6 +181,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider +@@ -175,6 +184,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider return mWebApkExtras; } @@ -1256,8 +1264,8 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc -@@ -350,6 +350,15 @@ ChromeAutocompleteProviderClient::GetOnDeviceTailModelService() const { - #endif // BUILDFLAG(BUILD_WITH_TFLITE_LIB) +@@ -350,6 +350,15 @@ ChromeAutocompleteProviderClient::GetProviderStateService() const { + return ProviderStateServiceFactory::GetForProfile(profile_); } +bool ChromeAutocompleteProviderClient::IsAlwaysIncognitoEnabled() const { @@ -1275,9 +1283,9 @@ diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h -@@ -84,6 +84,7 @@ class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { - const override; +@@ -85,6 +85,7 @@ class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { OnDeviceTailModelService* GetOnDeviceTailModelService() const override; + ProviderStateService* GetProviderStateService() const override; bool IsOffTheRecord() const override; + bool IsAlwaysIncognitoEnabled() const override; bool IsIncognitoProfile() const override; @@ -1367,7 +1375,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo #else #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" -@@ -482,6 +485,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { +@@ -445,6 +448,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { history::HistoryService* HistoryTabHelper::GetHistoryService() { Profile* profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext()); @@ -1381,7 +1389,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo if (profile->IsOffTheRecord()) return nullptr; -@@ -489,6 +499,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { +@@ -452,6 +462,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { profile, ServiceAccessType::IMPLICIT_ACCESS); } @@ -1422,7 +1430,7 @@ diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/histor private: explicit HistoryTabHelper(content::WebContents* web_contents); friend class content::WebContentsUserData; -@@ -85,9 +92,6 @@ class HistoryTabHelper +@@ -83,9 +90,6 @@ class HistoryTabHelper void OnLanguageDetermined( const translate::LanguageDetectionDetails& details) override; @@ -1445,7 +1453,7 @@ diff --git a/chrome/browser/offline_pages/android/offline_page_bridge.cc b/chrom using base::android::ConvertJavaStringToUTF8; using base::android::ConvertUTF16ToJavaString; -@@ -782,9 +785,15 @@ void OfflinePageBridge::GetPageByOfflineIdDone( +@@ -780,9 +783,15 @@ void OfflinePageBridge::GetPageByOfflineIdDone( } if (offline_page_model_->IsArchiveInInternalDir(offline_page->file_path)) { @@ -1619,7 +1627,7 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ + if (!tab_id_.empty() && web_contents()->GetBrowserContext()->IsOffTheRecord()) { + if (Profile::FromBrowserContext(web_contents()->GetBrowserContext()) + ->GetOriginalProfile() -+ ->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled) == true) { ++ ->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled)) { + snapshots_enabled_ = true; + incognito_tab_history_enabled_ = true; + } @@ -1627,23 +1635,76 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ if (snapshots_enabled_) { page_model_ = OfflinePageModelFactory::GetForBrowserContext( -@@ -456,7 +469,11 @@ void RecentTabHelper::ContinueSnapshotWithIdsToPurge( +@@ -339,7 +352,8 @@ void RecentTabHelper::WebContentsWasHidden() { + GetRecentPagesClientId(), + base::BindOnce(&RecentTabHelper::ContinueSnapshotWithIdsToPurge, + weak_ptr_factory_.GetWeakPtr(), +- last_n_ongoing_snapshot_info_.get())); ++ last_n_ongoing_snapshot_info_.get(), ++ /*user_requested*/ false)); + + IsSavingSamePageEnum saving_same_page_value = IsSavingSamePageEnum::kNewPage; + if (last_n_latest_saved_snapshot_info_) { +@@ -420,11 +434,12 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { + downloads_latest_saved_snapshot_info_->request_id, + downloads_latest_saved_snapshot_info_->origin); + std::vector ids{downloads_latest_saved_snapshot_info_->request_id}; +- ContinueSnapshotWithIdsToPurge(downloads_ongoing_snapshot_info_.get(), ids); ++ ContinueSnapshotWithIdsToPurge(downloads_ongoing_snapshot_info_.get(), /*user_requested*/ true, ids); + } else { + // Otherwise go straight to saving the page. + DCHECK(downloads_ongoing_snapshot_info_); + ContinueSnapshotAfterPurge(downloads_ongoing_snapshot_info_.get(), ++ /*user_requested*/ true, + OfflinePageModel::DeletePageResult::SUCCESS); + } + } +@@ -441,6 +456,7 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { + // for early termination in case of errors. + void RecentTabHelper::ContinueSnapshotWithIdsToPurge( + SnapshotProgressInfo* snapshot_info, ++ bool user_requested, + const std::vector& page_ids) { + DCHECK(snapshot_info); + +@@ -450,13 +466,20 @@ void RecentTabHelper::ContinueSnapshotWithIdsToPurge( + criteria.offline_ids = page_ids; + page_model_->DeletePagesWithCriteria( + criteria, base::BindOnce(&RecentTabHelper::ContinueSnapshotAfterPurge, +- weak_ptr_factory_.GetWeakPtr(), snapshot_info)); ++ weak_ptr_factory_.GetWeakPtr(), snapshot_info, ++ user_requested)); + } + void RecentTabHelper::ContinueSnapshotAfterPurge( SnapshotProgressInfo* snapshot_info, ++ bool user_requested, OfflinePageModel::DeletePageResult result) { - if (result != OfflinePageModel::DeletePageResult::SUCCESS) { + // remove snapshot save of recent tab if always incognito mode is active + // so recents tab list is empty at every startup + // the user can choose to disable the feature -+ if (incognito_tab_history_enabled_ || !base::FeatureList::IsEnabled(offline_pages::kOfflinePagesAutoSaveFeature) -+ || result != OfflinePageModel::DeletePageResult::SUCCESS) { ++ if ((incognito_tab_history_enabled_ || !base::FeatureList::IsEnabled(offline_pages::kOfflinePagesAutoSaveFeature) ++ || result != OfflinePageModel::DeletePageResult::SUCCESS) ++ && !user_requested) { ReportSnapshotCompleted(snapshot_info, false); return; } diff --git a/chrome/browser/offline_pages/recent_tab_helper.h b/chrome/browser/offline_pages/recent_tab_helper.h --- a/chrome/browser/offline_pages/recent_tab_helper.h +++ b/chrome/browser/offline_pages/recent_tab_helper.h -@@ -146,6 +146,9 @@ class RecentTabHelper +@@ -123,8 +123,10 @@ class RecentTabHelper + + bool EnsureInitialized(); + void ContinueSnapshotWithIdsToPurge(SnapshotProgressInfo* snapshot_info, ++ bool user_requested, + const std::vector& page_ids); + void ContinueSnapshotAfterPurge(SnapshotProgressInfo* snapshot_info, ++ bool user_requested, + OfflinePageModel::DeletePageResult result); + void SavePageCallback(SnapshotProgressInfo* snapshot_info, + OfflinePageModel::SavePageResult result, +@@ -146,6 +148,9 @@ class RecentTabHelper // Not page-specific. bool snapshots_enabled_ = false; @@ -1677,7 +1738,7 @@ diff --git a/chrome/browser/offline_pages/request_coordinator_factory.h b/chrome 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 -@@ -249,6 +249,7 @@ +@@ -256,6 +256,7 @@ #if BUILDFLAG(IS_ANDROID) #include "chrome/browser/accessibility/accessibility_prefs/android/accessibility_prefs_controller.h" @@ -1685,7 +1746,7 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" #include "chrome/browser/android/ntp/recent_tabs_page_prefs.h" #include "chrome/browser/android/oom_intervention/oom_intervention_decider.h" -@@ -1781,6 +1782,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1857,6 +1858,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry); variations::VariationsService::RegisterProfilePrefs(registry); webapps::InstallPromptPrefs::RegisterProfilePrefs(registry); @@ -1707,8 +1768,8 @@ diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/prof +#include "components/prefs/pref_service.h" +#include "chrome/common/pref_names.h" #include "chrome/browser/profiles/profile.h" - #include "chrome/browser/profiles/profile_types_ash.h" #include "components/profile_metrics/browser_profile_type.h" + @@ -110,6 +113,13 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const { return nullptr; case ProfileSelection::kOriginalOnly: @@ -1769,10 +1830,10 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ +import org.chromium.base.ContextUtils; + - /** - * An interface for pages that will be using Android views instead of html/rendered Web content. - */ -@@ -120,12 +122,12 @@ public interface NativePage { + /** An interface for pages that will be using Android views instead of html/rendered Web content. */ + public interface NativePage { + /** +@@ -118,12 +120,12 @@ public interface NativePage { */ @Deprecated // Use GURL-variant instead. static boolean isNativePageUrl(String url, boolean isIncognito) { @@ -1784,10 +1845,10 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ return url != null - && nativePageType(url.getHost(), url.getScheme(), null, isIncognito) + && nativePageType(url.getHost(), url.getScheme(), null, isIncognito, false) - != NativePageType.NONE; + != NativePageType.NONE; } -@@ -137,11 +139,12 @@ public interface NativePage { +@@ -135,11 +137,12 @@ public interface NativePage { */ // TODO(crbug/783819) - Convert to using GURL. static @NativePageType int nativePageType( @@ -1802,7 +1863,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ } /** -@@ -150,7 +153,7 @@ public interface NativePage { +@@ -148,7 +151,7 @@ public interface NativePage { * @return Type of the native page defined in {@link NativePageType}. */ private static @NativePageType int nativePageType( @@ -1811,7 +1872,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ if (!UrlConstants.CHROME_NATIVE_SCHEME.equals(scheme) && !UrlConstants.CHROME_SCHEME.equals(scheme)) { return NativePageType.NONE; -@@ -168,7 +171,8 @@ public interface NativePage { +@@ -166,7 +169,8 @@ public interface NativePage { return NativePageType.DOWNLOADS; } else if (UrlConstants.HISTORY_HOST.equals(host)) { return NativePageType.HISTORY; @@ -1824,7 +1885,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ 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 -@@ -1431,6 +1431,37 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1225,6 +1225,37 @@ Your Google account may have other forms of browsing history like searches and a Clears history from all synced devices @@ -1865,7 +1926,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java -@@ -177,6 +177,7 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro +@@ -165,6 +165,7 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro protected String mFormattedFullUrl; protected String mUrlForDisplay; private boolean mOmniboxUpdatedConnectionSecurityIndicatorsEnabled; @@ -1873,12 +1934,12 @@ diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/brow // notifyUrlChanged and notifySecurityStateChanged are usually called 3 times across a same // document navigation. The first call is usually necessary, which updates the UrlBar to reflect -@@ -199,7 +200,9 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro - public LocationBarModel(Context context, NewTabPageDelegate newTabPageDelegate, - @NonNull UrlFormatter urlFormatter, @NonNull ProfileProvider profileProvider, - @NonNull OfflineStatus offlineStatus, -- @NonNull SearchEngineLogoUtils searchEngineLogoUtils) { -+ @NonNull SearchEngineLogoUtils searchEngineLogoUtils, +@@ -188,7 +189,9 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro + Context context, + NewTabPageDelegate newTabPageDelegate, + @NonNull UrlFormatter urlFormatter, +- @NonNull OfflineStatus offlineStatus) { ++ @NonNull OfflineStatus offlineStatus, + boolean isAlwaysIncognito) { + mIsAlwaysIncognito = isAlwaysIncognito; // (uazo) to do, check mContext = context; @@ -1930,7 +1991,7 @@ new file mode 100644 diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -3878,6 +3878,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = +@@ -3938,6 +3938,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = "net.out_of_process_system_dns_resolution_enabled"; #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) @@ -1946,7 +2007,7 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc --- a/components/content_settings/core/browser/content_settings_pref_provider.cc +++ b/components/content_settings/core/browser/content_settings_pref_provider.cc -@@ -87,10 +87,12 @@ void PrefProvider::RegisterProfilePrefs( +@@ -91,10 +91,12 @@ void PrefProvider::RegisterProfilePrefs( PrefProvider::PrefProvider(PrefService* prefs, bool off_the_record, @@ -1959,7 +2020,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov store_last_modified_(store_last_modified), clock_(base::DefaultClock::GetInstance()) { TRACE_EVENT_BEGIN("startup", "PrefProvider::PrefProvider"); -@@ -113,10 +115,14 @@ PrefProvider::PrefProvider(PrefService* prefs, +@@ -117,10 +119,14 @@ PrefProvider::PrefProvider(PrefService* prefs, WebsiteSettingsRegistry* website_settings = WebsiteSettingsRegistry::GetInstance(); for (const WebsiteSettingsInfo* info : *website_settings) { @@ -1986,7 +2047,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov bool store_last_modified, bool restore_session); -@@ -110,6 +111,7 @@ class PrefProvider : public UserModifiableProvider { +@@ -116,6 +117,7 @@ class PrefProvider : public UserModifiableProvider { raw_ptr prefs_; const bool off_the_record_; @@ -1997,7 +2058,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc -@@ -280,6 +280,7 @@ struct ContentSettingEntry { +@@ -288,6 +288,7 @@ struct ContentSettingEntry { HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, bool is_off_the_record, @@ -2005,7 +2066,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics) -@@ -289,6 +290,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -297,6 +298,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, #endif prefs_(prefs), is_off_the_record_(is_off_the_record), @@ -2013,7 +2074,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. store_last_modified_(store_last_modified), allow_invalid_secondary_pattern_for_testing_(false), clock_(base::DefaultClock::GetInstance()) { -@@ -301,7 +303,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -309,7 +311,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, policy_provider->AddObserver(this); auto pref_provider_ptr = std::make_unique( @@ -2033,7 +2094,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics); -@@ -527,6 +528,8 @@ class HostContentSettingsMap : public content_settings::Observer, +@@ -531,6 +532,8 @@ class HostContentSettingsMap : public content_settings::Observer, // Whether this settings map is for an incognito or guest session. bool is_off_the_record_; @@ -2056,7 +2117,7 @@ diff --git a/components/omnibox/browser/autocomplete_provider_client.cc b/compon diff --git a/components/omnibox/browser/autocomplete_provider_client.h b/components/omnibox/browser/autocomplete_provider_client.h --- a/components/omnibox/browser/autocomplete_provider_client.h +++ b/components/omnibox/browser/autocomplete_provider_client.h -@@ -136,6 +136,7 @@ class AutocompleteProviderClient : public OmniboxAction::Client { +@@ -138,6 +138,7 @@ class AutocompleteProviderClient : public OmniboxAction::Client { virtual bool IsOffTheRecord() const = 0; virtual bool IsIncognitoProfile() const = 0; virtual bool IsGuestSession() const = 0; @@ -2067,7 +2128,7 @@ diff --git a/components/omnibox/browser/autocomplete_provider_client.h b/compone diff --git a/components/omnibox/browser/base_search_provider.cc b/components/omnibox/browser/base_search_provider.cc --- a/components/omnibox/browser/base_search_provider.cc +++ b/components/omnibox/browser/base_search_provider.cc -@@ -346,7 +346,7 @@ bool BaseSearchProvider::CanSendZeroSuggestRequest( +@@ -349,7 +349,7 @@ bool BaseSearchProvider::CanSendZeroSuggestRequest( } // Don't make a suggest request if in incognito mode. @@ -2079,7 +2140,7 @@ diff --git a/components/omnibox/browser/base_search_provider.cc b/components/omn 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 -@@ -780,7 +780,9 @@ bool SearchProvider::IsQuerySuitableForSuggest(bool* query_is_private) const { +@@ -767,7 +767,9 @@ bool SearchProvider::IsQuerySuitableForSuggest(bool* query_is_private) const { // keyword input to a keyword suggest server, if any.) const TemplateURL* default_url = providers_.GetDefaultProviderURL(); const TemplateURL* keyword_url = providers_.GetKeywordProviderURL(); @@ -2128,5 +2189,16 @@ new file mode 100644 +++ b/cromite_flags/components/offline_pages/core/offline_page_feature_h/add-an-always-incognito-mode.inc @@ -0,0 +1 @@ +BASE_DECLARE_FEATURE(kOfflinePagesAutoSaveFeature); +diff --git a/net/base/file_stream_context.cc b/net/base/file_stream_context.cc +--- a/net/base/file_stream_context.cc ++++ b/net/base/file_stream_context.cc +@@ -167,7 +167,7 @@ FileStream::Context::OpenResult FileStream::Context::OpenFileImpl( + #if BUILDFLAG(IS_ANDROID) + if (path.IsContentUri()) { + // Check that only Read flags are set. +- DCHECK_EQ(open_flags & ~base::File::FLAG_ASYNC, ++ DCHECK_EQ(open_flags & ~base::File::FLAG_ASYNC & ~base::File::FLAG_WIN_EXCLUSIVE_READ, + base::File::FLAG_OPEN | base::File::FLAG_READ); + file = base::OpenContentUriForRead(path); + } else { -- -2.25.1 diff --git a/build/bromite_patches/Add-autoplay-site-setting.patch b/build/cromite_patches/Add-autoplay-site-setting.patch similarity index 97% rename from build/bromite_patches/Add-autoplay-site-setting.patch rename to build/cromite_patches/Add-autoplay-site-setting.patch index a242e6d3b31371a18f7da19f53b7478d791eca83..fb3be1be3ada866623b632198e0e0e2a7f17e7e2 100644 --- a/build/bromite_patches/Add-autoplay-site-setting.patch +++ b/build/cromite_patches/Add-autoplay-site-setting.patch @@ -11,13 +11,13 @@ Require: Content-settings-infrastructure.patch .../res/drawable-xhdpi/settings_autoplay.png | Bin 0 -> 551 bytes .../res/drawable-xxhdpi/settings_autoplay.png | Bin 0 -> 792 bytes .../drawable-xxxhdpi/settings_autoplay.png | Bin 0 -> 1064 bytes - .../impl/BromiteAutoplayContentSetting.java | 92 ++++++++++++++++++ + .../impl/BromiteAutoplayContentSetting.java | 93 ++++++++++++++++++ .../bromite_content_settings/autoplay.grdp | 21 ++++ .../bromite_content_settings/autoplay.inc | 12 +++ .../core/browser/content_settings_registry.cc | 2 +- .../core/html/media/autoplay_policy.cc | 14 +++ .../core/html/media/autoplay_policy.h | 4 + - 11 files changed, 144 insertions(+), 1 deletion(-) + 11 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png @@ -139,7 +139,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c new file mode 100644 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java -@@ -0,0 +1,92 @@ +@@ -0,0 +1,93 @@ +/* + This file is part of Bromite. + @@ -192,7 +192,8 @@ new file mode 100644 + /*defaultEnabledValue*/ getDefaultEnabledValue(), + /*defaultDisabledValue*/ getDefaultDisabledValue(), + /*enabledSummary*/ R.string.website_settings_category_autoplay_enabled, -+ /*disabledSummary*/ R.string.website_settings_category_autoplay_disabled); ++ /*disabledSummary*/ R.string.website_settings_category_autoplay_disabled, ++ /*summaryOverrideForScreenReader*/ 0); + } + + @Override @@ -278,13 +279,13 @@ new file mode 100644 diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -246,7 +246,7 @@ void ContentSettingsRegistry::Init() { +@@ -250,7 +250,7 @@ void ContentSettingsRegistry::Init() { ContentSettingsInfo::INHERIT_IN_INCOGNITO, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); - Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW, + Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_BLOCK, - WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_schemes=*/{}, + WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_primary_schemes=*/{}, /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc @@ -298,7 +299,7 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/thi #include "third_party/blink/public/platform/web_media_player.h" #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_local_frame_client.h" -@@ -310,6 +311,8 @@ void AutoplayPolicy::TryUnlockingUserGesture() { +@@ -332,6 +333,8 @@ void AutoplayPolicy::TryUnlockingUserGesture() { } bool AutoplayPolicy::IsGestureNeededForPlayback() const { @@ -307,7 +308,7 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/thi if (!IsLockedPendingUserGesture()) return false; -@@ -408,6 +411,17 @@ void AutoplayPolicy::MaybeSetAutoplayInitiated() { +@@ -430,6 +433,17 @@ void AutoplayPolicy::MaybeSetAutoplayInitiated() { } } @@ -328,7 +329,7 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/thi diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.h b/third_party/blink/renderer/core/html/media/autoplay_policy.h --- a/third_party/blink/renderer/core/html/media/autoplay_policy.h +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.h -@@ -133,6 +133,10 @@ class CORE_EXPORT AutoplayPolicy final +@@ -137,6 +137,10 @@ class CORE_EXPORT AutoplayPolicy final // should use, if checking to see if an action is allowed. bool IsLockedPendingUserGesture() const; @@ -340,4 +341,3 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.h b/thir bool IsOrWillBeAutoplayingMutedInternal(bool muted) const; -- -2.25.1 diff --git a/build/bromite_patches/Add-bookmark-import-export-actions.patch b/build/cromite_patches/Add-bookmark-import-export-actions.patch similarity index 89% rename from build/bromite_patches/Add-bookmark-import-export-actions.patch rename to build/cromite_patches/Add-bookmark-import-export-actions.patch index 87fd540564fe4e902faf3c943e5ab74a01217098..d1d0f4ce6478dd5a0388c662d7c8f899af16cbd5 100644 --- a/build/bromite_patches/Add-bookmark-import-export-actions.patch +++ b/build/cromite_patches/Add-bookmark-import-export-actions.patch @@ -15,14 +15,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../menu/bookmark_toolbar_menu_improved.xml | 14 + .../browser/TabbedModeTabDelegateFactory.java | 5 +- .../app/bookmarks/BookmarkActivity.java | 32 ++ - .../browser/bookmarks/BookmarkBridge.java | 278 +++++++++++++++++ + .../browser/bookmarks/BookmarkBridge.java | 280 +++++++++++++++++ .../browser/bookmarks/BookmarkDelegate.java | 10 + .../bookmarks/BookmarkManagerCoordinator.java | 9 + .../bookmarks/BookmarkManagerMediator.java | 23 ++ .../browser/bookmarks/BookmarkPage.java | 8 +- .../browser/bookmarks/BookmarkToolbar.java | 23 ++ .../bookmarks/BookmarkToolbarMediator.java | 4 + - .../bookmarks/BookmarkToolbarProperties.java | 7 +- + .../bookmarks/BookmarkToolbarProperties.java | 8 +- .../bookmarks/BookmarkToolbarViewBinder.java | 6 + .../native_page/NativePageFactory.java | 11 +- chrome/browser/BUILD.gn | 11 +- @@ -33,7 +33,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../DownloadLocationDialogCoordinator.java | 8 +- .../flags/android/chrome_feature_list.cc | 1 + .../browser/flags/ChromeFeatureList.java | 1 + - chrome/browser/importer/profile_writer.cc | 12 + + chrome/browser/importer/profile_writer.cc | 10 + chrome/browser/importer/profile_writer.h | 6 + .../preferences/ChromePreferenceKeys.java | 3 + .../strings/android_chrome_strings.grd | 18 ++ @@ -53,7 +53,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ui/shell_dialogs/select_file_dialog_linux.cc | 4 + ui/shell_dialogs/select_file_dialog_linux.h | 2 + ui/shell_dialogs/select_file_dialog_win.cc | 5 + - 43 files changed, 917 insertions(+), 29 deletions(-) + 43 files changed, 918 insertions(+), 29 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/add-bookmark-import-export-actions.inc @@ -137,19 +137,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDe private final BrowserControlsVisibilityDelegate mAppBrowserControlsVisibilityDelegate; private final Supplier mShareDelegateSupplier; private final Supplier mEphemeralTabCoordinatorSupplier; -@@ -76,7 +77,7 @@ public class TabbedModeTabDelegateFactory implements TabDelegateFactory { - +@@ -77,7 +78,7 @@ public class TabbedModeTabDelegateFactory implements TabDelegateFactory { private NativePageFactory mNativePageFactory; -- public TabbedModeTabDelegateFactory(Activity activity, -+ public TabbedModeTabDelegateFactory(ChromeActivity activity, + public TabbedModeTabDelegateFactory( +- Activity activity, ++ ChromeActivity activity, BrowserControlsVisibilityDelegate appBrowserControlsVisibilityDelegate, Supplier shareDelegateSupplier, Supplier ephemeralTabCoordinatorSupplier, diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java -@@ -21,6 +21,11 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; +@@ -21,6 +21,11 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.embedder_support.util.UrlConstants; @@ -171,9 +171,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); -@@ -54,8 +62,23 @@ public class BookmarkActivity extends SnackbarActivity { - BackPressHelper.create(this, getOnBackPressedDispatcher(), - mBookmarkManagerCoordinator::onBackPressed, SecondaryActivity.BOOKMARK); +@@ -66,8 +74,23 @@ public class BookmarkActivity extends SnackbarActivity { + mBookmarkManagerCoordinator::onBackPressed, + SecondaryActivity.BOOKMARK); } + + final boolean listenToActivityState = true; @@ -195,15 +195,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B @Override protected void onDestroy() { super.onDestroy(); -@@ -65,6 +88,7 @@ public class BookmarkActivity extends SnackbarActivity { +@@ -77,6 +100,7 @@ public class BookmarkActivity extends SnackbarActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); + mWindowAndroid.getIntentRequestTracker().onActivityResult(requestCode, resultCode, data); if (requestCode == EDIT_BOOKMARK_REQUEST_CODE && resultCode == RESULT_OK) { - BookmarkId bookmarkId = BookmarkId.getBookmarkIdFromString( - data.getStringExtra(INTENT_VISIT_BOOKMARK_ID)); -@@ -72,6 +96,14 @@ public class BookmarkActivity extends SnackbarActivity { + BookmarkId bookmarkId = + BookmarkId.getBookmarkIdFromString( +@@ -85,6 +109,14 @@ public class BookmarkActivity extends SnackbarActivity { } } @@ -242,7 +242,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm import android.text.TextUtils; import android.util.Pair; -@@ -37,6 +50,32 @@ import org.chromium.url.GURL; +@@ -36,6 +49,33 @@ import org.chromium.url.GURL; import java.util.ArrayList; import java.util.List; @@ -251,7 +251,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm +import org.chromium.chrome.browser.document.ChromeLauncherActivity; +import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; -+import org.chromium.chrome.browser.preferences.SharedPreferencesManager; ++import org.chromium.base.shared_preferences.SharedPreferencesManager; ++import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.ui.base.PageTransition; +import org.chromium.ui.base.WindowAndroid; @@ -273,10 +274,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm +import java.io.File; + /** - * Provides the communication channel for Android to fetch and manipulate the - * bookmark model stored in native. -@@ -435,6 +474,209 @@ class BookmarkBridge { - mNativeBookmarkBridge, id.getId(), id.getType()); + * Provides the communication channel for Android to fetch and manipulate the bookmark model stored + * in native. +@@ -435,6 +475,209 @@ class BookmarkBridge { + .getTotalBookmarkCount(mNativeBookmarkBridge, id.getId(), id.getType()); } + /** @@ -317,7 +318,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); + + // get last exported uri path, if any -+ SharedPreferencesManager sharedPrefs = SharedPreferencesManager.getInstance(); ++ SharedPreferencesManager sharedPrefs = ChromeSharedPreferences.getInstance(); + String bookmarksPath = sharedPrefs.readString(ChromePreferenceKeys.BOOKMARKS_LAST_EXPORT_URI, standardBoorkmarkName); + Uri lastSelectedUri = Uri.parse(bookmarksPath); + @@ -484,8 +485,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + /** * Synchronously gets a list of bookmarks that match the specified search query. - * @param query Keyword used for searching bookmarks. -@@ -931,6 +1173,39 @@ class BookmarkBridge { + * +@@ -950,6 +1193,39 @@ class BookmarkBridge { depthList.add(depth); } @@ -500,7 +501,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + } + }); + } else { -+ SharedPreferencesManager sharedPrefs = SharedPreferencesManager.getInstance(); ++ SharedPreferencesManager sharedPrefs = ChromeSharedPreferences.getInstance(); + sharedPrefs.writeString(ChromePreferenceKeys.BOOKMARKS_LAST_EXPORT_URI, bookmarksPath); + + Context context = ContextUtils.getApplicationContext(); @@ -525,22 +526,23 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm private static List> createPairsList(int[] left, int[] right) { List> pairList = new ArrayList<>(); for (int i = 0; i < left.length; i++) { -@@ -961,6 +1236,9 @@ class BookmarkBridge { - int getChildCount(long nativeBookmarkBridge, long id, int type); +@@ -994,6 +1270,10 @@ class BookmarkBridge { void getChildIds( long nativeBookmarkBridge, long id, int type, List bookmarksList); + + void importBookmarks(long nativeBookmarkBridge, BookmarkBridge caller, WindowAndroid window); + void exportBookmarks(long nativeBookmarkBridge, BookmarkBridge caller, WindowAndroid window, + String export_path); ++ BookmarkId getChildAt(long nativeBookmarkBridge, long id, int type, int index); + int getTotalBookmarkCount(long nativeBookmarkBridge, long id, int type); - void setBookmarkTitle(long nativeBookmarkBridge, long id, int type, String title); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java -@@ -60,6 +60,16 @@ public interface BookmarkDelegate { - */ - void openBookmarksInNewTabs(List bookmark, boolean incognito); +@@ -66,6 +66,16 @@ public interface BookmarkDelegate { + /** Shows the search UI. */ + void openSearchUi(); + /** + * Imports bookmarks from user-selected file. @@ -552,13 +554,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + */ + void exportBookmarks(); + - /** - * Shows the search UI. - */ + /** Add an observer to bookmark UI changes. */ + void addUiObserver(BookmarkUiObserver observer); + diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerCoordinator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerCoordinator.java -@@ -49,6 +49,8 @@ import org.chromium.components.image_fetcher.ImageFetcher; +@@ -47,6 +47,8 @@ import org.chromium.components.image_fetcher.ImageFetcher; import org.chromium.components.image_fetcher.ImageFetcherConfig; import org.chromium.components.image_fetcher.ImageFetcherFactory; import org.chromium.ui.KeyboardVisibilityDelegate; @@ -567,7 +569,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modaldialog.ModalDialogManager.ModalDialogType; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; -@@ -233,6 +235,13 @@ public class BookmarkManagerCoordinator +@@ -320,6 +322,13 @@ public class BookmarkManagerCoordinator // Public API implementation. @@ -578,13 +580,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + mMediator.setWindow(window, modalDialogManager); + } + - /** - * Destroys and cleans up itself. This must be called after done using this class. - */ + /** Destroys and cleans up itself. This must be called after done using this class. */ + public void onDestroyed() { + RecordUserAction.record("MobileBookmarkManagerClose"); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManagerMediator.java -@@ -55,6 +55,8 @@ import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelega +@@ -53,6 +53,8 @@ import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelega import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate.SelectionObserver; import org.chromium.components.commerce.core.CommerceSubscription; import org.chromium.components.commerce.core.ShoppingService; @@ -600,10 +602,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + private ActivityWindowAndroid mWindowAndroid; + private ModalDialogManager mModalDialogManager; + - /** - * Keeps track of whether drag is enabled / active for bookmark lists. - */ -@@ -513,6 +518,14 @@ class BookmarkManagerMediator + /** Keeps track of whether drag is enabled / active for bookmark lists. */ + private class BookmarkDragStateDelegate implements DragStateDelegate { + private BookmarkDelegate mBookmarkDelegate; +@@ -551,6 +556,14 @@ class BookmarkManagerMediator mNativePage = nativePage; } @@ -615,10 +617,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + mModalDialogManager = modalDialogManager; + } + - /** - * See BookmarkManager(Coordinator)#updateForUrl - */ -@@ -689,6 +702,16 @@ class BookmarkManagerMediator + /** See BookmarkManager(Coordinator)#updateForUrl */ + void updateForUrl(String url) { + // Bookmark model is null if the manager has been destroyed. +@@ -727,6 +740,16 @@ class BookmarkManagerMediator } } @@ -646,20 +648,20 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm +import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.components.browser_ui.modaldialog.AppModalPresenter; - /** - * A native page holding a {@link BookmarkManagerCoordinator} on _tablet_. -@@ -29,7 +32,7 @@ public class BookmarkPage extends BasicNativePage { - * @param host A NativePageHost to load urls. - */ - public BookmarkPage(ComponentName componentName, SnackbarManager snackbarManager, -- boolean isIncognito, NativePageHost host) { -+ boolean isIncognito, NativePageHost host, ChromeActivity activity) { + /** A native page holding a {@link BookmarkManagerCoordinator} on _tablet_. */ + public class BookmarkPage extends BasicNativePage { +@@ -31,7 +34,7 @@ public class BookmarkPage extends BasicNativePage { + ComponentName componentName, + SnackbarManager snackbarManager, + boolean isIncognito, +- NativePageHost host) { ++ NativePageHost host, ChromeActivity activity) { super(host); mBookmarkManagerCoordinator = -@@ -37,6 +40,9 @@ public class BookmarkPage extends BasicNativePage { - snackbarManager, Profile.getLastUsedRegularProfile(), - new BookmarkUiPrefs(SharedPreferencesManager.getInstance())); +@@ -44,6 +47,9 @@ public class BookmarkPage extends BasicNativePage { + Profile.getLastUsedRegularProfile(), + new BookmarkUiPrefs(ChromeSharedPreferences.getInstance())); mBookmarkManagerCoordinator.setBasicNativePage(this); + mBookmarkManagerCoordinator.setWindow(activity.getWindowAndroid(), + new ModalDialogManager( @@ -670,7 +672,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java -@@ -119,6 +119,17 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -120,6 +120,17 @@ public class BookmarkToolbar extends SelectableListToolbar setOnMenuItemClickListener(dragEnabled ? null : this); } @@ -688,7 +690,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm void setSearchButtonVisible(boolean visible) { // The improved bookmarks experience embeds search in the list. if (BookmarkFeatures.isAndroidImprovedBookmarksEnabled()) return; -@@ -172,6 +183,8 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -173,6 +184,8 @@ public class BookmarkToolbar extends SelectableListToolbar void setCurrentFolder(BookmarkId folder) { mCurrentFolder = mBookmarkModel.getBookmarkById(folder); @@ -697,7 +699,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm } void setNavigateBackRunnable(Runnable navigateBackRunnable) { -@@ -191,6 +204,13 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -192,6 +205,13 @@ public class BookmarkToolbar extends SelectableListToolbar @Override public boolean onMenuItemClick(MenuItem menuItem) { hideOverflowMenu(); @@ -711,7 +713,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm return mMenuIdClickedFunction.apply(menuItem.getItemId()); } -@@ -211,6 +231,9 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -212,6 +232,9 @@ public class BookmarkToolbar extends SelectableListToolbar protected void showNormalView() { super.showNormalView(); @@ -724,22 +726,22 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarMediator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarMediator.java -@@ -109,6 +109,10 @@ class BookmarkToolbarMediator implements BookmarkUiObserver, DragListener, - bookmarkDelegateSupplier.onAvailable((bookmarkDelegate) -> { - mBookmarkDelegate = bookmarkDelegate; - mModel.set(BookmarkToolbarProperties.NAVIGATE_BACK_RUNNABLE, this::onNavigateBack); -+ mModel.set( -+ BookmarkToolbarProperties.IMPORT_BOOKMARK_RUNNABLE, mBookmarkDelegate::importBookmarks); -+ mModel.set( -+ BookmarkToolbarProperties.EXPORT_BOOKMARK_RUNNABLE, mBookmarkDelegate::exportBookmarks); - mBookmarkDelegate.addUiObserver(this); - mBookmarkDelegate.notifyStateChange(this); - }); +@@ -129,6 +129,10 @@ class BookmarkToolbarMediator + mBookmarkDelegate = bookmarkDelegate; + mModel.set( + BookmarkToolbarProperties.NAVIGATE_BACK_RUNNABLE, this::onNavigateBack); ++ mModel.set( ++ BookmarkToolbarProperties.IMPORT_BOOKMARK_RUNNABLE, mBookmarkDelegate::importBookmarks); ++ mModel.set( ++ BookmarkToolbarProperties.EXPORT_BOOKMARK_RUNNABLE, mBookmarkDelegate::exportBookmarks); + mBookmarkDelegate.addUiObserver(this); + mBookmarkDelegate.notifyStateChange(this); + }); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarProperties.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarProperties.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarProperties.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarProperties.java -@@ -66,11 +66,16 @@ class BookmarkToolbarProperties { - new WritableObjectPropertyKey<>(); +@@ -69,6 +69,10 @@ class BookmarkToolbarProperties { + static final WritableObjectPropertyKey NAVIGATE_BACK_RUNNABLE = new WritableObjectPropertyKey<>(); + static final WritableObjectPropertyKey IMPORT_BOOKMARK_RUNNABLE = @@ -747,19 +749,22 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + static final WritableObjectPropertyKey EXPORT_BOOKMARK_RUNNABLE = + new WritableObjectPropertyKey<>(); - static final PropertyKey[] ALL_KEYS = {BOOKMARK_MODEL, BOOKMARK_OPENER, SELECTION_DELEGATE, - TITLE, BOOKMARK_UI_MODE, SOFT_KEYBOARD_VISIBLE, IS_DIALOG_UI, DRAG_ENABLED, - SEARCH_BUTTON_VISIBLE, EDIT_BUTTON_VISIBLE, NEW_FOLDER_BUTTON_VISIBLE, - NEW_FOLDER_BUTTON_ENABLED, NAVIGATION_BUTTON_STATE, CURRENT_FOLDER, SORT_MENU_IDS, - SORT_MENU_IDS_ENABLED, CHECKED_SORT_MENU_ID, CHECKED_VIEW_MENU_ID, -- MENU_ID_CLICKED_FUNCTION, NAVIGATE_BACK_RUNNABLE, FAKE_SELECTION_STATE_CHANGE}; -+ MENU_ID_CLICKED_FUNCTION, NAVIGATE_BACK_RUNNABLE, FAKE_SELECTION_STATE_CHANGE, -+ IMPORT_BOOKMARK_RUNNABLE, EXPORT_BOOKMARK_RUNNABLE}; + static final PropertyKey[] ALL_KEYS = { + BOOKMARK_MODEL, +@@ -91,6 +95,8 @@ class BookmarkToolbarProperties { + CHECKED_VIEW_MENU_ID, + MENU_ID_CLICKED_FUNCTION, + NAVIGATE_BACK_RUNNABLE, +- FAKE_SELECTION_STATE_CHANGE ++ FAKE_SELECTION_STATE_CHANGE, ++ IMPORT_BOOKMARK_RUNNABLE, ++ EXPORT_BOOKMARK_RUNNABLE + }; } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarViewBinder.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarViewBinder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbarViewBinder.java -@@ -61,6 +61,12 @@ class BookmarkToolbarViewBinder { +@@ -59,6 +59,12 @@ class BookmarkToolbarViewBinder { model.get(BookmarkToolbarProperties.CHECKED_VIEW_MENU_ID)); } else if (key == BookmarkToolbarProperties.CURRENT_FOLDER) { bookmarkToolbar.setCurrentFolder(model.get(BookmarkToolbarProperties.CURRENT_FOLDER)); @@ -783,7 +788,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat import org.chromium.chrome.browser.app.download.home.DownloadPage; import org.chromium.chrome.browser.bookmarks.BookmarkPage; import org.chromium.chrome.browser.browser_controls.BrowserControlsMarginSupplier; -@@ -53,7 +54,7 @@ import org.chromium.ui.util.ColorUtils; +@@ -52,7 +53,7 @@ import org.chromium.ui.util.ColorUtils; * Creates NativePage objects to show chrome-native:// URLs using the native Android view system. */ public class NativePageFactory { @@ -793,15 +798,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat private final BrowserControlsManager mBrowserControlsManager; private final Supplier mCurrentTabSupplier; @@ -70,7 +71,7 @@ public class NativePageFactory { - private NativePageBuilder mNativePageBuilder; -- public NativePageFactory(@NonNull Activity activity, -+ public NativePageFactory(@NonNull ChromeActivity activity, + public NativePageFactory( +- @NonNull Activity activity, ++ @NonNull ChromeActivity activity, @NonNull BottomSheetController sheetController, @NonNull BrowserControlsManager browserControlsManager, @NonNull Supplier currentTabSupplier, -@@ -118,7 +119,7 @@ public class NativePageFactory { +@@ -130,7 +131,7 @@ public class NativePageFactory { @VisibleForTesting static class NativePageBuilder { @@ -810,18 +815,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat private final BottomSheetController mBottomSheetController; private final Supplier mUma; private final BrowserControlsManager mBrowserControlsManager; -@@ -133,7 +134,7 @@ public class NativePageFactory { - private final HomeSurfaceTracker mHomeSurfaceTracker; +@@ -146,7 +147,7 @@ public class NativePageFactory { private final ObservableSupplier mTabContentManagerSupplier; -- public NativePageBuilder(Activity activity, Supplier uma, -+ public NativePageBuilder(ChromeActivity activity, Supplier uma, + public NativePageBuilder( +- Activity activity, ++ ChromeActivity activity, + Supplier uma, BottomSheetController sheetController, - BrowserControlsManager browserControlsManager, Supplier currentTabSupplier, - Supplier snackbarManagerSupplier, -@@ -175,7 +176,7 @@ public class NativePageFactory { - protected NativePage buildBookmarksPage(Tab tab) { - return new BookmarkPage(mActivity.getComponentName(), mSnackbarManagerSupplier.get(), + BrowserControlsManager browserControlsManager, +@@ -208,7 +209,7 @@ public class NativePageFactory { + mActivity.getComponentName(), + mSnackbarManagerSupplier.get(), mTabModelSelector.isIncognitoSelected(), - new TabShim(tab, mBrowserControlsManager, mTabModelSelector)); + new TabShim(tab, mBrowserControlsManager, mTabModelSelector), mActivity); @@ -831,7 +836,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -225,6 +225,8 @@ static_library("browser") { +@@ -199,6 +199,8 @@ static_library("browser") { "bluetooth/chrome_bluetooth_delegate_impl_client.h", "bookmarks/bookmark_model_factory.cc", "bookmarks/bookmark_model_factory.h", @@ -840,7 +845,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "bookmarks/chrome_bookmark_client.cc", "bookmarks/chrome_bookmark_client.h", "bookmarks/managed_bookmark_service_factory.cc", -@@ -1968,6 +1970,13 @@ static_library("browser") { +@@ -1939,6 +1941,13 @@ static_library("browser") { ] } @@ -854,7 +859,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn configs += [ "//build/config/compiler:wexit_time_destructors", "//build/config:precompiled_headers", -@@ -3697,8 +3706,6 @@ static_library("browser") { +@@ -3664,8 +3673,6 @@ static_library("browser") { "badging/badge_manager_factory.h", "banners/app_banner_manager_desktop.cc", "banners/app_banner_manager_desktop.h", @@ -866,7 +871,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc --- a/chrome/browser/bookmarks/android/bookmark_bridge.cc +++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc -@@ -58,6 +58,25 @@ +@@ -56,6 +56,25 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" @@ -892,7 +897,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse using base::android::AttachCurrentThread; using base::android::ConvertUTF16ToJavaString; using base::android::ConvertUTF8ToJavaString; -@@ -75,8 +94,92 @@ using bookmarks::android::JavaBookmarkIdGetType; +@@ -73,12 +92,96 @@ using bookmarks::android::JavaBookmarkIdGetType; using content::BrowserThread; using power_bookmarks::PowerBookmarkMeta; @@ -947,7 +952,11 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse +} // internal + namespace { + // The key used to connect the instance of the bookmark bridge to the bookmark + // model. + const char kBookmarkBridgeUserDataKey[] = "bookmark_bridge"; + // Compares titles of different instance of BookmarkNode. +class FileBookmarksExportObserver: public BookmarksExportObserver { + public: + FileBookmarksExportObserver( @@ -985,7 +994,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse class BookmarkTitleComparer { public: explicit BookmarkTitleComparer(BookmarkBridge* bookmark_bridge, -@@ -198,6 +301,10 @@ BookmarkBridge::~BookmarkBridge() { +@@ -199,6 +302,10 @@ BookmarkBridge::~BookmarkBridge() { if (partner_bookmarks_shim_) partner_bookmarks_shim_->RemoveObserver(this); reading_list_manager_->RemoveObserver(this); @@ -996,7 +1005,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse } void BookmarkBridge::Destroy(JNIEnv*) { -@@ -558,6 +665,182 @@ jint BookmarkBridge::GetTotalBookmarkCount( +@@ -539,6 +646,182 @@ jint BookmarkBridge::GetTotalBookmarkCount( return count; } @@ -1182,7 +1191,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser/bookmarks/android/bookmark_bridge.h --- a/chrome/browser/bookmarks/android/bookmark_bridge.h +++ b/chrome/browser/bookmarks/android/bookmark_bridge.h -@@ -19,6 +19,7 @@ +@@ -20,6 +20,7 @@ #include "base/supports_user_data.h" #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" #include "chrome/browser/image_service/image_service_factory.h" @@ -1190,17 +1199,17 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_observer.h" #include "chrome/browser/reading_list/android/reading_list_manager.h" -@@ -27,6 +28,9 @@ +@@ -31,6 +32,9 @@ #include "components/prefs/pref_change_registrar.h" #include "url/android/gurl_android.h" +#include "components/search_engines/template_url.h" +#include "ui/shell_dialogs/select_file_dialog.h" + - namespace bookmarks { - class BookmarkModel; - class ManagedBookmarkService; -@@ -44,7 +48,8 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, + class BookmarkBridgeTest; + + // The delegate to fetch bookmarks information for the Android native +@@ -42,7 +46,8 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, public PartnerBookmarksShim::Observer, public ReadingListManager::Observer, public ProfileObserver, @@ -1210,7 +1219,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser public: BookmarkBridge(Profile* profile, bookmarks::BookmarkModel* model, -@@ -72,6 +77,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -69,6 +74,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, bool IsDoingExtensiveChanges(JNIEnv* env); @@ -1223,7 +1232,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser jboolean IsEditBookmarksEnabled(JNIEnv* env); void LoadEmptyPartnerBookmarkShimForTesting(JNIEnv* env); -@@ -84,6 +95,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -81,6 +92,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, jlong id, jint type); @@ -1236,9 +1245,9 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser + const base::android::JavaParamRef& java_window, + const base::android::JavaParamRef& j_export_path); + - void GetTopLevelFolderIds( + void GetAllFoldersWithDepths( JNIEnv* env, - const base::android::JavaParamRef& j_result_obj); + const base::android::JavaParamRef& j_folders_obj, @@ -310,12 +330,16 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, void DestroyJavaObject(); @@ -1299,7 +1308,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b 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 -@@ -49,7 +49,7 @@ public class DownloadLocationCustomView +@@ -47,7 +47,7 @@ public class DownloadLocationCustomView extends ScrollView private TextView mFileSize; private Spinner mFileLocation; private TextView mLocationAvailableSpace; @@ -1308,7 +1317,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse private @DownloadLocationDialogType int mDialogType; private long mTotalBytes; -@@ -72,7 +72,7 @@ public class DownloadLocationCustomView +@@ -70,7 +70,7 @@ public class DownloadLocationCustomView extends ScrollView mDontShowAgain = findViewById(R.id.show_again_checkbox); } @@ -1317,8 +1326,8 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse // TODO(xingliu): Remove this function, currently used by smart suggestion. mDialogType = dialogType; mTotalBytes = totalBytes; -@@ -125,7 +125,7 @@ public class DownloadLocationCustomView - * @return The text that the user inputted as the name of the file. +@@ -123,7 +123,7 @@ public class DownloadLocationCustomView extends ScrollView + * @return The text that the user inputted as the name of the file. */ @Nullable - String getFileName() { @@ -1326,8 +1335,8 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse if (mFileName == null || mFileName.getText() == null) return null; return mFileName.getText().toString(); } -@@ -134,7 +134,7 @@ public class DownloadLocationCustomView - * @return The file path based on what the user selected as the location of the file. +@@ -132,7 +132,7 @@ public class DownloadLocationCustomView extends ScrollView + * @return The file path based on what the user selected as the location of the file. */ @Nullable - DirectoryOption getDirectoryOption() { @@ -1338,10 +1347,10 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse 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 -@@ -36,12 +36,12 @@ import java.util.ArrayList; +@@ -35,12 +35,12 @@ import java.util.ArrayList; + */ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.Controller { - @NonNull - private DownloadLocationDialogController mController; + @NonNull private DownloadLocationDialogController mController; - private PropertyModel mDialogModel; + protected PropertyModel mDialogModel; private PropertyModel mDownloadLocationDialogModel; @@ -1354,7 +1363,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse private long mTotalBytes; private @DownloadLocationDialogType int mDialogType; private String mSuggestedPath; -@@ -130,7 +130,7 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. +@@ -137,7 +137,7 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. * Called after retrieved the download directory options. * @param dirs An list of available download directories. */ @@ -1366,21 +1375,21 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse 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 -@@ -191,6 +191,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -189,6 +189,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { + &kCastDeviceFilter, &kClearOmniboxFocusAfterNavigation, - &kCloseTabSuggestions, &kCloseTabSaveTabList, + &kBookmarksExportUseSaf, &kCriticalPersistedTabData, &kCreateNewTabInitializeRenderer, - &kCCTBackgroundTab, + &kCCTBottomBarSwipeUpGesture, 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 -@@ -475,6 +475,7 @@ public abstract class ChromeFeatureList { - public static final String USE_LIBUNWINDSTACK_NATIVE_UNWINDER_ANDROID = - "UseLibunwindstackNativeUnwinderAndroid"; +@@ -494,6 +494,7 @@ public abstract class ChromeFeatureList { public static final String USER_BYPASS_UI = "UserBypassUI"; + public static final String VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR = + "VerticalAutomotiveBackButtonToolbar"; + public static final String BOOKMARKS_EXPORT_USESAF = "BookmarksExportUseSaf"; public static final String VOICE_BUTTON_IN_TOP_TOOLBAR = "VoiceButtonInTopToolbar"; public static final String VOICE_SEARCH_AUDIO_CAPTURE_POLICY = "VoiceSearchAudioCapturePolicy"; @@ -1388,22 +1397,7 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc --- a/chrome/browser/importer/profile_writer.cc +++ b/chrome/browser/importer/profile_writer.cc -@@ -106,12 +106,14 @@ void ProfileWriter::AddHistoryPage(const history::URLRows& page, - HistoryServiceFactory::GetForProfile(profile_, - ServiceAccessType::EXPLICIT_ACCESS) - ->AddPagesWithDetails(page, visit_source); -+#if !BUILDFLAG(IS_ANDROID) - // Measure the size of the history page after Auto Import on first run. - if (first_run::IsChromeFirstRun() && - visit_source == history::SOURCE_IE_IMPORTED) { - UMA_HISTOGRAM_COUNTS_1M("Import.ImportedHistorySize.AutoImportFromIE", - page.size()); - } -+#endif - } - - void ProfileWriter::AddHomepage(const GURL& home_page) { -@@ -132,6 +134,16 @@ void ProfileWriter::AddBookmarks( +@@ -125,6 +125,16 @@ void ProfileWriter::AddBookmarks( return; BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile_); @@ -1446,7 +1440,7 @@ diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/ 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 -@@ -101,6 +101,8 @@ public final class ChromePreferenceKeys { +@@ -104,6 +104,8 @@ public final class ChromePreferenceKeys { "enhanced_bookmark_last_used_parent_folder"; public static final String BOOKMARKS_SORT_ORDER = "Chrome.Bookmarks.BookmarkRowSortOrder"; public static final String BOOKMARKS_VISUALS_PREF = "Chrome.Bookmarks.BookmarkRowDisplay"; @@ -1455,7 +1449,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro /** * Whether Chrome is set as the default browser. -@@ -992,6 +994,7 @@ public final class ChromePreferenceKeys { +@@ -938,6 +940,7 @@ public final class ChromePreferenceKeys { AUTOFILL_ASSISTANT_PROACTIVE_HELP_ENABLED, APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE, APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO, @@ -1466,7 +1460,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro 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 -@@ -245,6 +245,24 @@ CHAR_LIMIT guidelines: +@@ -248,6 +248,24 @@ CHAR_LIMIT guidelines: Sites @@ -1494,7 +1488,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -402,6 +402,9 @@ static_library("common_lib") { +@@ -403,6 +403,9 @@ static_library("common_lib") { sources += [ "media/chrome_media_drm_bridge_client.cc", "media/chrome_media_drm_bridge_client.h", @@ -1715,25 +1709,25 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui // The permission scenario for accessing media has evolved a bit over the years: // Early on, READ_EXTERNAL_STORAGE was required to access media, but that permission was // later deprecated. In its place (starting with Android T) READ_MEDIA_IMAGES and -@@ -381,7 +388,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick - } - - // TODO(finnur): Remove once we figure out the cause of crbug.com/950024. -- if (shouldUsePhotoPicker) { -+ if (shouldUsePhotoPicker || shouldShowHtmlTypes()) { - if (permissions.length != requestPermissions.length) { - throw new RuntimeException( - String.format("Permissions arrays misaligned: %d != %d", -@@ -395,7 +402,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick - } - } - -- if (shouldUsePhotoPicker) { -+ if (shouldUsePhotoPicker || shouldShowHtmlTypes()) { - if (permissions[i].equals(storagePermission) - || permissions[i].equals(Manifest.permission.READ_MEDIA_IMAGES) - || permissions[i].equals( -@@ -672,6 +679,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -385,7 +392,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick + + // TODO(finnur): Remove once we figure out the cause of + // crbug.com/950024. +- if (shouldUsePhotoPicker) { ++ if (shouldUsePhotoPicker || shouldShowHtmlTypes()) { + if (permissions.length != requestPermissions.length) { + throw new RuntimeException( + String.format( +@@ -402,7 +409,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick + } + } + +- if (shouldUsePhotoPicker) { ++ if (shouldUsePhotoPicker || shouldShowHtmlTypes()) { + if (permissions[i].equals(storagePermission) + || permissions[i].equals( + Manifest.permission.READ_MEDIA_IMAGES) +@@ -685,6 +692,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick } if (!mimeTypes.contains(mimeType)) mimeTypes.add(mimeType); } @@ -1741,7 +1735,7 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui return mimeTypes; } -@@ -1000,6 +1008,10 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -1032,6 +1040,10 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick return countAcceptTypesFor(superType) == mFileTypes.size(); } @@ -1854,4 +1848,3 @@ diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/selec if (!owning_window->GetRootWindow()) return false; -- -2.25.1 diff --git a/build/bromite_patches/00Add-cromite-flags-support.patch b/build/cromite_patches/Add-cromite-flags-support.patch similarity index 55% rename from build/bromite_patches/00Add-cromite-flags-support.patch rename to build/cromite_patches/Add-cromite-flags-support.patch index d79d24667e40667e1db0ee979b660c43c4c36fb8..57c21dd5e3e0e6a6f88316c58fc93b80d4f4ef79 100644 --- a/build/bromite_patches/00Add-cromite-flags-support.patch +++ b/build/cromite_patches/Add-cromite-flags-support.patch @@ -15,28 +15,44 @@ Need: bromite-build-utils.patch License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- base/BUILD.gn | 4 +- - base/feature_list.cc | 56 +++++++ - base/feature_list.h | 84 +++++++++- + base/android/feature_map.cc | 8 +- + base/feature_list.cc | 80 ++++++++++ + base/feature_list.h | 72 ++++++++- build/android/gyp/java_cpp_features.py | 17 ++ chrome/android/java/res/values/values.xml | 3 + .../java/res/xml/privacy_preferences.xml | 4 + - chrome/browser/about_flags.cc | 7 + + .../privacy/settings/PrivacySettings.java | 2 +- + .../browser/settings/SettingsActivity.java | 36 +++++ + chrome/browser/about_flags.cc | 11 ++ chrome/browser/browser_features.cc | 1 + + chrome/browser/flags/BUILD.gn | 12 ++ .../flags/android/chrome_feature_list.cc | 1 + .../flags/android/chrome_feature_list.h | 1 + + .../chrome/browser/flags/CachedFlag.java | 6 + + .../browser/flags/ChromeFeatureList.java | 13 +- + .../flags/cromite/include_all_directory.java | 1 + + .../java_template/CromiteCachedFlag.java.tmpl | 47 ++++++ + chrome/browser/settings/BUILD.gn | 1 + + .../settings/ChromeBaseSettingsFragment.java | 47 ++++++ + .../strings/android_chrome_strings.grd | 1 + + .../placeholder.txt | 1 + chrome/browser/ui/ui_features.cc | 1 + chrome/common/chrome_features.cc | 1 + + .../android/java/res/values/attrs.xml | 4 + + .../settings/ChromeSwitchPreference.java | 20 +++ + components/components_strings.grd | 1 + .../content_settings/core/common/features.cc | 1 + - components/flags_ui/flags_state.cc | 21 +++ + .../placeholder.txt | 1 + + components/flags_ui/flags_state.cc | 56 ++++++- + components/flags_ui/resources/app.html | 42 ++++- + components/flags_ui/resources/app.ts | 41 ++++- components/flags_ui/resources/experiment.html | 7 +- components/flags_ui/resources/experiment.ts | 16 ++ - components/flags_ui/resources/flags.css | 19 +++ - components/flags_ui/resources/flags.html | 13 ++ - components/flags_ui/resources/flags.ts | 36 ++++- .../flags_ui/resources/flags_browser_proxy.ts | 5 + .../core/offline_page_feature.cc | 1 + .../offline_pages/core/offline_page_feature.h | 1 + components/permissions/features.cc | 1 + + .../version_ui/version_handler_helper.cc | 2 +- content/common/features.cc | 1 + content/public/common/content_features.cc | 1 + content/public/common/content_features.h | 1 + @@ -71,7 +87,11 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html services/network/public/cpp/features.h | 1 + third_party/blink/common/features.cc | 1 + third_party/blink/public/common/features.h | 1 + - 57 files changed, 474 insertions(+), 12 deletions(-) + 73 files changed, 737 insertions(+), 18 deletions(-) + create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java + create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl + create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt + create mode 100644 components/cromite_components_strings_grd/placeholder.txt create mode 100755 cromite_flags/BUILD.gn create mode 100755 cromite_flags/chrome/browser/about_flags_cc/placeholder.txt create mode 100755 cromite_flags/chrome/browser/browser_features_cc/placeholder.txt @@ -108,7 +128,7 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn sources = [ "allocator/allocator_check.cc", "allocator/allocator_check.h", -@@ -1034,7 +1036,7 @@ component("base") { +@@ -1030,7 +1032,7 @@ component("base") { "//build/config/compiler:wglobal_constructors", ] @@ -117,10 +137,30 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn ":message_pump_buildflags", "//base/allocator:buildflags", "//base/allocator/partition_allocator:raw_ptr", +diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc +--- a/base/android/feature_map.cc ++++ b/base/android/feature_map.cc +@@ -45,9 +45,15 @@ static jboolean JNI_FeatureMap_IsEnabled( + JNIEnv* env, + jlong jfeature_map, + const android::JavaParamRef& jfeature_name) { ++ std::string feature_name = ConvertJavaStringToUTF8(env, jfeature_name); ++ if (base::FeatureList::IsCromiteFlag(feature_name)) { ++ const base::Feature* cromite_feature = ++ base::FeatureList::GetCromiteFlag(feature_name); ++ return base::FeatureList::IsEnabled(*cromite_feature); ++ } + FeatureMap* feature_map = reinterpret_cast(jfeature_map); + const base::Feature* feature = feature_map->FindFeatureExposedToJava( +- StringPiece(ConvertJavaStringToUTF8(env, jfeature_name))); ++ StringPiece(feature_name)); + return base::FeatureList::IsEnabled(*feature); + } + diff --git a/base/feature_list.cc b/base/feature_list.cc --- a/base/feature_list.cc +++ b/base/feature_list.cc -@@ -29,6 +29,33 @@ +@@ -30,6 +30,33 @@ #include "base/strings/stringprintf.h" #include "build/build_config.h" @@ -154,10 +194,11 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc namespace base { namespace { -@@ -436,6 +463,24 @@ bool FeatureList::IsEnabled(const Feature& feature) { +@@ -441,6 +468,48 @@ bool FeatureList::IsEnabled(const Feature& feature) { return g_feature_list_instance->IsFeatureEnabled(feature); } ++// static +bool FeatureList::IsCromiteChanged(const Feature& feature) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature.name) { @@ -167,6 +208,28 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc + return false; +} + ++// static ++const base::Feature* FeatureList::GetCromiteFlag(const std::string& feature_name) { ++ for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { ++ if (key->name == feature_name && key->is_cromite) { ++ return key; ++ } ++ } ++ NOTREACHED(); ++ return nullptr; ++} ++ ++// static ++bool FeatureList::IsCromiteFlag(const std::string& feature_name) { ++ for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { ++ if (key->name == feature_name && key->is_cromite) { ++ return true; ++ } ++ } ++ return false; ++} ++ ++// static +bool FeatureList::GetCromiteChange(const Feature& feature) { + for(auto const& [key, value]: internal::GetListOfNewFeatureState()) { + if (key->name == feature.name) { @@ -176,10 +239,11 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc + NOTREACHED(); + return false; +} ++ // static bool FeatureList::IsValidFeatureOrFieldTrialName(StringPiece name) { return IsStringASCII(name) && name.find_first_of(",<*") == std::string::npos; -@@ -616,6 +661,17 @@ void FeatureList::SetCachingContextForTesting(uint16_t caching_context) { +@@ -662,6 +731,17 @@ void FeatureList::AddEarlyAllowedFeatureForTesting(std::string feature_name) { void FeatureList::FinalizeInitialization() { DCHECK(!initialized_); @@ -200,7 +264,7 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc diff --git a/base/feature_list.h b/base/feature_list.h --- a/base/feature_list.h +++ b/base/feature_list.h -@@ -93,8 +93,10 @@ enum FeatureState { +@@ -94,8 +94,10 @@ enum FeatureState { // [1]: // https://crsrc.org/c/docs/speed/binary_size/android_binary_size_trybot.md#Mutable-Constants struct BASE_EXPORT LOGICALLY_CONST Feature { @@ -213,7 +277,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h #if BUILDFLAG(ENABLE_BANNED_BASE_FEATURE_PREFIX) if (StringPiece(name).find(BUILDFLAG(BANNED_BASE_FEATURE_PREFIX)) == 0) { LOG(FATAL) << "Invalid feature name " << name << " starts with " -@@ -120,6 +122,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { +@@ -121,6 +123,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { // command line switch. const FeatureState default_state; @@ -223,17 +287,19 @@ diff --git a/base/feature_list.h b/base/feature_list.h private: friend class FeatureList; -@@ -395,6 +400,9 @@ class BASE_EXPORT FeatureList { +@@ -396,6 +401,11 @@ class BASE_EXPORT FeatureList { // instance, which is checked in builds with DCHECKs enabled. static bool IsEnabled(const Feature& feature); ++ static bool IsCromiteFlag(const std::string& featureName); ++ static const base::Feature* GetCromiteFlag(const std::string& featureName); + static bool IsCromiteChanged(const Feature& feature); + static bool GetCromiteChange(const Feature& feature); + // Some characters are not allowed to appear in feature names or the // associated field trial names, as they are used as special characters for // command-line serialization. This function checks that the strings are ASCII -@@ -616,4 +624,76 @@ class BASE_EXPORT FeatureList { +@@ -652,4 +662,62 @@ class BASE_EXPORT FeatureList { } // namespace base @@ -255,27 +321,13 @@ diff --git a/base/feature_list.h b/base/feature_list.h +} // namespace base + +#define CROMITE_FEATURE(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, default_state, true, true) -+ -+#define CROMITE_FEATURE_KEEP_DISABLED(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, base::FEATURE_DISABLED_BY_DEFAULT, true); \ -+ static_assert(default_state == base::FEATURE_DISABLED_BY_DEFAULT, \ -+ "Feature is not disabled by default.") -+ -+#define CROMITE_FEATURE_DISABLED(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, base::FEATURE_DISABLED_BY_DEFAULT, true); \ -+ static_assert(default_state == base::FEATURE_ENABLED_BY_DEFAULT, \ -+ "Feature is not enabled by default.") -+ -+#define CROMITE_FEATURE_KEEP_ENABLED(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, base::FEATURE_ENABLED_BY_DEFAULT, true); \ -+ static_assert(default_state == base::FEATURE_ENABLED_BY_DEFAULT, \ -+ "Feature is not enabled by default.") -+ -+#define CROMITE_FEATURE_ENABLED(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, base::FEATURE_ENABLED_BY_DEFAULT, true); \ -+ static_assert(default_state == base::FEATURE_DISABLED_BY_DEFAULT, \ -+ "Feature is not disabled by default.") ++ CONSTINIT const base::Feature feature(name, default_state, true, true); \ ++ _Pragma("clang diagnostic push") \ ++ _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ ++ static const ::base::internal::FeatureDefaultStateOverrider \ ++ g_feature_default_state_overrider_ ##feature {feature, default_state}; \ ++ _Pragma("clang diagnostic pop") \ ++ static_assert(true, "") /* for a semicolon requirement */ + +#define SET_CROMITE_FEATURE_ENABLED(feature) \ + _Pragma("clang diagnostic push") \ @@ -344,20 +396,20 @@ diff --git a/build/android/gyp/java_cpp_features.py b/build/android/gyp/java_cpp 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 -@@ -42,6 +42,9 @@ found in the LICENSE file. - - 0.95 +@@ -9,6 +9,9 @@ found in the LICENSE file. + xmlns:tools="http://schemas.android.com/tools" + tools:ignore="MissingTranslation"> + Open Cromite flags list + chrome://flags/cromite + - - 0.5 - 0 + + + + +diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt +@@ -0,0 +1 @@ ++this file is intentionally empty diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc -@@ -394,4 +394,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, +@@ -429,4 +429,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, "StopLoadingAnimationForHiddenWindow", base::FEATURE_ENABLED_BY_DEFAULT); @@ -434,26 +815,125 @@ diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc 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 -@@ -1664,4 +1664,5 @@ BASE_FEATURE(kSupportsRtcWakeOver24Hours, +@@ -1751,4 +1751,5 @@ BASE_FEATURE(kSupportsRtcWakeOver24Hours, base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS_ASH) +#include "cromite_flags/chrome_common_chrome_features_cc.inc" } // namespace features +diff --git a/components/browser_ui/settings/android/java/res/values/attrs.xml b/components/browser_ui/settings/android/java/res/values/attrs.xml +--- a/components/browser_ui/settings/android/java/res/values/attrs.xml ++++ b/components/browser_ui/settings/android/java/res/values/attrs.xml +@@ -12,6 +12,10 @@ found in the LICENSE file. + + + ++ ++ ++ ++ + + + +diff --git a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java +--- a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java ++++ b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java +@@ -12,6 +12,9 @@ import android.view.accessibility.AccessibilityEvent; + import android.view.accessibility.AccessibilityNodeInfo; + import android.widget.TextView; + ++import androidx.annotation.Nullable; ++import android.content.res.TypedArray; ++ + import androidx.annotation.ColorRes; + import androidx.appcompat.content.res.AppCompatResources; + import androidx.preference.PreferenceViewHolder; +@@ -30,6 +33,11 @@ public class ChromeSwitchPreference extends SwitchPreferenceCompat { + /** Indicates if the preference uses a custom layout. */ + private final boolean mHasCustomLayout; + ++ @Nullable ++ private String mFeatureName; ++ ++ private final boolean mNeedRestart; ++ + // TOOD(crbug.com/1451550): This is an interim solution. In the long-term, we should migrate + // away from a switch with dynamically changing summaries onto a radio group. + /** +@@ -46,6 +54,18 @@ public class ChromeSwitchPreference extends SwitchPreferenceCompat { + super(context, attrs); + + mHasCustomLayout = ManagedPreferencesUtils.isCustomLayoutApplied(context, attrs); ++ TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ChromeBasePreference); ++ mFeatureName = a.getString(R.styleable.ChromeBasePreference_featureName); ++ mNeedRestart = a.getBoolean(R.styleable.ChromeBasePreference_needRestart, false); ++ a.recycle(); ++ } ++ ++ public String getFeatureName() { ++ return mFeatureName; ++ } ++ ++ public boolean needRestart() { ++ return mNeedRestart; + } + + /** Sets the ManagedPreferenceDelegate which will determine whether this preference is managed. */ +diff --git a/components/components_strings.grd b/components/components_strings.grd +--- a/components/components_strings.grd ++++ b/components/components_strings.grd +@@ -339,6 +339,7 @@ + + + ++ + + + diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc --- a/components/content_settings/core/common/features.cc +++ b/components/content_settings/core/common/features.cc -@@ -82,5 +82,6 @@ BASE_FEATURE(kTrackingProtection3pcd, - "TrackingProtection3pcd", - base::FEATURE_DISABLED_BY_DEFAULT); +@@ -100,5 +100,6 @@ BASE_FEATURE(kHostIndexedMetadataGrants, + const base::FeatureParam kMetadataGrantsThreshold{ + &kHostIndexedMetadataGrants, kMetadataGrantsThresholdName, 1}; +#include "cromite_flags/components_content_settings_core_common_features_cc.inc" } // namespace features } // namespace content_settings +diff --git a/components/cromite_components_strings_grd/placeholder.txt b/components/cromite_components_strings_grd/placeholder.txt +new file mode 100644 +--- /dev/null ++++ b/components/cromite_components_strings_grd/placeholder.txt +@@ -0,0 +1 @@ ++this file is intentionally empty diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_state.cc --- a/components/flags_ui/flags_state.cc +++ b/components/flags_ui/flags_state.cc -@@ -668,6 +668,27 @@ void FlagsState::GetFlagFeatureEntries( +@@ -359,7 +359,22 @@ void FlagsState::GetSwitchesAndFeaturesFromFlags( + + for (const std::string& entry_name : enabled_entries) { + const auto& entry_it = name_to_switch_map.find(entry_name); +- DCHECK(entry_it != name_to_switch_map.end()); ++ if (entry_it == name_to_switch_map.end()) { ++ // check if is a cromite feature ++ std::string::size_type pos = entry_name.find('@'); ++ if (pos != std::string::npos) { ++ std::string feature_name = entry_name.substr(0, pos); ++ if (base::FeatureList::IsCromiteFlag(feature_name)) { ++ if (entry_name.ends_with("@1")) ++ features->insert(entry_name + ":enabled"); ++ else ++ features->insert(entry_name + ":disabled"); ++ continue; ++ } ++ } ++ NOTREACHED(); ++ continue; ++ } + + const SwitchEntry& entry = entry_it->second; + if (!entry.switch_name.empty()) +@@ -668,6 +683,27 @@ void FlagsState::GetFlagFeatureEntries( bool is_default_value = IsDefaultValue(entry, enabled_entries); data.Set("is_default", is_default_value); @@ -481,6 +961,218 @@ diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_stat switch (entry.type) { case FeatureEntry::SINGLE_VALUE: case FeatureEntry::SINGLE_DISABLE_VALUE: +@@ -796,6 +832,16 @@ void FlagsState::AddSwitchesToCommandLine( + for (const std::string& entry_name : enabled_entries) { + const auto& entry_it = name_to_switch_map.find(entry_name); + if (entry_it == name_to_switch_map.end()) { ++ // check if is a cromite feature ++ std::string::size_type pos = entry_name.find('@'); ++ if (pos != std::string::npos) { ++ std::string feature_name = entry_name.substr(0, pos); ++ if (base::FeatureList::IsCromiteFlag(feature_name)) { ++ feature_switches[feature_name] = ++ entry_name.ends_with("@1"); ++ continue; ++ } ++ } + NOTREACHED(); + continue; + } +@@ -1048,6 +1094,14 @@ const FeatureEntry* FlagsState::FindFeatureEntryByName( + bool FlagsState::IsSupportedFeature(const FlagsStorage* storage, + const std::string& name, + int platform_mask) const { ++ // check if is a cromite feature ++ std::string::size_type pos = name.find('@'); ++ if (pos != std::string::npos) { ++ std::string feature_name = name.substr(0, pos); ++ if (base::FeatureList::IsCromiteFlag(feature_name)) { ++ return true; ++ } ++ } + for (const auto& entry : feature_entries_) { + DCHECK(entry.IsValid()); + if (!(entry.supported_platforms & platform_mask)) +diff --git a/components/flags_ui/resources/app.html b/components/flags_ui/resources/app.html +--- a/components/flags_ui/resources/app.html ++++ b/components/flags_ui/resources/app.html +@@ -473,7 +473,32 @@ + padding-top: 1.5rem; + } + } ++ #appcontainer { ++ overflow-y: scroll; ++ } ++ .cromite #header { ++ display: none; ++ } ++ .cromite .blurb-container { ++ display: none; ++ } ++ .cromite #tabs { ++ display: none; ++ } ++ .cromite #tab-content-available { ++ display: none; ++ } ++ .cromite #tab-content-unavailable { ++ display: none; ++ } ++ .cromite #tab-content-cromite { ++ display: block !important; ++ } ++ .cromite .section-header-title { ++ display: none; ++ } + ++
+ +\ No newline at end of file ++
++ ++ +diff --git a/components/flags_ui/resources/app.ts b/components/flags_ui/resources/app.ts +--- a/components/flags_ui/resources/app.ts ++++ b/components/flags_ui/resources/app.ts +@@ -193,6 +193,7 @@ export class FlagsAppElement extends CustomElement { + return getTemplate(); + } + ++ private onlyCromiteFlags: boolean = false; + private announceStatusDelayMs: number = 100; + private featuresResolver: PromiseResolver = new PromiseResolver(); + private flagSearch: FlagSearch = new FlagSearch(this); +@@ -204,6 +205,10 @@ export class FlagsAppElement extends CustomElement { + //
+ + tabs: Tab[] = [ ++ { ++ tabEl: this.getRequiredElement('#tab-cromite')!, ++ panelEl: this.getRequiredElement('#tab-content-cromite')!, ++ }, + { + tabEl: this.getRequiredElement('#tab-available'), + panelEl: this.getRequiredElement('#tab-content-available'), +@@ -217,6 +222,11 @@ export class FlagsAppElement extends CustomElement { + ]; + + connectedCallback() { ++ if (location.pathname == '/cromite') { ++ this.onlyCromiteFlags = true; ++ this.getRequiredElement("#appcontainer").classList.add('cromite'); ++ document.title = "Cromite Flags List"; ++ } + // Get and display the data upon loading. + this.requestExperimentalFeaturesData(); + // There is no restart button on iOS. +@@ -277,20 +287,29 @@ export class FlagsAppElement extends CustomElement { + const defaultFeatures: Feature[] = []; + const nonDefaultFeatures: Feature[] = []; + ++ if (this.onlyCromiteFlags) { ++ experimentalFeaturesData.supportedFeatures = ++ experimentalFeaturesData.supportedFeatures.filter(item => item.is_new); ++ } ++ experimentalFeaturesData.supportedFeatures.sort( ++ (a,b) => (a.internal_name.localeCompare(b.internal_name))); + experimentalFeaturesData.supportedFeatures.forEach( + f => (f.is_default ? defaultFeatures : nonDefaultFeatures).push(f)); + + this.renderExperiments( + nonDefaultFeatures, +- this.getRequiredElement('#non-default-experiments')); ++ this.getRequiredElement('#non-default-experiments'), ++ this.getRequiredElement('#non-default-cromite-experiments'), false); + + this.renderExperiments( +- defaultFeatures, this.getRequiredElement('#default-experiments')); ++ defaultFeatures, this.getRequiredElement('#default-experiments'), ++ this.getRequiredElement('#cromite-experiments'), false); + + // + this.renderExperiments( + experimentalFeaturesData.unsupportedFeatures, +- this.getRequiredElement('#unavailable-experiments'), true); ++ this.getRequiredElement('#unavailable-experiments'), ++ undefined, true); + // + + this.showRestartToast(experimentalFeaturesData.needsRestart); +@@ -401,16 +420,23 @@ export class FlagsAppElement extends CustomElement { + } + + private renderExperiments( +- features: Feature[], container: HTMLElement, unsupported = false) { ++ features: Feature[], container: HTMLElement, ++ cromiteContainer: HTMLElement | undefined, unsupported: boolean = false) { + const fragment = document.createDocumentFragment(); ++ const fragmentCromite = document.createDocumentFragment(); ++ const show_permalink = !document.body.classList.contains('cromite'); + for (const feature of features) { + const experiment = document.createElement('flags-experiment'); + + experiment.toggleAttribute('unsupported', unsupported); ++ experiment.permalink = show_permalink; + experiment.data = feature; + experiment.id = feature.internal_name; + + const select = experiment.getSelect(); ++ // if (select && feature.is_cromite && !feature.is_new) { ++ // select.disabled = true; ++ // } + if (select) { + experiment.addEventListener('select-change', e => { + e.preventDefault(); +@@ -434,9 +460,14 @@ export class FlagsAppElement extends CustomElement { + this.showRestartToast(true); + }); + } +- fragment.appendChild(experiment); ++ if (feature.is_cromite) ++ fragmentCromite.appendChild(experiment); ++ else ++ fragment.appendChild(experiment); + } + container.replaceChildren(fragment); ++ if (!!cromiteContainer) ++ cromiteContainer.replaceChildren(fragmentCromite); + } + + /** diff --git a/components/flags_ui/resources/experiment.html b/components/flags_ui/resources/experiment.html --- a/components/flags_ui/resources/experiment.html +++ b/components/flags_ui/resources/experiment.html @@ -570,156 +1262,6 @@ diff --git a/components/flags_ui/resources/experiment.ts b/components/flags_ui/r experimentSelect.appendChild(optionEl); } -diff --git a/components/flags_ui/resources/flags.css b/components/flags_ui/resources/flags.css ---- a/components/flags_ui/resources/flags.css -+++ b/components/flags_ui/resources/flags.css -@@ -468,3 +468,22 @@ button.primary:-webkit-any(:active, :hover) { - padding-top: 1.5rem; - } - } -+ -+.cromite #header { -+ display: none; -+} -+.cromite .blurb-container { -+ display: none; -+} -+.cromite #tabs { -+ display: none; -+} -+.cromite #tab-content-available { -+ display: none; -+} -+.cromite #tab-content-unavailable { -+ display: none; -+} -+.cromite #tab-content-cromite { -+ display: block !important; -+} -diff --git a/components/flags_ui/resources/flags.html b/components/flags_ui/resources/flags.html ---- a/components/flags_ui/resources/flags.html -+++ b/components/flags_ui/resources/flags.html -@@ -92,6 +92,11 @@ - aria-selected="false" aria-controls="panel2" - tabindex="-1">$i18n{unavailable} - -+ Cromite - -
-
-
- -+
-+ -+
-+ -+
-+ -+
-
-
-
-diff --git a/components/flags_ui/resources/flags.ts b/components/flags_ui/resources/flags.ts ---- a/components/flags_ui/resources/flags.ts -+++ b/components/flags_ui/resources/flags.ts -@@ -39,6 +39,10 @@ interface Tab { - } - - const tabs: Tab[] = [ -+ { -+ tabEl: document.body.querySelector('#tab-cromite')!, -+ panelEl: document.body.querySelector('#tab-content-cromite')!, -+ }, - { - tabEl: document.body.querySelector('#tab-available')!, - panelEl: document.body.querySelector('#tab-content-available')!, -@@ -84,18 +88,27 @@ function render(experimentalFeaturesData: ExperimentalFeaturesData) { - const defaultFeatures: Feature[] = []; - const nonDefaultFeatures: Feature[] = []; - -+ if (document.body.classList.contains("cromite")) { -+ experimentalFeaturesData.supportedFeatures = -+ experimentalFeaturesData.supportedFeatures.filter(item => item.is_new); -+ } -+ experimentalFeaturesData.supportedFeatures.sort( -+ (a,b) => (a.internal_name.localeCompare(b.internal_name))); - experimentalFeaturesData.supportedFeatures.forEach( - f => (f.is_default ? defaultFeatures : nonDefaultFeatures).push(f)); - - renderExperiments( -- nonDefaultFeatures, getRequiredElement('non-default-experiments')); -+ nonDefaultFeatures, getRequiredElement('non-default-experiments'), -+ getRequiredElement('non-default-cromite-experiments'), false); - -- renderExperiments(defaultFeatures, getRequiredElement('default-experiments')); -+ renderExperiments(defaultFeatures, getRequiredElement('default-experiments'), -+ getRequiredElement('cromite-experiments'), false); - - // - renderExperiments( - experimentalFeaturesData.unsupportedFeatures, -- getRequiredElement('unavailable-experiments'), true); -+ getRequiredElement('unavailable-experiments'), -+ undefined, true); - // - - showRestartToast(experimentalFeaturesData.needsRestart); -@@ -248,16 +261,22 @@ function resetAllFlags() { - } - - function renderExperiments( -- features: Feature[], container: HTMLElement, unsupported = false) { -+ features: Feature[], container: HTMLElement, cromiteContainer: HTMLElement | undefined, unsupported: boolean) { - const fragment = document.createDocumentFragment(); -+ const fragmentCromite = document.createDocumentFragment(); -+ const show_permalink = !document.body.classList.contains('cromite'); - for (const feature of features) { - const experiment = document.createElement('flags-experiment'); - - experiment.toggleAttribute('unsupported', unsupported); -+ experiment.permalink = show_permalink; - experiment.data = feature; - experiment.id = feature.internal_name; - - const select = experiment.getSelect(); -+ // if (select && feature.is_cromite && !feature.is_new) { -+ // select.disabled = true; -+ // } - if (select) { - experiment.addEventListener('select-change', () => { - showRestartToast(true); -@@ -281,9 +300,14 @@ function renderExperiments( - return false; - }); - } -- fragment.appendChild(experiment); -+ if (feature.is_cromite) -+ fragmentCromite.appendChild(experiment); -+ else -+ fragment.appendChild(experiment); - } - container.replaceChildren(fragment); -+ if (!!cromiteContainer) -+ cromiteContainer.replaceChildren(fragmentCromite); - } - - /** -@@ -507,6 +531,8 @@ function setupRestartButton() { - // - - document.addEventListener('DOMContentLoaded', function() { -+ if (location.pathname == '/cromite') -+ document.body.classList.add('cromite'); - // Get and display the data upon loading. - requestExperimentalFeaturesData(); - // There is no restart button on iOS. diff --git a/components/flags_ui/resources/flags_browser_proxy.ts b/components/flags_ui/resources/flags_browser_proxy.ts --- a/components/flags_ui/resources/flags_browser_proxy.ts +++ b/components/flags_ui/resources/flags_browser_proxy.ts @@ -758,18 +1300,30 @@ diff --git a/components/offline_pages/core/offline_page_feature.h b/components/o diff --git a/components/permissions/features.cc b/components/permissions/features.cc --- a/components/permissions/features.cc +++ b/components/permissions/features.cc -@@ -171,6 +171,7 @@ BASE_FEATURE(kBlockMidiByDefault, - "BlockMidiByDefault", - base::FEATURE_ENABLED_BY_DEFAULT); +@@ -135,6 +135,7 @@ BASE_FEATURE(kShowRelatedWebsiteSetsPermissionGrants, + "ShowRelatedWebsiteSetsPermissionGrants", + base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/components_permissions_features_cc.inc" } // namespace features namespace feature_params { +diff --git a/components/version_ui/version_handler_helper.cc b/components/version_ui/version_handler_helper.cc +--- a/components/version_ui/version_handler_helper.cc ++++ b/components/version_ui/version_handler_helper.cc +@@ -37,7 +37,7 @@ base::Value::List GetVariationsList() { + // displayed locally (and is useful for diagnostics purposes). + base::FieldTrialListIncludingLowAnonymity::GetActiveFieldTrialGroups( + &active_groups); +-#if !defined(NDEBUG) ++#if true + const unsigned char kNonBreakingHyphenUTF8[] = {0xE2, 0x80, 0x91, '\0'}; + const std::string kNonBreakingHyphenUTF8String( + reinterpret_cast(kNonBreakingHyphenUTF8)); diff --git a/content/common/features.cc b/content/common/features.cc --- a/content/common/features.cc +++ b/content/common/features.cc -@@ -529,4 +529,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, +@@ -586,4 +586,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, // Please keep features in alphabetical order. @@ -778,7 +1332,7 @@ diff --git a/content/common/features.cc b/content/common/features.cc 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 -@@ -1321,4 +1321,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { +@@ -1388,4 +1388,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { VideoCaptureServiceConfiguration::kEnabledForBrowserProcess; } @@ -787,7 +1341,7 @@ diff --git a/content/public/common/content_features.cc b/content/public/common/c 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 -@@ -327,6 +327,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); +@@ -338,6 +338,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForOutOfProcess(); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForBrowserProcess(); @@ -1085,7 +1639,7 @@ new file mode 100755 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 -@@ -1743,5 +1743,5 @@ uint32_t GetPassthroughAudioFormats() { +@@ -1763,5 +1763,5 @@ uint32_t GetPassthroughAudioFormats() { return 0; #endif // BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) } @@ -1095,7 +1649,7 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc 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 -@@ -505,5 +505,5 @@ MEDIA_EXPORT bool IsOutOfProcessVideoDecodingEnabled(); +@@ -519,5 +519,5 @@ MEDIA_EXPORT bool IsOutOfProcessVideoDecodingEnabled(); MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); } // namespace media @@ -1105,18 +1659,18 @@ diff --git a/media/base/media_switches.h b/media/base/media_switches.h diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc -@@ -469,4 +469,5 @@ BASE_FEATURE(kSpdyHeadersToHttpResponseVerifyCorrectness, - "SpdyHeadersToHttpResponseVerifyCorrectness", - base::FEATURE_DISABLED_BY_DEFAULT); +@@ -492,4 +492,5 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired, + "TreatHTTPExpiresHeaderValueZeroAsExpired", + base::FEATURE_ENABLED_BY_DEFAULT); +#include "cromite_flags/net_base_features_cc.inc" } // namespace net::features diff --git a/net/base/features.h b/net/base/features.h --- a/net/base/features.h +++ b/net/base/features.h -@@ -467,6 +467,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kSpdyHeadersToHttpResponseUseBuilder); - // for two weeks on Dev. - NET_EXPORT BASE_DECLARE_FEATURE(kSpdyHeadersToHttpResponseVerifyCorrectness); +@@ -487,6 +487,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kUseAlpsNewCodepoint); + // while on stable channels. + NET_EXPORT BASE_DECLARE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired); +#include "cromite_flags/net_base_features_h.inc" } // namespace net::features @@ -1125,18 +1679,18 @@ diff --git a/net/base/features.h b/net/base/features.h 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 -@@ -422,4 +422,5 @@ BASE_FEATURE(kVisibilityAwareResourceScheduler, - - BASE_FEATURE(kSharedZstd, "SharedZstd", base::FEATURE_ENABLED_BY_DEFAULT); +@@ -454,4 +454,5 @@ const base::FeatureParam kSkipTpcdMitigationsForAdsSupport{ + &kSkipTpcdMitigationsForAds, /*name=*/"SkipTpcdMitigationsForAdsSupport", + /*default_value=*/false}; +#include "cromite_flags/services_network_public_cpp_features_cc.inc" } // namespace network::features 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 -@@ -158,6 +158,7 @@ BASE_DECLARE_FEATURE(kVisibilityAwareResourceScheduler); +@@ -181,6 +181,7 @@ extern const base::FeatureParam kSkipTpcdMitigationsForAdsMetadata; COMPONENT_EXPORT(NETWORK_CPP) - BASE_DECLARE_FEATURE(kSharedZstd); + extern const base::FeatureParam kSkipTpcdMitigationsForAdsSupport; +#include "cromite_flags/services_network_public_cpp_features_h.inc" } // namespace features @@ -1145,9 +1699,9 @@ diff --git a/services/network/public/cpp/features.h b/services/network/public/cp 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 -@@ -2168,5 +2168,6 @@ bool IsKeepAliveURLLoaderServiceEnabled() { - base::FeatureList::IsEnabled(kFetchLaterAPI); - } +@@ -2305,5 +2305,6 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpiredInBlink, + "TreatHTTPExpiresHeaderValueZeroAsExpiredInBlink", + base::FEATURE_ENABLED_BY_DEFAULT); +#include "cromite_flags/third_party_blink_common_features_cc.inc" } // namespace features @@ -1155,13 +1709,12 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h -@@ -1388,6 +1388,7 @@ BLINK_COMMON_EXPORT bool IsKeepAliveURLLoaderServiceEnabled(); +@@ -1507,6 +1507,7 @@ BLINK_COMMON_EXPORT extern const base::FeatureParam kPixelDistanceToExpand; BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( - kRemoveAuthroizationOnCrossOriginRedirect); + kTreatHTTPExpiresHeaderValueZeroAsExpiredInBlink); +#include "cromite_flags/third_party_blink_common_features_h.inc" } // namespace features } // namespace blink -- -2.25.1 diff --git a/build/bromite_patches/Add-custom-tab-intents-privacy-option.patch b/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch similarity index 91% rename from build/bromite_patches/Add-custom-tab-intents-privacy-option.patch rename to build/cromite_patches/Add-custom-tab-intents-privacy-option.patch index 10a81604ad3c882f340d69a38c217c566d4dd55a..cc948b9e6ecf2e0597caed2af5d8aa4368fd06cf 100644 --- a/build/bromite_patches/Add-custom-tab-intents-privacy-option.patch +++ b/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch @@ -25,10 +25,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -74,6 +74,16 @@ found in the LICENSE file. - android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" +@@ -43,6 +43,16 @@ found in the LICENSE file. android:key="do_not_track" - android:title="@string/do_not_track_title"/> + android:title="@string/do_not_track_title" + android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" /> + ", "", servicesLink)); } @@ -140,7 +140,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); -@@ -263,6 +269,14 @@ public class PrivacySettings +@@ -292,6 +298,14 @@ public class PrivacySettings extends ChromeBaseSettingsFragment } else if (PREF_SEARCH_SUGGESTIONS.equals(key)) { UserPrefs.get(getProfile()) .setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue); @@ -155,7 +155,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting } return true; } -@@ -287,6 +301,16 @@ public class PrivacySettings +@@ -314,6 +328,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment UserPrefs.get(getProfile()).getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED)); } @@ -175,7 +175,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java --- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java +++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java -@@ -84,7 +84,11 @@ public final class TabAssociatedApp extends TabWebContentsUserData implements Im +@@ -85,7 +85,11 @@ public final class TabAssociatedApp extends TabWebContentsUserData implements Im public static boolean isOpenedFromExternalApp(Tab tab) { TabAssociatedApp app = get(tab); if (app == null) return false; @@ -191,7 +191,7 @@ diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAsso 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 -@@ -5238,6 +5238,20 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Resume @@ -229,4 +229,3 @@ new file mode 100644 +SET_CROMITE_FEATURE_DISABLED(kCCTIntentFeatureOverrides); +SET_CROMITE_FEATURE_DISABLED(kCCTPostMessageAPI); -- -2.25.1 diff --git a/build/bromite_patches/Add-exit-menu-item.patch b/build/cromite_patches/Add-exit-menu-item.patch similarity index 90% rename from build/bromite_patches/Add-exit-menu-item.patch rename to build/cromite_patches/Add-exit-menu-item.patch index a4861472cea24f10ff0f0d1356a08d0328b6616c..aa7a6acd180674ed1cfd947aeb6031a1b9f8e617 100644 --- a/build/bromite_patches/Add-exit-menu-item.patch +++ b/build/cromite_patches/Add-exit-menu-item.patch @@ -40,15 +40,15 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java -@@ -6,6 +6,7 @@ package org.chromium.chrome.browser; +@@ -7,6 +7,7 @@ package org.chromium.chrome.browser; + import org.jni_zero.CalledByNative; import org.chromium.base.ObserverList; - import org.chromium.base.annotations.CalledByNative; +import org.chromium.chrome.browser.incognito.IncognitoNotificationManager; - /** - * Watches for when Chrome is told to restart itself. -@@ -42,6 +43,7 @@ public class ApplicationLifetime { + /** Watches for when Chrome is told to restart itself. */ + public class ApplicationLifetime { +@@ -39,6 +40,7 @@ public class ApplicationLifetime { @CalledByNative public static void terminate(boolean restart) { @@ -59,7 +59,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLife 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 -@@ -236,6 +236,8 @@ import java.util.Locale; +@@ -252,6 +252,8 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; @@ -68,7 +68,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct /** * 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. -@@ -2271,6 +2273,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2577,6 +2578,11 @@ public abstract class ChromeActivity return true; } @@ -103,7 +103,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv 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, +@@ -81,7 +81,11 @@ class ChromeLifetimeController // Kick off a timer to kill the process after a delay, which fires only if the Activities // take too long to be finished. @@ -119,7 +119,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLife 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 -@@ -3859,6 +3859,9 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Dark theme @@ -130,4 +130,3 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Appearance -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch b/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch similarity index 96% rename from build/bromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch rename to build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch index 1355753c9033432c677bab57b7259c023235e50e..30bbe2cd4e64f97d957edf3f453f0b16bea2cf27 100644 --- a/build/bromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch +++ b/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch @@ -18,7 +18,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -18,6 +18,7 @@ +@@ -20,6 +20,7 @@ #include "base/barrier_callback.h" #include "base/check_op.h" #include "base/containers/contains.h" @@ -26,7 +26,7 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/ #include "base/feature_list.h" #include "base/format_macros.h" #include "base/functional/bind.h" -@@ -305,6 +306,15 @@ AutocompleteController::AutocompleteController( +@@ -336,6 +337,15 @@ AutocompleteController::AutocompleteController( provider_client_->GetOmniboxTriggeredFeatureService()), steady_state_omnibox_position_( metrics::OmniboxEventProto::UNKNOWN_POSITION) { @@ -66,7 +66,7 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/ #include "base/functional/callback.h" #include "base/i18n/break_iterator.h" #include "base/i18n/case_conversion.h" -@@ -649,6 +650,9 @@ void SearchProvider::Run(bool query_is_private) { +@@ -636,6 +637,9 @@ void SearchProvider::Run(bool query_is_private) { } void SearchProvider::DoHistoryQuery(bool minimal_changes) { @@ -88,7 +88,7 @@ diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/ur #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/i18n/char_iterator.h" -@@ -608,6 +610,8 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) { +@@ -621,6 +623,8 @@ GURL FixupURLInternal(const std::string& text, FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url); if (chrome_url && !parts.host.is_valid()) @@ -135,4 +135,3 @@ new file mode 100644 + +#endif -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-for-save-data-header.patch b/build/cromite_patches/Add-flag-for-save-data-header.patch similarity index 99% rename from build/bromite_patches/Add-flag-for-save-data-header.patch rename to build/cromite_patches/Add-flag-for-save-data-header.patch index 3bdc1e9fa35373ff6f2617b6fc2aa3803624700f..da2a0f9ce21d2b97f1cffe6e92f4b3d4b9d2303d 100644 --- a/build/bromite_patches/Add-flag-for-save-data-header.patch +++ b/build/cromite_patches/Add-flag-for-save-data-header.patch @@ -71,4 +71,3 @@ new file mode 100644 @@ -0,0 +1 @@ +COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kEnableSaveDataHeader); -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch b/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch similarity index 98% rename from build/bromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch rename to build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch index b054ea13b7462b9e7c366bb502200fe5d70532f4..6c7edc6408cafa216add6bc179c1a7e51877b145 100644 --- a/build/bromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch +++ b/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch @@ -92,7 +92,7 @@ new file mode 100644 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 -@@ -19,6 +19,10 @@ +@@ -21,6 +21,10 @@ #include "net/socket/client_socket_handle.h" #include "net/socket/client_socket_pool.h" #include "net/socket/connect_job.h" @@ -103,7 +103,7 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket #include "net/ssl/ssl_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" -@@ -172,6 +176,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool( +@@ -183,6 +187,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); @@ -124,4 +124,3 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket } -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-to-control-video-playback-resume-feature.patch b/build/cromite_patches/Add-flag-to-control-video-playback-resume-feature.patch similarity index 99% rename from build/bromite_patches/Add-flag-to-control-video-playback-resume-feature.patch rename to build/cromite_patches/Add-flag-to-control-video-playback-resume-feature.patch index 3d295070c9e921bb10e3c152645fa9c7f64ace08..35bf730c33d7b2284b64f35039524b6922de323e 100644 --- a/build/bromite_patches/Add-flag-to-control-video-playback-resume-feature.patch +++ b/build/cromite_patches/Add-flag-to-control-video-playback-resume-feature.patch @@ -37,4 +37,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kResumeBackgroundVideo); -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-to-disable-IPv6-probes.patch b/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch similarity index 93% rename from build/bromite_patches/Add-flag-to-disable-IPv6-probes.patch rename to build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch index e9c227d3c511e74a4dc7f70f28adb38e7be5d878..dd80869e8fd5842ff2a0128c766ef5cf3fc1146f 100644 --- a/build/bromite_patches/Add-flag-to-disable-IPv6-probes.patch +++ b/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch @@ -45,9 +45,9 @@ new file mode 100644 diff --git a/net/BUILD.gn b/net/BUILD.gn --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -1094,6 +1094,7 @@ component("net") { +@@ -1033,6 +1033,7 @@ component("net") { "//build:chromeos_buildflags", - "//net/data/ssl/chrome_root_store:gen_root_store_inc", + "//components/miracle_parameter/common", "//net/http:transport_security_state_generated_files", + "//components/network_session_configurator/common" ] @@ -56,7 +56,7 @@ diff --git a/net/BUILD.gn b/net/BUILD.gn 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 -@@ -110,6 +110,7 @@ +@@ -109,6 +109,7 @@ #include "net/log/net_log_event_type.h" #include "net/log/net_log_source.h" #include "net/log/net_log_source_type.h" @@ -64,7 +64,7 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc #include "net/log/net_log_with_source.h" #include "net/socket/client_socket_factory.h" #include "net/url_request/url_request_context.h" -@@ -685,6 +686,9 @@ class HostResolverManager::RequestImpl +@@ -681,6 +682,9 @@ class HostResolverManager::RequestImpl // request source is LOCAL_ONLY. This is due to LOCAL_ONLY requiring a // synchronous response, so it cannot wait on an async probe result and // cannot make assumptions about reachability. @@ -74,7 +74,7 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc if (parameters_.source == HostResolverSource::LOCAL_ONLY) { int rv = resolver_->StartIPv6ReachabilityCheck( source_net_log_, GetClientSocketFactory(), -@@ -3903,6 +3907,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( +@@ -3899,6 +3903,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( return OK; } @@ -89,4 +89,3 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc ipv6_request_callbacks_.push_back(std::move(callback)); return ERR_IO_PENDING; -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-to-disable-external-intent-requests.patch b/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch similarity index 99% rename from build/bromite_patches/Add-flag-to-disable-external-intent-requests.patch rename to build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch index 8e37f8c7bed7c217685c4b6c89d9ce09a8f4e017..4682e102b7390c403e23e40583216deaaf486c0d 100644 --- a/build/bromite_patches/Add-flag-to-disable-external-intent-requests.patch +++ b/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch @@ -30,4 +30,3 @@ new file mode 100644 + +#endif -- -2.25.1 diff --git a/build/bromite_patches/Add-flag-to-disable-vibration.patch b/build/cromite_patches/Add-flag-to-disable-vibration.patch similarity index 97% rename from build/bromite_patches/Add-flag-to-disable-vibration.patch rename to build/cromite_patches/Add-flag-to-disable-vibration.patch index 42e332d4a43d6edc5ca9366b261f627ce4fab057..91ad5f843ccaf4a7dc64e7270349b33b125938c0 100644 --- a/build/bromite_patches/Add-flag-to-disable-vibration.patch +++ b/build/cromite_patches/Add-flag-to-disable-vibration.patch @@ -59,10 +59,10 @@ new file mode 100644 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 -@@ -70,6 +70,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFeatures : public WebRuntimeFeaturesBase { - static void EnableFingerprintingCanvasMeasureTextNoise(bool); +@@ -71,6 +71,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFeatures : public WebRuntimeFeaturesBase { static void EnableFingerprintingCanvasImageDataNoise(bool); static void EnableFluentScrollbars(bool); + static void EnableFluentOverlayScrollbars(bool); + static void EnableVibration(bool); WebRuntimeFeatures() = delete; @@ -104,7 +104,7 @@ diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.c 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 -@@ -2638,6 +2638,10 @@ +@@ -2621,6 +2621,10 @@ status: {"Android": "stable"}, base_feature: "none", }, @@ -116,4 +116,3 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 name: "OriginIsolationHeader", status: "stable", -- -2.25.1 diff --git a/build/bromite_patches/Add-lifetime-options-for-permissions.patch b/build/cromite_patches/Add-lifetime-options-for-permissions.patch similarity index 80% rename from build/bromite_patches/Add-lifetime-options-for-permissions.patch rename to build/cromite_patches/Add-lifetime-options-for-permissions.patch index 7b006d76ccec1c6cd3b236c583cb1c0db13891f7..99c341f066df0ff5b62a2be1daa71f27a7e807cc 100644 --- a/build/bromite_patches/Add-lifetime-options-for-permissions.patch +++ b/build/cromite_patches/Add-lifetime-options-for-permissions.patch @@ -56,18 +56,15 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../one_time_permissions_tracker.cc | 33 +++++++- .../one_time_permissions_tracker.h | 5 +- .../one_time_permissions_tracker_factory.cc | 2 +- - .../embedded_permission_prompt_ask_view.cc | 2 +- + .../permissions/embedded_permission_prompt.cc | 2 +- .../permission_prompt_bubble_base_view.cc | 2 +- - .../browser/content_autofill_driver.cc | 64 ++++++++------- - .../content/browser/content_autofill_driver.h | 2 +- - .../autofill/core/browser/autofill_driver.h | 2 + .../site_settings/PermissionInfo.java | 14 +++- .../site_settings/SingleWebsiteSettings.java | 10 +++ .../WebsitePreferenceBridge.java | 6 +- .../android/website_preference_bridge.cc | 7 +- .../strings/android/browser_ui_strings.grd | 5 ++ components/content_settings/android/BUILD.gn | 1 + - .../core/browser/content_settings_utils.cc | 36 +++++++++ + .../core/browser/content_settings_utils.cc | 36 ++++++++ .../core/browser/content_settings_utils.h | 6 ++ .../common/content_settings_constraints.h | 11 +++ .../page_info/PageInfoController.java | 4 +- @@ -76,7 +73,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/page_info/page_info.cc | 2 + components/page_info/page_info.h | 1 + .../permissions/PermissionDialogDelegate.java | 13 +++ - .../permissions/PermissionDialogModel.java | 81 ++++++++++++++++++- + .../PermissionDialogModelFactory.java | 82 ++++++++++++++++++- .../permission_dialog_delegate.cc | 19 +++++ .../permission_dialog_delegate.h | 1 + .../permission_prompt_android.cc | 8 ++ @@ -89,9 +86,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/permissions/permission_prompt.h | 3 +- components/permissions/permission_request.cc | 30 ++++++- components/permissions/permission_request.h | 16 +++- - .../permissions/permission_request_manager.cc | 45 +++++++---- + .../permissions/permission_request_manager.cc | 45 ++++++---- .../permissions/permission_request_manager.h | 11 ++- - 39 files changed, 547 insertions(+), 92 deletions(-) + 36 files changed, 511 insertions(+), 61 deletions(-) diff --git a/chrome/browser/permissions/last_tab_standing_tracker.cc b/chrome/browser/permissions/last_tab_standing_tracker.cc --- a/chrome/browser/permissions/last_tab_standing_tracker.cc @@ -230,18 +227,18 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker_factory.cc - return std::make_unique(); + return std::make_unique(context); } -diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc ---- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc -+++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc -@@ -34,7 +34,7 @@ void EmbeddedPermissionPromptAskView::RunButtonCallback(int button_id) { - - if (delegate()) { - if (button == ButtonType::kAllowThisTime) { -- delegate()->AcceptThisTime(); -+ delegate()->AcceptThisTime(content_settings::LifetimeMode::OnlyThisTime); - } else if (button == ButtonType::kAllow) { - delegate()->Accept(); - } +diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc +--- a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc ++++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc +@@ -236,7 +236,7 @@ void EmbeddedPermissionPrompt::Allow() { + } + + void EmbeddedPermissionPrompt::AllowThisTime() { +- delegate_->AcceptThisTime(); ++ delegate_->AcceptThisTime(content_settings::LifetimeMode::OnlyThisTime); + CloseCurrentViewAndMaybeShowNext(/*first_prompt=*/false); + } + diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc --- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc +++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc @@ -254,207 +251,6 @@ diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_v return; case PermissionDialogButton::kDeny: RecordDecision(permissions::PermissionAction::DENIED); -diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc ---- a/components/autofill/content/browser/content_autofill_driver.cc -+++ b/components/autofill/content/browser/content_autofill_driver.cc -@@ -412,8 +412,8 @@ void ContentAutofillDriver::FormsSeen( - const std::vector& removed_forms) { - target->GetAutofillManager().OnFormsSeen( - WithNewVersion(updated_forms), removed_forms); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnFormsSeen( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnFormsSeen( - WithNewVersion(updated_forms), removed_forms); - } - }); -@@ -443,8 +443,8 @@ void ContentAutofillDriver::FormSubmitted( - } - target->GetAutofillManager().OnFormSubmitted( - WithNewVersion(form), known_success, submission_source); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnFormSubmitted( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnFormSubmitted( - WithNewVersion(form), known_success, submission_source); - } - }); -@@ -468,8 +468,8 @@ void ContentAutofillDriver::TextFieldDidChange(const FormData& raw_form, - base::TimeTicks timestamp) { - target->GetAutofillManager().OnTextFieldDidChange( - WithNewVersion(form), field, bounding_box, timestamp); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnTextFieldDidChange( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnTextFieldDidChange( - WithNewVersion(form), field, bounding_box, timestamp); - } - }); -@@ -491,8 +491,8 @@ void ContentAutofillDriver::TextFieldDidScroll(const FormData& raw_form, - const FormFieldData& field, const gfx::RectF& bounding_box) { - target->GetAutofillManager().OnTextFieldDidScroll(WithNewVersion(form), - field, bounding_box); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnTextFieldDidScroll( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnTextFieldDidScroll( - WithNewVersion(form), field, bounding_box); - } - }); -@@ -515,8 +515,8 @@ void ContentAutofillDriver::SelectControlDidChange( - const FormFieldData& field, const gfx::RectF& bounding_box) { - target->GetAutofillManager().OnSelectControlDidChange( - WithNewVersion(form), field, bounding_box); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnSelectControlDidChange( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnSelectControlDidChange( - WithNewVersion(form), field, bounding_box); - } - }); -@@ -541,8 +541,8 @@ void ContentAutofillDriver::AskForValuesToFill( - AutofillSuggestionTriggerSource trigger_source) { - target->GetAutofillManager().OnAskForValuesToFill( - WithNewVersion(form), field, bounding_box, trigger_source); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnAskForValuesToFill( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnAskForValuesToFill( - WithNewVersion(form), field, bounding_box, trigger_source); - } - }); -@@ -556,8 +556,8 @@ void ContentAutofillDriver::HidePopup() { - DCHECK(!target->IsPrerendering()) - << "We should never affect UI while prerendering"; - target->GetAutofillManager().OnHidePopup(); -- if (target->secondary_autofill_manager_) -- target->secondary_autofill_manager_->OnHidePopup(); -+ if (target->secondary_autofill_manager()) -+ target->secondary_autofill_manager()->OnHidePopup(); - }); - } - -@@ -569,8 +569,8 @@ void ContentAutofillDriver::FocusNoLongerOnForm(bool had_interacted_form) { - this, had_interacted_form, - [](autofill::AutofillDriver* target, bool had_interacted_form) { - target->GetAutofillManager().OnFocusNoLongerOnForm(had_interacted_form); -- if (target->secondary_autofill_manager_) -- target->secondary_autofill_manager_->OnFocusNoLongerOnForm(had_interacted_form); -+ if (target->secondary_autofill_manager()) -+ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(had_interacted_form); - }); - } - -@@ -590,15 +590,15 @@ void ContentAutofillDriver::FocusOnFormField(const FormData& raw_form, - const FormFieldData& field, const gfx::RectF& bounding_box) { - target->GetAutofillManager().OnFocusOnFormField(WithNewVersion(form), - field, bounding_box); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnFocusOnFormField( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnFocusOnFormField( - WithNewVersion(form), field, bounding_box); - } - }, - [](autofill::AutofillDriver* target) { - target->GetAutofillManager().OnFocusNoLongerOnForm(true); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnFocusNoLongerOnForm(true); -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(true); - } - }); - } -@@ -614,8 +614,8 @@ void ContentAutofillDriver::DidFillAutofillFormData(const FormData& raw_form, - base::TimeTicks timestamp) { - target->GetAutofillManager().OnDidFillAutofillFormData( - WithNewVersion(form), timestamp); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnDidFillAutofillFormData( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnDidFillAutofillFormData( - WithNewVersion(form), timestamp); - } - }); -@@ -627,8 +627,8 @@ void ContentAutofillDriver::DidEndTextFieldEditing() { - } - router().DidEndTextFieldEditing(this, [](autofill::AutofillDriver* target) { - target->GetAutofillManager().OnDidEndTextFieldEditing(); -- if (target->secondary_autofill_manager_) -- target->secondary_autofill_manager_->OnDidEndTextFieldEditing(); -+ if (target->secondary_autofill_manager()) -+ target->secondary_autofill_manager()->OnDidEndTextFieldEditing(); - }); - } - -@@ -643,8 +643,8 @@ void ContentAutofillDriver::SelectOrSelectListFieldOptionsDidChange( - cast(target) - ->GetAutofillManager() - .OnSelectOrSelectListFieldOptionsDidChange(WithNewVersion(form)); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnSelectOrSelectMenuFieldOptionsDidChange( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnSelectOrSelectListFieldOptionsDidChange( - WithNewVersion(form)); - } - }); -@@ -666,8 +666,8 @@ void ContentAutofillDriver::JavaScriptChangedAutofilledValue( - const FormFieldData& field, const std::u16string& old_value) { - target->GetAutofillManager().OnJavaScriptChangedAutofilledValue( - WithNewVersion(form), field, old_value); -- if (target->secondary_autofill_manager_) { -- target->secondary_autofill_manager_->OnJavaScriptChangedAutofilledValue( -+ if (target->secondary_autofill_manager()) { -+ target->secondary_autofill_manager()->OnJavaScriptChangedAutofilledValue( - WithNewVersion(form), field, old_value); - } - }); -@@ -682,8 +682,8 @@ void ContentAutofillDriver::OnContextMenuShownInField( - const FieldGlobalId& field_global_id) { - target->GetAutofillManager().OnContextMenuShownInField(form_global_id, - field_global_id); -- if (target->secondary_autofill_manager_) -- target->secondary_autofill_manager_->OnContextMenuShownInField(form_global_id, field_global_id); -+ if (target->secondary_autofill_manager()) -+ target->secondary_autofill_manager()->OnContextMenuShownInField(form_global_id, field_global_id); - }); - } - -@@ -708,6 +708,10 @@ ContentAutofillDriver::GetAutofillAgent() { - return autofill_agent_; - } - -+raw_ptr ContentAutofillDriver::secondary_autofill_manager() { -+ return secondary_autofill_manager_.get(); -+} -+ - void ContentAutofillDriver::SetFrameAndFormMetaData( - FormData& form, - FormFieldData* optional_field) const { -diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h ---- a/components/autofill/content/browser/content_autofill_driver.h -+++ b/components/autofill/content/browser/content_autofill_driver.h -@@ -132,7 +132,7 @@ class ContentAutofillDriver : public AutofillDriver, - autofill_manager_ = std::move(autofill_manager); - secondary_autofill_manager_ = std::move(secondary_autofill_manager); - } -- AutofillManager* secondary_autofill_manager() { return secondary_autofill_manager_.get(); } -+ raw_ptr secondary_autofill_manager() override; - - content::RenderFrameHost* render_frame_host() { return &*render_frame_host_; } - const content::RenderFrameHost* render_frame_host() const { -diff --git a/components/autofill/core/browser/autofill_driver.h b/components/autofill/core/browser/autofill_driver.h ---- a/components/autofill/core/browser/autofill_driver.h -+++ b/components/autofill/core/browser/autofill_driver.h -@@ -69,6 +69,8 @@ class AutofillDriver { - // Returns the AutofillManager owned by the AutofillDriver. - virtual AutofillManager& GetAutofillManager() = 0; - -+ virtual raw_ptr secondary_autofill_manager() = 0; -+ - // Returns whether the AutofillDriver instance is associated with an active - // frame in the MPArch sense. - virtual bool IsInActiveFrame() const = 0; diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java @@ -466,7 +262,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c import java.io.Serializable; -@@ -20,9 +21,15 @@ public class PermissionInfo implements Serializable { +@@ -18,9 +19,15 @@ public class PermissionInfo implements Serializable { private final String mEmbedder; private final String mOrigin; private final @ContentSettingsType int mContentSettingsType; @@ -481,9 +277,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + @ContentSettingsType int type, String origin, String embedder, boolean isEmbargoed, + @SessionModel int sessionModel) { assert WebsitePermissionsFetcher.getPermissionsType(type) - == WebsitePermissionsFetcher.WebsitePermissionsType.PERMISSION_INFO - : "invalid type: " -@@ -31,6 +38,11 @@ public class PermissionInfo implements Serializable { + == WebsitePermissionsFetcher.WebsitePermissionsType.PERMISSION_INFO + : "invalid type: " + type; +@@ -28,6 +35,11 @@ public class PermissionInfo implements Serializable { mEmbedder = embedder; mContentSettingsType = type; mIsEmbargoed = isEmbargoed; @@ -504,9 +300,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c import org.chromium.components.content_settings.ContentSettingsType; +import org.chromium.components.content_settings.SessionModel; import org.chromium.components.embedder_support.util.Origin; - import org.chromium.content_public.browser.BrowserContextHandle; - -@@ -558,6 +559,11 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment + import org.chromium.components.permissions.PermissionsAndroidFeatureList; + import org.chromium.components.permissions.PermissionsAndroidFeatureMap; +@@ -567,6 +568,11 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment } } @@ -518,7 +314,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c private void setUpClearDataPreference() { ClearWebsiteStorage preference = findPreference(PREF_CLEAR_DATA); long usage = mSite.getTotalUsage(); -@@ -1024,6 +1030,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1094,6 +1100,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment if (contentType == mHighlightedPermission) { switchPreference.setBackgroundColor(mHighlightColor); } @@ -532,25 +328,25 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -@@ -9,6 +9,7 @@ import org.chromium.base.annotations.CalledByNative; - import org.chromium.base.annotations.NativeMethods; +@@ -10,6 +10,7 @@ import org.jni_zero.NativeMethods; + import org.chromium.base.Callback; import org.chromium.components.content_settings.ContentSettingValues; import org.chromium.components.content_settings.ContentSettingsType; +import org.chromium.components.content_settings.SessionModel; import org.chromium.components.location.LocationUtils; import org.chromium.content_public.browser.BrowserContextHandle; import org.chromium.url.GURL; -@@ -55,7 +56,8 @@ public class WebsitePreferenceBridge { - - @CalledByNative - private static void insertPermissionInfoIntoList(@ContentSettingsType int type, -- ArrayList list, String origin, String embedder, boolean isEmbargoed) { -+ ArrayList list, String origin, String embedder, boolean isEmbargoed, +@@ -54,7 +55,8 @@ public class WebsitePreferenceBridge { + ArrayList list, + String origin, + String embedder, +- boolean isEmbargoed) { ++ boolean isEmbargoed, + @SessionModel int sessionModel) { if (type == ContentSettingsType.MEDIASTREAM_CAMERA || type == ContentSettingsType.MEDIASTREAM_MIC) { for (PermissionInfo info : list) { -@@ -64,7 +66,7 @@ public class WebsitePreferenceBridge { +@@ -63,7 +65,7 @@ public class WebsitePreferenceBridge { } } } @@ -593,7 +389,7 @@ diff --git a/components/browser_ui/site_settings/android/website_preference_brid diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd --- a/components/browser_ui/strings/android/browser_ui_strings.grd +++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -642,6 +642,11 @@ +@@ -682,6 +682,11 @@ URL truncated @@ -602,13 +398,13 @@ diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/comp + (only this session) + + - - Ad personalization + + Ad privacy diff --git a/components/content_settings/android/BUILD.gn b/components/content_settings/android/BUILD.gn --- a/components/content_settings/android/BUILD.gn +++ b/components/content_settings/android/BUILD.gn -@@ -60,6 +60,7 @@ java_cpp_enum("content_settings_enums_javagen") { +@@ -61,6 +61,7 @@ java_cpp_enum("content_settings_enums_javagen") { "../core/common/cookie_controls_breakage_confidence_level.h", "../core/common/cookie_controls_enforcement.h", "../core/common/cookie_controls_status.h", @@ -619,7 +415,7 @@ diff --git a/components/content_settings/android/BUILD.gn b/components/content_s diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc --- a/components/content_settings/core/browser/content_settings_utils.cc +++ b/components/content_settings/core/browser/content_settings_utils.cc -@@ -174,6 +174,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { +@@ -173,6 +173,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { return constraints.session_model() == SessionModel::Durable; } @@ -709,10 +505,10 @@ diff --git a/components/content_settings/core/common/content_settings_constraint diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java --- a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java -@@ -336,9 +336,9 @@ public class PageInfoController implements PageInfoMainController, ModalDialogPr - */ - @CalledByNative - private void addPermissionSection(String name, String nameMidSentence, int type, +@@ -378,9 +378,9 @@ public class PageInfoController + String name, + String nameMidSentence, + int type, - @ContentSettingValues int currentSettingValue) { + @ContentSettingValues int currentSettingValue, boolean is_user_session) { mPermissionParamsListBuilder.addPermissionEntry( @@ -720,7 +516,7 @@ diff --git a/components/page_info/android/java/src/org/chromium/components/page_ + name, nameMidSentence, type, currentSettingValue, is_user_session); } - /** + /** Update the permissions view based on the contents of mDisplayedPermissions. */ diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java b/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java --- a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java @@ -747,7 +543,7 @@ diff --git a/components/page_info/android/java/src/org/chromium/components/page_ } } -@@ -123,13 +128,15 @@ public class PermissionParamsListBuilder { +@@ -126,13 +131,15 @@ public class PermissionParamsListBuilder { public final String nameMidSentence; public final int type; public final @ContentSettingValues int setting; @@ -808,7 +604,7 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc --- a/components/page_info/page_info.cc +++ b/components/page_info/page_info.cc -@@ -1184,6 +1184,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1187,6 +1187,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, permission_info.source = info.source; permission_info.is_one_time = (info.metadata.session_model() == content_settings::SessionModel::OneTime); @@ -820,7 +616,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. diff --git a/components/page_info/page_info.h b/components/page_info/page_info.h --- a/components/page_info/page_info.h +++ b/components/page_info/page_info.h -@@ -199,6 +199,7 @@ class PageInfo : private content_settings::CookieControlsObserver, +@@ -200,6 +200,7 @@ class PageInfo : private content_settings::CookieControlsObserver, content_settings::SETTING_SOURCE_NONE; // Whether the permission is a one-time grant. bool is_one_time = false; @@ -831,9 +627,9 @@ diff --git a/components/page_info/page_info.h b/components/page_info/page_info.h diff --git a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java --- a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java +++ b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java -@@ -8,6 +8,7 @@ import org.chromium.base.annotations.CalledByNative; - import org.chromium.base.annotations.JNINamespace; - import org.chromium.base.annotations.NativeMethods; +@@ -11,6 +11,7 @@ import org.jni_zero.JNINamespace; + import org.jni_zero.NativeMethods; + import org.chromium.ui.base.WindowAndroid; +import org.chromium.components.content_settings.LifetimeMode; @@ -849,7 +645,7 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per public WindowAndroid getWindow() { return mWindow; } -@@ -79,6 +83,15 @@ public class PermissionDialogDelegate { +@@ -75,6 +79,15 @@ public class PermissionDialogDelegate { PermissionDialogDelegateJni.get().accept(mNativeDelegatePtr, PermissionDialogDelegate.this); } @@ -865,10 +661,10 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per public void onCancel() { assert mNativeDelegatePtr != 0; PermissionDialogDelegateJni.get().cancel(mNativeDelegatePtr, PermissionDialogDelegate.this); -diff --git a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModel.java b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModel.java ---- a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModel.java -+++ b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModel.java -@@ -16,6 +16,17 @@ import org.chromium.ui.UiUtils; +diff --git a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModelFactory.java b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModelFactory.java +--- a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModelFactory.java ++++ b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogModelFactory.java +@@ -12,6 +12,18 @@ import org.chromium.ui.UiUtils; import org.chromium.ui.modaldialog.ModalDialogProperties; import org.chromium.ui.modelutil.PropertyModel; @@ -878,25 +674,26 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per +import android.widget.LinearLayout; +import android.widget.RadioButton; +import android.widget.RadioGroup; ++import android.widget.TextView; +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.ui.base.ViewUtils; +import org.chromium.components.content_settings.ContentSettingsType; +import org.chromium.components.content_settings.LifetimeMode; + - /** - * This class creates the model for permission dialog. - */ -@@ -41,7 +52,7 @@ class PermissionDialogModel { - secondaryTextView.setVisibility(View.VISIBLE); - } + /** This class creates the model for the permission dialog. */ + class PermissionDialogModelFactory { + public static PropertyModel getModel( +@@ -25,7 +37,7 @@ class PermissionDialogModelFactory { + String messageText = delegate.getMessageText(); + assert !TextUtils.isEmpty(messageText); - return new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) + PropertyModel pm = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) .with(ModalDialogProperties.CONTROLLER, controller) .with(ModalDialogProperties.FOCUS_DIALOG, true) .with(ModalDialogProperties.CUSTOM_VIEW, customView) -@@ -53,6 +64,74 @@ class PermissionDialogModel { - .with(ModalDialogProperties.BUTTON_TAP_PROTECTION_PERIOD_MS, +@@ -38,5 +50,73 @@ class PermissionDialogModelFactory { + ModalDialogProperties.BUTTON_TAP_PROTECTION_PERIOD_MS, UiUtils.PROMPT_INPUT_PROTECTION_SHORT_DELAY_MS) .build(); + @@ -923,29 +720,29 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per + // Create radio buttons with lifetime options. + RadioGroup radioGroup = new RadioGroup(context); + -+ RadioButton radioButon = new RadioButton(context); -+ radioButon.setText(context.getString( ++ RadioButton radioButton = new RadioButton(context); ++ radioButton.setText(context.getString( + org.chromium.components.permissions.R.string.session_permissions_only_this_this)); -+ radioButon.setId(LifetimeMode.ONLY_THIS_TIME); -+ radioGroup.addView(radioButon); ++ radioButton.setId(LifetimeMode.ONLY_THIS_TIME); ++ radioGroup.addView(radioButton); + -+ radioButon = new RadioButton(context); -+ radioButon.setText(context.getString( ++ radioButton = new RadioButton(context); ++ radioButton.setText(context.getString( + org.chromium.components.permissions.R.string.session_permissions_until_page_close)); -+ radioButon.setId(LifetimeMode.UNTIL_ORIGIN_CLOSED); -+ radioGroup.addView(radioButon); ++ radioButton.setId(LifetimeMode.UNTIL_ORIGIN_CLOSED); ++ radioGroup.addView(radioButton); + -+ radioButon = new RadioButton(context); -+ radioButon.setText(context.getString( ++ radioButton = new RadioButton(context); ++ radioButton.setText(context.getString( + org.chromium.components.permissions.R.string.session_permissions_until_browser_close)); -+ radioButon.setId(LifetimeMode.UNTIL_BROWSER_CLOSED); -+ radioGroup.addView(radioButon); ++ radioButton.setId(LifetimeMode.UNTIL_BROWSER_CLOSED); ++ radioGroup.addView(radioButton); + -+ radioButon = new RadioButton(context); -+ radioButon.setText(context.getString( ++ radioButton = new RadioButton(context); ++ radioButton.setText(context.getString( + org.chromium.components.permissions.R.string.session_permissions_forever)); -+ radioButon.setId(LifetimeMode.ALWAYS); -+ radioGroup.addView(radioButon); ++ radioButton.setId(LifetimeMode.ALWAYS); ++ radioGroup.addView(radioButton); + + radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { + @Override @@ -968,12 +765,11 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per + } + return false; } - - private static View loadDialogView(Context context) { + } diff --git a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc --- a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc +++ b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc -@@ -68,6 +68,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { +@@ -113,6 +113,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { Java_PermissionDialogDelegate_dismissFromNative(env, j_delegate_); } @@ -985,7 +781,7 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ // static void PermissionDialogDelegate::Create( content::WebContents* web_contents, -@@ -96,12 +101,26 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( +@@ -141,12 +146,26 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( void PermissionDialogDelegate::Accept(JNIEnv* env, const JavaParamRef& obj) { DCHECK(permission_prompt_); @@ -1015,9 +811,9 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ diff --git a/components/permissions/android/permission_prompt/permission_dialog_delegate.h b/components/permissions/android/permission_prompt/permission_dialog_delegate.h --- a/components/permissions/android/permission_prompt/permission_dialog_delegate.h +++ b/components/permissions/android/permission_prompt/permission_dialog_delegate.h -@@ -35,6 +35,7 @@ class PermissionDialogJavaDelegate { - PermissionDialogDelegate* owner); - virtual void CreateDialog(); +@@ -41,6 +41,7 @@ class PermissionDialogJavaDelegate { + const favicon_base::FaviconRawBitmapResult& favicon_result); + virtual void DismissDialog(); + virtual int GetSelectedLifetimeOption(); @@ -1026,7 +822,7 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ diff --git a/components/permissions/android/permission_prompt/permission_prompt_android.cc b/components/permissions/android/permission_prompt/permission_prompt_android.cc --- a/components/permissions/android/permission_prompt/permission_prompt_android.cc +++ b/components/permissions/android/permission_prompt/permission_prompt_android.cc -@@ -47,6 +47,14 @@ void PermissionPromptAndroid::Accept() { +@@ -52,6 +52,14 @@ void PermissionPromptAndroid::Accept() { delegate_->Accept(); } @@ -1044,7 +840,7 @@ diff --git a/components/permissions/android/permission_prompt/permission_prompt_ diff --git a/components/permissions/android/permission_prompt/permission_prompt_android.h b/components/permissions/android/permission_prompt/permission_prompt_android.h --- a/components/permissions/android/permission_prompt/permission_prompt_android.h +++ b/components/permissions/android/permission_prompt/permission_prompt_android.h -@@ -46,7 +46,9 @@ class PermissionPromptAndroid : public PermissionPrompt { +@@ -47,7 +47,9 @@ class PermissionPromptAndroid : public PermissionPrompt { void Closing(); void Accept(); @@ -1215,7 +1011,7 @@ diff --git a/components/permissions/contexts/geolocation_permission_context_andr diff --git a/components/permissions/permission_context_base.cc b/components/permissions/permission_context_base.cc --- a/components/permissions/permission_context_base.cc +++ b/components/permissions/permission_context_base.cc -@@ -262,6 +262,16 @@ PermissionContextBase::CreatePermissionRequest( +@@ -261,6 +261,16 @@ PermissionContextBase::CreatePermissionRequest( std::move(delete_callback)); } @@ -1232,7 +1028,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm content::PermissionResult PermissionContextBase::GetPermissionStatus( content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, -@@ -506,7 +516,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -505,7 +515,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1242,7 +1038,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK(content_setting == CONTENT_SETTING_ALLOW || content_setting == CONTENT_SETTING_BLOCK || content_setting == CONTENT_SETTING_DEFAULT); -@@ -521,13 +532,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -520,13 +531,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, // missing if a permission prompt was preignored and we already notified an // origin about it. if (request->second.second) { @@ -1261,7 +1057,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } } -@@ -573,11 +585,27 @@ void PermissionContextBase::NotifyPermissionSet( +@@ -572,11 +584,27 @@ void PermissionContextBase::NotifyPermissionSet( ContentSetting content_setting, bool is_one_time, bool is_final_decision) { @@ -1290,7 +1086,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } if (is_final_decision) { -@@ -607,6 +635,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -606,6 +634,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time) { @@ -1306,7 +1102,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK_EQ(requesting_origin, requesting_origin.DeprecatedGetOriginAsURL()); DCHECK_EQ(embedding_origin, embedding_origin.DeprecatedGetOriginAsURL()); DCHECK(content_setting == CONTENT_SETTING_ALLOW || -@@ -616,6 +653,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -615,6 +652,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, constraints.set_session_model(is_one_time ? content_settings::SessionModel::OneTime : content_settings::SessionModel::Durable); @@ -1314,11 +1110,11 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm + constraints = content_settings::GetConstraintSessionExpiration(lifetime_option); #if !BUILDFLAG(IS_ANDROID) - if (base::FeatureList::IsEnabled( + // The Permissions module in Safety check will revoke permissions after diff --git a/components/permissions/permission_context_base.h b/components/permissions/permission_context_base.h --- a/components/permissions/permission_context_base.h +++ b/components/permissions/permission_context_base.h -@@ -149,6 +149,15 @@ class PermissionContextBase : public content_settings::Observer { +@@ -153,6 +153,15 @@ class PermissionContextBase : public content_settings::Observer { // Updates stored content setting if persist is set, updates tab indicators // and runs the callback to finish the request. @@ -1334,7 +1130,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi virtual void NotifyPermissionSet(const PermissionRequestID& id, const GURL& requesting_origin, const GURL& embedding_origin, -@@ -170,6 +179,11 @@ class PermissionContextBase : public content_settings::Observer { +@@ -174,6 +183,11 @@ class PermissionContextBase : public content_settings::Observer { // Store the decided permission as a content setting. // virtual since the permission might be stored with different restrictions // (for example for desktop notifications). @@ -1346,7 +1142,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi virtual void UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, -@@ -200,6 +214,12 @@ class PermissionContextBase : public content_settings::Observer { +@@ -204,6 +218,12 @@ class PermissionContextBase : public content_settings::Observer { PermissionRequest::PermissionDecidedCallback permission_decided_callback, base::OnceClosure delete_callback) const; @@ -1359,7 +1155,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi base::ObserverList permission_observers_; // Set by subclasses to inform the base class that they will handle adding -@@ -222,7 +242,8 @@ class PermissionContextBase : public content_settings::Observer { +@@ -226,7 +246,8 @@ class PermissionContextBase : public content_settings::Observer { const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1401,7 +1197,7 @@ diff --git a/components/permissions/permission_request.cc b/components/permissio PermissionRequest::~PermissionRequest() { DCHECK(delete_callback_.is_null()); } -@@ -276,19 +284,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { +@@ -279,19 +287,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { permissions::features::kPermissionStorageAccessAPI); } @@ -1438,9 +1234,9 @@ diff --git a/components/permissions/permission_request.cc b/components/permissio + content_settings::LifetimeMode::Always); + return; + } - permission_decided_callback_.Run(CONTENT_SETTING_DEFAULT, - /*is_one_time=*/false, is_final_decision); - } + if (permission_decided_callback_) { + permission_decided_callback_.Run(CONTENT_SETTING_DEFAULT, + /*is_one_time=*/false, is_final_decision); diff --git a/components/permissions/permission_request.h b/components/permissions/permission_request.h --- a/components/permissions/permission_request.h +++ b/components/permissions/permission_request.h @@ -1480,7 +1276,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission // Called when the user has cancelled the permission request. This // corresponds to a denial, but is segregated in case the context needs to -@@ -174,6 +183,9 @@ class PermissionRequest { +@@ -180,6 +189,9 @@ class PermissionRequest { // Called once a decision is made about the permission. PermissionDecidedCallback permission_decided_callback_; @@ -1511,7 +1307,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } request->RequestFinished(); return; -@@ -568,7 +568,8 @@ void PermissionRequestManager::Accept() { +@@ -574,7 +574,8 @@ void PermissionRequestManager::Accept() { (*requests_iter)->request_type(), PermissionAction::GRANTED); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1521,8 +1317,8 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p #if !BUILDFLAG(IS_ANDROID) absl::optional content_settings_type = -@@ -586,7 +587,7 @@ void PermissionRequestManager::Accept() { - FinalizeCurrentRequests(PermissionAction::GRANTED); +@@ -592,7 +593,7 @@ void PermissionRequestManager::Accept() { + CurrentRequestsDecided(PermissionAction::GRANTED); } -void PermissionRequestManager::AcceptThisTime() { @@ -1530,7 +1326,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -597,7 +598,8 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -603,7 +604,8 @@ void PermissionRequestManager::AcceptThisTime() { (*requests_iter)->request_type(), PermissionAction::GRANTED_ONCE); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1540,7 +1336,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::GRANTED_ONCE); -@@ -605,6 +607,15 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -611,6 +613,15 @@ void PermissionRequestManager::AcceptThisTime() { } void PermissionRequestManager::Deny() { @@ -1556,7 +1352,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -627,7 +638,7 @@ void PermissionRequestManager::Deny() { +@@ -633,7 +644,7 @@ void PermissionRequestManager::Deny() { StorePermissionActionForUMA((*requests_iter)->requesting_origin(), (*requests_iter)->request_type(), PermissionAction::DENIED); @@ -1565,7 +1361,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::DENIED); -@@ -1165,32 +1176,32 @@ PermissionRequestManager::VisitDuplicateRequests( +@@ -1190,32 +1201,32 @@ PermissionRequestManager::VisitDuplicateRequests( void PermissionRequestManager::PermissionGrantedIncludingDuplicates( PermissionRequest* request, @@ -1608,7 +1404,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p request); } -@@ -1439,7 +1450,7 @@ void PermissionRequestManager::LogWarningToConsole(const char* message) { +@@ -1467,7 +1478,7 @@ void PermissionRequestManager::LogWarningToConsole(const char* message) { void PermissionRequestManager::DoAutoResponseForTesting() { switch (auto_response_for_test_) { case ACCEPT_ONCE: @@ -1631,8 +1427,8 @@ diff --git a/components/permissions/permission_request_manager.h b/components/pe + void DenyThisTime(content_settings::LifetimeMode lifetime_option) override; void Dismiss() override; void Ignore() override; - void OpenHelpCenterLink(const ui::Event& event) override; -@@ -362,9 +364,12 @@ class PermissionRequestManager + void FinalizeCurrentRequests() override; +@@ -365,9 +367,12 @@ class PermissionRequestManager // Calls PermissionGranted on a request and all its duplicates. void PermissionGrantedIncludingDuplicates(PermissionRequest* request, @@ -1648,4 +1444,3 @@ diff --git a/components/permissions/permission_request_manager.h b/components/pe void CancelledIncludingDuplicates(PermissionRequest* request, bool is_final_decision = true); -- -2.25.1 diff --git a/build/bromite_patches/Add-menu-item-to-bookmark-all-tabs.patch b/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch similarity index 87% rename from build/bromite_patches/Add-menu-item-to-bookmark-all-tabs.patch rename to build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch index 8ebb1c48c8dd252fae1fdfcaef55e39080121c37..2377193ef6cae48779da9a88d8ba0d75095973f9 100644 --- a/build/bromite_patches/Add-menu-item-to-bookmark-all-tabs.patch +++ b/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch @@ -6,27 +6,27 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/java/res/menu/main_menu.xml | 7 ++ .../chrome/browser/ChromeTabbedActivity.java | 24 +++++++ - .../browser/bookmarks/BookmarkBridge.java | 64 +++++++++++++++++++ - .../bookmarks/android/bookmark_bridge.cc | 43 +++++++++++++ + .../browser/bookmarks/BookmarkBridge.java | 67 +++++++++++++++++++ + .../bookmarks/android/bookmark_bridge.cc | 44 ++++++++++++ .../bookmarks/android/bookmark_bridge.h | 8 +++ .../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 | 22 +++++-- + .../bookmarks/browser/bookmark_client.cc | 2 + + .../bookmarks/browser/bookmark_codec.cc | 22 ++++-- components/bookmarks/browser/bookmark_codec.h | 7 +- .../browser/bookmark_load_details.cc | 4 ++ .../bookmarks/browser/bookmark_load_details.h | 3 + .../bookmarks/browser/bookmark_model.cc | 3 +- components/bookmarks/browser/bookmark_model.h | 7 ++ - components/bookmarks/browser/bookmark_node.cc | 11 ++++ + components/bookmarks/browser/bookmark_node.cc | 11 +++ components/bookmarks/browser/bookmark_node.h | 4 ++ .../bookmarks/browser/bookmark_uuids.cc | 3 + components/bookmarks/browser/bookmark_uuids.h | 1 + components/bookmarks/browser/model_loader.cc | 3 +- .../bookmark_specifics_conversions.cc | 1 + - 22 files changed, 228 insertions(+), 10 deletions(-) + 22 files changed, 232 insertions(+), 10 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 @@ -55,7 +55,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re 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 -@@ -84,6 +84,7 @@ import org.chromium.chrome.browser.back_press.MinimizeAppAndCloseTabBackPressHan +@@ -86,6 +86,7 @@ import org.chromium.chrome.browser.base.ColdStartTracker; import org.chromium.chrome.browser.bookmarks.BookmarkUtils; import org.chromium.chrome.browser.browserservices.intents.WebappConstants; import org.chromium.chrome.browser.compositor.CompositorViewHolder; @@ -63,7 +63,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChromePhone; -@@ -2294,6 +2295,8 @@ public class ChromeTabbedActivity extends ChromeActivity getTabModelSelector().closeAllTabs()); RecordUserAction.record("MobileMenuCloseAllTabs"); @@ -71,8 +71,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct + bookmarkAllTabs(); } else if (id == R.id.close_all_incognito_tabs_menu_id) { // Close only incognito tabs - CloseAllTabsDialog.show(this, getModalDialogManagerSupplier(), -@@ -2359,6 +2362,27 @@ public class ChromeTabbedActivity extends ChromeActivity mObservers = new ObserverList<>(); @@ -131,7 +132,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm private long mNativeBookmarkBridge; private boolean mIsDestroyed; private boolean mIsDoingExtensiveChanges; -@@ -375,6 +382,16 @@ class BookmarkBridge { +@@ -374,6 +382,16 @@ class BookmarkBridge { return mMobileFolderId; } @@ -148,7 +149,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** * @return Id representing the special "other" folder from bookmark model. */ -@@ -1008,6 +1025,50 @@ class BookmarkBridge { +@@ -1018,6 +1036,50 @@ class BookmarkBridge { return BookmarkBridgeJni.get().addToReadingList(mNativeBookmarkBridge, title, url); } @@ -197,28 +198,31 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + } + /** - * @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. -@@ -1221,12 +1282,15 @@ class BookmarkBridge { - void getImageUrlForBookmark(long nativeBookmarkBridge, GURL url, Callback callback); - BookmarkId getBookmarkIdForWebContents( - long nativeBookmarkBridge, WebContents webContents, boolean onlyEditable); + * Helper method to mark an article as read. + * +@@ -1243,6 +1305,9 @@ class BookmarkBridge { + + BookmarkId getMostRecentlyAddedUserBookmarkIdForUrl(long nativeBookmarkBridge, GURL url); + + BookmarkId getBookmarkIdForTabsCollection( + long nativeBookmarkBridge, GURL url); ++ BookmarkItem getBookmarkById(long nativeBookmarkBridge, long id, int type); + void getTopLevelFolderIds(long nativeBookmarkBridge, List bookmarksList); - BookmarkId getReadingListFolder(long nativeBookmarkBridge); - void getAllFoldersWithDepths( - long nativeBookmarkBridge, List folderList, List depthList); +@@ -1254,6 +1319,8 @@ class BookmarkBridge { + BookmarkId getRootFolderId(long nativeBookmarkBridge); + + BookmarkId getTabsCollectionFolderId(long nativeBookmarkBridge, BookmarkBridge caller); ++ BookmarkId getMobileFolderId(long nativeBookmarkBridge); + BookmarkId getOtherFolderId(long nativeBookmarkBridge); - BookmarkId getDesktopFolderId(long nativeBookmarkBridge); diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc --- a/chrome/browser/bookmarks/android/bookmark_bridge.cc +++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc -@@ -330,6 +330,33 @@ void BookmarkBridge::GetImageUrlForBookmark( +@@ -331,6 +331,33 @@ void BookmarkBridge::GetImageUrlForBookmark( base::BindOnce(&HandleImageUrlResponse, callback)); } @@ -250,20 +254,9 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse +} + base::android::ScopedJavaLocalRef - BookmarkBridge::GetBookmarkIdForWebContents( + BookmarkBridge::GetMostRecentlyAddedUserBookmarkIdForUrl( JNIEnv* env, -@@ -436,6 +463,10 @@ void BookmarkBridge::GetTopLevelFolderIds( - } - top_level_folders.push_back(root_child.get()); - } -+ for (const auto& node : bookmark_model_->tabs_collection_node()->children()) { -+ if (node->is_folder()) -+ top_level_folders.push_back(node.get()); -+ } - - if (managed_bookmark_service_->managed_node() && - !managed_bookmark_service_->managed_node()->children().empty()) { -@@ -479,6 +510,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( +@@ -421,6 +448,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( // Vector to temporarily contain all child bookmarks at same level for sorting std::vector bookmarks = { bookmark_model_->mobile_node(), @@ -271,8 +264,20 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse bookmark_model_->bookmark_bar_node(), bookmark_model_->other_node(), }; -@@ -1051,6 +1083,17 @@ void BookmarkBridge::GetBookmarksOfType( +@@ -474,6 +502,11 @@ std::vector BookmarkBridge::GetTopLevelFolderIdsImpl() { + top_level_folders.push_back(root_child.get()); + } + ++ for (const auto& node : bookmark_model_->tabs_collection_node()->children()) { ++ if (node->is_folder()) ++ top_level_folders.push_back(node.get()); ++ } ++ + if (reading_list_manager_->GetRoot()) { + top_level_folders.push_back(reading_list_manager_->GetRoot()); } +@@ -1027,6 +1060,17 @@ void BookmarkBridge::GetBookmarksOfType( + AddBookmarkNodesToBookmarkIdList(env, j_list, results); } +ScopedJavaLocalRef BookmarkBridge::GetTabsCollectionFolderId( @@ -292,7 +297,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser/bookmarks/android/bookmark_bridge.h --- a/chrome/browser/bookmarks/android/bookmark_bridge.h +++ b/chrome/browser/bookmarks/android/bookmark_bridge.h -@@ -69,6 +69,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -67,6 +67,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, const base::android::JavaParamRef& j_url, const base::android::JavaParamRef& j_callback); @@ -300,10 +305,10 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser + JNIEnv* env, + const base::android::JavaParamRef& url); + - base::android::ScopedJavaLocalRef GetBookmarkIdForWebContents( + base::android::ScopedJavaLocalRef + GetMostRecentlyAddedUserBookmarkIdForUrl( JNIEnv* env, - -@@ -205,6 +209,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -197,6 +201,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, const base::android::JavaParamRef& j_list, jint type); @@ -347,22 +352,10 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b 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 -@@ -160,6 +160,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 -@@ -79,7 +79,7 @@ public class DownloadLocationCustomView +@@ -77,7 +77,7 @@ public class DownloadLocationCustomView extends ScrollView mDirectoryAdapter.update(); } @@ -371,7 +364,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse mTitle.setText(title); } -@@ -87,7 +87,7 @@ public class DownloadLocationCustomView +@@ -85,7 +85,7 @@ public class DownloadLocationCustomView extends ScrollView mSubtitleView.setText(subtitle); } @@ -383,7 +376,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse 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 -@@ -3989,6 +3989,9 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Select tabs @@ -416,6 +409,18 @@ diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_stri Other Bookmarks +diff --git a/components/bookmarks/browser/bookmark_client.cc b/components/bookmarks/browser/bookmark_client.cc +--- a/components/bookmarks/browser/bookmark_client.cc ++++ b/components/bookmarks/browser/bookmark_client.cc +@@ -55,6 +55,8 @@ bool BookmarkClient::IsPermanentNodeVisibleWhenEmpty( + case BookmarkNode::MOBILE: + // Either MOBILE or OTHER_NODE is visible when empty, but never both. + return !IsPermanentNodeVisibleWhenEmpty(BookmarkNode::OTHER_NODE); ++ case bookmarks::BookmarkNode::TABS_COLLECTION: ++ return !is_desktop; + } + NOTREACHED_NORETURN(); + } 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 @@ -427,33 +432,33 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar const char BookmarkCodec::kVersionKey[] = "version"; const char BookmarkCodec::kChecksumKey[] = "checksum"; const char BookmarkCodec::kIdKey[] = "id"; -@@ -75,7 +76,8 @@ BookmarkCodec::~BookmarkCodec() = default; +@@ -74,7 +75,8 @@ BookmarkCodec::~BookmarkCodec() = default; base::Value::Dict BookmarkCodec::Encode(BookmarkModel* model, 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(), - model->root_node()->GetUnsyncedMetaInfoMap(), std::move(sync_metadata_str)); } -@@ -84,6 +86,7 @@ base::Value::Dict BookmarkCodec::Encode( + +@@ -82,6 +84,7 @@ base::Value::Dict 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 BookmarkNode::MetaInfoMap* model_unsynced_meta_info_map, std::string sync_metadata_str) { -@@ -105,6 +108,7 @@ base::Value::Dict BookmarkCodec::Encode( + ids_reassigned_ = false; +@@ -102,6 +105,7 @@ base::Value::Dict BookmarkCodec::Encode( roots.Set(kBookmarkBarFolderNameKey, EncodeNode(bookmark_bar_node)); roots.Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node)); roots.Set(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node)); + roots.Set(kTabsBookmarkFolderNameKey, EncodeNode(tabs_folder_node)); if (model_meta_info_map) roots.Set(kMetaInfo, EncodeMetaInfo(*model_meta_info_map)); - if (model_unsynced_meta_info_map) { -@@ -125,6 +129,7 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, + +@@ -119,6 +123,7 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -461,7 +466,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar int64_t* max_id, std::string* sync_metadata_str) { ids_.clear(); -@@ -132,7 +137,8 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, +@@ -126,7 +131,8 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, base::Uuid::ParseLowercase(kBookmarkBarNodeUuid), base::Uuid::ParseLowercase(kOtherBookmarksNodeUuid), base::Uuid::ParseLowercase(kMobileBookmarksNodeUuid), @@ -471,7 +476,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar ids_reassigned_ = false; uuids_reassigned_ = false; ids_valid_ = true; -@@ -140,12 +146,13 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, +@@ -134,12 +140,13 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, stored_checksum_.clear(); InitializeChecksum(); bool success = DecodeHelper(bb_node, other_folder_node, mobile_folder_node, @@ -486,7 +491,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar *max_id = maximum_id_ + 1; return success; } -@@ -201,6 +208,7 @@ base::Value::Dict BookmarkCodec::EncodeMetaInfo( +@@ -191,6 +198,7 @@ base::Value::Dict BookmarkCodec::EncodeMetaInfo( bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -494,7 +499,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar const base::Value::Dict& value, std::string* sync_metadata_str) { absl::optional version = value.FindInt(kVersionKey); -@@ -225,6 +233,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, +@@ -215,6 +223,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, roots->FindDict(kOtherBookmarkFolderNameKey); const base::Value::Dict* mobile_folder_value = roots->FindDict(kMobileBookmarkFolderNameKey); @@ -503,7 +508,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar if (!bb_value || !other_folder_value || !mobile_folder_value) return false; -@@ -232,6 +242,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, +@@ -222,6 +232,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, DecodeNode(*bb_value, nullptr, bb_node); DecodeNode(*other_folder_value, nullptr, other_folder_node); DecodeNode(*mobile_folder_value, nullptr, mobile_folder_node); @@ -512,7 +517,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar if (!DecodeMetaInfo(*roots, &model_meta_info_map_)) return false; -@@ -497,11 +509,13 @@ void BookmarkCodec::DecodeMetaInfoHelper( +@@ -463,11 +475,13 @@ void BookmarkCodec::DecodeMetaInfoHelper( void BookmarkCodec::ReassignIDs(BookmarkNode* bb_node, BookmarkNode* other_node, @@ -536,9 +541,9 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark const BookmarkNode* mobile_folder_node, + const BookmarkNode* tabs_folder_node, const BookmarkNode::MetaInfoMap* model_meta_info_map, - const BookmarkNode::MetaInfoMap* model_unsynced_meta_info_map, std::string sync_metadata_str); -@@ -59,6 +60,7 @@ class BookmarkCodec { + +@@ -58,6 +59,7 @@ class BookmarkCodec { BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -546,7 +551,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark int64_t* max_node_id, std::string* sync_metadata_str); -@@ -110,6 +112,7 @@ class BookmarkCodec { +@@ -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[]; @@ -554,7 +559,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark static const char kDateLastUsed[]; // Possible values for kTypeKey. -@@ -128,6 +131,7 @@ class BookmarkCodec { +@@ -121,6 +124,7 @@ class BookmarkCodec { bool DecodeHelper(BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -562,7 +567,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark const base::Value::Dict& value, std::string* sync_metadata_str); -@@ -139,7 +143,8 @@ class BookmarkCodec { +@@ -132,7 +136,8 @@ class BookmarkCodec { // Reassigns bookmark IDs for all nodes. void ReassignIDs(BookmarkNode* bb_node, BookmarkNode* other_node, @@ -597,7 +602,7 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/b std::unique_ptr owned_titled_url_index() { return std::move(titled_url_index_); -@@ -119,6 +120,8 @@ class BookmarkLoadDetails { +@@ -112,6 +113,8 @@ class BookmarkLoadDetails { nullptr; raw_ptr mobile_folder_node_ = nullptr; @@ -609,7 +614,7 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/b 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 -@@ -845,7 +845,7 @@ bool BookmarkModel::HasBookmarks() const { +@@ -829,7 +829,7 @@ bool BookmarkModel::HasBookmarks() const { bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return bookmark_bar_node_->children().empty() && @@ -618,20 +623,20 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar } bool BookmarkModel::IsBookmarked(const GURL& url) const { -@@ -1155,6 +1155,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr details) { +@@ -1166,6 +1166,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr 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(client_.get())); + // TODO(crbug.com/1494120): Load nodes for account storage as well. + 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 -@@ -132,6 +132,12 @@ class BookmarkModel final : public BookmarkUndoProvider, - return mobile_node_; - } +@@ -159,6 +159,12 @@ class BookmarkModel final : public BookmarkUndoProvider, + // bookmarks in the account storage). + const BookmarkNode* account_mobile_node() const; + // Returns the 'mobile' node. This is NULL until loaded. + const BookmarkNode* tabs_collection_node() const { @@ -642,10 +647,10 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark bool is_root_node(const BookmarkNode* node) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return node == root_; -@@ -495,6 +501,7 @@ class BookmarkModel final : public BookmarkUndoProvider, - nullptr; - raw_ptr mobile_node_ = - nullptr; +@@ -528,6 +534,7 @@ class BookmarkModel final : public BookmarkUndoProvider, + raw_ptr account_bookmark_bar_node_ = nullptr; + raw_ptr account_other_node_ = nullptr; + raw_ptr account_mobile_node_ = nullptr; + raw_ptr tabs_collection_node_ = nullptr; // The maximum ID assigned to the bookmark nodes in the model. @@ -653,7 +658,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark 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 -@@ -239,6 +239,17 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id, +@@ -189,6 +189,17 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id, visible_when_empty)); } @@ -682,7 +687,7 @@ diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks MOBILE }; -@@ -259,6 +260,9 @@ class BookmarkPermanentNode : public BookmarkNode { +@@ -246,6 +247,9 @@ class BookmarkPermanentNode : public BookmarkNode { static std::unique_ptr CreateMobileBookmarks( int64_t id, bool visible_when_empty); @@ -732,7 +737,7 @@ diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks 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 -@@ -447,6 +447,7 @@ sync_pb::BookmarkSpecifics::Type GetProtoTypeFromBookmarkNode( +@@ -445,6 +445,7 @@ sync_pb::BookmarkSpecifics::Type GetProtoTypeFromBookmarkNode( case bookmarks::BookmarkNode::BOOKMARK_BAR: case bookmarks::BookmarkNode::OTHER_NODE: case bookmarks::BookmarkNode::MOBILE: @@ -741,4 +746,3 @@ diff --git a/components/sync_bookmarks/bookmark_specifics_conversions.cc b/compo return sync_pb::BookmarkSpecifics::FOLDER; } -- -2.25.1 diff --git a/build/bromite_patches/Add-menu-item-to-view-source.patch b/build/cromite_patches/Add-menu-item-to-view-source.patch similarity index 94% rename from build/bromite_patches/Add-menu-item-to-view-source.patch rename to build/cromite_patches/Add-menu-item-to-view-source.patch index 279633b2feca1db736afe1ead37b3a51a1381944..711552f3c641c97552504f0485a388488e907e12 100644 --- a/build/bromite_patches/Add-menu-item-to-view-source.patch +++ b/build/cromite_patches/Add-menu-item-to-view-source.patch @@ -42,7 +42,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re 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 -@@ -2319,6 +2319,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2722,6 +2722,11 @@ public abstract class ChromeActivity return doOpenWebApk(currentTab); } @@ -69,7 +69,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv 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 -@@ -550,6 +550,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -578,6 +578,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate isChromeScheme, isFileScheme, isContentScheme, isIncognito, url)); updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isChromeScheme); @@ -77,7 +77,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App updateAutoDarkMenuItem(menu, currentTab, isChromeScheme); -@@ -1142,6 +1143,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -1181,6 +1182,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } } @@ -104,7 +104,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App 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 -@@ -241,6 +241,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat +@@ -260,6 +260,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat updateRequestDesktopSiteMenuItem( menu, currentTab, requestDesktopSiteVisible, isChromeScheme); @@ -115,7 +115,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust 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 -@@ -314,6 +314,10 @@ CHAR_LIMIT guidelines: +@@ -317,6 +317,10 @@ CHAR_LIMIT guidelines: USB @@ -127,4 +127,3 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro You and Google -- -2.25.1 diff --git a/build/bromite_patches/Add-option-to-force-tablet-UI.patch b/build/cromite_patches/Add-option-to-force-tablet-UI.patch similarity index 71% rename from build/bromite_patches/Add-option-to-force-tablet-UI.patch rename to build/cromite_patches/Add-option-to-force-tablet-UI.patch index aeebeba663b5ad9f76f040f3c91153d532d12804..dd9be165b77d32fca593bbcea94d3f04687de649 100644 --- a/build/bromite_patches/Add-option-to-force-tablet-UI.patch +++ b/build/cromite_patches/Add-option-to-force-tablet-UI.patch @@ -5,19 +5,20 @@ Subject: Add option to force tablet UI License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- .../ChromeAccessibilitySettingsDelegate.java | 19 +++++++++++++++++++ + .../browser/tasks/ReturnToChromeUtil.java | 4 +++- .../chrome/browser/ui/RootUiCoordinator.java | 5 ++++- + chrome/browser/preferences/BUILD.gn | 1 + .../preferences/ChromePreferenceKeys.java | 1 + + .../preferences/ChromeSharedPreferences.java | 8 ++++++++ .../LegacyChromePreferenceKeys.java | 1 + .../omnibox/LocationBarCoordinator.java | 2 +- .../strings/android_chrome_strings.grd | 7 +++++++ - .../toolbar/top/ToolbarControlContainer.java | 5 ++--- components/BUILD.gn | 6 +++--- .../res/xml/accessibility_preferences.xml | 5 +++++ .../accessibility/AccessibilitySettings.java | 10 ++++++++++ .../AccessibilitySettingsDelegate.java | 2 ++ - ui/android/BUILD.gn | 2 ++ - .../chromium/ui/base/DeviceFormFactor.java | 5 +++++ - 13 files changed, 62 insertions(+), 8 deletions(-) + .../chromium/ui/base/DeviceFormFactor.java | 6 ++++++ + 14 files changed, 71 insertions(+), 6 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java @@ -29,13 +30,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s + private static class ForceTabletUIDelegate implements BooleanPreferenceDelegate { + @Override + public boolean isEnabled() { -+ return SharedPreferencesManager.getInstance().readBoolean( ++ return ChromeSharedPreferences.getInstance().readBoolean( + ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false); + } + + @Override + public void setEnabled(boolean value) { -+ SharedPreferencesManager.getInstance().writeBoolean( ++ ChromeSharedPreferences.getInstance().writeBoolean( + ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, value); + } + } @@ -48,32 +49,57 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s @Override public void addExtraPreferences(PreferenceFragmentCompat fragment) { if (ImageDescriptionsController.getInstance().shouldShowImageDescriptionsMenuItem()) { +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java +@@ -987,7 +987,9 @@ public final class ReturnToChromeUtil { + + public static boolean isScrollableMvtEnabled(Context context) { + boolean isSurfacePolishEnabled = ChromeFeatureList.sSurfacePolish.isEnabled(); +- if (!DeviceFormFactor.isNonMultiDisplayContextOnTablet(context)) { ++ if (!DeviceFormFactor.isNonMultiDisplayContextOnTablet(context) || ++ ChromeSharedPreferences.getInstance().readBoolean( ++ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false)) { + // On phones, parameter SURFACE_POLISH_SCROLLABLE_MVT is checked when feature flag + // surface polish is enabled; otherwise, feature flag + // SHOW_SCROLLABLE_MVT_ON_NTP_PHONE_ANDROID is checked. 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 -@@ -100,6 +100,7 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; +@@ -98,6 +98,7 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher; - import org.chromium.chrome.browser.preferences.SharedPreferencesManager; + import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.price_tracking.PriceTrackingButtonController; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.quick_delete.QuickDeleteController; -@@ -1444,7 +1445,9 @@ public class RootUiCoordinator +@@ -1588,7 +1589,9 @@ public class RootUiCoordinator if (!mSupportsFindInPageSupplier.getAsBoolean()) return; int stubId = R.id.find_toolbar_stub; - if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)) { + if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity) && -+ !SharedPreferencesManager.getInstance().readBoolean( ++ !ChromeSharedPreferences.getInstance().readBoolean( + ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false)) { stubId = R.id.find_toolbar_tablet_stub; } - mFindToolbarManager = new FindToolbarManager(mActivity.findViewById(stubId), + mFindToolbarManager = +diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BUILD.gn +--- a/chrome/browser/preferences/BUILD.gn ++++ b/chrome/browser/preferences/BUILD.gn +@@ -25,6 +25,7 @@ android_library("java") { + "//components/browser_ui/site_settings/android:constants_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/jni_zero:jni_zero_java", ++ "//ui/android:ui_java", + ] + + srcjar_deps = [ 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 -@@ -355,6 +355,7 @@ public final class ChromePreferenceKeys { +@@ -310,6 +310,7 @@ public final class ChromePreferenceKeys { AccessibilityConstants.FONT_USER_SET_FORCE_ENABLE_ZOOM; public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info"; @@ -81,12 +107,37 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro /** Keys used to save settings related to homepage. */ public static final String DEPRECATED_HOMEPAGE_CUSTOM_URI = "homepage_custom_uri"; +diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java +--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java ++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java +@@ -11,6 +11,8 @@ import org.chromium.base.shared_preferences.PreferenceKeyRegistry; + import org.chromium.base.shared_preferences.SharedPreferencesManager; + import org.chromium.build.BuildConfig; + ++import org.chromium.ui.base.DeviceFormFactor; ++ + @JNINamespace("android::shared_preferences") + public class ChromeSharedPreferences { + public static final PreferenceKeyRegistry REGISTRY = +@@ -22,6 +24,12 @@ public class ChromeSharedPreferences { + LegacyChromePreferenceKeys.getPrefixesInUse()) + : null); + ++ static { ++ DeviceFormFactor.setForceTabletUI( ++ ChromeSharedPreferences.getInstance().readBoolean( ++ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false)); ++ } ++ + /** + * @return The //base SharedPreferencesManager singleton. + */ 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 -@@ -64,6 +64,7 @@ public class LegacyChromePreferenceKeys { - ChromePreferenceKeys.FLAGS_CACHED_START_SURFACE_ENABLED, - ChromePreferenceKeys.FLAGS_CACHED_TAB_GROUPS_ANDROID_ENABLED, +@@ -58,6 +58,7 @@ public class LegacyChromePreferenceKeys { + ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE, + ChromePreferenceKeys.FIRST_RUN_SKIP_WELCOME_PAGE, ChromePreferenceKeys.FONT_USER_FONT_SCALE_FACTOR, + ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, ChromePreferenceKeys.FONT_USER_SET_FORCE_ENABLE_ZOOM, @@ -95,7 +146,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro 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 -@@ -691,7 +691,7 @@ public class LocationBarCoordinator +@@ -777,7 +777,7 @@ public class LocationBarCoordinator } private boolean isTabletWindow() { @@ -107,8 +158,8 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow 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 -@@ -1765,6 +1765,13 @@ Your Google account may have other forms of browsing history like searches and a - Protection from trackers (third-party cookies, IP tracking, invasive scripts, and more) +@@ -1561,6 +1561,13 @@ Your Google account may have other forms of browsing history like searches and a + Manage third-party cookies and tracking protections + @@ -121,25 +172,10 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Safety check -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 -@@ -166,9 +166,8 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con - - return backgroundDrawable; - } else { -- final Drawable backgroundDrawable = -- AppCompatResources.getDrawable(getContext(), R.drawable.toolbar_background) -- .mutate(); -+ Drawable backgroundDrawable = new ColorDrawable( -+ ChromeColors.getPrimaryBackgroundColor(getContext(), incognito)); - backgroundDrawable.setTint(ChromeColors.getDefaultThemeColor(getContext(), incognito)); - backgroundDrawable.setTintMode(PorterDuff.Mode.MULTIPLY); - diff --git a/components/BUILD.gn b/components/BUILD.gn --- a/components/BUILD.gn +++ b/components/BUILD.gn -@@ -71,7 +71,7 @@ if (is_ios) { +@@ -68,7 +68,7 @@ if (is_ios) { # Omit Lacros because it allows //components to depend on //chrome, which in # turn depends on //extensions. @@ -148,7 +184,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn disallowed_extension_deps_ = [ # Components should largely not depend on //extensions. Since // extensions # is not a component target and is linked with //chrome, depending on most -@@ -817,7 +817,7 @@ test("components_unittests") { +@@ -819,7 +819,7 @@ test("components_unittests") { # On other platforms, no components should depend on Chrome. # Since //chrome depends on //extensions, we also only assert_no_deps on # extensions targets for non-lacros builds. @@ -157,7 +193,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn assert_no_deps = [ "//chrome/*" ] assert_no_deps += disallowed_extension_deps_ } -@@ -1103,7 +1103,7 @@ if (use_blink) { +@@ -1107,7 +1107,7 @@ if (use_blink) { # dependency. On other platforms, no components should depend on Chrome. # Since //chrome depends on //extensions, we also only assert_no_deps on # extensions targets for non-lacros builds. @@ -184,7 +220,7 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java --- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java +++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -@@ -33,6 +33,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -31,6 +31,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat public static final String PREF_CAPTIONS = "captions"; public static final String PREF_ZOOM_INFO = "zoom_info"; @@ -193,7 +229,7 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c private TextScalePreference mTextScalePref; private PageZoomPreference mPageZoomDefaultZoomPref; private ChromeSwitchPreference mPageZoomAlwaysShowPref; -@@ -117,6 +119,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -123,6 +125,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat getPreferenceScreen().removePreference(readerForAccessibilityPref); } @@ -204,9 +240,9 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c + forceTabletUiPref.setOnPreferenceChangeListener(this); + Preference captions = findPreference(PREF_CAPTIONS); - captions.setOnPreferenceClickListener(preference -> { - Intent intent = new Intent(Settings.ACTION_CAPTIONING_SETTINGS); -@@ -174,6 +182,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat + captions.setOnPreferenceClickListener( + preference -> { +@@ -182,6 +190,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat mFontSizePrefs.setUserFontScaleFactor((Float) newValue); } else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) { mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue); @@ -218,7 +254,7 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java --- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java +++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java -@@ -60,6 +60,8 @@ public interface AccessibilitySettingsDelegate { +@@ -52,6 +52,8 @@ public interface AccessibilitySettingsDelegate { */ IntegerPreferenceDelegate getTextSizeContrastAccessibilityDelegate(); @@ -227,39 +263,27 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c /** * Allows the embedder to add more preferences to the preference screen. * -diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn ---- a/ui/android/BUILD.gn -+++ b/ui/android/BUILD.gn -@@ -411,6 +411,8 @@ android_library("ui_no_recycler_view_java") { - ":ui_android_features_java", - ":ui_java_resources", - ":ui_utils_java", -+ # dependency for ui_no_recycler_view_java -+ "//chrome/browser/preferences:java", - "//base:base_java", - "//base:jni_java", - "//build/android:build_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 -@@ -12,6 +12,8 @@ import androidx.annotation.VisibleForTesting; - 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; -@@ -62,6 +64,9 @@ public class DeviceFormFactor { +@@ -31,6 +31,11 @@ public class DeviceFormFactor { + /** Matches the value set in res/values-sw720dp/values.xml */ + private static final int SCREEN_BUCKET_LARGET_TABLET = 3; + ++ private static boolean mForceTabletUI; ++ public static void setForceTabletUI(boolean forceTabletUI) { ++ mForceTabletUI = forceTabletUI; ++ } ++ + /** + * Each activity could be on a different display, and this will just tell you whether the + * display associated with the application context is "tablet sized". +@@ -56,6 +61,7 @@ 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; ++ if (mForceTabletUI) return true; return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET; } -- -2.25.1 diff --git a/build/bromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch b/build/cromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch similarity index 89% rename from build/bromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch rename to build/cromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch index c8567cec25a666d11b8b7619ead18d3c651980ac..2d68ac2bc71eb15c48c7d7b0e8cb01a5651c6715 100644 --- a/build/bromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch +++ b/build/cromite_patches/Add-option-to-not-persist-tabs-across-sessions.patch @@ -13,7 +13,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -61,6 +61,11 @@ found in the LICENSE file. +@@ -71,6 +71,11 @@ found in the LICENSE file. android:title="@string/incognito_settings_title" android:summary="@string/incognito_settings_summary" android:fragment="org.chromium.chrome.browser.privacy.settings.IncognitoSettings"/> @@ -22,9 +22,9 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi + android:title="@string/close_tabs_on_exit_title" + android:summary="@string/close_tabs_on_exit_summary" + android:defaultValue="false" /> - diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java @@ -36,7 +36,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.base.IntentUtils; import org.chromium.base.Log; import org.chromium.base.MemoryPressureListener; -@@ -1307,8 +1308,10 @@ public class ChromeTabbedActivity extends ChromeActivity<resetlink>reset sync

<resetlink>reset sync

IMAGE @@ -119,4 +119,3 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro LINK -- -2.25.1 diff --git a/build/bromite_patches/Add-option-to-use-home-page-as-NTP.patch b/build/cromite_patches/Add-option-to-use-home-page-as-NTP.patch similarity index 83% rename from build/bromite_patches/Add-option-to-use-home-page-as-NTP.patch rename to build/cromite_patches/Add-option-to-use-home-page-as-NTP.patch index 9b6f7b16572ac0374fa73f1a2ccdd3cf7ff35517..aea46321f4a4e8b8bab018e0363eec1ce6cf7f15 100644 --- a/build/bromite_patches/Add-option-to-use-home-page-as-NTP.patch +++ b/build/cromite_patches/Add-option-to-use-home-page-as-NTP.patch @@ -39,7 +39,7 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser import java.util.ArrayList; import java.util.List; -@@ -564,9 +566,14 @@ public class TabGridDialogMediator +@@ -615,11 +617,16 @@ public class TabGridDialogMediator assert relatedTabs.size() > 0; @@ -49,16 +49,18 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser + url = gurl != null ? gurl.getSpec() : url; + } Tab parentTabToAttach = relatedTabs.get(relatedTabs.size() - 1); - mTabCreatorManager.getTabCreator(currentTab.isIncognito()) -- .createNewTab(new LoadUrlParams(UrlConstants.NTP_URL), -+ .createNewTab(new LoadUrlParams(url), - TabLaunchType.FROM_TAB_GROUP_UI, parentTabToAttach); + mTabCreatorManager + .getTabCreator(currentTab.isIncognito()) + .createNewTab( +- new LoadUrlParams(UrlConstants.NTP_URL), ++ new LoadUrlParams(url), + TabLaunchType.FROM_TAB_GROUP_UI, + parentTabToAttach); RecordUserAction.record("MobileNewTabOpened." + mComponentName); - }; diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java -@@ -17,6 +17,7 @@ import org.chromium.base.metrics.RecordUserAction; +@@ -18,6 +18,7 @@ import org.chromium.base.supplier.LazyOneshotSupplier; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.base.supplier.OneshotSupplier; @@ -66,21 +68,23 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser import org.chromium.chrome.browser.layouts.LayoutStateProvider; import org.chromium.chrome.browser.layouts.LayoutStateProvider.LayoutStateObserver; import org.chromium.chrome.browser.layouts.LayoutType; -@@ -345,8 +346,13 @@ public class TabGroupUiMediator implements BackPressHandler { - assert relatedTabs.size() > 0; +@@ -371,10 +372,15 @@ public class TabGroupUiMediator implements BackPressHandler { + assert relatedTabs.size() > 0; - parentTabToAttach = relatedTabs.get(relatedTabs.size() - 1); -+ String url = UrlConstants.NTP_URL; -+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) { -+ GURL gurl = HomepageManager.getInstance().getHomepageGurl(); -+ url = gurl != null ? gurl.getSpec() : url; -+ } - mTabCreatorManager.getTabCreator(currentTab.isIncognito()) -- .createNewTab(new LoadUrlParams(UrlConstants.NTP_URL), -+ .createNewTab(new LoadUrlParams(url), - TabLaunchType.FROM_TAB_GROUP_UI, parentTabToAttach); - RecordUserAction.record("MobileNewTabOpened." + TabGroupUiCoordinator.COMPONENT_NAME); - }; + parentTabToAttach = relatedTabs.get(relatedTabs.size() - 1); ++ String url = UrlConstants.NTP_URL; ++ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) { ++ GURL gurl = HomepageManager.getInstance().getHomepageGurl(); ++ url = gurl != null ? gurl.getSpec() : url; ++ } + mTabCreatorManager + .getTabCreator(currentTab.isIncognito()) + .createNewTab( +- new LoadUrlParams(UrlConstants.NTP_URL), ++ new LoadUrlParams(url), + TabLaunchType.FROM_TAB_GROUP_UI, + parentTabToAttach); + RecordUserAction.record( diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml --- a/chrome/android/java/res/xml/homepage_preferences.xml +++ b/chrome/android/java/res/xml/homepage_preferences.xml @@ -99,7 +103,7 @@ diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/andro 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 -@@ -238,6 +238,22 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat +@@ -233,6 +233,22 @@ public class HomepageManager notifyHomepageUpdated(); } @@ -131,9 +135,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settin import org.chromium.url.GURL; +import org.chromium.components.embedder_support.util.UrlConstants; - /** - * Fragment that allows the user to configure homepage related preferences. -@@ -32,6 +33,8 @@ public class HomepageSettings extends ChromeBaseSettingsFragment { + /** Fragment that allows the user to configure homepage related preferences. */ + public class HomepageSettings extends ChromeBaseSettingsFragment { +@@ -30,6 +31,8 @@ public class HomepageSettings extends ChromeBaseSettingsFragment { @VisibleForTesting public static final String PREF_HOMEPAGE_RADIO_GROUP = "homepage_radio_group"; @@ -142,8 +146,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settin private HomepageManager mHomepageManager; private RadioButtonGroupHomepagePreference mRadioButtons; -@@ -65,6 +68,15 @@ public class HomepageSettings extends ChromeBaseSettingsFragment { - }); +@@ -64,6 +67,15 @@ public class HomepageSettings extends ChromeBaseSettingsFragment { + }); mRadioButtons.setupPreferenceValues(createPreferenceValuesForRadioGroup()); + ChromeSwitchPreference mNTPIsHomepageSwitch = @@ -161,26 +165,26 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settin diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java -@@ -103,7 +103,6 @@ public class LaunchMetrics { +@@ -112,7 +112,6 @@ public class LaunchMetrics { public static void recordHomePageLaunchMetrics( boolean showHomeButton, boolean homepageIsNtp, GURL homepageGurl) { if (homepageGurl.isEmpty()) { - assert !showHomeButton : "Homepage should be disabled for an empty GURL"; } - LaunchMetricsJni.get().recordHomePageLaunchMetrics( - showHomeButton, homepageIsNtp, homepageGurl); + LaunchMetricsJni.get() + .recordHomePageLaunchMetrics(showHomeButton, homepageIsNtp, homepageGurl); 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 -@@ -27,6 +27,7 @@ import org.chromium.chrome.browser.compositor.CompositorViewHolder; +@@ -24,6 +24,7 @@ import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingTask; + import org.chromium.chrome.browser.compositor.CompositorViewHolder; import org.chromium.chrome.browser.flags.ChromeFeatureList; - import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.new_tab_url.DseNewTabUrlManager; +import org.chromium.chrome.browser.homepage.HomepageManager; import org.chromium.chrome.browser.ntp.NewTabPageLaunchOrigin; import org.chromium.chrome.browser.ntp.NewTabPageUtils; import org.chromium.chrome.browser.prefetch.settings.PreloadPagesSettingsBridge; -@@ -502,6 +503,13 @@ public class ChromeTabCreator extends TabCreator { +@@ -484,6 +485,13 @@ public class ChromeTabCreator extends TabCreator { * @return the created tab. */ public Tab launchUrl(String url, @TabLaunchType int type, Intent intent, long intentTimestamp) { @@ -197,18 +201,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/Chrome 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 -@@ -367,6 +367,7 @@ public final class ChromePreferenceKeys { +@@ -323,6 +323,7 @@ public final class ChromePreferenceKeys { public static final String HOMEPAGE_USE_CHROME_NTP = "Chrome.Homepage.UseNTP"; public static final String HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled"; + public static final String HOMEPAGE_NTP_IS_HOMEPAGE = "newtabpage_is_homepage"; - /** - * Key used to save homepage location set by enterprise policy - */ + /** Key used to save homepage location set by enterprise policy */ + public static final String DEPRECATED_HOMEPAGE_LOCATION_POLICY = + "Chrome.Policy.HomepageLocation"; 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 -@@ -68,6 +68,7 @@ public class LegacyChromePreferenceKeys { +@@ -62,6 +62,7 @@ public class LegacyChromePreferenceKeys { ChromePreferenceKeys.HISTORY_SHOW_HISTORY_INFO, ChromePreferenceKeys.HOMEPAGE_ENABLED, ChromePreferenceKeys.HOMEPAGE_USE_DEFAULT_URI, @@ -219,7 +223,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro 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 -@@ -1540,6 +1540,9 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1334,6 +1334,9 @@ Your Google account may have other forms of browsing history like searches and a Last hour @@ -244,7 +248,7 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -1283,6 +1283,10 @@ inline constexpr char kUsedPolicyCertificates[] = +@@ -1311,6 +1311,10 @@ inline constexpr char kUsedPolicyCertificates[] = // visible on the toolbar. inline constexpr char kShowHomeButton[] = "browser.show_home_button"; @@ -256,4 +260,3 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h // The old key value is kept to avoid unnecessary migration code. inline constexpr char kSpeechRecognitionFilterProfanities[] = -- -2.25.1 diff --git a/build/bromite_patches/Add-search-engine.patch b/build/cromite_patches/Add-search-engine.patch similarity index 97% rename from build/bromite_patches/Add-search-engine.patch rename to build/cromite_patches/Add-search-engine.patch index 6910720b50615b80c411c3c089710bfe25b63a1e..f3562c93b09de9e2d9278b2d569fe9be71290bad 100644 --- a/build/bromite_patches/Add-search-engine.patch +++ b/build/cromite_patches/Add-search-engine.patch @@ -76,7 +76,7 @@ diff --git a/components/search_engines/search_engine_type.h b/components/search_ 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 -@@ -56,6 +56,7 @@ struct EngineAndTier { +@@ -61,6 +61,7 @@ struct EngineAndTier { // Default (for countries with no better engine set) constexpr EngineAndTier engines_default[] = { @@ -84,7 +84,7 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon {SearchEngineTier::kTopEngines, &google}, {SearchEngineTier::kTopEngines, &bing}, {SearchEngineTier::kTopEngines, &yahoo}, -@@ -1608,6 +1609,8 @@ const std::vector GetPrepopulationSetFromCountryID( +@@ -1613,6 +1614,8 @@ const std::vector GetPrepopulationSetFromCountryID( for (size_t i = 0; i < num_engines; i++) { t_url.push_back(engines[i]); } @@ -94,4 +94,3 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon } -- -2.25.1 diff --git a/build/bromite_patches/Add-site-engagement-flag.patch b/build/cromite_patches/Add-site-engagement-flag.patch similarity index 71% rename from build/bromite_patches/Add-site-engagement-flag.patch rename to build/cromite_patches/Add-site-engagement-flag.patch index f9105f723f765fdaf37dcb273845425e57bb6245..667d1b17160aee74e68035f9d6562589fce29b6f 100644 --- a/build/bromite_patches/Add-site-engagement-flag.patch +++ b/build/cromite_patches/Add-site-engagement-flag.patch @@ -8,12 +8,14 @@ Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/browser/about_flags.cc | 1 + + .../internal/tracker_impl.cc | 3 ++ + .../public/feature_configurations.cc | 7 ++++ .../content/site_engagement_score.cc | 5 +++ components/site_engagement/core/BUILD.gn | 6 ++++ components/site_engagement/core/features.cc | 30 ++++++++++++++++ components/site_engagement/core/features.h | 34 +++++++++++++++++++ .../Add-site-engagement-flag.inc | 10 ++++++ - 6 files changed, 86 insertions(+) + 8 files changed, 96 insertions(+) create mode 100644 components/site_engagement/core/features.cc create mode 100644 components/site_engagement/core/features.h create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc @@ -21,14 +23,58 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -148,6 +148,7 @@ - #include "components/segmentation_platform/public/features.h" +@@ -152,6 +152,7 @@ #include "components/send_tab_to_self/features.h" #include "components/services/heap_profiling/public/cpp/switches.h" + #include "components/services/storage/public/cpp/buckets/bucket_info.h" +#include "components/site_engagement/core/features.h" #include "components/shared_highlighting/core/common/shared_highlighting_features.h" #include "components/signin/core/browser/dice_account_reconcilor_delegate.h" #include "components/signin/public/base/signin_buildflags.h" +diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc +--- a/components/feature_engagement/internal/tracker_impl.cc ++++ b/components/feature_engagement/internal/tracker_impl.cc +@@ -22,6 +22,7 @@ + #include "base/task/single_thread_task_runner.h" + #include "base/time/clock.h" + #include "build/build_config.h" ++#include "components/site_engagement/core/features.h" + #include "components/feature_engagement/internal/availability_model_impl.h" + #include "components/feature_engagement/internal/blocked_iph_features.h" + #include "components/feature_engagement/internal/chrome_variations_configuration.h" +@@ -187,6 +188,8 @@ TrackerImpl::TrackerImpl( + TrackerImpl::~TrackerImpl() = default; + + void TrackerImpl::NotifyEvent(const std::string& event) { ++ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) ++ return; + event_model_->IncrementEvent(event, time_provider_->GetCurrentDay()); + stats::RecordNotifyEvent(event, configuration_.get(), + event_model_->IsReady()); +diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc +--- a/components/feature_engagement/public/feature_configurations.cc ++++ b/components/feature_engagement/public/feature_configurations.cc +@@ -6,6 +6,7 @@ + + #include "base/strings/string_util.h" + #include "build/build_config.h" ++#include "components/site_engagement/core/features.h" + #include "components/feature_engagement/public/configuration.h" + #include "components/feature_engagement/public/event_constants.h" + #include "components/feature_engagement/public/feature_constants.h" +@@ -66,6 +67,12 @@ absl::optional GetClientSideFeatureConfig( + } + + #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) ++ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) { ++ absl::optional config = FeatureConfig(); ++ config->valid = false; ++ return config; ++ } ++ + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_CHROMEOS) + if (kIPHPasswordsAccountStorageFeature.name == feature->name) { diff --git a/components/site_engagement/content/site_engagement_score.cc b/components/site_engagement/content/site_engagement_score.cc --- a/components/site_engagement/content/site_engagement_score.cc +++ b/components/site_engagement/content/site_engagement_score.cc @@ -159,4 +205,3 @@ new file mode 100644 + +#endif -- -2.25.1 diff --git a/build/bromite_patches/Add-support-for-ISupportHelpAndFeedback.patch b/build/cromite_patches/Add-support-for-ISupportHelpAndFeedback.patch similarity index 85% rename from build/bromite_patches/Add-support-for-ISupportHelpAndFeedback.patch rename to build/cromite_patches/Add-support-for-ISupportHelpAndFeedback.patch index e9b9026e24af04c858afc806bf74164517ee27a4..56f129f954e8bbb73d4eba3533fda4f8d47b5870 100644 --- a/build/bromite_patches/Add-support-for-ISupportHelpAndFeedback.patch +++ b/build/cromite_patches/Add-support-for-ISupportHelpAndFeedback.patch @@ -12,25 +12,25 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -86,6 +86,7 @@ import org.chromium.components.browser_ui.settings.CustomDividerFragment; +@@ -85,6 +85,7 @@ import org.chromium.components.browser_ui.settings.CustomDividerFragment; import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher; - import org.chromium.components.browser_ui.settings.PaddedDividerItemDecoration; + import org.chromium.components.browser_ui.settings.PaddedItemDecorationWithDivider; import org.chromium.components.browser_ui.settings.SettingsLauncher; +import org.chromium.components.browser_ui.settings.SettingsUtils; - import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.browser_ui.site_settings.BaseSiteSettingsFragment; + import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.browser_ui.util.TraceEventVectorDrawableCompat; -@@ -417,8 +418,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -454,8 +455,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity finish(); return true; } else if (item.getItemId() == R.id.menu_id_general_help) { -- HelpAndFeedbackLauncherImpl.getForProfile(mProfile).show( -- this, getString(R.string.help_context_settings), null); +- HelpAndFeedbackLauncherImpl.getForProfile(mProfile) +- .show(this, getString(R.string.help_context_settings), null); + if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) { + ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed(); + } else { -+ HelpAndFeedbackLauncherImpl.getForProfile(mProfile).show( -+ this, getString(R.string.help_context_settings), null); ++ HelpAndFeedbackLauncherImpl.getForProfile(mProfile) ++ .show(this, getString(R.string.help_context_settings), null); + } return true; } @@ -38,7 +38,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin 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 -@@ -97,4 +97,8 @@ public class SettingsUtils { +@@ -91,4 +91,8 @@ public class SettingsUtils { ToolbarUtils.setOverflowMenuVisibility(toolbar, visibility); return true; } @@ -48,4 +48,3 @@ diff --git a/components/browser_ui/settings/android/java/src/org/chromium/compon + } } -- -2.25.1 diff --git a/build/bromite_patches/Add-support-for-writing-URIs.patch b/build/cromite_patches/Add-support-for-writing-URIs.patch similarity index 92% rename from build/bromite_patches/Add-support-for-writing-URIs.patch rename to build/cromite_patches/Add-support-for-writing-URIs.patch index 9122d43c06df39aa6d589d66416f178e8c3433ff..4b3ba99fd66c04e2e2b8bd8eef4fd424bd6f411b 100644 --- a/build/bromite_patches/Add-support-for-writing-URIs.patch +++ b/build/cromite_patches/Add-support-for-writing-URIs.patch @@ -49,17 +49,17 @@ diff --git a/base/android/content_uri_utils.h b/base/android/content_uri_utils.h diff --git a/base/android/java/src/org/chromium/base/ContentUriUtils.java b/base/android/java/src/org/chromium/base/ContentUriUtils.java --- a/base/android/java/src/org/chromium/base/ContentUriUtils.java +++ b/base/android/java/src/org/chromium/base/ContentUriUtils.java -@@ -23,6 +23,9 @@ import org.chromium.base.annotations.CalledByNative; +@@ -23,6 +23,9 @@ import org.jni_zero.CalledByNative; import java.io.File; import java.io.IOException; +import android.system.Os; +import android.content.ContentProviderClient; + - /** - * This class provides methods to access content URI schemes. - */ -@@ -89,6 +92,36 @@ public abstract class ContentUriUtils { + /** This class provides methods to access content URI schemes. */ + public abstract class ContentUriUtils { + private static final String TAG = "ContentUriUtils"; +@@ -87,6 +90,36 @@ public abstract class ContentUriUtils { return -1; } @@ -97,4 +97,3 @@ diff --git a/base/android/java/src/org/chromium/base/ContentUriUtils.java b/base * Check whether a content URI exists. * -- -2.25.1 diff --git a/build/bromite_patches/Add-webGL-site-setting.patch b/build/cromite_patches/Add-webGL-site-setting.patch similarity index 95% rename from build/bromite_patches/Add-webGL-site-setting.patch rename to build/cromite_patches/Add-webGL-site-setting.patch index 5a69ec9a8cf7dd6339f3da974b61fbebc4e99353..db26b62d7e09539e177fd458cbad2b0644b7b28d 100644 --- a/build/bromite_patches/Add-webGL-site-setting.patch +++ b/build/cromite_patches/Add-webGL-site-setting.patch @@ -9,7 +9,7 @@ Requires patch: Content-settings-infrastructure.patch Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../impl/BromiteWebGLContentSetting.java | 92 +++++++++++++++++++ + .../impl/BromiteWebGLContentSetting.java | 93 +++++++++++++++++++ .../bromite_content_settings/webgl.grdp | 27 ++++++ .../bromite_content_settings/webgl.inc | 22 +++++ .../common/bromite_content_settings/WEBGL.inc | 1 + @@ -17,7 +17,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../execution_context/execution_context.h | 2 + .../webgl/webgl_rendering_context_base.cc | 32 +++---- .../webgl/webgl_rendering_context_base.h | 2 + - 8 files changed, 166 insertions(+), 19 deletions(-) + 8 files changed, 167 insertions(+), 19 deletions(-) create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java create mode 100644 components/browser_ui/strings/bromite_content_settings/webgl.grdp create mode 100644 components/content_settings/core/browser/bromite_content_settings/webgl.inc @@ -27,7 +27,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c new file mode 100644 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java -@@ -0,0 +1,92 @@ +@@ -0,0 +1,93 @@ +/* + This file is part of Bromite. + @@ -80,7 +80,8 @@ new file mode 100644 + /*defaultEnabledValue*/ getDefaultEnabledValue(), + /*defaultDisabledValue*/ getDefaultDisabledValue(), + /*enabledSummary*/ R.string.website_settings_category_webgl_enabled, -+ /*disabledSummary*/ R.string.website_settings_category_webgl_disabled); ++ /*disabledSummary*/ R.string.website_settings_category_webgl_disabled, ++ /*summaryOverrideForScreenReader*/ 0); + } + + @Override @@ -205,7 +206,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h --- a/third_party/blink/renderer/core/execution_context/execution_context.h +++ b/third_party/blink/renderer/core/execution_context/execution_context.h -@@ -116,6 +116,8 @@ enum ReasonForCallingCanExecuteScripts { +@@ -115,6 +115,8 @@ enum ReasonForCallingCanExecuteScripts { enum ReferrerPolicySource { kPolicySourceHttpHeader, kPolicySourceMetaTag }; @@ -217,7 +218,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -248,6 +248,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits( +@@ -309,6 +309,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits( } } @@ -231,7 +232,7 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba unsigned WebGLRenderingContextBase::CurrentMaxGLContexts() { base::AutoLock locker(WebGLContextLimitLock()); DCHECK(webgl_context_limits_initialized_); -@@ -521,25 +528,6 @@ static String ExtractWebGLContextCreationError( +@@ -582,25 +589,6 @@ static String ExtractWebGLContextCreationError( const Platform::GraphicsInfo& info) { StringBuilder builder; builder.Append("Could not create a WebGL context"); @@ -257,7 +258,7 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba FormatWebGLStatusString("ErrorMessage", info.error_message.Utf8().c_str(), builder); builder.Append('.'); -@@ -599,6 +587,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider( +@@ -660,6 +648,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider( const CanvasContextCreationAttributesCore& attributes, Platform::ContextType context_type, Platform::GraphicsInfo* graphics_info) { @@ -273,14 +274,13 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h -@@ -1937,6 +1937,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, +@@ -1952,6 +1952,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, DOMArrayBufferView* pixels, int64_t offset); + static bool AllowWebglForHost(blink::CanvasRenderingContextHost* host); + - // Record Canvas/OffscreenCanvas.RenderingContextDrawnTo at the first draw - // call. - void RecordUKMCanvasDrawnToAtFirstDrawCall(); + void RecordANGLEImplementation(); + + private: -- -2.25.1 diff --git a/build/bromite_patches/Add-webRTC-site-settings.patch b/build/cromite_patches/Add-webRTC-site-settings.patch similarity index 97% rename from build/bromite_patches/Add-webRTC-site-settings.patch rename to build/cromite_patches/Add-webRTC-site-settings.patch index 5fc32e931d4ef94bb858d4d97415c28c0b5354ba..b1dd0017e8951d093ebcbd1a0dbc2aaad0cf9e11 100644 --- a/build/bromite_patches/Add-webRTC-site-settings.patch +++ b/build/cromite_patches/Add-webRTC-site-settings.patch @@ -7,14 +7,14 @@ Requires patch: Content-settings-infrastructure.patch Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../impl/BromiteWebRTCContentSetting.java | 93 +++++++++++++++++++ + .../impl/BromiteWebRTCContentSetting.java | 94 +++++++++++++++++++ .../bromite_content_settings/webrtc.grdp | 27 ++++++ .../bromite_content_settings/webrtc.inc | 22 +++++ .../bromite_content_settings/WEBRTC.inc | 1 + .../peer_connection_dependency_factory.cc | 6 ++ .../peerconnection/rtc_rtp_receiver.cc | 10 ++ .../modules/peerconnection/rtc_rtp_sender.cc | 10 ++ - 7 files changed, 169 insertions(+) + 7 files changed, 170 insertions(+) create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java create mode 100644 components/browser_ui/strings/bromite_content_settings/webrtc.grdp create mode 100644 components/content_settings/core/browser/bromite_content_settings/webrtc.inc @@ -24,7 +24,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c new file mode 100644 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java -@@ -0,0 +1,93 @@ +@@ -0,0 +1,94 @@ +/* + This file is part of Bromite. + @@ -77,7 +77,8 @@ new file mode 100644 + /*defaultEnabledValue*/ getDefaultEnabledValue(), + /*defaultDisabledValue*/ getDefaultDisabledValue(), + /*enabledSummary*/ R.string.website_settings_category_webrtc_enabled, -+ /*disabledSummary*/ R.string.website_settings_category_webrtc_disabled); ++ /*disabledSummary*/ R.string.website_settings_category_webrtc_disabled, ++ /*summaryOverrideForScreenReader*/ 0); + } + + @Override @@ -194,7 +195,7 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_d #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h" #include "third_party/blink/public/web/web_document.h" -@@ -781,6 +782,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator( +@@ -774,6 +775,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator( // origin. WebRTCIPHandlingPolicy policy = GetWebRTCIPHandlingPolicy(webrtc_ip_handling_policy); @@ -218,7 +219,7 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver. #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_rtcp_parameters.h" -@@ -255,6 +257,14 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state, +@@ -287,6 +289,14 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state, if (kind != "audio" && kind != "video") return nullptr; @@ -245,7 +246,7 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_rtcp_parameters.h" -@@ -1004,6 +1006,14 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, +@@ -1034,6 +1036,14 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, if (kind != "audio" && kind != "video") return nullptr; @@ -261,4 +262,3 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc capabilities->setCodecs(HeapVector>()); capabilities->setHeaderExtensions( -- -2.25.1 diff --git a/build/bromite_patches/Allow-building-without-enable_reporting.patch b/build/cromite_patches/Allow-building-without-enable_reporting.patch similarity index 94% rename from build/bromite_patches/Allow-building-without-enable_reporting.patch rename to build/cromite_patches/Allow-building-without-enable_reporting.patch index c0f6ae5c287fae62ac5d9b4e5d8871a4e4fcb191..3f84709967fc5b112546106d907cf99a18ddd5f5 100644 --- a/build/bromite_patches/Allow-building-without-enable_reporting.patch +++ b/build/cromite_patches/Allow-building-without-enable_reporting.patch @@ -20,11 +20,11 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../network/public/mojom/network_context.mojom | 2 ++ .../core/frame/csp/content_security_policy.cc | 3 +++ .../blink/renderer/core/frame/local_frame.cc | 3 +++ - .../blink/renderer/core/frame/local_frame.h | 6 +++--- + .../blink/renderer/core/frame/local_frame.h | 4 +++- .../renderer/core/frame/reporting_context.cc | 9 +++++++++ .../renderer/core/frame/reporting_context.h | 7 +++++-- .../renderer/core/frame/reporting_observer.cc | 3 +-- - 20 files changed, 58 insertions(+), 27 deletions(-) + 20 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Allow-building-without-enable_reporting.inc diff --git a/chrome/browser/net/chrome_report_sender.cc b/chrome/browser/net/chrome_report_sender.cc @@ -41,7 +41,7 @@ diff --git a/chrome/browser/net/chrome_report_sender.cc b/chrome/browser/net/chr diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc -@@ -1314,6 +1314,7 @@ String BuildReportStatus(const net::ReportingReport::Status status) { +@@ -1326,6 +1326,7 @@ String BuildReportStatus(const net::ReportingReport::Status status) { } } @@ -49,7 +49,7 @@ diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/brow std::vector ComputeReportingURLs(RenderFrameHostImpl* frame_host) { std::vector urls; frame_host->ForEachRenderFrameHostWithAction( -@@ -1327,6 +1328,7 @@ std::vector ComputeReportingURLs(RenderFrameHostImpl* frame_host) { +@@ -1339,6 +1340,7 @@ std::vector ComputeReportingURLs(RenderFrameHostImpl* frame_host) { }); return urls; } @@ -183,7 +183,7 @@ diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browse #include "content/browser/service_worker/service_worker_host.h" #include "content/browser/worker_host/dedicated_worker_host.h" #include "content/browser/worker_host/shared_worker_host.h" -@@ -174,12 +175,14 @@ class ReportingServiceProxyImpl : public blink::mojom::ReportingServiceProxy { +@@ -175,12 +176,14 @@ class ReportingServiceProxyImpl : public blink::mojom::ReportingServiceProxy { const std::string& group, const std::string& type, base::Value::Dict body) { @@ -201,7 +201,7 @@ diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browse diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -13489,12 +13489,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport( +@@ -13593,12 +13593,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport( base::Value::Dict body; if (!reason.empty()) body.Set("reason", reason); @@ -254,7 +254,7 @@ new file mode 100644 diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc -@@ -224,6 +224,7 @@ extern const base::FeatureParam kTimeoutTcpConnectAttemptMax( +@@ -227,6 +227,7 @@ extern const base::FeatureParam kTimeoutTcpConnectAttemptMax( base::Seconds(30)); #if BUILDFLAG(ENABLE_REPORTING) @@ -281,7 +281,7 @@ diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_servic diff --git a/services/network/network_context.h b/services/network/network_context.h --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -473,10 +473,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -472,10 +472,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext const absl::optional& reporting_source, const net::NetworkAnonymizationKey& network_anonymization_key, const absl::optional& user_agent, @@ -297,7 +297,7 @@ diff --git a/services/network/network_context.h b/services/network/network_conte diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn -@@ -1427,7 +1427,6 @@ mojom("mojom") { +@@ -1435,7 +1435,6 @@ mojom("mojom") { export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" export_header_blink = "third_party/blink/public/platform/web_common.h" if (enable_reporting) { @@ -308,7 +308,7 @@ diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mo diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1196,6 +1196,7 @@ interface NetworkContext { +@@ -1197,6 +1197,7 @@ interface NetworkContext { // provided |network_isolation_key|. // // Spec: https://w3c.github.io/reporting/#concept-reports @@ -316,7 +316,7 @@ diff --git a/services/network/public/mojom/network_context.mojom b/services/netw QueueReport(string type, string group, url.mojom.Url url, -@@ -1209,6 +1210,7 @@ interface NetworkContext { +@@ -1210,6 +1211,7 @@ interface NetworkContext { // Note that this queued report will never be delivered if no reporting // endpoint matching is registered for with the provided // |network_isolation_key|. @@ -335,7 +335,7 @@ diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.c #include "base/containers/contains.h" #include "base/debug/dump_without_crashing.h" #include "services/network/public/cpp/web_sandbox_flags.h" -@@ -1156,6 +1157,7 @@ void ContentSecurityPolicy::ReportViolation( +@@ -1169,6 +1170,7 @@ void ContentSecurityPolicy::ReportViolation( return; } @@ -343,7 +343,7 @@ diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.c PostViolationReport(violation_data, context_frame, report_endpoints, use_reporting_api); -@@ -1163,6 +1165,7 @@ void ContentSecurityPolicy::ReportViolation( +@@ -1176,6 +1178,7 @@ void ContentSecurityPolicy::ReportViolation( // `context_frame` (i.e. we're not processing 'frame-ancestors'). if (delegate_ && !context_frame) delegate_->DispatchViolationEvent(*violation_data, element); @@ -354,7 +354,7 @@ diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.c 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 -@@ -42,6 +42,7 @@ +@@ -45,6 +45,7 @@ #include "build/build_config.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "mojo/public/cpp/system/message_pipe.h" @@ -362,8 +362,8 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/ #include "services/network/public/cpp/features.h" #include "services/network/public/mojom/content_security_policy.mojom-blink.h" #include "services/network/public/mojom/source_location.mojom-blink.h" -@@ -2502,9 +2503,11 @@ void LocalFrame::MainFrameInteractive() { - } +@@ -2585,9 +2586,11 @@ void LocalFrame::MainFrameInteractive() { + v8_local_compile_hints_producer_->GenerateData(); } +#if BUILDFLAG(ENABLE_REPORTING) @@ -372,34 +372,30 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/ } +#endif - // static - void LocalFrame::NotifyUserActivation( + device::mojom::blink::DevicePostureProvider* + LocalFrame::GetDevicePostureProvider() { 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 -@@ -35,9 +35,9 @@ - #include "base/time/default_tick_clock.h" - #include "base/time/time.h" - #include "base/unguessable_token.h" --#include "build/build_config.h" +@@ -38,6 +38,7 @@ + #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/metrics/public/cpp/ukm_source_id.h" #include "services/network/public/mojom/fetch_api.mojom-blink-forward.h" -@@ -627,9 +627,9 @@ class CORE_EXPORT LocalFrame final +@@ -657,8 +658,9 @@ class CORE_EXPORT LocalFrame final void FinishedScrollSequence(); SmoothScrollSequencer* GetSmoothScrollSequencer() const; - +#if BUILDFLAG(ENABLE_REPORTING) mojom::blink::ReportingServiceProxy* GetReportingService(); -- +#endif + device::mojom::blink::DevicePostureProvider* GetDevicePostureProvider(); + // 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 @@ -512,4 +508,3 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_observer.cc b/third bool ReportingObserver::Buffered() { -- -2.25.1 diff --git a/build/bromite_patches/Allow-building-without-supervised-users.patch b/build/cromite_patches/Allow-building-without-supervised-users.patch similarity index 68% rename from build/bromite_patches/Allow-building-without-supervised-users.patch rename to build/cromite_patches/Allow-building-without-supervised-users.patch index a0737cff6f480cd4cc1ff466c497b18b9875ec13..09f5949f099b8becd4fa25f482bfeb11341c5c45 100644 --- a/build/bromite_patches/Allow-building-without-supervised-users.patch +++ b/build/cromite_patches/Allow-building-without-supervised-users.patch @@ -4,24 +4,27 @@ Subject: Allow building without supervised users License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/android/BUILD.gn | 1 - - chrome/android/chrome_java_sources.gni | 1 - - chrome/browser/BUILD.gn | 6 ------ - .../browser/extensions/api/settings_private/prefs_util.cc | 2 ++ - chrome/browser/profiles/profile_impl.cc | 4 ++++ - chrome/browser/profiles/profile_manager.cc | 4 ++++ - chrome/browser/ui/webui/managed_ui_handler.cc | 2 ++ - .../browser/ui/webui/management/management_ui_handler.cc | 2 ++ - components/supervised_user/buildflags.gni | 6 +----- - components/supervised_user/core/common/pref_names.h | 4 ++++ - .../core/common/supervised_user_constants.cc | 2 ++ - .../supervised_user/core/common/supervised_user_utils.cc | 8 ++++++++ - 12 files changed, 29 insertions(+), 13 deletions(-) + chrome/android/BUILD.gn | 1 - + chrome/android/chrome_java_sources.gni | 1 - + .../chrome/browser/feed/FeedSurfaceCoordinator.java | 5 +---- + chrome/browser/BUILD.gn | 6 ------ + .../extensions/api/settings_private/prefs_util.cc | 2 ++ + chrome/browser/profiles/profile_impl.cc | 4 ++++ + chrome/browser/profiles/profile_manager.cc | 4 ++++ + chrome/browser/ui/webui/managed_ui_handler.cc | 2 ++ + .../browser/ui/webui/management/management_ui_handler.cc | 2 ++ + components/supervised_user/buildflags.gni | 6 +----- + .../core/browser/supervised_user_preferences.cc | 2 +- + components/supervised_user/core/common/features.cc | 1 + + components/supervised_user/core/common/pref_names.h | 4 ++++ + .../core/common/supervised_user_constants.cc | 2 ++ + .../supervised_user/core/common/supervised_user_utils.cc | 9 ++++++--- + 15 files changed, 30 insertions(+), 21 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -3604,7 +3604,6 @@ generate_jni("chrome_jni_headers") { +@@ -3657,7 +3657,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java", "java/src/org/chromium/chrome/browser/suggestions/mostvisited/MostVisitedSites.java", "java/src/org/chromium/chrome/browser/suggestions/mostvisited/MostVisitedSitesBridge.java", @@ -32,7 +35,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn 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 -@@ -1074,7 +1074,6 @@ chrome_java_sources = [ +@@ -1075,7 +1075,6 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/suggestions/tile/TileGroupDelegateImpl.java", "java/src/org/chromium/chrome/browser/suggestions/tile/TileRenderer.java", "java/src/org/chromium/chrome/browser/suggestions/tile/TopSitesTileView.java", @@ -40,10 +43,32 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java "java/src/org/chromium/chrome/browser/survey/ChromeSurveyController.java", "java/src/org/chromium/chrome/browser/sync/SyncErrorNotifier.java", "java/src/org/chromium/chrome/browser/sync/TrustedVaultClient.java", +diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +--- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java ++++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +@@ -69,7 +69,6 @@ import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; + import org.chromium.components.feature_engagement.EventConstants; + import org.chromium.components.feature_engagement.Tracker; + import org.chromium.components.prefs.PrefService; +-import org.chromium.components.supervised_user.SupervisedUserPreferences; + import org.chromium.components.user_prefs.UserPrefs; + import org.chromium.third_party.android.swiperefresh.SwipeRefreshLayout; + import org.chromium.ui.base.DeviceFormFactor; +@@ -848,9 +847,7 @@ public class FeedSurfaceCoordinator + * Returns true if the supervised user feed should be displayed. + */ + public boolean shouldDisplaySupervisedFeed() { +- PrefService prefService = UserPrefs.get(mProfile); +- return SupervisedUserPreferences.isSubjectToParentalControls(prefService) +- && ChromeFeatureList.isEnabled(ChromeFeatureList.KID_FRIENDLY_CONTENT_FEED); ++ return false; + } + + /** diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -3182,8 +3182,6 @@ static_library("browser") { +@@ -3161,8 +3161,6 @@ static_library("browser") { "feed/android/refresh_task_scheduler_impl.cc", "feed/android/refresh_task_scheduler_impl.h", "feed/android/web_feed_bridge.cc", @@ -52,7 +77,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "file_select_helper_contacts_android.cc", "file_select_helper_contacts_android.h", "first_run/android/first_run_prefs.cc", -@@ -3398,10 +3396,6 @@ static_library("browser") { +@@ -3381,10 +3379,6 @@ static_library("browser") { "ssl/chrome_security_state_model_delegate.h", "ssl/known_interception_disclosure_infobar.cc", "ssl/known_interception_disclosure_infobar.h", @@ -66,22 +91,22 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc -@@ -1027,9 +1027,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { - settings_api::PrefType::PREF_TYPE_BOOLEAN; +@@ -1001,9 +1001,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { + settings_api::PrefType::kBoolean; #endif +#if BUILDFLAG(ENABLE_SUPERVISED_USERS) // Supervised Users. This setting is queried in our Tast tests (b/241943380). (*s_allowlist)[::prefs::kSupervisedUserExtensionsMayRequestPermissions] = - settings_api::PrefType::PREF_TYPE_BOOLEAN; + settings_api::PrefType::kBoolean; +#endif #if BUILDFLAG(IS_CHROMEOS_LACROS) - (*s_allowlist)[::prefs::kUseAshProxy] = + (*s_allowlist)[::prefs::kUseAshProxy] = settings_api::PrefType::kBoolean; 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 -@@ -691,10 +691,12 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) { +@@ -696,10 +696,12 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) { prefs->SetTime(prefs::kProfileCreationTime, path_creation_time_); pref_change_registrar_.Init(prefs); @@ -94,7 +119,7 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p // Changes in the profile avatar. pref_change_registrar_.Add( -@@ -1614,11 +1616,13 @@ GURL ProfileImpl::GetHomePage() { +@@ -1625,11 +1627,13 @@ GURL ProfileImpl::GetHomePage() { } void ProfileImpl::UpdateSupervisedUserIdInStorage() { @@ -111,7 +136,7 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc -@@ -1219,6 +1219,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { +@@ -1222,6 +1222,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { profile->GetPrefs()->SetString(prefs::kProfileName, profile_name); } @@ -119,7 +144,7 @@ diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profile base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool force_supervised_user_id = #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -1240,6 +1241,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { +@@ -1243,6 +1244,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { profile->GetPrefs()->SetString(prefs::kSupervisedUserId, supervised_user_id); } @@ -127,7 +152,7 @@ diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profile #if !BUILDFLAG(IS_ANDROID) if (profile->IsNewProfile()) { profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, false); -@@ -2035,8 +2037,10 @@ void ProfileManager::AddProfileToStorage(Profile* profile) { +@@ -2046,8 +2048,10 @@ void ProfileManager::AddProfileToStorage(Profile* profile) { init_params.icon_index = profile->GetPrefs()->GetInteger(prefs::kProfileAvatarIndex); @@ -183,6 +208,27 @@ diff --git a/components/supervised_user/buildflags.gni b/components/supervised_u - is_ios || is_linux || is_mac || is_win + enable_supervised_users = false } +diff --git a/components/supervised_user/core/browser/supervised_user_preferences.cc b/components/supervised_user/core/browser/supervised_user_preferences.cc +--- a/components/supervised_user/core/browser/supervised_user_preferences.cc ++++ b/components/supervised_user/core/browser/supervised_user_preferences.cc +@@ -173,7 +173,7 @@ bool IsChildAccountStatusKnown(const PrefService& pref_service) { + } + + bool IsChildAccount(const PrefService& pref_service) { +- return pref_service.GetString(prefs::kSupervisedUserId) == kChildAccountSUID; ++ return false; + } + + bool IsSafeSitesEnabled(const PrefService& pref_service) { +diff --git a/components/supervised_user/core/common/features.cc b/components/supervised_user/core/common/features.cc +--- a/components/supervised_user/core/common/features.cc ++++ b/components/supervised_user/core/common/features.cc +@@ -165,4 +165,5 @@ bool IsShadowKidsApiWithSafeSitesEnabled() { + return base::FeatureList::IsEnabled(kShadowKidsApiWithSafeSites); + } + ++SET_CROMITE_FEATURE_DISABLED(kForceGoogleSafeSearchForSupervisedUsers); + } // namespace supervised_user diff --git a/components/supervised_user/core/common/pref_names.h b/components/supervised_user/core/common/pref_names.h --- a/components/supervised_user/core/common/pref_names.h +++ b/components/supervised_user/core/common/pref_names.h @@ -226,36 +272,22 @@ diff --git a/components/supervised_user/core/common/supervised_user_constants.cc diff --git a/components/supervised_user/core/common/supervised_user_utils.cc b/components/supervised_user/core/common/supervised_user_utils.cc --- a/components/supervised_user/core/common/supervised_user_utils.cc +++ b/components/supervised_user/core/common/supervised_user_utils.cc -@@ -76,11 +76,15 @@ GURL NormalizeUrl(const GURL& url) { +@@ -52,11 +52,14 @@ GURL NormalizeUrl(const GURL& url) { } bool AreWebFilterPrefsDefault(const PrefService& pref_service) { +#if BUILDFLAG(ENABLE_SUPERVISED_USERS) return pref_service .FindPreference(prefs::kDefaultSupervisedUserFilteringBehavior) - ->IsDefaultValue() || - pref_service.FindPreference(prefs::kSupervisedUserSafeSites) - ->IsDefaultValue(); -+#else -+ return true; -+#endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) - } - - bool EmitLogSegmentHistogram(const std::vector& primary_accounts) { -@@ -107,10 +111,14 @@ bool EmitLogSegmentHistogram(const std::vector& primary_accounts) { - } - - bool IsSubjectToParentalControls(const PrefService* pref_service) { -+#if BUILDFLAG(ENABLE_SUPERVISED_USERS) - return pref_service && - pref_service->GetString(prefs::kSupervisedUserId) == - kChildAccountSUID && - IsChildAccountSupervisionEnabled(); +- ->IsDefaultValue() || +- pref_service.FindPreference(prefs::kSupervisedUserSafeSites) +- ->IsDefaultValue(); ++ kChildAccountSUID && ++ IsChildAccountSupervisionEnabled(); +#else + return false; +#endif } - } // namespace supervised_user + absl::optional SupervisionStatusForUser( -- -2.25.1 diff --git a/build/bromite_patches/Allow-playing-audio-in-background.patch b/build/cromite_patches/Allow-playing-audio-in-background.patch similarity index 94% rename from build/bromite_patches/Allow-playing-audio-in-background.patch rename to build/cromite_patches/Allow-playing-audio-in-background.patch index 766d7bb3749288527f836d56b9f8ee9155707a56..f1987a08d6d2e54f1907736490a086285d9d2224 100644 --- a/build/bromite_patches/Allow-playing-audio-in-background.patch +++ b/build/cromite_patches/Allow-playing-audio-in-background.patch @@ -11,7 +11,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -1176,6 +1176,12 @@ bool WebMediaPlayerImpl::HasAudio() const { +@@ -1177,6 +1177,12 @@ bool WebMediaPlayerImpl::HasAudio() const { return pipeline_metadata_.has_audio; } @@ -24,7 +24,7 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc void WebMediaPlayerImpl::EnabledAudioTracksChanged( const WebVector& enabledTrackIds) { DCHECK(main_task_runner_->BelongsToCurrentThread()); -@@ -3484,7 +3490,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const { +@@ -3504,7 +3510,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const { : HasAudio(); // Audio only stream is allowed to play when in background. @@ -50,4 +50,3 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.h b const WebVector& enabledTrackIds) override; void SelectedVideoTrackChanged( -- -2.25.1 diff --git a/build/bromite_patches/Always-use-new-tab-page-for-default-home-page.patch b/build/cromite_patches/Always-use-new-tab-page-for-default-home-page.patch similarity index 81% rename from build/bromite_patches/Always-use-new-tab-page-for-default-home-page.patch rename to build/cromite_patches/Always-use-new-tab-page-for-default-home-page.patch index 4df336597cb686f04951bed412931f7adabee145..11eaf654675c7bd5ba0d6c532d4b0829f9b45c6d 100644 --- a/build/bromite_patches/Always-use-new-tab-page-for-default-home-page.patch +++ b/build/cromite_patches/Always-use-new-tab-page-for-default-home-page.patch @@ -17,7 +17,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -168,10 +168,6 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat +@@ -152,10 +152,6 @@ public class HomepageManager * tab page if the homepage button is force enabled via flag. */ public static GURL getDefaultHomepageGurl() { @@ -26,25 +26,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/Homepa - } - String homepagePartnerDefaultGurlSerialized = - SharedPreferencesManager.getInstance().readString( - ChromePreferenceKeys.HOMEPAGE_PARTNER_CUSTOMIZED_DEFAULT_GURL, ""); + ChromeSharedPreferences.getInstance() + .readString( diff --git a/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java --- a/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java +++ b/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java -@@ -214,7 +214,7 @@ public class PartnerBrowserCustomizations { - boolean systemOrPreStable = - (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1 - || !VersionInfo.isStableBuild(); -- if (!systemOrPreStable) { -+ if ((true)) { - // Only allow partner customization if this browser is a system package, or - // is in pre-stable channels. - return null; +@@ -212,7 +212,7 @@ public class PartnerBrowserCustomizations { + & ApplicationInfo.FLAG_SYSTEM) + == 1 + || !VersionInfo.isStableBuild(); +- if (!systemOrPreStable) { ++ if ((true)) { + // Only allow partner customization if this browser is a system + // package, or is in pre-stable channels. + return null; diff --git a/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java b/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java --- a/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java +++ b/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java -@@ -75,6 +75,7 @@ public class TemplateUrl { - * prepopulated_engines.json. +@@ -69,6 +69,7 @@ public class TemplateUrl { + * prepopulated_engines.json. */ public String getNewTabURL() { + if ((true)) return null; @@ -70,4 +70,3 @@ new file mode 100755 +SET_CROMITE_FEATURE_DISABLED(kNewTabSearchEngineUrlAndroid); +SET_CROMITE_FEATURE_DISABLED(kPartnerCustomizationsUma); -- -2.25.1 diff --git a/build/bromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch b/build/cromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch similarity index 99% rename from build/bromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch rename to build/cromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch index c8677db7686ee3371b5b6f15c401a514a2c6277d..67cf3c4018b0d9c9c6965b77232123a0d858badf 100644 --- a/build/bromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch +++ b/build/cromite_patches/AudioBuffer-AnalyserNode-fp-mitigations.patch @@ -204,4 +204,3 @@ diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/ } } -- -2.25.1 diff --git a/build/bromite_patches/Battery-API-return-nothing.patch b/build/cromite_patches/Battery-API-return-nothing.patch similarity index 99% rename from build/bromite_patches/Battery-API-return-nothing.patch rename to build/cromite_patches/Battery-API-return-nothing.patch index 0aac3bc2b60b3c092649d3acaee746ef72981b21..4e54e96aa0875f7976034d49f4dbedc2f2833061 100644 --- a/build/bromite_patches/Battery-API-return-nothing.patch +++ b/build/cromite_patches/Battery-API-return-nothing.patch @@ -64,4 +64,3 @@ diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/thi void BatteryManager::RegisterWithDispatcher() { -- -2.25.1 diff --git a/build/bromite_patches/Block-qjz9zk-or-trk-requests.patch b/build/cromite_patches/Block-qjz9zk-or-trk-requests.patch similarity index 97% rename from build/bromite_patches/Block-qjz9zk-or-trk-requests.patch rename to build/cromite_patches/Block-qjz9zk-or-trk-requests.patch index 12fa309a5ee15dcff2ecc94c1968e73b1addc296..4e38f13205ec21086cee97d3add401bb0dc82058 100644 --- a/build/bromite_patches/Block-qjz9zk-or-trk-requests.patch +++ b/build/cromite_patches/Block-qjz9zk-or-trk-requests.patch @@ -94,7 +94,7 @@ diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnib 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 -@@ -563,6 +563,10 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) { +@@ -576,6 +576,10 @@ GURL FixupURLInternal(const std::string& text, } } @@ -108,7 +108,7 @@ diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/ur 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 -@@ -829,6 +829,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() +@@ -841,6 +841,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl() RegisterPseudoScheme(url::kJavaScriptScheme); RegisterPseudoScheme(kViewSourceScheme); RegisterPseudoScheme(kGoogleChromeScheme); @@ -119,7 +119,7 @@ diff --git a/content/browser/child_process_security_policy_impl.cc b/content/bro diff --git a/net/BUILD.gn b/net/BUILD.gn --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -1056,6 +1056,8 @@ component("net") { +@@ -995,6 +995,8 @@ component("net") { "url_request/url_request_http_job.cc", "url_request/url_request_http_job.h", "url_request/url_request_interceptor.cc", @@ -212,7 +212,7 @@ diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc namespace net { -@@ -597,6 +599,12 @@ URLRequest::URLRequest(base::PassKey pass_key, +@@ -591,6 +593,12 @@ URLRequest::URLRequest(base::PassKey pass_key, // Sanity check out environment. DCHECK(base::SingleThreadTaskRunner::HasCurrentDefault()); @@ -287,4 +287,3 @@ diff --git a/url/url_util.cc b/url/url_util.cc // Schemes that can be sent CORS requests. -- -2.25.1 diff --git a/build/bromite_patches/Bookmarks-select-all-menu-entry.patch b/build/cromite_patches/Bookmarks-select-all-menu-entry.patch similarity index 92% rename from build/bromite_patches/Bookmarks-select-all-menu-entry.patch rename to build/cromite_patches/Bookmarks-select-all-menu-entry.patch index 06152d26a21b017e6d3f0b446a128650644d92b1..a2248c179518c33862e6eb84d97c943d5359597b 100644 --- a/build/bromite_patches/Bookmarks-select-all-menu-entry.patch +++ b/build/cromite_patches/Bookmarks-select-all-menu-entry.patch @@ -47,16 +47,16 @@ diff --git a/chrome/android/java/res/menu/bookmark_toolbar_menu_improved.xml b/c diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkToolbar.java -@@ -27,6 +27,8 @@ import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelega - import java.util.ArrayList; +@@ -28,6 +28,8 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Function; + +import java.util.HashSet; + /** - * Main toolbar of bookmark UI. It is responsible for displaying title and buttons - * associated with the current context. -@@ -183,6 +185,7 @@ public class BookmarkToolbar extends SelectableListToolbar + * Main toolbar of bookmark UI. It is responsible for displaying title and buttons associated with + * the current context. +@@ -184,6 +186,7 @@ public class BookmarkToolbar extends SelectableListToolbar void setCurrentFolder(BookmarkId folder) { mCurrentFolder = mBookmarkModel.getBookmarkById(folder); @@ -64,7 +64,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm getMenu().findItem(R.id.import_menu_id).setVisible(true); getMenu().findItem(R.id.export_menu_id).setVisible(true); } -@@ -211,6 +214,17 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -212,6 +215,17 @@ public class BookmarkToolbar extends SelectableListToolbar mExportBookmarkRunnable.run(); return true; } @@ -82,7 +82,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm return mMenuIdClickedFunction.apply(menuItem.getItemId()); } -@@ -233,6 +247,7 @@ public class BookmarkToolbar extends SelectableListToolbar +@@ -234,6 +248,7 @@ public class BookmarkToolbar extends SelectableListToolbar getMenu().findItem(R.id.import_menu_id).setVisible(mCurrentFolder != null); getMenu().findItem(R.id.export_menu_id).setVisible(mCurrentFolder != null); @@ -93,7 +93,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm 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 -@@ -245,6 +245,9 @@ CHAR_LIMIT guidelines: +@@ -248,6 +248,9 @@ CHAR_LIMIT guidelines: Sites @@ -104,4 +104,3 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Import -- -2.25.1 diff --git a/build/bromite_patches/Bromite-package-name.patch b/build/cromite_patches/Bromite-package-name.patch similarity index 99% rename from build/bromite_patches/Bromite-package-name.patch rename to build/cromite_patches/Bromite-package-name.patch index 0c339f28b6dc662dc8e35b165538f9c6ce3a6e8a..139e2d5408d622621585b93c8ecb11e9dffa9363 100644 --- a/build/bromite_patches/Bromite-package-name.patch +++ b/build/cromite_patches/Bromite-package-name.patch @@ -20,4 +20,3 @@ diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_p chrome_public_manifest_package += ".stable" } else if (android_channel != "default" && android_channel != "stable") { -- -2.25.1 diff --git a/build/bromite_patches/Bromite-subresource-adblocker.patch b/build/cromite_patches/Bromite-subresource-adblocker.patch similarity index 93% rename from build/bromite_patches/Bromite-subresource-adblocker.patch rename to build/cromite_patches/Bromite-subresource-adblocker.patch index b503443dd15f05f461c8d3c8c101f0290d606a3e..6f4f31976c7fbb328206ef03b5a7aa2a588656e3 100644 --- a/build/bromite_patches/Bromite-subresource-adblocker.patch +++ b/build/cromite_patches/Bromite-subresource-adblocker.patch @@ -17,31 +17,31 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/android/chrome_java_sources.gni | 2 + .../java/res/layout/adblock_editor.xml | 67 +++++ chrome/android/java/res/values/styles.xml | 18 ++ - chrome/android/java/res/values/values.xml | 2 + + chrome/android/java/res/values/values.xml | 4 + .../java/res/xml/adblock_preferences.xml | 25 ++ .../android/java/res/xml/main_preferences.xml | 5 + .../browser/settings/AdBlockEditor.java | 91 ++++++ - .../browser/settings/AdBlockPreferences.java | 61 ++++ + .../browser/settings/AdBlockPreferences.java | 58 ++++ .../chrome/browser/tabmodel/TabModelImpl.java | 2 +- chrome/app/generated_resources.grd | 10 + chrome/browser/after_startup_task_utils.cc | 4 + chrome/browser/browser_process.h | 6 + - chrome/browser/browser_process_impl.cc | 20 ++ + chrome/browser/browser_process_impl.cc | 21 ++ chrome/browser/browser_process_impl.h | 2 + chrome/browser/chrome_browser_main.cc | 3 + chrome/browser/flags/BUILD.gn | 3 + - .../flags/android/adblock_native_gateway.cc | 21 ++ - .../browser/flags/AdBlockNativeGateway.java | 20 ++ - .../net/system_network_context_manager.cc | 3 + + .../flags/android/adblock_native_gateway.cc | 31 ++ + .../browser/flags/AdBlockNativeGateway.java | 30 ++ + .../net/system_network_context_manager.cc | 8 + .../sessions/session_restore_android.cc | 6 +- .../strings/android_chrome_strings.grd | 14 + - chrome/common/pref_names.h | 3 + - .../strings/android/site_settings.grdp | 4 +- + chrome/common/pref_names.h | 5 + + .../strings/android/site_settings.grdp | 3 + components/component_updater/BUILD.gn | 7 + - .../adblock_updater_service.cc | 268 ++++++++++++++++++ - .../adblock_updater_service.h | 98 +++++++ - .../download_filters_task.cc | 239 ++++++++++++++++ - .../component_updater/download_filters_task.h | 129 +++++++++ + .../adblock_updater_service.cc | 281 ++++++++++++++++++ + .../adblock_updater_service.h | 103 +++++++ + .../download_filters_task.cc | 239 +++++++++++++++ + .../component_updater/download_filters_task.h | 129 ++++++++ ...ent_subresource_filter_throttle_manager.cc | 15 + ...tent_subresource_filter_throttle_manager.h | 2 + .../content/browser/ruleset_service.cc | 42 ++- @@ -52,7 +52,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/subresource_filter_features.cc | 116 +------- .../core/common/indexed_ruleset.cc | 5 +- .../Bromite-subresource-adblocker.inc | 3 + - 40 files changed, 1208 insertions(+), 129 deletions(-) + 40 files changed, 1254 insertions(+), 127 deletions(-) create mode 100644 chrome/android/java/res/layout/adblock_editor.xml create mode 100644 chrome/android/java/res/xml/adblock_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java @@ -79,7 +79,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn 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 -@@ -448,6 +448,7 @@ chrome_java_resources = [ +@@ -434,6 +434,7 @@ chrome_java_resources = [ "java/res/layout/account_chooser_dialog_title.xml", "java/res/layout/account_divider_preference.xml", "java/res/layout/account_management_account_row.xml", @@ -87,7 +87,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja "java/res/layout/auto_sign_in_first_run_dialog.xml", "java/res/layout/autofill_billing_address_dropdown.xml", "java/res/layout/autofill_card_name_and_number.xml", -@@ -648,6 +649,7 @@ chrome_java_resources = [ +@@ -638,6 +639,7 @@ chrome_java_resources = [ "java/res/xml/about_chrome_preferences.xml", "java/res/xml/account_management_preferences.xml", "java/res/xml/ad_services_config.xml", @@ -98,7 +98,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja 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 -@@ -960,6 +960,8 @@ chrome_java_sources = [ +@@ -961,6 +961,8 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java", "java/src/org/chromium/chrome/browser/permissions/PermissionUpdateRequester.java", "java/src/org/chromium/chrome/browser/photo_picker/DecoderServiceImpl.java", @@ -106,7 +106,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java + "java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java", "java/src/org/chromium/chrome/browser/policy/PolicyAuditor.java", "java/src/org/chromium/chrome/browser/policy/PolicyAuditorBridge.java", - "java/src/org/chromium/chrome/browser/printing/TabPrinter.java", + "java/src/org/chromium/chrome/browser/privacy/settings/DoNotTrackSettings.java", diff --git a/chrome/android/java/res/layout/adblock_editor.xml b/chrome/android/java/res/layout/adblock_editor.xml new file mode 100644 --- /dev/null @@ -210,10 +210,12 @@ diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res 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 -@@ -27,6 +27,8 @@ found in the LICENSE file. +@@ -25,6 +25,10 @@ found in the LICENSE file. true ++ Autoupdate enabled ++ Autoupdate disabled + https://www.bromite.org/custom-filters + Proxy configuration @@ -235,27 +237,27 @@ new file mode 100644 + + -+ -+ ++ android:summaryOn="@string/adblock_on" ++ android:summaryOff="@string/adblock_off" /> + + + ++ ++ + diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml -@@ -71,6 +71,11 @@ - android:key="eyeo_adblock" - android:order="13" - android:title="@string/adblock_settings_title" /> +@@ -72,6 +72,11 @@ found in the LICENSE file. + android:key="safety_check" + android:order="12" + android:title="@string/prefs_safety_check"/> + { -+ WebsitePreferenceBridge.setCategoryEnabled(browserContextHandle, ContentSettingsType.ADS, !(boolean) newValue); ++ AdBlockNativeGateway.setAdBlockEnabled((boolean) newValue); + return true; + }); + @@ -429,7 +428,7 @@ new file mode 100644 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java -@@ -781,7 +781,7 @@ public class TabModelImpl extends TabModelJniBridge { +@@ -839,7 +839,7 @@ public class TabModelImpl extends TabModelJniBridge { protected boolean createTabWithWebContents( Tab parent, Profile profile, WebContents webContents) { return getTabCreator(profile.isOffTheRecord()) @@ -441,7 +440,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabMod diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd -@@ -14317,6 +14317,16 @@ Please help our engineers fix this problem. Tell us what happened right before y +@@ -14908,6 +14908,16 @@ Please help our engineers fix this problem. Tell us what happened right before y Never show this again. @@ -501,7 +500,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h namespace extensions { class EventRouterForwarder; } -@@ -241,6 +246,7 @@ class BrowserProcess { +@@ -245,6 +250,7 @@ class BrowserProcess { #endif virtual component_updater::ComponentUpdateService* component_updater() = 0; @@ -512,7 +511,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h 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 -@@ -1130,6 +1130,26 @@ BrowserProcessImpl::component_updater() { +@@ -1138,6 +1138,27 @@ BrowserProcessImpl::component_updater() { return component_updater_.get(); } @@ -531,6 +530,7 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro + g_browser_process->system_network_context_manager()->GetSharedURLLoaderFactory(), + std::move(scheduler), + g_browser_process->subresource_filter_ruleset_service(), ++ local_state()->GetBoolean(prefs::kAdBlockEnabled), + local_state()->GetString(prefs::kAdBlockFiltersURL)); + + return adblock_updater_.get(); @@ -542,7 +542,7 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -204,6 +204,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -210,6 +210,7 @@ class BrowserProcessImpl : public BrowserProcess, #endif component_updater::ComponentUpdateService* component_updater() override; @@ -550,7 +550,7 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc MediaFileSystemRegistry* media_file_system_registry() override; WebRtcLogUploader* webrtc_log_uploader() override; network_time::NetworkTimeTracker* network_time_tracker() override; -@@ -398,6 +399,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -406,6 +407,7 @@ class BrowserProcessImpl : public BrowserProcess, // to concerns over integrity of data shared between profiles, // but some users of component updater only install per-user. std::unique_ptr component_updater_; @@ -561,7 +561,7 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc -@@ -431,6 +431,9 @@ StartupProfileInfo CreateInitialProfile( +@@ -448,6 +448,9 @@ StartupProfileInfo CreateInitialProfile( // missing code in the above test. CHECK(profile_info.profile) << "Cannot get default profile."; @@ -574,7 +574,7 @@ diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_brows diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn --- a/chrome/browser/flags/BUILD.gn +++ b/chrome/browser/flags/BUILD.gn -@@ -24,6 +24,7 @@ android_library("java") { +@@ -23,6 +23,7 @@ android_library("java") { "android/java/src/org/chromium/chrome/browser/flags/StringCachedFieldTrialParameter.java", "android/java/src/org/chromium/chrome/browser/flags/ValuesOverridden.java", "android/java/src/org/chromium/chrome/browser/flags/ValuesReturned.java", @@ -582,7 +582,7 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn ] deps = [ "//base:base_java", -@@ -45,6 +46,7 @@ android_library("java") { +@@ -44,6 +45,7 @@ android_library("java") { generate_jni("jni_headers") { sources = [ "android/java/src/org/chromium/chrome/browser/flags/CromiteNativeUtils.java" ] sources += [ @@ -590,7 +590,7 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureMap.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeSessionState.java", ] -@@ -59,6 +61,7 @@ static_library("flags_android") { +@@ -58,6 +60,7 @@ static_library("flags_android") { "android/chrome_session_state.cc", "android/chrome_session_state.h", ] @@ -602,7 +602,7 @@ diff --git a/chrome/browser/flags/android/adblock_native_gateway.cc b/chrome/bro new file mode 100755 --- /dev/null +++ b/chrome/browser/flags/android/adblock_native_gateway.cc -@@ -0,0 +1,21 @@ +@@ -0,0 +1,31 @@ +#include "chrome/browser/flags/jni_headers/AdBlockNativeGateway_jni.h" + +#include "base/android/jni_string.h" @@ -624,15 +624,25 @@ new file mode 100755 + g_browser_process->local_state()->SetString(prefs::kAdBlockFiltersURL, + base::android::ConvertJavaStringToUTF8(env, url)); +} ++ ++static jboolean JNI_AdBlockNativeGateway_GetAdBlockEnabled( ++ JNIEnv* env) { ++ return g_browser_process->local_state()->GetBoolean(prefs::kAdBlockEnabled); ++} ++ ++static void JNI_AdBlockNativeGateway_SetAdBlockEnabled( ++ JNIEnv* env, jboolean enabled) { ++ g_browser_process->local_state()->SetBoolean(prefs::kAdBlockEnabled, enabled); ++} diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java new file mode 100755 --- /dev/null +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java -@@ -0,0 +1,20 @@ +@@ -0,0 +1,30 @@ +package org.chromium.chrome.browser.flags; + -+import org.chromium.base.annotations.CalledByNative; -+import org.chromium.base.annotations.NativeMethods; ++import org.jni_zero.CalledByNative; ++import org.jni_zero.NativeMethods; + +public class AdBlockNativeGateway { + public static void setAdBlockFiltersURL(String url) { @@ -643,19 +653,34 @@ new file mode 100755 + return AdBlockNativeGatewayJni.get().getAdBlockFiltersURL(); + } + ++ public static void setAdBlockEnabled(boolean enabled) { ++ AdBlockNativeGatewayJni.get().setAdBlockEnabled(enabled); ++ } ++ ++ public static boolean getAdBlockEnabled() { ++ return AdBlockNativeGatewayJni.get().getAdBlockEnabled(); ++ } ++ + @NativeMethods + interface Natives { + void setAdBlockFiltersURL(String url); + String getAdBlockFiltersURL(); ++ void setAdBlockEnabled(boolean enabled); ++ boolean getAdBlockEnabled(); + } +} 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 -@@ -604,6 +604,9 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { +@@ -602,6 +602,14 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) { StubResolverConfigReader::RegisterPrefs(registry); ++#if BUILDFLAG(IS_ANDROID) ++ registry->RegisterBooleanPref(prefs::kAdBlockEnabled, true); ++#else ++ registry->RegisterBooleanPref(prefs::kAdBlockEnabled, false); ++#endif + registry->RegisterStringPref(prefs::kAdBlockFiltersURL, + "https://www.bromite.org/filters/filters.dat"); + @@ -681,7 +706,7 @@ diff --git a/chrome/browser/sessions/session_restore_android.cc b/chrome/browser 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 -@@ -217,6 +217,20 @@ CHAR_LIMIT guidelines: +@@ -220,6 +220,20 @@ CHAR_LIMIT guidelines: Advanced @@ -705,12 +730,14 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -2598,6 +2598,9 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; +@@ -2657,6 +2657,11 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; inline constexpr char kAudioCaptureAllowedUrls[] = "hardware.audio_capture_allowed_urls"; +// Holds the URL to an indexed subresource filters file. +inline constexpr char kAdBlockFiltersURL[] = "adblock.filters_url"; ++ ++inline constexpr char kAdBlockEnabled[] = "adblock.enabled"; + // A pref holding the value of the policy used to explicitly allow or deny // access to video capture devices. When enabled or not set, the user is @@ -718,24 +745,23 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp --- a/components/browser_ui/strings/android/site_settings.grdp +++ b/components/browser_ui/strings/android/site_settings.grdp -@@ -362,8 +362,8 @@ +@@ -371,6 +371,9 @@ This site shows intrusive or misleading ads -- -- Block ads on sites that show intrusive or misleading ads + + Block ads based on the current filters - ++ Blocked on some sites + diff --git a/components/component_updater/BUILD.gn b/components/component_updater/BUILD.gn --- a/components/component_updater/BUILD.gn +++ b/components/component_updater/BUILD.gn -@@ -10,6 +10,12 @@ static_library("component_updater") { +@@ -16,6 +16,12 @@ static_library("component_updater") { + "component_installer.h", + "component_updater_command_line_config_policy.cc", "component_updater_command_line_config_policy.h", - "component_updater_paths.cc", - "component_updater_paths.h", + + "adblock_updater_service.cc", + "adblock_updater_service.h", @@ -745,7 +771,7 @@ diff --git a/components/component_updater/BUILD.gn b/components/component_update "component_updater_service.cc", "component_updater_service.h", "component_updater_service_internal.h", -@@ -39,6 +45,7 @@ static_library("component_updater") { +@@ -47,6 +53,7 @@ static_library("component_updater") { "//components/prefs", "//components/update_client", "//components/version_info", @@ -757,7 +783,7 @@ diff --git a/components/component_updater/adblock_updater_service.cc b/component new file mode 100644 --- /dev/null +++ b/components/component_updater/adblock_updater_service.cc -@@ -0,0 +1,268 @@ +@@ -0,0 +1,281 @@ +/* + This file is part of Bromite. + @@ -801,9 +827,16 @@ new file mode 100644 + next_check_delay = 60*60*24*7, // 1 week + on_demand_check_delay = 60; // minimum 1 minute between each on-demand check + -+AdBlockUpdaterService::AdBlockUpdaterService(scoped_refptr shared_url_network_factory, std::unique_ptr scheduler, -+ subresource_filter::RulesetService* ruleset_service, std::string filters_url) -+ : ruleset_service_(ruleset_service), shared_url_network_factory_(shared_url_network_factory), scheduler_(std::move(scheduler)) { ++AdBlockUpdaterService::AdBlockUpdaterService( ++ scoped_refptr shared_url_network_factory, ++ std::unique_ptr scheduler, ++ subresource_filter::RulesetService* ruleset_service, ++ bool enabled, ++ std::string filters_url) ++ : ruleset_service_(ruleset_service), ++ shared_url_network_factory_(shared_url_network_factory), ++ scheduler_(std::move(scheduler)), ++ enabled_(enabled) { + DCHECK(ruleset_service); + + filters_url_ = filters_url; @@ -862,6 +895,11 @@ new file mode 100644 +bool AdBlockUpdaterService::OnDemandUpdateAsNeeded(bool is_foreground, Callback on_finished) { + DCHECK(thread_checker_.CalledOnValidThread()); + ++ if (!enabled_) { ++ LOG(INFO) << "AdBlockUpdaterService: update is disabled."; ++ return false; ++ } ++ + // Check if the request is too early + if (!last_update_.is_null()) { + base::TimeDelta delta = @@ -941,22 +979,23 @@ new file mode 100644 + } + + last_update_ = base::TimeTicks::Now(); -+ auto task = base::MakeRefCounted( -+ shared_url_network_factory_, -+ is_foreground, filters_url_, -+ min_last_modified, -+ base::BindOnce(&AdBlockUpdaterService::OnUpdateComplete, base::Unretained(this), -+ std::move(on_finished))); -+ -+ // run task now; task is responsible for downloading the filters (if Last-Modified header is more recent) -+ // and then clearing the 'is_updating' status -+ base::SequencedTaskRunner::GetCurrentDefault()->PostTask(FROM_HERE, -+ base::BindOnce(&DownloadFiltersTask::Run, base::Unretained(task.get()))); -+ tasks_.insert(task); -+ -+ base::SequencedTaskRunner::GetCurrentDefault()->PostTask( -+ FROM_HERE, base::BindOnce(&AdBlockUpdaterService::NotifyObservers, base::Unretained(this), Event::ADBLOCK_UPDATE_DOWNLOADING)); ++ if (!filters_url_.empty()) { ++ auto task = base::MakeRefCounted( ++ shared_url_network_factory_, ++ is_foreground, filters_url_, ++ min_last_modified, ++ base::BindOnce(&AdBlockUpdaterService::OnUpdateComplete, base::Unretained(this), ++ std::move(on_finished))); ++ ++ // run task now; task is responsible for downloading the filters (if Last-Modified header is more recent) ++ // and then clearing the 'is_updating' status ++ base::SequencedTaskRunner::GetCurrentDefault()->PostTask(FROM_HERE, ++ base::BindOnce(&DownloadFiltersTask::Run, base::Unretained(task.get()))); ++ tasks_.insert(task); + ++ base::SequencedTaskRunner::GetCurrentDefault()->PostTask( ++ FROM_HERE, base::BindOnce(&AdBlockUpdaterService::NotifyObservers, base::Unretained(this), Event::ADBLOCK_UPDATE_DOWNLOADING)); ++ } + return true; +} + @@ -1030,7 +1069,7 @@ diff --git a/components/component_updater/adblock_updater_service.h b/components new file mode 100644 --- /dev/null +++ b/components/component_updater/adblock_updater_service.h -@@ -0,0 +1,98 @@ +@@ -0,0 +1,103 @@ +/* + This file is part of Bromite. + @@ -1086,8 +1125,12 @@ new file mode 100644 +// All methods are safe to call ONLY from the browser's main thread. +class AdBlockUpdaterService { + public: -+ AdBlockUpdaterService(scoped_refptr shared_url_network_factory, std::unique_ptr scheduler, -+ subresource_filter::RulesetService* ruleset_service, std::string filters_url); ++ AdBlockUpdaterService( ++ scoped_refptr shared_url_network_factory, ++ std::unique_ptr scheduler, ++ subresource_filter::RulesetService* ruleset_service, ++ bool enabled, ++ std::string filters_url); + ~AdBlockUpdaterService(); + + // Adds an observer for this class. An observer should not be added more @@ -1121,6 +1164,7 @@ new file mode 100644 + scoped_refptr shared_url_network_factory_; + std::unique_ptr scheduler_; + ++ bool enabled_; + bool is_updating_ = false; + bool scheduled_ = false; + std::set> tasks_; @@ -1528,7 +1572,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f web_contents_helper_(web_contents_helper) {} ContentSubresourceFilterThrottleManager:: -@@ -667,6 +671,17 @@ ContentSubresourceFilterThrottleManager:: +@@ -668,6 +672,17 @@ ContentSubresourceFilterThrottleManager:: throttle->NotifyPageActivationWithRuleset(EnsureRulesetHandle(), ad_tagging_state); } @@ -1549,7 +1593,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h --- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h +++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h -@@ -412,6 +412,8 @@ class ContentSubresourceFilterThrottleManager +@@ -413,6 +413,8 @@ class ContentSubresourceFilterThrottleManager std::unique_ptr profile_interaction_manager_; @@ -1696,7 +1740,7 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.cc b/ diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/components/subresource_filter/content/browser/ruleset_service.h --- a/components/subresource_filter/content/browser/ruleset_service.h +++ b/components/subresource_filter/content/browser/ruleset_service.h -@@ -184,7 +184,7 @@ class RulesetService : public base::SupportsWeakPtr { +@@ -182,7 +182,7 @@ class RulesetService : public base::SupportsWeakPtr { // // Virtual so that it can be mocked out in tests. virtual void IndexAndStoreAndPublishRulesetIfNeeded( @@ -1705,7 +1749,7 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/c // Get the ruleset version associated with the current local_state_. IndexedRulesetVersion GetMostRecentlyIndexedVersion() const; -@@ -217,6 +217,11 @@ class RulesetService : public base::SupportsWeakPtr { +@@ -215,6 +215,11 @@ class RulesetService : public base::SupportsWeakPtr { const base::FilePath& indexed_ruleset_base_dir, const UnindexedRulesetInfo& unindexed_ruleset_info); @@ -1955,4 +1999,3 @@ new file mode 100644 +SET_CROMITE_FEATURE_DISABLED(kAutomaticLazyFrameLoadingToEmbeds); +SET_CROMITE_FEATURE_DISABLED(kAutomaticLazyFrameLoadingToEmbedUrls); -- -2.25.1 diff --git a/build/bromite_patches/Client-hints-overrides.patch b/build/cromite_patches/Client-hints-overrides.patch similarity index 95% rename from build/bromite_patches/Client-hints-overrides.patch rename to build/cromite_patches/Client-hints-overrides.patch index b67f5af6993e9b1603b687cd6e2cce3b12baaf92..305420c4085a23a7b68f393cbbb654fd1cd4936e 100644 --- a/build/bromite_patches/Client-hints-overrides.patch +++ b/build/cromite_patches/Client-hints-overrides.patch @@ -51,7 +51,7 @@ diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/clie diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc -@@ -1067,6 +1067,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( +@@ -1064,6 +1064,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( return; } @@ -78,14 +78,14 @@ new file mode 100644 diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc -@@ -99,6 +99,7 @@ const size_t kMaxRestarts = 32; +@@ -101,6 +101,7 @@ const size_t kMaxRestarts = 32; // Returns true when Early Hints are allowed on the given protocol. - bool EarlyHintsAreAllowedOn(HttpResponseInfo::ConnectionInfo connection_info) { + bool EarlyHintsAreAllowedOn(HttpConnectionInfo connection_info) { + if ((true)) return false; switch (connection_info) { - case HttpResponseInfo::ConnectionInfo::CONNECTION_INFO_HTTP0_9: - case HttpResponseInfo::ConnectionInfo::CONNECTION_INFO_HTTP1_0: + case HttpConnectionInfo::kHTTP0_9: + case HttpConnectionInfo::kHTTP1_0: diff --git a/services/network/public/cpp/client_hints.cc b/services/network/public/cpp/client_hints.cc --- a/services/network/public/cpp/client_hints.cc +++ b/services/network/public/cpp/client_hints.cc @@ -139,7 +139,7 @@ diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/thi 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 -@@ -3906,8 +3906,8 @@ +@@ -3903,8 +3903,8 @@ public: true, }, { @@ -151,4 +151,3 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 { // https://chromestatus.com/feature/5132477781245952 -- -2.25.1 diff --git a/build/bromite_patches/Content-settings-infrastructure.patch b/build/cromite_patches/Content-settings-infrastructure.patch similarity index 65% rename from build/bromite_patches/Content-settings-infrastructure.patch rename to build/cromite_patches/Content-settings-infrastructure.patch index 9aab4a3b69835d0a359192be48d12d370c6518b3..f8a8826ac18cf5d069daf327bef747400c55b902 100644 --- a/build/bromite_patches/Content-settings-infrastructure.patch +++ b/build/cromite_patches/Content-settings-infrastructure.patch @@ -14,34 +14,46 @@ Require: bromite-build-utils.patch .../ChromeSiteSettingsDelegate.java | 17 +- .../installable/installed_webapp_bridge.cc | 2 +- .../settings/privacy_page/privacy_page.html | 1 + - .../settings/privacy_page/privacy_page.ts | 44 ++- + .../settings/privacy_page/privacy_page.ts | 77 +++- chrome/browser/resources/settings/route.ts | 2 + - .../settings_category_default_radio_group.ts | 7 + + ...settings_category_default_radio_group.html | 12 + + .../settings_category_default_radio_group.ts | 22 +- .../settings/site_settings/site_details.html | 1 + - .../settings/site_settings/site_details.ts | 16 +- - .../site_settings_page/site_settings_page.ts | 28 +- - .../site_settings_page_util.ts | 55 ++++ + .../settings/site_settings/site_details.ts | 33 +- + .../site_details_permission.html | 8 +- + .../site_settings/site_details_permission.ts | 44 ++ + .../site_settings/site_settings_mixin.ts | 18 + + .../site_settings_page/site_settings_page.ts | 30 +- + .../site_settings_page_util.ts | 55 +++ chrome/browser/ui/BUILD.gn | 1 + - .../views/page_info/page_info_view_factory.cc | 13 + - .../settings_localized_strings_provider.cc | 39 +++ + .../controls/rich_controls_container_view.h | 7 + + .../ui/views/page_info/page_info_main_view.cc | 27 +- + .../views/page_info/page_info_view_factory.cc | 19 + + .../views/page_info/page_info_view_factory.h | 3 + + .../page_info/permission_toggle_row_view.cc | 163 ++++++- + .../page_info/permission_toggle_row_view.h | 18 +- + .../settings_localized_strings_provider.cc | 54 +++ .../ui/webui/settings/site_settings_helper.cc | 34 +- - .../browser_ui/site_settings/android/BUILD.gn | 16 + + .../browser_ui/settings/android/BUILD.gn | 1 + + .../preference_spinner_single_widget.xml | 92 ++++ + .../settings/SpinnerPreference.java | 24 + + .../browser_ui/site_settings/android/BUILD.gn | 18 + .../site_settings/AllSiteSettings.java | 5 +- - .../BromiteCustomContentSetting.java | 139 ++++++++ - .../BromiteCustomContentSettingImpl.java | 307 ++++++++++++++++++ - ...tomTriStateSiteSettingsPreferenceImpl.java | 24 ++ + .../BromiteCustomContentSetting.java | 155 +++++++ + .../BromiteCustomContentSettingImpl.java | 409 ++++++++++++++++++ + ...tomTriStateSiteSettingsPreferenceImpl.java | 24 + .../ContentSettingsResources.java | 14 +- .../site_settings/SingleCategorySettings.java | 50 ++- - .../site_settings/SingleWebsiteSettings.java | 26 +- + .../site_settings/SingleWebsiteSettings.java | 58 ++- .../site_settings/SiteSettings.java | 14 +- .../site_settings/SiteSettingsCategory.java | 18 +- .../site_settings/SiteSettingsDelegate.java | 2 + .../TriStateSiteSettingsPreference.java | 13 +- - .../browser_ui/site_settings/Website.java | 6 + + .../browser_ui/site_settings/Website.java | 6 +- .../WebsitePermissionsFetcher.java | 4 +- .../WebsitePreferenceBridge.java | 3 +- .../impl/include_all_directory.java | 1 + - ...miteCustomContentSettingImplBase.java.tmpl | 48 +++ + ...miteCustomContentSettingImplBase.java.tmpl | 48 ++ .../bromite_content_settings/placeholder.txt | 1 + components/content_settings/android/BUILD.gn | 1 + .../content_settings/core/browser/BUILD.gn | 7 + @@ -49,7 +61,7 @@ Require: bromite-build-utils.patch .../core/browser/content_settings_registry.cc | 2 + .../core/browser/content_settings_uma_util.cc | 3 +- .../core/browser/content_settings_utils.cc | 12 + - .../core/browser/website_settings_info.h | 35 ++ + .../core/browser/website_settings_info.h | 38 ++ .../core/browser/website_settings_registry.cc | 6 + .../core/browser/website_settings_registry.h | 1 + .../content_settings/core/common/BUILD.gn | 7 + @@ -58,7 +70,7 @@ Require: bromite-build-utils.patch .../core/common/content_settings.h | 10 + .../core/common/content_settings.mojom | 6 + .../common/content_settings_mojom_traits.cc | 12 +- - .../common/content_settings_mojom_traits.h | 24 ++ + .../common/content_settings_mojom_traits.h | 24 + .../common/content_settings_param_traits.h | 2 +- .../core/common/content_settings_types.h | 4 +- .../renderer/content_settings_agent_impl.cc | 33 ++ @@ -72,7 +84,8 @@ Require: bromite-build-utils.patch .../platform/web_content_settings_client.h | 5 + .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + - 61 files changed, 1193 insertions(+), 44 deletions(-) + 73 files changed, 1821 insertions(+), 76 deletions(-) + create mode 100644 components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomTriStateSiteSettingsPreferenceImpl.java @@ -85,7 +98,7 @@ Require: bromite-build-utils.patch diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java -@@ -47,6 +47,10 @@ import org.chromium.url.GURL; +@@ -58,6 +58,10 @@ import org.chromium.url.GURL; import java.util.Set; @@ -93,10 +106,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C +import android.provider.Browser; +import android.net.Uri; + - /** - * A SiteSettingsDelegate instance that contains Chrome-specific Site Settings logic. - */ -@@ -191,7 +195,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { + /** A SiteSettingsDelegate instance that contains Chrome-specific Site Settings logic. */ + public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { + public static final String EMBEDDED_CONTENT_HELP_CENTER_URL = +@@ -202,7 +206,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { @Override public boolean isHelpAndFeedbackEnabled() { @@ -105,7 +118,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C } @Override -@@ -272,6 +276,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { +@@ -315,6 +319,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { return PrivacySandboxBridge.getFirstPartySetOwner(memberOrigin); } @@ -138,7 +151,7 @@ diff --git a/chrome/browser/installable/installed_webapp_bridge.cc b/chrome/brow diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html -@@ -1358,4 +1358,5 @@ +@@ -1326,4 +1326,5 @@ @@ -147,9 +160,37 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/chrome/browser/resources/settings/privacy_page/privacy_page.ts --- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts -@@ -71,7 +71,49 @@ export class SettingsPrivacyPageElement extends SettingsPrivacyPageElementBase { +@@ -47,6 +47,7 @@ import {SiteSettingsPrefsBrowserProxy, SiteSettingsPrefsBrowserProxyImpl} from ' + + import {PrivacyGuideAvailabilityMixin} from './privacy_guide/privacy_guide_availability_mixin.js'; + import {getTemplate} from './privacy_page.html.js'; ++import { SettingsCategoryDefaultRadioGroupElement } from '../site_settings/settings_category_default_radio_group.js'; + + interface BlockAutoplayStatus { + enabled: boolean; +@@ -70,8 +71,82 @@ export class SettingsPrivacyPageElement extends SettingsPrivacyPageElementBase { + return 'settings-privacy-page'; } ++ static getSettingTemplate(template: HTMLTemplateElement, ++ name: string) : SettingsCategoryDefaultRadioGroupElement | undefined { ++ let value : SettingsCategoryDefaultRadioGroupElement | undefined = undefined; ++ let page : any = template.content!.querySelector("settings-animated-pages"); ++ ++ page.querySelectorAll("template")!.forEach( ++ (subTemplate: HTMLTemplateElement) => { ++ subTemplate.content.querySelectorAll("settings-category-default-radio-group").forEach( ++ (radio: any) => { ++ let setting = radio.getAttribute("category") ++ .replace("[[contentSettingsTypesEnum_.", "") ++ .replace("]]", ""); ++ if ((ContentSettingsTypes as any)[setting] === name) ++ value = radio; ++ }); ++ }); ++ return value; ++ } ++ static get template() { - return getTemplate(); + let template = getTemplate(); @@ -160,36 +201,49 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/ch + let name = obj["name"]; + let tag_name = obj["tag_ui"]; if (!tag_name) tag_name = obj["name"]; + -+ let template = document.createElement("settings-subpage"); -+ template.setAttribute("page-title", loadTimeData.getString(`brSiteSettings${name}`)); -+ template.setAttribute("search-title", loadTimeData.getString("siteSettingsAllSitesSearch")); -+ template.setAttribute("search-term", "{{searchFilter_}}"); ++ let existingSetting = this.getSettingTemplate(template, name); ++ if (existingSetting) { ++ if (loadTimeData.valueExists(`brSiteSettings${name}Ask`)) { ++ existingSetting.setAttribute("ask-option-label", loadTimeData.getString(`brSiteSettings${name}Ask`)); ++ existingSetting.setAttribute("ask-option-icon", `br-settings:${name}-off`); ++ } ++ continue; ++ } ++ ++ let subpage = document.createElement("settings-subpage"); ++ subpage.setAttribute("page-title", loadTimeData.getString(`brSiteSettings${name}`)); ++ subpage.setAttribute("search-title", loadTimeData.getString("siteSettingsAllSitesSearch")); ++ subpage.setAttribute("search-term", "{{searchFilter_}}"); + + let divElement = document.createElement("div"); + divElement.setAttribute("class", "content-settings-header secondary"); + divElement.innerText = loadTimeData.getString(`brSiteSettings${name}Description`); -+ template.appendChild(divElement); ++ subpage.appendChild(divElement); + -+ let radioGroup = document.createElement("settings-category-default-radio-group"); ++ let radioGroup = existingSetting ?? document.createElement("settings-category-default-radio-group"); + radioGroup.setAttribute("category", name); + radioGroup.setAttribute("allow-option-label", loadTimeData.getString(`brSiteSettings${name}Allowed`)); + radioGroup.setAttribute("allow-option-icon", `br-settings:${name}`); + radioGroup.setAttribute("block-option-label", loadTimeData.getString(`brSiteSettings${name}Blocked`)); + radioGroup.setAttribute("block-option-icon", `br-settings:${name}-off`); -+ template.appendChild(radioGroup); ++ if (loadTimeData.valueExists(`brSiteSettings${name}Ask`)) { ++ radioGroup.setAttribute("ask-option-label", loadTimeData.getString(`brSiteSettings${name}Ask`)); ++ radioGroup.setAttribute("ask-option-icon", `br-settings:${name}-off`); ++ } ++ subpage.appendChild(radioGroup); + + let exceptions = document.createElement("category-setting-exceptions"); + exceptions.setAttribute("category", name); + exceptions.setAttribute("allow-header", loadTimeData.getString(`brSiteSettings${name}AllowedExceptions`)); + exceptions.setAttribute("block-header", loadTimeData.getString(`brSiteSettings${name}BlockedExceptions`)); + exceptions.setAttribute("search-filter", "[[searchFilter_]]"); -+ template.appendChild(exceptions); ++ subpage.appendChild(exceptions); + + let tag = document.createElement("template"); + tag.setAttribute("is", "dom-if"); + tag.setAttribute("route-path", `/content/${tag_name}`); + tag.setAttribute("no-search", ""); -+ tag.content.appendChild(template); ++ tag.content.appendChild(subpage); + + content.parentElement!.insertBefore(tag, content); + } @@ -209,7 +263,7 @@ diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resourc /** * Add all of the child routes that originate from the privacy route, -@@ -137,6 +138,7 @@ function addPrivacyChildRoutes(r: Partial) { +@@ -136,6 +137,7 @@ function addPrivacyChildRoutes(r: Partial) { r.SITE_SETTINGS_STORAGE_ACCESS = r.SITE_SETTINGS.createChild('storageAccess'); } @@ -217,27 +271,105 @@ diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resourc } /** +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.html b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.html +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.html ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.html +@@ -53,5 +53,17 @@ + icon="[[blockOptionIcon]]" + no-collapse> + ++ ++ + +

diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts --- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts -@@ -161,6 +161,13 @@ export class SettingsCategoryDefaultRadioGroupElement extends +@@ -29,6 +29,7 @@ import {ContentSettingProvider, DefaultContentSetting} from './site_settings_pre + export enum SiteContentRadioSetting { + DISABLED = 0, + ENABLED = 1, ++ ASK = 2, + } + + export interface SettingsCategoryDefaultRadioGroupElement { +@@ -76,6 +77,10 @@ export class SettingsCategoryDefaultRadioGroupElement extends + blockOptionSubLabel: String, + blockOptionIcon: String, + ++ askOptionLabel: String, ++ askOptionSubLabel: String, ++ askOptionIcon: String, ++ + siteContentRadioSettingEnum_: { + type: Object, + value: SiteContentRadioSetting, +@@ -111,6 +116,9 @@ export class SettingsCategoryDefaultRadioGroupElement extends + blockOptionLabel: string; + blockOptionSubLabel: string; + blockOptionIcon: string; ++ askOptionLabel: string; ++ askOptionSubLabel: string; ++ askOptionIcon: string; + private pref_: chrome.settingsPrivate.PrefObject; + + override ready() { +@@ -121,6 +129,13 @@ export class SettingsCategoryDefaultRadioGroupElement extends + (category: ContentSettingsTypes) => this.onCategoryChanged_(category)); + } + ++ private showAskSetting_( ++ category: ContentSettingsTypes): boolean { ++ let obj = this.getSettingData(category); ++ if (obj) return obj["allowed_ask"] === "1"; ++ return false; ++ } ++ + private getAllowOptionForCategory_(): ContentSetting { + switch (this.category) { + case ContentSettingsTypes.ADS: +@@ -161,6 +176,8 @@ export class SettingsCategoryDefaultRadioGroupElement extends // "Ask" vs "Blocked". return ContentSetting.ASK; default: -+ for (let index=0; index < loadTimeData.getInteger("br_cs_count"); index++) { -+ let obj = JSON.parse(loadTimeData.getString("br_cs_" + index)); -+ let name = obj["name"]; -+ if (this.category == name) { -+ return ContentSetting.ALLOW; -+ } -+ } ++ let obj = this.getSettingData(this.category); ++ if (obj) return ContentSetting.ALLOW; assertNotReached('Invalid category: ' + this.category); } } +@@ -185,6 +202,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + /** @type {!ContentSetting} */ (this.getAllowOptionForCategory_()); + this.browserProxy.setDefaultValueForContentType( + this.category, ++ this.pref_.value === SiteContentRadioSetting.ASK ? "ask" : + this.categoryEnabled_ ? allowOption : ContentSetting.BLOCK); + } + +@@ -216,7 +234,9 @@ export class SettingsCategoryDefaultRadioGroupElement extends + } + + const enabled = this.computeIsSettingEnabled(update.setting); +- const prefValue = enabled ? SiteContentRadioSetting.ENABLED : ++ const ask = this.computeIsSettingAsk(update.setting); ++ const prefValue = ask ? SiteContentRadioSetting.ASK : ++ enabled ? SiteContentRadioSetting.ENABLED : + SiteContentRadioSetting.DISABLED; + + this.set('pref_.value', prefValue); diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html --- a/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chrome/browser/resources/settings/site_settings/site_details.html -@@ -274,4 +274,5 @@ +@@ -279,4 +279,5 @@ label="$i18n{siteSettingsAutoPictureInPicture}"> @@ -246,9 +378,24 @@ diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/chrome/browser/resources/settings/site_settings/site_details.ts --- a/chrome/browser/resources/settings/site_settings/site_details.ts +++ b/chrome/browser/resources/settings/site_settings/site_details.ts -@@ -61,7 +61,21 @@ export class SiteDetailsElement extends SiteDetailsElementBase { +@@ -60,8 +60,39 @@ export class SiteDetailsElement extends SiteDetailsElementBase { + return 'site-details'; } ++ static getSettingTemplate(template: HTMLTemplateElement, ++ name: string) : SiteDetailsPermissionElement | undefined { ++ let value : SiteDetailsPermissionElement | undefined = undefined; ++ template.content.querySelectorAll("site-details-permission").forEach( ++ (element: any) => { ++ let setting = element.getAttribute("category") ++ .replace("[[contentSettingsTypesEnum_.", "") ++ .replace("]]", ""); ++ if ((ContentSettingsTypes as any)[setting] === name) ++ value = element; ++ }); ++ return value; ++ } ++ static get template() { - return getTemplate(); + let template = getTemplate(); @@ -258,6 +405,9 @@ diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/c + let obj = JSON.parse(loadTimeData.getString("br_cs_" + index)); + let name = obj["name"]; + ++ if (this.getSettingTemplate(template, name)) ++ continue; ++ + let tag = document.createElement("site-details-permission"); + tag.setAttribute("category", name); + tag.setAttribute("icon", `br-settings:${name}`); @@ -269,10 +419,167 @@ diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/c } static get properties() { +diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.html b/chrome/browser/resources/settings/site_settings/site_details_permission.html +--- a/chrome/browser/resources/settings/site_settings/site_details_permission.html ++++ b/chrome/browser/resources/settings/site_settings/site_details_permission.html +@@ -49,7 +49,9 @@ + + + + +
+diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.ts b/chrome/browser/resources/settings/site_settings/site_details_permission.ts +--- a/chrome/browser/resources/settings/site_settings/site_details_permission.ts ++++ b/chrome/browser/resources/settings/site_settings/site_details_permission.ts +@@ -20,6 +20,7 @@ import {WebUiListenerMixin} from 'chrome://resources/cr_elements/web_ui_listener + import {assert, assertNotReached} from 'chrome://resources/js/assert.js'; + import {sanitizeInnerHtml} from 'chrome://resources/js/parse_html_subset.js'; + import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; ++import {loadTimeData} from '../i18n_setup.js'; + + import {ChooserType, ContentSetting, ContentSettingsTypes, SiteSettingSource} from './constants.js'; + import {getTemplate} from './site_details_permission.html.js'; +@@ -267,15 +268,28 @@ export class SiteDetailsPermissionElement extends + return ''; + } + ++ let obj = this.getSettingData(category); + if (defaultSetting === ContentSetting.ASK || + defaultSetting === ContentSetting.IMPORTANT_CONTENT) { ++ if (obj) { ++ let v = this.askSettingString_(category, ""); ++ if (v !== "") return "(Default) " + v; ++ } + return this.i18n('siteSettingsActionAskDefault'); + } else if (defaultSetting === ContentSetting.ALLOW) { ++ if (obj) { ++ let v = this.allowSettingString_(category, ""); ++ if (v !== "") return "(Default) " + v; ++ } + if (this.useCustomSoundLabels_(category) && useAutomaticLabel) { + return this.i18n('siteSettingsActionAutomaticDefault'); + } + return this.i18n('siteSettingsActionAllowDefault'); + } else if (defaultSetting === ContentSetting.BLOCK) { ++ if (obj) { ++ let v = this.blockSettingString_(category, "", ""); ++ if (v !== "") return "(Default) " + v; ++ } + if (this.useCustomSoundLabels_(category)) { + return this.i18n('siteSettingsActionMuteDefault'); + } +@@ -294,12 +308,40 @@ export class SiteDetailsPermissionElement extends + private blockSettingString_( + category: ContentSettingsTypes, blockString: string, + muteString: string): string { ++ let obj = this.getSettingData(category); ++ if (obj) { ++ let propertyName = "brSiteSettings" + obj["name"] + "Blocked"; ++ if (loadTimeData.valueExists(propertyName)) ++ return loadTimeData.getString(propertyName); ++ } + if (this.useCustomSoundLabels_(category)) { + return muteString; + } + return blockString; + } + ++ private allowSettingString_( ++ category: ContentSettingsTypes, defaultString: string): string { ++ let obj = this.getSettingData(category); ++ if (obj) { ++ let propertyName = "brSiteSettings" + obj["name"] + "Allowed"; ++ if (loadTimeData.valueExists(propertyName)) ++ return loadTimeData.getString(propertyName); ++ } ++ return defaultString; ++ } ++ ++ private askSettingString_( ++ category: ContentSettingsTypes, defaultString: string): string { ++ let obj = this.getSettingData(category); ++ if (obj) { ++ let propertyName = "brSiteSettings" + obj["name"] + "Ask"; ++ if (loadTimeData.valueExists(propertyName)) ++ return loadTimeData.getString(propertyName); ++ } ++ return defaultString; ++ } ++ + /** + * @return true if |this| should be hidden. + */ +@@ -385,6 +427,8 @@ export class SiteDetailsPermissionElement extends + private showAskSetting_( + category: ContentSettingsTypes, setting: ContentSetting, + source: SiteSettingSource): boolean { ++ let obj = this.getSettingData(category); ++ if (obj) return obj["allowed_ask"] === "1"; + // For chooser-based permissions 'ask' takes the place of 'allow'. + if (category === ContentSettingsTypes.SERIAL_PORTS || + category === ContentSettingsTypes.USB_DEVICES || +diff --git a/chrome/browser/resources/settings/site_settings/site_settings_mixin.ts b/chrome/browser/resources/settings/site_settings/site_settings_mixin.ts +--- a/chrome/browser/resources/settings/site_settings/site_settings_mixin.ts ++++ b/chrome/browser/resources/settings/site_settings/site_settings_mixin.ts +@@ -11,6 +11,7 @@ import {dedupingMixin, PolymerElement} from 'chrome://resources/polymer/v3_0/pol + + import {ContentSetting,ContentSettingsTypes, SiteSettingSource} from './constants.js'; + import {RawSiteException,SiteException,SiteSettingsPrefsBrowserProxy,SiteSettingsPrefsBrowserProxyImpl} from './site_settings_prefs_browser_proxy.js'; ++import {loadTimeData} from '../i18n_setup.js'; + // clang-format on + + type Constructor = new (...args: any[]) => T; +@@ -91,6 +92,21 @@ export const SiteSettingsMixin = dedupingMixin( + return setting !== ContentSetting.BLOCK; + } + ++ computeIsSettingAsk(setting: ContentSetting): boolean { ++ return setting === ContentSetting.ASK; ++ } ++ ++ getSettingData(category: ContentSettingsTypes): any { ++ for (let index=0; index < loadTimeData.getInteger("br_cs_count"); index++) { ++ let obj = JSON.parse(loadTimeData.getString("br_cs_" + index)); ++ let name = obj["name"]; ++ if (name == category) { ++ return obj; ++ } ++ } ++ return undefined; ++ } ++ + /** + * Converts a string origin/pattern to a URL. + * @param originOrPattern The origin/pattern to convert to URL. +@@ -171,6 +187,8 @@ export interface SiteSettingsMixinInterface { + browserProxy: SiteSettingsPrefsBrowserProxy; + category: ContentSettingsTypes; + computeIsSettingEnabled(setting: string): boolean; ++ computeIsSettingAsk(setting: string): boolean; ++ getSettingData(category: ContentSettingsTypes): any; + originRepresentation(origin: string): string; + toUrl(originOrPattern: string): URL|null; + expandSiteException(exception: RawSiteException): SiteException; diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts -@@ -43,7 +43,7 @@ function getCategoryItemMap(): Map { +@@ -45,7 +45,7 @@ function getCategoryItemMap(): Map { } // The following list is ordered alphabetically by |id|. The order in which // these appear in the UI is determined elsewhere in this file. @@ -281,7 +588,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ { route: routes.SITE_SETTINGS_ADS, id: Id.ADS, -@@ -367,10 +367,34 @@ function getCategoryItemMap(): Map { +@@ -371,10 +371,36 @@ function getCategoryItemMap(): Map { disabledLabel: 'trackingProtectionLinkRowSubLabel', }); } @@ -289,14 +596,16 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ + let obj = JSON.parse(loadTimeData.getString("br_cs_" + index)); + let name = obj["name"]; + -+ categoryList.push({ -+ route: (routes as any)[`SITE_SETTINGS_${name.toUpperCase()}`], -+ id: name, -+ label: `brSiteSettings${name}`, -+ icon: `br-settings:${name}`, -+ enabledLabel: `brSiteSettings${name}Allowed`, -+ disabledLabel: `brSiteSettings${name}Blocked`, -+ }); ++ if (!categoryList.find(x=> x.id == name)) { ++ categoryList.push({ ++ route: (routes as any)[`SITE_SETTINGS_${name.toUpperCase()}`], ++ id: name, ++ label: `brSiteSettings${name}`, ++ icon: `br-settings:${name}`, ++ enabledLabel: `brSiteSettings${name}Allowed`, ++ disabledLabel: `brSiteSettings${name}Blocked`, ++ }); ++ } + } + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); @@ -316,7 +625,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ function buildItemListFromIds(orderedIdList: ContentSettingsTypes[]): CategoryListItem[] { const map = getCategoryItemMap(); -@@ -460,7 +484,7 @@ export class SettingsSiteSettingsPageElement extends +@@ -465,7 +491,7 @@ export class SettingsSiteSettingsPageElement extends Id.IMAGES, Id.POPUPS, ]), @@ -328,7 +637,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page_util.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page_util.ts --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page_util.ts +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page_util.ts -@@ -6,6 +6,54 @@ import {assertNotReached} from 'chrome://resources/js/assert_ts.js'; +@@ -6,6 +6,54 @@ import {assertNotReached} from 'chrome://resources/js/assert.js'; import {ContentSettingsTypes} from '../site_settings/constants.js'; @@ -383,7 +692,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ /** * Determine localization string for i18n for a given content settings type. * Sorted alphabetically by |ContentSettingsType|. -@@ -89,6 +137,13 @@ export function getLocalizationStringForContentType( +@@ -90,6 +138,13 @@ export function getLocalizationStringForContentType( case ContentSettingsTypes.SITE_DATA: return null; default: @@ -400,14 +709,100 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ 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 -@@ -1975,6 +1975,7 @@ static_library("ui") { +@@ -2047,6 +2047,7 @@ static_library("ui") { + "//components/commerce/core/mojom:mojo_bindings", "//components/commerce/core/webui", - "//components/compose/core/browser:features", "//components/endpoint_fetcher:endpoint_fetcher", + "//components/content_settings/core/browser:browser", "//components/enterprise/common:files_scan_data", "//components/feedback/proto", "//components/headless/policy", +diff --git a/chrome/browser/ui/views/controls/rich_controls_container_view.h b/chrome/browser/ui/views/controls/rich_controls_container_view.h +--- a/chrome/browser/ui/views/controls/rich_controls_container_view.h ++++ b/chrome/browser/ui/views/controls/rich_controls_container_view.h +@@ -42,6 +42,13 @@ class RichControlsContainerView : public views::FlexLayoutView { + return AddChildView(std::move(control_view)); + } + ++ template ++ T* AddControlUnderLabel(std::unique_ptr control_view) { ++ control_view->SetProperty(views::kInternalPaddingKey, ++ control_view->GetInsets()); ++ return labels_wrapper_->AddChildView(std::move(control_view)); ++ } ++ + int GetFirstLineHeight(); + gfx::Size FlexRule(const views::View* view, + const views::SizeBounds& maximum_size) const; +diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/browser/ui/views/page_info/page_info_main_view.cc +--- a/chrome/browser/ui/views/page_info/page_info_main_view.cc ++++ b/chrome/browser/ui/views/page_info/page_info_main_view.cc +@@ -49,6 +49,7 @@ + #include "ui/views/controls/separator.h" + #include "ui/views/layout/box_layout.h" + #include "ui/views/layout/flex_layout.h" ++#include "ui/views/layout/table_layout.h" + #include "ui/views/view_class_properties.h" + + #if BUILDFLAG(FULL_SAFE_BROWSING) +@@ -243,8 +244,20 @@ void PageInfoMainView::SetPermissionInfo( + scroll_view->SetDrawOverflowIndicator(false); + auto* content_view = + scroll_view->SetContents(std::make_unique()); +- content_view->SetLayoutManager(std::make_unique()) +- ->SetOrientation(views::LayoutOrientation::kVertical); ++ ++ views::TableLayout* table_layout = ++ content_view->SetLayoutManager(std::make_unique()); ++ table_layout->AddColumn( ++ views::LayoutAlignment::kStretch, views::LayoutAlignment::kStretch, ++ views::TableLayout::kFixedSize, ++ views::TableLayout::ColumnSize::kFixed, ++ /*fixed_width=*/250, /*min_width=*/0) ++ .AddColumn( ++ views::LayoutAlignment::kStretch, views::LayoutAlignment::kStretch, ++ views::TableLayout::kFixedSize, ++ views::TableLayout::ColumnSize::kFixed, ++ /*fixed_width=*/250, /*min_width=*/0) ++ .AddRows(/*n=*/1, views::TableLayout::kFixedSize); + content_view->SetID(PageInfoViewFactory::VIEW_ID_PAGE_INFO_PERMISSION_VIEW); + content_view->SetProperty(views::kElementIdentifierKey, + kPermissionsElementId); +@@ -259,17 +272,24 @@ void PageInfoMainView::SetPermissionInfo( + } + } + ++ int count = 0; + for (const auto& permission : permission_info_list) { ++ if (++count % 2 == 0) ++ table_layout->AddRows(/*n=*/1, views::TableLayout::kFixedSize); + auto* toggle_row = + content_view->AddChildView(std::make_unique( + ui_delegate_, navigation_handler_, permission, should_show_spacer)); + toggle_row->AddObserver(this); ++ toggle_row->SetProperty(views::kMarginsKey, ++ gfx::Insets::TLBR(0, 0, 0, 0)); + toggle_row->SetProperty(views::kCrossAxisAlignmentKey, + views::LayoutAlignment::kStretch); + toggle_rows_.push_back(std::move(toggle_row)); + } + + for (auto& object : chosen_object_info_list) { ++ if (++count % 2 == 0) ++ table_layout->AddRows(/*n=*/1, views::TableLayout::kFixedSize); + // The view takes ownership of the object info. + auto object_view = std::make_unique( + std::move(object), +@@ -280,6 +300,9 @@ void PageInfoMainView::SetPermissionInfo( + content_view->AddChildView(std::move(object_view))); + } + ++ if (++count % 2 == 0) ++ content_view->AddChildView(std::make_unique()); ++ + const int controls_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL); + reset_button_ = content_view->AddChildView( diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc --- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc +++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc @@ -420,8 +815,22 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrom #include "components/page_info/core/features.h" #include "components/page_info/core/proto/about_this_site_metadata.pb.h" #include "components/page_info/page_info.h" -@@ -508,6 +510,17 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( - icon = &vector_icons::kSelectWindowIcon; +@@ -253,7 +255,13 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + ContentSetting setting = info.setting == CONTENT_SETTING_DEFAULT + ? info.default_setting + : info.setting; ++ return GetPermissionIcon(info, setting); ++} + ++// static ++const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( ++ const PageInfo::PermissionInfo& info, ++ ContentSetting setting) { + // For guard content settings and Automatic Picture-in-Picture, ASK is treated + // as an "on" state. + const bool show_blocked_badge = +@@ -507,6 +515,17 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + icon = &vector_icons::kPictureInPictureIcon; break; default: + bool found = false; @@ -438,6 +847,287 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrom // All other |ContentSettingsType|s do not have icons on desktop or are // not shown in the Page Info bubble. NOTREACHED_NORETURN(); +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.h b/chrome/browser/ui/views/page_info/page_info_view_factory.h +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.h ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.h +@@ -83,6 +83,9 @@ class PageInfoViewFactory { + static const ui::ImageModel GetPermissionIcon( + const PageInfo::PermissionInfo& info); + ++ static const ui::ImageModel GetPermissionIcon( ++ const PageInfo::PermissionInfo& info, ContentSetting setting); ++ + // Returns the icon for the given object |info|. + static const ui::ImageModel GetChosenObjectIcon( + const PageInfoUI::ChosenObjectInfo& info, +diff --git a/chrome/browser/ui/views/page_info/permission_toggle_row_view.cc b/chrome/browser/ui/views/page_info/permission_toggle_row_view.cc +--- a/chrome/browser/ui/views/page_info/permission_toggle_row_view.cc ++++ b/chrome/browser/ui/views/page_info/permission_toggle_row_view.cc +@@ -35,6 +35,30 @@ + #include "ui/views/controls/label.h" + #include "ui/views/style/typography.h" + #include "ui/views/view_class_properties.h" ++#include "components/content_settings/core/browser/content_settings_registry.h" ++ ++namespace { ++ bool IsAllowed(const PageInfo::PermissionInfo& permission) { ++ if (permission.setting == CONTENT_SETTING_DEFAULT) ++ return permission.default_setting == CONTENT_SETTING_ALLOW; ++ else ++ return permission.setting == CONTENT_SETTING_ALLOW; ++ } ++ ++ bool IsBlocked(const PageInfo::PermissionInfo& permission) { ++ if (permission.setting == CONTENT_SETTING_DEFAULT) ++ return permission.default_setting == CONTENT_SETTING_BLOCK; ++ else ++ return permission.setting == CONTENT_SETTING_BLOCK; ++ } ++ ++ bool IsAsk(const PageInfo::PermissionInfo& permission) { ++ if (permission.setting == CONTENT_SETTING_DEFAULT) ++ return permission.default_setting == CONTENT_SETTING_ASK; ++ else ++ return permission.setting == CONTENT_SETTING_ASK; ++ } ++} + + PermissionToggleRowView::PermissionToggleRowView( + ChromePageInfoUiDelegate* delegate, +@@ -48,16 +72,12 @@ PermissionToggleRowView::PermissionToggleRowView( + // instead of adding it as the only child. + SetUseDefaultFillLayout(true); + row_view_ = AddChildView(std::make_unique()); ++ row_view_->SetCrossAxisAlignment(views::LayoutAlignment::kCenter); + + std::u16string toggle_accessible_name = + PageInfoUI::PermissionTypeToUIString(permission.type); + row_view_->SetTitle(toggle_accessible_name); + +- // Add extra details as sublabel. +- std::u16string detail = delegate->GetPermissionDetail(permission.type); +- if (!detail.empty()) +- row_view_->AddSecondaryLabel(detail); +- + if (permission.requesting_origin.has_value()) { + std::u16string requesting_origin_string; + switch (permission.type) { +@@ -115,6 +135,90 @@ void PermissionToggleRowView::PermissionChanged() { + } + } + ++void PermissionToggleRowView::OnShowOptionsMenu() { ++ sources_menu_runner_.reset(); ++ ++ ContentSettingsType type = permission_.type; ++ const content_settings::WebsiteSettingsInfo* setting_info = ++ content_settings::WebsiteSettingsRegistry::GetInstance()->Get(type); ++ ++ sources_menu_model_ = std::make_unique(this); ++ if (setting_info->allowed_ui() != 0) { ++ sources_menu_model_->AddCheckItemWithStringId(1, setting_info->allowed_ui()); ++ } else { ++ sources_menu_model_->AddCheckItem(1, u"Enabled"); ++ } ++ sources_menu_model_->SetIcon(sources_menu_model_->GetItemCount() - 1, ++ PageInfoViewFactory::GetPermissionIcon(permission_, CONTENT_SETTING_DEFAULT)); ++ ++ auto* content_setting_registry = ++ content_settings::ContentSettingsRegistry::GetInstance(); ++ auto* content_setting = content_setting_registry->Get(type); ++ if (content_setting->IsSettingValid(CONTENT_SETTING_ASK)) { ++ if (setting_info->ask_ui() != 0) { ++ sources_menu_model_->AddCheckItemWithStringId(3, setting_info->ask_ui()); ++ } else { ++ sources_menu_model_->AddCheckItem(3, u"Ask"); ++ } ++ sources_menu_model_->SetIcon(sources_menu_model_->GetItemCount() - 1, ++ PageInfoViewFactory::GetPermissionIcon(permission_, CONTENT_SETTING_ASK)); ++ } ++ ++ if (setting_info->blocked_ui() != 0) { ++ sources_menu_model_->AddCheckItemWithStringId(2, setting_info->blocked_ui()); ++ } else { ++ sources_menu_model_->AddCheckItem(2, u"Disabled"); ++ } ++ sources_menu_model_->SetIcon(sources_menu_model_->GetItemCount() - 1, ++ PageInfoViewFactory::GetPermissionIcon(permission_, CONTENT_SETTING_BLOCK)); ++ ++ sources_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); ++ sources_menu_model_->AddCheckItem(4, u"Default"); ++ ++ //sources_menu_model_->ActivatedAt(0); ++ ++ // const gfx::Point point = choose_button_->GetMenuPosition(); ++ // const gfx::Point origin(point.x() - width(), point.y() - height()); ++ ++ sources_menu_runner_ = std::make_unique( ++ sources_menu_model_.get(), views::MenuRunner::COMBOBOX); ++ sources_menu_runner_->RunMenuAt( ++ choose_button_->GetWidget(), nullptr, ++ choose_button_->GetAnchorBoundsInScreen(), ++ views::MenuAnchorPosition::kTopLeft, ui::MENU_SOURCE_MOUSE); ++} ++ ++bool PermissionToggleRowView::IsCommandIdChecked(int command_id) const { ++ if (permission_.setting == CONTENT_SETTING_DEFAULT && command_id == 4) { ++ return true; ++ } else if (IsAllowed(permission_)) { ++ return command_id == 1; ++ } else if (IsBlocked(permission_)) { ++ return command_id == 2; ++ } else if (IsAsk(permission_)) { ++ return command_id == 3; ++ } ++ return false; ++} ++ ++void PermissionToggleRowView::ExecuteCommand(int command_id, int event_flags) { ++ switch(command_id) { ++ case 1: ++ permission_.setting = CONTENT_SETTING_ALLOW; ++ break; ++ case 2: ++ permission_.setting = CONTENT_SETTING_BLOCK; ++ break; ++ case 3: ++ permission_.setting = CONTENT_SETTING_ASK; ++ break; ++ case 4: ++ permission_.setting = CONTENT_SETTING_DEFAULT; ++ break; ++ } ++ PermissionChanged(); ++} ++ + void PermissionToggleRowView::OnToggleButtonPressed() { + PageInfoUI::ToggleBetweenAllowAndBlock(permission_); + PermissionChanged(); +@@ -123,24 +227,19 @@ void PermissionToggleRowView::OnToggleButtonPressed() { + void PermissionToggleRowView::InitForUserSource( + bool should_show_spacer_view, + const std::u16string& toggle_accessible_name) { +- const int icon_label_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( +- views::DISTANCE_RELATED_LABEL_HORIZONTAL); +- +- auto toggle_button = std::make_unique( +- base::BindRepeating(&PermissionToggleRowView::OnToggleButtonPressed, +- base::Unretained(this))); ++ auto toggle_button = std::make_unique( ++ base::BindRepeating(&PermissionToggleRowView::OnShowOptionsMenu, ++ base::Unretained(this)), ++ u""); ++ toggle_button->SetStyle(ui::ButtonStyle::kText); ++ toggle_button->SetHorizontalAlignment(gfx::ALIGN_LEFT); + toggle_button->SetID( + PageInfoViewFactory::VIEW_ID_PERMISSION_TOGGLE_ROW_TOGGLE_BUTTON); +- toggle_button->SetPreferredSize( +- gfx::Size(toggle_button->GetPreferredSize().width(), +- row_view_->GetFirstLineHeight())); +- toggle_button->SetProperty(views::kMarginsKey, +- gfx::Insets::VH(0, icon_label_spacing)); + toggle_button->SetTooltipText(PageInfoUI::PermissionTooltipUiString( + permission_.type, permission_.requesting_origin)); + toggle_button->SetAccessibleName(toggle_accessible_name); + +- toggle_button_ = row_view_->AddControl(std::move(toggle_button)); ++ choose_button_ = row_view_->AddControlUnderLabel(std::move(toggle_button)); + + const int icon_size = GetLayoutConstant(PAGE_INFO_ICON_SIZE); + // TODO(crbug.com/1011533): Remove separate handling of +@@ -187,9 +286,6 @@ void PermissionToggleRowView::InitForUserSource( + auto spacer_view = std::make_unique(); + spacer_view->SetPreferredSize(gfx::Size(icon_size, icon_size)); + spacer_view_ = row_view_->AddControl(std::move(spacer_view)); +- } else { +- toggle_button_->SetProperty( +- views::kMarginsKey, gfx::Insets::TLBR(0, icon_label_spacing, 0, 0)); + } + } + } +@@ -245,6 +341,33 @@ void PermissionToggleRowView::UpdateUiOnPermissionChanged() { + state_label_ = row_view_->AddSecondaryLabel(state_text); + } + } ++ ++ if (choose_button_) { ++ ContentSettingsType type = permission_.type; ++ const content_settings::WebsiteSettingsInfo* setting_info = ++ content_settings::WebsiteSettingsRegistry::GetInstance()->Get(type); ++ ++ std::u16string caption; ++ if (IsAllowed(permission_)) { ++ if (setting_info->allowed_ui() != 0) ++ caption = l10n_util::GetStringUTF16(setting_info->allowed_ui()); ++ else ++ caption = u"Allowed"; ++ } else if (IsBlocked(permission_)) { ++ if (setting_info->blocked_ui() != 0) ++ caption = l10n_util::GetStringUTF16(setting_info->blocked_ui()); ++ else ++ caption = u"Blocked"; ++ } else if (IsAsk(permission_)) { ++ if (setting_info->ask_ui() != 0) ++ caption = l10n_util::GetStringUTF16(setting_info->ask_ui()); ++ else ++ caption = u"Ask"; ++ } else { ++ caption = u"Unknown"; ++ } ++ choose_button_->SetText(caption); ++ } + } + + void PermissionToggleRowView::ResetPermission() { +diff --git a/chrome/browser/ui/views/page_info/permission_toggle_row_view.h b/chrome/browser/ui/views/page_info/permission_toggle_row_view.h +--- a/chrome/browser/ui/views/page_info/permission_toggle_row_view.h ++++ b/chrome/browser/ui/views/page_info/permission_toggle_row_view.h +@@ -14,6 +14,11 @@ + #include "ui/base/metadata/metadata_header_macros.h" + #include "ui/views/view.h" + ++#include "components/content_settings/core/browser/website_settings_registry.h" ++#include "chrome/browser/ui/views/controls/md_text_button_with_down_arrow.h" ++#include "ui/base/models/simple_menu_model.h" ++#include "ui/views/controls/menu/menu_runner.h" ++ + class ChromePageInfoUiDelegate; + class PageInfoNavigationHandler; + +@@ -29,7 +34,8 @@ class PageInfoBubbleViewTestApi; + // A view that shows a permission that a site is able to access, and + // allows the user to control via toggle whether that access is granted. Has a + // button that opens a subpage with more controls. +-class PermissionToggleRowView : public views::View { ++class PermissionToggleRowView : public views::View, ++ public ui::SimpleMenuModel::Delegate { + public: + METADATA_HEADER(PermissionToggleRowView); + PermissionToggleRowView(ChromePageInfoUiDelegate* delegate, +@@ -52,6 +58,12 @@ class PermissionToggleRowView : public views::View { + private: + friend class test::PageInfoBubbleViewTestApi; + ++ void OnShowOptionsMenu(); ++ ++ // ui::SimpleMenuModel::Delegate overrides: ++ bool IsCommandIdChecked(int command_id) const override; ++ void ExecuteCommand(int command_id, int event_flags) override; ++ + void OnToggleButtonPressed(); + void InitForUserSource(bool should_show_spacer_view, + const std::u16string& toggle_accessible_name); +@@ -65,6 +77,10 @@ class PermissionToggleRowView : public views::View { + raw_ptr toggle_button_ = nullptr; + raw_ptr spacer_view_ = nullptr; + ++ raw_ptr choose_button_ = nullptr; ++ std::unique_ptr sources_menu_model_; ++ std::unique_ptr sources_menu_runner_; ++ + raw_ptr delegate_ = nullptr; + raw_ptr navigation_handler_ = + nullptr; diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc @@ -449,34 +1139,47 @@ diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provide #include "build/branding_buildflags.h" #include "build/build_config.h" #include "build/buildflag.h" -@@ -72,6 +73,8 @@ +@@ -72,6 +73,9 @@ #include "components/google/core/common/google_util.h" #include "components/history/core/common/pref_names.h" #include "components/omnibox/common/omnibox_features.h" ++#include "components/content_settings/core/browser/content_settings_registry.h" +#include "components/content_settings/core/browser/website_settings_info.h" +#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/password_manager/core/browser/leak_detection_dialog_utils.h" #include "components/password_manager/core/browser/manage_passwords_referrer.h" #include "components/password_manager/core/common/password_manager_features.h" -@@ -3631,6 +3634,42 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, +@@ -3628,6 +3632,56 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, policy_indicator::AddLocalizedStrings(html_source); AddSecurityKeysStrings(html_source); + content_settings::WebsiteSettingsRegistry* website_settings = + content_settings::WebsiteSettingsRegistry::GetInstance(); ++ auto* content_setting_registry = ++ content_settings::ContentSettingsRegistry::GetInstance(); + int index = 0; + for (const content_settings::WebsiteSettingsInfo* info : *website_settings) { + if (info->desktop_ui()) { ++ auto* content_setting = content_setting_registry->Get(info->type()); + std::string name = info->name(); + std::string prefix = "brSiteSettings" + name; + -+ html_source->AddLocalizedString(prefix, info->title_ui()); -+ html_source->AddLocalizedString(prefix + "Description", info->description_ui()); -+ html_source->AddLocalizedString(prefix + "Allowed", info->allowed_ui()); -+ html_source->AddLocalizedString(prefix + "Blocked", info->blocked_ui()); -+ html_source->AddLocalizedString(prefix + "AllowedExceptions", info->allowed_exceptions_ui()); -+ html_source->AddLocalizedString(prefix + "BlockedExceptions", info->blocked_exceptions_ui()); -+ html_source->AddLocalizedString(prefix + "MidSentence", info->mid_sentence_ui()); ++ if (info->title_ui()) ++ html_source->AddLocalizedString(prefix, info->title_ui()); ++ if (info->description_ui()) ++ html_source->AddLocalizedString(prefix + "Description", info->description_ui()); ++ if (info->allowed_ui()) ++ html_source->AddLocalizedString(prefix + "Allowed", info->allowed_ui()); ++ if (info->blocked_ui()) ++ html_source->AddLocalizedString(prefix + "Blocked", info->blocked_ui()); ++ if (info->ask_ui()) ++ html_source->AddLocalizedString(prefix + "Ask", info->ask_ui()); ++ if (info->allowed_exceptions_ui()) ++ html_source->AddLocalizedString(prefix + "AllowedExceptions", info->allowed_exceptions_ui()); ++ if (info->blocked_exceptions_ui()) ++ html_source->AddLocalizedString(prefix + "BlockedExceptions", info->blocked_exceptions_ui()); ++ if (info->mid_sentence_ui()) ++ html_source->AddLocalizedString(prefix + "MidSentence", info->mid_sentence_ui()); + + base::Value::Dict dict; + dict.Set("name", name); @@ -486,6 +1189,8 @@ diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provide + info->initial_default_value().GetInt() == (int)CONTENT_SETTING_ALLOW ? "allow" : + info->initial_default_value().GetInt() == (int)CONTENT_SETTING_BLOCK ? "block" : + "ask"); ++ dict.Set("allowed_ask", ++ content_setting->IsSettingValid(CONTENT_SETTING_ASK) ? "1" : "0"); + + std::string json_string; + base::JSONWriter::WriteWithOptions( @@ -504,7 +1209,7 @@ diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provide diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc --- a/chrome/browser/ui/webui/settings/site_settings_helper.cc +++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc -@@ -41,6 +41,8 @@ +@@ -42,6 +42,8 @@ #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -513,7 +1218,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_utils.h" -@@ -206,7 +208,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { +@@ -209,7 +211,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { static_assert(std::size(kContentSettingsTypeGroupNames) == // ContentSettingsType starts at -1, so add 1 here. @@ -522,7 +1227,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b "kContentSettingsTypeGroupNames should have " "CONTENT_SETTINGS_NUM_TYPES elements"); -@@ -461,6 +463,13 @@ bool HasRegisteredGroupName(ContentSettingsType type) { +@@ -462,6 +464,13 @@ bool HasRegisteredGroupName(ContentSettingsType type) { return true; } } @@ -536,7 +1241,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b return false; } -@@ -474,11 +483,24 @@ ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { +@@ -475,11 +484,24 @@ ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { return entry.type; } } @@ -562,7 +1267,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b for (const auto& entry : kContentSettingsTypeGroupNames) { if (type == entry.type) { // Content setting types that aren't represented in the settings UI -@@ -493,7 +515,6 @@ base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type) { +@@ -494,7 +516,6 @@ base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type) { return entry.name ? entry.name : base::StringPiece(); } } @@ -570,7 +1275,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b NOTREACHED() << static_cast(type) << " is not a recognized content settings type."; return base::StringPiece(); -@@ -573,6 +594,13 @@ const std::vector& GetVisiblePermissionCategories() { +@@ -574,6 +595,13 @@ const std::vector& GetVisiblePermissionCategories() { base_types->push_back(ContentSettingsType::MIDI_SYSEX); } @@ -584,10 +1289,173 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b initialized = true; } +diff --git a/components/browser_ui/settings/android/BUILD.gn b/components/browser_ui/settings/android/BUILD.gn +--- a/components/browser_ui/settings/android/BUILD.gn ++++ b/components/browser_ui/settings/android/BUILD.gn +@@ -82,6 +82,7 @@ android_resources("java_resources") { + "java/res/layout/managed_disclaimer_preference_for_radio_groups.xml", + "java/res/layout/preference_chrome_image_view.xml", + "java/res/layout/preference_spinner.xml", ++ "java/res/layout/preference_spinner_single_widget.xml", + "java/res/layout/preference_spinner_single_line.xml", + "java/res/layout/preference_spinner_single_line_item.xml", + "java/res/layout/settings_action_bar_shadow.xml", +diff --git a/components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml b/components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml +new file mode 100644 +--- /dev/null ++++ b/components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml +@@ -0,0 +1,92 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/SpinnerPreference.java b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/SpinnerPreference.java +--- a/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/SpinnerPreference.java ++++ b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/SpinnerPreference.java +@@ -23,6 +23,7 @@ public class SpinnerPreference extends Preference { + private ArrayAdapter mAdapter; + private int mSelectedIndex; + private final boolean mSingleLine; ++ private boolean mIsWidget = false; + + /** Constructor for inflating from XML. */ + public SpinnerPreference(Context context, AttributeSet attrs) { +@@ -37,6 +38,19 @@ public class SpinnerPreference extends Preference { + } + } + ++ public SpinnerPreference(Context context, boolean singleLine) { ++ super(context, null); ++ mSingleLine = singleLine; ++ mIsWidget = true; ++ setLayoutResource(R.layout.preference_spinner_single_widget); ++ } ++ ++ @Override ++ protected void onClick() { ++ if (mIsWidget) ++ mSpinner.performClick(); ++ } ++ + /** + * Provides a list of arbitrary objects to be shown in the spinner. Visually, each option will + * be presented as its toString() text. Alternative to {@link #setAdapter(ArrayAdapter, int)}. +@@ -56,6 +70,12 @@ public class SpinnerPreference extends Preference { + mSelectedIndex = selectedIndex; + } + ++ public void setSelectedIndex(int selectedIndex) { ++ mSelectedIndex = selectedIndex; ++ if (mSpinner != null) ++ mSpinner.setSelection(mSelectedIndex); ++ } ++ + /** Returns the Spinner instance for introspection during tests. */ + public Spinner getSpinnerForTesting() { + return mSpinner; +@@ -88,6 +108,10 @@ public class SpinnerPreference extends Preference { + public void onBindViewHolder(PreferenceViewHolder holder) { + super.onBindViewHolder(holder); + ++ if (mIsWidget) { ++ holder.setDividerAllowedAbove(true); ++ holder.setDividerAllowedBelow(true); ++ } + ((TextView) holder.findViewById(R.id.title)).setText(getTitle()); + CharSequence summary = getSummary(); + TextView summaryView = ((TextView) holder.findViewById(R.id.summary)); diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn --- a/components/browser_ui/site_settings/android/BUILD.gn +++ b/components/browser_ui/site_settings/android/BUILD.gn -@@ -149,6 +149,21 @@ android_library("java") { +@@ -149,6 +149,23 @@ android_library("java") { ":site_settings_jni_headers", "//components/content_settings/android:java_pref_names_srcjar", ] @@ -605,11 +1473,13 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b + +java_bromite_impl("java_bromite_content_settings") { + inputs = [ "java/src/org/chromium/components/browser_ui/site_settings/impl/include_all_directory.java" ] ++ namespace = "org.chromium.components.browser_ui.site_settings.impl" + template = "java/src/org/chromium/components/browser_ui/site_settings/impl/java_template/BromiteCustomContentSettingImplBase.java.tmpl" ++ static_classes = false } android_library("javatests") { -@@ -194,6 +209,7 @@ robolectric_library("junit") { +@@ -194,6 +211,7 @@ robolectric_library("junit") { } android_resources("java_resources") { @@ -620,17 +1490,20 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AllSiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AllSiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AllSiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/AllSiteSettings.java -@@ -346,11 +346,14 @@ public class AllSiteSettings extends BaseSiteSettingsFragment - if (queryHasChanged) getInfoForOrigins(); - }); +@@ -366,7 +366,8 @@ public class AllSiteSettings extends BaseSiteSettingsFragment + if (queryHasChanged) getInfoForOrigins(); + }); - if (getSiteSettingsDelegate().isHelpAndFeedbackEnabled()) { + if (getSiteSettingsDelegate().isHelpAndFeedbackEnabled() || + BromiteCustomContentSettingImpl.isHelpAndFeedbackEnabled(mCategory)) { - MenuItem help = menu.add( - Menu.NONE, R.id.menu_id_site_settings_help, Menu.NONE, R.string.menu_help); - help.setIcon(TraceEventVectorDrawableCompat.create( - getResources(), R.drawable.ic_help_and_feedback, getContext().getTheme())); + MenuItem help = + menu.add( + Menu.NONE, +@@ -378,6 +379,8 @@ public class AllSiteSettings extends BaseSiteSettingsFragment + getResources(), + R.drawable.ic_help_and_feedback, + getContext().getTheme())); + if (!BromiteCustomContentSettingImpl.isHelpAndFeedbackEnabled(mCategory)) + help.setVisible(false); } @@ -640,7 +1513,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c new file mode 100644 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java -@@ -0,0 +1,139 @@ +@@ -0,0 +1,155 @@ +/* + This file is part of Bromite. + @@ -660,6 +1533,8 @@ new file mode 100644 + +package org.chromium.components.browser_ui.site_settings; + ++import android.content.Context; ++ +import org.chromium.components.browser_ui.site_settings.ContentSettingsResources; +import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; +import org.chromium.components.content_settings.ContentSettingValues; @@ -716,6 +1591,20 @@ new file mode 100644 + return mDefaultDisabledValue; + } + ++ public Preference createWebSitePreference(Context context, ++ @ContentSettingValues @Nullable Integer value) { ++ return null; ++ } ++ ++ public boolean setWebSitePreferenceValue(Preference preference, ++ @ContentSettingValues @Nullable Integer value) { ++ return false; ++ } ++ ++ public Integer getWebSitePreferenceValue(Object newValue) { ++ return null; ++ } ++ + public String getPreferenceKey() { + return mPreferenceKey; + } @@ -784,7 +1673,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c new file mode 100644 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java -@@ -0,0 +1,307 @@ +@@ -0,0 +1,409 @@ +/* + This file is part of Bromite. + @@ -807,6 +1696,8 @@ new file mode 100644 +import android.app.Activity; +import android.content.Context; + ++import org.chromium.base.Log; ++import org.chromium.components.browser_ui.settings.SpinnerPreference; +import org.chromium.components.browser_ui.site_settings.ContentSettingsResources; +import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; +import org.chromium.components.content_settings.ContentSettingValues; @@ -827,6 +1718,27 @@ new file mode 100644 +public abstract class BromiteCustomContentSettingImpl + extends BromiteCustomContentSettingImplBase { + ++ static class ContentSettingsSpinnerOption { ++ private @ContentSettingValues int mValue; ++ private String mDescription; ++ ++ public ContentSettingsSpinnerOption( ++ @ContentSettingValues int value, ++ String description) { ++ mValue = value; ++ mDescription = description; ++ } ++ ++ public @ContentSettingValues int getValue() { ++ return mValue; ++ } ++ ++ @Override ++ public String toString() { ++ return mDescription; ++ } ++ } ++ + public static SiteSettingsCategory createFromType( + BrowserContextHandle browserContextHandle, @SiteSettingsCategory.Type int type) { + for (BromiteCustomContentSetting cs : mItemList) { @@ -850,6 +1762,85 @@ new file mode 100644 + return null; + } + ++ public static Preference createWebSitePreference( ++ @ContentSettingsType int type, ++ Context context, ++ @ContentSettingValues @Nullable Integer value) { ++ BromiteCustomContentSetting cs = getContentSetting(type); ++ if (cs != null) { ++ Preference pref = cs.createWebSitePreference(context, value); ++ if (pref != null) return pref; ++ ++ if (cs.requiresTriStateContentSetting()) { ++ int[] descriptions = cs.getTriStateSettingDescriptionIDs(); ++ ++ List options = new ArrayList<>(); ++ options.add(new ContentSettingsSpinnerOption( ++ ContentSettingValues.ALLOW, ++ context.getText(descriptions[0]).toString())); ++ options.add(new ContentSettingsSpinnerOption( ++ ContentSettingValues.ASK, ++ context.getText(descriptions[1]).toString())); ++ options.add(new ContentSettingsSpinnerOption( ++ ContentSettingValues.BLOCK, ++ context.getText(descriptions[2]).toString())); ++ ++ SpinnerPreference spinner = new SpinnerPreference(context, true); ++ spinner.setOptions(options.toArray(), ++ GetContentSettingValuesIndex(value)); ++ return spinner; ++ } ++ } ++ return null; ++ } ++ ++ private static int GetContentSettingValuesIndex( ++ @ContentSettingValues @Nullable Integer value) { ++ if (value == null) ++ return 0; ++ else if (value == ContentSettingValues.ALLOW) ++ return 0; ++ else if (value == ContentSettingValues.ASK) ++ return 1; ++ else if (value == ContentSettingValues.BLOCK) ++ return 2; ++ return 0; ++ } ++ ++ public static void setWebSitePreferenceValue( ++ @ContentSettingsType int type, ++ Preference preference, ++ @ContentSettingValues @Nullable Integer value) { ++ BromiteCustomContentSetting cs = getContentSetting(type); ++ if (cs != null) { ++ if (cs.setWebSitePreferenceValue(preference, value)) ++ return; ++ if (cs.requiresTriStateContentSetting() && value != null && ++ preference instanceof SpinnerPreference) { ++ ((SpinnerPreference)preference).setSelectedIndex( ++ GetContentSettingValuesIndex(value)); ++ return; ++ } ++ } ++ return; ++ } ++ ++ public static Integer getWebSitePreferenceValue( ++ @ContentSettingsType int type, ++ Object newValue) { ++ BromiteCustomContentSetting cs = getContentSetting(type); ++ if (cs != null) { ++ Integer permission = cs.getWebSitePreferenceValue(newValue); ++ if (permission != null) return permission; ++ ++ if (cs.requiresTriStateContentSetting() && ++ newValue instanceof ContentSettingsSpinnerOption) { ++ return ((ContentSettingsSpinnerOption)newValue).getValue(); ++ } ++ } ++ return null; ++ } ++ + public static @Nullable String getPreferenceKey(@SiteSettingsCategory.Type int type) { + for (BromiteCustomContentSetting cs : mItemList) { + if (type == cs.getSiteSettingsCategory()) { @@ -1124,34 +2115,34 @@ new file mode 100644 diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java -@@ -39,7 +39,7 @@ public class ContentSettingsResources { - /** - * An inner class contains all the resources for a ContentSettingsType - */ +@@ -37,7 +37,7 @@ import org.chromium.device.DeviceFeatureMap; + @SuppressLint("UseSparseArrays") + public class ContentSettingsResources { + /** An inner class contains all the resources for a ContentSettingsType */ - private static class ResourceItem { + public static class ResourceItem { private final int mIcon; private final int mTitle; private final @ContentSettingValues @Nullable Integer mDefaultEnabledValue; -@@ -47,7 +47,7 @@ public class ContentSettingsResources { - private final int mEnabledSummary; +@@ -46,7 +46,7 @@ public class ContentSettingsResources { private final int mDisabledSummary; + private final int mSummaryOverrideForScreenReader; -- ResourceItem(int icon, int title, -+ public ResourceItem(int icon, int title, +- ResourceItem( ++ public ResourceItem( + int icon, + int title, @ContentSettingValues @Nullable Integer defaultEnabledValue, - @ContentSettingValues @Nullable Integer defaultDisabledValue, int enabledSummary, - int disabledSummary) { -@@ -309,6 +309,8 @@ public class ContentSettingsResources { - ContentSettingValues.BLOCK, R.string.website_settings_category_vr_ask, - R.string.website_settings_category_vr_blocked); +@@ -437,6 +437,8 @@ public class ContentSettingsResources { + R.string.website_settings_category_vr_blocked, + R.string.website_settings_category_vr_a11y); } + ResourceItem ri = BromiteCustomContentSettingImpl.getResourceItem(contentType); + if (ri != null) return ri; assert false; // NOTREACHED return null; } -@@ -474,6 +476,12 @@ public class ContentSettingsResources { +@@ -617,6 +619,12 @@ public class ContentSettingsResources { } } @@ -1164,7 +2155,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c /** * Returns the string resource id for a content type to show with a permission category. * @param enabled Whether the content type is enabled. -@@ -609,6 +617,8 @@ public class ContentSettingsResources { +@@ -769,6 +777,8 @@ public class ContentSettingsResources { * Blocked states, in that order. */ public static int[] getTriStateSettingDescriptionIDs(int contentType) { @@ -1172,14 +2163,14 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + if (value != null) return value; if (contentType == ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER) { int[] descriptionIDs = { - R.string.website_settings_category_protected_content_allowed_recommended, + R.string.website_settings_category_protected_content_allowed_recommended, diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java -@@ -310,6 +310,10 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - @ContentSettingValues - Integer contentSetting = website.site().getContentSetting( - browserContextHandle, mCategory.getContentSettingsType()); +@@ -337,6 +337,10 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + website.site() + .getContentSetting( + browserContextHandle, mCategory.getContentSettingsType()); + if (contentSetting != null && + BromiteCustomContentSettingImpl.processOnBlockList(contentSetting, contentSetting)) { + return BromiteCustomContentSettingImpl.isOnBlockList(contentSetting, website, contentSetting); @@ -1187,25 +2178,28 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (contentSetting != null) { return ContentSettingValues.BLOCK == contentSetting; } -@@ -469,6 +473,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - ? new HashSet<>(getArguments().getStringArrayList(EXTRA_SELECTED_DOMAINS)) - : null; +@@ -501,6 +505,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + ? new HashSet<>(getArguments().getStringArrayList(EXTRA_SELECTED_DOMAINS)) + : null; + BromiteCustomContentSettingImpl.onActivityCreated(this); configureGlobalToggles(); if (mCategory.getType() == SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE) { RecordUserAction.record("DesktopSiteContentSetting.SettingsPage.Entered"); -@@ -493,17 +498,26 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - if (queryHasChanged) getInfoForOrigins(); - }); +@@ -531,7 +536,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + if (queryHasChanged) getInfoForOrigins(); + }); - if (getSiteSettingsDelegate().isHelpAndFeedbackEnabled()) { + if (getSiteSettingsDelegate().isHelpAndFeedbackEnabled() || + BromiteCustomContentSettingImpl.isHelpAndFeedbackEnabled(mCategory)) { - MenuItem help = menu.add( - Menu.NONE, R.id.menu_id_site_settings_help, Menu.NONE, R.string.menu_help); - help.setIcon(TraceEventVectorDrawableCompat.create( - getResources(), R.drawable.ic_help_and_feedback, getContext().getTheme())); + MenuItem help = + menu.add( + Menu.NONE, +@@ -543,12 +549,20 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + getResources(), + R.drawable.ic_help_and_feedback, + getContext().getTheme())); + if (!BromiteCustomContentSettingImpl.isHelpAndFeedbackEnabled(mCategory)) + help.setVisible(false); } @@ -1221,9 +2215,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + return true; + } if (mCategory.getType() == SiteSettingsCategory.Type.PROTECTED_MEDIA) { - getSiteSettingsDelegate().launchProtectedContentHelpAndFeedbackActivity( - getActivity()); -@@ -577,6 +591,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + getSiteSettingsDelegate() + .launchProtectedContentHelpAndFeedbackActivity(getActivity()); +@@ -620,6 +634,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment BrowserContextHandle browserContextHandle = getSiteSettingsDelegate().getBrowserContextHandle(); PrefService prefService = UserPrefs.get(browserContextHandle); @@ -1235,8 +2229,8 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (BINARY_TOGGLE_KEY.equals(preference.getKey())) { assert !mCategory.isManaged(); boolean toggleValue = (boolean) newValue; -@@ -796,6 +815,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - : R.string.website_settings_allowed_group_heading_request_desktop_site; +@@ -817,6 +836,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + .website_settings_allowed_group_heading_request_desktop_site; break; } + if (resource == 0) @@ -1244,16 +2238,16 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c assert resource > 0; return getString(resource); } -@@ -914,6 +935,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -934,6 +955,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment default: break; } + Boolean allow = BromiteCustomContentSettingImpl.allowSpecifyingExceptions(mCategory); + if (allow != null) allowSpecifyingExceptions = (boolean)allow; if (allowSpecifyingExceptions) { - getPreferenceScreen().addPreference(new AddExceptionPreference(getStyledContext(), - ADD_EXCEPTION_KEY, getAddExceptionDialogMessage(), mCategory, this)); -@@ -1085,8 +1108,16 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + getPreferenceScreen() + .addPreference( +@@ -1122,8 +1145,16 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment private boolean isBlocked() { switch (mGlobalToggleLayout) { case GlobalToggleLayout.TRI_STATE_TOGGLE: @@ -1268,11 +2262,11 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c getPreferenceScreen().findPreference(TRI_STATE_TOGGLE_KEY); + if (triStateToggle == null) return true; return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK); - case GlobalToggleLayout.FOUR_STATE_COOKIE_TOGGLE: - FourStateCookieSettingsPreference fourStateCookieToggle = -@@ -1165,7 +1196,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - } else if (mCategory.getType() == SiteSettingsCategory.Type.THIRD_PARTY_COOKIES) { - infoText.setSummary(R.string.website_settings_third_party_cookies_page_description); + case GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE: + TriStateCookieSettingsPreference triStateCookieToggle = +@@ -1190,7 +1221,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + } else if (mCategory.getType() == SiteSettingsCategory.Type.STORAGE_ACCESS) { + infoText.setSummary(getStorageAccessSummary()); } else { - screen.removePreference(infoText); + int infoMessage = BromiteCustomContentSettingImpl.getCategoryDescription(mCategory); @@ -1283,7 +2277,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } // Hide the anti-abuse text preferences, as needed. -@@ -1189,6 +1224,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1214,6 +1249,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment screen.removePreference(antiAbuseThingsToConsiderHeader); screen.removePreference(antiAbuseThingsToConsiderSectionOne); } @@ -1291,8 +2285,8 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (permissionBlockedByOs) { maybeShowOsWarning(screen); -@@ -1352,7 +1388,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment - getSiteSettingsDelegate().getBrowserContextHandle(), contentType); +@@ -1378,7 +1414,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment + getSiteSettingsDelegate().getBrowserContextHandle(), contentType); int[] descriptionIds = ContentSettingsResources.getTriStateSettingDescriptionIDs(contentType); - triStateToggle.initialize(setting, descriptionIds); @@ -1300,7 +2294,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } private void configureBinaryToggle(ChromeSwitchPreference binaryToggle, int contentType) { -@@ -1478,6 +1514,14 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1517,6 +1553,14 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment @ContentSettingValues Integer value = site.getContentSetting(browserContextHandle, contentSettingsType); @@ -1314,19 +2308,19 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + AlertDialog alertDialog = new AlertDialog.Builder(getContext(), R.style.ThemeOverlay_BrowserUI_AlertDialog) - .setTitle(getContext().getString( + .setTitle( diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java -@@ -46,6 +46,7 @@ import java.util.Collection; +@@ -49,6 +49,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.List; - /** - * Shows the permissions and other settings for a particular website. -@@ -171,7 +172,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment + /** Shows the permissions and other settings for a particular website. */ + public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -169,7 +170,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment case ContentSettingsType.CLIPBOARD_READ_WRITE: return "clipboard_permission_list"; default: @@ -1335,20 +2329,34 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } } -@@ -536,7 +537,8 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -544,8 +545,21 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment private void setupContentSettingsPreferences() { mMaxPermissionOrder = findPreference(PREF_PERMISSIONS_HEADER).getOrder(); - for (@ContentSettingsType int type : SiteSettingsUtil.SETTINGS_ORDER) { +- Preference preference = new ChromeSwitchPreference(getStyledContext()); + List order = BromiteCustomContentSettingImpl.getSettingsOrder(); + for (@ContentSettingsType int type : order) { - Preference preference = new ChromeSwitchPreference(getStyledContext()); ++ @ContentSettingValues @Nullable Integer value = ++ mSite.getContentSetting( ++ getSiteSettingsDelegate().getBrowserContextHandle(), type); ++ if (value == null) { ++ value = WebsitePreferenceBridge.getDefaultContentSetting( ++ getSiteSettingsDelegate().getBrowserContextHandle(), type); ++ } ++ Preference preference = ++ BromiteCustomContentSettingImpl ++ .createWebSitePreference(type, getStyledContext(), value); ++ if (preference == null) { ++ preference = new ChromeSwitchPreference(getStyledContext()); ++ } preference.setKey(getPreferenceKey(type)); -@@ -1016,14 +1018,22 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment - - private void setupContentSettingsPreference(Preference preference, - @ContentSettingValues @Nullable Integer value, boolean isEmbargoed) { + if (type == ContentSettingsType.ADS) { +@@ -1085,20 +1099,32 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment + Preference preference, + @ContentSettingValues @Nullable Integer value, + boolean isEmbargoed) { - if (value == null) return; + int content_type = getContentSettingsTypeFromPreferenceKey(preference.getKey()); + BromiteCustomContentSetting cs = @@ -1361,17 +2369,30 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + } setUpPreferenceCommon(preference, value); - ChromeSwitchPreference switchPreference = (ChromeSwitchPreference) preference; +- ChromeSwitchPreference switchPreference = (ChromeSwitchPreference) preference; - switchPreference.setChecked(value == ContentSettingValues.ALLOW); -+ switchPreference.setChecked(value != ContentSettingValues.BLOCK); - switchPreference.setSummary(isEmbargoed ++ Preference switchPreference = preference; ++ if (preference instanceof ChromeSwitchPreference) { ++ ((ChromeSwitchPreference)switchPreference).setChecked(value != ContentSettingValues.BLOCK); ++ } else { ++ BromiteCustomContentSettingImpl.setWebSitePreferenceValue(content_type, preference, value); ++ } + switchPreference.setSummary( + isEmbargoed ? getString(R.string.automatically_blocked) - : getString(ContentSettingsResources.getCategorySummary(value))); + : getString(ContentSettingsResources.getCategorySummary(content_type, value))); switchPreference.setOnPreferenceChangeListener(this); @ContentSettingsType int contentType = getContentSettingsTypeFromPreferenceKey(preference.getKey()); -@@ -1176,7 +1186,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +- if (contentType == mHighlightedPermission) { +- switchPreference.setBackgroundColor(mHighlightColor); ++ if (preference instanceof ChromeSwitchPreference && contentType == mHighlightedPermission) { ++ ((ChromeSwitchPreference)switchPreference).setBackgroundColor(mHighlightColor); + } + if (isSessionPermission(contentType)) { + switchPreference.setSummary(switchPreference.getSummary() + " " + +@@ -1256,7 +1282,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment public @ContentSettingsType int getContentSettingsTypeFromPreferenceKey(String preferenceKey) { if (mPreferenceMap == null) { mPreferenceMap = new HashMap<>(); @@ -1380,7 +2401,18 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c String key = getPreferenceKey(type); if (key != null) { mPreferenceMap.put(key, type); -@@ -1218,7 +1228,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1293,11 +1319,17 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment + permission = + (Boolean) newValue ? ContentSettingValues.ALLOW : ContentSettingValues.BLOCK; + } else { +- permission = (Integer) newValue; ++ Integer newPermission = ++ BromiteCustomContentSettingImpl ++ .getWebSitePreferenceValue(type, newValue); ++ if (newPermission != null) ++ permission = newPermission; ++ else ++ permission = (Integer) newValue; } mSite.setContentSetting(browserContextHandle, type, permission); @@ -1389,7 +2421,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c preference.setIcon(getContentSettingsIcon(type, permission)); if (mWebsiteSettingsObserver != null) { -@@ -1248,7 +1258,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1325,7 +1357,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment // TODO(mvanouwerkerk): Refactor this class so that it does not depend on the screen state // for its logic. This class should maintain its own data model, and only update the screen // after a change is made. @@ -1401,24 +2433,24 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java -@@ -37,6 +37,7 @@ public class SiteSettings extends BaseSiteSettingsFragment - : R.xml.site_settings_preferences); +@@ -34,6 +34,7 @@ public class SiteSettings extends BaseSiteSettingsFragment + SettingsUtils.addPreferencesFromResource(this, R.xml.site_settings_preferences); getActivity().setTitle(getContext().getString(R.string.prefs_site_settings)); + BromiteCustomContentSettingImpl.configurePreferences(this); configurePreferences(); updatePreferenceStates(); } -@@ -52,7 +53,7 @@ public class SiteSettings extends BaseSiteSettingsFragment +@@ -55,7 +56,7 @@ public class SiteSettings extends BaseSiteSettingsFragment - private void configurePreferences() { // Remove unsupported settings categories. -- for (@SiteSettingsCategory.Type int type = 0; type < SiteSettingsCategory.Type.NUM_ENTRIES; -+ for (@SiteSettingsCategory.Type int type = 0; type < BromiteCustomContentSettingImpl.NUM_ENTRIES(); + for (@SiteSettingsCategory.Type int type = 0; +- type < SiteSettingsCategory.Type.NUM_ENTRIES; ++ type < BromiteCustomContentSettingImpl.NUM_ENTRIES(); type++) { if (!getSiteSettingsDelegate().isCategoryVisible(type)) { getPreferenceScreen().removePreference(findPreference(type)); -@@ -68,7 +69,7 @@ public class SiteSettings extends BaseSiteSettingsFragment +@@ -71,7 +72,7 @@ public class SiteSettings extends BaseSiteSettingsFragment @CookieControlsMode int cookieControlsMode = UserPrefs.get(browserContextHandle).getInteger(COOKIE_CONTROLS_MODE); @@ -1427,7 +2459,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c Preference p = findPreference(prefCategory); int contentType = SiteSettingsCategory.contentSettingsType(prefCategory); // p can be null if the Preference was removed in configurePreferences. -@@ -133,10 +134,13 @@ public class SiteSettings extends BaseSiteSettingsFragment +@@ -139,10 +140,13 @@ public class SiteSettings extends BaseSiteSettingsFragment } else if (Type.ZOOM == prefCategory) { // Don't want to set a summary for Zoom because we don't want any message to display // under the Zoom row on site settings. @@ -1447,25 +2479,25 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java -@@ -47,7 +47,7 @@ public class SiteSettingsCategory { - Type.PROTECTED_MEDIA, Type.SENSORS, Type.SOUND, Type.USB, Type.VIRTUAL_REALITY, - Type.USE_STORAGE, Type.AUTO_DARK_WEB_CONTENT, Type.REQUEST_DESKTOP_SITE, - Type.FEDERATED_IDENTITY_API, Type.THIRD_PARTY_COOKIES, Type.SITE_DATA, Type.ANTI_ABUSE, -- Type.ZOOM, Type.NUM_ENTRIES}) -+ Type.ZOOM, Type.NUM_ENTRIES_CHROMIUM}) +@@ -70,7 +70,7 @@ public class SiteSettingsCategory { + Type.ZOOM, + Type.STORAGE_ACCESS, + Type.TRACKING_PROTECTION, +- Type.NUM_ENTRIES ++ Type.NUM_ENTRIES_CHROMIUM + }) @Retention(RetentionPolicy.SOURCE) public @interface Type { - // All updates here must also be reflected in {@link #preferenceKey(int) -@@ -85,7 +85,7 @@ public class SiteSettingsCategory { - /** - * Number of handled categories used for calculating array sizes. - */ -- int NUM_ENTRIES = 30; -+ int NUM_ENTRIES_CHROMIUM = 30; +@@ -109,7 +109,7 @@ public class SiteSettingsCategory { + int TRACKING_PROTECTION = 30; + + /** Number of handled categories used for calculating array sizes. */ +- int NUM_ENTRIES = 31; ++ int NUM_ENTRIES_CHROMIUM = 31; } private final BrowserContextHandle mBrowserContextHandle; -@@ -129,6 +129,9 @@ public class SiteSettingsCategory { +@@ -154,6 +154,9 @@ public class SiteSettingsCategory { } else { permission = ""; } @@ -1475,7 +2507,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c return new SiteSettingsCategory(browserContextHandle, type, permission); } -@@ -137,7 +140,7 @@ public class SiteSettingsCategory { +@@ -162,7 +165,7 @@ public class SiteSettingsCategory { @ContentSettingsType int contentSettingsType) { assert contentSettingsType != -1; assert Type.ALL_SITES == 0; @@ -1484,7 +2516,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (contentSettingsType(i) == contentSettingsType) { return createFromType(browserContextHandle, i); } -@@ -148,7 +151,7 @@ public class SiteSettingsCategory { +@@ -173,7 +176,7 @@ public class SiteSettingsCategory { public static SiteSettingsCategory createFromPreferenceKey( BrowserContextHandle browserContextHandle, String preferenceKey) { assert Type.ALL_SITES == 0; @@ -1493,8 +2525,8 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (preferenceKey(i).equals(preferenceKey)) { return createFromType(browserContextHandle, i); } -@@ -219,8 +222,7 @@ public class SiteSettingsCategory { - case Type.ZOOM: +@@ -244,8 +247,7 @@ public class SiteSettingsCategory { + case Type.TRACKING_PROTECTION: return ContentSettingsType.DEFAULT; // Conversion unavailable. } - assert false; @@ -1503,7 +2535,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } /** -@@ -305,8 +307,12 @@ public class SiteSettingsCategory { +@@ -330,8 +332,12 @@ public class SiteSettingsCategory { case Type.ZOOM: return "zoom"; default: @@ -1519,7 +2551,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java -@@ -168,6 +168,8 @@ public interface SiteSettingsDelegate { +@@ -152,6 +152,8 @@ public interface SiteSettingsDelegate { */ String getFirstPartySetOwner(String memberOrigin); @@ -1537,9 +2569,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c import org.chromium.components.content_settings.ContentSettingValues; +import org.chromium.components.content_settings.ContentSettingsType; - /** - * A 3-state Allowed/Ask/Blocked radio group Preference used for SiteSettings. -@@ -25,6 +26,7 @@ public class TriStateSiteSettingsPreference + /** A 3-state Allowed/Ask/Blocked radio group Preference used for SiteSettings. */ + public class TriStateSiteSettingsPreference extends Preference +@@ -23,6 +24,7 @@ public class TriStateSiteSettingsPreference extends Preference private RadioButtonWithDescription mAsk; private RadioButtonWithDescription mBlocked; private RadioGroup mRadioGroup; @@ -1547,7 +2579,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c public TriStateSiteSettingsPreference(Context context, AttributeSet attrs) { super(context, attrs); -@@ -44,7 +46,9 @@ public class TriStateSiteSettingsPreference +@@ -42,7 +44,9 @@ public class TriStateSiteSettingsPreference extends Preference * @param descriptionIds An array of 3 resource IDs for descriptions for * Allowed, Ask and Blocked states, in that order. */ @@ -1558,7 +2590,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c mSetting = setting; mDescriptionIds = descriptionIds; } -@@ -79,6 +83,13 @@ public class TriStateSiteSettingsPreference +@@ -75,6 +79,13 @@ public class TriStateSiteSettingsPreference extends Preference mRadioGroup = (RadioGroup) holder.findViewById(R.id.radio_button_layout); mRadioGroup.setOnCheckedChangeListener(this); @@ -1575,11 +2607,11 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java -@@ -263,6 +263,12 @@ public final class Website implements WebsiteEntry { +@@ -325,7 +325,11 @@ public final class Website implements WebsiteEntry { RecordUserAction.record("SoundContentSetting.UnmuteBy.SiteSettings"); } } -+ +- + if (exception == null) { + exception = BromiteCustomContentSettingImpl.createCustomException(type, value, getAddress()); + if (exception != null) @@ -1591,16 +2623,16 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java -@@ -106,7 +106,7 @@ public class WebsitePermissionsFetcher { - case ContentSettingsType.USB_GUARD: - return WebsitePermissionsType.CHOSEN_OBJECT_INFO; +@@ -114,7 +114,7 @@ public class WebsitePermissionsFetcher { + } + return null; default: - return null; + return BromiteCustomContentSettingImpl.getPermissionsType(contentSettingsType); } } -@@ -220,7 +220,7 @@ public class WebsitePermissionsFetcher { +@@ -228,7 +228,7 @@ public class WebsitePermissionsFetcher { if (SiteSettingsFeatureMap.isEnabled(SiteSettingsFeatureList.SITE_DATA_IMPROVEMENTS)) { queue.add(new CookiesInfoFetcher()); } @@ -1612,7 +2644,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -@@ -265,7 +265,7 @@ public class WebsitePreferenceBridge { +@@ -283,7 +283,7 @@ public class WebsitePreferenceBridge { case ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER: return true; default: @@ -1621,9 +2653,9 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } } -@@ -280,7 +280,6 @@ public class WebsitePreferenceBridge { - - public static boolean isCategoryEnabled(BrowserContextHandle browserContextHandle, +@@ -299,7 +299,6 @@ public class WebsitePreferenceBridge { + public static boolean isCategoryEnabled( + BrowserContextHandle browserContextHandle, @ContentSettingsType int contentSettingsType) { - assert !requiresTriStateContentSetting(contentSettingsType); return isContentSettingEnabled(browserContextHandle, contentSettingsType); @@ -1708,7 +2740,7 @@ diff --git a/components/content_settings/android/BUILD.gn b/components/content_s diff --git a/components/content_settings/core/browser/BUILD.gn b/components/content_settings/core/browser/BUILD.gn --- a/components/content_settings/core/browser/BUILD.gn +++ b/components/content_settings/core/browser/BUILD.gn -@@ -87,6 +87,13 @@ static_library("browser") { +@@ -89,6 +89,13 @@ static_library("browser") { } configs += [ "//build/config/compiler:wexit_time_destructors" ] @@ -1739,7 +2771,7 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. namespace content_settings { -@@ -630,6 +631,7 @@ void ContentSettingsRegistry::Init() { +@@ -654,6 +655,7 @@ void ContentSettingsRegistry::Init() { WebsiteSettingsRegistry::DESKTOP, ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); @@ -1750,7 +2782,7 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. diff --git a/components/content_settings/core/browser/content_settings_uma_util.cc b/components/content_settings/core/browser/content_settings_uma_util.cc --- a/components/content_settings/core/browser/content_settings_uma_util.cc +++ b/components/content_settings/core/browser/content_settings_uma_util.cc -@@ -176,8 +176,9 @@ void RecordContentSettingsHistogram(const std::string& name, +@@ -180,8 +180,9 @@ void RecordContentSettingsHistogram(const std::string& name, } int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting) { @@ -1770,9 +2802,9 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/common/content_settings.h" - #include "components/content_settings/core/common/content_settings_types.h" #include "components/content_settings/core/common/content_settings_utils.h" -@@ -122,6 +123,17 @@ PatternPair ParsePatternString(const std::string& pattern_str) { + #include "components/content_settings/core/common/features.h" +@@ -121,6 +122,17 @@ PatternPair ParsePatternString(const std::string& pattern_str) { void GetRendererContentSettingRules(const HostContentSettingsMap* map, RendererContentSettingRules* rules) { @@ -1793,7 +2825,7 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc diff --git a/components/content_settings/core/browser/website_settings_info.h b/components/content_settings/core/browser/website_settings_info.h --- a/components/content_settings/core/browser/website_settings_info.h +++ b/components/content_settings/core/browser/website_settings_info.h -@@ -125,6 +125,30 @@ class WebsiteSettingsInfo { +@@ -132,6 +132,32 @@ class WebsiteSettingsInfo { ScopingType scoping_type() const { return scoping_type_; } IncognitoBehavior incognito_behavior() const { return incognito_behavior_; } @@ -1805,6 +2837,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ + int description_ui() const { return description_ui_; } + int allowed_ui() const { return allowed_ui_; } + int blocked_ui() const { return blocked_ui_; } ++ int ask_ui() const { return ask_ui_; } + int allowed_exceptions_ui() const { return allowed_exceptions_ui_; } + int blocked_exceptions_ui() const { return blocked_exceptions_ui_; } + int mid_sentence_ui() const { return mid_sentence_ui_; } @@ -1817,6 +2850,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ + WebsiteSettingsInfo& set_description_ui(int value) { description_ui_ = value; return *this; } + WebsiteSettingsInfo& set_allowed_ui(int value) { allowed_ui_ = value; return *this; } + WebsiteSettingsInfo& set_blocked_ui(int value) { blocked_ui_ = value; return *this; } ++ WebsiteSettingsInfo& set_ask_ui(int value) { ask_ui_ = value; return *this; } + WebsiteSettingsInfo& set_allowed_exceptions_ui(int value) { allowed_exceptions_ui_ = value; return *this; } + WebsiteSettingsInfo& set_blocked_exceptions_ui(int value) { blocked_exceptions_ui_ = value; return *this; } + WebsiteSettingsInfo& set_mid_sentence_ui(int value) { mid_sentence_ui_ = value; return *this; } @@ -1824,7 +2858,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ private: const ContentSettingsType type_; const std::string name_; -@@ -136,6 +160,17 @@ class WebsiteSettingsInfo { +@@ -143,6 +169,18 @@ class WebsiteSettingsInfo { const LossyStatus lossy_status_; const ScopingType scoping_type_; const IncognitoBehavior incognito_behavior_; @@ -1836,6 +2870,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ + int description_ui_ = 0; + int allowed_ui_ = 0; + int blocked_ui_ = 0; ++ int ask_ui_ = 0; + int allowed_exceptions_ui_ = 0; + int blocked_exceptions_ui_ = 0; + int mid_sentence_ui_ = 0; @@ -1872,7 +2907,7 @@ diff --git a/components/content_settings/core/browser/website_settings_registry. diff --git a/components/content_settings/core/common/BUILD.gn b/components/content_settings/core/common/BUILD.gn --- a/components/content_settings/core/common/BUILD.gn +++ b/components/content_settings/core/common/BUILD.gn -@@ -49,6 +49,13 @@ static_library("common") { +@@ -52,6 +52,13 @@ static_library("common") { "//net", "//url", ] @@ -1977,9 +3012,9 @@ diff --git a/components/content_settings/core/common/content_settings.mojom b/co // This mirrors the C++ type in content_settings.h. struct ContentSettingPatternSource { ContentSettingsPattern primary_pattern; -@@ -91,6 +96,7 @@ struct ContentSettingPatternSource { - +@@ -92,6 +97,7 @@ struct ContentSettingPatternSource { // This mirrors the C++ type in content_settings.h. + // TODO(https://crbug.com/1485360): This should be removed. struct RendererContentSettingRules { + array settings_rules; array image_rules; @@ -2065,9 +3100,9 @@ diff --git a/components/content_settings/core/common/content_settings_param_trai diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h --- a/components/content_settings/core/common/content_settings_types.h +++ b/components/content_settings/core/common/content_settings_types.h -@@ -365,7 +365,9 @@ enum class ContentSettingsType : int32_t { - // request. - FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION, +@@ -371,7 +371,9 @@ enum class ContentSettingsType : int32_t { + // shown to the user, for a given origin. + FILE_SYSTEM_ACCESS_RESTORE_PERMISSION, - NUM_TYPES, + NUM_TYPES_CHROMIUM, @@ -2079,7 +3114,7 @@ diff --git a/components/content_settings/core/common/content_settings_types.h b/ diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc --- a/components/content_settings/renderer/content_settings_agent_impl.cc +++ b/components/content_settings/renderer/content_settings_agent_impl.cc -@@ -201,6 +201,39 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( +@@ -202,6 +202,39 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( std::move(renderer_settings)); } @@ -2137,8 +3172,8 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.h diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoPermissionsController.java b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoPermissionsController.java --- a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoPermissionsController.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoPermissionsController.java -@@ -169,6 +169,15 @@ public class PageInfoPermissionsController - : perm1.nameMidSentence.toString()); +@@ -177,6 +177,15 @@ public class PageInfoPermissionsController extends PageInfoPreferenceSubpageCont + : perm1.nameMidSentence.toString()); } + String value = ""; @@ -2152,7 +3187,7 @@ diff --git a/components/page_info/android/java/src/org/chromium/components/page_ + // More than 2 permissions. if (same) { - int resId = perm1.allowed ? R.plurals.page_info_permissions_summary_more_allowed + int resId = diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java b/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java --- a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java @@ -2217,7 +3252,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. #include "components/content_settings/browser/ui/cookie_controls_controller.h" #include "components/content_settings/core/browser/content_settings_registry.h" #include "components/content_settings/core/browser/content_settings_uma_util.h" -@@ -1246,6 +1247,14 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1249,6 +1250,14 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, // applies to permissions listed in |kPermissionType|. bool PageInfo::ShouldShowPermission( const PageInfo::PermissionInfo& info) const { @@ -2232,7 +3267,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. // Note |ContentSettingsType::ADS| will show up regardless of its default // value when it has been activated on the current origin. if (info.type == ContentSettingsType::ADS) { -@@ -1346,7 +1355,19 @@ void PageInfo::PresentSitePermissions() { +@@ -1375,7 +1384,19 @@ void PageInfo::PresentSitePermissions() { HostContentSettingsMap* content_settings = GetContentSettings(); DCHECK(web_contents_); @@ -2264,7 +3299,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in #include "components/page_info/core/features.h" #include "components/page_info/page_info.h" #include "components/page_info/page_info_ui_delegate.h" -@@ -607,6 +608,12 @@ PageInfoUI::~PageInfoUI() = default; +@@ -622,6 +623,12 @@ PageInfoUI::~PageInfoUI() = default; // static std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { @@ -2277,7 +3312,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in for (const PermissionUIInfo& info : GetContentSettingsUIInfo()) { if (info.type == type) return l10n_util::GetStringUTF16(info.string_id); -@@ -618,6 +625,12 @@ std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { +@@ -633,6 +640,12 @@ std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { // static std::u16string PageInfoUI::PermissionTypeToUIStringMidSentence( ContentSettingsType type) { @@ -2290,7 +3325,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in for (const PermissionUIInfo& info : GetContentSettingsUIInfo()) { if (info.type == type) return l10n_util::GetStringUTF16(info.string_id_mid_sentence); -@@ -1052,6 +1065,11 @@ bool PageInfoUI::ContentSettingsTypeInPageInfo(ContentSettingsType type) { +@@ -1067,6 +1080,11 @@ bool PageInfoUI::ContentSettingsTypeInPageInfo(ContentSettingsType type) { if (info.type == type) return true; } @@ -2321,9 +3356,9 @@ diff --git a/third_party/blink/public/platform/web_content_settings_client.h b/t #include "base/time/time.h" +#include "components/content_settings/core/common/content_settings_types.h" #include "third_party/blink/public/common/client_hints/enabled_client_hints.h" + #include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom.h" - namespace blink { -@@ -68,6 +69,10 @@ class WebContentSettingsClient { +@@ -51,6 +52,10 @@ class WebContentSettingsClient { return enabled_per_settings; } @@ -2331,8 +3366,8 @@ diff --git a/third_party/blink/public/platform/web_content_settings_client.h b/t + return enabled_per_settings; + } + - // Controls whether auto dark web content is allowed for this frame. - virtual bool AllowAutoDarkWebContent(bool enabled_per_settings) { + // Controls whether scripts are allowed to execute for this frame. + virtual bool AllowScript(bool enabled_per_settings) { return enabled_per_settings; diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc --- a/third_party/blink/renderer/core/execution_context/execution_context.cc @@ -2363,7 +3398,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h --- a/third_party/blink/renderer/core/execution_context/execution_context.h +++ b/third_party/blink/renderer/core/execution_context/execution_context.h -@@ -44,6 +44,7 @@ +@@ -43,6 +43,7 @@ #include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink-forward.h" #include "third_party/blink/public/mojom/permissions_policy/policy_disposition.mojom-blink-forward.h" #include "third_party/blink/public/mojom/v8_cache_options.mojom-blink-forward.h" @@ -2371,7 +3406,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context #include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/security_context.h" -@@ -103,6 +104,10 @@ class SecurityOrigin; +@@ -102,6 +103,10 @@ class SecurityOrigin; class ScriptState; class ScriptWrappable; class TrustedTypePolicyFactory; @@ -2383,4 +3418,3 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context enum ReasonForCallingCanExecuteScripts { kAboutToExecuteScript, -- -2.25.1 diff --git a/build/bromite_patches/Dictionary-suggestions-for-the-Omnibox.patch b/build/cromite_patches/Dictionary-suggestions-for-the-Omnibox.patch similarity index 85% rename from build/bromite_patches/Dictionary-suggestions-for-the-Omnibox.patch rename to build/cromite_patches/Dictionary-suggestions-for-the-Omnibox.patch index 1388407b25b72f3c637a3bfa1b272e845054fc31..7a60a76906ad54c33c8643ab3c3e2fdfe1cbb536 100644 --- a/build/bromite_patches/Dictionary-suggestions-for-the-Omnibox.patch +++ b/build/cromite_patches/Dictionary-suggestions-for-the-Omnibox.patch @@ -10,9 +10,9 @@ Original License: BSD-3-Clause - https://spdx.org/licenses/BSD-3-Clause.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/java/res/layout/url_bar.xml | 1 + - .../browser/omnibox/LocationBarMediator.java | 12 ++++++++-- + .../browser/omnibox/LocationBarMediator.java | 13 +++++++++-- .../chrome/browser/omnibox/UrlBar.java | 23 +++++++++++++++++++ - 3 files changed, 34 insertions(+), 2 deletions(-) + 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/res/layout/url_bar.xml b/chrome/android/java/res/layout/url_bar.xml --- a/chrome/android/java/res/layout/url_bar.xml @@ -27,7 +27,7 @@ diff --git a/chrome/android/java/res/layout/url_bar.xml b/chrome/android/java/re diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java -@@ -278,8 +278,16 @@ class LocationBarMediator +@@ -288,8 +288,17 @@ class LocationBarMediator if (mNativeInitialized) RecordUserAction.record("FocusLocation"); // Don't clear Omnibox if the user just pasted text to NTP Omnibox. if (mShouldClearOmniboxOnFocus) { @@ -35,9 +35,10 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow - UrlBarData.EMPTY, UrlBar.ScrollType.NO_SCROLL, SelectionState.SELECT_END); + UrlBarData data = mLocationBarDataProvider.getUrlBarData(); + @SelectionState int selectionState = SelectionState.SELECT_ALL; -+ if (mTemplateUrlServiceSupplier.hasValue()) { -+ String searchParams = mTemplateUrlServiceSupplier.get().getSearchQueryForUrl( -+ mLocationBarDataProvider.getUrlBarData().url); ++ GURL url = mLocationBarDataProvider.getUrlBarData().url; ++ if (url != null && mTemplateUrlServiceSupplier.hasValue()) { ++ String searchParams = ++ mTemplateUrlServiceSupplier.get().getSearchQueryForUrl(url); + if (searchParams != null && !searchParams.isEmpty()) { + data = UrlBarData.forUrlAndText(data.url, data.displayText, searchParams); + } @@ -57,15 +58,15 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow import android.os.SystemClock; import android.text.Editable; import android.text.InputType; -@@ -106,6 +107,7 @@ public abstract class UrlBar extends AutocompleteEditText { +@@ -100,6 +101,7 @@ public abstract class UrlBar extends AutocompleteEditText { + private boolean mFocused; private boolean mAllowFocus = true; - private boolean mPendingScroll; + private boolean mPendingSelectAll; - private int mPreviousWidth; + private boolean mPendingScroll; - @ScrollType -@@ -307,6 +309,27 @@ public abstract class UrlBar extends AutocompleteEditText { + // Captures the current intended text scroll type. +@@ -299,6 +301,27 @@ public abstract class UrlBar extends AutocompleteEditText { mPendingScroll = false; } fixupTextDirection(); @@ -94,4 +95,3 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow @Override -- -2.25.1 diff --git a/build/cromite_patches/Disable-Accessibility-service-by-default.patch b/build/cromite_patches/Disable-Accessibility-service-by-default.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d1c10d7a42f2a3c0e8cb477f31949a31e7a9399 --- /dev/null +++ b/build/cromite_patches/Disable-Accessibility-service-by-default.patch @@ -0,0 +1,57 @@ +From: uazo +Date: Mon, 8 Nov 2021 09:47:23 +0000 +Subject: Disable Accessibility service by default + +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html +--- + .../Disable-Accessibility-service-by-default.grdp | 9 +++++++++ + .../android/java/res/xml/accessibility_preferences.xml | 5 +++++ + .../accessibility/WebContentsAccessibilityImpl.java | 5 +++++ + 3 files changed, 19 insertions(+) + create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Disable-Accessibility-service-by-default.grdp + +diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Disable-Accessibility-service-by-default.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Disable-Accessibility-service-by-default.grdp +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Disable-Accessibility-service-by-default.grdp +@@ -0,0 +1,9 @@ ++ ++ ++ ++ Enable Accessibility Service ++ ++ ++ Activates or deactivates the communication of all user activities in ui to the Accessibility provider ++ ++ +diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml +--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml ++++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml +@@ -7,6 +7,11 @@ found in the LICENSE file. + + + ++ ++ + RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2, false); registry->RegisterBooleanPref(prefs::kPrivacySandboxM1ConsentDecisionMade, +@@ -28,7 +28,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref(prefs::kPrivacySandboxM1FledgeEnabled, false); + registry->RegisterBooleanPref(prefs::kPrivacySandboxM1AdMeasurementEnabled, + false); +- registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, false); ++ registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, true); + + registry->RegisterBooleanPref(prefs::kPrivacySandboxManuallyControlledV2, + false); diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc --- a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc +++ b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc -@@ -120,7 +120,7 @@ std::set GetTopicsSetFromString( +@@ -121,7 +121,7 @@ std::set GetTopicsSetFromString( // static bool PrivacySandboxSettingsImpl::IsAllowed(Status status) { @@ -137,18 +144,18 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo } // static -@@ -229,7 +229,8 @@ PrivacySandboxSettingsImpl::GetFinchPrioritizedTopics() { +@@ -230,7 +230,8 @@ PrivacySandboxSettingsImpl::GetFinchPrioritizedTopics() { return finch_prioritized_topics_; } -bool PrivacySandboxSettingsImpl::IsTopicsAllowed() const { +bool PrivacySandboxSettingsImpl::IsTopicsAllowed() const { // disabled in Bromite + if ((true)) return false; - // M1 specific - if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings4)) { - Status status = GetM1TopicAllowedStatus(); -@@ -286,7 +287,8 @@ bool PrivacySandboxSettingsImpl::IsTopicsAllowedForContext( - IsPrivacySandboxEnabledForContext(top_frame_origin, url); + Status status = GetM1TopicAllowedStatus(); + JoinHistogram(kIsTopicsAllowedHistogram, status); + return IsAllowed(status); +@@ -262,7 +263,8 @@ bool PrivacySandboxSettingsImpl::IsTopicsAllowedForContext( + return IsAllowed(status); } -bool PrivacySandboxSettingsImpl::IsTopicAllowed(const CanonicalTopic& topic) { @@ -157,7 +164,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo const auto& blocked_topics = pref_service_->GetList(prefs::kPrivacySandboxBlockedTopics); -@@ -488,6 +490,7 @@ bool PrivacySandboxSettingsImpl::MaySendAttributionReport( +@@ -464,6 +466,7 @@ bool PrivacySandboxSettingsImpl:: void PrivacySandboxSettingsImpl::SetFledgeJoiningAllowed( const std::string& top_frame_etld_plus1, bool allowed) { @@ -165,7 +172,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo ScopedDictPrefUpdate scoped_pref_update( pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked); -@@ -558,7 +561,8 @@ void PrivacySandboxSettingsImpl::ClearFledgeJoiningAllowedSettings( +@@ -534,7 +537,8 @@ void PrivacySandboxSettingsImpl::ClearFledgeJoiningAllowedSettings( } bool PrivacySandboxSettingsImpl::IsFledgeJoiningAllowed( @@ -175,8 +182,8 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo ScopedDictPrefUpdate scoped_pref_update( pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked); auto& pref_data = scoped_pref_update.Get(); -@@ -727,7 +731,8 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationDebugModeAllowed( - net::CookieSettingOverrides()); +@@ -693,7 +697,8 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationDebugModeAllowed( + delegate_->AreThirdPartyCookiesBlockedByCookieDeprecationExperiment(); } -bool PrivacySandboxSettingsImpl::IsPrivacySandboxEnabled() const { @@ -185,8 +192,8 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo PrivacySandboxSettingsImpl::Status status = GetPrivacySandboxAllowedStatus(); if (!IsAllowed(status)) { return false; -@@ -765,7 +770,8 @@ void PrivacySandboxSettingsImpl::SetTopicsBlockedForTesting() { - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, false); +@@ -720,7 +725,8 @@ void PrivacySandboxSettingsImpl::SetTopicsBlockedForTesting() { + pref_service_->SetBoolean(prefs::kPrivacySandboxM1TopicsEnabled, false); } -void PrivacySandboxSettingsImpl::SetPrivacySandboxEnabled(bool enabled) { @@ -195,8 +202,8 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, enabled); } -@@ -826,7 +832,10 @@ bool PrivacySandboxSettingsImpl::IsPrivacySandboxEnabledForContext( - net::CookieSettingOverrides()); +@@ -767,7 +773,10 @@ void PrivacySandboxSettingsImpl::SetDelegateForTesting( + delegate_ = std::move(delegate); } -void PrivacySandboxSettingsImpl::SetTopicsDataAccessibleFromNow() const { @@ -207,7 +214,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo pref_service_->SetTime(prefs::kPrivacySandboxTopicsDataAccessibleSince, base::Time::Now()); -@@ -839,6 +848,7 @@ PrivacySandboxSettingsImpl::Status +@@ -780,6 +789,7 @@ PrivacySandboxSettingsImpl::Status PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus( const url::Origin& top_frame_origin, const GURL& url) const { @@ -215,5 +222,21 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo // Relying on |host_content_settings_map_| instead of |cookie_settings_| // allows to query whether the site associated with the |url| is allowed to // access Site data (aka ContentSettingsType::COOKIES) without considering any +diff --git a/cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc b/cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc +@@ -0,0 +1 @@ ++SET_CROMITE_FEATURE_DISABLED(kFencedFrames); +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 +@@ -2239,6 +2239,7 @@ bool IsAllowPageWithIDBConnectionAndTransactionInBFCacheEnabled() { + } + + bool IsAllowURNsInIframeEnabled() { ++ if ((true)) return false; // see https://chromium-review.googlesource.com/c/chromium/src/+/3690741 + return base::FeatureList::IsEnabled(blink::features::kAllowURNsInIframes); + } + -- -2.25.1 diff --git a/build/bromite_patches/00Disable-Feeback-Collector.patch b/build/cromite_patches/Disable-Feeback-Collector.patch similarity index 81% rename from build/bromite_patches/00Disable-Feeback-Collector.patch rename to build/cromite_patches/Disable-Feeback-Collector.patch index e3198574bf138637c953301bc9d3edf960c4b933..32941739ae3e32782009fd65c92ec742200779c9 100644 --- a/build/bromite_patches/00Disable-Feeback-Collector.patch +++ b/build/cromite_patches/Disable-Feeback-Collector.patch @@ -4,8 +4,8 @@ Subject: Disable Feeback Collector License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - .../browser/feedback/FeedbackCollector.java | 27 +++---------------- - 1 file changed, 3 insertions(+), 24 deletions(-) + .../browser/feedback/FeedbackCollector.java | 28 ++----------------- + 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java --- a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java @@ -18,9 +18,9 @@ diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browse import java.util.List; import java.util.Map; -@@ -64,30 +65,8 @@ public abstract class FeedbackCollector implements Runnable { - // Subclasses must invoke init() at construction time. - protected void init(Activity activity, @Nullable ScreenshotSource screenshotTask, T initParams, +@@ -69,31 +70,8 @@ public abstract class FeedbackCollector implements Runnable { + @Nullable ScreenshotSource screenshotTask, + T initParams, Profile profile) { - // 1. Build all synchronous and asynchronous sources and determine the currently signed in - // account. @@ -29,8 +29,9 @@ diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browse - IdentityManager identityManager = - IdentityServicesProvider.get().getIdentityManager(profile); - if (identityManager != null) { -- mAccountInUse = CoreAccountInfo.getEmailFrom( -- identityManager.getPrimaryAccountInfo(ConsentLevel.SIGNIN)); +- mAccountInUse = +- CoreAccountInfo.getEmailFrom( +- identityManager.getPrimaryAccountInfo(ConsentLevel.SIGNIN)); - } - - // Validation check in case a source is added to the wrong list. @@ -52,4 +53,3 @@ diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browse // 4. Kick off a task to timeout the async sources. ThreadUtils.postOnUiThreadDelayed(this, TIMEOUT_MS); -- -2.25.1 diff --git a/build/bromite_patches/Disable-NTP-remote-suggestions-by-default.patch b/build/cromite_patches/Disable-NTP-remote-suggestions-by-default.patch similarity index 99% rename from build/bromite_patches/Disable-NTP-remote-suggestions-by-default.patch rename to build/cromite_patches/Disable-NTP-remote-suggestions-by-default.patch index b5bfbdb1518658e9ad0395c2b4ff287119f3faa8..7b5fc2b60eccfb8fd33a0c082f7929e5ac1e887c 100644 --- a/build/bromite_patches/Disable-NTP-remote-suggestions-by-default.patch +++ b/build/cromite_patches/Disable-NTP-remote-suggestions-by-default.patch @@ -22,4 +22,3 @@ diff --git a/components/feed/core/shared_prefs/pref_names.cc b/components/feed/c } -- -2.25.1 diff --git a/build/bromite_patches/Disable-PrivacyGuide.patch b/build/cromite_patches/Disable-PrivacyGuide.patch similarity index 95% rename from build/bromite_patches/Disable-PrivacyGuide.patch rename to build/cromite_patches/Disable-PrivacyGuide.patch index 75bc133963dfff5fb4eb9a3d325bda95414c6ae3..61cf841d6b9e67f9f814d504434b39a0372cef62 100644 --- a/build/bromite_patches/Disable-PrivacyGuide.patch +++ b/build/cromite_patches/Disable-PrivacyGuide.patch @@ -12,7 +12,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc -@@ -331,7 +331,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) +@@ -351,7 +351,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) #endif // !BUILDFLAG(IS_CHROMEOS_LACROS) bool show_privacy_guide = @@ -37,4 +37,3 @@ new file mode 100644 + +#endif -- -2.25.1 diff --git a/build/bromite_patches/Disable-StartSurface-feature.patch b/build/cromite_patches/Disable-StartSurface-feature.patch similarity index 80% rename from build/bromite_patches/Disable-StartSurface-feature.patch rename to build/cromite_patches/Disable-StartSurface-feature.patch index 42b096cffb5a24a43be7a5c26e41ea89b30c9bb3..f9a35d5af58ec2b753d7c5b337f170ca2fba2421 100644 --- a/build/bromite_patches/Disable-StartSurface-feature.patch +++ b/build/cromite_patches/Disable-StartSurface-feature.patch @@ -14,12 +14,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -613,7 +613,7 @@ public abstract class ChromeFeatureList { - new CachedFlag(SHOULD_IGNORE_INTENT_SKIP_INTERNAL_CHECK, true); +@@ -631,7 +631,7 @@ public abstract class ChromeFeatureList { + new CachedFlag(SHOW_NTP_AT_STARTUP_ANDROID, false); public static final CachedFlag sSpareTab = new CachedFlag(SPARE_TAB, false); - public static final CachedFlag sStartSurfaceAndroid = new CachedFlag( -- START_SURFACE_ANDROID, ChromePreferenceKeys.FLAGS_CACHED_START_SURFACE_ENABLED, true); -+ START_SURFACE_ANDROID, ChromePreferenceKeys.FLAGS_CACHED_START_SURFACE_ENABLED, false); + public static final CachedFlag sStartSurfaceAndroid = +- new CachedFlag(START_SURFACE_ANDROID, true); ++ new CachedFlag(START_SURFACE_ANDROID, false); public static final CachedFlag sStartSurfaceDisabledFeedImprovement = new CachedFlag(START_SURFACE_DISABLED_FEED_IMPROVEMENT, false); public static final CachedFlag sStartSurfaceOnTablet = @@ -30,4 +30,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kStartSurfaceAndroid); -- -2.25.1 diff --git a/build/bromite_patches/Disable-TLS-resumption.patch b/build/cromite_patches/Disable-TLS-resumption.patch similarity index 95% rename from build/bromite_patches/Disable-TLS-resumption.patch rename to build/cromite_patches/Disable-TLS-resumption.patch index 2f2aee25d3a308d3d213a3aeebcabe7609578488..8ab79fc0d2baadaa3568e0a0df631be93fece3a4 100644 --- a/build/bromite_patches/Disable-TLS-resumption.patch +++ b/build/cromite_patches/Disable-TLS-resumption.patch @@ -90,7 +90,7 @@ diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc --- a/net/quic/quic_stream_factory.cc +++ b/net/quic/quic_stream_factory.cc -@@ -70,6 +70,7 @@ +@@ -69,6 +69,7 @@ #include "net/third_party/quiche/src/quiche/quic/core/quic_utils.h" #include "net/third_party/quiche/src/quiche/quic/platform/api/quic_flags.h" #include "third_party/boringssl/src/include/openssl/aead.h" @@ -98,7 +98,7 @@ diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc #include "url/gurl.h" #include "url/scheme_host_port.h" #include "url/url_constants.h" -@@ -195,6 +196,38 @@ std::set HostsFromOrigins(std::set origins) { +@@ -194,6 +195,38 @@ std::set HostsFromOrigins(std::set origins) { } // namespace @@ -137,7 +137,7 @@ diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc // Refcounted class that owns quic::QuicCryptoClientConfig and tracks how many // consumers are using it currently. When the last reference is freed, the // QuicCryptoClientConfigHandle informs the owning QuicStreamFactory, moves it -@@ -2353,7 +2386,7 @@ QuicStreamFactory::CreateCryptoConfigHandle( +@@ -2368,7 +2401,7 @@ QuicStreamFactory::CreateCryptoConfigHandle( sct_auditing_delegate_, HostsFromOrigins(params_.origins_to_force_quic_on), actual_network_anonymization_key), @@ -183,7 +183,7 @@ diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket Disconnect(); } -@@ -776,6 +802,8 @@ int SSLClientSocketImpl::Init() { +@@ -772,6 +798,8 @@ int SSLClientSocketImpl::Init() { } if (session) SSL_set_session(ssl_.get(), session.get()); @@ -191,8 +191,8 @@ diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket + Log_ssl_session_data("Old session resumed", session.get()); } - const int kBufferSize = kDefaultOpenSSLBufferSize.Get(); -@@ -1067,6 +1095,35 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) { + const int kBufferSize = GetDefaultOpenSSLBufferSize(); +@@ -1066,6 +1094,35 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) { : SSLHandshakeDetails::kTLS13Full; } } @@ -228,7 +228,7 @@ diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket UMA_HISTOGRAM_ENUMERATION("Net.SSLHandshakeDetails", details); // Measure TLS connections that implement the renegotiation_info extension. -@@ -1741,6 +1798,8 @@ bool SSLClientSocketImpl::IsRenegotiationAllowed() const { +@@ -1718,6 +1775,8 @@ bool SSLClientSocketImpl::IsRenegotiationAllowed() const { } bool SSLClientSocketImpl::IsCachingEnabled() const { @@ -240,7 +240,7 @@ diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket diff --git a/net/socket/ssl_client_socket_impl.h b/net/socket/ssl_client_socket_impl.h --- a/net/socket/ssl_client_socket_impl.h +++ b/net/socket/ssl_client_socket_impl.h -@@ -126,6 +126,8 @@ class SSLClientSocketImpl : public SSLClientSocket, +@@ -124,6 +124,8 @@ class SSLClientSocketImpl : public SSLClientSocket, friend class SSLClientSocket; friend class SSLContext; @@ -250,4 +250,3 @@ diff --git a/net/socket/ssl_client_socket_impl.h b/net/socket/ssl_client_socket_ void DoReadCallback(int result); void DoWriteCallback(int result); -- -2.25.1 diff --git a/build/bromite_patches/Disable-UA-full-version.patch b/build/cromite_patches/Disable-UA-full-version.patch similarity index 90% rename from build/bromite_patches/Disable-UA-full-version.patch rename to build/cromite_patches/Disable-UA-full-version.patch index 934d64ca3346c7d8c629484f2ea2cd5c8029f8f9..7eb11dd28b2d96ad56320685fa1b273866ea0894 100644 --- a/build/bromite_patches/Disable-UA-full-version.patch +++ b/build/cromite_patches/Disable-UA-full-version.patch @@ -22,8 +22,8 @@ diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_ #include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h" #include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h" #include "third_party/blink/public/common/privacy_budget/identifiable_surface.h" -@@ -40,6 +42,16 @@ void MaybeRecordMetric(bool record_identifiability, - .Record(execution_context->UkmRecorder()); +@@ -64,6 +66,16 @@ void MaybeRecordMetric(bool record_identifiability, + execution_context); } +const String GetReducedVersionNumber(const std::string& fullVersion) { @@ -39,7 +39,7 @@ diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_ } // namespace NavigatorUAData::NavigatorUAData(ExecutionContext* context) -@@ -78,7 +90,7 @@ void NavigatorUAData::SetFullVersionList( +@@ -102,7 +114,7 @@ void NavigatorUAData::SetFullVersionList( const UserAgentBrandList& full_version_list) { for (const auto& brand_version : full_version_list) { AddBrandFullVersion(String::FromUTF8(brand_version.brand), @@ -48,7 +48,7 @@ diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_ } } -@@ -100,7 +112,7 @@ void NavigatorUAData::SetModel(const String& model) { +@@ -124,7 +136,7 @@ void NavigatorUAData::SetModel(const String& model) { } void NavigatorUAData::SetUAFullVersion(const String& ua_full_version) { @@ -58,4 +58,3 @@ diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_ void NavigatorUAData::SetBitness(const String& bitness) { -- -2.25.1 diff --git a/build/cromite_patches/Disable-add-to-home-screen-prompt.patch b/build/cromite_patches/Disable-add-to-home-screen-prompt.patch new file mode 100644 index 0000000000000000000000000000000000000000..70042dd70bbb779770b6a4ef00326ee6e89cd11a --- /dev/null +++ b/build/cromite_patches/Disable-add-to-home-screen-prompt.patch @@ -0,0 +1,26 @@ +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Wed, 28 Sep 2022 00:54:10 +0200 +Subject: Disable add to home screen prompt + +License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html +--- + .../AddToHomescreenMostVisitedTileClickObserver.java | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenMostVisitedTileClickObserver.java +@@ -48,11 +48,7 @@ public class AddToHomescreenMostVisitedTileClickObserver implements MostVisitedT + ntp.addMostVisitedTileClickObserver( + AddToHomescreenMostVisitedTileClickObserver.this); + } else { +- // If it is a regular web page, and started from a most visited +- // tile, show IPH. +- if (url.getOrigin().equals(mLastClickedMostVisitedTileUrl)) { +- addToHomescreenIPHController.showAddToHomescreenIPH(tab); +- } ++ // do not show any add to home screen IPH in Bromite + removeObserver(tab); + } + mLastClickedMostVisitedTileUrl = null; +-- diff --git a/build/bromite_patches/Disable-all-predictors-code.patch b/build/cromite_patches/Disable-all-predictors-code.patch similarity index 56% rename from build/bromite_patches/Disable-all-predictors-code.patch rename to build/cromite_patches/Disable-all-predictors-code.patch index 436dcb285c01ae734bdc6644a0657236f6f35556..69d4a0e8f6a2d89afffa2bc670917c7e2bc7014f 100644 --- a/build/bromite_patches/Disable-all-predictors-code.patch +++ b/build/cromite_patches/Disable-all-predictors-code.patch @@ -5,28 +5,33 @@ Subject: Disable all predictors code Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/browser/BUILD.gn | 8 +- - chrome/browser/browser_features.cc | 16 ++-- - .../preloading_model_keyed_service.cc | 8 -- - .../preloading_model_keyed_service_factory.cc | 4 +- - .../ranking/history_clusters_module_ranker.cc | 3 +- + chrome/browser/BUILD.gn | 2 -- + .../preloading_model_keyed_service.cc | 1 + + .../preloading_model_keyed_service_factory.cc | 4 +-- .../chrome_hints_manager.cc | 1 + .../optimization_guide_keyed_service.cc | 1 - - .../browser/predictors/loading_predictor.cc | 4 +- - .../predictors/loading_predictor_config.cc | 4 +- - .../browser/predictors/predictors_features.cc | 14 +--- - .../browser/autofill_optimization_guide.cc | 5 +- + .../browser/predictors/loading_predictor.cc | 4 +-- + .../predictors/loading_predictor_config.cc | 4 +-- + .../browser/predictors/predictors_features.cc | 11 ++----- + chrome/browser/ui/tab_helpers.cc | 1 - + .../ui/webui/omnibox/omnibox_page_handler.cc | 14 +++++++++ + .../browser/autofill_optimization_guide.cc | 5 ++-- + .../browser/autocomplete_controller.cc | 2 ++ .../optimization_guide/core/hints_fetcher.cc | 1 + - .../optimization_guide/core/hints_manager.cc | 5 ++ - .../core/optimization_guide_features.cc | 74 +++++++------------ - .../core/prediction_model_download_manager.cc | 6 +- + .../optimization_guide/core/hints_manager.cc | 5 ++++ + .../core/optimization_guide_features.cc | 29 ++++++++++--------- + .../core/prediction_model_download_manager.cc | 6 ++-- .../core/prediction_model_fetcher_impl.cc | 1 + components/optimization_guide/features.gni | 3 +- - .../Disable-all-predictors-code.inc | 7 ++ - .../Disable-all-predictors-code.inc | 4 + - .../Disable-all-predictors-code.inc | 2 + + components/search/ntp_features.cc | 3 ++ + .../Disable-all-predictors-code.inc | 4 +++ + .../Disable-all-predictors-code.inc | 7 +++++ + .../Disable-all-predictors-code.inc | 4 +++ + .../Disable-all-predictors-code.inc | 2 ++ + .../document_speculation_rules.cc | 1 + .../platform/runtime_enabled_features.json5 | 2 +- - 21 files changed, 80 insertions(+), 93 deletions(-) + 25 files changed, 77 insertions(+), 41 deletions(-) + create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-all-predictors-code.inc @@ -34,73 +39,26 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -891,10 +891,10 @@ static_library("browser") { +@@ -840,8 +840,6 @@ static_library("browser") { + "navigation_predictor/navigation_predictor_keyed_service_factory.h", + "navigation_predictor/navigation_predictor_metrics_document_data.cc", "navigation_predictor/navigation_predictor_metrics_document_data.h", - "navigation_predictor/navigation_predictor_preconnect_client.cc", - "navigation_predictor/navigation_predictor_preconnect_client.h", -- "navigation_predictor/preloading_model_executor.cc", -- "navigation_predictor/preloading_model_executor.h", -- "navigation_predictor/preloading_model_handler.cc", -- "navigation_predictor/preloading_model_handler.h", -+ # "navigation_predictor/preloading_model_executor.cc", -+ # "navigation_predictor/preloading_model_executor.h", -+ # "navigation_predictor/preloading_model_handler.cc", -+ # "navigation_predictor/preloading_model_handler.h", +- "navigation_predictor/navigation_predictor_preconnect_client.cc", +- "navigation_predictor/navigation_predictor_preconnect_client.h", "navigation_predictor/preloading_model_keyed_service.cc", "navigation_predictor/preloading_model_keyed_service.h", "navigation_predictor/preloading_model_keyed_service_factory.cc", -diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc ---- a/chrome/browser/browser_features.cc -+++ b/chrome/browser/browser_features.cc -@@ -255,22 +255,22 @@ BASE_FEATURE(kIncomingCallNotifications, - - // Enables omnibox trigger prerendering. - BASE_FEATURE(kOmniboxTriggerForPrerender2, -- "OmniboxTriggerForPrerender2", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OmniboxTriggerForPrerender2", // always disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite - - // Enables bookmark trigger prerendering. - BASE_FEATURE(kBookmarkTriggerForPrerender2, -- "BookmarkTriggerForPrerender2", -- base::FEATURE_DISABLED_BY_DEFAULT); -+ "BookmarkTriggerForPrerender2", // always disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite - - // Enables New Tab Page trigger prerendering. - BASE_FEATURE(kNewTabPageTriggerForPrerender2, -- "NewTabPageTriggerForPrerender2", -- base::FEATURE_DISABLED_BY_DEFAULT); -+ "NewTabPageTriggerForPrerender2", // always disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite - - BASE_FEATURE(kSupportSearchSuggestionForPrerender2, -- "SupportSearchSuggestionForPrerender2", -- base::FEATURE_DISABLED_BY_DEFAULT); -+ "SupportSearchSuggestionForPrerender2", // always disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // in bromite - const base::FeatureParam::Option - search_suggestion_implementation_types[] = { - {SearchSuggestionPrerenderImplementationType::kUsePrefetch, diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc --- a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc +++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc -@@ -10,14 +10,6 @@ PreloadingModelKeyedService::Inputs::Inputs() = default; - +@@ -16,6 +16,7 @@ PreloadingModelKeyedService::Inputs::Inputs() = default; PreloadingModelKeyedService::PreloadingModelKeyedService( OptimizationGuideKeyedService* optimization_guide_keyed_service) { -- auto* model_provider = -- static_cast( -- optimization_guide_keyed_service); -- -- if (model_provider) { -- preloading_model_handler_ = -- std::make_unique(model_provider); -- } - } - - PreloadingModelKeyedService::~PreloadingModelKeyedService() = default; + #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) ++#error BUILD_WITH_TFLITE_LIB must be disabled + auto* model_provider = + static_cast( + optimization_guide_keyed_service); diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc --- a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc +++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc @@ -113,21 +71,6 @@ diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service_ - OptimizationGuideKeyedServiceFactory::GetForProfile(profile)); + return nullptr; } -diff --git a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc ---- a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc -+++ b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc -@@ -62,9 +62,10 @@ void HistoryClustersModuleRanker::OnAllSignalsReady( - for (const auto& cluster : clusters) { - ranking_signals->emplace_back(active_carts, category_boostlist_, cluster); - } -- auto* ranking_signals_ptr = ranking_signals.get(); - - #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) -+ auto* ranking_signals_ptr = ranking_signals.get(); -+ - if (model_handler_ && model_handler_->CanExecuteAvailableModel()) { - model_handler_->ExecuteBatch( - ranking_signals_ptr, diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/browser/optimization_guide/chrome_hints_manager.cc --- a/chrome/browser/optimization_guide/chrome_hints_manager.cc +++ b/chrome/browser/optimization_guide/chrome_hints_manager.cc @@ -142,7 +85,7 @@ diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/ diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc --- a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc +++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc -@@ -343,7 +343,6 @@ void OptimizationGuideKeyedService::RemoveObserverForOptimizationTargetModel( +@@ -520,7 +520,6 @@ void OptimizationGuideKeyedService::RemoveObserverForOptimizationTargetModel( void OptimizationGuideKeyedService::RegisterOptimizationTypes( const std::vector& optimization_types) { @@ -153,7 +96,7 @@ diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service. diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/predictors/loading_predictor.cc --- a/chrome/browser/predictors/loading_predictor.cc +++ b/chrome/browser/predictors/loading_predictor.cc -@@ -184,7 +184,7 @@ ResourcePrefetchPredictor* LoadingPredictor::resource_prefetch_predictor() { +@@ -212,7 +212,7 @@ ResourcePrefetchPredictor* LoadingPredictor::resource_prefetch_predictor() { } PreconnectManager* LoadingPredictor::preconnect_manager() { @@ -162,7 +105,7 @@ diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/pre return nullptr; } -@@ -200,7 +200,7 @@ PrefetchManager* LoadingPredictor::prefetch_manager() { +@@ -228,7 +228,7 @@ PrefetchManager* LoadingPredictor::prefetch_manager() { if (!base::FeatureList::IsEnabled(features::kLoadingPredictorPrefetch)) return nullptr; @@ -188,17 +131,6 @@ diff --git a/chrome/browser/predictors/loading_predictor_config.cc b/chrome/brow diff --git a/chrome/browser/predictors/predictors_features.cc b/chrome/browser/predictors/predictors_features.cc --- a/chrome/browser/predictors/predictors_features.cc +++ b/chrome/browser/predictors/predictors_features.cc -@@ -11,8 +11,8 @@ namespace features { - - // Whether local predictions should be used to make preconnect predictions. - BASE_FEATURE(kLoadingPredictorUseLocalPredictions, -- "LoadingPredictorUseLocalPredictions", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "LoadingPredictorUseLocalPredictions", // disabled by -+ base::FEATURE_DISABLED_BY_DEFAULT); // default - - // Modifies loading predictor so that it only learns about subresources and - // origins that are high priority. @@ -39,11 +39,7 @@ BASE_FEATURE(kLoadingPredictorDisregardAlwaysAccessesNetwork, const base::FeatureState @@ -224,6 +156,82 @@ diff --git a/chrome/browser/predictors/predictors_features.cc b/chrome/browser/p // Modifies loading predictor so that it does prefetches of subresources instead // of preconnects. +@@ -103,4 +95,5 @@ size_t GetMaxInflightPrefetches() { + 3)); + } + ++SET_CROMITE_FEATURE_DISABLED(kLoadingPredictorUseLocalPredictions); + } // namespace features +diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc +--- a/chrome/browser/ui/tab_helpers.cc ++++ b/chrome/browser/ui/tab_helpers.cc +@@ -404,7 +404,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { + } + MixedContentSettingsTabHelper::CreateForWebContents(web_contents); + NavigationMetricsRecorder::CreateForWebContents(web_contents); +- NavigationPredictorPreconnectClient::CreateForWebContents(web_contents); + OpenerHeuristicTabHelper::CreateForWebContents(web_contents); + if (optimization_guide::features::IsOptimizationHintsEnabled()) { + OptimizationGuideWebContentsObserver::CreateForWebContents(web_contents); +diff --git a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc +--- a/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc ++++ b/chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc +@@ -39,7 +39,9 @@ + #include "components/omnibox/browser/autocomplete_match.h" + #include "components/omnibox/browser/autocomplete_provider.h" + #include "components/omnibox/browser/autocomplete_result.h" ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + #include "components/omnibox/browser/autocomplete_scoring_model_service.h" ++#endif + #include "components/omnibox/browser/omnibox_field_trial.h" + #include "components/search_engines/template_url.h" + #include "content/public/browser/web_ui.h" +@@ -500,6 +502,7 @@ void OmniboxPageHandler::StartOmniboxQuery(const std::string& input_string, + } + + void OmniboxPageHandler::GetMlModelVersion(GetMlModelVersionCallback callback) { ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + if (auto* service = GetMlService()) { + auto version = service->GetModelVersion(); + if (version == -1) { +@@ -512,10 +515,14 @@ void OmniboxPageHandler::GetMlModelVersion(GetMlModelVersionCallback callback) { + } else { + std::move(callback).Run(-1); + } ++#else ++ std::move(callback).Run(-1); ++#endif + } + + void OmniboxPageHandler::StartMl(mojom::SignalsPtr mojom_signals, + StartMlCallback callback) { ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + if (auto* service = GetMlService()) { + AutocompleteMatch::ScoringSignals signals = + mojo::ConvertTo(mojom_signals); +@@ -526,6 +533,9 @@ void OmniboxPageHandler::StartMl(mojom::SignalsPtr mojom_signals, + } else { + std::move(callback).Run(-1); + } ++#else ++ std::move(callback).Run(-1); ++#endif + } + + std::unique_ptr OmniboxPageHandler::CreateController( +@@ -550,8 +560,12 @@ OmniboxPageHandler::GetAutocompleteControllerType( + } + + AutocompleteScoringModelService* OmniboxPageHandler::GetMlService() { ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + return OmniboxFieldTrial::IsMlSyncBatchUrlScoringEnabled() + ? AutocompleteScoringModelServiceFactory::GetInstance() + ->GetForProfile(profile_) + : nullptr; ++#else ++ return nullptr; ++#endif + } diff --git a/components/autofill/core/browser/autofill_optimization_guide.cc b/components/autofill/core/browser/autofill_optimization_guide.cc --- a/components/autofill/core/browser/autofill_optimization_guide.cc +++ b/components/autofill/core/browser/autofill_optimization_guide.cc @@ -253,6 +261,19 @@ diff --git a/components/autofill/core/browser/autofill_optimization_guide.cc b/c optimization_guide::OptimizationGuideDecision decision = decider_->CanApplyOptimization(url, optimization_type, /*optimization_metadata=*/nullptr); +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 +@@ -46,7 +46,9 @@ + #include "components/omnibox/browser/autocomplete_input.h" + #include "components/omnibox/browser/autocomplete_match_type.h" + #include "components/omnibox/browser/autocomplete_provider.h" ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + #include "components/omnibox/browser/autocomplete_scoring_model_service.h" ++#endif + #include "components/omnibox/browser/autocomplete_scoring_signals_annotator.h" + #include "components/omnibox/browser/bookmark_provider.h" + #include "components/omnibox/browser/bookmark_scoring_signals_annotator.h" diff --git a/components/optimization_guide/core/hints_fetcher.cc b/components/optimization_guide/core/hints_fetcher.cc --- a/components/optimization_guide/core/hints_fetcher.cc +++ b/components/optimization_guide/core/hints_fetcher.cc @@ -267,7 +288,7 @@ diff --git a/components/optimization_guide/core/hints_fetcher.cc b/components/op diff --git a/components/optimization_guide/core/hints_manager.cc b/components/optimization_guide/core/hints_manager.cc --- a/components/optimization_guide/core/hints_manager.cc +++ b/components/optimization_guide/core/hints_manager.cc -@@ -391,6 +391,7 @@ void HintsManager::Shutdown() { +@@ -388,6 +388,7 @@ void HintsManager::Shutdown() { OptimizationGuideDecision HintsManager::GetOptimizationGuideDecisionFromOptimizationTypeDecision( OptimizationTypeDecision optimization_type_decision) { @@ -275,7 +296,7 @@ diff --git a/components/optimization_guide/core/hints_manager.cc b/components/op switch (optimization_type_decision) { case OptimizationTypeDecision::kAllowedByOptimizationFilter: case OptimizationTypeDecision::kAllowedByHint: -@@ -1099,6 +1100,7 @@ void HintsManager::CanApplyOptimizationOnDemand( +@@ -1096,6 +1097,7 @@ void HintsManager::CanApplyOptimizationOnDemand( proto::RequestContext request_context, OnDemandOptimizationGuideDecisionRepeatingCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -283,7 +304,7 @@ diff --git a/components/optimization_guide/core/hints_manager.cc b/components/op InsertionOrderedSet urls_to_fetch; InsertionOrderedSet hosts_to_fetch; -@@ -1389,6 +1391,9 @@ OptimizationTypeDecision HintsManager::CanApplyOptimization( +@@ -1392,6 +1394,9 @@ OptimizationTypeDecision HintsManager::CanApplyOptimization( bool skip_cache, OptimizationMetadata* optimization_metadata) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -291,172 +312,67 @@ diff --git a/components/optimization_guide/core/hints_manager.cc b/components/op + return OptimizationTypeDecision::kNoHintAvailable; + } - ScopedCanApplyOptimizationLogger scoped_logger( - optimization_type, navigation_url, optimization_guide_logger_); + ScopedCanApplyOptimizationLogger scoped_logger(optimization_type, url, + optimization_guide_logger_); diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc --- a/components/optimization_guide/core/optimization_guide_features.cc +++ b/components/optimization_guide/core/optimization_guide_features.cc -@@ -34,13 +34,6 @@ namespace features { - +@@ -35,25 +35,13 @@ namespace features { namespace { --constexpr auto enabled_by_default_desktop_only = + constexpr auto enabled_by_default_desktop_only = -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) -- base::FEATURE_DISABLED_BY_DEFAULT; + base::FEATURE_DISABLED_BY_DEFAULT; -#else - base::FEATURE_ENABLED_BY_DEFAULT; -#endif -- + constexpr auto enabled_by_default_mobile_only = - #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - true; -@@ -48,13 +41,6 @@ constexpr auto enabled_by_default_mobile_only = +-#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) +- true; +-#else false; - #endif +-#endif --constexpr auto enabled_by_default_ios_only = + constexpr auto enabled_by_default_ios_only = -#if BUILDFLAG(IS_IOS) - base::FEATURE_ENABLED_BY_DEFAULT; -#else -- base::FEATURE_DISABLED_BY_DEFAULT; + base::FEATURE_DISABLED_BY_DEFAULT; -#endif -- + // Returns whether |locale| is a supported locale for |feature|. // - // This matches |locale| with the "supported_locales" feature param value in -@@ -149,17 +135,17 @@ std::set GetOauthScopesForFeature(const base::Feature& feature) { - // Enables the syncing of the Optimization Hints component, which provides - // hints for what optimizations can be applied on a page load. - BASE_FEATURE(kOptimizationHints, -- "OptimizationHints", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OptimizationHints", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - // Enables fetching from a remote Optimization Guide Service. - BASE_FEATURE(kRemoteOptimizationGuideFetching, -- "OptimizationHintsFetching", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OptimizationHintsFetching", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - BASE_FEATURE(kRemoteOptimizationGuideFetchingAnonymousDataConsent, -- "OptimizationHintsFetchingAnonymousDataConsent", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OptimizationHintsFetchingAnonymousDataConsent", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - // Enables performance info in the context menu and fetching from a remote - // Optimization Guide Service. -@@ -169,33 +155,29 @@ BASE_FEATURE(kContextMenuPerformanceInfoAndRemoteHintFetching, - - // Enables the prediction of optimization targets. - BASE_FEATURE(kOptimizationTargetPrediction, -- "OptimizationTargetPrediction", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OptimizationTargetPrediction", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - // Enables the downloading of models. - BASE_FEATURE(kOptimizationGuideModelDownloading, -- "OptimizationGuideModelDownloading", --#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) -- base::FEATURE_ENABLED_BY_DEFAULT --#else // BUILD_WITH_TFLITE_LIB -- base::FEATURE_DISABLED_BY_DEFAULT --#endif // !BUILD_WITH_TFLITE_LIB -+ "OptimizationGuideModelDownloading", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT // in Bromite - ); - - // Enables page content to be annotated. - BASE_FEATURE(kPageContentAnnotations, -- "PageContentAnnotations", -- enabled_by_default_desktop_only); -+ "PageContentAnnotations", // disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // by default - - // Enables fetching page metadata from the remote Optimization Guide service. - BASE_FEATURE(kRemotePageMetadata, -- "RemotePageMetadata", -- enabled_by_default_desktop_only); -+ "RemotePageMetadata", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - // Enables the page entities model to be annotated on every page load. - BASE_FEATURE(kPageEntitiesPageContentAnnotations, -- "PageEntitiesPageContentAnnotations", -- enabled_by_default_desktop_only); -+ "PageEntitiesPageContentAnnotations", // disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // by default - // Enables the page visibility model to be annotated on every page load. - BASE_FEATURE(kPageVisibilityPageContentAnnotations, - "PageVisibilityPageContentAnnotations", -@@ -218,8 +200,8 @@ BASE_FEATURE(kPageEntitiesModelResetOnShutdown, - - // Enables push notification of hints. - BASE_FEATURE(kPushNotifications, -- "OptimizationGuidePushNotifications", -- enabled_by_default_ios_only); -+ "OptimizationGuidePushNotifications", // disabled by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - // This feature flag does not turn off any behavior, it is only used for - // experiment parameters. -@@ -232,21 +214,21 @@ BASE_FEATURE(kOptimizationGuideMetadataValidation, - "OptimizationGuideMetadataValidation", - base::FEATURE_DISABLED_BY_DEFAULT); - --BASE_FEATURE(kPageVisibilityBatchAnnotations, -- "PageVisibilityBatchAnnotations", -- base::FEATURE_ENABLED_BY_DEFAULT); -+BASE_FEATURE(kPageVisibilityBatchAnnotations, // disabled -+ "PageVisibilityBatchAnnotations", // by default -+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite - - BASE_FEATURE(kTextEmbeddingBatchAnnotations, - "TextEmbeddingBatchAnnotations", - base::FEATURE_DISABLED_BY_DEFAULT); - - BASE_FEATURE(kPageContentAnnotationsValidation, -- "PageContentAnnotationsValidation", -- base::FEATURE_DISABLED_BY_DEFAULT); -+ "PageContentAnnotationsValidation", // disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // by default - - BASE_FEATURE(kPreventLongRunningPredictionModels, - "PreventLongRunningPredictionModels", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ base::FEATURE_DISABLED_BY_DEFAULT); - - BASE_FEATURE(kOptimizationGuideUseContinueOnShutdownForPageContentAnnotations, - "OptimizationGuideUseContinueOnShutdownForPageContentAnnotations", -@@ -276,13 +258,13 @@ BASE_FEATURE(kExtractRelatedSearchesFromPrefetchedZPSResponse, - - BASE_FEATURE(kPageContentAnnotationsPersistSalientImageMetadata, - "PageContentAnnotationsPersistSalientImageMetadata", -- enabled_by_default_desktop_only); -+ base::FEATURE_DISABLED_BY_DEFAULT); - - // Killswitch for fetching on search results from a remote Optimization Guide - // Service. - BASE_FEATURE(kOptimizationGuideFetchingForSRP, -- "OptimizationHintsFetchingSRP", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ "OptimizationHintsFetchingSRP", // disabled -+ base::FEATURE_DISABLED_BY_DEFAULT); // by default - - // Enables the model store to save relative paths computed from the base model - // store dir. Storing as relative path in the model store is needed for IOS, -@@ -566,7 +548,7 @@ size_t MaxURLKeyedHintCacheSize() { +@@ -587,8 +575,7 @@ size_t MaxURLKeyedHintCacheSize() { + } bool ShouldPersistHintsToDisk() { - return GetFieldTrialParamByFeatureAsBool(kOptimizationHints, +- return GetFieldTrialParamByFeatureAsBool(kOptimizationHints, - "persist_hints_to_disk", true); -+ "persist_hints_to_disk", false); ++ return false; } bool ShouldEnablePersonalizedMetadata(proto::RequestContext request_context) { +@@ -1007,5 +994,19 @@ bool CanLaunchOnDeviceModelService() { + base::FeatureList::IsEnabled(kLogOnDeviceMetricsOnStartup); + } + ++SET_CROMITE_FEATURE_DISABLED(kOptimizationHints); ++SET_CROMITE_FEATURE_DISABLED(kRemoteOptimizationGuideFetching); ++SET_CROMITE_FEATURE_DISABLED(kRemoteOptimizationGuideFetchingAnonymousDataConsent); ++SET_CROMITE_FEATURE_DISABLED(kOptimizationTargetPrediction); ++SET_CROMITE_FEATURE_DISABLED(kOptimizationGuideModelDownloading); ++SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotations); ++SET_CROMITE_FEATURE_DISABLED(kRemotePageMetadata); ++SET_CROMITE_FEATURE_DISABLED(kPageEntitiesPageContentAnnotations); ++SET_CROMITE_FEATURE_DISABLED(kPushNotifications); ++SET_CROMITE_FEATURE_DISABLED(kPageVisibilityBatchAnnotations); ++SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotationsValidation); ++SET_CROMITE_FEATURE_DISABLED(kPreventLongRunningPredictionModels); ++SET_CROMITE_FEATURE_DISABLED(kPageContentAnnotationsPersistSalientImageMetadata); ++SET_CROMITE_FEATURE_DISABLED(kOptimizationGuideFetchingForSRP); + } // namespace features + } // namespace optimization_guide diff --git a/components/optimization_guide/core/prediction_model_download_manager.cc b/components/optimization_guide/core/prediction_model_download_manager.cc --- a/components/optimization_guide/core/prediction_model_download_manager.cc +++ b/components/optimization_guide/core/prediction_model_download_manager.cc @@ -518,6 +434,26 @@ diff --git a/components/optimization_guide/features.gni b/components/optimizatio } declare_args() { +diff --git a/components/search/ntp_features.cc b/components/search/ntp_features.cc +--- a/components/search/ntp_features.cc ++++ b/components/search/ntp_features.cc +@@ -501,4 +501,7 @@ std::vector GetModulesOrder() { + base::SplitResult::SPLIT_WANT_NONEMPTY); + } + ++SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModule); ++SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModuleLoad); ++SET_CROMITE_FEATURE_DISABLED(kNtpHistoryClustersModuleUseModelRanking); + } // namespace ntp_features +diff --git a/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc b/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc +@@ -0,0 +1,4 @@ ++SET_CROMITE_FEATURE_DISABLED(kOmniboxTriggerForPrerender2); ++SET_CROMITE_FEATURE_DISABLED(kBookmarkTriggerForPrerender2); ++SET_CROMITE_FEATURE_DISABLED(kNewTabPageTriggerForPrerender2); ++SET_CROMITE_FEATURE_DISABLED(kSupportSearchSuggestionForPrerender2); diff --git a/cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc b/cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc new file mode 100644 --- /dev/null @@ -546,10 +482,21 @@ new file mode 100644 @@ -0,0 +1,2 @@ +SET_CROMITE_FEATURE_DISABLED(kNavigationPredictor); +SET_CROMITE_FEATURE_DISABLED(kPreloadingHeuristicsMLModel); +diff --git a/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc b/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc +--- a/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc ++++ b/third_party/blink/renderer/core/speculation_rules/document_speculation_rules.cc +@@ -584,6 +584,7 @@ void DocumentSpeculationRules::UpdateSpeculationCandidates() { + return; + } + ++ if ((true)) return; + HeapVector> candidates; + auto push_candidates = [&candidates, &execution_context]( + mojom::blink::SpeculationAction action, 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 -@@ -3007,7 +3007,7 @@ +@@ -2969,7 +2969,7 @@ { // https://crbug.com/1126305 name: "Prerender2", @@ -559,4 +506,3 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 { name: "Presentation", -- -2.25.1 diff --git a/build/bromite_patches/Disable-all-promo-dialogs.patch b/build/cromite_patches/Disable-all-promo-dialogs.patch similarity index 71% rename from build/bromite_patches/Disable-all-promo-dialogs.patch rename to build/cromite_patches/Disable-all-promo-dialogs.patch index c98ce1a6ae8b4d4ae09340be44dfd098a5d1e865..07391fcd0e84f5d464cc101409033b8a51e238f7 100644 --- a/build/bromite_patches/Disable-all-promo-dialogs.patch +++ b/build/cromite_patches/Disable-all-promo-dialogs.patch @@ -8,26 +8,27 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/browser/ui/browser_ui_prefs.cc | 2 +- .../ui/views/user_education/browser_feature_promo_controller.cc | 1 + .../chrome/browser/user_education/UserEducationHelper.java | 1 + + components/user_education/common/feature_promo_controller.cc | 1 + components/user_education/common/feature_promo_registry.cc | 1 + .../browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc | 1 + - 6 files changed, 6 insertions(+), 1 deletion(-) + 7 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc 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 -@@ -945,6 +945,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { +@@ -1143,6 +1143,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { } - private boolean maybeShowPromo() { + private boolean maybeShowPromo(Profile profile) { + if ((true)) return false; - // Only one promo can be shown in one run to avoid nagging users too much. - if (FullScreenSyncPromoUtil.launchPromoIfNeeded(mActivity, - SyncConsentActivityLauncherImpl.get(), VersionInfo.getProductMajorVersion())) { + // NOTE: Only one promo can be shown in one run to avoid nagging users too much. + + // The PWA Restore promotion runs when we've detected that a user has switched to a new diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc --- a/chrome/browser/ui/browser_ui_prefs.cc +++ b/chrome/browser/ui/browser_ui_prefs.cc -@@ -144,7 +144,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { +@@ -143,7 +143,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref(prefs::kEnterpriseHardwarePlatformAPIEnabled, false); @@ -39,14 +40,14 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u diff --git a/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc b/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc --- a/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc +++ b/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc -@@ -68,6 +68,7 @@ ui::ElementContext BrowserFeaturePromoController::GetAnchorContext() const { +@@ -129,6 +129,7 @@ ui::ElementContext BrowserFeaturePromoController::GetAnchorContext() const { bool BrowserFeaturePromoController::CanShowPromoForElement( ui::TrackedElement* anchor_element) const { + if ((true)) return false; auto* const profile = browser_view_->GetProfile(); - // Temporarily turn off IPH in incognito as a concern was raised that - // the IPH backend ignores incognito and writes to the parent profile. + + // Verify that there are no required notices pending. diff --git a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java --- a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java +++ b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java @@ -57,18 +58,29 @@ diff --git a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/ + if ((true)) return; // Activity was destroyed; don't show IPH. View anchorView = iphCommand.anchorView; - if (mActivity == null || mActivity.isFinishing() || mActivity.isDestroyed() + if (mActivity == null +diff --git a/components/user_education/common/feature_promo_controller.cc b/components/user_education/common/feature_promo_controller.cc +--- a/components/user_education/common/feature_promo_controller.cc ++++ b/components/user_education/common/feature_promo_controller.cc +@@ -433,6 +433,7 @@ FeaturePromoResult FeaturePromoControllerCommon::CanShowPromoCommon( + const FeaturePromoSpecification** spec_out, + std::unique_ptr* lifecycle_out, + ui::TrackedElement** anchor_element_out) const { ++ if ((true)) return FeaturePromoResult::kBlockedByContext; + // Ensure that this promo isn't already queued for startup. + // + // Note that this check is bypassed if this is for an explicit demo, but not diff --git a/components/user_education/common/feature_promo_registry.cc b/components/user_education/common/feature_promo_registry.cc --- a/components/user_education/common/feature_promo_registry.cc +++ b/components/user_education/common/feature_promo_registry.cc -@@ -30,6 +30,7 @@ const FeaturePromoSpecification* FeaturePromoRegistry::GetParamsForFeature( +@@ -29,6 +29,7 @@ const FeaturePromoSpecification* FeaturePromoRegistry::GetParamsForFeature( } void FeaturePromoRegistry::RegisterFeature(FeaturePromoSpecification spec) { + if ((true)) return; const base::Feature* const iph_feature = spec.feature(); CHECK(iph_feature); - const auto result = feature_promo_data_.emplace(iph_feature, std::move(spec)); + CHECK_NE(FeaturePromoSpecification::PromoType::kUnspecified, diff --git a/cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc b/cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc new file mode 100755 --- /dev/null @@ -76,4 +88,3 @@ new file mode 100755 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kChromeLabs); -- -2.25.1 diff --git a/build/bromite_patches/Disable-conversion-measurement-api.patch b/build/cromite_patches/Disable-conversion-measurement-api.patch similarity index 61% rename from build/bromite_patches/Disable-conversion-measurement-api.patch rename to build/cromite_patches/Disable-conversion-measurement-api.patch index c5f6fc57b8c5c954b404d94f681e7d39e743c743..760603b75a195e0c3904f2424528b221324f4aea 100644 --- a/build/bromite_patches/Disable-conversion-measurement-api.patch +++ b/build/cromite_patches/Disable-conversion-measurement-api.patch @@ -11,34 +11,46 @@ being sent and being saved to disk, although it is currently in uncalled code. Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/android/java/AndroidManifest.xml | 1 - - components/attribution_reporting/features.cc | 1 + + .../browser/aw_content_browser_client.cc | 1 + + chrome/android/java/AndroidManifest.xml | 4 - + components/attribution_reporting/features.cc | 2 + .../origin_trials/features.cc | 2 + .../render_view_context_menu_base.cc | 3 - .../aggregatable_report_sender.cc | 15 +- .../aggregation_service_features.cc | 1 + - .../attribution_data_host_manager_impl.cc | 5 + + .../attribution_data_host_manager_impl.cc | 1 + .../attribution_reporting/attribution_host.cc | 1 + - .../attribution_os_level_manager.cc | 1 + + .../attribution_os_level_manager.cc | 3 +- .../attribution_report_network_sender.cc | 9 + .../attribution_storage_sql.cc | 8 +- content/browser/storage_partition_impl.cc | 9 - content/public/android/BUILD.gn | 2 - - .../browser/AttributionOsLevelManager.java | 218 +----------------- - .../public/browser/content_browser_client.cc | 6 +- + .../browser/AttributionOsLevelManager.java | 296 +----------------- + .../public/browser/content_browser_client.cc | 7 +- .../public/browser/navigation_controller.cc | 1 - - content/renderer/render_thread_impl.cc | 5 +- .../Disable-conversion-measurement-api.inc | 1 + .../Disable-conversion-measurement-api.inc | 1 + .../Disable-conversion-measurement-api.inc | 9 + .../attribution/request_headers_internal.cc | 1 + .../network/public/cpp/attribution_utils.cc | 2 + + third_party/blink/renderer/core/page/page.cc | 2 +- ui/events/android/motion_event_android.cc | 6 +- - 23 files changed, 67 insertions(+), 241 deletions(-) + 24 files changed, 64 insertions(+), 323 deletions(-) create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-conversion-measurement-api.inc create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Disable-conversion-measurement-api.inc create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-conversion-measurement-api.inc +diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc +--- a/android_webview/browser/aw_content_browser_client.cc ++++ b/android_webview/browser/aw_content_browser_client.cc +@@ -1216,6 +1216,7 @@ network::mojom::AttributionSupport + AwContentBrowserClient::GetAttributionSupport( + AttributionReportingOsApiState state, + content::WebContents* web_contents) { ++ if ((true)) return network::mojom::AttributionSupport::kNone; + AwSettings* aw_settings = AwSettings::FromWebContents(web_contents); + if (aw_settings && aw_settings->GetAttributionBehavior() == + AwSettings::AttributionBehavior::DISABLED) { 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 @@ -50,14 +62,25 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro diff --git a/components/attribution_reporting/features.cc b/components/attribution_reporting/features.cc --- a/components/attribution_reporting/features.cc +++ b/components/attribution_reporting/features.cc -@@ -17,4 +17,5 @@ BASE_FEATURE(kAttributionReportingNullAggregatableReports, - "AttributionReportingNullAggregatableReports", +@@ -21,4 +21,6 @@ BASE_FEATURE(kAttributionReportingTriggerContextId, + "AttributionReportingTriggerContextId", base::FEATURE_ENABLED_BY_DEFAULT); +SET_CROMITE_FEATURE_DISABLED(kConversionMeasurement); ++SET_CROMITE_FEATURE_DISABLED(kAttributionReportingTriggerContextId); } // namespace attribution_reporting::features diff --git a/components/embedder_support/origin_trials/features.cc b/components/embedder_support/origin_trials/features.cc --- a/components/embedder_support/origin_trials/features.cc @@ -72,7 +95,7 @@ diff --git a/components/embedder_support/origin_trials/features.cc b/components/ diff --git a/components/renderer_context_menu/render_view_context_menu_base.cc b/components/renderer_context_menu/render_view_context_menu_base.cc --- a/components/renderer_context_menu/render_view_context_menu_base.cc +++ b/components/renderer_context_menu/render_view_context_menu_base.cc -@@ -507,9 +507,6 @@ RenderViewContextMenuBase::GetOpenURLParamsWithExtraHeaders( +@@ -510,9 +510,6 @@ RenderViewContextMenuBase::GetOpenURLParamsWithExtraHeaders( open_url_params.source_site_instance = site_instance_; @@ -85,7 +108,7 @@ diff --git a/components/renderer_context_menu/render_view_context_menu_base.cc b diff --git a/content/browser/aggregation_service/aggregatable_report_sender.cc b/content/browser/aggregation_service/aggregatable_report_sender.cc --- a/content/browser/aggregation_service/aggregatable_report_sender.cc +++ b/content/browser/aggregation_service/aggregatable_report_sender.cc -@@ -136,19 +136,18 @@ void AggregatableReportSender::SendReport(const GURL& url, +@@ -137,19 +137,18 @@ void AggregatableReportSender::SendReport(const GURL& url, // Allow bodies of non-2xx responses to be returned. simple_url_loader_ptr->SetAllowHttpErrorResults(true); @@ -111,7 +134,7 @@ diff --git a/content/browser/aggregation_service/aggregatable_report_sender.cc b + } RequestStatus status; - absl::optional http_response_code; + std::optional http_response_code; diff --git a/content/browser/aggregation_service/aggregation_service_features.cc b/content/browser/aggregation_service/aggregation_service_features.cc --- a/content/browser/aggregation_service/aggregation_service_features.cc +++ b/content/browser/aggregation_service/aggregation_service_features.cc @@ -124,22 +147,18 @@ diff --git a/content/browser/aggregation_service/aggregation_service_features.cc diff --git a/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc b/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc --- a/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc +++ b/content/browser/attribution_reporting/attribution_data_host_manager_impl.cc -@@ -500,6 +500,11 @@ void AttributionDataHostManagerImpl::ParseSource( +@@ -833,6 +833,7 @@ void AttributionDataHostManagerImpl::ParseHeader( + HeaderPendingDecode pending_decode, Registrar registrar) { DCHECK(it != registrations_.end()); ++ if ((true)) return; -+ if ((true)) { -+ MaybeOnRegistrationsFinished(it); -+ return; -+ } -+ - switch (registrar) { - case Registrar::kWeb: - if (!network::HasAttributionWebSupport( + switch (it->eligibility()) { + case RegistrationEligibility::kSourceOrTrigger: diff --git a/content/browser/attribution_reporting/attribution_host.cc b/content/browser/attribution_reporting/attribution_host.cc --- a/content/browser/attribution_reporting/attribution_host.cc +++ b/content/browser/attribution_reporting/attribution_host.cc -@@ -360,6 +360,7 @@ void AttributionHost::RegisterNavigationDataHost( +@@ -361,6 +361,7 @@ void AttributionHost::RegisterNavigationDataHost( return; } @@ -150,14 +169,23 @@ diff --git a/content/browser/attribution_reporting/attribution_host.cc b/content diff --git a/content/browser/attribution_reporting/attribution_os_level_manager.cc b/content/browser/attribution_reporting/attribution_os_level_manager.cc --- a/content/browser/attribution_reporting/attribution_os_level_manager.cc +++ b/content/browser/attribution_reporting/attribution_os_level_manager.cc -@@ -51,6 +51,7 @@ ApiState GetApiState() { +@@ -46,6 +46,7 @@ absl::optional g_state GUARDED_BY_CONTEXT(GetSequenceChecker()); + // static + bool AttributionOsLevelManager::ShouldUseOsWebSource( + GlobalRenderFrameHostId render_frame_id) { ++ if ((true)) return false; + return GetContentClient() + ->browser() + ->ShouldUseOsWebSourceAttributionReporting( +@@ -74,7 +75,7 @@ bool AttributionOsLevelManager::ShouldInitializeApiState() { + // static + ApiState AttributionOsLevelManager::GetApiState() { + DCHECK_CALLED_ON_VALID_SEQUENCE(GetSequenceChecker()); +- return g_state.value_or(ApiState::kDisabled); ++ return ApiState::kDisabled; + } // static - network::mojom::AttributionSupport AttributionOsLevelManager::GetSupport() { -+ if ((true)) return network::mojom::AttributionSupport::kNone; - bool is_web_allowed = - GetContentClient()->browser()->IsWebAttributionReportingAllowed(); - switch (GetApiState()) { diff --git a/content/browser/attribution_reporting/attribution_report_network_sender.cc b/content/browser/attribution_reporting/attribution_report_network_sender.cc --- a/content/browser/attribution_reporting/attribution_report_network_sender.cc +++ b/content/browser/attribution_reporting/attribution_report_network_sender.cc @@ -187,8 +215,8 @@ diff --git a/content/browser/attribution_reporting/attribution_report_network_se diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc --- a/content/browser/attribution_reporting/attribution_storage_sql.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql.cc -@@ -692,14 +692,16 @@ StorableSource::Result DestinationRateLimitResultToStorableSourceResult( - } +@@ -398,14 +398,16 @@ base::FilePath DatabasePath(const base::FilePath& user_data_directory) { + return user_data_directory.Append(kDatabasePath); } +bool g_run_in_memory = true; @@ -210,7 +238,7 @@ diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/ diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc -@@ -1500,15 +1500,6 @@ void StoragePartitionImpl::Initialize( +@@ -1526,15 +1526,6 @@ void StoragePartitionImpl::Initialize( bucket_manager_ = std::make_unique(this); @@ -257,9 +285,9 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; - import org.chromium.base.ContextUtils; - import org.chromium.base.Log; -@@ -51,6 +40,8 @@ import java.util.concurrent.TimeoutException; + import org.jni_zero.CalledByNative; + import org.jni_zero.JNINamespace; +@@ -52,6 +41,8 @@ import java.util.concurrent.TimeoutException; */ @JNINamespace("content") public class AttributionOsLevelManager { @@ -268,149 +296,205 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib private static final String TAG = "AttributionManager"; // TODO: replace with constant in android.Manifest.permission once it becomes available in U. private static final String PERMISSION_ACCESS_ADSERVICES_ATTRIBUTION = -@@ -98,21 +89,11 @@ public class AttributionOsLevelManager { +@@ -116,62 +107,11 @@ public class AttributionOsLevelManager { } private static boolean supportsAttribution() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R; +- } +- +- private static @OperationResult int convertToOperationResult(Throwable thrown) { +- if (thrown instanceof IllegalArgumentException) { +- return OperationResult.ERROR_ILLEGAL_ARGUMENT; +- } else if (thrown instanceof IOException) { +- return OperationResult.ERROR_IO; +- } else if (thrown instanceof IllegalStateException) { +- // The Android API doesn't break out this error as a separate exception so we +- // are forced to inspect the message for now. +- if (thrown.getMessage().toLowerCase(Locale.US).contains("background")) { +- return OperationResult.ERROR_BACKGROUND_CALLER; +- } else { +- return OperationResult.ERROR_ILLEGAL_STATE; +- } +- } else if (thrown instanceof SecurityException) { +- return OperationResult.ERROR_SECURITY; +- } else if (thrown instanceof TimeoutException) { +- return OperationResult.ERROR_TIMEOUT; +- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R +- && thrown instanceof LimitExceededException) { +- return OperationResult.ERROR_LIMIT_EXCEEDED; +- } else { +- return OperationResult.ERROR_UNKNOWN; +- } + return false; } + private static void recordOperationResult( + @OperationType int type, @OperationResult int result) { +- String suffix = ""; +- switch (type) { +- case OperationType.REGISTER_SOURCE: +- suffix = "RegisterSource"; +- break; +- case OperationType.REGISTER_WEB_SOURCE: +- suffix = "RegisterWebSource"; +- break; +- case OperationType.REGISTER_TRIGGER: +- suffix = "RegisterTrigger"; +- break; +- case OperationType.REGISTER_WEB_TRIGGER: +- suffix = "RegisterWebTrigger"; +- break; +- case OperationType.GET_MEASUREMENT_API_STATUS: +- suffix = "GetMeasurementApiStatus"; +- break; +- case OperationType.DELETE_REGISTRATIONS: +- suffix = "DeleteRegistrations"; +- break; +- } +- +- assert suffix.length() > 0; +- +- RecordHistogram.recordEnumeratedHistogram( +- "Conversions.AndroidOperationResult." + suffix, result, OperationResult.COUNT); + } + + @CalledByNative +@@ -180,22 +120,7 @@ public class AttributionOsLevelManager { + } + private MeasurementManagerFutures getManager() { +- if (!supportsAttribution()) { +- return null; +- } - if (sManagerForTesting != null) { - return sManagerForTesting; - } - if (mManager != null) { - return mManager; - } -- if (!supportsAttribution()) { -- return null; +- try { +- mManager = MeasurementManagerFutures.from(ContextUtils.getApplicationContext()); +- } catch (Throwable t) { +- // An error may be thrown if android.ext.adservices is not loaded. +- Log.i(TAG, "Failed to get measurement manager", t); - } -- mManager = MeasurementManagerFutures.from(ContextUtils.getApplicationContext()); - return mManager; + return null; } private void onRegistrationCompleted( -@@ -137,46 +118,6 @@ public class AttributionOsLevelManager { +@@ -209,28 +134,6 @@ public class AttributionOsLevelManager { } } - private void addRegistrationFutureCallback( -- int requestId, @RegistrationType int type, ListenableFuture future) { +- int requestId, @OperationType int type, ListenableFuture future) { - if (!supportsAttribution()) { - return; - } -- Futures.addCallback(future, new FutureCallback() { -- @Override -- public void onSuccess(Object result) { -- onRegistrationCompleted(requestId, type, RegistrationResult.SUCCESS); -- } -- @Override -- public void onFailure(Throwable thrown) { -- Log.w(TAG, "Failed to register", thrown); -- @RegistrationResult -- int result = RegistrationResult.ERROR_UNKNOWN; -- if (thrown instanceof IllegalArgumentException) { -- result = RegistrationResult.ERROR_ILLEGAL_ARGUMENT; -- } else if (thrown instanceof IOException) { -- result = RegistrationResult.ERROR_IO; -- } else if (thrown instanceof IllegalStateException) { -- // The Android API doesn't break out this error as a separate exception so we -- // are forced to inspect the message for now. -- if (thrown.getMessage().toLowerCase(Locale.US).contains("background")) { -- result = RegistrationResult.ERROR_BACKGROUND_CALLER; -- } else { -- result = RegistrationResult.ERROR_ILLEGAL_STATE; +- Futures.addCallback( +- future, +- new FutureCallback() { +- @Override +- public void onSuccess(Object result) { +- onRegistrationCompleted(requestId, type, OperationResult.SUCCESS); - } -- } else if (thrown instanceof SecurityException) { -- result = RegistrationResult.ERROR_SECURITY; -- } else if (thrown instanceof TimeoutException) { -- result = RegistrationResult.ERROR_TIMEOUT; -- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R -- && thrown instanceof LimitExceededException) { -- result = RegistrationResult.ERROR_LIMIT_EXCEEDED; -- } -- onRegistrationCompleted(requestId, type, result); -- } -- }, ContextUtils.getApplicationContext().getMainExecutor()); +- +- @Override +- public void onFailure(Throwable thrown) { +- Log.w(TAG, "Failed to register", thrown); +- onRegistrationCompleted(requestId, type, convertToOperationResult(thrown)); +- } +- }, +- ContextUtils.getApplicationContext().getMainExecutor()); - } - /** * Registers a web attribution source with native, see `registerWebSourceAsync()`: * https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/java/measurement/MeasurementManagerFutures. -@@ -189,19 +130,6 @@ public class AttributionOsLevelManager { - requestId, RegistrationType.SOURCE, RegistrationResult.ERROR_INTERNAL); +@@ -249,25 +152,6 @@ public class AttributionOsLevelManager { + OperationResult.ERROR_VERSION_UNSUPPORTED); return; } - MeasurementManagerFutures mm = getManager(); - if (mm == null) { - onRegistrationCompleted( -- requestId, RegistrationType.SOURCE, RegistrationResult.ERROR_INTERNAL); +- requestId, OperationType.REGISTER_WEB_SOURCE, OperationResult.ERROR_INTERNAL); - return; - } -- ListenableFuture future = mm.registerWebSourceAsync(new WebSourceRegistrationRequest( -- Arrays.asList(new WebSourceParams( -- Uri.parse(registrationUrl.getSpec()), isDebugKeyAllowed)), -- Uri.parse(topLevelOrigin.getSpec()), /*inputEvent=*/event, -- /*appDestination=*/null, /*webDestination=*/null, -- /*verifiedDestination=*/null)); -- addRegistrationFutureCallback(requestId, RegistrationType.SOURCE, future); +- ListenableFuture future = +- mm.registerWebSourceAsync( +- new WebSourceRegistrationRequest( +- Arrays.asList( +- new WebSourceParams( +- Uri.parse(registrationUrl.getSpec()), +- isDebugKeyAllowed)), +- Uri.parse(topLevelOrigin.getSpec()), +- /* inputEvent= */ event, +- /* appDestination= */ null, +- /* webDestination= */ null, +- /* verifiedDestination= */ null)); +- addRegistrationFutureCallback(requestId, OperationType.REGISTER_WEB_SOURCE, future); } /** -@@ -215,15 +143,6 @@ public class AttributionOsLevelManager { - requestId, RegistrationType.SOURCE, RegistrationResult.ERROR_INTERNAL); +@@ -283,15 +167,6 @@ public class AttributionOsLevelManager { + OperationResult.ERROR_VERSION_UNSUPPORTED); return; } - MeasurementManagerFutures mm = getManager(); - if (mm == null) { - onRegistrationCompleted( -- requestId, RegistrationType.SOURCE, RegistrationResult.ERROR_INTERNAL); +- requestId, OperationType.REGISTER_SOURCE, OperationResult.ERROR_INTERNAL); - return; - } - ListenableFuture future = - mm.registerSourceAsync(Uri.parse(registrationUrl.getSpec()), event); -- addRegistrationFutureCallback(requestId, RegistrationType.SOURCE, future); +- addRegistrationFutureCallback(requestId, OperationType.REGISTER_SOURCE, future); } /** -@@ -238,18 +157,6 @@ public class AttributionOsLevelManager { - requestId, RegistrationType.TRIGGER, RegistrationResult.ERROR_INTERNAL); +@@ -308,22 +183,6 @@ public class AttributionOsLevelManager { + OperationResult.ERROR_VERSION_UNSUPPORTED); return; } - - MeasurementManagerFutures mm = getManager(); - if (mm == null) { - onRegistrationCompleted( -- requestId, RegistrationType.TRIGGER, RegistrationResult.ERROR_INTERNAL); +- requestId, OperationType.REGISTER_WEB_TRIGGER, OperationResult.ERROR_INTERNAL); - return; - } -- ListenableFuture future = mm.registerWebTriggerAsync(new WebTriggerRegistrationRequest( -- Arrays.asList(new WebTriggerParams( -- Uri.parse(registrationUrl.getSpec()), isDebugKeyAllowed)), -- Uri.parse(topLevelOrigin.getSpec()))); -- addRegistrationFutureCallback(requestId, RegistrationType.TRIGGER, future); +- ListenableFuture future = +- mm.registerWebTriggerAsync( +- new WebTriggerRegistrationRequest( +- Arrays.asList( +- new WebTriggerParams( +- Uri.parse(registrationUrl.getSpec()), +- isDebugKeyAllowed)), +- Uri.parse(topLevelOrigin.getSpec()))); +- addRegistrationFutureCallback(requestId, OperationType.REGISTER_WEB_TRIGGER, future); } /** -@@ -263,15 +170,6 @@ public class AttributionOsLevelManager { - requestId, RegistrationType.TRIGGER, RegistrationResult.ERROR_INTERNAL); +@@ -339,15 +198,6 @@ public class AttributionOsLevelManager { + OperationResult.ERROR_VERSION_UNSUPPORTED); return; } - - MeasurementManagerFutures mm = getManager(); - if (mm == null) { - onRegistrationCompleted( -- requestId, RegistrationType.TRIGGER, RegistrationResult.ERROR_INTERNAL); +- requestId, OperationType.REGISTER_TRIGGER, OperationResult.ERROR_INTERNAL); - return; - } - ListenableFuture future = mm.registerTriggerAsync(Uri.parse(registrationUrl.getSpec())); -- addRegistrationFutureCallback(requestId, RegistrationType.TRIGGER, future); +- addRegistrationFutureCallback(requestId, OperationType.REGISTER_TRIGGER, future); } private void onDataDeletionCompleted(int requestId) { -@@ -296,77 +194,7 @@ public class AttributionOsLevelManager { +@@ -382,96 +232,7 @@ public class AttributionOsLevelManager { onDataDeletionCompleted(requestId); return; } @@ -430,14 +514,20 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib - if (origins.length == 0 && domains.length == 0) { - switch (matchBehavior) { - case DeletionRequest.MATCH_BEHAVIOR_DELETE: +- recordOperationResult( +- OperationType.DELETE_REGISTRATIONS, OperationResult.SUCCESS); - onDataDeletionCompleted(requestId); - return; - case DeletionRequest.MATCH_BEHAVIOR_PRESERVE: -- matchBehaviors = ImmutableList.of(DeletionRequest.MATCH_BEHAVIOR_DELETE, -- DeletionRequest.MATCH_BEHAVIOR_PRESERVE); +- matchBehaviors = +- ImmutableList.of( +- DeletionRequest.MATCH_BEHAVIOR_DELETE, +- DeletionRequest.MATCH_BEHAVIOR_PRESERVE); - break; - default: - Log.e(TAG, "Received invalid match behavior: ", matchBehavior); +- recordOperationResult( +- OperationType.DELETE_REGISTRATIONS, OperationResult.ERROR_UNKNOWN); - onDataDeletionCompleted(requestId); - return; - } @@ -457,30 +547,43 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib - - int numCalls = matchBehaviors.size(); - -- FutureCallback callback = new FutureCallback() { -- private int mNumPendingCalls = numCalls; +- FutureCallback callback = +- new FutureCallback() { +- private int mNumPendingCalls = numCalls; - -- private void onCall() { -- if (--mNumPendingCalls == 0) { -- onDataDeletionCompleted(requestId); -- } -- } +- private void onCall() { +- if (--mNumPendingCalls == 0) { +- onDataDeletionCompleted(requestId); +- } +- } - -- @Override -- public void onSuccess(Object result) { -- onCall(); -- } -- @Override -- public void onFailure(Throwable thrown) { -- Log.w(TAG, "Failed to delete measurement API data", thrown); -- onCall(); -- } -- }; +- @Override +- public void onSuccess(Object result) { +- recordOperationResult( +- OperationType.DELETE_REGISTRATIONS, OperationResult.SUCCESS); +- onCall(); +- } +- +- @Override +- public void onFailure(Throwable thrown) { +- Log.w(TAG, "Failed to delete measurement API data", thrown); +- recordOperationResult( +- OperationType.DELETE_REGISTRATIONS, +- convertToOperationResult(thrown)); +- onCall(); +- } +- }; - - for (int currMatchBehavior : matchBehaviors) { -- ListenableFuture future = mm.deleteRegistrationsAsync(new DeletionRequest( -- deletionMode, currMatchBehavior, Instant.ofEpochMilli(startMs), -- Instant.ofEpochMilli(endMs), originUris, domainUris)); +- ListenableFuture future = +- mm.deleteRegistrationsAsync( +- new DeletionRequest( +- deletionMode, +- currMatchBehavior, +- Instant.ofEpochMilli(startMs), +- Instant.ofEpochMilli(endMs), +- originUris, +- domainUris)); - - Futures.addCallback( - future, callback, ContextUtils.getApplicationContext().getMainExecutor()); @@ -488,8 +591,8 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib + onDataDeletionCompleted(requestId); } - /** -@@ -377,6 +205,10 @@ public class AttributionOsLevelManager { + private static void onMeasurementStateReturned(int status, @OperationResult int result) { +@@ -487,6 +248,10 @@ public class AttributionOsLevelManager { private static void getMeasurementApiStatus() { ThreadUtils.assertOnBackgroundThread(); @@ -500,14 +603,20 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib if (sManagerForTesting != null) { AttributionOsLevelManagerJni.get().onMeasurementStateReturned(1); return; -@@ -393,38 +225,6 @@ public class AttributionOsLevelManager { - AttributionOsLevelManagerJni.get().onMeasurementStateReturned(0); +@@ -506,49 +271,6 @@ public class AttributionOsLevelManager { + onMeasurementStateReturned(/* status= */ 0, OperationResult.ERROR_PERMISSION_UNGRANTED); return; } -- MeasurementManagerFutures mm = -- MeasurementManagerFutures.from(ContextUtils.getApplicationContext()); +- MeasurementManagerFutures mm = null; +- try { +- mm = MeasurementManagerFutures.from(ContextUtils.getApplicationContext()); +- } catch (Throwable t) { +- // An error may be thrown if android.ext.adservices is not loaded. +- Log.i(TAG, "Failed to get measurement manager", t); +- } +- - if (mm == null) { -- AttributionOsLevelManagerJni.get().onMeasurementStateReturned(0); +- onMeasurementStateReturned(/* status= */ 0, OperationResult.ERROR_INTERNAL); - return; - } - @@ -521,31 +630,44 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Attrib - } - - if (future == null) { -- AttributionOsLevelManagerJni.get().onMeasurementStateReturned(0); +- onMeasurementStateReturned(/* status= */ 0, OperationResult.ERROR_INTERNAL); - return; - } - -- Futures.addCallback(future, new FutureCallback() { -- @Override -- public void onSuccess(Integer status) { -- AttributionOsLevelManagerJni.get().onMeasurementStateReturned(status); -- } -- @Override -- public void onFailure(Throwable thrown) { -- Log.w(TAG, "Failed to get measurement API status", thrown); -- AttributionOsLevelManagerJni.get().onMeasurementStateReturned(0); -- } -- }, ContextUtils.getApplicationContext().getMainExecutor()); +- Futures.addCallback( +- future, +- new FutureCallback() { +- @Override +- public void onSuccess(Integer status) { +- onMeasurementStateReturned(status, OperationResult.SUCCESS); +- } +- +- @Override +- public void onFailure(Throwable thrown) { +- Log.w(TAG, "Failed to get measurement API status", thrown); +- onMeasurementStateReturned( +- /* status= */ 0, convertToOperationResult(thrown)); +- } +- }, +- ContextUtils.getApplicationContext().getMainExecutor()); } @CalledByNative diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -560,17 +560,17 @@ bool ContentBrowserClient::IsAttributionReportingOperationAllowed( - } - - bool ContentBrowserClient::IsWebAttributionReportingAllowed() { +@@ -554,6 +554,7 @@ void ContentBrowserClient::OnAuctionComplete( + network::mojom::AttributionSupport ContentBrowserClient::GetAttributionSupport( + AttributionReportingOsApiState state, + content::WebContents* web_contents) { ++ if ((true)) return network::mojom::AttributionSupport::kNone; + switch (state) { + case AttributionReportingOsApiState::kDisabled: + return network::mojom::AttributionSupport::kWeb; +@@ -570,17 +571,17 @@ bool ContentBrowserClient::IsAttributionReportingOperationAllowed( + const url::Origin* destination_origin, + const url::Origin* reporting_origin, + bool* can_bypass) { - return true; + return false; } @@ -574,28 +696,6 @@ diff --git a/content/public/browser/navigation_controller.cc b/content/public/br is_pdf(input.is_pdf) { #if DCHECK_IS_ON() DCHECK(input.Valid()); -diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc ---- a/content/renderer/render_thread_impl.cc -+++ b/content/renderer/render_thread_impl.cc -@@ -885,6 +885,9 @@ void RenderThreadImpl::InitializeRenderer( - GetContentClient()->renderer()->DidSetUserAgent(user_agent); - user_agent_metadata_ = user_agent_metadata; - cors_exempt_header_list_ = cors_exempt_header_list; -+#if BUILDFLAG(IS_ANDROID) -+ attribution_support = network::mojom::AttributionSupport::kNone; -+#endif - attribution_support_ = attribution_support; - - blink::WebVector web_cors_exempt_header_list( -@@ -1789,7 +1792,7 @@ RenderThreadImpl::GetAttributionReportingSupport() { - - void RenderThreadImpl::SetAttributionReportingSupport( - network::mojom::AttributionSupport attribution_support) { -- attribution_support_ = attribution_support; -+ attribution_support_ = network::mojom::AttributionSupport::kNone; - } - - std::unique_ptr RenderThreadImpl::CreateMediaCodecFactory( diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-conversion-measurement-api.inc b/cromite_flags/content/public/common/content_features_cc/Disable-conversion-measurement-api.inc new file mode 100644 --- /dev/null @@ -652,6 +752,18 @@ diff --git a/services/network/public/cpp/attribution_utils.cc b/services/network switch (attribution_support) { case mojom::AttributionSupport::kWeb: case mojom::AttributionSupport::kWebAndOs: +diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc +--- a/third_party/blink/renderer/core/page/page.cc ++++ b/third_party/blink/renderer/core/page/page.cc +@@ -1303,7 +1303,7 @@ void Page::UpdateBrowsingContextGroup( + + void Page::SetAttributionSupport( + network::mojom::AttributionSupport attribution_support) { +- attribution_support_ = attribution_support; ++ attribution_support_ = network::mojom::AttributionSupport::kNone; + } + + template class CORE_TEMPLATE_EXPORT Supplement; diff --git a/ui/events/android/motion_event_android.cc b/ui/events/android/motion_event_android.cc --- a/ui/events/android/motion_event_android.cc +++ b/ui/events/android/motion_event_android.cc @@ -669,4 +781,3 @@ diff --git a/ui/events/android/motion_event_android.cc b/ui/events/android/motio } -- -2.25.1 diff --git a/build/bromite_patches/Disable-crash-reporting.patch b/build/cromite_patches/Disable-crash-reporting.patch similarity index 94% rename from build/bromite_patches/Disable-crash-reporting.patch rename to build/cromite_patches/Disable-crash-reporting.patch index 18df3661aa6981403ae5bfa892f38dbab34dea11..fa5ef5917393c478841de13970048bf0fbc852ce 100644 --- a/build/bromite_patches/Disable-crash-reporting.patch +++ b/build/cromite_patches/Disable-crash-reporting.patch @@ -11,7 +11,7 @@ Subject: Disable crash reporting diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -2651,6 +2651,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( +@@ -2622,6 +2622,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( base::NumberToString(pid)); } #endif @@ -26,4 +26,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kCrashReporting); -- -2.25.1 diff --git a/build/bromite_patches/Disable-feeds-support-by-default.patch b/build/cromite_patches/Disable-feeds-support-by-default.patch similarity index 53% rename from build/bromite_patches/Disable-feeds-support-by-default.patch rename to build/cromite_patches/Disable-feeds-support-by-default.patch index 71fad0314ed948dd6b8e9931557f0894c4ad086c..ba2ff97101ce54eb5b2c07d7347e35998ca75579 100644 --- a/build/bromite_patches/Disable-feeds-support-by-default.patch +++ b/build/cromite_patches/Disable-feeds-support-by-default.patch @@ -4,35 +4,17 @@ Subject: Disable feeds support by default License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../chromium/chrome/browser/feed/FeedFeatures.java | 8 +------- - chrome/browser/prefs/browser_prefs.cc | 4 ++-- - components/feed/core/common/pref_names.cc | 13 +------------ - components/feed/feed_feature_list.cc | 2 ++ - 4 files changed, 6 insertions(+), 21 deletions(-) + chrome/browser/prefs/browser_prefs.cc | 4 ++-- + components/feed/core/common/pref_names.cc | 13 +------------ + components/feed/core/shared_prefs/pref_names.cc | 2 +- + components/feed/feed_feature_list.cc | 2 ++ + 4 files changed, 6 insertions(+), 15 deletions(-) -diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java ---- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java -+++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java -@@ -46,13 +46,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.SIGNIN) -- && !Profile.getLastUsedRegularProfile().isChild(); -+ return false; - } - - public static boolean shouldUseWebFeedAwarenessIPH() { 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 -@@ -1765,10 +1765,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, - supervised_user::SupervisedUserService::RegisterProfilePrefs(registry); +@@ -1840,10 +1840,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + supervised_user::RegisterProfilePrefs(registry); #endif -#if BUILDFLAG(ENABLE_FEED_V2) @@ -67,15 +49,26 @@ diff --git a/components/feed/core/common/pref_names.cc b/components/feed/core/co prefs->ClearPref(prefs::kExperimentsDeprecated); } +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 +@@ -26,7 +26,7 @@ const char kEnableSnippetsByDse[] = "ntp_snippets_by_dse.enable"; + void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref(kEnableSnippets, false); + registry->RegisterBooleanPref(kArticlesListVisible, false); +- registry->RegisterBooleanPref(kEnableSnippetsByDse, true); ++ registry->RegisterBooleanPref(kEnableSnippetsByDse, false); + } + + } // namespace prefs 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 -@@ -163,4 +163,6 @@ BASE_FEATURE(kFeedSportsCard, - "FeedSportsCard", +@@ -169,4 +169,6 @@ BASE_FEATURE(kRefreshFeedOnRestart, + "RefreshFeedOnRestart", base::FEATURE_DISABLED_BY_DEFAULT); +SET_CROMITE_FEATURE_DISABLED(kInterestFeedV2); +SET_CROMITE_FEATURE_DISABLED(kWebFeed); } // namespace feed -- -2.25.1 diff --git a/build/bromite_patches/Disable-fetching-of-all-field-trials.patch b/build/cromite_patches/Disable-fetching-of-all-field-trials.patch similarity index 81% rename from build/bromite_patches/Disable-fetching-of-all-field-trials.patch rename to build/cromite_patches/Disable-fetching-of-all-field-trials.patch index c96e40a9380579f7a61082ab9b5d68c1e7a6d0cf..899b131bde26c797dec24bad3e664154fd5dbd75 100644 --- a/build/bromite_patches/Disable-fetching-of-all-field-trials.patch +++ b/build/cromite_patches/Disable-fetching-of-all-field-trials.patch @@ -9,29 +9,31 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- android_webview/common/aw_features.cc | 4 +-- android_webview/nonembedded/BUILD.gn | 2 -- + ...eddedFastVariationsSeedSafeModeAction.java | 2 -- + ...SafeModeVariationsSeedContentProvider.java | 5 --- .../services/VariationsSeedServer.java | 2 -- .../metrics/chrome_browser_sampling_trials.cc | 4 +++ .../net/system_network_context_manager.cc | 1 - components/ukm/ukm_recorder_impl.cc | 3 ++ .../firstrun/VariationsSeedBridge.java | 2 +- - .../firstrun/VariationsSeedFetcher.java | 32 +++---------------- + .../firstrun/VariationsSeedFetcher.java | 36 +++---------------- components/variations/net/BUILD.gn | 2 -- .../variations/net/omnibox_http_headers.cc | 4 +-- .../variations/net/variations_http_headers.cc | 3 ++ .../variations_field_trial_creator_base.cc | 8 ++--- - .../variations/service/variations_service.cc | 15 ++------- + .../variations/service/variations_service.cc | 15 ++------ .../browser/loader/url_loader_throttles.cc | 7 ---- .../origin_trials/origin_trials_utils.cc | 2 +- - .../variations_render_thread_observer.cc | 9 ------ + .../variations_render_thread_observer.cc | 9 ----- .../Disable-fetching-of-all-field-trials.inc | 1 + .../renderer/core/loader/document_loader.cc | 7 ---- - 18 files changed, 28 insertions(+), 80 deletions(-) + 20 files changed, 28 insertions(+), 91 deletions(-) create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-fetching-of-all-field-trials.inc diff --git a/android_webview/common/aw_features.cc b/android_webview/common/aw_features.cc --- a/android_webview/common/aw_features.cc +++ b/android_webview/common/aw_features.cc -@@ -106,8 +106,8 @@ BASE_FEATURE(kWebViewMetricsFiltering, +@@ -107,8 +107,8 @@ BASE_FEATURE(kWebViewMetricsFiltering, // Field trial feature for controlling support of Origin Trials on WebView. BASE_FEATURE(kWebViewOriginTrials, @@ -61,17 +63,49 @@ diff --git a/android_webview/nonembedded/BUILD.gn b/android_webview/nonembedded/ "java/src/org/chromium/android_webview/services/VariationsSeedServer.java", ] deps = [ +diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java +--- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java ++++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java +@@ -27,13 +27,11 @@ public class NonEmbeddedFastVariationsSeedSafeModeAction implements NonEmbeddedS + + @Override + public boolean onActivate() { +- AwVariationsSeedFetcher.scheduleIfNeeded(/* requireFastMode= */ true); + return true; + } + + @Override + public boolean onDeactivate() { +- AwVariationsSeedFetcher.cancelSafeModeSeedFetchSchedulerJob(); + return true; + } + } +diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java +--- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java ++++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java +@@ -88,11 +88,6 @@ public class SafeModeVariationsSeedContentProvider extends ContentProvider { + + private Boolean awaitSeedResults() { + CountDownLatch countDownLatch = new CountDownLatch(1); +- VariationsSeedHolder.getInstance() +- .hasSeedUpdateCompletedAsync( +- () -> { +- countDownLatch.countDown(); +- }); + try { + return countDownLatch.await(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java --- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java +++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java -@@ -30,8 +30,6 @@ public class VariationsSeedServer extends Service { - @Override - public void getSeed(ParcelFileDescriptor newSeedFile, long oldSeedDate, - IVariationsSeedServerCallback callback) { -- maybeReportMetrics(callback); -- VariationsSeedHolder.getInstance().writeSeedIfNewer(newSeedFile, oldSeedDate); - } - }; +@@ -33,8 +33,6 @@ public class VariationsSeedServer extends Service { + ParcelFileDescriptor newSeedFile, + long oldSeedDate, + IVariationsSeedServerCallback callback) { +- maybeReportMetrics(callback); +- VariationsSeedHolder.getInstance().writeSeedIfNewer(newSeedFile, oldSeedDate); + } + }; diff --git a/chrome/browser/metrics/chrome_browser_sampling_trials.cc b/chrome/browser/metrics/chrome_browser_sampling_trials.cc --- a/chrome/browser/metrics/chrome_browser_sampling_trials.cc @@ -97,7 +131,7 @@ diff --git a/chrome/browser/metrics/chrome_browser_sampling_trials.cc b/chrome/b 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 -@@ -818,7 +818,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams( +@@ -815,7 +815,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams( void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams( network::mojom::NetworkContextParams* network_context_params) { @@ -121,7 +155,7 @@ diff --git a/components/ukm/ukm_recorder_impl.cc b/components/ukm/ukm_recorder_i diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java --- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java +++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java -@@ -51,7 +51,7 @@ public class VariationsSeedBridge { +@@ -53,7 +53,7 @@ public class VariationsSeedBridge { } @CalledByNative @@ -133,7 +167,7 @@ diff --git a/components/variations/android/java/src/org/chromium/components/vari diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java --- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java +++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java -@@ -453,35 +453,13 @@ public class VariationsSeedFetcher { +@@ -468,39 +468,13 @@ public class VariationsSeedFetcher { */ public void fetchSeed(String restrictMode, String milestone, String channel) { assert !ThreadUtils.runningOnUiThread(); @@ -162,8 +196,12 @@ diff --git a/components/variations/android/java/src/org/chromium/components/vari - SeedFetchInfo fetchInfo = downloadContent(params, null); - if (fetchInfo.seedInfo != null) { - SeedInfo info = fetchInfo.seedInfo; -- VariationsSeedBridge.setVariationsFirstRunSeed(info.seedData, info.signature, -- info.country, info.date, info.isGzipCompressed); +- VariationsSeedBridge.setVariationsFirstRunSeed( +- info.seedData, +- info.signature, +- info.country, +- info.date, +- info.isGzipCompressed); - } + SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); // VARIATIONS_INITIALIZED_PREF should still be set to true when exceptions occur @@ -173,7 +211,7 @@ diff --git a/components/variations/android/java/src/org/chromium/components/vari } private void recordFetchResultOrCode(int resultOrCode) { -@@ -525,7 +503,7 @@ public class VariationsSeedFetcher { +@@ -552,7 +526,7 @@ public class VariationsSeedFetcher { * @param curSeedInfo optional currently saved seed info to set the `If-None-Match` header. * @return the object holds the request result and seed data with its related header fields. */ @@ -232,7 +270,7 @@ diff --git a/components/variations/service/variations_field_trial_creator_base.c // Determines whether the field trial testing config defined in // testing/variations/fieldtrial_testing_config.json should be applied. If the // "disable_fieldtrial_testing_config" GN flag is set to true, then the testing -@@ -302,11 +303,6 @@ bool VariationsFieldTrialCreatorBase::SetUpFieldTrials( +@@ -300,11 +301,6 @@ bool VariationsFieldTrialCreatorBase::SetUpFieldTrials( safe_seed_manager); } @@ -244,15 +282,15 @@ diff --git a/components/variations/service/variations_field_trial_creator_base.c base::FeatureList::SetInstance(std::move(feature_list)); // For testing Variations Safe Mode, maybe crash here. -@@ -585,6 +581,7 @@ bool VariationsFieldTrialCreatorBase::CreateTrialsFromSeed( +@@ -581,6 +577,7 @@ bool VariationsFieldTrialCreatorBase::CreateTrialsFromSeed( const EntropyProviders& entropy_providers, base::FeatureList* feature_list, - SafeSeedManagerInterface* safe_seed_manager) { + SafeSeedManagerBase* safe_seed_manager) { + if ((true)) return false; // This histogram name uses "VariationsFieldTrialCreator" rather than // "VariationsFieldTrialCreatorBase" for consistency with historical data TRACE_EVENT0("startup", "VariationsFieldTrialCreator::CreateTrialsFromSeed"); -@@ -678,6 +675,7 @@ bool VariationsFieldTrialCreatorBase::CreateTrialsFromSeed( +@@ -674,6 +671,7 @@ bool VariationsFieldTrialCreatorBase::CreateTrialsFromSeed( void VariationsFieldTrialCreatorBase::LoadSeedFromJsonFile( const base::FilePath& json_seed_path) { @@ -263,7 +301,7 @@ diff --git a/components/variations/service/variations_field_trial_creator_base.c 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 -@@ -220,17 +220,8 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers, +@@ -221,17 +221,8 @@ 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() { @@ -283,7 +321,7 @@ diff --git a/components/variations/service/variations_service.cc b/components/va } // Returns the already downloaded first run seed, and clear the seed from the -@@ -599,7 +590,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) { +@@ -601,7 +592,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. @@ -295,7 +333,7 @@ diff --git a/components/variations/service/variations_service.cc b/components/va diff --git a/content/browser/loader/url_loader_throttles.cc b/content/browser/loader/url_loader_throttles.cc --- a/content/browser/loader/url_loader_throttles.cc +++ b/content/browser/loader/url_loader_throttles.cc -@@ -49,8 +49,6 @@ CreateContentBrowserURLLoaderThrottles( +@@ -50,8 +50,6 @@ CreateContentBrowserURLLoaderThrottles( // TODO(crbug.com/1094303): Consider whether we want to use the WebContents to // determine the value for variations::Owner. Alternatively, this is the // browser side, and we might be fine with Owner::kUnknown. @@ -304,7 +342,7 @@ diff --git a/content/browser/loader/url_loader_throttles.cc b/content/browser/lo ClientHintsControllerDelegate* client_hint_delegate = browser_context->GetClientHintsControllerDelegate(); -@@ -128,11 +126,6 @@ CreateContentBrowserURLLoaderThrottlesForKeepAlive( +@@ -130,11 +128,6 @@ CreateContentBrowserURLLoaderThrottlesForKeepAlive( GetContentClient()->browser()->CreateURLLoaderThrottlesForKeepAlive( request, browser_context, wc_getter, frame_tree_node_id); variations::OmniboxURLLoaderThrottle::AppendThrottleIfNeeded(&throttles); @@ -314,8 +352,8 @@ diff --git a/content/browser/loader/url_loader_throttles.cc b/content/browser/lo - variations::VariationsURLLoaderThrottle::AppendThrottleIfNeeded( - browser_context->GetVariationsClient(), &throttles); - return throttles; - } + auto throttle = MaybeCreateIdentityUrlLoaderThrottle(base::BindRepeating( + webid::SetIdpSigninStatus, browser_context, frame_tree_node_id)); diff --git a/content/browser/origin_trials/origin_trials_utils.cc b/content/browser/origin_trials/origin_trials_utils.cc --- a/content/browser/origin_trials/origin_trials_utils.cc +++ b/content/browser/origin_trials/origin_trials_utils.cc @@ -356,9 +394,9 @@ new file mode 100644 diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc -@@ -187,13 +187,6 @@ Vector CopyInitiatorOriginTrials( - WebVector CopyInitiatorOriginTrials( - const Vector& initiator_origin_trial_features) { +@@ -194,13 +194,6 @@ WebVector CopyInitiatorOriginTrials( + const Vector& + initiator_origin_trial_features) { WebVector result; - for (auto feature : initiator_origin_trial_features) { - // Convert from OriginTrialFeature to int. These values are passed between @@ -371,4 +409,3 @@ diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_p } -- -2.25.1 diff --git a/build/cromite_patches/Disable-idle-detection.patch b/build/cromite_patches/Disable-idle-detection.patch new file mode 100644 index 0000000000000000000000000000000000000000..acad45f7b6e1b3fe7cd8355d6bd21ade7ce2d0ee --- /dev/null +++ b/build/cromite_patches/Disable-idle-detection.patch @@ -0,0 +1,70 @@ +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Sat, 19 Feb 2022 12:01:33 +0100 +Subject: Disable idle detection + +License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html +--- + .../common/content_features_cc/Disable-idle-detection.inc | 4 ++++ + .../common/content_features_h/Disable-idle-detection.inc | 1 + + .../permissions_policy/permissions_policy_features.json5 | 1 + + third_party/blink/renderer/modules/idle/idle_detector.idl | 3 ++- + .../blink/renderer/platform/runtime_enabled_features.json5 | 5 +++++ + 5 files changed, 13 insertions(+), 1 deletion(-) + create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc + create mode 100644 cromite_flags/content/public/common/content_features_h/Disable-idle-detection.inc + +diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc b/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/content/public/common/content_features_cc/Disable-idle-detection.inc +@@ -0,0 +1,4 @@ ++// This is intended as a kill switch for the Idle Detection feature. To enable ++// this feature, the experimental web platform features flag should be set, ++// or the site should obtain an Origin Trial token. ++CROMITE_FEATURE(kIdleDetection, "IdleDetection", base::FEATURE_DISABLED_BY_DEFAULT); +diff --git a/cromite_flags/content/public/common/content_features_h/Disable-idle-detection.inc b/cromite_flags/content/public/common/content_features_h/Disable-idle-detection.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/content/public/common/content_features_h/Disable-idle-detection.inc +@@ -0,0 +1 @@ ++CONTENT_EXPORT BASE_DECLARE_FEATURE(kIdleDetection); +diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 +--- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 ++++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 +@@ -275,6 +275,7 @@ + { + name: "IdleDetection", + permissions_policy_name: "idle-detection", ++ depends_on: ["IdleDetection"], + }, + { + name: "JoinAdInterestGroup", +diff --git a/third_party/blink/renderer/modules/idle/idle_detector.idl b/third_party/blink/renderer/modules/idle/idle_detector.idl +--- a/third_party/blink/renderer/modules/idle/idle_detector.idl ++++ b/third_party/blink/renderer/modules/idle/idle_detector.idl +@@ -17,7 +17,8 @@ enum ScreenIdleState { + [ + SecureContext, + Exposed=(Window,DedicatedWorker), +- ActiveScriptWrappable ++ ActiveScriptWrappable, ++ RuntimeEnabled=IdleDetection + ] interface IdleDetector : EventTarget { + [CallWith=ScriptState] constructor(); + readonly attribute UserIdleState? userState; +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 +@@ -2068,6 +2068,11 @@ + name: "HTMLUnsafeMethods", + status: "experimental", + }, ++ { ++ name: "IdleDetection", // disabled ++ public: true, // by ++ base_feature: "none", // default ++ }, + { + name: "ImplicitRootScroller", + public: true, +-- diff --git a/build/bromite_patches/Disable-lock-icon-in-address-bar-by-default.patch b/build/cromite_patches/Disable-lock-icon-in-address-bar-by-default.patch similarity index 93% rename from build/bromite_patches/Disable-lock-icon-in-address-bar-by-default.patch rename to build/cromite_patches/Disable-lock-icon-in-address-bar-by-default.patch index fa4c500189a7884509821f6b3a3b30c8f740f6a7..844bdf60b3f0522f99cf5e7ac5308c753cffe837 100644 --- a/build/bromite_patches/Disable-lock-icon-in-address-bar-by-default.patch +++ b/build/cromite_patches/Disable-lock-icon-in-address-bar-by-default.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc -@@ -466,8 +466,8 @@ BASE_FEATURE(kOmniboxModernizeVisualUpdate, +@@ -448,8 +448,8 @@ BASE_FEATURE(kOmniboxModernizeVisualUpdate, // used, on non-Android platforms this is controlled through the // ChromeRefresh2023 flag. BASE_FEATURE(kUpdatedConnectionSecurityIndicators, @@ -22,4 +22,3 @@ diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/ // Feature used to default typed navigations to use HTTPS instead of HTTP. // This only applies to navigations that don't have a scheme such as -- -2.25.1 diff --git a/build/bromite_patches/Disable-media-router-and-remoting-by-default.patch b/build/cromite_patches/Disable-media-router-and-remoting-by-default.patch similarity index 52% rename from build/bromite_patches/Disable-media-router-and-remoting-by-default.patch rename to build/cromite_patches/Disable-media-router-and-remoting-by-default.patch index 04c3b024d2b51972aaefb0e9d2bc51ec110a4368..ca42dd5ea62d7e80f4172bd4fb1095cd7efcfa41 100644 --- a/build/bromite_patches/Disable-media-router-and-remoting-by-default.patch +++ b/build/cromite_patches/Disable-media-router-and-remoting-by-default.patch @@ -5,15 +5,17 @@ Subject: Disable media router and remoting by default Original License: MIT - https://spdx.org/licenses/MIT.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/browser/media/router/media_router_feature.cc | 6 +++++- - chrome/browser/profiles/profile_impl.cc | 2 +- - .../renderer/modules/remoteplayback/remote_playback.cc | 2 +- - 3 files changed, 7 insertions(+), 3 deletions(-) + chrome/browser/media/router/media_router_feature.cc | 6 +++++- + chrome/browser/profiles/profile_impl.cc | 2 +- + content/child/runtime_features.cc | 2 ++ + .../renderer/modules/remoteplayback/remote_playback.cc | 2 +- + .../renderer/platform/runtime_enabled_features.json5 | 10 +++------- + 5 files changed, 12 insertions(+), 10 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 -@@ -106,6 +106,7 @@ void ClearMediaRouterStoredPrefsForTesting() { +@@ -105,6 +105,7 @@ void ClearMediaRouterStoredPrefsForTesting() { } bool MediaRouterEnabled(content::BrowserContext* context) { @@ -21,7 +23,7 @@ diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browse #if !BUILDFLAG(IS_ANDROID) if (!base::FeatureList::IsEnabled(kMediaRouter)) return false; -@@ -147,7 +148,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { +@@ -146,7 +147,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterStringPref(prefs::kMediaRouterReceiverIdHashToken, "", PrefRegistry::PUBLIC); registry->RegisterBooleanPref( @@ -30,7 +32,7 @@ diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browse registry->RegisterBooleanPref( media_router::prefs::kMediaRouterShowCastSessionsStartedByOtherDevices, true); -@@ -218,4 +219,7 @@ absl::optional GetCastMirroringPlayoutDelay() { +@@ -217,4 +218,7 @@ absl::optional GetCastMirroringPlayoutDelay() { #endif // !BUILDFLAG(IS_ANDROID) @@ -41,7 +43,7 @@ diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browse 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 -@@ -413,7 +413,7 @@ void ProfileImpl::RegisterProfilePrefs( +@@ -418,7 +418,7 @@ void ProfileImpl::RegisterProfilePrefs( #endif registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false); @@ -50,10 +52,22 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p #if !BUILDFLAG(IS_ANDROID) registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false); #endif // !BUILDFLAG(IS_ANDROID) +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 +@@ -558,6 +558,8 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs( + WebRuntimeFeatures::EnableBackForwardCache( + content::IsBackForwardCacheEnabled()); + ++ WebRuntimeFeatures::EnableRemotePlayback(false); ++ + if (base::FeatureList::IsEnabled(network::features::kPrivateStateTokens)) { + WebRuntimeFeatures::EnablePrivateStateTokens(true); + WebRuntimeFeatures::EnablePrivateStateTokensAlwaysAllowIssuance(true); diff --git a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc --- a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc +++ b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc -@@ -101,7 +101,7 @@ KURL GetAvailabilityUrl(const WebURL& source, +@@ -99,7 +99,7 @@ KURL GetAvailabilityUrl(const WebURL& source, } bool IsBackgroundAvailabilityMonitoringDisabled() { @@ -62,5 +76,25 @@ diff --git a/third_party/blink/renderer/modules/remoteplayback/remote_playback.c } void RemotingStarting(HTMLMediaElement& media_element) { +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 +@@ -3109,14 +3109,10 @@ + base_feature: "none", + }, + { +- name: "RemotePlaybackBackend", ++ name: "RemotePlaybackBackend", // disabled + settable_from_internals: true, +- status: { +- "Android": "stable", +- "Win": "stable", +- "Mac": "stable", +- "Linux": "stable", +- "default": "experimental"}, ++ // Tracking bug for the implementation: https://crbug.com/728609 ++ status: "experimental", // by default + }, + { + name: "RemoveDanglingMarkupInTarget", -- -2.25.1 diff --git a/build/bromite_patches/Disable-minidump-upload-scheduling.patch b/build/cromite_patches/Disable-minidump-upload-scheduling.patch similarity index 89% rename from build/bromite_patches/Disable-minidump-upload-scheduling.patch rename to build/cromite_patches/Disable-minidump-upload-scheduling.patch index cf4cc452f0e7d12ea376dcf84eb4cc81cf460304..474f477d85f3c10ac1bc5db3eaa9aaffae9b9a83 100644 --- a/build/bromite_patches/Disable-minidump-upload-scheduling.patch +++ b/build/cromite_patches/Disable-minidump-upload-scheduling.patch @@ -23,7 +23,7 @@ diff --git a/components/endpoint_fetcher/endpoint_fetcher.cc b/components/endpoi diff --git a/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java b/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java --- a/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java +++ b/components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/MinidumpUploadJobService.java -@@ -50,7 +50,10 @@ public abstract class MinidumpUploadJobService +@@ -52,7 +52,10 @@ public abstract class MinidumpUploadJobService extends JobService * to build an upload job for scheduling. */ public static void scheduleUpload(JobInfo.Builder jobInfoBuilder) { @@ -33,7 +33,6 @@ diff --git a/components/minidump_uploader/android/java/src/org/chromium/componen + return; + } JobScheduler scheduler = - (JobScheduler) ContextUtils.getApplicationContext().getSystemService( - Context.JOB_SCHEDULER_SERVICE); + (JobScheduler) + ContextUtils.getApplicationContext() -- -2.25.1 diff --git a/build/bromite_patches/Disable-offline-pages-in-CCT.patch b/build/cromite_patches/Disable-offline-pages-in-CCT.patch similarity index 99% rename from build/bromite_patches/Disable-offline-pages-in-CCT.patch rename to build/cromite_patches/Disable-offline-pages-in-CCT.patch index 9d361f5e869ae6121e54cd3a2a1476c4550da35a..cc53099c403d74621c8d964c9f77b149f538fa36 100644 --- a/build/bromite_patches/Disable-offline-pages-in-CCT.patch +++ b/build/cromite_patches/Disable-offline-pages-in-CCT.patch @@ -15,4 +15,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kOfflinePagesInDownloadHomeOpenInCctFeature); -- -2.25.1 diff --git a/build/bromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch b/build/cromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch similarity index 99% rename from build/bromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch rename to build/cromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch index cb573f7e1030f6f257cb75785c386fe0e15cef6a..e6f26b6064db9a3943a442c6ac28053fc17e1e14 100644 --- a/build/bromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch +++ b/build/cromite_patches/Disable-omission-of-URL-elements-in-Omnibox.patch @@ -54,4 +54,3 @@ new file mode 100755 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kAndroidVisibleUrlTruncation); -- -2.25.1 diff --git a/build/bromite_patches/Disable-plugins-enumeration.patch b/build/cromite_patches/Disable-plugins-enumeration.patch similarity index 91% rename from build/bromite_patches/Disable-plugins-enumeration.patch rename to build/cromite_patches/Disable-plugins-enumeration.patch index 2c6183afc6cf87de5026b76b22b1ab910d0647cd..c2bdfe42c14ac288438d752ad88c4d014ff87a17 100644 --- a/build/bromite_patches/Disable-plugins-enumeration.patch +++ b/build/cromite_patches/Disable-plugins-enumeration.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -2053,9 +2053,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -2113,9 +2113,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { } PluginData* LocalFrame::GetPluginData() const { @@ -21,4 +21,3 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/ void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) { -- -2.25.1 diff --git a/build/bromite_patches/Disable-references-to-fonts.googleapis.com.patch b/build/cromite_patches/Disable-references-to-fonts.googleapis.com.patch similarity index 97% rename from build/bromite_patches/Disable-references-to-fonts.googleapis.com.patch rename to build/cromite_patches/Disable-references-to-fonts.googleapis.com.patch index 7f38671e5f5bf4a968cb249188bfd311eee2a034..6012bb56d0755da87992ec20f12d5ef88a047ebb 100644 --- a/build/bromite_patches/Disable-references-to-fonts.googleapis.com.patch +++ b/build/cromite_patches/Disable-references-to-fonts.googleapis.com.patch @@ -13,7 +13,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -301,7 +301,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest( +@@ -291,7 +291,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest( std::string DomDistillerViewerSource::GetContentSecurityPolicy( network::mojom::CSPDirectiveName directive) { if (directive == network::mojom::CSPDirectiveName::StyleSrc) { @@ -60,4 +60,3 @@ diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/th body, table, -- -2.25.1 diff --git a/build/bromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch b/build/cromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch similarity index 89% rename from build/bromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch rename to build/cromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch index c9fa9f783d80880faa8102c20fdf0ec98d14db40..2ed5b3692f9d136019ecc990672d71c672fabdbc 100644 --- a/build/bromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch +++ b/build/cromite_patches/Disable-requests-for-single-word-Omnibar-searches.patch @@ -12,7 +12,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -76,6 +76,7 @@ bool OnlyChangeIsFromHTTPToHTTPS(const GURL& origin, const GURL& destination) { +@@ -74,6 +74,7 @@ bool OnlyChangeIsFromHTTPToHTTPS(const GURL& origin, const GURL& destination) { return origin_with_https == destination; } @@ -20,7 +20,7 @@ diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/c // Choose the appropriate URLLoaderFactory: either an explicitly specified or a // default for the given profile. network::mojom::URLLoaderFactory* GetURLLoaderFactory( -@@ -87,6 +88,7 @@ network::mojom::URLLoaderFactory* GetURLLoaderFactory( +@@ -85,6 +86,7 @@ network::mojom::URLLoaderFactory* GetURLLoaderFactory( ->GetURLLoaderFactoryForBrowserProcess() .get(); } @@ -28,7 +28,7 @@ diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/c // Helper to keep ChromeOmniboxNavigationObserver alive while the initiated // navigation is pending. -@@ -252,13 +254,6 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver( +@@ -250,13 +252,6 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver( profile_(profile), show_infobar_(std::move(show_infobar)) { NavigationUserData::CreateForNavigationHandle(navigation, this); @@ -43,4 +43,3 @@ diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/c ChromeOmniboxNavigationObserver::~ChromeOmniboxNavigationObserver() { -- -2.25.1 diff --git a/build/bromite_patches/Disable-safety-check.patch b/build/cromite_patches/Disable-safety-check.patch similarity index 79% rename from build/bromite_patches/Disable-safety-check.patch rename to build/cromite_patches/Disable-safety-check.patch index 01b67613da1b0d901680604cdf574a1e57f5a0b8..91a4266e1d8a56f3bbd2fc707a7c66e0e904e409 100644 --- a/build/bromite_patches/Disable-safety-check.patch +++ b/build/cromite_patches/Disable-safety-check.patch @@ -4,14 +4,14 @@ Subject: Disable safety check License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/android/BUILD.gn | 5 ----- - chrome/android/chrome_java_sources.gni | 1 - - chrome/android/java/res/xml/main_preferences.xml | 5 ----- - .../chrome/browser/settings/SettingsActivity.java | 9 --------- - .../chrome/browser/settings/SettingsLauncherImpl.java | 5 +---- - chrome/browser/BUILD.gn | 1 - - .../browser/omnibox/suggestions/action/OmniboxPedal.java | 3 --- - 7 files changed, 1 insertion(+), 28 deletions(-) + chrome/android/BUILD.gn | 5 ----- + chrome/android/chrome_java_sources.gni | 1 - + chrome/android/java/res/xml/main_preferences.xml | 5 ----- + .../chrome/browser/settings/SettingsActivity.java | 12 ------------ + .../browser/settings/SettingsLauncherImpl.java | 5 +---- + chrome/browser/BUILD.gn | 1 - + .../omnibox/suggestions/action/OmniboxPedal.java | 3 --- + 7 files changed, 1 insertion(+), 31 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -24,7 +24,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn "//chrome/browser/screenshot_monitor:java", "//chrome/browser/search_engines/android:java", "//chrome/browser/search_resumption:java", -@@ -1033,8 +1032,6 @@ if (current_toolchain == default_toolchain) { +@@ -1037,8 +1036,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/recent_tabs:java", "//chrome/browser/recent_tabs:junit", "//chrome/browser/recent_tabs/internal:junit", @@ -33,7 +33,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn "//chrome/browser/screenshot_monitor:java", "//chrome/browser/search_engines/android:java", "//chrome/browser/search_engines/android:junit", -@@ -1638,8 +1635,6 @@ if (current_toolchain == default_toolchain) { +@@ -1659,8 +1656,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/quick_delete:javatests", "//chrome/browser/safe_browsing/android:java", "//chrome/browser/safe_browsing/android:javatests", @@ -45,7 +45,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn 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 -@@ -1000,7 +1000,6 @@ chrome_java_sources = [ +@@ -1001,7 +1001,6 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingPasswordReuseDialogBridge.java", "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingReferringAppBridge.java", "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingSettingsLauncher.java", @@ -56,7 +56,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml -@@ -61,11 +61,6 @@ +@@ -67,11 +67,6 @@ found in the LICENSE file. android:key="privacy" android:order="11" android:title="@string/prefs_privacy_security"/> @@ -66,12 +66,12 @@ diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/j - android:order="12" - android:title="@string/prefs_safety_check"/> (); } else if (file_type == DownloadFileType::SEVEN_ZIP) { -- -2.25.1 diff --git a/build/bromite_patches/Disable-text-fragments-by-default.patch b/build/cromite_patches/Disable-text-fragments-by-default.patch similarity index 97% rename from build/bromite_patches/Disable-text-fragments-by-default.patch rename to build/cromite_patches/Disable-text-fragments-by-default.patch index 13a3ed7eedf27fc48e85e8c8abbac3960777d530..5eff35acc2c4a5603364a99ef1b8008f1f52da61 100644 --- a/build/bromite_patches/Disable-text-fragments-by-default.patch +++ b/build/cromite_patches/Disable-text-fragments-by-default.patch @@ -34,7 +34,7 @@ diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/pre 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 -@@ -293,6 +293,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() { +@@ -292,6 +292,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() { #endif {wf::EnableTouchDragAndContextMenu, raw_ref(features::kTouchDragAndContextMenu)}, @@ -74,7 +74,7 @@ new file mode 100644 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 -@@ -4465,9 +4465,14 @@ void Document::SetURL(const KURL& url) { +@@ -4432,9 +4432,14 @@ void Document::SetURL(const KURL& url) { TRACE_EVENT1("navigation", "Document::SetURL", "url", new_url.GetString().Utf8()); @@ -92,7 +92,7 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink 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 -@@ -3736,10 +3736,9 @@ +@@ -3703,10 +3703,9 @@ }, { name: "TextFragmentIdentifiers", @@ -106,4 +106,3 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 { name: "TextFragmentTapOpensContextMenu", -- -2.25.1 diff --git a/build/bromite_patches/Disable-the-DIAL-repeating-discovery.patch b/build/cromite_patches/Disable-the-DIAL-repeating-discovery.patch similarity index 99% rename from build/bromite_patches/Disable-the-DIAL-repeating-discovery.patch rename to build/cromite_patches/Disable-the-DIAL-repeating-discovery.patch index fedfaebf3444d6e28c4cf5f8be30294ac3c6ddc6..b23bfcd024ddf220f1edc0ea0ee537cc65a20405 100644 --- a/build/bromite_patches/Disable-the-DIAL-repeating-discovery.patch +++ b/build/cromite_patches/Disable-the-DIAL-repeating-discovery.patch @@ -33,4 +33,3 @@ diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrom } -- -2.25.1 diff --git a/build/bromite_patches/Disable-third-party-origin-trials.patch b/build/cromite_patches/Disable-third-party-origin-trials.patch similarity index 85% rename from build/bromite_patches/Disable-third-party-origin-trials.patch rename to build/cromite_patches/Disable-third-party-origin-trials.patch index ee5693b6edf21ad5cc73a8f8167ebb0933977fd1..686cd22100195de87396c72979a4f23824a8282a 100644 --- a/build/bromite_patches/Disable-third-party-origin-trials.patch +++ b/build/cromite_patches/Disable-third-party-origin-trials.patch @@ -4,6 +4,7 @@ Subject: Disable third-party origin trials License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- + android_webview/common/aw_content_client.cc | 1 - .../origin_trials/origin_trial_policy_impl.cc | 7 ++++--- .../origin_trials/origin_trial_policy_impl.h | 2 +- .../browser/renderer_host/navigation_request.cc | 1 - @@ -13,8 +14,19 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../renderer/core/loader/document_loader.cc | 17 ----------------- .../blink/renderer/core/loader/http_equiv.cc | 2 +- .../core/origin_trials/origin_trial_context.cc | 6 ++++-- - 9 files changed, 16 insertions(+), 47 deletions(-) + 10 files changed, 16 insertions(+), 48 deletions(-) +diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc +--- a/android_webview/common/aw_content_client.cc ++++ b/android_webview/common/aw_content_client.cc +@@ -127,7 +127,6 @@ blink::OriginTrialPolicy* AwContentClient::GetOriginTrialPolicy() { + // flag to true after construction. This will work because trial token + // validator will always get the current instance of policy when needed. + if (IsDisableOriginTrialsSafeModeActionOn()) { +- origin_trial_policy_->SetAllowOnlyDeprecationTrials(true); + } + return origin_trial_policy_.get(); + } diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc b/components/embedder_support/origin_trials/origin_trial_policy_impl.cc --- a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc +++ b/components/embedder_support/origin_trials/origin_trial_policy_impl.cc @@ -63,7 +75,7 @@ diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl. diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -8350,7 +8350,6 @@ void NavigationRequest::SetSourceSiteInstanceToInitiatorIfNeeded() { +@@ -8520,7 +8520,6 @@ void NavigationRequest::SetSourceSiteInstanceToInitiatorIfNeeded() { void NavigationRequest::ForceEnableOriginTrials( const std::vector& trials) { DCHECK(!HasCommitted()); @@ -74,7 +86,7 @@ diff --git a/content/browser/renderer_host/navigation_request.cc b/content/brows diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -477,10 +477,6 @@ void FillNavigationParamsRequest( +@@ -483,10 +483,6 @@ void FillNavigationParamsRequest( common_params.initiator_origin.value(); } @@ -85,7 +97,7 @@ diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_fra navigation_params->was_discarded = commit_params.was_discarded; navigation_params->document_ukm_source_id = commit_params.document_ukm_source_id; -@@ -508,12 +504,6 @@ void FillNavigationParamsRequest( +@@ -514,12 +510,6 @@ void FillNavigationParamsRequest( navigation_params->had_transient_user_activation = common_params.has_user_gesture; @@ -98,7 +110,7 @@ diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_fra if (!commit_params.early_hints_preloaded_resources.empty()) { navigation_params->early_hints_preloaded_resources = WebVector(); for (const auto& resource : commit_params.early_hints_preloaded_resources) { -@@ -575,11 +565,6 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams( +@@ -581,11 +571,6 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams( info->url_request.GetURLRequestExtraData().get()); DCHECK(url_request_extra_data); @@ -110,7 +122,7 @@ diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_fra blink::NavigationDownloadPolicy download_policy; download_policy.ApplyDownloadFramePolicy( info->is_opener_navigation, info->url_request.HasUserGesture(), -@@ -602,7 +587,7 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams( +@@ -608,7 +593,7 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams( info->url_request.HasUserGesture(), info->url_request.HasTextFragmentToken(), info->should_check_main_world_content_security_policy, @@ -162,21 +174,21 @@ diff --git a/third_party/blink/common/origin_trials/trial_token_validator.cc b/t diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc -@@ -174,13 +174,6 @@ namespace { - Vector CopyInitiatorOriginTrials( +@@ -180,13 +180,6 @@ namespace { + Vector CopyInitiatorOriginTrials( const WebVector& initiator_origin_trial_features) { - Vector result; + Vector result; - for (auto feature : initiator_origin_trial_features) { - // Convert from int to OriginTrialFeature. These values are passed between - // blink navigations. OriginTrialFeature isn't visible outside of blink (and - // doesn't need to be) so the values are transferred outside of blink as - // ints and casted to OriginTrialFeature once being processed in blink. -- result.push_back(static_cast(feature)); +- result.push_back(static_cast(feature)); - } return result; } -@@ -193,18 +186,12 @@ WebVector CopyInitiatorOriginTrials( +@@ -200,18 +193,12 @@ WebVector CopyInitiatorOriginTrials( Vector CopyForceEnabledOriginTrials( const WebVector& force_enabled_origin_trials) { Vector result; @@ -195,8 +207,8 @@ diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_p return result; } -@@ -2859,10 +2846,6 @@ void DocumentLoader::CreateParserPostCommit() { - OriginTrialFeature::kTouchEventFeatureDetection); +@@ -2942,10 +2929,6 @@ void DocumentLoader::CreateParserPostCommit() { + mojom::blink::OriginTrialFeature::kTouchEventFeatureDetection); } - // Enable any origin trials that have been force enabled for this commit. @@ -221,7 +233,7 @@ diff --git a/third_party/blink/renderer/core/loader/http_equiv.cc b/third_party/ diff --git a/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc b/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc --- a/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc +++ b/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc -@@ -316,6 +316,9 @@ void OriginTrialContext::AddToken(const String& token) { +@@ -317,6 +317,9 @@ void OriginTrialContext::AddToken(const String& token) { void OriginTrialContext::AddTokenFromExternalScript( const String& token, const Vector>& external_origins) { @@ -231,22 +243,21 @@ diff --git a/third_party/blink/renderer/core/origin_trials/origin_trial_context. Vector script_origins; for (const scoped_refptr& origin : external_origins) { OriginInfo origin_info = {.origin = origin, -@@ -451,8 +454,6 @@ bool OriginTrialContext::InstallSettingFeature( +@@ -452,8 +455,6 @@ bool OriginTrialContext::InstallSettingFeature( } - void OriginTrialContext::AddFeature(OriginTrialFeature feature) { + void OriginTrialContext::AddFeature(mojom::blink::OriginTrialFeature feature) { - enabled_features_.insert(feature); - InitializePendingFeatures(); } - bool OriginTrialContext::IsFeatureEnabled(OriginTrialFeature feature) const { -@@ -494,6 +495,7 @@ void OriginTrialContext::AddForceEnabledTrials( + bool OriginTrialContext::IsFeatureEnabled( +@@ -497,6 +498,7 @@ void OriginTrialContext::AddForceEnabledTrials( } bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) { + if ((true)) return false; - if (trial_name == "Portals") - return base::FeatureList::IsEnabled(features::kPortals); + if (trial_name == "PrivacySandboxAdsAPIs") + return base::FeatureList::IsEnabled(features::kPrivacySandboxAdsAPIs); -- -2.25.1 diff --git a/build/bromite_patches/Disable-update-scheduler.patch b/build/cromite_patches/Disable-update-scheduler.patch similarity index 94% rename from build/bromite_patches/Disable-update-scheduler.patch rename to build/cromite_patches/Disable-update-scheduler.patch index 7481d4c21a604379031b0013bc03f5ef88705dcc..08d35e406c42516a3204c8015a81fb450377c2ef 100644 --- a/build/bromite_patches/Disable-update-scheduler.patch +++ b/build/cromite_patches/Disable-update-scheduler.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -65,7 +65,7 @@ public class ChromeBackgroundTaskFactory implements BackgroundTaskFactory { +@@ -67,7 +67,7 @@ public class ChromeBackgroundTaskFactory implements BackgroundTaskFactory { case TaskIds.WEBAPK_UPDATE_JOB_ID: return new WebApkUpdateTask(); case TaskIds.COMPONENT_UPDATE_JOB_ID: @@ -20,4 +20,3 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/background_task return new BackgroundSyncBackgroundTask(); case TaskIds.NOTIFICATION_SCHEDULER_JOB_ID: -- -2.25.1 diff --git a/build/bromite_patches/Disable-various-metrics.patch b/build/cromite_patches/Disable-various-metrics.patch similarity index 94% rename from build/bromite_patches/Disable-various-metrics.patch rename to build/cromite_patches/Disable-various-metrics.patch index 73725cf343ef1ea57405f401619ba0bd0ceb8e9a..f19b83982fddfaac2e6ed5e0be5e80963788d1d4 100644 --- a/build/bromite_patches/Disable-various-metrics.patch +++ b/build/cromite_patches/Disable-various-metrics.patch @@ -24,7 +24,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java -@@ -57,7 +57,7 @@ public abstract class FirstRunActivityBase +@@ -63,7 +63,7 @@ public abstract class FirstRunActivityBase extends AsyncInitializationActivity static final String SHOW_SEARCH_ENGINE_PAGE = "ShowSearchEnginePage"; static final String SHOW_SYNC_CONSENT_PAGE = "ShowSyncConsent"; @@ -91,7 +91,7 @@ diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/br 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 -@@ -1043,7 +1043,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) { +@@ -1051,7 +1051,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) { #endif // BUILDFLAG(IS_CHROMEOS_ASH) registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled, @@ -103,15 +103,15 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -80,7 +80,6 @@ +@@ -84,7 +84,6 @@ #include "chrome/browser/hid/chrome_hid_delegate.h" #include "chrome/browser/interstitials/enterprise_util.h" #include "chrome/browser/lifetime/browser_shutdown.h" -#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" #include "chrome/browser/media/audio_service_util.h" + #include "chrome/browser/media/prefs/capture_device_ranking.h" #include "chrome/browser/media/router/media_router_feature.h" - #include "chrome/browser/media/webrtc/audio_debug_recordings_handler.h" -@@ -5029,16 +5028,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( +@@ -5030,16 +5029,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( content::NavigationHandle* handle) { std::vector> throttles; @@ -128,7 +128,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch #if BUILDFLAG(ENABLE_SUPERVISED_USERS) MaybeAddThrottle( SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(handle), -@@ -5139,10 +5128,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( +@@ -5140,10 +5129,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( throttle_manager->MaybeAppendNavigationThrottles(handle, &throttles); } @@ -142,7 +142,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc --- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc +++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc -@@ -92,6 +92,10 @@ BASE_FEATURE(kPostFREFixMetricsReportingFeature, +@@ -90,6 +90,10 @@ BASE_FEATURE(kPostFREFixMetricsReportingFeature, // Name of the variations param that defines the sampling rate. const char kRateParamName[] = "sampling_rate_per_mille"; @@ -222,11 +222,10 @@ diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/m diff --git a/services/metrics/public/cpp/ukm_recorder.cc b/services/metrics/public/cpp/ukm_recorder.cc --- a/services/metrics/public/cpp/ukm_recorder.cc +++ b/services/metrics/public/cpp/ukm_recorder.cc -@@ -116,4 +116,5 @@ ukm::SourceId UkmRecorder::GetSourceIdFromScopeImpl(const GURL& scope_url, - return source_id; +@@ -130,4 +130,5 @@ void UkmRecorder::RemoveObserver(Observer* observer) { + observers_.RemoveObserver(observer); } +SET_CROMITE_FEATURE_DISABLED(kUkmFeature); } // namespace ukm -- -2.25.1 diff --git a/build/bromite_patches/Do-not-build-API-keys-infobar.patch b/build/cromite_patches/Do-not-build-API-keys-infobar.patch similarity index 92% rename from build/bromite_patches/Do-not-build-API-keys-infobar.patch rename to build/cromite_patches/Do-not-build-API-keys-infobar.patch index f69c7befb66f6206c62c38e0591a04a737b54eb8..bd5b9ee492e10d96c924bf1e960dbb10dad77707 100644 --- a/build/bromite_patches/Do-not-build-API-keys-infobar.patch +++ b/build/cromite_patches/Do-not-build-API-keys-infobar.patch @@ -11,7 +11,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -1388,8 +1388,6 @@ static_library("ui") { +@@ -1421,8 +1421,6 @@ static_library("ui") { "singleton_tabs.h", "startup/automation_infobar_delegate.cc", "startup/automation_infobar_delegate.h", @@ -23,7 +23,7 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn diff --git a/chrome/browser/ui/startup/infobar_utils.cc b/chrome/browser/ui/startup/infobar_utils.cc --- a/chrome/browser/ui/startup/infobar_utils.cc +++ b/chrome/browser/ui/startup/infobar_utils.cc -@@ -139,9 +139,6 @@ void AddInfoBarsIfNecessary(Browser* browser, +@@ -146,9 +146,6 @@ void AddInfoBarsIfNecessary(Browser* browser, infobars::ContentInfoBarManager* infobar_manager = infobars::ContentInfoBarManager::FromWebContents(web_contents); @@ -34,4 +34,3 @@ diff --git a/chrome/browser/ui/startup/infobar_utils.cc b/chrome/browser/ui/star PrefService* local_state = g_browser_process->local_state(); if (!local_state || -- -2.25.1 diff --git a/build/bromite_patches/Do-not-compile-QR-code-sharing.patch b/build/cromite_patches/Do-not-compile-QR-code-sharing.patch similarity index 87% rename from build/bromite_patches/Do-not-compile-QR-code-sharing.patch rename to build/cromite_patches/Do-not-compile-QR-code-sharing.patch index 76b4611c15a9a64fe46ad5cf1cb41d46015dcdab..be297b389985aba8ddb5e8dcbaaa32b250542631 100644 --- a/build/bromite_patches/Do-not-compile-QR-code-sharing.patch +++ b/build/cromite_patches/Do-not-compile-QR-code-sharing.patch @@ -5,16 +5,16 @@ Subject: Do not compile QR code sharing License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/BUILD.gn | 1 - - .../chrome/browser/ui/RootUiCoordinator.java | 5 ----- + .../chrome/browser/ui/RootUiCoordinator.java | 5 ---- chrome/browser/share/BUILD.gn | 2 -- - ...omeProvidedSharingOptionsProviderBase.java | 19 ------------------- - chrome/browser/share/android/java_sources.gni | 11 ----------- - 5 files changed, 38 deletions(-) + ...omeProvidedSharingOptionsProviderBase.java | 23 ------------------- + chrome/browser/share/android/java_sources.gni | 11 --------- + 5 files changed, 42 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -3416,7 +3416,6 @@ generate_jni("chrome_jni_headers") { +@@ -3471,7 +3471,6 @@ generate_jni("chrome_jni_headers") { "../browser/share/android/java/src/org/chromium/chrome/browser/share/link_to_text/LinkToTextBridge.java", "../browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabService.java", "../browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabServiceFactory.java", @@ -25,7 +25,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn 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 -@@ -114,7 +114,6 @@ import org.chromium.chrome.browser.share.ShareButtonController; +@@ -112,7 +112,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; @@ -33,7 +33,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordi import org.chromium.chrome.browser.share.scroll_capture.ScrollCaptureManager; import org.chromium.chrome.browser.tab.AccessibilityVisibilityHandler; import org.chromium.chrome.browser.tab.AutofillSessionLifetimeController; -@@ -552,10 +551,6 @@ public class RootUiCoordinator +@@ -574,10 +573,6 @@ public class RootUiCoordinator } public void onAttachFragment(Fragment fragment) { @@ -67,7 +67,7 @@ diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/s import org.chromium.chrome.browser.share.send_tab_to_self.SendTabToSelfAndroidBridge; import org.chromium.chrome.browser.share.send_tab_to_self.SendTabToSelfCoordinator; import org.chromium.chrome.browser.share.share_sheet.ChromeOptionShareCallback; -@@ -288,9 +287,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -303,9 +302,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { } private void maybeAddQrCodeFirstPartyOption() { @@ -77,22 +77,26 @@ diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/s } private void maybeAddScreenshotFirstPartyOption() { -@@ -442,21 +438,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -486,25 +482,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { .build(); } - private FirstPartyOption createQrCodeFirstPartyOption() { - return new FirstPartyOptionBuilder( -- ContentType.LINK_PAGE_VISIBLE, ContentType.LINK_PAGE_NOT_VISIBLE, ContentType.IMAGE) +- ContentType.LINK_PAGE_VISIBLE, +- ContentType.LINK_PAGE_NOT_VISIBLE, +- ContentType.IMAGE) - .setDetailedContentTypesToDisableFor( - DetailedContentType.WEB_NOTES, DetailedContentType.SCREENSHOT) - .setIcon(R.drawable.qr_code, R.string.qr_code_share_icon_label) - .setFeatureNameForMetrics(USER_ACTION_QR_CODE_SELECTED) -- .setOnClickCallback((view) -> { -- QrCodeCoordinator qrCodeCoordinator = -- new QrCodeCoordinator(mActivity, mUrl, mShareParams.getWindow()); -- qrCodeCoordinator.show(); -- }) +- .setOnClickCallback( +- (view) -> { +- QrCodeCoordinator qrCodeCoordinator = +- new QrCodeCoordinator( +- mActivity, mUrl, mShareParams.getWindow()); +- qrCodeCoordinator.show(); +- }) - .build(); - } - @@ -121,4 +125,3 @@ diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/shar "//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.25.1 diff --git a/build/bromite_patches/Do-not-ignore-download-location-prompt-setting.patch b/build/cromite_patches/Do-not-ignore-download-location-prompt-setting.patch similarity index 90% rename from build/bromite_patches/Do-not-ignore-download-location-prompt-setting.patch rename to build/cromite_patches/Do-not-ignore-download-location-prompt-setting.patch index 6134dcb58088e972250f06c694c0f30d56aa968c..022159984d036ed023eac33ca4b2d3cf74db2dd8 100644 --- a/build/bromite_patches/Do-not-ignore-download-location-prompt-setting.patch +++ b/build/cromite_patches/Do-not-ignore-download-location-prompt-setting.patch @@ -10,20 +10,21 @@ Do not tick "Don't show again" by default License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../DownloadLocationDialogCoordinator.java | 15 --------------- - 1 file changed, 15 deletions(-) + .../DownloadLocationDialogCoordinator.java | 16 ---------------- + 1 file changed, 16 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 -@@ -131,21 +131,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. +@@ -138,22 +138,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. * @param dirs An list of available download directories. */ private void onDirectoryOptionsRetrieved(ArrayList 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 or if Incognito download warning is needed. -- if (dirs.size() == 1 && !mLocationDialogManaged +- if (dirs.size() == 1 +- && !mLocationDialogManaged - && mDialogType == DownloadLocationDialogType.DEFAULT - && !shouldShowIncognitoWarning()) { - final DirectoryOption dir = dirs.get(0); @@ -39,4 +40,3 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse if (mDialogModel != null) return; -- -2.25.1 diff --git a/build/bromite_patches/Do-not-link-with-libatomic.patch b/build/cromite_patches/Do-not-link-with-libatomic.patch similarity index 94% rename from build/bromite_patches/Do-not-link-with-libatomic.patch rename to build/cromite_patches/Do-not-link-with-libatomic.patch index 9caa2f3a30c596e8b93a4348121ebad8beae19b7..dc4825382ac613110a57aeacb98a5c96147c114f 100644 --- a/build/bromite_patches/Do-not-link-with-libatomic.patch +++ b/build/cromite_patches/Do-not-link-with-libatomic.patch @@ -14,7 +14,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/base/BUILD.gn b/base/BUILD.gn --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1103,7 +1103,7 @@ component("base") { +@@ -1100,7 +1100,7 @@ component("base") { # more robust check for this. if (!use_sysroot && (is_android || is_chromeos || (is_linux && !is_castos)) && host_toolchain != "//build/toolchain/cros:host") { @@ -24,4 +24,3 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn if (use_allocator_shim) { -- -2.25.1 diff --git a/build/bromite_patches/Do-not-store-passwords-by-default.patch b/build/cromite_patches/Do-not-store-passwords-by-default.patch similarity index 99% rename from build/bromite_patches/Do-not-store-passwords-by-default.patch rename to build/cromite_patches/Do-not-store-passwords-by-default.patch index c79c4d4fced802eafa64ddc0b39554717ca885d1..bdc846948615c0207a9043b32040209264861034 100644 --- a/build/bromite_patches/Do-not-store-passwords-by-default.patch +++ b/build/cromite_patches/Do-not-store-passwords-by-default.patch @@ -40,4 +40,3 @@ diff --git a/components/password_manager/core/browser/password_manager.cc b/comp registry->RegisterIntegerPref( prefs::kCurrentMigrationVersionToGoogleMobileServices, 0); -- -2.25.1 diff --git a/build/bromite_patches/DoH-improvements.patch b/build/cromite_patches/DoH-improvements.patch similarity index 98% rename from build/bromite_patches/DoH-improvements.patch rename to build/cromite_patches/DoH-improvements.patch index 7281c4a766655dc0e7ad61dba4fc0bf7e88f1af7..ac37ead3c8fde8d2b7085f11a920c6d3d1072d11 100644 --- a/build/bromite_patches/DoH-improvements.patch +++ b/build/cromite_patches/DoH-improvements.patch @@ -82,7 +82,7 @@ diff --git a/net/dns/dns_client.cc b/net/dns/dns_client.cc 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 -@@ -3149,6 +3149,7 @@ void HostResolverManager::SetDnsConfigOverrides(DnsConfigOverrides overrides) { +@@ -3139,6 +3139,7 @@ void HostResolverManager::SetDnsConfigOverrides(DnsConfigOverrides overrides) { bool changed = dns_client_->SetConfigOverrides(std::move(overrides)); if (changed) { @@ -91,4 +91,3 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc // Only invalidate cache if new overrides have resulted in a config change. -- -2.25.1 diff --git a/build/bromite_patches/Enable-Certificate-Transparency.patch b/build/cromite_patches/Enable-Certificate-Transparency.patch similarity index 84% rename from build/bromite_patches/Enable-Certificate-Transparency.patch rename to build/cromite_patches/Enable-Certificate-Transparency.patch index a7368225526c8d1b750063b3c2640867b717cecc..e2682096d31470780bac66f57904509a5c42043f 100644 --- a/build/bromite_patches/Enable-Certificate-Transparency.patch +++ b/build/cromite_patches/Enable-Certificate-Transparency.patch @@ -9,7 +9,7 @@ by default. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/browser/browser_features.h | 1 + - chrome/browser/net/system_network_context_manager.cc | 6 +----- + chrome/browser/net/system_network_context_manager.cc | 2 +- chrome/browser/ssl/sct_reporting_service.cc | 5 +++++ .../about_flags_cc/Enable-Certificate-Transparency.inc | 9 +++++++++ .../Enable-Certificate-Transparency.inc | 6 ++++++ @@ -18,7 +18,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html net/url_request/report_sender.cc | 3 ++- services/network/network_context.cc | 2 +- services/network/sct_auditing/sct_auditing_handler.cc | 2 ++ - 10 files changed, 32 insertions(+), 9 deletions(-) + 10 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Enable-Certificate-Transparency.inc create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Enable-Certificate-Transparency.inc create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Enable-Certificate-Transparency.inc @@ -26,7 +26,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/browser_features.h b/chrome/browser/browser_features.h --- a/chrome/browser/browser_features.h +++ b/chrome/browser/browser_features.h -@@ -58,6 +58,7 @@ BASE_DECLARE_FEATURE(kTabCaptureBlueBorderCrOS); +@@ -62,6 +62,7 @@ BASE_DECLARE_FEATURE(kTabCaptureBlueBorderCrOS); BASE_DECLARE_FEATURE(kWebUsbDeviceDetection); @@ -37,22 +37,11 @@ diff --git a/chrome/browser/browser_features.h b/chrome/browser/browser_features 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 -@@ -957,7 +957,6 @@ void SystemNetworkContextManager::SetEnableCertificateTransparencyForTesting( - bool SystemNetworkContextManager::IsCertificateTransparencyEnabled() { - if (certificate_transparency_enabled_for_testing_.has_value()) - return certificate_transparency_enabled_for_testing_.value(); --#if defined(OFFICIAL_BUILD) - // TODO(carlosil): Figure out if we can/should remove the OFFICIAL_BUILD - // check now that enforcement does not rely on build dates. - // Certificate Transparency is enabled: -@@ -965,10 +964,7 @@ bool SystemNetworkContextManager::IsCertificateTransparencyEnabled() { - // - on an opt-in basis for other builds and embedders, controlled with the - // kCertificateTransparencyAskBeforeEnabling flag +@@ -982,7 +982,7 @@ bool SystemNetworkContextManager::IsCertificateTransparencyEnabled() { + // - on an opt-in basis for other builds and embedders, controlled with the + // kCertificateTransparencyAskBeforeEnabling flag return base::FeatureList::IsEnabled( - features::kCertificateTransparencyAskBeforeEnabling); --#else -- return false; --#endif // defined(OFFICIAL_BUILD) + features::kCertificateTransparency); } @@ -60,8 +49,8 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/brows diff --git a/chrome/browser/ssl/sct_reporting_service.cc b/chrome/browser/ssl/sct_reporting_service.cc --- a/chrome/browser/ssl/sct_reporting_service.cc +++ b/chrome/browser/ssl/sct_reporting_service.cc -@@ -211,6 +211,11 @@ void SetSCTAuditingEnabledForStoragePartition( - } // namespace +@@ -203,6 +203,11 @@ SCTReportingService::SCTReportingService( + SCTReportingService::~SCTReportingService() = default; network::mojom::SCTAuditingMode SCTReportingService::GetReportingMode() { + if ((true)) { @@ -107,7 +96,7 @@ new file mode 100644 diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc -@@ -329,6 +329,7 @@ class HSTSPreloadDecoder : public net::extras::PreloadDecoder { +@@ -327,6 +327,7 @@ class HSTSPreloadDecoder : public net::extras::PreloadDecoder { bool DecodeHSTSPreload(const std::string& search_hostname, PreloadResult* out) { #if !BUILDFLAG(INCLUDE_TRANSPORT_SECURITY_STATE_PRELOAD_LIST) @@ -115,7 +104,7 @@ diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_ if (g_hsts_source == nullptr) return false; #endif -@@ -374,8 +375,8 @@ bool DecodeHSTSPreload(const std::string& search_hostname, PreloadResult* out) { +@@ -372,8 +373,8 @@ bool DecodeHSTSPreload(const std::string& search_hostname, PreloadResult* out) { // static BASE_FEATURE(kCertificateTransparencyEnforcement, @@ -142,7 +131,7 @@ diff --git a/net/url_request/report_sender.cc b/net/url_request/report_sender.cc diff --git a/services/network/network_context.cc b/services/network/network_context.cc --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -2796,7 +2796,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2797,7 +2797,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( // TransportSecurityState. Since no requests have been made yet, safe to do // this even after the call to Build(). @@ -171,4 +160,3 @@ diff --git a/services/network/sct_auditing/sct_auditing_handler.cc b/services/ne auto reporter = std::make_unique( owner_network_context_, reporter_key, std::move(report), -- -2.25.1 diff --git a/build/bromite_patches/Enable-ECH-by-default.patch b/build/cromite_patches/Enable-ECH-by-default.patch similarity index 99% rename from build/bromite_patches/Enable-ECH-by-default.patch rename to build/cromite_patches/Enable-ECH-by-default.patch index be75b2683ab61e507f77eabfa5a9a32ee4d48d8a..20739b767487fa7b1c28bd19d6d0ef84e56748c5 100644 --- a/build/bromite_patches/Enable-ECH-by-default.patch +++ b/build/cromite_patches/Enable-ECH-by-default.patch @@ -16,4 +16,3 @@ new file mode 100644 +SET_CROMITE_FEATURE_ENABLED(kEncryptedClientHello); +SET_CROMITE_FEATURE_ENABLED(kEncryptedClientHelloQuic); -- -2.25.1 diff --git a/build/bromite_patches/Enable-HEVC-by-default.patch b/build/cromite_patches/Enable-HEVC-by-default.patch similarity index 94% rename from build/bromite_patches/Enable-HEVC-by-default.patch rename to build/cromite_patches/Enable-HEVC-by-default.patch index cdbc7e54985bc8d4e5c5c01507699d402fd02228..04c83a07b3bc199f83aec61319d696ee023b7d5d 100644 --- a/build/bromite_patches/Enable-HEVC-by-default.patch +++ b/build/cromite_patches/Enable-HEVC-by-default.patch @@ -12,7 +12,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -340,8 +340,8 @@ BASE_FEATURE(kEnableTabMuting, +@@ -348,8 +348,8 @@ BASE_FEATURE(kEnableTabMuting, #if BUILDFLAG(ENABLE_PLATFORM_HEVC) // Enables HEVC hardware accelerated decoding. BASE_FEATURE(kPlatformHEVCDecoderSupport, @@ -24,4 +24,3 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_ANDROID) // Enables HEVC hardware accelerated encoding for Windows, Mac, and Android. -- -2.25.1 diff --git a/build/bromite_patches/00Enable-ImprovedBookmarks-by-default.patch b/build/cromite_patches/Enable-ImprovedBookmarks-by-default.patch similarity index 67% rename from build/bromite_patches/00Enable-ImprovedBookmarks-by-default.patch rename to build/cromite_patches/Enable-ImprovedBookmarks-by-default.patch index c9fadacf503064f52bfdbbad5bead11f5a147011..bc8900a7e30dd0b3811114ff270958b5f6f72013 100644 --- a/build/bromite_patches/00Enable-ImprovedBookmarks-by-default.patch +++ b/build/cromite_patches/Enable-ImprovedBookmarks-by-default.patch @@ -5,12 +5,13 @@ Subject: Enable ImprovedBookmarks by default License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- chrome/android/java/res/layout/bookmark_search_box_row.xml | 4 ++-- - .../chromium/chrome/browser/bookmarks/BookmarkFeatures.java | 2 +- .../browser/bookmarks/BookmarkSearchBoxRowViewBinder.java | 2 ++ .../chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java | 2 +- .../org/chromium/chrome/browser/bookmarks/BookmarkUtils.java | 3 ++- + .../org/chromium/chrome/browser/flags/ChromeFeatureList.java | 2 +- + components/bookmarks/browser/bookmark_client.cc | 3 +-- .../Enable-ImprovedBookmarks-by-default.inc | 1 + - 6 files changed, 9 insertions(+), 5 deletions(-) + 7 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Enable-ImprovedBookmarks-by-default.inc diff --git a/chrome/android/java/res/layout/bookmark_search_box_row.xml b/chrome/android/java/res/layout/bookmark_search_box_row.xml @@ -27,18 +28,6 @@ diff --git a/chrome/android/java/res/layout/bookmark_search_box_row.xml b/chrome android:orientation="horizontal"> RegisterFilePathPref(prefs::kDiskCacheDir, base::FilePath()); registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0); registry->RegisterStringPref(prefs::kIsolateOrigins, std::string()); @@ -29,7 +29,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch registry->RegisterBooleanPref(prefs::kTabFreezingEnabled, true); registry->RegisterIntegerPref(prefs::kSCTAuditingHashdanceReportCount, 0); registry->RegisterBooleanPref( -@@ -1612,7 +1612,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs( +@@ -1574,7 +1574,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs( // user policy in addition to the same named ones in Local State (which are // used for mapping the command-line flags). registry->RegisterStringPref(prefs::kIsolateOrigins, std::string()); @@ -78,4 +78,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_ENABLED(kStrictOriginIsolation); -- -2.25.1 diff --git a/build/bromite_patches/Enable-darken-websites-checkbox-in-themes.patch b/build/cromite_patches/Enable-darken-websites-checkbox-in-themes.patch similarity index 93% rename from build/bromite_patches/Enable-darken-websites-checkbox-in-themes.patch rename to build/cromite_patches/Enable-darken-websites-checkbox-in-themes.patch index eb9a44c84b2ffc18a730b64afe2ed4a0c90b2c9d..943f37ecfc0308622ef8c0d3bf58dc4170737cbc 100644 --- a/build/bromite_patches/Enable-darken-websites-checkbox-in-themes.patch +++ b/build/cromite_patches/Enable-darken-websites-checkbox-in-themes.patch @@ -14,19 +14,19 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -1588,9 +1588,9 @@ +@@ -1554,9 +1554,9 @@ "expiry_milestone": 125 }, { - "name": "darken-websites-checkbox-in-themes-setting", -- "owners": [ "nemco@google.com", "wenyufu@google.com", "twellington" ], +- "owners": [ "nemco@google.com", "wenyufu@google.com", "twellington@chromium.org" ], - "expiry_milestone": 125 + "name": "darken-websites-checkbox-in-themes-setting", // this is always enabled in Bromite -+ "owners": [ "nemco@google.com", "wenyufu@google.com", "twellington" ], // - ++ "owners": [ "nemco@google.com", "wenyufu@google.com", "twellington@chromium.org" ], // - + "expiry_milestone": -1 }, { - "name": "data-retention-policies-disable-sync-types-needed", + "name": "dcheck-is-fatal", diff --git a/cromite_flags/components/content_settings/core/common/features_cc/Enable-darken-websites-checkbox-in-themes.inc b/cromite_flags/components/content_settings/core/common/features_cc/Enable-darken-websites-checkbox-in-themes.inc new file mode 100644 --- /dev/null @@ -38,4 +38,3 @@ new file mode 100644 + +#endif // BUILDFLAG(IS_ANDROID) -- -2.25.1 diff --git a/build/bromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch b/build/cromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch similarity index 98% rename from build/bromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch rename to build/cromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch index 6d69e45f1cee0c97887a31338c3faacd7058cca3..faf0df8bd6bef4e8c50ffc5388e558fc1b2d2c69 100644 --- a/build/bromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch +++ b/build/cromite_patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch @@ -45,7 +45,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -389,6 +389,10 @@ config("compiler") { +@@ -395,6 +395,10 @@ config("compiler") { } } @@ -57,4 +57,3 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn if (fatal_linker_warnings && !is_apple && current_os != "aix" && current_os != "zos") { -- -2.25.1 diff --git a/build/bromite_patches/Enable-native-Android-autofill.patch b/build/cromite_patches/Enable-native-Android-autofill.patch similarity index 64% rename from build/bromite_patches/Enable-native-Android-autofill.patch rename to build/cromite_patches/Enable-native-Android-autofill.patch index ac5d5ae373877845a465aa29b863e7fe6da73415..19ea31edd3a51ab5ecf95372eaafbbb9c04ee961 100644 --- a/build/bromite_patches/Enable-native-Android-autofill.patch +++ b/build/cromite_patches/Enable-native-Android-autofill.patch @@ -15,42 +15,36 @@ See also: https://github.com/bromite/bromite/issues/547 Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - android_webview/browser/aw_contents.cc | 3 +- chrome/android/BUILD.gn | 1 + .../settings/PasswordSettings.java | 81 ++++++++++++++++++- - .../chromium/chrome/browser/tab/TabImpl.java | 51 ++++++++++++ + .../chromium/chrome/browser/tab/TabImpl.java | 55 +++++++++++++ .../browser/tab/TabViewAndroidDelegate.java | 14 ++++ chrome/browser/BUILD.gn | 7 ++ chrome/browser/android/tab_android.cc | 15 ++++ chrome/browser/android/tab_android.h | 2 + .../strings/android_chrome_strings.grd | 6 ++ .../ui/autofill/chrome_autofill_client.cc | 8 +- + components/android_autofill/browser/BUILD.gn | 1 + .../browser/android_autofill_manager.cc | 2 +- .../browser/android_autofill_manager.h | 4 +- - .../browser/content_autofill_driver.cc | 53 ++++++++++++ + .../autofill/AutofillManagerWrapper.java | 5 +- + .../components/autofill/AutofillProvider.java | 7 ++ + .../BrowserSelectionActionMenuDelegate.java | 62 ++++++++++++++ + .../browser/content_autofill_driver.cc | 57 +++++++++++++ .../content/browser/content_autofill_driver.h | 9 ++- .../content_autofill_driver_factory.cc | 11 ++- .../browser/content_autofill_driver_factory.h | 1 + + .../content/renderer/autofill_agent.cc | 6 ++ .../renderer/password_autofill_agent.cc | 5 +- + .../autofill/core/browser/autofill_driver.h | 2 + .../autofill/core/common/autofill_prefs.cc | 6 ++ .../autofill/core/common/autofill_prefs.h | 2 + .../embedder_support/view/ContentView.java | 46 +++++++++++ + .../selection/FloatingPastePopupMenu.java | 3 +- .../chromium/ui/base/ViewAndroidDelegate.java | 8 ++ - 21 files changed, 326 insertions(+), 9 deletions(-) + 27 files changed, 416 insertions(+), 10 deletions(-) + create mode 100644 components/android_autofill/browser/java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java -diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc ---- a/android_webview/browser/aw_contents.cc -+++ b/android_webview/browser/aw_contents.cc -@@ -216,7 +216,8 @@ AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID( - AwSafeBrowsingUIManager::UIManagerClient* - AwSafeBrowsingUIManager::UIManagerClient::FromWebContents( - WebContents* web_contents) { -- return AwContents::FromWebContents(web_contents); -+ return AwContents::FromWebContents(web_contents, -+ /*enable_secondary_autofill_manager*/ false); - } - - // static diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -65,7 +59,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn 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 -@@ -59,13 +59,18 @@ import java.lang.annotation.Retention; +@@ -59,6 +59,11 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Locale; @@ -77,15 +71,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage /** * The "Passwords" screen in Settings, which allows the user to enable or disable password saving, * to view saved passwords (just the username and URL), and to delete saved passwords. - */ +@@ -66,7 +71,7 @@ import java.util.Locale; public class PasswordSettings extends ChromeBaseSettingsFragment - implements PasswordListObserver, Preference.OnPreferenceClickListener, -- SyncService.SyncStateChangedListener { -+ SyncService.SyncStateChangedListener, INeedSnackbarManager { - @IntDef({TrustedVaultBannerState.NOT_SHOWN, TrustedVaultBannerState.OFFER_OPT_IN, - TrustedVaultBannerState.OPTED_IN}) - @Retention(RetentionPolicy.SOURCE) -@@ -92,6 +97,12 @@ public class PasswordSettings extends ChromeBaseSettingsFragment + implements PasswordListObserver, + Preference.OnPreferenceClickListener, +- SyncService.SyncStateChangedListener { ++ SyncService.SyncStateChangedListener, INeedSnackbarManager { + @IntDef({ + TrustedVaultBannerState.NOT_SHOWN, + TrustedVaultBannerState.OFFER_OPT_IN, +@@ -96,6 +101,12 @@ public class PasswordSettings extends ChromeBaseSettingsFragment public static final String PREF_TRUSTED_VAULT_BANNER = "trusted_vault_banner"; public static final String PREF_KEY_MANAGE_ACCOUNT_LINK = "manage_account_link"; @@ -98,7 +93,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage private static final String PREF_KEY_CATEGORY_SAVED_PASSWORDS = "saved_passwords"; private static final String PREF_KEY_CATEGORY_EXCEPTIONS = "exceptions"; private static final String PREF_KEY_SAVED_PASSWORDS_NO_TEXT = "saved_passwords_no_text"; -@@ -124,6 +135,8 @@ public class PasswordSettings extends ChromeBaseSettingsFragment +@@ -128,6 +139,8 @@ public class PasswordSettings extends ChromeBaseSettingsFragment private Preference mLinkPref; private Menu mMenu; @@ -107,7 +102,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage private @ManagePasswordsReferrer int mManagePasswordsReferrer; private BottomSheetController mBottomSheetController; -@@ -298,6 +311,7 @@ public class PasswordSettings extends ChromeBaseSettingsFragment +@@ -302,6 +315,7 @@ public class PasswordSettings extends ChromeBaseSettingsFragment } createSavePasswordsSwitch(); @@ -115,7 +110,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage if (shouldShowAutoSigninOption()) { createAutoSignInCheckbox(); } -@@ -561,6 +575,71 @@ public class PasswordSettings extends ChromeBaseSettingsFragment +@@ -575,6 +589,71 @@ public class PasswordSettings extends ChromeBaseSettingsFragment getPrefService().getBoolean(Pref.CREDENTIALS_ENABLE_SERVICE)); } @@ -190,7 +185,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java -@@ -75,6 +75,17 @@ import org.chromium.url.GURL; +@@ -74,6 +74,18 @@ import org.chromium.url.GURL; import java.nio.ByteBuffer; @@ -200,24 +195,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav +import android.view.ViewStructure; +import android.view.autofill.AutofillValue; +import org.chromium.components.autofill.AutofillProvider; -+import org.chromium.components.autofill.AutofillSelectionMenuItemProvider; ++import org.chromium.components.autofill.AutofillSelectionMenuItemHelper; ++import org.chromium.components.autofill.BrowserSelectionActionMenuDelegate; +import org.chromium.content_public.browser.SelectionPopupController; +import org.chromium.chrome.browser.preferences.Pref; +import org.chromium.components.user_prefs.UserPrefs; + /** - * Implementation of the interface {@link Tab}. Contains and manages a {@link ContentView}. - * This class is not intended to be extended. -@@ -236,6 +247,8 @@ public class TabImpl implements Tab { + * Implementation of the interface {@link Tab}. Contains and manages a {@link ContentView}. This + * class is not intended to be extended. +@@ -224,6 +236,8 @@ class TabImpl implements Tab { */ private @Nullable @TabLaunchType Integer mTabLaunchTypeAtCreation; + AutofillProvider mAutofillProvider; + /** - * Creates an instance of a {@link TabImpl}. - * -@@ -817,6 +830,11 @@ public class TabImpl implements Tab { + * Creates an instance of a {@link TabImpl}. Package-private. Use {@link TabBuilder} to create + * an instance. +@@ -844,6 +858,11 @@ class TabImpl implements Tab { for (TabObserver observer : mObservers) observer.onDestroyed(this); mObservers.clear(); @@ -229,7 +225,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav mUserDataHost.destroy(); mTabViewManager.destroy(); hideNativePage(false, null); -@@ -1395,6 +1413,16 @@ public class TabImpl implements Tab { +@@ -1424,6 +1443,16 @@ class TabImpl implements Tab { return mWebContentsState == null ? -1 : mWebContentsState.version(); } @@ -246,8 +242,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav /** * Initializes the {@link WebContents}. Completes the browser content components initialization * around a native WebContents pointer. -@@ -1444,6 +1472,28 @@ public class TabImpl implements Tab { - mDelegateFactory.createContextMenuPopulatorFactory(this), this)); +@@ -1491,6 +1520,30 @@ class TabImpl implements Tab { + this)); mWebContents.notifyRendererPreferenceUpdate(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { @@ -267,37 +263,40 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav + TabImplJni.get().initializeAutofillIfNecessary(mNativeTabAndroid); + mAutofillProvider.setWebContents(webContents); + cv.setWebContents(webContents); -+ selectionController.setNonSelectionAdditionalMenuItemProvider( -+ new AutofillSelectionMenuItemProvider( -+ getContext(), mAutofillProvider)); ++ BrowserSelectionActionMenuDelegate selectionActionMenuDelegate = ++ new BrowserSelectionActionMenuDelegate(); ++ selectionActionMenuDelegate.setAutofillSelectionMenuItemHelper( ++ new AutofillSelectionMenuItemHelper(getContext(), mAutofillProvider)); ++ selectionController.setSelectionActionMenuDelegate(selectionActionMenuDelegate); + } + } TabHelpers.initWebContentsHelpers(this); notifyContentChanged(); } finally { -@@ -1873,6 +1923,7 @@ public class TabImpl implements Tab { - void setActiveNavigationEntryTitleForUrl(long nativeTabAndroid, String url, String title); - void loadOriginalImage(long nativeTabAndroid); +@@ -1954,6 +2007,8 @@ class TabImpl implements Tab { + boolean handleNonNavigationAboutURL(GURL url); + + void initializeAutofillIfNecessary(long nativeTabAndroid); ++ void onShow(long nativeTabAndroid); } } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java -@@ -21,6 +21,10 @@ import org.chromium.ui.dragdrop.DragAndDropBrowserDelegate; - import org.chromium.ui.dragdrop.DragAndDropDelegate; +@@ -20,6 +20,10 @@ import org.chromium.ui.base.WindowAndroid; + import org.chromium.ui.dragdrop.DragAndDropBrowserDelegate; import org.chromium.ui.dragdrop.DragStateTracker; +import android.util.SparseArray; +import android.view.autofill.AutofillValue; +import android.view.ViewStructure; + - /** - * Implementation of the abstract class {@link ViewAndroidDelegate} for Chrome. - */ -@@ -86,6 +90,16 @@ public class TabViewAndroidDelegate extends ViewAndroidDelegate { + /** Implementation of the abstract class {@link ViewAndroidDelegate} for Chrome. */ + public class TabViewAndroidDelegate extends ViewAndroidDelegate { + private final TabImpl mTab; +@@ -83,6 +87,16 @@ public class TabViewAndroidDelegate extends ViewAndroidDelegate { mTab.onBackgroundColorChanged(color); } @@ -317,7 +316,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndr diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -2677,6 +2677,13 @@ static_library("browser") { +@@ -2664,6 +2664,13 @@ static_library("browser") { deps += [ "//chrome/browser/error_reporting" ] } @@ -334,7 +333,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc --- a/chrome/browser/android/tab_android.cc +++ b/chrome/browser/android/tab_android.cc -@@ -52,6 +52,13 @@ +@@ -53,6 +53,13 @@ #include "url/android/gurl_android.h" #include "url/gurl.h" @@ -375,7 +374,7 @@ diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_a 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 -@@ -642,6 +642,12 @@ CHAR_LIMIT guidelines: +@@ -634,6 +634,12 @@ CHAR_LIMIT guidelines: Save passwords @@ -391,7 +390,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc --- a/chrome/browser/ui/autofill/chrome_autofill_client.cc +++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc -@@ -1320,7 +1320,13 @@ ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) +@@ -1359,7 +1359,13 @@ ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) web_contents, base::BindRepeating(&BrowserDriverInitHook, this, @@ -406,10 +405,21 @@ diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/brows content::WebContentsObserver(web_contents), log_manager_( // TODO(crbug.com/928595): Replace the closure with a callback to the +diff --git a/components/android_autofill/browser/BUILD.gn b/components/android_autofill/browser/BUILD.gn +--- a/components/android_autofill/browser/BUILD.gn ++++ b/components/android_autofill/browser/BUILD.gn +@@ -40,6 +40,7 @@ android_library("java") { + "java/src/org/chromium/components/autofill/AutofillProviderUMA.java", + "java/src/org/chromium/components/autofill/AutofillRequest.java", + "java/src/org/chromium/components/autofill/AutofillSelectionMenuItemHelper.java", ++ "java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java", + "java/src/org/chromium/components/autofill/FormData.java", + "java/src/org/chromium/components/autofill/FormFieldData.java", + "java/src/org/chromium/components/autofill/PrefillRequest.java", diff --git a/components/android_autofill/browser/android_autofill_manager.cc b/components/android_autofill/browser/android_autofill_manager.cc --- a/components/android_autofill/browser/android_autofill_manager.cc +++ b/components/android_autofill/browser/android_autofill_manager.cc -@@ -25,7 +25,7 @@ using base::TimeTicks; +@@ -26,7 +26,7 @@ using base::TimeTicks; void AndroidDriverInitHook(AutofillClient* client, ContentAutofillDriver* driver) { driver->set_autofill_manager( @@ -421,9 +431,9 @@ diff --git a/components/android_autofill/browser/android_autofill_manager.cc b/c diff --git a/components/android_autofill/browser/android_autofill_manager.h b/components/android_autofill/browser/android_autofill_manager.h --- a/components/android_autofill/browser/android_autofill_manager.h +++ b/components/android_autofill/browser/android_autofill_manager.h -@@ -95,12 +95,12 @@ class AndroidAutofillManager : public AutofillManager, - const FieldTypeGroup field_type_group, - const url::Origin& triggered_origin); +@@ -91,12 +91,12 @@ class AndroidAutofillManager : public AutofillManager, + const std::u16string& value, + PopupItemId popup_item_id) override; + AndroidAutofillManager(AutofillDriver* driver, AutofillClient* client); + @@ -436,162 +446,296 @@ diff --git a/components/android_autofill/browser/android_autofill_manager.h b/co void OnFormSubmittedImpl(const FormData& form, bool known_success, mojom::SubmissionSource source) override; +diff --git a/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillManagerWrapper.java b/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillManagerWrapper.java +--- a/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillManagerWrapper.java ++++ b/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillManagerWrapper.java +@@ -51,6 +51,7 @@ public class AutofillManagerWrapper { + AutofillManagerWrapper manager = mManager.get(); + if (manager == null) return; + manager.mIsAutofillInputUIShowing = (event == EVENT_INPUT_SHOWN); ++ if (manager.isLoggable()) manager.log("onAutofillEvent isAutofillInputUIShowing: " + manager.mIsAutofillInputUIShowing); + if (event == EVENT_INPUT_SHOWN) manager.notifyInputUIChange(); + } + } +@@ -89,6 +90,7 @@ public class AutofillManagerWrapper { + // Uses Exception to catch various cases. (refer to crbug.com/1186406) + Log.e(TAG, "getAutofillServiceComponentName", e); + } ++ if (isLoggable()) log("componentName=" + componentName); + if (componentName != null) { + mIsAwGCurrentAutofillService = + AWG_COMPONENT_NAME.equals(componentName.flattenToString()); +@@ -247,7 +249,7 @@ public class AutofillManagerWrapper { + /** Always check isLoggable() before call this method. */ + public static void log(String log) { + // Log.i() instead of Log.d() is used here because log.d() is stripped out in release build. +- Log.i(TAG, log); ++ Log.i(TAG, "---" + log); + } + + public static boolean isLoggable() { +@@ -260,6 +262,7 @@ public class AutofillManagerWrapper { + // NOTE: See the comment on TAG above for why this is still AwAutofillManager. + // Check the system setting directly. + sIsLoggable = android.util.Log.isLoggable(TAG, Log.DEBUG); ++ // sIsLoggable = true; // to force enable the log + } + + } +diff --git a/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillProvider.java b/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillProvider.java +--- a/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillProvider.java ++++ b/components/android_autofill/browser/java/src/org/chromium/components/autofill/AutofillProvider.java +@@ -190,13 +190,19 @@ public class AutofillProvider { + + /** @return whether query autofill suggestion. */ + public boolean shouldQueryAutofillSuggestion() { ++ AutofillManagerWrapper.log("---shouldQueryAutofillSuggestion" + ++ " mRequest != null=" + (mRequest != null) + ++ " mRequest.getFocusField() != null=" + (mRequest != null && mRequest.getFocusField() != null) + ++ " !mAutofillManager.isAutofillInputUIShowing()=" + ( !mAutofillManager.isAutofillInputUIShowing())); + return mRequest != null + && mRequest.getFocusField() != null + && !mAutofillManager.isAutofillInputUIShowing(); + } + + public void queryAutofillSuggestion() { ++ AutofillManagerWrapper.log("queryAutofillSuggestion start"); + if (shouldQueryAutofillSuggestion()) { ++ AutofillManagerWrapper.log("calling requestAutofill"); + FocusField focusField = mRequest.getFocusField(); + mAutofillManager.requestAutofill( + mContainerView, +@@ -256,6 +262,7 @@ public class AutofillProvider { + float width, + float height, + boolean hasServerPrediction) { ++ AutofillManagerWrapper.log("startAutofillSession"); + // Check focusField inside short value? Autofill Manager might have session that wasn't + // started by AutofillProvider, we just always cancel existing session here. + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { +diff --git a/components/android_autofill/browser/java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java b/components/android_autofill/browser/java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java +new file mode 100644 +--- /dev/null ++++ b/components/android_autofill/browser/java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java +@@ -0,0 +1,62 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++package org.chromium.components.autofill; ++ ++import android.content.pm.ResolveInfo; ++ ++import androidx.annotation.IntDef; ++import androidx.annotation.NonNull; ++ ++import org.chromium.base.metrics.RecordHistogram; ++import org.chromium.components.autofill.AutofillSelectionMenuItemHelper; ++import org.chromium.content_public.browser.SelectionMenuItem; ++import org.chromium.content_public.browser.SelectionPopupController; ++import org.chromium.content_public.browser.selection.SelectionActionMenuDelegate; ++ ++import java.lang.annotation.Retention; ++import java.lang.annotation.RetentionPolicy; ++import java.util.ArrayList; ++import java.util.List; ++ ++import org.chromium.base.Log; ++ ++/** Interface for customizing text selection menu items in {@link SelectionPopupController} */ ++public class BrowserSelectionActionMenuDelegate implements SelectionActionMenuDelegate { ++ private AutofillSelectionMenuItemHelper mAutofillSelectionMenuItemHelper; ++ ++ public BrowserSelectionActionMenuDelegate() { ++ } ++ ++ @Override ++ public void modifyDefaultMenuItems( ++ List menuItemBuilders, ++ boolean isSelectionPassword, ++ @NonNull String selectedText) { ++ } ++ ++ @Override ++ public List filterTextProcessingActivities(List activities) { ++ return activities; ++ } ++ ++ @NonNull ++ @Override ++ public List getAdditionalNonSelectionItems() { ++ if (mAutofillSelectionMenuItemHelper != null) { ++ return mAutofillSelectionMenuItemHelper.getAdditionalItems(); ++ } ++ return new ArrayList<>(); ++ } ++ ++ @NonNull ++ @Override ++ public List getAdditionalTextProcessingItems() { ++ return new ArrayList<>(); ++ } ++ ++ public void setAutofillSelectionMenuItemHelper(AutofillSelectionMenuItemHelper provider) { ++ mAutofillSelectionMenuItemHelper = provider; ++ } ++} diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc -@@ -412,6 +412,10 @@ void ContentAutofillDriver::FormsSeen( +@@ -455,6 +455,10 @@ void ContentAutofillDriver::FormsSeen( const std::vector& removed_forms) { target->GetAutofillManager().OnFormsSeen( WithNewVersion(updated_forms), removed_forms); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnFormsSeen( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFormsSeen( + WithNewVersion(updated_forms), removed_forms); + } }); } -@@ -439,6 +443,10 @@ void ContentAutofillDriver::FormSubmitted( +@@ -482,6 +486,10 @@ void ContentAutofillDriver::FormSubmitted( } target->GetAutofillManager().OnFormSubmitted( WithNewVersion(form), known_success, submission_source); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnFormSubmitted( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFormSubmitted( + WithNewVersion(form), known_success, submission_source); + } }); } -@@ -460,6 +468,10 @@ void ContentAutofillDriver::TextFieldDidChange(const FormData& raw_form, +@@ -503,6 +511,10 @@ void ContentAutofillDriver::TextFieldDidChange(const FormData& raw_form, base::TimeTicks timestamp) { target->GetAutofillManager().OnTextFieldDidChange( WithNewVersion(form), field, bounding_box, timestamp); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnTextFieldDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnTextFieldDidChange( + WithNewVersion(form), field, bounding_box, timestamp); + } }); } -@@ -479,6 +491,10 @@ void ContentAutofillDriver::TextFieldDidScroll(const FormData& raw_form, +@@ -522,6 +534,10 @@ void ContentAutofillDriver::TextFieldDidScroll(const FormData& raw_form, const FormFieldData& field, const gfx::RectF& bounding_box) { target->GetAutofillManager().OnTextFieldDidScroll(WithNewVersion(form), field, bounding_box); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnTextFieldDidScroll( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnTextFieldDidScroll( + WithNewVersion(form), field, bounding_box); + } }); } -@@ -499,6 +515,10 @@ void ContentAutofillDriver::SelectControlDidChange( +@@ -542,6 +558,10 @@ void ContentAutofillDriver::SelectControlDidChange( const FormFieldData& field, const gfx::RectF& bounding_box) { target->GetAutofillManager().OnSelectControlDidChange( WithNewVersion(form), field, bounding_box); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnSelectControlDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnSelectControlDidChange( + WithNewVersion(form), field, bounding_box); + } }); } -@@ -521,6 +541,10 @@ void ContentAutofillDriver::AskForValuesToFill( +@@ -564,6 +584,10 @@ void ContentAutofillDriver::AskForValuesToFill( AutofillSuggestionTriggerSource trigger_source) { target->GetAutofillManager().OnAskForValuesToFill( WithNewVersion(form), field, bounding_box, trigger_source); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnAskForValuesToFill( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnAskForValuesToFill( + WithNewVersion(form), field, bounding_box, trigger_source); + } }); } -@@ -532,6 +556,8 @@ void ContentAutofillDriver::HidePopup() { +@@ -575,6 +599,8 @@ void ContentAutofillDriver::HidePopup() { DCHECK(!target->IsPrerendering()) << "We should never affect UI while prerendering"; target->GetAutofillManager().OnHidePopup(); -+ if (target->secondary_autofill_manager_) -+ target->secondary_autofill_manager_->OnHidePopup(); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnHidePopup(); }); } -@@ -543,6 +569,8 @@ void ContentAutofillDriver::FocusNoLongerOnForm(bool had_interacted_form) { +@@ -586,6 +612,8 @@ void ContentAutofillDriver::FocusNoLongerOnForm(bool had_interacted_form) { this, had_interacted_form, [](autofill::AutofillDriver* target, bool had_interacted_form) { target->GetAutofillManager().OnFocusNoLongerOnForm(had_interacted_form); -+ if (target->secondary_autofill_manager_) -+ target->secondary_autofill_manager_->OnFocusNoLongerOnForm(had_interacted_form); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(had_interacted_form); }); } -@@ -562,9 +590,16 @@ void ContentAutofillDriver::FocusOnFormField(const FormData& raw_form, +@@ -605,9 +633,16 @@ void ContentAutofillDriver::FocusOnFormField(const FormData& raw_form, const FormFieldData& field, const gfx::RectF& bounding_box) { target->GetAutofillManager().OnFocusOnFormField(WithNewVersion(form), field, bounding_box); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnFocusOnFormField( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFocusOnFormField( + WithNewVersion(form), field, bounding_box); + } }, [](autofill::AutofillDriver* target) { target->GetAutofillManager().OnFocusNoLongerOnForm(true); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnFocusNoLongerOnForm(true); ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(true); + } }); } -@@ -579,6 +614,10 @@ void ContentAutofillDriver::DidFillAutofillFormData(const FormData& raw_form, +@@ -622,6 +657,10 @@ void ContentAutofillDriver::DidFillAutofillFormData(const FormData& raw_form, base::TimeTicks timestamp) { target->GetAutofillManager().OnDidFillAutofillFormData( WithNewVersion(form), timestamp); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnDidFillAutofillFormData( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnDidFillAutofillFormData( + WithNewVersion(form), timestamp); + } }); } -@@ -588,6 +627,8 @@ void ContentAutofillDriver::DidEndTextFieldEditing() { +@@ -631,6 +670,8 @@ void ContentAutofillDriver::DidEndTextFieldEditing() { } router().DidEndTextFieldEditing(this, [](autofill::AutofillDriver* target) { target->GetAutofillManager().OnDidEndTextFieldEditing(); -+ if (target->secondary_autofill_manager_) -+ target->secondary_autofill_manager_->OnDidEndTextFieldEditing(); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnDidEndTextFieldEditing(); }); } -@@ -602,6 +643,10 @@ void ContentAutofillDriver::SelectOrSelectListFieldOptionsDidChange( +@@ -645,6 +686,10 @@ void ContentAutofillDriver::SelectOrSelectListFieldOptionsDidChange( cast(target) ->GetAutofillManager() .OnSelectOrSelectListFieldOptionsDidChange(WithNewVersion(form)); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnSelectOrSelectMenuFieldOptionsDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnSelectOrSelectListFieldOptionsDidChange( + WithNewVersion(form)); + } }); } -@@ -621,6 +666,10 @@ void ContentAutofillDriver::JavaScriptChangedAutofilledValue( +@@ -664,6 +709,10 @@ void ContentAutofillDriver::JavaScriptChangedAutofilledValue( const FormFieldData& field, const std::u16string& old_value) { target->GetAutofillManager().OnJavaScriptChangedAutofilledValue( WithNewVersion(form), field, old_value); -+ if (target->secondary_autofill_manager_) { -+ target->secondary_autofill_manager_->OnJavaScriptChangedAutofilledValue( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnJavaScriptChangedAutofilledValue( + WithNewVersion(form), field, old_value); + } }); } -@@ -633,6 +682,8 @@ void ContentAutofillDriver::OnContextMenuShownInField( +@@ -676,6 +725,8 @@ void ContentAutofillDriver::OnContextMenuShownInField( const FieldGlobalId& field_global_id) { target->GetAutofillManager().OnContextMenuShownInField(form_global_id, field_global_id); -+ if (target->secondary_autofill_manager_) -+ target->secondary_autofill_manager_->OnContextMenuShownInField(form_global_id, field_global_id); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnContextMenuShownInField(form_global_id, field_global_id); }); } -@@ -643,6 +694,8 @@ void ContentAutofillDriver::Reset() { +@@ -686,6 +737,8 @@ void ContentAutofillDriver::Reset() { owner_->router().UnregisterDriver(this, /*driver_is_dying=*/false); autofill_manager_->Reset(); @@ -600,10 +744,21 @@ diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/co } const mojo::AssociatedRemote& +@@ -698,6 +751,10 @@ ContentAutofillDriver::GetAutofillAgent() { + return autofill_agent_; + } + ++raw_ptr ContentAutofillDriver::secondary_autofill_manager() { ++ return secondary_autofill_manager_.get(); ++} ++ + void ContentAutofillDriver::SetFrameAndFormMetaData( + FormData& form, + FormFieldData* optional_field) const { diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h --- a/components/autofill/content/browser/content_autofill_driver.h +++ b/components/autofill/content/browser/content_autofill_driver.h -@@ -127,9 +127,12 @@ class ContentAutofillDriver : public AutofillDriver, +@@ -128,9 +128,12 @@ class ContentAutofillDriver : public AutofillDriver, ContentAutofillDriver& operator=(const ContentAutofillDriver&) = delete; ~ContentAutofillDriver() override; @@ -613,11 +768,11 @@ diff --git a/components/autofill/content/browser/content_autofill_driver.h b/com autofill_manager_ = std::move(autofill_manager); + secondary_autofill_manager_ = std::move(secondary_autofill_manager); } -+ AutofillManager* secondary_autofill_manager() { return secondary_autofill_manager_.get(); } ++ raw_ptr secondary_autofill_manager() override; content::RenderFrameHost* render_frame_host() { return &*render_frame_host_; } const content::RenderFrameHost* render_frame_host() const { -@@ -319,6 +322,10 @@ class ContentAutofillDriver : public AutofillDriver, +@@ -351,6 +354,10 @@ class ContentAutofillDriver : public AutofillDriver, std::unique_ptr autofill_manager_ = nullptr; @@ -669,10 +824,46 @@ diff --git a/components/autofill/content/browser/content_autofill_driver_factory ContentAutofillDriver* driver); // Manages lifetime of ContentAutofillDriver. Owned by ContentAutofillClient, +diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc +--- a/components/autofill/content/renderer/autofill_agent.cc ++++ b/components/autofill/content/renderer/autofill_agent.cc +@@ -1024,14 +1024,18 @@ void AutofillAgent::ShowSuggestions( + password_generation_agent_->ShowPasswordGenerationSuggestions( + input_element)) { + is_popup_possibly_visible_ = true; ++#if !BUILDFLAG(IS_ANDROID) + return; ++#endif + } + if (password_autofill_agent_->ShowSuggestions( + input_element, + ShowAll(ShouldShowFullSuggestionListForPasswordManager( + trigger_source, element)))) { + is_popup_possibly_visible_ = true; ++#if !BUILDFLAG(IS_ANDROID) + return; ++#endif + } + } + +@@ -1043,11 +1047,13 @@ void AutofillAgent::ShowSuggestions( + // match a regex). In this specific case we are actually interested in whether + // the field is currently a password field, not whether it has ever been a + // password field. ++#if !BUILDFLAG(IS_ANDROID) + if (!input_element.IsNull() && + input_element.IsPasswordField /*disable presubmit*/ () && + !query_password_suggestion_) { + return; + } ++#endif + + QueryAutofillSuggestions(element, trigger_source); + } diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc -@@ -838,7 +838,10 @@ void PasswordAutofillAgent::UpdateStateForTextChange( +@@ -827,7 +827,10 @@ void PasswordAutofillAgent::UpdatePasswordStateForTextChange( void PasswordAutofillAgent::TrackAutofilledElement( const blink::WebFormControlElement& element) { @@ -684,6 +875,18 @@ diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/c } void PasswordAutofillAgent::FillPasswordSuggestion( +diff --git a/components/autofill/core/browser/autofill_driver.h b/components/autofill/core/browser/autofill_driver.h +--- a/components/autofill/core/browser/autofill_driver.h ++++ b/components/autofill/core/browser/autofill_driver.h +@@ -69,6 +69,8 @@ class AutofillDriver { + // Returns the AutofillManager owned by the AutofillDriver. + virtual AutofillManager& GetAutofillManager() = 0; + ++ virtual raw_ptr secondary_autofill_manager() = 0; ++ + // Returns whether the AutofillDriver instance is associated with an active + // frame in the MPArch sense. + virtual bool IsInActiveFrame() const = 0; diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc --- a/components/autofill/core/common/autofill_prefs.cc +++ b/components/autofill/core/common/autofill_prefs.cc @@ -698,15 +901,15 @@ diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/auto void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { // Synced prefs. Used for cross-device choices, e.g., credit card Autofill. registry->RegisterBooleanPref( -@@ -169,6 +173,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { +@@ -166,6 +170,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kAutofillCreditCardFidoAuthOfferCheckboxState, true); #endif + registry->RegisterBooleanPref(prefs::kAutofillAndroidEnabled, true); + registry->RegisterBooleanPref(prefs::kAutofillAndroidIncognitoEnabled, false); - registry->RegisterIntegerPref( - prefs::kAutofillLastVersionDisusedCreditCardsDeleted, 0); registry->RegisterIntegerPref(prefs::kAutocompleteLastVersionRetentionPolicy, + 0); + registry->RegisterStringPref(prefs::kAutofillUploadEncodingSeed, ""); diff --git a/components/autofill/core/common/autofill_prefs.h b/components/autofill/core/common/autofill_prefs.h --- a/components/autofill/core/common/autofill_prefs.h +++ b/components/autofill/core/common/autofill_prefs.h @@ -722,7 +925,7 @@ diff --git a/components/autofill/core/common/autofill_prefs.h b/components/autof diff --git a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java --- a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java +++ b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java -@@ -41,6 +41,11 @@ import org.chromium.ui.dragdrop.DragEventDispatchHelper.DragEventDispatchDestina +@@ -42,6 +42,11 @@ import org.chromium.ui.dragdrop.DragEventDispatchHelper.DragEventDispatchDestina import java.util.function.Supplier; @@ -734,16 +937,16 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component /** * The containing view for {@link WebContents} that exists in the Android UI hierarchy and exposes * the various {@link View} functionality to it. -@@ -92,6 +97,8 @@ public class ContentView extends FrameLayout - */ - public static ContentView createContentView(Context context, - @Nullable EventOffsetHandler eventOffsetHandler, @Nullable WebContents webContents) { +@@ -96,6 +101,8 @@ public class ContentView extends FrameLayout + Context context, + @Nullable EventOffsetHandler eventOffsetHandler, + @Nullable WebContents webContents) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + return new ContentViewWithAutofill(context, eventOffsetHandler, webContents); return new ContentView(context, eventOffsetHandler, webContents); } -@@ -638,4 +645,43 @@ public class ContentView extends FrameLayout +@@ -642,4 +649,43 @@ public class ContentView extends FrameLayout mDragDropEventOffsetHandler.onPostDispatchDragEvent(event.getAction()); return ret; } @@ -787,10 +990,29 @@ diff --git a/components/embedder_support/android/java/src/org/chromium/component + } + } } +diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/FloatingPastePopupMenu.java b/content/public/android/java/src/org/chromium/content/browser/selection/FloatingPastePopupMenu.java +--- a/content/public/android/java/src/org/chromium/content/browser/selection/FloatingPastePopupMenu.java ++++ b/content/public/android/java/src/org/chromium/content/browser/selection/FloatingPastePopupMenu.java +@@ -133,13 +133,14 @@ public class FloatingPastePopupMenu implements PastePopupMenu { + SortedSet nonSelectionMenuItems = + SelectActionMenuHelper.getNonSelectionMenuItems( + mContext, actionMenuDelegate, mSelectionActionMenuDelegate); ++ mCustomMenuItemClickListeners.clear(); + SelectionPopupControllerImpl.initializeActionMenu( + mContext, nonSelectionMenuItems, menu, mCustomMenuItemClickListeners, null); + } + + @Override + public boolean onPrepareActionMode(ActionMode mode, Menu menu) { +- mCustomMenuItemClickListeners.clear(); ++ // fixed a bug, moved above + return false; + } + diff --git a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java --- a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java +++ b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java -@@ -31,6 +31,10 @@ import org.chromium.ui.dragdrop.DragStateTracker; +@@ -32,6 +32,10 @@ import org.chromium.ui.dragdrop.DragStateTracker; import org.chromium.ui.dragdrop.DropDataAndroid; import org.chromium.ui.mojom.CursorType; @@ -798,10 +1020,10 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java b +import android.view.autofill.AutofillValue; +import android.view.ViewStructure; + - /** - * Class to acquire, position, and remove anchor views from the implementing View. - */ -@@ -578,4 +582,8 @@ public class ViewAndroidDelegate { + /** Class to acquire, position, and remove anchor views from the implementing View. */ + @JNINamespace("ui") + public class ViewAndroidDelegate { +@@ -586,4 +590,8 @@ public class ViewAndroidDelegate { sDragAndDropDelegateForTesting = testDelegate; ResettersForTesting.register(() -> sDragAndDropDelegateForTesting = null); } @@ -811,4 +1033,3 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java b + public void autofill(final SparseArray values) {} } -- -2.25.1 diff --git a/build/bromite_patches/Enable-network-isolation-features.patch b/build/cromite_patches/Enable-network-isolation-features.patch similarity index 99% rename from build/bromite_patches/Enable-network-isolation-features.patch rename to build/cromite_patches/Enable-network-isolation-features.patch index a600388f2f138d805e42b43139225e4578b49e48..33f66f4334336c5f8d1efa483e5596d824843fba 100644 --- a/build/bromite_patches/Enable-network-isolation-features.patch +++ b/build/cromite_patches/Enable-network-isolation-features.patch @@ -37,4 +37,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_ENABLED(kSplitAuthCacheByNetworkIsolationKey); -- -2.25.1 diff --git a/build/bromite_patches/Enable-prefetch-privacy-changes-by-default.patch b/build/cromite_patches/Enable-prefetch-privacy-changes-by-default.patch similarity index 99% rename from build/bromite_patches/Enable-prefetch-privacy-changes-by-default.patch rename to build/cromite_patches/Enable-prefetch-privacy-changes-by-default.patch index 427ab601de209b71b477cf9b2354306931848430..913d3627b9e88ea9b962875ded7627da021bf94f 100644 --- a/build/bromite_patches/Enable-prefetch-privacy-changes-by-default.patch +++ b/build/cromite_patches/Enable-prefetch-privacy-changes-by-default.patch @@ -15,4 +15,3 @@ new file mode 100644 @@ -0,0 +1 @@ +SET_CROMITE_FEATURE_ENABLED(kPrefetchPrivacyChanges); -- -2.25.1 diff --git a/build/bromite_patches/Enable-share-intent.patch b/build/cromite_patches/Enable-share-intent.patch similarity index 78% rename from build/bromite_patches/Enable-share-intent.patch rename to build/cromite_patches/Enable-share-intent.patch index a33fa889070046627fc87a58ddea867f736ca65f..329ee7f88ce04bb64dcef6243d16e7baa19bccfb 100644 --- a/build/bromite_patches/Enable-share-intent.patch +++ b/build/cromite_patches/Enable-share-intent.patch @@ -12,19 +12,19 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/chrome_java_resources.gni | 1 + chrome/android/chrome_java_sources.gni | 1 + - chrome/android/java/AndroidManifest.xml | 24 +++- - .../res/layout/sharing_intent_content.xml | 87 +++++++++++++ - .../chrome/browser/IntentHandler.java | 16 ++- - .../browser/LaunchIntentDispatcher.java | 2 +- + chrome/android/java/AndroidManifest.xml | 28 +++- + .../res/layout/sharing_intent_content.xml | 88 ++++++++++ + .../chrome/browser/IntentHandler.java | 16 +- + .../browser/LaunchIntentDispatcher.java | 14 +- .../init/ProcessInitializationHandler.java | 3 + - .../SharedIntentShareActivity.java | 119 ++++++++++++++++++ + .../SharedIntentShareActivity.java | 158 ++++++++++++++++++ .../flags/android/chrome_feature_list.cc | 1 + .../browser/flags/ChromeFeatureList.java | 1 + .../strings/android_chrome_strings.grd | 13 ++ .../about_flags_cc/Enable-share-intent.inc | 12 ++ .../Enable-share-intent.inc | 3 + .../Enable-share-intent.inc | 1 + - 14 files changed, 276 insertions(+), 8 deletions(-) + 14 files changed, 332 insertions(+), 8 deletions(-) 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 create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Enable-share-intent.inc @@ -34,7 +34,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -598,6 +598,7 @@ chrome_java_resources = [ +@@ -589,6 +589,7 @@ chrome_java_resources = [ "java/res/layout/signin_activity.xml", "java/res/layout/status_indicator_container.xml", "java/res/layout/suggestions_tile_view_condensed.xml", @@ -45,7 +45,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja 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 -@@ -1037,6 +1037,7 @@ chrome_java_sources = [ +@@ -1038,6 +1038,7 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/signin/SyncConsentActivity.java", "java/src/org/chromium/chrome/browser/signin/SyncConsentActivityLauncherImpl.java", "java/src/org/chromium/chrome/browser/signin/SyncConsentFragment.java", @@ -69,7 +69,18 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro -@@ -362,6 +356,24 @@ by a child template that "extends" this file. +@@ -326,6 +320,10 @@ by a child template that "extends" this file. + + + ++ ++ ++ ++ + + + +@@ -362,6 +360,24 @@ by a child template that "extends" this file. @@ -98,7 +109,7 @@ diff --git a/chrome/android/java/res/layout/sharing_intent_content.xml b/chrome/ new file mode 100644 --- /dev/null +++ b/chrome/android/java/res/layout/sharing_intent_content.xml -@@ -0,0 +1,87 @@ +@@ -0,0 +1,88 @@ + + -@@ -35307,7 +35310,7 @@ Called by update_extension_histograms.py.--> +@@ -14462,7 +14465,7 @@ Called by update_extension_histograms.py.--> @@ -5448,10 +5448,10 @@ diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums -@@ -38455,6 +38458,8 @@ Called by update_extension_permission.py.--> - - - +@@ -17413,6 +17416,8 @@ Called by update_extension_permission.py.--> + + + + + @@ -5889,4 +5889,3 @@ new file mode 100644 + } +} -- -2.25.1 diff --git a/build/bromite_patches/kill-Auth.patch b/build/cromite_patches/kill-Auth.patch similarity index 58% rename from build/bromite_patches/kill-Auth.patch rename to build/cromite_patches/kill-Auth.patch index bd298626936eb308cc7de8b474596ad89c4b88b4..967f8cac172fcfbb7fe80143b4024a780ee6c197 100644 --- a/build/bromite_patches/kill-Auth.patch +++ b/build/cromite_patches/kill-Auth.patch @@ -4,8 +4,8 @@ Subject: kill Auth License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../signin/SystemAccountManagerDelegate.java | 49 ++----------------- - 1 file changed, 3 insertions(+), 46 deletions(-) + .../signin/SystemAccountManagerDelegate.java | 69 +------------------ + 1 file changed, 3 insertions(+), 66 deletions(-) diff --git a/components/signin/public/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/public/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java --- a/components/signin/public/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java @@ -20,33 +20,53 @@ diff --git a/components/signin/public/android/java/src/org/chromium/components/s import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; import org.chromium.base.ContextUtils; -@@ -87,14 +84,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { - +@@ -89,15 +86,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { + @Deprecated @Override public Account[] getAccounts() { - if (hasGetAccountsPermission() && isGooglePlayServicesAvailable()) { - long startTime = SystemClock.elapsedRealtime(); - Account[] accounts = - mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); -- RecordHistogram.recordTimesHistogram("Signin.AndroidGetAccountsTime_AccountManager", +- RecordHistogram.recordTimesHistogram( +- "Signin.AndroidGetAccountsTime_AccountManager", - SystemClock.elapsedRealtime() - startTime); - return accounts; - } // Account seeding relies on GoogleAuthUtil.getAccountId to get GAIA ids, // so don't report any accounts if Google Play Services are out of date. return new Account[] {}; -@@ -105,28 +94,12 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { +@@ -108,15 +96,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { + if (!isGooglePlayServicesAvailable()) { + throw new AccountManagerDelegateException("Can't use Google Play Services"); + } +- if (hasGetAccountsPermission()) { +- long startTime = SystemClock.elapsedRealtime(); +- Account[] accounts = +- mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); +- RecordHistogram.recordTimesHistogram( +- "Signin.AndroidGetAccountsTime_AccountManager", +- SystemClock.elapsedRealtime() - startTime); +- return accounts; +- } + // Don't report any accounts if we don't have permission. + // TODO(crbug.com/1502123): Throw an exception if permission was denied. + return new Account[] {}; +@@ -127,31 +106,12 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { throws AuthException { ThreadUtils.assertOnBackgroundThread(); assert AccountUtils.GOOGLE_ACCOUNT_TYPE.equals(account.type); - try { -- return new AccessTokenData(GoogleAuthUtil.getTokenWithNotification( -- ContextUtils.getApplicationContext(), account, authTokenScope, null)); +- return new AccessTokenData( +- GoogleAuthUtil.getTokenWithNotification( +- ContextUtils.getApplicationContext(), account, authTokenScope, null)); - } catch (GoogleAuthException ex) { - // This case includes a UserRecoverableNotifiedException, but most clients will have - // their own retry mechanism anyway. -- throw new AuthException(AuthException.NONTRANSIENT, -- "Error while getting token for scope '" + authTokenScope + "'", ex); +- throw new AuthException( +- AuthException.NONTRANSIENT, +- "Error while getting token for scope '" + authTokenScope + "'", +- ex); - } catch (IOException ex) { - throw new AuthException(AuthException.TRANSIENT, ex); - } @@ -66,25 +86,32 @@ diff --git a/components/signin/public/android/java/src/org/chromium/components/s } @Override -@@ -163,17 +136,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { +@@ -188,24 +148,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { @SuppressLint("MissingPermission") @Override public void createAddAccountIntent(Callback callback) { -- AccountManagerCallback accountManagerCallback = accountManagerFuture -> { -- try { -- Bundle bundle = accountManagerFuture.getResult(); -- callback.onResult(bundle.getParcelable(AccountManager.KEY_INTENT)); -- } catch (OperationCanceledException | IOException | AuthenticatorException e) { -- Log.e(TAG, "Error while creating an intent to add an account: ", e); -- callback.onResult(null); -- } -- }; -- mAccountManager.addAccount(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE, null, null, null, null, -- accountManagerCallback, null); +- AccountManagerCallback accountManagerCallback = +- accountManagerFuture -> { +- try { +- Bundle bundle = accountManagerFuture.getResult(); +- callback.onResult(bundle.getParcelable(AccountManager.KEY_INTENT)); +- } catch (OperationCanceledException | IOException | AuthenticatorException e) { +- Log.e(TAG, "Error while creating an intent to add an account: ", e); +- callback.onResult(null); +- } +- }; +- mAccountManager.addAccount( +- GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE, +- null, +- null, +- null, +- null, +- accountManagerCallback, +- null); } // No permission is needed on 23+ and Chrome always has MANAGE_ACCOUNTS permission on lower APIs -@@ -206,12 +168,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { +@@ -240,12 +182,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate { @Nullable @Override public String getAccountGaiaId(String accountEmail) { @@ -99,4 +126,3 @@ diff --git a/components/signin/public/android/java/src/org/chromium/components/s @Override -- -2.25.1 diff --git a/build/bromite_patches/kill-Location-fall-back-to-system.patch b/build/cromite_patches/kill-Location-fall-back-to-system.patch similarity index 84% rename from build/bromite_patches/kill-Location-fall-back-to-system.patch rename to build/cromite_patches/kill-Location-fall-back-to-system.patch index 055ad664aa4455d896c78083a427a9db79ddc4ca..d6f723f7a959f515c1fba8a45ceb08e8ebdc8dfa 100644 --- a/build/bromite_patches/kill-Location-fall-back-to-system.patch +++ b/build/cromite_patches/kill-Location-fall-back-to-system.patch @@ -4,14 +4,14 @@ Subject: kill Location, fall back to system License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - services/device/geolocation/BUILD.gn | 1 - - .../device/geolocation/LocationProviderFactory.java | 10 ++-------- - 2 files changed, 2 insertions(+), 9 deletions(-) + services/device/geolocation/BUILD.gn | 1 - + .../device/geolocation/LocationProviderFactory.java | 11 ++--------- + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn --- a/services/device/geolocation/BUILD.gn +++ b/services/device/geolocation/BUILD.gn -@@ -163,7 +163,6 @@ if (is_android) { +@@ -165,7 +165,6 @@ if (is_android) { "android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java", "android/java/src/org/chromium/device/geolocation/LocationProviderAndroid.java", "android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java", @@ -22,7 +22,7 @@ diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/ diff --git a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java --- a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java +++ b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java -@@ -27,19 +27,13 @@ public class LocationProviderFactory { +@@ -26,19 +26,12 @@ public class LocationProviderFactory { @CalledByNative public static void useGmsCoreLocationProvider() { @@ -32,10 +32,10 @@ diff --git a/services/device/geolocation/android/java/src/org/chromium/device/ge public static LocationProvider create() { if (sProviderImpl != null) return sProviderImpl; - +- - if (sUseGmsCoreLocationProvider - && LocationProviderGmsCore.isGooglePlayServicesAvailable( -- ContextUtils.getApplicationContext())) { +- ContextUtils.getApplicationContext())) { - sProviderImpl = new LocationProviderGmsCore(ContextUtils.getApplicationContext()); - } else { - sProviderImpl = new LocationProviderAndroid(); @@ -45,4 +45,3 @@ diff --git a/services/device/geolocation/android/java/src/org/chromium/device/ge } } -- -2.25.1 diff --git a/build/bromite_patches/kill-Vision.patch b/build/cromite_patches/kill-Vision.patch similarity index 94% rename from build/bromite_patches/kill-Vision.patch rename to build/cromite_patches/kill-Vision.patch index 56182a756ae10054390c0fb2a9f114c957253199..64a7947e1782829e8f293c7ca3b74f33608fea78 100644 --- a/build/bromite_patches/kill-Vision.patch +++ b/build/cromite_patches/kill-Vision.patch @@ -15,15 +15,15 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -299,8 +299,6 @@ if (current_toolchain == default_toolchain) { +@@ -300,8 +300,6 @@ if (current_toolchain == default_toolchain) { "$google_play_services_package:google_play_services_gcm_java", "$google_play_services_package:google_play_services_iid_java", "$google_play_services_package:google_play_services_tasks_java", - "$google_play_services_package:google_play_services_vision_common_java", - "$google_play_services_package:google_play_services_vision_java", - "//base:jni_java", "//cc:cc_java", "//cc/mojom:mojom_java", + "//chrome/android/features/keyboard_accessory:public_java", diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn --- a/services/shape_detection/BUILD.gn +++ b/services/shape_detection/BUILD.gn @@ -47,8 +47,8 @@ diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD. - "$google_play_services_package:google_play_services_vision_common_java", - "$google_play_services_package:google_play_services_vision_java", "//base:base_java", - "//base:jni_java", "//mojo/public/java:base_java", + "//mojo/public/java:bindings_java", diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java @@ -61,7 +61,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect import org.chromium.mojo_base.BigBufferUtil; import java.nio.ByteBuffer; -@@ -43,14 +41,4 @@ public class BitmapUtils { +@@ -41,14 +39,4 @@ public class BitmapUtils { return bitmap; } } @@ -79,8 +79,8 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java --- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java +++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java -@@ -8,9 +8,6 @@ import org.chromium.base.annotations.CalledByNative; - import org.chromium.base.annotations.JNINamespace; +@@ -9,9 +9,6 @@ import org.jni_zero.JNINamespace; + import org.chromium.mojo.system.MessagePipeHandle; import org.chromium.mojo.system.impl.CoreImpl; -import org.chromium.shape_detection.mojom.BarcodeDetectionProvider; @@ -89,7 +89,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect @JNINamespace("shape_detection") class InterfaceRegistrar { -@@ -22,33 +19,17 @@ class InterfaceRegistrar { +@@ -23,33 +20,17 @@ class InterfaceRegistrar { static void bindBarcodeDetectionProvider(long nativeHandle) { // Immediately wrap |nativeHandle| as it cannot be allowed to leak. MessagePipeHandle handle = messagePipeHandleFromNative(nativeHandle); @@ -126,4 +126,3 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect } } -- -2.25.1 diff --git a/build/bromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch b/build/cromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch similarity index 99% rename from build/bromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch rename to build/cromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch index ba37c8c4f0839a1642dcc24662dbed3a1e960e91..864f1ecc83125d294e42bc185cd67e4e6f6095bd 100644 --- a/build/bromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch +++ b/build/cromite_patches/mime_util-force-text-x-suse-ymp-to-be-downloaded.patch @@ -22,4 +22,3 @@ diff --git a/third_party/blink/common/mime_util/mime_util.cc b/third_party/blink "text/csv", "text/tab-separated-values", -- -2.25.1 diff --git a/build/bromite_patches/net-cert-increase-default-key-length.patch b/build/cromite_patches/net-cert-increase-default-key-length.patch similarity index 91% rename from build/bromite_patches/net-cert-increase-default-key-length.patch rename to build/cromite_patches/net-cert-increase-default-key-length.patch index df5c3d23ac8a4ed1efda88baf89a0adcf3dcaeab..632b55c9251a587cd4691db8c6378c4eebae8e82 100644 --- a/build/bromite_patches/net-cert-increase-default-key-length.patch +++ b/build/cromite_patches/net-cert-increase-default-key-length.patch @@ -13,7 +13,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/net/cert/x509_util.cc b/net/cert/x509_util.cc --- a/net/cert/x509_util.cc +++ b/net/cert/x509_util.cc -@@ -254,7 +254,7 @@ bool GetTLSServerEndPointChannelBinding(const X509Certificate& certificate, +@@ -255,7 +255,7 @@ bool GetTLSServerEndPointChannelBinding(const X509Certificate& certificate, } // RSA keys created by CreateKeyAndSelfSignedCert will be of this length. @@ -23,4 +23,3 @@ diff --git a/net/cert/x509_util.cc b/net/cert/x509_util.cc // Certificates made by CreateKeyAndSelfSignedCert will be signed using this // digest algorithm. -- -2.25.1 diff --git a/build/bromite_patches/openH264-enable-ARM-ARM64-optimizations.patch b/build/cromite_patches/openH264-enable-ARM-ARM64-optimizations.patch similarity index 99% rename from build/bromite_patches/openH264-enable-ARM-ARM64-optimizations.patch rename to build/cromite_patches/openH264-enable-ARM-ARM64-optimizations.patch index 8050fe4faf59cd7696fe29f17620c930345e93a7..b0532b288e0ccd2793312a14cd17bc9f1e0aecad 100644 --- a/build/bromite_patches/openH264-enable-ARM-ARM64-optimizations.patch +++ b/build/cromite_patches/openH264-enable-ARM-ARM64-optimizations.patch @@ -78,4 +78,3 @@ diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn include_dirs = openh264_encoder_include_dirs -- -2.25.1 diff --git a/build/bromite_patches/prefs-always-prompt-for-download-directory.patch b/build/cromite_patches/prefs-always-prompt-for-download-directory.patch similarity index 96% rename from build/bromite_patches/prefs-always-prompt-for-download-directory.patch rename to build/cromite_patches/prefs-always-prompt-for-download-directory.patch index d160240c1e92dfcee1e8f16546ce41c3f321c68e..8612a3617eeac60cbafe1ce3a4f9bae675e2e48a 100644 --- a/build/bromite_patches/prefs-always-prompt-for-download-directory.patch +++ b/build/cromite_patches/prefs-always-prompt-for-download-directory.patch @@ -31,7 +31,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc -@@ -281,7 +281,7 @@ void DownloadPrefs::RegisterProfilePrefs( +@@ -279,7 +279,7 @@ void DownloadPrefs::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kPromptForDownload, @@ -41,4 +41,3 @@ diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download registry->RegisterStringPref(prefs::kDownloadExtensionsToOpen, std::string()); registry->RegisterListPref(prefs::kDownloadExtensionsToOpenByPolicy, {}); -- -2.25.1 diff --git a/build/bromite_patches/profile-resetter-disable-send-settings.patch b/build/cromite_patches/profile-resetter-disable-send-settings.patch similarity index 99% rename from build/bromite_patches/profile-resetter-disable-send-settings.patch rename to build/cromite_patches/profile-resetter-disable-send-settings.patch index 31a46541074ef003f1c934d7ab4e8c094fd83caf..98a007099217b7ae36551588ca4a5a5da8ad342a 100644 --- a/build/bromite_patches/profile-resetter-disable-send-settings.patch +++ b/build/cromite_patches/profile-resetter-disable-send-settings.patch @@ -28,4 +28,3 @@ diff --git a/chrome/browser/profile_resetter/reset_report_uploader.cc b/chrome/b GURL GetClientReportUrl(const std::string& report_url) { GURL url(report_url); -- -2.25.1 diff --git a/build/bromite_patches/sharing-hub-always-use-visible-URL.patch b/build/cromite_patches/sharing-hub-always-use-visible-URL.patch similarity index 94% rename from build/bromite_patches/sharing-hub-always-use-visible-URL.patch rename to build/cromite_patches/sharing-hub-always-use-visible-URL.patch index 0adb90c8233da4b928cf468e3324ad419bd091dd..a1ff8bd670a064e56adcfc9e0e44e29817f53f66 100644 --- a/build/bromite_patches/sharing-hub-always-use-visible-URL.patch +++ b/build/cromite_patches/sharing-hub-always-use-visible-URL.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/ShareDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/share/ShareDelegateImpl.java --- a/chrome/android/java/src/org/chromium/chrome/browser/share/ShareDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/share/ShareDelegateImpl.java -@@ -184,14 +184,8 @@ public class ShareDelegateImpl implements ShareDelegate { +@@ -226,14 +226,8 @@ public class ShareDelegateImpl implements ShareDelegate { @VisibleForTesting static boolean shouldFetchCanonicalUrl(final Tab currentTab) { @@ -28,4 +28,3 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/ShareDele private static void logCanonicalUrlResult(GURL visibleUrl, GURL canonicalUrl) { -- -2.25.1 diff --git a/build/bromite_patches/translate-disable-fetching-of-languages-from-server.patch b/build/cromite_patches/translate-disable-fetching-of-languages-from-server.patch similarity index 88% rename from build/bromite_patches/translate-disable-fetching-of-languages-from-server.patch rename to build/cromite_patches/translate-disable-fetching-of-languages-from-server.patch index 47add6e197931955614800bfc80b09bd92404e17..448cf928d0bb93a89f144a1404ac29323870b018 100644 --- a/build/bromite_patches/translate-disable-fetching-of-languages-from-server.patch +++ b/build/cromite_patches/translate-disable-fetching-of-languages-from-server.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc --- a/components/translate/core/browser/translate_language_list.cc +++ b/components/translate/core/browser/translate_language_list.cc -@@ -242,6 +242,7 @@ GURL TranslateLanguageList::TranslateLanguageUrl() { +@@ -392,6 +392,7 @@ GURL TranslateLanguageList::TranslateLanguageUrl() { } void TranslateLanguageList::RequestLanguageList() { @@ -18,7 +18,7 @@ diff --git a/components/translate/core/browser/translate_language_list.cc b/comp // If resource requests are not allowed, we'll get a callback when they are. if (!resource_requests_allowed_) { request_pending_ = true; -@@ -271,6 +272,7 @@ void TranslateLanguageList::RequestLanguageList() { +@@ -421,6 +422,7 @@ void TranslateLanguageList::RequestLanguageList() { if (!result) NotifyEvent(__LINE__, "Request is omitted due to retry limit"); } @@ -27,4 +27,3 @@ diff --git a/components/translate/core/browser/translate_language_list.cc b/comp void TranslateLanguageList::SetResourceRequestsAllowed(bool allowed) { -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-Gaia.patch b/build/cromite_patches/ungoogled-chromium-Disable-Gaia.patch similarity index 90% rename from build/bromite_patches/ungoogled-chromium-Disable-Gaia.patch rename to build/cromite_patches/ungoogled-chromium-Disable-Gaia.patch index e923a088a382bdac8aba6cda7a16c2ff0414519f..0497ba7b23c53f07c0f687699859440f39632350 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-Gaia.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-Gaia.patch @@ -24,7 +24,7 @@ diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_ constexpr char kBadAuthenticationError[] = "BadAuthentication"; constexpr char kBadAuthenticationShortError[] = "badauth"; -@@ -260,6 +260,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( +@@ -264,6 +264,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( const net::NetworkTrafficAnnotationTag& traffic_annotation) { DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; @@ -32,7 +32,7 @@ diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_ auto resource_request = std::make_unique(); resource_request->url = gaia_gurl; original_url_ = gaia_gurl; -@@ -314,6 +315,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( +@@ -318,6 +319,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete, base::Unretained(this)), kMaxMessageSize); @@ -41,4 +41,3 @@ diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_ // static -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch b/build/cromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch similarity index 93% rename from build/bromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch rename to build/cromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch index fb3834b77df6a0363036dce9ce676f6c3ecd6fcb..de42ad055d55f43d814f7badbb434915243cb0ae 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-Network-Time-Tracker.patch @@ -15,7 +15,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/components/network_time/network_time_tracker.cc b/components/network_time/network_time_tracker.cc --- a/components/network_time/network_time_tracker.cc +++ b/components/network_time/network_time_tracker.cc -@@ -289,7 +289,7 @@ void NetworkTimeTracker::UpdateNetworkTime(base::Time network_time, +@@ -294,7 +294,7 @@ void NetworkTimeTracker::UpdateNetworkTime(base::Time network_time, } bool NetworkTimeTracker::AreTimeFetchesEnabled() const { @@ -25,4 +25,3 @@ diff --git a/components/network_time/network_time_tracker.cc b/components/networ NetworkTimeTracker::FetchBehavior NetworkTimeTracker::GetFetchBehavior() const { -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-intranet-detector.patch b/build/cromite_patches/ungoogled-chromium-Disable-intranet-detector.patch similarity index 99% rename from build/bromite_patches/ungoogled-chromium-Disable-intranet-detector.patch rename to build/cromite_patches/ungoogled-chromium-Disable-intranet-detector.patch index 95bb81b0564c9645d48b20ac6059b120ad5ad036..8aa3504cfec0e6cc8345ba46924f0b56afbcc35c 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-intranet-detector.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-intranet-detector.patch @@ -26,4 +26,3 @@ diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intra DCHECK(simple_loaders_.empty() && resulting_origins_.empty()); -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-profile-avatar.patch b/build/cromite_patches/ungoogled-chromium-Disable-profile-avatar.patch similarity index 92% rename from build/bromite_patches/ungoogled-chromium-Disable-profile-avatar.patch rename to build/cromite_patches/ungoogled-chromium-Disable-profile-avatar.patch index 4ac0e14c1238c7270890e24c4e57efa385ff7b22..640c65e2d6c078644f97307930da752ddb9b0020 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-profile-avatar.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-profile-avatar.patch @@ -14,7 +14,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -1463,8 +1463,6 @@ static_library("browser") { +@@ -1425,8 +1425,6 @@ static_library("browser") { "profiles/profile_attributes_storage.cc", "profiles/profile_attributes_storage.h", "profiles/profile_attributes_storage_observer.h", @@ -26,7 +26,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc --- a/chrome/browser/profiles/profile_attributes_entry.cc +++ b/chrome/browser/profiles/profile_attributes_entry.cc -@@ -329,12 +329,6 @@ std::u16string ProfileAttributesEntry::GetUserName() const { +@@ -323,12 +323,6 @@ std::u16string ProfileAttributesEntry::GetUserName() const { gfx::Image ProfileAttributesEntry::GetAvatarIcon( int size_for_placeholder_avatar, bool use_high_res_file) const { @@ -42,7 +42,7 @@ diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browse diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc --- a/chrome/browser/profiles/profile_attributes_storage.cc +++ b/chrome/browser/profiles/profile_attributes_storage.cc -@@ -998,7 +998,7 @@ void ProfileAttributesStorage::DownloadHighResAvatarIfNeeded( +@@ -984,7 +984,7 @@ void ProfileAttributesStorage::DownloadHighResAvatarIfNeeded( void ProfileAttributesStorage::DownloadHighResAvatar( size_t icon_index, const base::FilePath& profile_path) { @@ -52,4 +52,3 @@ diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/brow profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index); DCHECK(file_name); -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-translate-integration.patch b/build/cromite_patches/ungoogled-chromium-Disable-translate-integration.patch similarity index 80% rename from build/bromite_patches/ungoogled-chromium-Disable-translate-integration.patch rename to build/cromite_patches/ungoogled-chromium-Disable-translate-integration.patch index 61363478a73b2bb1c311ef4e2eec358b1bec459a..3320db9587072fdab4cb14a0343949ae3e56af9d 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-translate-integration.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-translate-integration.patch @@ -6,13 +6,13 @@ Remove translate offer License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../xml/languages_detailed_preferences.xml | 43 ------------------ - .../java/res/xml/languages_preferences.xml | 5 --- - .../language/settings/LanguageSettings.java | 44 +------------------ + .../xml/languages_detailed_preferences.xml | 43 ----------------- + .../java/res/xml/languages_preferences.xml | 5 -- + .../language/settings/LanguageSettings.java | 47 +------------------ .../strings/android_chrome_strings.grd | 3 -- - .../core/browser/translate_manager.cc | 5 ++- - .../core/browser/translate_script.cc | 19 +++----- - 6 files changed, 11 insertions(+), 108 deletions(-) + .../core/browser/translate_manager.cc | 5 +- + .../core/browser/translate_script.cc | 17 ++----- + 6 files changed, 10 insertions(+), 110 deletions(-) diff --git a/chrome/browser/language/android/java/res/xml/languages_detailed_preferences.xml b/chrome/browser/language/android/java/res/xml/languages_detailed_preferences.xml --- a/chrome/browser/language/android/java/res/xml/languages_detailed_preferences.xml @@ -94,7 +94,7 @@ diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browse private static final String TAG = "LanguageSettings"; -@@ -97,32 +91,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment +@@ -95,35 +89,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment ContentLanguagesPreference mLanguageListPref = (ContentLanguagesPreference) findPreference(PREFERRED_LANGUAGES_KEY); mLanguageListPref.initialize(this, getPrefService()); @@ -104,30 +104,33 @@ diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browse - boolean isTranslateEnabled = getPrefService().getBoolean(Pref.OFFER_TRANSLATE_ENABLED); - translateSwitch.setChecked(isTranslateEnabled); - -- translateSwitch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { -- @Override -- public boolean onPreferenceChange(Preference preference, Object newValue) { -- boolean enabled = (boolean) newValue; -- getPrefService().setBoolean(Pref.OFFER_TRANSLATE_ENABLED, enabled); -- mLanguageListPref.notifyPrefChanged(); -- LanguagesManager.recordAction(enabled ? LanguagesManager.LanguageSettingsActionType -- .ENABLE_TRANSLATE_GLOBALLY -- : LanguagesManager.LanguageSettingsActionType -- .DISABLE_TRANSLATE_GLOBALLY); -- return true; -- } -- }); -- translateSwitch.setManagedPreferenceDelegate(new ChromeManagedPreferenceDelegate( -- getProfile()) { -- @Override -- public boolean isPreferenceControlledByPolicy(Preference preference) { -- return getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED); -- } -- }); +- translateSwitch.setOnPreferenceChangeListener( +- new Preference.OnPreferenceChangeListener() { +- @Override +- public boolean onPreferenceChange(Preference preference, Object newValue) { +- boolean enabled = (boolean) newValue; +- getPrefService().setBoolean(Pref.OFFER_TRANSLATE_ENABLED, enabled); +- mLanguageListPref.notifyPrefChanged(); +- LanguagesManager.recordAction( +- enabled +- ? LanguagesManager.LanguageSettingsActionType +- .ENABLE_TRANSLATE_GLOBALLY +- : LanguagesManager.LanguageSettingsActionType +- .DISABLE_TRANSLATE_GLOBALLY); +- return true; +- } +- }); +- translateSwitch.setManagedPreferenceDelegate( +- new ChromeManagedPreferenceDelegate(getProfile()) { +- @Override +- public boolean isPreferenceControlledByPolicy(Preference preference) { +- return getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED); +- } +- }); } /** -@@ -137,8 +105,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment +@@ -138,8 +103,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment ContentLanguagesPreference mLanguageListPref = (ContentLanguagesPreference) findPreference(CONTENT_LANGUAGES_KEY); mLanguageListPref.initialize(this, getPrefService()); @@ -135,8 +138,8 @@ diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browse - setupTranslateSection(mLanguageListPref); } - /** -@@ -168,7 +134,7 @@ public class LanguageSettings extends ChromeBaseSettingsFragment + /** Setup the App Language section with a title and preference to choose the app language. */ +@@ -169,7 +132,7 @@ public class LanguageSettings extends ChromeBaseSettingsFragment * @param contentLanguagesPreference ContentLanguagesPreference reference to update about state * changes. */ @@ -145,16 +148,16 @@ diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browse // Setup expandable advanced settings section. PreferenceCategory translationAdvancedSection = (PreferenceCategory) findPreference(TRANSLATION_ADVANCED_SECTION); -@@ -237,7 +203,7 @@ public class LanguageSettings extends ChromeBaseSettingsFragment - return getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED); - } - }); +@@ -245,7 +208,7 @@ public class LanguageSettings extends ChromeBaseSettingsFragment + return getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED); + } + }); - } + } */ @Override public void onStart() { -@@ -275,12 +241,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment +@@ -284,12 +247,6 @@ public class LanguageSettings extends ChromeBaseSettingsFragment // Set the default target language to match the new app language. TranslateBridge.setDefaultTargetLanguage(code); } else if (requestCode == REQUEST_CODE_CHANGE_TARGET_LANGUAGE) { @@ -170,7 +173,7 @@ diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browse 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 -@@ -1930,9 +1930,6 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1726,9 +1726,6 @@ Your Google account may have other forms of browsing history like searches and a Websites will show text in your preferred language, when possible. @@ -183,7 +186,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc --- a/components/translate/core/browser/translate_manager.cc +++ b/components/translate/core/browser/translate_manager.cc -@@ -832,8 +832,9 @@ void TranslateManager::FilterIsTranslatePossible( +@@ -834,8 +834,9 @@ void TranslateManager::FilterIsTranslatePossible( TriggerDecision::kDisabledOffline); } @@ -198,7 +201,7 @@ diff --git a/components/translate/core/browser/translate_manager.cc b/components diff --git a/components/translate/core/browser/translate_script.cc b/components/translate/core/browser/translate_script.cc --- a/components/translate/core/browser/translate_script.cc +++ b/components/translate/core/browser/translate_script.cc -@@ -125,19 +125,12 @@ void TranslateScript::OnScriptFetchComplete(bool success, +@@ -127,20 +127,13 @@ void TranslateScript::OnScriptFetchComplete(bool success, data_ = base::StringPrintf("var translateApiKey = '%s';\n", google_apis::GetAPIKey().c_str()); @@ -208,21 +211,20 @@ diff --git a/components/translate/core/browser/translate_script.cc b/components/ - std::map params; - base::StringAppendF( - &data_, "var gtTimeInfo = {'fetchStart': %0.f, 'fetchEnd': %0.f};\n", -- script_fetch_start_time_, base::Time::Now().ToJsTime()); +- script_fetch_start_time_, ++ base::StringAppendF(&data_, "var serverParams = '';\n"); ++ base::StringAppendF( ++ &data_, "var gtTimeInfo = {'fetchStart': %0.f, 'fetchEnd': %0.f};\n", ++ script_fetch_start_time_, + base::Time::Now().InMillisecondsFSinceUnixEpoch()); - base::StringAppendF(&data_, "var serverParams = '%s';\n", - server_params.c_str()); -- + - GURL security_origin = translate::GetTranslateSecurityOrigin(); - base::StringAppendF(&data_, "var securityOrigin = '%s';", - security_origin.spec().c_str()); -+ base::StringAppendF(&data_, "var serverParams = '';\n"); -+ base::StringAppendF( -+ &data_, "var gtTimeInfo = {'fetchStart': %0.f, 'fetchEnd': %0.f};\n", -+ script_fetch_start_time_, base::Time::Now().ToJsTime()); -+ + base::StringAppendF(&data_, "var securityOrigin = '';"); // Load embedded translate.js. data_.append(ui::ResourceBundle::GetSharedInstance().LoadDataResourceString( -- -2.25.1 diff --git a/build/bromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch b/build/cromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch similarity index 99% rename from build/bromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch rename to build/cromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch index 7fd0c08e801c0e59743c5dbc79efaa140b82b20c..2ccaef2afe778d485aa1b004f2bd2fed7659550f 100644 --- a/build/bromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch +++ b/build/cromite_patches/ungoogled-chromium-Disable-untraceable-URLs.patch @@ -74,4 +74,3 @@ diff --git a/rlz/lib/lib_values.h b/rlz/lib/lib_values.h extern const int kFinancialPort; -- -2.25.1 diff --git a/build/cromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch b/build/cromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6913c50e28ee2e3fcdd55d5db8330ee29f09df8 --- /dev/null +++ b/build/cromite_patches/ungoogled-chromium-Disable-webRTC-log-uploader.patch @@ -0,0 +1,22 @@ +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Mon, 12 Feb 2018 21:21:36 +0100 +Subject: ungoogled-chromium: Disable webRTC log uploader + +License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html +--- + chrome/browser/ui/browser_ui_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc +--- a/chrome/browser/ui/browser_ui_prefs.cc ++++ b/chrome/browser/ui/browser_ui_prefs.cc +@@ -98,7 +98,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string()); + registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false); + registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls); +- registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, true); ++ registry->RegisterBooleanPref(prefs::kWebRtcTextLogCollectionAllowed, false); + + // Dictionaries to keep track of default tasks in the file browser. + registry->RegisterDictionaryPref( +-- diff --git a/build/bromite_patches/ungoogled-chromium-no-special-hosts-domains.patch b/build/cromite_patches/ungoogled-chromium-no-special-hosts-domains.patch similarity index 95% rename from build/bromite_patches/ungoogled-chromium-no-special-hosts-domains.patch rename to build/cromite_patches/ungoogled-chromium-no-special-hosts-domains.patch index 0d85c7a8a721c0d646884cd275eef7e661659d6e..2f47b29faeb2036de46de30ccf080bb7388f9b7f 100644 --- a/build/bromite_patches/ungoogled-chromium-no-special-hosts-domains.patch +++ b/build/cromite_patches/ungoogled-chromium-no-special-hosts-domains.patch @@ -11,7 +11,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../android/metrics/uma_session_stats.cc | 10 - .../android/signin/signin_manager_android.cc | 27 +- chrome/browser/browser_process_impl.cc | 1 - - chrome/browser/chrome_browser_main.cc | 8 - + chrome/browser/chrome_browser_main.cc | 10 - .../browser/chrome_content_browser_client.cc | 35 +- .../domain_reliability/service_factory.cc | 33 +- chrome/browser/extensions/BUILD.gn | 1 - @@ -21,7 +21,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../long_screenshots_tab_service.cc | 22 -- .../metrics/chrome_metrics_service_client.cc | 2 +- .../chrome_metrics_services_manager_client.cc | 5 +- - .../metrics/metrics_reporting_state.cc | 78 +---- + .../metrics/metrics_reporting_state.cc | 72 +--- .../net/system_network_context_manager.cc | 1 - .../modules/recipes/recipes_service.cc | 3 +- .../one_google_bar_loader_impl.cc | 3 +- @@ -57,16 +57,16 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/url_matcher/url_util.cc | 83 ----- ...gled-chromium-no-special-hosts-domains.inc | 1 + ...gled-chromium-no-special-hosts-domains.inc | 1 + - net/base/url_util.cc | 21 -- + net/base/url_util.cc | 25 +- services/network/network_context.cc | 2 +- - 52 files changed, 57 insertions(+), 800 deletions(-) + 52 files changed, 58 insertions(+), 799 deletions(-) create mode 100644 cromite_flags/content/common/features_cc/ungoogled-chromium-no-special-hosts-domains.inc create mode 100644 cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -1039,10 +1039,6 @@ static_library("browser") { +@@ -992,10 +992,6 @@ static_library("browser") { "page_load_metrics/observers/foreground_duration_ukm_observer.h", "page_load_metrics/observers/formfill_page_load_metrics_observer.cc", "page_load_metrics/observers/formfill_page_load_metrics_observer.h", @@ -77,23 +77,23 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "page_load_metrics/observers/histogram_suffixes.cc", "page_load_metrics/observers/histogram_suffixes.h", "page_load_metrics/observers/https_engagement_metrics/https_engagement_page_load_metrics_observer.cc", -@@ -1989,7 +1985,6 @@ static_library("browser") { +@@ -1960,7 +1956,6 @@ static_library("browser") { "//chrome/browser/autofill", "//chrome/browser/devtools", "//chrome/browser/favicon", - "//chrome/browser/google", - "//chrome/browser/profiling_host", - # TODO(crbug.com/1335199): break this dep when favicon is in its own target -@@ -2013,7 +2008,6 @@ static_library("browser") { + # Circular dependency due to SystemNetworkContextManager. + "//chrome/browser/image_fetcher", +@@ -1987,7 +1982,6 @@ static_library("browser") { public_deps = [ "//base", - "//chrome/browser/google", "//chrome/browser/headless", + "//chrome/browser/profiles", "//chrome/common", - "//chrome/common:buildflags", -@@ -7789,8 +7783,6 @@ static_library("browser") { +@@ -7839,8 +7833,6 @@ static_library("browser") { "supervised_user/kids_chrome_management/kids_chrome_management_client_factory.h", "supervised_user/supervised_user_browser_utils.cc", "supervised_user/supervised_user_browser_utils.h", @@ -105,7 +105,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc --- a/chrome/browser/android/metrics/uma_session_stats.cc +++ b/chrome/browser/android/metrics/uma_session_stats.cc -@@ -256,16 +256,6 @@ static void JNI_UmaSessionStats_ChangeMetricsReportingConsent( +@@ -257,16 +257,6 @@ static void JNI_UmaSessionStats_ChangeMetricsReportingConsent( jint called_from) { UpdateMetricsPrefsOnPermissionChange( consent, static_cast(called_from)); @@ -162,7 +162,7 @@ diff --git a/chrome/browser/android/signin/signin_manager_android.cc b/chrome/br 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 -@@ -1121,7 +1121,6 @@ BrowserProcessImpl::component_updater() { +@@ -1129,7 +1129,6 @@ BrowserProcessImpl::component_updater() { std::make_unique(); std::string brand; @@ -173,24 +173,26 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc -@@ -515,10 +515,6 @@ void ProcessSingletonNotificationCallbackImpl( +@@ -529,11 +529,6 @@ void ProcessSingletonNotificationCallbackImpl( StartupBrowserCreator::ProcessCommandLineAlreadyRunning( command_line, current_directory, startup_profile_path_info); - - // Record now as the last successful chrome start. -- if (ShouldRecordActiveUse(command_line)) +- if constexpr (kShouldRecordActiveUse) { - GoogleUpdateSettings::SetLastRunTime(); +- } } #endif // BUILDFLAG(ENABLE_PROCESS_SINGLETON) -@@ -1791,10 +1787,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1773,11 +1768,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { upgrade_util::SaveLastModifiedTimeOfExe(); #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) - // Record now as the last successful chrome start. -- if (ShouldRecordActiveUse(*base::CommandLine::ForCurrentProcess())) +- if constexpr (kShouldRecordActiveUse) { - GoogleUpdateSettings::SetLastRunTime(); +- } - // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -198,7 +200,7 @@ diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_brows diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -2916,7 +2916,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( +@@ -2860,7 +2860,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( switches::kForcePNaClSubzero, #endif switches::kForceUIDirection, @@ -206,7 +208,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch switches::kJavaScriptHarmony, switches::kEnableExperimentalWebAssemblyFeatures, embedder_support::kOriginTrialDisabledFeatures, -@@ -5131,12 +5130,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( +@@ -5132,12 +5131,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation( } #endif @@ -219,7 +221,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch if (auto* throttle_manager = subresource_filter::ContentSubresourceFilterThrottleManager:: FromNavigationHandle(*handle)) { -@@ -5662,7 +5655,8 @@ GetClientDataHeader(int frame_tree_node_id) { +@@ -5678,7 +5671,8 @@ GetClientDataHeader(int frame_tree_node_id) { } #endif @@ -229,8 +231,8 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch #if BUILDFLAG(IS_ANDROID) const std::string& client_data_header, #endif -@@ -5701,7 +5695,7 @@ std::unique_ptr CreateGoogleURLLoaderThrottle( - std::move(bound_session_request_throttled_listener), +@@ -5717,7 +5711,7 @@ std::unique_ptr CreateGoogleURLLoaderThrottle( + std::move(bound_session_request_throttled_handler), #endif std::move(dynamic_params)); -} @@ -238,7 +240,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch std::vector> ChromeContentBrowserClient::CreateURLLoaderThrottles( -@@ -5747,15 +5741,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles( +@@ -5763,15 +5757,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles( GetClientDataHeader(frame_tree_node_id); #endif @@ -254,7 +256,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch { auto* factory = ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context); -@@ -5809,20 +5794,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive( +@@ -5825,20 +5810,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive( } #endif @@ -324,7 +326,7 @@ diff --git a/chrome/browser/domain_reliability/service_factory.cc b/chrome/brows diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn -@@ -822,7 +822,6 @@ static_library("extensions") { +@@ -801,7 +801,6 @@ static_library("extensions") { "//chrome/browser/devtools", "//chrome/browser/extensions:cws_item_service_proto", "//chrome/browser/favicon", @@ -335,7 +337,7 @@ diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUIL diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc --- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -@@ -119,7 +119,6 @@ constexpr char kOsVersionTag[] = "OS VERSION"; +@@ -122,7 +122,6 @@ constexpr char kOsVersionTag[] = "OS VERSION"; #if BUILDFLAG(IS_WIN) constexpr char kUsbKeyboardDetected[] = "usb_keyboard_detected"; constexpr char kIsEnrolledToDomain[] = "enrolled_to_domain"; @@ -343,7 +345,7 @@ diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log #if BUILDFLAG(GOOGLE_CHROME_BRANDING) constexpr char kUpdateErrorCode[] = "update_error_code"; constexpr char kUpdateHresult[] = "update_hresult"; -@@ -622,10 +621,6 @@ void ChromeInternalLogSource::PopulateEnrolledToDomain( +@@ -631,10 +630,6 @@ void ChromeInternalLogSource::PopulateEnrolledToDomain( void ChromeInternalLogSource::PopulateInstallerBrandCode( SystemLogsResponse* response) { @@ -441,7 +443,7 @@ diff --git a/chrome/browser/long_screenshots/long_screenshots_tab_service.cc b/c diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc -@@ -629,7 +629,7 @@ ChromeMetricsServiceClient::GetNetworkTimeTracker() { +@@ -620,7 +620,7 @@ ChromeMetricsServiceClient::GetNetworkTimeTracker() { } bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { @@ -453,7 +455,7 @@ diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/br diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc --- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc +++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc -@@ -103,9 +103,6 @@ void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { +@@ -101,9 +101,6 @@ void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { // This must happen on the same sequence as the tasks to enable/disable // metrics reporting. Otherwise, this may run while disabling metrics // reporting if the user quickly enables and disables metrics reporting. @@ -475,7 +477,7 @@ diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/ diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/metrics/metrics_reporting_state.cc --- a/chrome/browser/metrics/metrics_reporting_state.cc +++ b/chrome/browser/metrics/metrics_reporting_state.cc -@@ -34,71 +34,6 @@ +@@ -33,65 +33,6 @@ #include "components/policy/core/common/features.h" #endif // BUILDFLAG(IS_ANDROID) @@ -521,12 +523,6 @@ diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/ - g_browser_process->local_state()->SetBoolean( - metrics::prefs::kMetricsReportingEnabled, updated_pref); - --#if BUILDFLAG(IS_CHROMEOS_ASH) -- metrics::structured::NeutrinoDevicesLogWithClientId( -- g_browser_process->local_state()->GetString( -- metrics::prefs::kMetricsClientID), -- metrics::structured::NeutrinoDevicesLocation::kSetMetricsReporting); --#endif // BUILDFLAG(IS_CHROMEOS_ASH) - UpdateMetricsPrefsOnPermissionChange(updated_pref, called_from); - - // Uses the current state of whether reporting is enabled to enable services. @@ -547,10 +543,10 @@ diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/ void ChangeMetricsReportingState( bool enabled, ChangeMetricsReportingStateCalledFrom called_from) { -@@ -139,11 +74,6 @@ void ChangeMetricsReportingStateWithReply( - metrics::structured::NeutrinoDevicesLocation:: - kChangeMetricsReportingStateWithReply); - #endif // BUILDFLAG(IS_CHROMEOS_ASH) +@@ -125,11 +66,6 @@ void ChangeMetricsReportingStateWithReply( + return; + } + #endif - GoogleUpdateSettings::CollectStatsConsentTaskRunner() - ->PostTaskAndReplyWithResult( - FROM_HERE, base::BindOnce(&SetGoogleUpdateSettings, enabled), @@ -559,7 +555,7 @@ diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/ } void UpdateMetricsPrefsOnPermissionChange( -@@ -215,13 +145,7 @@ void UpdateMetricsPrefsOnPermissionChange( +@@ -195,13 +131,7 @@ void UpdateMetricsPrefsOnPermissionChange( crash_keys::ClearMetricsClientId(); } @@ -577,7 +573,7 @@ diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/ 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 -@@ -819,7 +819,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams( +@@ -816,7 +816,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams( void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams( network::mojom::NetworkContextParams* network_context_params) { variations::UpdateCorsExemptHeaderForVariations(network_context_params); @@ -588,7 +584,7 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/brows diff --git a/chrome/browser/new_tab_page/modules/recipes/recipes_service.cc b/chrome/browser/new_tab_page/modules/recipes/recipes_service.cc --- a/chrome/browser/new_tab_page/modules/recipes/recipes_service.cc +++ b/chrome/browser/new_tab_page/modules/recipes/recipes_service.cc -@@ -52,9 +52,10 @@ const char* GetExperimentGroupParam() { +@@ -53,9 +53,10 @@ const char* GetExperimentGroupParam() { } GURL GetApiUrl(const std::string& application_locale) { @@ -658,7 +654,7 @@ diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metri diff --git a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc --- a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc -@@ -124,8 +124,6 @@ void PageLoadMetricsEmbedder::RegisterEmbedderObservers( +@@ -125,8 +125,6 @@ void PageLoadMetricsEmbedder::RegisterEmbedderObservers( tracker->AddObserver(std::make_unique()); tracker->AddObserver(std::make_unique()); tracker->AddObserver(std::make_unique()); @@ -701,12 +697,12 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn "//chrome/browser/favicon", - "//chrome/browser/google", "//chrome/browser/image_decoder", + "//chrome/browser/image_fetcher", "//chrome/browser/media:mojo_bindings", - "//chrome/browser/media/router:media_router_feature", diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc -@@ -621,11 +621,6 @@ content::WebUIDataSource* CreateAndAddNewTabPageUiHtmlSource(Profile* profile) { +@@ -634,11 +634,6 @@ content::WebUIDataSource* CreateAndAddNewTabPageUiHtmlSource(Profile* profile) { // chrome-untrusted://new-tab-page for other external content and resources. // NOTE: Use caution when overriding content security policies as that cean // lead to subtle security bugs such as https://crbug.com/1251541. @@ -721,7 +717,7 @@ diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc b/chrome/br diff --git a/chrome/browser/ui/webui/settings/reset_settings_handler.cc b/chrome/browser/ui/webui/settings/reset_settings_handler.cc --- a/chrome/browser/ui/webui/settings/reset_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/reset_settings_handler.cc -@@ -87,7 +87,6 @@ bool ResetSettingsHandler::ShouldShowResetProfileBanner(Profile* profile) { +@@ -81,7 +81,6 @@ bool ResetSettingsHandler::ShouldShowResetProfileBanner(Profile* profile) { ResetSettingsHandler::ResetSettingsHandler(Profile* profile) : profile_(profile) { @@ -732,7 +728,7 @@ diff --git a/chrome/browser/ui/webui/settings/reset_settings_handler.cc b/chrome diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc --- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc -@@ -207,7 +207,7 @@ void UpgradeDetectorImpl::StartOutdatedBuildDetector() { +@@ -215,7 +215,7 @@ void UpgradeDetectorImpl::StartOutdatedBuildDetector() { // an outdated build is being simulated by command line switches. if (!simulating_outdated_) { std::string brand; @@ -744,7 +740,7 @@ diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/b diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -142,8 +142,6 @@ static_library("common_lib") { +@@ -138,8 +138,6 @@ static_library("common_lib") { "content_restriction.h", "crash_keys.cc", "crash_keys.h", @@ -767,7 +763,7 @@ diff --git a/chrome/renderer/google_accounts_private_api_util.cc b/chrome/render diff --git a/chrome/renderer/url_loader_throttle_provider_impl.cc b/chrome/renderer/url_loader_throttle_provider_impl.cc --- a/chrome/renderer/url_loader_throttle_provider_impl.cc +++ b/chrome/renderer/url_loader_throttle_provider_impl.cc -@@ -219,17 +219,6 @@ URLLoaderThrottleProviderImpl::CreateThrottles( +@@ -220,17 +220,6 @@ URLLoaderThrottleProviderImpl::CreateThrottles( } #endif @@ -777,7 +773,7 @@ diff --git a/chrome/renderer/url_loader_throttle_provider_impl.cc b/chrome/rende -#endif -#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) - chrome_content_renderer_client_->GetChromeObserver() -- ->CreateBoundSessionRequestThrottledListener(), +- ->CreateBoundSessionRequestThrottledHandler(), -#endif - chrome_content_renderer_client_->GetChromeObserver() - ->GetDynamicParams())); @@ -788,14 +784,14 @@ diff --git a/chrome/renderer/url_loader_throttle_provider_impl.cc b/chrome/rende diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6506,7 +6506,6 @@ test("unit_tests") { +@@ -6738,7 +6738,6 @@ test("unit_tests") { "//chrome/browser/favicon", "//chrome/browser/feature_guide/notifications:unit_tests", "//chrome/browser/first_party_sets", - "//chrome/browser/google:unit_tests", + "//chrome/browser/media/prefs", + "//chrome/browser/media/prefs:unit_tests", "//chrome/browser/media/router", - "//chrome/browser/media/router:media_router_feature", - "//chrome/browser/media/router:unittests", diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn --- a/components/domain_reliability/BUILD.gn +++ b/components/domain_reliability/BUILD.gn @@ -930,7 +926,7 @@ diff --git a/components/domain_reliability/google_configs.h b/components/domain_ diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc --- a/components/domain_reliability/monitor.cc +++ b/components/domain_reliability/monitor.cc -@@ -94,14 +94,6 @@ void DomainReliabilityMonitor::Shutdown() { +@@ -95,14 +95,6 @@ void DomainReliabilityMonitor::Shutdown() { } void DomainReliabilityMonitor::AddBakedInConfigs() { @@ -1367,7 +1363,7 @@ diff --git a/components/google/core/common/google_util.h b/components/google/cor diff --git a/components/page_load_metrics/browser/page_load_metrics_util.cc b/components/page_load_metrics/browser/page_load_metrics_util.cc --- a/components/page_load_metrics/browser/page_load_metrics_util.cc +++ b/components/page_load_metrics/browser/page_load_metrics_util.cc -@@ -281,9 +281,7 @@ bool DidObserveLoadingBehaviorInAnyFrame( +@@ -283,9 +283,7 @@ bool DidObserveLoadingBehaviorInAnyFrame( } bool IsGoogleSearchHostname(const GURL& url) { @@ -1456,7 +1452,7 @@ diff --git a/components/search_engines/search_terms_data.cc b/components/search_ diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc -@@ -561,11 +561,7 @@ std::u16string TemplateURLRef::SearchTermToString16( +@@ -562,11 +562,7 @@ std::u16string TemplateURLRef::SearchTermToString16( bool TemplateURLRef::HasGoogleBaseURLs( const SearchTermsData& search_terms_data) const { ParseIfNecessary(search_terms_data); @@ -1646,10 +1642,10 @@ new file mode 100644 diff --git a/net/base/url_util.cc b/net/base/url_util.cc --- a/net/base/url_util.cc +++ b/net/base/url_util.cc -@@ -489,27 +489,6 @@ bool HasGoogleHost(const GURL& url) { +@@ -491,34 +491,11 @@ bool HasGoogleHost(const GURL& url) { } - bool IsGoogleHost(base::StringPiece host) { + bool IsGoogleHost(std::string_view host) { - static const char* kGoogleHostSuffixes[] = { - ".google.com", - ".youtube.com", @@ -1668,16 +1664,24 @@ diff --git a/net/base/url_util.cc b/net/base/url_util.cc - // Here it's possible to get away with faster case-sensitive comparisons - // because the list above is all lowercase, and a GURL's host name will - // always be canonicalized to lowercase as well. -- if (base::EndsWith(host, suffix)) +- if (host.ends_with(suffix)) { - return true; +- } - } return false; } + bool IsGoogleHostWithAlpnH3(std::string_view host) { +- return base::EqualsCaseInsensitiveASCII(host, "google.com") || +- base::EqualsCaseInsensitiveASCII(host, "www.google.com"); ++ return false; + } + + bool IsLocalHostname(std::string_view host) { diff --git a/services/network/network_context.cc b/services/network/network_context.cc --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -2846,7 +2846,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2847,7 +2847,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( } #endif // BUILDFLAG(IS_CT_SUPPORTED) @@ -1687,4 +1691,3 @@ diff --git a/services/network/network_context.cc b/services/network/network_cont std::make_unique( result.url_request_context.get(), -- -2.25.1 diff --git a/build/bromite_patches/updater-disable-updater-pings.patch b/build/cromite_patches/updater-disable-updater-pings.patch similarity index 99% rename from build/bromite_patches/updater-disable-updater-pings.patch rename to build/cromite_patches/updater-disable-updater-pings.patch index f8ae7db4f6068d7e6978092cb93b82a3e05d0836..64a8a59071b2a3703ae3be97afd540281e4134f4 100644 --- a/build/bromite_patches/updater-disable-updater-pings.patch +++ b/build/cromite_patches/updater-disable-updater-pings.patch @@ -62,4 +62,3 @@ diff --git a/components/component_updater/configurator_impl.h b/components/compo const base::TimeDelta initial_delay_; }; -- -2.25.1 diff --git a/build/bromite_patches/webRTC-do-not-expose-local-IP-addresses.patch b/build/cromite_patches/webRTC-do-not-expose-local-IP-addresses.patch similarity index 94% rename from build/bromite_patches/webRTC-do-not-expose-local-IP-addresses.patch rename to build/cromite_patches/webRTC-do-not-expose-local-IP-addresses.patch index 71fced69b69b168ca7d27682599d3a3acd516074..644cb0765f81cdcc3c8831ce0d9a2d5fe8d143ff 100644 --- a/build/bromite_patches/webRTC-do-not-expose-local-IP-addresses.patch +++ b/build/cromite_patches/webRTC-do-not-expose-local-IP-addresses.patch @@ -29,7 +29,7 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u 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 -@@ -113,7 +113,9 @@ WebRTCIPHandlingPolicy GetWebRTCIPHandlingPolicy(const String& preference) { +@@ -112,7 +112,9 @@ WebRTCIPHandlingPolicy GetWebRTCIPHandlingPolicy(const String& preference) { return kDefaultPublicInterfaceOnly; if (preference == kWebRTCIPHandlingDisableNonProxiedUdp) return kDisableNonProxiedUdp; @@ -40,7 +40,7 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_d } bool IsValidPortRange(uint16_t min_port, uint16_t max_port) { -@@ -799,7 +801,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( +@@ -792,7 +794,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( break; } @@ -50,4 +50,3 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_d << ", multiple_routes: " << port_config.enable_multiple_routes << ", nonproxied_udp: " << port_config.enable_nonproxied_udp -- -2.25.1 diff --git a/build/bromite_patches/webview-Hard-no-to-persistent-histograms.patch b/build/cromite_patches/webview-Hard-no-to-persistent-histograms.patch similarity index 95% rename from build/bromite_patches/webview-Hard-no-to-persistent-histograms.patch rename to build/cromite_patches/webview-Hard-no-to-persistent-histograms.patch index 32b96436918bc1f78a331a6561b78a862cecd1ed..0524573e32389ceefe7693cc206a6bbf4beb15b0 100644 --- a/build/bromite_patches/webview-Hard-no-to-persistent-histograms.patch +++ b/build/cromite_patches/webview-Hard-no-to-persistent-histograms.patch @@ -18,7 +18,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/android_webview/browser/aw_field_trials.cc b/android_webview/browser/aw_field_trials.cc --- a/android_webview/browser/aw_field_trials.cc +++ b/android_webview/browser/aw_field_trials.cc -@@ -50,13 +50,6 @@ class AwFeatureOverrides { +@@ -58,13 +58,6 @@ class AwFeatureOverrides { } // namespace void AwFieldTrials::OnVariationsSetupComplete() { @@ -33,4 +33,3 @@ diff --git a/android_webview/browser/aw_field_trials.cc b/android_webview/browse // TODO(crbug.com/1453407): Consider to migrate all WebView feature overrides -- -2.25.1 diff --git a/build/bromite_patches_list.txt b/build/cromite_patches_list.txt similarity index 95% rename from build/bromite_patches_list.txt rename to build/cromite_patches_list.txt index 770f66c57ff60603eb586959152cf58102b1d88a..cc4ae934c95dcc29fd9193a99e786c22101cbe23 100644 --- a/build/bromite_patches_list.txt +++ b/build/cromite_patches_list.txt @@ -1,11 +1,3 @@ -eyeo-beta-118.0.5993.48-base.patch -eyeo-beta-118.0.5993.48-chrome_integration.patch -eyeo-beta-118.0.5993.48-android_api.patch -eyeo-beta-118.0.5993.48-android_settings.patch -eyeo-beta-118.0.5993.48-extension_api.patch -00Eyeo-Adblock-Remove-Privacy-Issues.patch -00AdblockPlus-add-blocking-in-service-workers.patch - bromite-build-utils.patch Remove-EV-certificates.patch do-not-hide-.orig-files.patch @@ -31,7 +23,6 @@ Battery-API-return-nothing.patch updater-disable-updater-pings.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 @@ -77,7 +68,6 @@ profile-resetter-disable-send-settings.patch Do-not-build-API-keys-infobar.patch autofill-miscellaneous.patch Enable-native-Android-autofill.patch -first_run-deactivate-autoupdate-globally.patch translate-disable-fetching-of-languages-from-server.patch Offer-builtin-autocomplete-for-chrome-flags.patch Use-4-tile-rows-never-show-logo.patch @@ -157,7 +147,7 @@ Add-flag-for-save-data-header.patch Disable-UA-full-version.patch Dictionary-suggestions-for-the-Omnibox.patch Disable-AsyncDNS-by-default.patch -00Restore-LastTabStandingTracker.patch +Restore-LastTabStandingTracker.patch Add-lifetime-options-for-permissions.patch Disable-crash-reporting.patch Samsung-Note-9-SDK27-crazylinker-workaround.patch @@ -185,7 +175,7 @@ Disable-StartSurface-feature.patch Enable-PermuteTLSExtensions-by-default.patch Enable-third-party-storage-partitioning.patch Restore-adaptive-button-in-top-toolbar-customization.patch -00Enable-ImprovedBookmarks-by-default.patch +Enable-ImprovedBookmarks-by-default.patch Content-settings-infrastructure.patch Add-autoplay-site-setting.patch Site-setting-for-images.patch @@ -195,5 +185,15 @@ Add-webRTC-site-settings.patch Show-site-settings-for-cookies-javascript-and-ads.patch Timezone-customization.patch AudioBuffer-AnalyserNode-fp-mitigations.patch -00Disable-Feeback-Collector.patch -00Add-cromite-flags-support.patch +Disable-Feeback-Collector.patch +Add-cromite-flags-support.patch +Fix-chromium-build-bugs.patch + +eyeo-beta-118.0.5993.48-base.patch +eyeo-beta-118.0.5993.48-chrome_integration.patch +eyeo-beta-118.0.5993.48-android_api.patch +eyeo-beta-118.0.5993.48-android_settings.patch +eyeo-beta-118.0.5993.48-extension_api.patch +Eyeo-Adblock-Remove-Privacy-Issues.patch +AdblockPlus-add-blocking-in-service-workers.patch +AdblockPlus-connect-popup-blocker.patch diff --git a/build/e_patches/0001-disable-browser-sign-in-feature-by-default.patch b/build/e_patches/0001-disable-browser-sign-in-feature-by-default.patch index 7fbf9ca8f39f2956901c283e8483ee9d1afc364c..9a2d07d3d057a8a507e26cf52a126acb8071ab5c 100644 --- a/build/e_patches/0001-disable-browser-sign-in-feature-by-default.patch +++ b/build/e_patches/0001-disable-browser-sign-in-feature-by-default.patch @@ -1,118 +1,17 @@ -From 31f41366d4f92e432df6268b0220ca10be2817ed Mon Sep 17 00:00:00 2001 -From: fgei -Date: Sun, 29 Aug 2021 19:31:00 +0000 -Subject: [PATCH] disable browser sign in feature by default +From c18bc8deafefe687a706f662866525e93cbf4cc8 Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Mon, 12 Feb 2024 13:26:25 +0530 +Subject: [PATCH 01/48] disable browser sign in feature by default --- - .../android/java/res/xml/main_preferences.xml | 24 ------------------- - .../settings/PasswordSettings.java | 4 ++++ - .../chrome/browser/settings/MainSettings.java | 10 ++------ - .../sync/settings/SignInPreference.java | 1 + - .../account_consistency_mode_manager.cc | 2 +- - 5 files changed, 8 insertions(+), 33 deletions(-) + chrome/browser/signin/account_consistency_mode_manager.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml -index f859a2b0b1846..bb75f9a8e384c 100644 ---- a/chrome/android/java/res/xml/main_preferences.xml -+++ b/chrome/android/java/res/xml/main_preferences.xml -@@ -3,30 +3,6 @@ - xmlns:app="http://schemas.android.com/apk/res-auto" - android:orderingFromXml="false"> - -- -- -- -- -- -- - +Date: Tue, 8 Aug 2023 09:10:36 +0000 +Subject: [PATCH 02/48] Disable adding a signed out avatar on new tab pages by + default + +--- + .../identity_disc/IdentityDiscController.java | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java b/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java +index 9d02df21e3e9f..995755ac47d2c 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java +@@ -59,6 +59,9 @@ public class IdentityDiscController + ProfileDataCache.Observer, + IdentityManager.Observer, + ButtonDataProvider { ++ ++ private static final boolean ALLOW_NTP_AVATAR = false; ++ + // Context is used for fetching resources and launching preferences page. + private final Context mContext; + private ActivityLifecycleDispatcher mActivityLifecycleDispatcher; +@@ -166,6 +169,11 @@ public class IdentityDiscController + return; + } + ++ if (!ALLOW_NTP_AVATAR) { ++ mButtonData.setCanShow(false); ++ return; ++ } ++ + String email = CoreAccountInfo.getEmailFrom(getSignedInAccountInfo()); + ensureProfileDataCache(); + +@@ -342,6 +350,10 @@ public class IdentityDiscController + } + + private String getContentDescription(@Nullable String email) { ++ if (!ALLOW_NTP_AVATAR) { ++ return mContext.getString(R.string.accessibility_toolbar_btn_identity_disc); ++ } ++ + if (email == null) { + return mContext.getString(R.string.accessibility_toolbar_btn_signed_out_identity_disc); + } +-- +2.34.1 + diff --git a/build/e_patches/0003-Hide-Sign-In-preference-when-disallowed.patch b/build/e_patches/0003-Hide-Sign-In-preference-when-disallowed.patch new file mode 100644 index 0000000000000000000000000000000000000000..52b66f69252528bcf2edec8ace7391350451cc5e --- /dev/null +++ b/build/e_patches/0003-Hide-Sign-In-preference-when-disallowed.patch @@ -0,0 +1,24 @@ +From acb68804a93e2b908fc5702974faf8266bcf20ca Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sun, 29 Aug 2021 19:31:00 +0000 +Subject: [PATCH 03/48] Hide Sign In preference when disallowed + +--- + .../chromium/chrome/browser/sync/settings/SignInPreference.java | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java +index 043ab492edd75..6db3510b53b0a 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java +@@ -158,6 +158,7 @@ public class SignInPreference extends Preference + } + + private void setupSigninDisallowed() { ++ setViewEnabled(false); + mWasGenericSigninPromoDisplayed = false; + } + +-- +2.34.1 + diff --git a/build/e_patches/0004-Remove-google-pref-from-main-menu.patch b/build/e_patches/0004-Remove-google-pref-from-main-menu.patch new file mode 100644 index 0000000000000000000000000000000000000000..5889382dcc6dfe3d7b0f6e7cfdffb61c19f5fa05 --- /dev/null +++ b/build/e_patches/0004-Remove-google-pref-from-main-menu.patch @@ -0,0 +1,26 @@ +From fb5411624273d21bafeab40587aa4a38f39fd11e Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Mon, 12 Feb 2024 13:41:11 +0530 +Subject: [PATCH 04/48] Remove google pref from main menu + +--- + .../src/org/chromium/chrome/browser/settings/MainSettings.java | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +index f7f4f891269a8..b4cee944cfb16 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +@@ -237,6 +237,9 @@ public class MainSettings extends ChromeBaseSettingsFragment + templateUrlService.load(); + } + ++ getPreferenceScreen().removePreference(findPreference(PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION)); ++ getPreferenceScreen().removePreference(findPreference(PREF_GOOGLE_SERVICES)); ++ + new AdaptiveToolbarStatePredictor(null) + .recomputeUiState( + uiState -> { +-- +2.34.1 + diff --git a/build/e_patches/0002-disable-contextual-search-by-default.patch b/build/e_patches/0005-disable-contextual-search-by-default.patch similarity index 80% rename from build/e_patches/0002-disable-contextual-search-by-default.patch rename to build/e_patches/0005-disable-contextual-search-by-default.patch index 6b50b730120bf0f5dae8a74af2caf887e79045a6..d29824d8c82de5c8205ecd109d3fd2dae8a9d8e2 100644 --- a/build/e_patches/0002-disable-contextual-search-by-default.patch +++ b/build/e_patches/0005-disable-contextual-search-by-default.patch @@ -1,7 +1,7 @@ -From 2437c143b9f19d301a111fc85c689534cc34be63 Mon Sep 17 00:00:00 2001 +From f3599559391c05b2c251ecd0fe7bb82d1ffd2184 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 23 Nov 2016 09:26:51 -0500 -Subject: [PATCH] disable contextual search by default +Subject: [PATCH 05/48] disable contextual search by default --- .../browser/contextualsearch/ContextualSearchFieldTrial.java | 2 +- @@ -9,10 +9,10 @@ Subject: [PATCH] disable contextual search by default 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java -index 0f481728d8e76..65e7ef9070d88 100644 +index 02f5bcd9fe8f9..154a843f8158e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java -@@ -114,7 +114,7 @@ public class ContextualSearchFieldTrial { +@@ -111,7 +111,7 @@ public class ContextualSearchFieldTrial { // Allow disabling the feature remotely. if (getBooleanParam(DISABLED_PARAM)) return false; @@ -22,10 +22,10 @@ index 0f481728d8e76..65e7ef9070d88 100644 /** diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc -index c85f0f3bca9aa..d4fd34bd1132a 100644 +index 4e0a5f09ac0cf..13879a8374044 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc -@@ -315,7 +315,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { +@@ -319,7 +319,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { #if BUILDFLAG(IS_ANDROID) registry->RegisterStringPref( prefs::kContextualSearchEnabled, diff --git a/build/e_patches/0003-Disable-AGSA-by-default.patch b/build/e_patches/0006-Disable-AGSA-by-default.patch similarity index 72% rename from build/e_patches/0003-Disable-AGSA-by-default.patch rename to build/e_patches/0006-Disable-AGSA-by-default.patch index 5017587298ce13b216d694fb41abf55424274546..d4667d249885550b3c9e96c2330d6d1ba24ab498 100644 --- a/build/e_patches/0003-Disable-AGSA-by-default.patch +++ b/build/e_patches/0006-Disable-AGSA-by-default.patch @@ -1,28 +1,28 @@ -From e19e2df911e9c3ab2e7c969ab6cf637057df7f23 Mon Sep 17 00:00:00 2001 +From 235b07cf7383c02e51ecd4e00871792ece09329f Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sun, 26 Sep 2021 11:17:53 +0200 -Subject: [PATCH] Disable AGSA by default +Subject: [PATCH 06/48] Disable AGSA by default License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/android/BUILD.gn | 2 -- .../org/chromium/chrome/browser/AppHooks.java | 1 - .../chrome/browser/IntentHandler.java | 5 ---- - .../chrome/browser/app/ChromeActivity.java | 27 ------------------- - .../ChromeContextMenuPopulator.java | 7 ----- - ...stomTabActivityClientConnectionKeeper.java | 9 ------- - .../init/ProcessInitializationHandler.java | 8 ------ - .../chrome/browser/share/LensUtils.java | 17 ++---------- + .../chrome/browser/app/ChromeActivity.java | 29 ------------------- + .../ChromeContextMenuPopulator.java | 8 ----- + ...stomTabActivityClientConnectionKeeper.java | 13 --------- + .../init/ProcessInitializationHandler.java | 9 ------ + .../chrome/browser/share/LensUtils.java | 17 ++--------- .../flags/android/chrome_feature_list.cc | 4 +-- .../browser/flags/ChromeFeatureList.java | 2 +- chrome/browser/ui/android/omnibox/BUILD.gn | 2 -- - 11 files changed, 5 insertions(+), 79 deletions(-) + 11 files changed, 5 insertions(+), 87 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index 9dd3012b3425b..4594740d3b6cc 100644 +index 6a81035d932e4..2384bf934f2d3 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -988,7 +988,6 @@ if (current_toolchain == default_toolchain) { +@@ -1004,7 +1004,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/flags:flags_junit_tests", "//chrome/browser/flags:java", "//chrome/browser/fullscreen/android:java", @@ -30,31 +30,31 @@ index 9dd3012b3425b..4594740d3b6cc 100644 "//chrome/browser/history_clusters:java", "//chrome/browser/hub:factory_java", "//chrome/browser/hub:java", -@@ -1596,7 +1595,6 @@ if (current_toolchain == default_toolchain) { +@@ -1628,7 +1627,6 @@ if (current_toolchain == default_toolchain) { "//chrome/browser/first_run/android:java", "//chrome/browser/flags:java", "//chrome/browser/fullscreen/android:java", - "//chrome/browser/gsa:java", "//chrome/browser/history_clusters:java", - "//chrome/browser/image_descriptions:javatests", - "//chrome/browser/incognito:incognito_java_tests", + "//chrome/browser/hub:factory_java", + "//chrome/browser/hub:java", diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -index d52c9a1de8642..50e8fb5e86d7b 100644 +index da0c6ba320fd4..12030d94581c0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -@@ -11,7 +11,6 @@ import org.chromium.base.PackageUtils; +@@ -10,7 +10,6 @@ import org.chromium.base.ContextUtils; + import org.chromium.base.PackageUtils; import org.chromium.base.ResettersForTesting; import org.chromium.chrome.browser.customtabs.CustomTabsConnection; - import org.chromium.chrome.browser.directactions.DirectActionCoordinator; -import org.chromium.chrome.browser.gsa.GSAHelper; import org.chromium.chrome.browser.historyreport.AppIndexingReporter; import org.chromium.chrome.browser.init.ChromeStartupDelegate; import org.chromium.chrome.browser.init.ProcessInitializationHandler; diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java -index 2d72afc45f1a2..ef703f130aca2 100644 +index 0e5b7a1fdc167..f5b676769b45b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java -@@ -38,7 +38,6 @@ import org.chromium.chrome.browser.document.ChromeLauncherActivity; +@@ -39,7 +39,6 @@ import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.externalnav.IntentWithRequestMetadataHandler; import org.chromium.chrome.browser.externalnav.IntentWithRequestMetadataHandler.RequestMetadata; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -62,7 +62,7 @@ index 2d72afc45f1a2..ef703f130aca2 100644 import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteControllerProvider; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.renderer_host.ChromeNavigationUIData; -@@ -264,8 +263,6 @@ public class IntentHandler { +@@ -239,8 +238,6 @@ public class IntentHandler { private static int sReferrerId; private static String sPendingIncognitoUrl; @@ -81,10 +81,10 @@ index 2d72afc45f1a2..ef703f130aca2 100644 return ExternalAppId.CHROME; } else if (packageName.startsWith(WEBAPK_PACKAGE_PREFIX)) { 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 -index 3b6c78ef848fa..919e644702b37 100644 +index c59cb5a07458f..b284d46a2c097 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java -@@ -112,10 +112,6 @@ import org.chromium.chrome.browser.fullscreen.BrowserControlsManager; +@@ -115,10 +115,6 @@ import org.chromium.chrome.browser.fullscreen.BrowserControlsManager; import org.chromium.chrome.browser.fullscreen.BrowserControlsManagerSupplier; import org.chromium.chrome.browser.fullscreen.FullscreenBackPressHandler; import org.chromium.chrome.browser.fullscreen.FullscreenManager; @@ -95,7 +95,7 @@ index 3b6c78ef848fa..919e644702b37 100644 import org.chromium.chrome.browser.history.HistoryManagerUtils; import org.chromium.chrome.browser.init.AsyncInitializationActivity; import org.chromium.chrome.browser.init.ProcessInitializationHandler; -@@ -384,8 +380,6 @@ public abstract class ChromeActivity +@@ -386,8 +382,6 @@ public abstract class ChromeActivity private LaunchCauseMetrics mLaunchCauseMetrics; @@ -104,7 +104,7 @@ index 3b6c78ef848fa..919e644702b37 100644 // TODO(972867): Pull MenuOrKeyboardActionController out of ChromeActivity. private List mMenuActionHandlers = new ArrayList<>(); -@@ -1277,9 +1271,6 @@ public abstract class ChromeActivity +@@ -1406,9 +1400,6 @@ public abstract class ChromeActivity @Override public void onStopWithNative() { @@ -114,36 +114,38 @@ index 3b6c78ef848fa..919e644702b37 100644 if (mSyncStateChangedListener != null) { SyncService syncService = getSyncServiceForOriginalProfile(); if (syncService != null) { -@@ -1367,24 +1358,6 @@ public abstract class ChromeActivity - ChromeActivity.this, Profile.getLastUsedRegularProfile()); - }); +@@ -1505,26 +1496,6 @@ public abstract class ChromeActivity + getProfileProviderSupplier().get().getOriginalProfile()); + }); - // GSA connection is not needed on low-end devices because Icing is disabled. - if (!SysUtils.isLowEndDevice()) { -- DeferredStartupHandler.getInstance().addDeferredTask(() -> { -- if (isActivityFinishingOrDestroyed()) return; -- if (!GSAState.getInstance().isGsaAvailable()) { -- ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE); -- return; -- } +- DeferredStartupHandler.getInstance() +- .addDeferredTask( +- () -> { +- if (isActivityFinishingOrDestroyed() +- || !GSAState.getInstance().isGsaAvailable()) { +- return; +- } - -- if (mGSAAccountChangeListener == null) { -- mGSAAccountChangeListener = -- GSAAccountChangeListener.create(AppHooks.get().createGsaHelper()); -- } -- mGSAAccountChangeListener.connect(); -- createContextReporterIfNeeded(); -- }); +- if (mGSAAccountChangeListener == null) { +- mGSAAccountChangeListener = +- GSAAccountChangeListener.create( +- AppHooks.get().createGsaHelper()); +- } +- mGSAAccountChangeListener.connect(); +- createContextReporterIfNeeded(); +- }); - } - - DeferredStartupHandler.getInstance().addDeferredTask( - () -> { MemoryPurgeManager.getInstance().start(); }); - } + DeferredStartupHandler.getInstance() + .addDeferredTask( + () -> { 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 -index 3680169398ef4..43e280e6e839d 100644 +index 809925b15b3b8..618d844f06f5e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java -@@ -35,7 +35,6 @@ import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator.ListItemTy +@@ -36,7 +36,6 @@ import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator.ListItemTy import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.firstrun.FirstRunStatus; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -151,12 +153,13 @@ index 3680169398ef4..43e280e6e839d 100644 import org.chromium.chrome.browser.lens.LensController; import org.chromium.chrome.browser.lens.LensEntryPoint; import org.chromium.chrome.browser.lens.LensIntentParams; -@@ -818,12 +817,6 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -893,13 +892,6 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { LensMetrics.LensSupportStatus.ACTIVITY_NOT_ACCESSIBLE); return false; } -- if (GSAState.getInstance().isAgsaVersionBelowMinimum( -- versionName, LensUtils.getMinimumAgsaVersionForLensSupport())) { +- if (GSAState.getInstance() +- .isAgsaVersionBelowMinimum( +- versionName, LensUtils.getMinimumAgsaVersionForLensSupport())) { - LensMetrics.recordLensSupportStatus( - LENS_SUPPORT_STATUS_HISTOGRAM_NAME, LensMetrics.LensSupportStatus.OUT_OF_DATE); - return false; @@ -165,7 +168,7 @@ index 3680169398ef4..43e280e6e839d 100644 if (LensUtils.isDeviceOsBelowMinimum()) { LensMetrics.recordLensSupportStatus( diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java -index 8c222555b292c..8eb7340f20761 100644 +index 72f0702465c22..19e1e4ffc455d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityClientConnectionKeeper.java @@ -11,7 +11,6 @@ import org.chromium.base.metrics.RecordHistogram; @@ -176,52 +179,57 @@ index 8c222555b292c..8eb7340f20761 100644 import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.StartStopWithNativeObserver; import org.chromium.chrome.browser.tab.Tab; -@@ -95,13 +94,5 @@ public class CustomTabActivityClientConnectionKeeper implements StartStopWithNat +@@ -100,17 +99,5 @@ public class CustomTabActivityClientConnectionKeeper implements StartStopWithNat } } assert status >= 0; - - if (GSAState.isGsaPackageName(packageName)) { -- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.GSA", -- status, ConnectionStatus.NUM_ENTRIES); +- RecordHistogram.recordEnumeratedHistogram( +- "CustomTabs.ConnectionStatusOnReturn.GSA", +- status, +- ConnectionStatus.NUM_ENTRIES); - } else { -- RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.NonGSA", -- status, ConnectionStatus.NUM_ENTRIES); +- RecordHistogram.recordEnumeratedHistogram( +- "CustomTabs.ConnectionStatusOnReturn.NonGSA", +- status, +- ConnectionStatus.NUM_ENTRIES); - } } } 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 -index 8db4090429b56..f3254a08dde4f 100644 +index 4908795921a87..47d20b0660c18 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java -@@ -386,14 +386,6 @@ public class ProcessInitializationHandler { - } - }); +@@ -412,15 +412,6 @@ public class ProcessInitializationHandler { + } + }); -- deferredStartupHandler.addDeferredTask(new Runnable() { -- @Override -- public void run() { -- // Starts syncing with GSA. -- AppHooks.get().createGsaHelper().startSync(); -- } -- }); +- deferredStartupHandler.addDeferredTask( +- new Runnable() { +- @Override +- public void run() { +- // Starts syncing with GSA. +- AppHooks.get().createGsaHelper().startSync(); +- } +- }); - - deferredStartupHandler.addDeferredTask(new Runnable() { - @Override - public void run() { + deferredStartupHandler.addDeferredTask( + new Runnable() { + @Override diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java -index 6220d80133333..2a90e2b7d49ef 100644 +index 55f548a243b84..063d4ca5c1330 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java -@@ -12,7 +12,6 @@ import org.chromium.base.ResettersForTesting; - import org.chromium.chrome.R; +@@ -11,7 +11,6 @@ import android.text.TextUtils; + import org.chromium.base.ResettersForTesting; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.flags.ChromeFeatureList; -import org.chromium.chrome.browser.gsa.GSAState; import org.chromium.components.externalauth.ExternalAuthUtils; - /** -@@ -61,15 +60,7 @@ public class LensUtils { + /** This class provides utilities for intenting into Google Lens. */ +@@ -52,15 +51,7 @@ public class LensUtils { if (sFakePassableLensEnvironmentForTesting) { return MIN_AGSA_VERSION_NAME_FOR_LENS_POSTCAPTURE; } else { @@ -238,7 +246,7 @@ index 6220d80133333..2a90e2b7d49ef 100644 } } -@@ -121,11 +112,7 @@ public class LensUtils { +@@ -112,11 +103,7 @@ public class LensUtils { * @return Whether the package is valid. */ public static boolean isValidAgsaPackage(final ExternalAuthUtils externalAuthUtils) { @@ -252,11 +260,11 @@ index 6220d80133333..2a90e2b7d49ef 100644 public static boolean isGoogleLensFeatureEnabled(boolean isIncognito) { diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc -index 90bba6d7540ef..93088c1c1ddc6 100644 +index a786a37f4ab1f..717387be134f4 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc -@@ -805,8 +805,8 @@ BASE_FEATURE(kEarlyInitializeStartupMetrics, - BASE_FEATURE(kEmptyStates, "EmptyStates", base::FEATURE_ENABLED_BY_DEFAULT); +@@ -789,8 +789,8 @@ BASE_FEATURE(kEarlyInitializeStartupMetrics, + base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kExperimentsForAgsa, - "ExperimentsForAgsa", @@ -267,23 +275,23 @@ index 90bba6d7540ef..93088c1c1ddc6 100644 BASE_FEATURE(kExploreSites, "ExploreSites", base::FEATURE_DISABLED_BY_DEFAULT); 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 -index cde0cf08868d2..5af946d46d0f1 100644 +index 86c816207c1f4..90a585b20e1b8 100644 --- 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 -@@ -570,7 +570,7 @@ public abstract class ChromeFeatureList { +@@ -589,7 +589,7 @@ public abstract class ChromeFeatureList { + new CachedFlag(DRAW_WEB_EDGE_TO_EDGE, false); public static final CachedFlag sEarlyInitializeStartupMetrics = new CachedFlag(EARLY_INITIALIZE_STARTUP_METRICS, false); - public static final CachedFlag sEmptyStates = new CachedFlag(EMPTY_STATES, true); - public static final CachedFlag sExperimentsForAgsa = new CachedFlag(EXPERIMENTS_FOR_AGSA, true); + public static final CachedFlag sExperimentsForAgsa = new CachedFlag(EXPERIMENTS_FOR_AGSA, false); public static final CachedFlag sFeedLoadingPlaceholder = new CachedFlag(FEED_LOADING_PLACEHOLDER, false); public static final CachedFlag sFriendlierSafeBrowsingSettingsEnhancedProtection = diff --git a/chrome/browser/ui/android/omnibox/BUILD.gn b/chrome/browser/ui/android/omnibox/BUILD.gn -index 5a3b585ab6435..a5fadd374244b 100644 +index b0bd1468bd3d9..de48a56cd9638 100644 --- a/chrome/browser/ui/android/omnibox/BUILD.gn +++ b/chrome/browser/ui/android/omnibox/BUILD.gn -@@ -158,7 +158,6 @@ android_library("java") { +@@ -161,7 +161,6 @@ android_library("java") { "//chrome/browser/device:java", "//chrome/browser/feature_engagement:java", "//chrome/browser/flags:java", @@ -291,9 +299,9 @@ index 5a3b585ab6435..a5fadd374244b 100644 "//chrome/browser/history_clusters:java", "//chrome/browser/language/android:java", "//chrome/browser/lens:java", -@@ -489,7 +488,6 @@ robolectric_library("junit") { - "//chrome/browser/commerce/merchant_viewer/android:java", +@@ -483,7 +482,6 @@ robolectric_library("junit") { "//chrome/browser/device:java", + "//chrome/browser/feature_engagement:java", "//chrome/browser/flags:java", - "//chrome/browser/gsa:java", "//chrome/browser/lens:java", diff --git a/build/e_patches/0004-Update-i18n-zh_CN-support.patch b/build/e_patches/0007-Update-i18n-zh_CN-support.patch similarity index 95% rename from build/e_patches/0004-Update-i18n-zh_CN-support.patch rename to build/e_patches/0007-Update-i18n-zh_CN-support.patch index 3860b216301f4069e918ce3fd78c8c00a72e27fc..3b0fb7de0d923af6fb4cd1451c7309f0a9c3f891 100644 --- a/build/e_patches/0004-Update-i18n-zh_CN-support.patch +++ b/build/e_patches/0007-Update-i18n-zh_CN-support.patch @@ -1,7 +1,7 @@ -From 1332754a5023156c83baf5bb1f7498e446caab1c Mon Sep 17 00:00:00 2001 +From 7c95eb168af243ff41a3ca6135f4c3fd0dcbe76f Mon Sep 17 00:00:00 2001 From: mars Date: Sun, 2 Aug 2020 00:37:49 +0800 -Subject: [PATCH] Update i18n zh_CN support +Subject: [PATCH 07/48] Update i18n zh_CN support License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- @@ -14,10 +14,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 6 files changed, 133 insertions(+), 6 deletions(-) diff --git a/chrome/app/resources/generated_resources_zh-CN.xtb b/chrome/app/resources/generated_resources_zh-CN.xtb -index 639914a48658c..35aecd19f2330 100644 +index cddce23a6feea..78036628ff9d7 100644 --- a/chrome/app/resources/generated_resources_zh-CN.xtb +++ b/chrome/app/resources/generated_resources_zh-CN.xtb -@@ -10308,4 +10308,6 @@ +@@ -10566,4 +10566,6 @@ 网站会在您访问时自动采用此设置。网站通常会传送通知,以便您知悉重大新闻或聊天消息。 您需要开启 Chrome 同步才能使用 Wi-Fi 同步功能。了解详情 检查(&N) @@ -27,11 +27,11 @@ index 639914a48658c..35aecd19f2330 100644 +配置广告拦截和过滤规则地址 + diff --git a/chrome/app/resources/google_chrome_strings_zh-CN.xtb b/chrome/app/resources/google_chrome_strings_zh-CN.xtb -index 2a21b0a88395d..da575b8d2857e 100644 +index 8779cb311b8b0..61618b7da2a86 100644 --- a/chrome/app/resources/google_chrome_strings_zh-CN.xtb +++ b/chrome/app/resources/google_chrome_strings_zh-CN.xtb -@@ -458,4 +458,5 @@ - 开启此设置后,Chrome 会通过限制后台活动和视觉效果(例如流畅滚动和视频帧速率)来节省电池电量。 +@@ -493,4 +493,5 @@ + 更新服务器没有应用的任何哈希数据,因此安装失败。 Google Chrome 是您的默认浏览器 可用于切换 Chrome 个人资料 - @@ -39,10 +39,10 @@ index 2a21b0a88395d..da575b8d2857e 100644 +关于 Bromite + diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb -index 08d71f688c19c..cc74fa277cce0 100644 +index 0651ead3c41d3..24b348a573521 100644 --- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb +++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb -@@ -1657,4 +1657,74 @@ +@@ -1610,4 +1610,74 @@ 个标签页 也从这部车载设备中清除书签、历史记录等信息 动态卡片上的菜单已关闭 @@ -120,10 +120,10 @@ index 08d71f688c19c..cc74fa277cce0 100644 +全选 + diff --git a/components/browser_ui/strings/android/translations/browser_ui_strings_zh-CN.xtb b/components/browser_ui/strings/android/translations/browser_ui_strings_zh-CN.xtb -index 5923b1f97f9ad..2a6cb7a6ed38d 100644 +index 8315b429357d8..9dc640d247ff1 100644 --- a/components/browser_ui/strings/android/translations/browser_ui_strings_zh-CN.xtb +++ b/components/browser_ui/strings/android/translations/browser_ui_strings_zh-CN.xtb -@@ -475,4 +475,28 @@ +@@ -500,4 +500,28 @@ 移除此网站? 您访问的网站可以验证您是真人而非机器人 已存储的数据 @@ -155,10 +155,10 @@ index 5923b1f97f9ad..2a6cb7a6ed38d 100644 +WebRTC + diff --git a/components/strings/components_strings_zh-CN.xtb b/components/strings/components_strings_zh-CN.xtb -index 2f3e913c27412..7a1dcc6125257 100644 +index 53ef407a16ca9..478c378a023c0 100644 --- a/components/strings/components_strings_zh-CN.xtb +++ b/components/strings/components_strings_zh-CN.xtb -@@ -4065,4 +4065,33 @@ +@@ -4182,4 +4182,33 @@ </ul> JIS B1 来自 Google Pay @@ -195,10 +195,10 @@ index 2f3e913c27412..7a1dcc6125257 100644 +JavaScript JIT + diff --git a/ui/android/java/strings/translations/android_ui_strings_zh-CN.xtb b/ui/android/java/strings/translations/android_ui_strings_zh-CN.xtb -index 9892dd5fa77fa..30903c4603b37 100644 +index a7a5bb8d41c6e..eb88a676d443b 100644 --- a/ui/android/java/strings/translations/android_ui_strings_zh-CN.xtb +++ b/ui/android/java/strings/translations/android_ui_strings_zh-CN.xtb -@@ -11,4 +11,5 @@ +@@ -13,4 +13,5 @@ 未能复制到剪贴板 无法选择媒体,因为权限请求被拒 无法打开所选文件 diff --git a/build/e_patches/0005-Remove-mremap-from-seccomp-baseline-policy.patch b/build/e_patches/0008-Remove-mremap-from-seccomp-baseline-policy.patch similarity index 65% rename from build/e_patches/0005-Remove-mremap-from-seccomp-baseline-policy.patch rename to build/e_patches/0008-Remove-mremap-from-seccomp-baseline-policy.patch index a45665f5d6aaf3ee4bf76163589f98973b7bfd00..7b8cba2eecb155321ee9001f6477223158dd13aa 100644 --- a/build/e_patches/0005-Remove-mremap-from-seccomp-baseline-policy.patch +++ b/build/e_patches/0008-Remove-mremap-from-seccomp-baseline-policy.patch @@ -1,7 +1,7 @@ -From 0127adccd62e6c1238d2e535cb6d2a853d65f038 Mon Sep 17 00:00:00 2001 +From fff6d368cde36d88fbca8e60eeffe101b0ed8601 Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sat, 16 Apr 2022 10:14:28 +0200 -Subject: [PATCH] Remove mremap from seccomp baseline policy +Subject: [PATCH 08/48] Remove mremap from seccomp baseline policy See also: * https://bugs.chromium.org/p/chromium/issues/detail?id=1288042 @@ -13,17 +13,17 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 1 file changed, 1 deletion(-) diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_android.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_android.cc -index 14acc6956310f..e8cb6af831391 100644 +index 9aa6408e88350..932a7c579276b 100644 --- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_android.cc +++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_android.cc -@@ -166,7 +166,6 @@ ResultExpr BaselinePolicyAndroid::EvaluateSyscall(int sysno) const { - case __NR_getdents64: - case __NR_getpriority: - case __NR_membarrier: // https://crbug.com/966433 -- case __NR_mremap: - #if defined(__i386__) +@@ -164,7 +164,6 @@ bool IsBaselinePolicyAllowed(int sysno) { // Used on pre-N to initialize threads in ART. case __NR_modify_ldt: + #endif +- case __NR_mremap: + case __NR_msync: + // File system access cannot be restricted with seccomp-bpf on Android, + // since the JVM classloader and other Framework features require file -- 2.34.1 diff --git a/build/e_patches/0008-fixup-Disable-fetching-of-all-field-trials.patch b/build/e_patches/0008-fixup-Disable-fetching-of-all-field-trials.patch deleted file mode 100644 index 5e116cbf6b00cbf99c19faaddd719a2e32a3483c..0000000000000000000000000000000000000000 --- a/build/e_patches/0008-fixup-Disable-fetching-of-all-field-trials.patch +++ /dev/null @@ -1,66 +0,0 @@ -From cfdb3987e0e0f280274a1b06b45c72c607ae6f48 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Wed, 20 Sep 2023 09:48:52 +0530 -Subject: [PATCH] fixup Disable fetching of all field trials - ---- - .../NonEmbeddedFastVariationsSeedSafeModeAction.java | 2 -- - .../SafeModeVariationsSeedContentProvider.java | 10 +--------- - build/android/gyp/proguard.py | 2 ++ - 3 files changed, 3 insertions(+), 11 deletions(-) - -diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java -index 7f46eae25c00e..426a7bc51366d 100644 ---- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java -+++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonEmbeddedFastVariationsSeedSafeModeAction.java -@@ -27,13 +27,11 @@ public class NonEmbeddedFastVariationsSeedSafeModeAction implements NonEmbeddedS - - @Override - public boolean onActivate() { -- AwVariationsSeedFetcher.scheduleIfNeeded(/*requireFastMode=*/true); - return true; - } - - @Override - public boolean onDeactivate() { -- AwVariationsSeedFetcher.cancelSafeModeSeedFetchSchedulerJob(); - return true; - } - } -diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java -index 6dd27d1df2923..8a829529fb839 100644 ---- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java -+++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java -@@ -82,15 +82,7 @@ public class SafeModeVariationsSeedContentProvider extends ContentProvider { - } - - private Boolean awaitSeedResults() { -- CountDownLatch countDownLatch = new CountDownLatch(1); -- VariationsSeedHolder.getInstance().hasSeedUpdateCompletedAsync( -- () -> { countDownLatch.countDown(); }); -- try { -- return countDownLatch.await(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS); -- } catch (InterruptedException e) { -- Log.w(TAG, e.toString()); -- return false; -- } -+ return false; - } - - @Override -diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py -index 66a27445a46c6..3827ac40074b4 100755 ---- a/build/android/gyp/proguard.py -+++ b/build/android/gyp/proguard.py -@@ -54,6 +54,8 @@ _IGNORE_WARNINGS = ( - r'PaymentRequest[BH]', - # com.google.android.gms.cast is stripped down from the build - r'class com\.google\.android\.gms\.', -+ # No fetching of trials -+ r'org\.chromium\.android_webview\.services\.AwVariationsSeedFetcher', - ]) + ')', - # TODO(agrieve): Remove once we update to U SDK. - r'OnBackAnimationCallback', --- -2.34.1 - diff --git a/build/e_patches/0006-Re-introduce-kWebAuthCable.patch b/build/e_patches/0009-Re-introduce-kWebAuthCable.patch similarity index 71% rename from build/e_patches/0006-Re-introduce-kWebAuthCable.patch rename to build/e_patches/0009-Re-introduce-kWebAuthCable.patch index 5ef30ca6d6297061670eb6f43b5759effe53cbd0..c81974a84be10678d2ed8b08fb37889424328ff4 100644 --- a/build/e_patches/0006-Re-introduce-kWebAuthCable.patch +++ b/build/e_patches/0009-Re-introduce-kWebAuthCable.patch @@ -1,7 +1,7 @@ -From 8f8a4013922c31c202f07dcc1e88a15375629202 Mon Sep 17 00:00:00 2001 +From 0a8a14fd161324746af1e53ff63908cae856ac77 Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sun, 4 Sep 2022 18:47:58 +0200 -Subject: [PATCH] Re-introduce kWebAuthCable +Subject: [PATCH 09/48] Re-introduce kWebAuthCable This reverts commit ebfd987a57bf4a58588760e8a4342b4fffef36f2. @@ -10,20 +10,20 @@ Feature is disabled by default. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- .../org/chromium/chrome/browser/AppHooks.java | 8 --- - .../chrome/browser/app/ChromeActivity.java | 66 ------------------- - .../authenticator_dialog_view_browsertest.cc | 7 ++ - .../authenticator_dialog_browsertest.cc | 7 ++ + .../chrome/browser/app/ChromeActivity.java | 59 ------------------- + .../authenticator_dialog_view_browsertest.cc | 7 +++ + .../authenticator_dialog_browsertest.cc | 7 +++ .../webauthn/chrome_webauthn_browsertest.cc | 2 + - .../webauth/authenticator_impl_unittest.cc | 7 +- - content/public/common/content_features.cc | 7 ++ + .../webauth/authenticator_impl_unittest.cc | 7 ++- + content/public/common/content_features.cc | 7 +++ content/public/common/content_features.h | 1 + - 8 files changed, 30 insertions(+), 75 deletions(-) + 8 files changed, 30 insertions(+), 68 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -index 50e8fb5e86d7b..5ce21991d9aab 100644 +index 12030d94581c0..c8776db837c3e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -@@ -108,14 +108,6 @@ public abstract class AppHooks { +@@ -98,14 +98,6 @@ public abstract class AppHooks { return new GoogleActivityController(); } @@ -39,10 +39,10 @@ index 50e8fb5e86d7b..5ce21991d9aab 100644 return new InstantAppsHandler(); } 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 -index 919e644702b37..0667c8617bf11 100644 +index b284d46a2c097..dc415daa9bc47 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java -@@ -297,7 +297,6 @@ public abstract class ChromeActivity +@@ -312,7 +312,6 @@ public abstract class ChromeActivity private TabContentManager mTabContentManager; private UmaSessionStats mUmaSessionStats; @@ -50,7 +50,7 @@ index 919e644702b37..0667c8617bf11 100644 private boolean mPartnerBrowserRefreshNeeded; -@@ -310,9 +309,6 @@ public abstract class ChromeActivity +@@ -325,9 +324,6 @@ public abstract class ChromeActivity private boolean mNativeInitialized; private boolean mRemoveWindowBackgroundDone; @@ -60,7 +60,7 @@ index 919e644702b37..0667c8617bf11 100644 // The FullscreenVideoPictureInPictureController is initialized lazily https://crbug.com/729738. private FullscreenVideoPictureInPictureController mFullscreenVideoPictureInPictureController; -@@ -1094,59 +1090,6 @@ public abstract class ChromeActivity +@@ -1206,53 +1202,6 @@ public abstract class ChromeActivity return StatusBarColorController.UNDEFINED_STATUS_BAR_COLOR; } @@ -72,20 +72,30 @@ index 919e644702b37..0667c8617bf11 100644 - - if (syncService != null && syncService.isSyncingUnencryptedUrls()) { - ContextReporter.SelectionReporter controller = -- getContextualSearchManagerSupplier().hasValue() ? new ContextReporter.SelectionReporter() { -- @Override -- public void enable(Callback callback) { -- getContextualSearchManagerSupplier().get().enableContextReporting( -- callback); -- } +- getContextualSearchManagerSupplier().hasValue() +- ? new ContextReporter.SelectionReporter() { +- @Override +- public void enable(Callback callback) { +- getContextualSearchManagerSupplier() +- .get() +- .enableContextReporting(callback); +- } - -- @Override -- public void disable() { -- getContextualSearchManagerSupplier().get().disableContextReporting(); -- } -- } : null; -- mContextReporter = AppHooks.get().createGsaHelper().getContextReporter( -- getActivityTabProvider(), mTabModelSelectorSupplier, controller); +- @Override +- public void disable() { +- getContextualSearchManagerSupplier() +- .get() +- .disableContextReporting(); +- } +- } +- : null; +- mContextReporter = +- AppHooks.get() +- .createGsaHelper() +- .getContextReporter( +- getActivityTabProvider(), +- mTabModelSelectorSupplier, +- controller); - - if (mSyncStateChangedListener != null) { - syncService.removeSyncStateChangedListener(mSyncStateChangedListener); @@ -93,8 +103,6 @@ index 919e644702b37..0667c8617bf11 100644 - } - - return; -- } else { -- reportSyncStatus(syncService); - } - - if (mSyncStateChangedListener == null && syncService != null) { @@ -102,25 +110,11 @@ index 919e644702b37..0667c8617bf11 100644 - syncService.addSyncStateChangedListener(mSyncStateChangedListener); - } - } -- -- /** Records an appropriate status via UMA given the current sync status. */ -- private static void reportSyncStatus(@Nullable SyncService syncService) { -- if (syncService == null || !syncService.isEngineInitialized()) { -- ContextReporter.reportStatus(ContextReporter.STATUS_SYNC_NOT_INITIALIZED); -- } else if (!syncService.getActiveDataTypes().contains(ModelType.HISTORY)) { -- ContextReporter.reportStatus(ContextReporter.STATUS_SYNC_NOT_SYNCING_URLS); -- } else if (syncService.getPassphraseType() != PassphraseType.KEYSTORE_PASSPHRASE -- && syncService.getPassphraseType() != PassphraseType.TRUSTED_VAULT_PASSPHRASE) { -- ContextReporter.reportStatus(ContextReporter.STATUS_SYNC_NOT_KEYSTORE_PASSPHRASE); -- } else { -- ContextReporter.reportStatus(ContextReporter.STATUS_SYNC_OTHER); -- } -- } - @Override public void onResumeWithNative() { // First, update the activity type in order to have it properly captured in -@@ -1271,15 +1214,6 @@ public abstract class ChromeActivity +@@ -1400,14 +1349,6 @@ public abstract class ChromeActivity @Override public void onStopWithNative() { @@ -132,15 +126,14 @@ index 919e644702b37..0667c8617bf11 100644 - mSyncStateChangedListener = null; - } - if (mContextReporter != null) mContextReporter.disable(); -- super.onStopWithNative(); } diff --git a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc -index a6a3ec4dfcc04..5d47d84fbde21 100644 +index f0f58e3832af3..3f3a5ce8a4bad 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc -@@ -100,6 +100,12 @@ class TestSheetView : public AuthenticatorRequestSheetView { +@@ -99,6 +99,12 @@ class TestSheetView : public AuthenticatorRequestSheetView { class AuthenticatorDialogViewTest : public DialogBrowserTest { public: @@ -153,7 +146,7 @@ index a6a3ec4dfcc04..5d47d84fbde21 100644 // DialogBrowserTest: void ShowUi(const std::string& name) override { dialog_model_ = std::make_unique( -@@ -163,6 +169,7 @@ class AuthenticatorDialogViewTest : public DialogBrowserTest { +@@ -162,6 +168,7 @@ class AuthenticatorDialogViewTest : public DialogBrowserTest { } } @@ -162,10 +155,10 @@ index a6a3ec4dfcc04..5d47d84fbde21 100644 }; diff --git a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc -index 92bbc694b8e3d..a02a7515eef87 100644 +index d1255412c5ca2..906a1173f944c 100644 --- a/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc +++ b/chrome/browser/ui/webauthn/authenticator_dialog_browsertest.cc -@@ -44,6 +44,12 @@ class AuthenticatorDialogTest : public DialogBrowserTest { +@@ -45,6 +45,12 @@ class AuthenticatorDialogTest : public DialogBrowserTest { AuthenticatorDialogTest(const AuthenticatorDialogTest&) = delete; AuthenticatorDialogTest& operator=(const AuthenticatorDialogTest&) = delete; @@ -178,7 +171,7 @@ index 92bbc694b8e3d..a02a7515eef87 100644 // DialogBrowserTest: void ShowUi(const std::string& name) override { // Web modal dialogs' bounds may exceed the display's work area. -@@ -341,6 +347,7 @@ class AuthenticatorDialogTest : public DialogBrowserTest { +@@ -342,6 +348,7 @@ class AuthenticatorDialogTest : public DialogBrowserTest { std::unique_ptr model_; base::RepeatingTimer timer_; int bio_samples_remaining_ = 5; @@ -187,10 +180,10 @@ index 92bbc694b8e3d..a02a7515eef87 100644 IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_default) { diff --git a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc -index 8b5a56337f0bc..3b996faa7f5b3 100644 +index d0dc93c2d879d..eaa40cc67e179 100644 --- a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc +++ b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc -@@ -714,6 +714,7 @@ IN_PROC_BROWSER_TEST_F(WebAuthnCableExtension, ServerLink) { +@@ -735,6 +735,7 @@ IN_PROC_BROWSER_TEST_F(WebAuthnCableExtension, ServerLink) { class WebAuthnCableSecondFactor : public WebAuthnBrowserTest { public: WebAuthnCableSecondFactor() { @@ -198,7 +191,7 @@ index 8b5a56337f0bc..3b996faa7f5b3 100644 // This makes it a little easier to compare against. trace_ << std::endl; } -@@ -956,6 +957,7 @@ class WebAuthnCableSecondFactor : public WebAuthnBrowserTest { +@@ -977,6 +978,7 @@ class WebAuthnCableSecondFactor : public WebAuthnBrowserTest { }; protected: @@ -207,10 +200,10 @@ index 8b5a56337f0bc..3b996faa7f5b3 100644 // This field is not a raw_ptr<> to avoid returning a reference to a temporary // T* (result of implicitly casting raw_ptr to T*). diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc -index 0cea1a420fc22..c53f512b0a2d0 100644 +index a9efd96c69ae9..ec93927251f6d 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc -@@ -1278,7 +1278,12 @@ TEST_F(AuthenticatorImplTest, OversizedCredentialId) { +@@ -1273,7 +1273,12 @@ TEST_F(AuthenticatorImplTest, OversizedCredentialId) { } } @@ -225,10 +218,10 @@ index 0cea1a420fc22..c53f512b0a2d0 100644 NavigateAndCommit(GURL(kTestOrigin1)); diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc -index 1e0250e65829b..9c5764d26cb99 100644 +index 8b50940f065ef..9c100a654805b 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc -@@ -1140,6 +1140,13 @@ BASE_FEATURE(kWebAssemblyTrapHandler, +@@ -1199,6 +1199,13 @@ BASE_FEATURE(kWebAssemblyTrapHandler, #endif ); @@ -243,10 +236,10 @@ index 1e0250e65829b..9c5764d26cb99 100644 // https://webbluetoothcg.github.io/web-bluetooth/ BASE_FEATURE(kWebBluetooth, "WebBluetooth", base::FEATURE_DISABLED_BY_DEFAULT); diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h -index 00370cf433f03..ed84d030303a5 100644 +index 73708d43f733c..f43fb5f9be8d4 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h -@@ -291,6 +291,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebMidi); +@@ -301,6 +301,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebMidi); CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebOtpBackendAuto); CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebPayments); CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUICodeCache); diff --git a/build/e_patches/0009-fixup-Enable-native-Android-autofill.patch b/build/e_patches/0009-fixup-Enable-native-Android-autofill.patch deleted file mode 100644 index 68c40b3f1d30f7888755db165dd480e5877f2088..0000000000000000000000000000000000000000 --- a/build/e_patches/0009-fixup-Enable-native-Android-autofill.patch +++ /dev/null @@ -1,55 +0,0 @@ -From e1d97e6c9e8cb48e8683a85032a3bfeb7b4931a5 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Thu, 28 Sep 2023 21:11:16 +0530 -Subject: [PATCH] fixup Enable native Android autofill - ---- - android_webview/browser/aw_autofill_client.cc | 3 ++- - android_webview/browser/aw_contents.cc | 3 +-- - .../chromium/components/embedder_support/view/ContentView.java | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/android_webview/browser/aw_autofill_client.cc b/android_webview/browser/aw_autofill_client.cc -index 449fe65d0bdda..45241971a0cbc 100644 ---- a/android_webview/browser/aw_autofill_client.cc -+++ b/android_webview/browser/aw_autofill_client.cc -@@ -412,7 +412,8 @@ AwAutofillClient::AwAutofillClient(WebContents* contents, - ? base::BindRepeating(&autofill::AndroidDriverInitHook, this) - : base::BindRepeating(&autofill::BrowserDriverInitHook, - this, -- base::android::GetDefaultLocaleString())) -+ base::android::GetDefaultLocaleString(), -+ /*enable_secondary_autofill_manager*/ false)) - #if DCHECK_IS_ON() - , - use_android_autofill_manager_(use_android_autofill_manager) -diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc -index 530d9052dc848..5fe6f69c96e34 100644 ---- a/android_webview/browser/aw_contents.cc -+++ b/android_webview/browser/aw_contents.cc -@@ -216,8 +216,7 @@ AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID( - AwSafeBrowsingUIManager::UIManagerClient* - AwSafeBrowsingUIManager::UIManagerClient::FromWebContents( - WebContents* web_contents) { -- return AwContents::FromWebContents(web_contents, -- /*enable_secondary_autofill_manager*/ false); -+ return AwContents::FromWebContents(web_contents); - } - - // static -diff --git a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java -index 33e9d22ba831a..6979c32d9f0d1 100644 ---- a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java -+++ b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java -@@ -649,7 +649,7 @@ public class ContentView extends FrameLayout - /** - * API level 26 implementation that includes autofill. - */ -- public static class ContentViewWithAutofill extends ContentView { -+ private static class ContentViewWithAutofill extends ContentView { - private ViewAndroidDelegate viewAndroidDelegate; - - private ContentViewWithAutofill(Context context, EventOffsetHandler eventOffsetHandler, WebContents webContents) { --- -2.34.1 - diff --git a/build/e_patches/0007-Enable-SPPI-for-devices-with-enough-memory.patch b/build/e_patches/0010-Enable-SPPI-for-devices-with-enough-memory.patch similarity index 89% rename from build/e_patches/0007-Enable-SPPI-for-devices-with-enough-memory.patch rename to build/e_patches/0010-Enable-SPPI-for-devices-with-enough-memory.patch index f4113571d84bdd26811d465b77a5c5b6db72f81f..069492fd5e2f99ebdfbbc579b96111104d8e20e0 100644 --- a/build/e_patches/0007-Enable-SPPI-for-devices-with-enough-memory.patch +++ b/build/e_patches/0010-Enable-SPPI-for-devices-with-enough-memory.patch @@ -1,7 +1,7 @@ -From a2a5d645b7d0103ca9461ef10afc0b06ae85c073 Mon Sep 17 00:00:00 2001 +From 6cdedbee98e5a55df857b6957849eaeda0816d6e Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sun, 17 Mar 2019 19:09:00 +0100 -Subject: [PATCH] Enable SPPI for devices with enough memory +Subject: [PATCH 10/48] Enable SPPI for devices with enough memory License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- diff --git a/build/e_patches/0010-fixup-Disable-Accessibility-service-by-default.patch b/build/e_patches/0010-fixup-Disable-Accessibility-service-by-default.patch deleted file mode 100644 index ee37e6d70f82dd3f17d80a7d8dab4b29af3cbb9d..0000000000000000000000000000000000000000 --- a/build/e_patches/0010-fixup-Disable-Accessibility-service-by-default.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 68da116097def33fee9dd5671a4958a308daea13 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Fri, 29 Sep 2023 14:10:43 +0530 -Subject: [PATCH] fixup Disable Accessibility service by default - ---- - .../browser/ui/android/strings/android_chrome_strings.grd | 6 ------ - .../browser_ui/accessibility/AccessibilitySettings.java | 3 --- - .../browser_ui/strings/android/browser_ui_strings.grd | 6 ++++++ - 3 files changed, 6 insertions(+), 9 deletions(-) - -diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd -index 0906059458684..7e1d32decf380 100644 ---- a/chrome/browser/ui/android/strings/android_chrome_strings.grd -+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1856,12 +1856,6 @@ Your Google account may have other forms of browsing history like searches and a - - Check now - -- -- Enable Accessibility Service -- -- -- Activates or deactivates the communication of all user activities in ui to the Accessibility provider -- - - An error occurred. - -diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -index cecb6800e604c..d913d195115c0 100644 ---- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -@@ -20,9 +20,6 @@ import org.chromium.components.browser_ui.settings.SettingsUtils; - import org.chromium.content_public.browser.ContentFeatureList; - import org.chromium.content_public.browser.ContentFeatureMap; - --import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; --import org.chromium.chrome.browser.preferences.SharedPreferencesManager; -- - /** - * Fragment to keep track of all the accessibility related preferences. - */ -diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd -index ec8205459b08e..4c85ac26d9def 100644 ---- a/components/browser_ui/strings/android/browser_ui_strings.grd -+++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -989,6 +989,12 @@ - - Drag the slider until you can read this comfortably. Text should look at least this big after double-tapping on a paragraph. - -+ -+ Enable Accessibility Service -+ -+ -+ Activates or deactivates the communication of all user activities in ui to the Accessibility provider -+ - - Force enable zoom - --- -2.34.1 - diff --git a/build/e_patches/0011-fixup-Add-option-to-force-tablet-UI.patch b/build/e_patches/0011-fixup-Add-option-to-force-tablet-UI.patch deleted file mode 100644 index 15a79cf91c8fa660af038a474f5cefddfb71a7af..0000000000000000000000000000000000000000 --- a/build/e_patches/0011-fixup-Add-option-to-force-tablet-UI.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 9af643417794b4bd450bd3e5d0db1aab61659d48 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Fri, 29 Sep 2023 14:35:06 +0530 -Subject: [PATCH] fixup Add option to force tablet UI - ---- - .../ui/android/strings/android_chrome_strings.grd | 7 ------- - .../toolbar/top/ToolbarControlContainer.java | 15 +++------------ - components/BUILD.gn | 4 ++-- - .../strings/android/browser_ui_strings.grd | 6 ++++++ - ui/android/BUILD.gn | 2 -- - .../org/chromium/ui/base/DeviceFormFactor.java | 11 +++++------ - 6 files changed, 16 insertions(+), 29 deletions(-) - -diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd -index 7e1d32decf380..47481ccc0fe97 100644 ---- a/chrome/browser/ui/android/strings/android_chrome_strings.grd -+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1823,13 +1823,6 @@ Your Google account may have other forms of browsing history like searches and a - - Protection from trackers (third-party cookies, IP tracking, invasive scripts, and more) - -- -- -- Open chromium in Tablet Mode -- -- -- Force Tablet Mode -- - - Move toolbar to bottom - -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 -index 8bdb3c8d3bbc4..a54ec94044657 100644 ---- 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 -@@ -176,8 +176,9 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con - - return backgroundDrawable; - } else { -- Drawable backgroundDrawable = new ColorDrawable( -- ChromeColors.getPrimaryBackgroundColor(getContext(), incognito)); -+ final Drawable backgroundDrawable = -+ AppCompatResources.getDrawable(getContext(), R.drawable.toolbar_background) -+ .mutate(); - backgroundDrawable.setTint(ChromeColors.getDefaultThemeColor(getContext(), incognito)); - backgroundDrawable.setTintMode(PorterDuff.Mode.MULTIPLY); - -@@ -212,16 +213,6 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con - tabSupplier, compositorInMotionSupplier, - browserStateBrowserControlsVisibilityDelegate, isVisible, - layoutStateProviderSupplier, fullscreenManager); -- -- View toolbarView = findViewById(R.id.toolbar); -- assert toolbarView != null; -- -- if (toolbarView instanceof ToolbarTablet) { -- // 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.) -- setBackground(getTempTabStripDrawable(isIncognito)); -- } - } - - @Override -diff --git a/components/BUILD.gn b/components/BUILD.gn -index cb89c56644882..3692d8ed2c586 100644 ---- a/components/BUILD.gn -+++ b/components/BUILD.gn -@@ -817,7 +817,7 @@ test("components_unittests") { - # On other platforms, no components should depend on Chrome. - # Since //chrome depends on //extensions, we also only assert_no_deps on - # extensions targets for non-lacros builds. -- if (!is_chromeos_lacros && !is_android) { -+ if (!is_chromeos_lacros && !is_android) { - assert_no_deps = [ "//chrome/*" ] - assert_no_deps += disallowed_extension_deps_ - } -@@ -1103,7 +1103,7 @@ if (use_blink) { - # dependency. On other platforms, no components should depend on Chrome. - # Since //chrome depends on //extensions, we also only assert_no_deps on - # extensions targets for non-lacros builds. -- if (!is_chromeos_lacros && !is_android) { -+ if (!is_chromeos_lacros && !is_android) { - assert_no_deps = [ "//chrome/*" ] - assert_no_deps += disallowed_extension_deps_ - } -diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd -index 4c85ac26d9def..d3546d252c525 100644 ---- a/components/browser_ui/strings/android/browser_ui_strings.grd -+++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -1013,6 +1013,12 @@ - - Captions - -+ -+ Open chromium in Tablet Mode -+ -+ -+ Force Tablet Mode -+ - - - -diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn -index 6aaffadc768ca..7d68f8ca350b7 100644 ---- a/ui/android/BUILD.gn -+++ b/ui/android/BUILD.gn -@@ -411,8 +411,6 @@ android_library("ui_no_recycler_view_java") { - ":ui_android_features_java", - ":ui_java_resources", - ":ui_utils_java", -- # dependency for ui_no_recycler_view_java -- "//chrome/browser/preferences:java", - "//base:base_java", - "//base:jni_java", - "//build/android:build_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 -index 39e1f0e915d6b..68074c7bb0773 100644 ---- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java -+++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java -@@ -5,6 +5,8 @@ - package org.chromium.ui.base; - - import android.content.Context; -+import android.content.SharedPreferences; -+import android.preference.PreferenceManager; - - import androidx.annotation.UiThread; - import androidx.annotation.VisibleForTesting; -@@ -12,8 +14,6 @@ import androidx.annotation.VisibleForTesting; - 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; -@@ -64,10 +64,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; -+ boolean isTabletUi = PreferenceManager.getDefaultSharedPreferences(context).getBoolean( -+ "force_tablet_ui_enabled", false); -+ return isTabletUi || detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET; - } - - /** --- -2.34.1 - diff --git a/build/e_patches/0011-fixup-Disable-fetching-of-all-field-trials.patch b/build/e_patches/0011-fixup-Disable-fetching-of-all-field-trials.patch new file mode 100644 index 0000000000000000000000000000000000000000..f22749cc726f413d485d7b748588bb450456bf60 --- /dev/null +++ b/build/e_patches/0011-fixup-Disable-fetching-of-all-field-trials.patch @@ -0,0 +1,45 @@ +From f5ec28fc3656ce0b513d0d6e95281ff00d71c8cd Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Wed, 20 Sep 2023 09:48:52 +0530 +Subject: [PATCH 11/48] fixup Disable fetching of all field trials + +--- + .../services/SafeModeVariationsSeedContentProvider.java | 8 +------- + build/android/gyp/proguard.py | 2 ++ + 2 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java +index 4a5bbb81a6812..c3fd6b3fbd68a 100644 +--- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java ++++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/SafeModeVariationsSeedContentProvider.java +@@ -87,13 +87,7 @@ public class SafeModeVariationsSeedContentProvider extends ContentProvider { + } + + private Boolean awaitSeedResults() { +- CountDownLatch countDownLatch = new CountDownLatch(1); +- try { +- return countDownLatch.await(TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS); +- } catch (InterruptedException e) { +- Log.w(TAG, e.toString()); +- return false; +- } ++ return false; + } + + @Override +diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py +index f26ea21ebf7af..5277d1fe2ba44 100755 +--- a/build/android/gyp/proguard.py ++++ b/build/android/gyp/proguard.py +@@ -54,6 +54,8 @@ _IGNORE_WARNINGS = ( + r'PaymentRequest[BH]', + # com.google.android.gms.cast is stripped down from the build + r'class com\.google\.android\.gms\.', ++ # No fetching of trials ++ r'org\.chromium\.android_webview\.services\.AwVariationsSeedFetcher', + ]) + ')', + # TODO(agrieve): Remove once we update to U SDK. + r'OnBackAnimationCallback', +-- +2.34.1 + diff --git a/build/e_patches/0012-fixup-Move-navigation-bar-to-bottom.patch b/build/e_patches/0012-fixup-Move-navigation-bar-to-bottom.patch deleted file mode 100644 index c9faf9cda08a496a4970c7e0d11ebfe2144f9305..0000000000000000000000000000000000000000 --- a/build/e_patches/0012-fixup-Move-navigation-bar-to-bottom.patch +++ /dev/null @@ -1,47 +0,0 @@ -From a19efa43661978ffedc4cac16db8279925da0e37 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Fri, 29 Sep 2023 14:41:03 +0530 -Subject: [PATCH] fixup Move navigation bar to bottom - ---- - .../browser/ui/android/strings/android_chrome_strings.grd | 6 ------ - .../browser_ui/strings/android/browser_ui_strings.grd | 6 ++++++ - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd -index 47481ccc0fe97..9354ba7b6beef 100644 ---- a/chrome/browser/ui/android/strings/android_chrome_strings.grd -+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1823,12 +1823,6 @@ Your Google account may have other forms of browsing history like searches and a - - Protection from trackers (third-party cookies, IP tracking, invasive scripts, and more) - -- -- Move toolbar to bottom -- -- -- Move toolbar to bottom -- - - - -diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd -index d3546d252c525..a91fd35ec124f 100644 ---- a/components/browser_ui/strings/android/browser_ui_strings.grd -+++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -1019,6 +1019,12 @@ - - Force Tablet Mode - -+ -+ Move toolbar to bottom -+ -+ -+ Move toolbar to bottom -+ - - - --- -2.34.1 - diff --git a/build/e_patches/0016-fixup-Revert-removal-of-execution-context-address-sp.patch b/build/e_patches/0012-fixup-Revert-removal-of-execution-context-address-sp.patch similarity index 89% rename from build/e_patches/0016-fixup-Revert-removal-of-execution-context-address-sp.patch rename to build/e_patches/0012-fixup-Revert-removal-of-execution-context-address-sp.patch index ce4116edabe0d3d279d151b99dab8a5ba2917d9d..2a78ed23bed9691f40fb1c6d44370f7f6672cf69 100644 --- a/build/e_patches/0016-fixup-Revert-removal-of-execution-context-address-sp.patch +++ b/build/e_patches/0012-fixup-Revert-removal-of-execution-context-address-sp.patch @@ -1,7 +1,7 @@ -From cd0a81a23d1b9ce56aeaae714fda2fcef7f0d3e8 Mon Sep 17 00:00:00 2001 +From 72e4b09fa116b1e440a28983da789f5866b81e7f Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 4 Oct 2023 13:51:29 +0530 -Subject: [PATCH] fixup Revert removal of execution context address space +Subject: [PATCH 12/48] fixup Revert removal of execution context address space --- .../blink/renderer/core/workers/installed_scripts_manager.cc | 4 ++-- diff --git a/build/e_patches/0017-Remove-bromite-auto-updater-option.patch b/build/e_patches/0013-Remove-bromite-auto-updater-option.patch similarity index 86% rename from build/e_patches/0017-Remove-bromite-auto-updater-option.patch rename to build/e_patches/0013-Remove-bromite-auto-updater-option.patch index d0cb33d78d597d4b39f2c5d9c3e69fb2d9ac21fd..8b1655eca307e069f8e1054f7ca14edba65c4ce0 100644 --- a/build/e_patches/0017-Remove-bromite-auto-updater-option.patch +++ b/build/e_patches/0013-Remove-bromite-auto-updater-option.patch @@ -1,7 +1,7 @@ -From 0faf894065adf8e4f235ebc01954397161192985 Mon Sep 17 00:00:00 2001 +From 2a5244c76a21d23abff3740ec1834da0b5243eb6 Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 20 Sep 2023 09:59:55 +0530 -Subject: [PATCH] Remove bromite auto updater option +Subject: [PATCH 13/48] Remove bromite auto updater option --- .../firstrun/ToSAndUMAFirstRunFragment.java | 25 ------------------- @@ -98,17 +98,17 @@ index 9de332c99045a..2da39d602db41 100644 protected View getToSAndPrivacyText() { 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 -index 10f69e965845d..b1417084317e5 100644 +index adda6ccad4420..afbe972a84643 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java -@@ -286,9 +286,7 @@ public class UpdateStatusProvider { - status.updateUrl = MarketURLGetter.getMarketUrl(); - status.latestVersion = VersionNumberGetter.getInstance().getLatestKnownVersion(); - -- boolean allowedToUpdate = checkForSufficientStorage() -- && PackageUtils.isPackageInstalled( -- GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE); -+ boolean allowedToUpdate = checkForSufficientStorage(); +@@ -289,9 +289,7 @@ public class UpdateStatusProvider { + boolean allowedToUpdate = + checkForSufficientStorage() + // Disable the version update check for automotive. See b/297925838. +- && !BuildInfo.getInstance().isAutomotive +- && PackageUtils.isPackageInstalled( +- GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE); ++ && !BuildInfo.getInstance().isAutomotive; status.updateState = allowedToUpdate ? UpdateState.UPDATE_AVAILABLE : UpdateState.NONE; diff --git a/build/e_patches/0013-fixup-Remove-binary-blob-integrations.patch b/build/e_patches/0013-fixup-Remove-binary-blob-integrations.patch deleted file mode 100644 index 030b6ff5a720fc6cb33d59dfce2aaeb712c77ef0..0000000000000000000000000000000000000000 --- a/build/e_patches/0013-fixup-Remove-binary-blob-integrations.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2a1faa2a9ee443392482cc4ab75acf269489aea7 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Thu, 23 Nov 2023 14:56:24 +0530 -Subject: [PATCH] fixup: Remove binary blob integrations - ---- - android_webview/tools/captured_sites_tests/BUILD.gn | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/android_webview/tools/captured_sites_tests/BUILD.gn b/android_webview/tools/captured_sites_tests/BUILD.gn -index 2904f8868b0c9..5eefa3de517aa 100644 ---- a/android_webview/tools/captured_sites_tests/BUILD.gn -+++ b/android_webview/tools/captured_sites_tests/BUILD.gn -@@ -42,7 +42,6 @@ robolectric_binary("captured_sites_junit_tests") { - "//base:base_java_test_support", - "//base:base_junit_test_support", - "//third_party/android_deps:espresso_java", -- "//third_party/android_deps:playcore_java", - "//third_party/android_sdk:android_test_base_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_test_monitor_java", -@@ -90,7 +89,6 @@ instrumentation_test_apk("webview_captured_sites_test_apk") { - "//base:base_java", - "//base:base_java_test_support", - "//third_party/android_deps:espresso_java", -- "//third_party/android_deps:playcore_java", - "//third_party/android_sdk:android_test_base_java", - "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/androidx:androidx_test_monitor_java", --- -2.34.1 - diff --git a/build/e_patches/0018-Browser-disable-price-shopping-commerce-integration.patch b/build/e_patches/0014-Browser-disable-price-shopping-commerce-integration.patch similarity index 69% rename from build/e_patches/0018-Browser-disable-price-shopping-commerce-integration.patch rename to build/e_patches/0014-Browser-disable-price-shopping-commerce-integration.patch index 7e656ca09e646b2b0a17f1fb5c95f629a56147b8..12f27ebf3b5193404a2169794238ecad802d50a7 100644 --- a/build/e_patches/0018-Browser-disable-price-shopping-commerce-integration.patch +++ b/build/e_patches/0014-Browser-disable-price-shopping-commerce-integration.patch @@ -1,7 +1,7 @@ -From 3d950aefd31c731c0194b81aaa29460eb9650ac6 Mon Sep 17 00:00:00 2001 +From 49b0da6d2e550f2043454c7836d23528ffbadadc Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 4 Oct 2023 19:36:24 +0530 -Subject: [PATCH] Browser: disable price shopping commerce integration +Subject: [PATCH 14/48] Browser: disable price shopping commerce integration --- .../browser/app/appmenu/AppMenuPropertiesDelegateImpl.java | 6 ++++-- @@ -9,19 +9,19 @@ Subject: [PATCH] Browser: disable price shopping commerce integration 2 files changed, 6 insertions(+), 4 deletions(-) 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 -index b760f8f9d4406..4cac17e2d185c 100644 +index bbd9aa631fb3f..762b670fef2bf 100644 --- 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 -@@ -1109,7 +1109,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate - */ - protected void updatePriceTrackingMenuItemRow(@NonNull MenuItem startPriceTrackingMenuItem, - @NonNull MenuItem stopPriceTrackingMenuItem, @Nullable Tab currentTab) { -- ShoppingService service = -+ /*ShoppingService service = - ShoppingServiceFactory.getForProfile(Profile.getLastUsedRegularProfile()); +@@ -1146,7 +1146,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate + } + + Profile profile = currentTab.getProfile(); +- ShoppingService service = ShoppingServiceFactory.getForProfile(profile); ++ /*ShoppingService service = ShoppingServiceFactory.getForProfile(profile); ShoppingService.ProductInfo info = null; - if (service != null && currentTab != null) { -@@ -1140,7 +1140,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate + if (service != null) { + info = service.getAvailableProductInfoForUrl(currentTab.getUrl()); +@@ -1179,7 +1179,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } else { startPriceTrackingMenuItem.setVisible(true); stopPriceTrackingMenuItem.setVisible(false); @@ -33,10 +33,10 @@ index b760f8f9d4406..4cac17e2d185c 100644 /** diff --git a/components/commerce/core/commerce_feature_list.cc b/components/commerce/core/commerce_feature_list.cc -index aa15c1322beae..8914a9147d2f5 100644 +index 1ac2669c4d5a1..784db2a9d38bb 100644 --- a/components/commerce/core/commerce_feature_list.cc +++ b/components/commerce/core/commerce_feature_list.cc -@@ -122,7 +122,7 @@ BASE_FEATURE(kCommerceAllowLocalImages, +@@ -123,7 +123,7 @@ BASE_FEATURE(kCommerceAllowLocalImages, BASE_FEATURE(kCommerceAllowOnDemandBookmarkUpdates, "CommerceAllowOnDemandBookmarkUpdates", @@ -45,7 +45,7 @@ index aa15c1322beae..8914a9147d2f5 100644 BASE_FEATURE(kCommerceAllowOnDemandBookmarkBatchUpdates, "CommerceAllowOnDemandBookmarkBatchUpdates", -@@ -259,7 +259,7 @@ BASE_FEATURE(kShoppingPageTypesRegionLaunched, +@@ -283,7 +283,7 @@ BASE_FEATURE(kShoppingPageTypesRegionLaunched, "ShoppingPageTypesRegionLaunched", base::FEATURE_ENABLED_BY_DEFAULT); diff --git a/build/e_patches/0014-fixup-Disable-third-party-origin-trials.patch b/build/e_patches/0014-fixup-Disable-third-party-origin-trials.patch deleted file mode 100644 index 3b0a048a738cb63c27a4d2cd3dc08d8ce50d3e5e..0000000000000000000000000000000000000000 --- a/build/e_patches/0014-fixup-Disable-third-party-origin-trials.patch +++ /dev/null @@ -1,44 +0,0 @@ -From d8644003b2d9885f0a739f98590a1af914c730bc Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Thu, 23 Nov 2023 17:10:27 +0530 -Subject: [PATCH] fixup: Disable third-party origin trials - ---- - android_webview/common/aw_content_client.cc | 6 ------ - .../origin_trials/origin_trial_policy_impl.cc | 3 ++- - 2 files changed, 2 insertions(+), 7 deletions(-) - -diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc -index 22ae5619b1d42..181a4d6aacab7 100644 ---- a/android_webview/common/aw_content_client.cc -+++ b/android_webview/common/aw_content_client.cc -@@ -123,12 +123,6 @@ blink::OriginTrialPolicy* AwContentClient::GetOriginTrialPolicy() { - if (!origin_trial_policy_) - origin_trial_policy_ = - std::make_unique(); -- // If we turn on the Disable Origin Trial SafeMode on we will set the policy -- // flag to true after construction. This will work because trial token -- // validator will always get the current instance of policy when needed. -- if (IsDisableOriginTrialsSafeModeActionOn()) { -- origin_trial_policy_->SetAllowOnlyDeprecationTrials(true); -- } - return origin_trial_policy_.get(); - } - -diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc b/components/embedder_support/origin_trials/origin_trial_policy_impl.cc -index dfefce72244fd..ae8d643fc2b03 100644 ---- a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc -+++ b/components/embedder_support/origin_trials/origin_trial_policy_impl.cc -@@ -168,7 +168,8 @@ bool OriginTrialPolicyImpl::SetDisabledTokens( - - void OriginTrialPolicyImpl::SetAllowOnlyDeprecationTrials( - bool allow_only_deprecation_trials) { -- allow_only_deprecation_trials_ = allow_only_deprecation_trials; -+ // third-party origin trials are always disabled -+ allow_only_deprecation_trials_ = false; - } - - bool OriginTrialPolicyImpl::GetAllowOnlyDeprecationTrials() const { --- -2.34.1 - diff --git a/build/e_patches/0019-add-trichrome-browser-apk-targets.patch b/build/e_patches/0015-add-trichrome-browser-apk-targets.patch similarity index 86% rename from build/e_patches/0019-add-trichrome-browser-apk-targets.patch rename to build/e_patches/0015-add-trichrome-browser-apk-targets.patch index 250a867ae3b460a3670e933e91fd0b8fbfd835c5..2c267470254019d96f0e1f90707176011933cbea 100644 --- a/build/e_patches/0019-add-trichrome-browser-apk-targets.patch +++ b/build/e_patches/0015-add-trichrome-browser-apk-targets.patch @@ -1,7 +1,7 @@ -From da578621122ad5e2d36f1c647a405cdcfd81b99c Mon Sep 17 00:00:00 2001 +From c85731ca0b7248beda61472b6ff4e50ed0dd5ab5 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 27 May 2021 07:30:02 -0400 -Subject: [PATCH] add trichrome browser apk targets +Subject: [PATCH 15/48] add trichrome browser apk targets --- chrome/android/BUILD.gn | 35 +++++++++++++++++++++++ @@ -9,10 +9,10 @@ Subject: [PATCH] add trichrome browser apk targets 2 files changed, 37 insertions(+) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index 4594740d3b6cc..aab9ff8afc0d9 100644 +index 2384bf934f2d3..0baa87d367c63 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -2393,6 +2393,10 @@ if (current_toolchain == default_toolchain) { +@@ -2432,6 +2432,10 @@ if (current_toolchain == default_toolchain) { is_trichrome = true is_bundle_module = true } @@ -23,7 +23,7 @@ index 4594740d3b6cc..aab9ff8afc0d9 100644 # Exists separately from chrome_public_base_module_java_for_test to allow # downstream to depend on test support packages without needing to depend on -@@ -2728,6 +2732,37 @@ if (current_toolchain == default_toolchain) { +@@ -2786,6 +2790,37 @@ if (current_toolchain == default_toolchain) { } } } @@ -62,10 +62,10 @@ index 4594740d3b6cc..aab9ff8afc0d9 100644 # As compared to chrome_public_test_apk, this target contains only unit tests # that require on device capabilities. These tests are smaller, more tightly diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni -index cdabf99ee5129..4d483eaa28656 100644 +index af39bbe745dab..7daeae480cbd7 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni -@@ -450,6 +450,8 @@ template("chrome_common_apk_or_module_tmpl") { +@@ -454,6 +454,8 @@ template("chrome_common_apk_or_module_tmpl") { deps += [ "//chrome/android:chrome_bundle_module_pak_assets" ] } else if (_is_monochrome) { deps += [ "//chrome/android:monochrome_apk_pak_assets" ] diff --git a/build/e_patches/0015-fixup-disable-browser-sign-in-feature-by-default.patch b/build/e_patches/0015-fixup-disable-browser-sign-in-feature-by-default.patch deleted file mode 100644 index 63e53cb297da49a24271d82ea3653f82a83a7d5c..0000000000000000000000000000000000000000 --- a/build/e_patches/0015-fixup-disable-browser-sign-in-feature-by-default.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 65ce880e1e3c2d2aaf844d4f8f727438c0bac744 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Fri, 24 Nov 2023 15:34:45 +0530 -Subject: [PATCH] fixup: disable browser sign in feature by default - ---- - .../settings/PasswordSettings.java | 4 ---- - .../chrome/browser/settings/MainSettings.java | 14 -------------- - 2 files changed, 18 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 -index 25a770923c78e..b22ceff9d786a 100644 ---- 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 -@@ -37,7 +37,6 @@ import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; - import org.chromium.chrome.browser.password_manager.PasswordCheckReferrer; - import org.chromium.chrome.browser.password_manager.PasswordManagerHelper; - import org.chromium.chrome.browser.preferences.Pref; --import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; - import org.chromium.chrome.browser.settings.ChromeBaseSettingsFragment; - import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; - import org.chromium.chrome.browser.settings.SettingsLauncherImpl; -@@ -705,9 +704,6 @@ public class PasswordSettings extends ChromeBaseSettingsFragment - if (mSearchQuery != null && !mNoPasswords) { - return; // Don't add the Manage Account link if there is a search going on. - } -- if (!IdentityServicesProvider.get().getSigninManager(mProfile).isSigninSupported(false)) { -- return; -- } - if (getPreferenceScreen().findPreference(PREF_KEY_MANAGE_ACCOUNT_LINK) != null) { - return; // Don't add the Manage Account link if it's present. - } -diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java -index 22704e54390da..271192a7a814d 100644 ---- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java -+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java -@@ -171,18 +171,6 @@ public class MainSettings extends ChromeBaseSettingsFragment - ProfileDataCache profileDataCache = - ProfileDataCache.createWithDefaultImageSizeAndNoBadge(getContext()); - AccountManagerFacade accountManagerFacade = AccountManagerFacadeProvider.getInstance(); -- SigninManager signinManager = IdentityServicesProvider.get().getSigninManager(getProfile()); -- IdentityManager identityManager = -- IdentityServicesProvider.get().getIdentityManager(getProfile()); -- -- SyncPromoPreference syncPromoPreference = findPreference(PREF_SYNC_PROMO); -- syncPromoPreference.initialize( -- profileDataCache, accountManagerFacade, signinManager, identityManager); -- -- SignInPreference signInPreference = findPreference(PREF_SIGN_IN); -- signInPreference.initialize(profileDataCache, accountManagerFacade, -- UserPrefs.get(getProfile()), SyncServiceFactory.getForProfile(getProfile()), -- signinManager, identityManager); - - cachePreferences(); - -@@ -256,8 +244,6 @@ public class MainSettings extends ChromeBaseSettingsFragment - } - - private void updatePreferences() { -- removePreferenceIfPresent(PREF_SIGN_IN); -- - updateManageSyncPreference(); - updateSearchEnginePreference(); - updateAutofillPreferences(); --- -2.34.1 - diff --git a/build/e_patches/0020-Browser-Change-app-and-package-name-to-browser.patch b/build/e_patches/0016-Browser-Change-app-and-package-name-to-browser.patch similarity index 92% rename from build/e_patches/0020-Browser-Change-app-and-package-name-to-browser.patch rename to build/e_patches/0016-Browser-Change-app-and-package-name-to-browser.patch index 26c438272ce395a7342738fc2ba210a092e9977b..937f8de230acb9589009db3cad650a866ab14f69 100644 --- a/build/e_patches/0020-Browser-Change-app-and-package-name-to-browser.patch +++ b/build/e_patches/0016-Browser-Change-app-and-package-name-to-browser.patch @@ -1,7 +1,7 @@ -From b7e62469fdcec340bbe8cdf3a705575e1827d9d7 Mon Sep 17 00:00:00 2001 +From 3d0e5ae37173e05fec7a5c22bac54016a9647e05 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Fri, 26 Nov 2021 05:39:25 +0000 -Subject: [PATCH] Browser: Change app and package name to browser +Subject: [PATCH 16/48] Browser: Change app and package name to browser Signed-off-by: Aayush Gupta Signed-off-by: althafvly diff --git a/build/e_patches/0021-Browser-Point-to-our-default-popular-sites.patch b/build/e_patches/0017-Browser-Point-to-our-default-popular-sites.patch similarity index 94% rename from build/e_patches/0021-Browser-Point-to-our-default-popular-sites.patch rename to build/e_patches/0017-Browser-Point-to-our-default-popular-sites.patch index ffc1aabda1efbffddf063649c283313a4b48352f..e1d838978c5601a2daf555f68f76a21a0d3d2fb5 100644 --- a/build/e_patches/0021-Browser-Point-to-our-default-popular-sites.patch +++ b/build/e_patches/0017-Browser-Point-to-our-default-popular-sites.patch @@ -1,7 +1,7 @@ -From 7bdcf8d46f47e33564172b6ac405cf46d564637a Mon Sep 17 00:00:00 2001 +From f055dad8afeddecca1bab4b21383e4a491f9d7e6 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Fri, 26 Nov 2021 07:29:59 +0000 -Subject: [PATCH] Browser: Point to our default popular sites +Subject: [PATCH 17/48] Browser: Point to our default popular sites Signed-off-by: Aayush Gupta --- diff --git a/build/e_patches/0018-Browser-Enable-do-not-track-by-default.patch b/build/e_patches/0018-Browser-Enable-do-not-track-by-default.patch new file mode 100644 index 0000000000000000000000000000000000000000..128336594a0e1abf3024fa6b4e3db5d0897186cf --- /dev/null +++ b/build/e_patches/0018-Browser-Enable-do-not-track-by-default.patch @@ -0,0 +1,25 @@ +From f5117998c1c11865b8c7d46d3a688181fc1f1725 Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Fri, 26 Nov 2021 07:34:57 +0000 +Subject: [PATCH 18/48] Browser: Enable do not track by default + +--- + components/privacy_sandbox/tracking_protection_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/privacy_sandbox/tracking_protection_prefs.cc b/components/privacy_sandbox/tracking_protection_prefs.cc +index daf4a381b46c1..863cc62b62628 100644 +--- a/components/privacy_sandbox/tracking_protection_prefs.cc ++++ b/components/privacy_sandbox/tracking_protection_prefs.cc +@@ -72,7 +72,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); + registry->RegisterBooleanPref( +- prefs::kEnableDoNotTrack, false, ++ prefs::kEnableDoNotTrack, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + + // Sentiment Survey +-- +2.34.1 + diff --git a/build/e_patches/0023-Browser-Add-provider-to-share-default-search-engine.patch b/build/e_patches/0019-Browser-Add-provider-to-share-default-search-engine.patch similarity index 95% rename from build/e_patches/0023-Browser-Add-provider-to-share-default-search-engine.patch rename to build/e_patches/0019-Browser-Add-provider-to-share-default-search-engine.patch index 6ab6ffd6d2ebca3ed7162b1a6112a75eac092578..438ee8d9e3641f512c22fbe3bb4d6bf2456b3273 100644 --- a/build/e_patches/0023-Browser-Add-provider-to-share-default-search-engine.patch +++ b/build/e_patches/0019-Browser-Add-provider-to-share-default-search-engine.patch @@ -1,7 +1,7 @@ -From c6fe5cfdfd8e08804e775125a9267df18cd59e6d Mon Sep 17 00:00:00 2001 +From 5386b7eccfbc537879ea61e482a14adb873a3001 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Fri, 26 Nov 2021 08:03:13 +0000 -Subject: [PATCH] Browser: Add provider to share default search engine +Subject: [PATCH 19/48] Browser: Add provider to share default search engine Signed-off-by: Aayush Gupta --- @@ -12,10 +12,10 @@ Signed-off-by: Aayush Gupta create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml -index 3f8f499a3b6b9..f4a46b731ec36 100644 +index 205b0658173f0..23053a389696c 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml -@@ -1316,6 +1316,12 @@ by a child template that "extends" this file. +@@ -1322,6 +1322,12 @@ by a child template that "extends" this file. android:readPermission="android.permission.GLOBAL_SEARCH" /> diff --git a/build/e_patches/0024-Browser-Enable-custom-tabs-by-default.patch b/build/e_patches/0020-Browser-Enable-custom-tabs-by-default.patch similarity index 80% rename from build/e_patches/0024-Browser-Enable-custom-tabs-by-default.patch rename to build/e_patches/0020-Browser-Enable-custom-tabs-by-default.patch index e199ffff0228fab118ee50266cc1fa2f28b90518..bef0656120975e37ff0a4aa9de7ad240f64aeeaa 100644 --- a/build/e_patches/0024-Browser-Enable-custom-tabs-by-default.patch +++ b/build/e_patches/0020-Browser-Enable-custom-tabs-by-default.patch @@ -1,7 +1,7 @@ -From 116a7160423f1a7834c09009cb26de15ade54be9 Mon Sep 17 00:00:00 2001 +From bd05aaf23a005acc6ad7f48b06413860467091b7 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 29 Nov 2021 03:37:37 +0000 -Subject: [PATCH] Browser: Enable custom tabs by default +Subject: [PATCH 20/48] Browser: Enable custom tabs by default Signed-off-by: Aayush Gupta Signed-off-by: althafvly @@ -11,10 +11,10 @@ Signed-off-by: althafvly 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml -index fdacc112dd747..2a3b411f60657 100644 +index 132b713a4d0a9..43692f356e60a 100644 --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -88,7 +88,7 @@ found in the LICENSE file. +@@ -47,7 +47,7 @@ found in the LICENSE file. android:key="allow_custom_tab_intents" android:title="@string/allow_custom_tab_intents_title" android:summary="@string/allow_custom_tab_intents_summary" @@ -24,18 +24,18 @@ index fdacc112dd747..2a3b411f60657 100644 android:key="open_external_links_incognito" android:title="@string/open_external_links_incognito_title" diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java -index 58395f243bcab..7bc4a960b5309 100644 +index ea7aae8a3704c..b4dd554b006a5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java -@@ -250,7 +250,7 @@ public class LaunchIntentDispatcher { +@@ -263,7 +263,7 @@ public class LaunchIntentDispatcher { public static boolean isCustomTabIntent(Intent intent) { if (intent == null) return false; if (!ContextUtils.getAppSharedPreferences() - .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false)) + .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, true)) return false; - if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent) - || !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) { + Log.w( + TAG, -- 2.34.1 diff --git a/build/e_patches/0025-Browser-Enable-search-suggestion-by-default.patch b/build/e_patches/0021-Browser-Enable-search-suggestion-by-default.patch similarity index 75% rename from build/e_patches/0025-Browser-Enable-search-suggestion-by-default.patch rename to build/e_patches/0021-Browser-Enable-search-suggestion-by-default.patch index c2e38a124e5d9f7fa4031ee87f69c8c71a4cbca5..42df654a5818c41ff21016c08134b48a06c079c2 100644 --- a/build/e_patches/0025-Browser-Enable-search-suggestion-by-default.patch +++ b/build/e_patches/0021-Browser-Enable-search-suggestion-by-default.patch @@ -1,7 +1,7 @@ -From b87caac1318f0983e13189bf946f209255fb2fab Mon Sep 17 00:00:00 2001 +From d65ced7680ec370a1c2866d10c78cabaa932ed84 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Mon, 29 Nov 2021 03:39:21 +0000 -Subject: [PATCH] Browser: Enable search suggestion by default +Subject: [PATCH 21/48] Browser: Enable search suggestion by default Signed-off-by: Aayush Gupta --- @@ -9,10 +9,10 @@ Signed-off-by: Aayush Gupta 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc -index d4fd34bd1132a..8cb7e0e113203 100644 +index 13879a8374044..cde4ae5fce68d 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc -@@ -310,7 +310,7 @@ const char Profile::kProfileKey[] = "__PROFILE__"; +@@ -314,7 +314,7 @@ const char Profile::kProfileKey[] = "__PROFILE__"; void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kSearchSuggestEnabled, diff --git a/build/e_patches/0022-Browser-Enable-do-not-track-by-default.patch b/build/e_patches/0022-Browser-Enable-do-not-track-by-default.patch deleted file mode 100644 index aacea155b2ef782d6e2199928f61e4203af9deec..0000000000000000000000000000000000000000 --- a/build/e_patches/0022-Browser-Enable-do-not-track-by-default.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 955d4028e3eab596d817ccad192fcb46eb71d120 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Fri, 26 Nov 2021 07:34:57 +0000 -Subject: [PATCH] Browser: Enable do not track by default - ---- - chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc -index a608961f5cdf7..0bb1d403cf734 100644 ---- a/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc -+++ b/chrome/browser/sync/prefs/chrome_syncable_prefs_database.cc -@@ -973,7 +973,7 @@ const auto& SyncablePreferences() { - {syncable_prefs_ids::kDownloadBubbleIphSuppression, - syncer::PREFERENCES, false, sync_preferences::MergeBehavior::kNone}}, - {prefs::kEnableDoNotTrack, -- {syncable_prefs_ids::kEnableDoNotTrack, syncer::PREFERENCES, false, -+ {syncable_prefs_ids::kEnableDoNotTrack, syncer::PREFERENCES, true, - sync_preferences::MergeBehavior::kNone}}, - {prefs::kExtensionCommands, - {syncable_prefs_ids::kExtensionCommands, syncer::PREFERENCES, false, --- -2.34.1 - diff --git a/build/e_patches/0026-Browser-Modify-default-search-engines.patch b/build/e_patches/0022-Browser-Modify-default-search-engines.patch similarity index 98% rename from build/e_patches/0026-Browser-Modify-default-search-engines.patch rename to build/e_patches/0022-Browser-Modify-default-search-engines.patch index 3616b9ae36135c64794976241b1e452d76d075c8..83b367ec5e83ea3aade132d968a1b463c70ceb50 100644 --- a/build/e_patches/0026-Browser-Modify-default-search-engines.patch +++ b/build/e_patches/0022-Browser-Modify-default-search-engines.patch @@ -1,19 +1,19 @@ -From 3c57b89e8c72cd39b4dced431918495c00a22731 Mon Sep 17 00:00:00 2001 +From d4e553a5c8bcaf108bd0c62ca15d56647af04ae8 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Thu, 18 Mar 2021 13:42:44 +0100 -Subject: [PATCH] Browser: Modify default search engines +Subject: [PATCH 22/48] Browser: Modify default search engines Signed-off-by: althafvly --- .../locale/locale_template_url_loader.cc | 35 +- .../locale/locale_template_url_loader.h | 1 - .../browser/locale/LocaleManagerDelegate.java | 1 - - .../locale/LocaleTemplateUrlLoader.java | 9 - + .../locale/LocaleTemplateUrlLoader.java | 8 - .../search_engines/prepopulated_engines.json | 10 + .../search_engines/search_engine_type.h | 1 + .../search_engines/search_engine_utils.cc | 12 +- .../template_url_prepopulate_data.cc | 1031 ++++++----------- - 8 files changed, 358 insertions(+), 742 deletions(-) + 8 files changed, 358 insertions(+), 741 deletions(-) diff --git a/chrome/browser/android/locale/locale_template_url_loader.cc b/chrome/browser/android/locale/locale_template_url_loader.cc index d44abf2732581..572e42d0c9d32 100644 @@ -94,7 +94,7 @@ index f77a936bcedcc..7c90fd6574e9e 100644 LocaleTemplateUrlLoader(const LocaleTemplateUrlLoader&) = delete; LocaleTemplateUrlLoader& operator=(const LocaleTemplateUrlLoader&) = delete; diff --git a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java -index bd949ff290fa4..25643e12e5d61 100644 +index d27f23e94b03f..cee4f1f77f109 100644 --- a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java +++ b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java @@ -143,7 +143,6 @@ public class LocaleManagerDelegate { @@ -106,16 +106,14 @@ index bd949ff290fa4..25643e12e5d61 100644 } diff --git a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java -index 690a6b4bc099b..fd4279ddac4d6 100644 +index e68159823e45d..eb99d9bd7fd62 100644 --- a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java +++ b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java -@@ -67,14 +67,6 @@ public class LocaleTemplateUrlLoader { - mNativeLocaleTemplateUrlLoader); +@@ -64,12 +64,6 @@ public class LocaleTemplateUrlLoader { + .overrideDefaultSearchProvider(mNativeLocaleTemplateUrlLoader); } -- /** -- * Sets the default search provider back to Google. -- */ +- /** Sets the default search provider back to Google. */ - public void setGoogleAsDefaultSearch() { - assert mNativeLocaleTemplateUrlLoader != 0; - LocaleTemplateUrlLoaderJni.get().setGoogleAsDefaultSearch(mNativeLocaleTemplateUrlLoader); @@ -124,15 +122,16 @@ index 690a6b4bc099b..fd4279ddac4d6 100644 @NativeMethods interface Natives { long init(String localeId); -@@ -82,6 +74,5 @@ public class LocaleTemplateUrlLoader { - boolean loadTemplateUrls(long nativeLocaleTemplateUrlLoader); +@@ -81,7 +75,5 @@ public class LocaleTemplateUrlLoader { void removeTemplateUrls(long nativeLocaleTemplateUrlLoader); + void overrideDefaultSearchProvider(long nativeLocaleTemplateUrlLoader); +- - void setGoogleAsDefaultSearch(long nativeLocaleTemplateUrlLoader); } } diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json -index 17394cb89b700..3060973ae5d85 100644 +index 56071eb060744..78a89a41355fd 100644 --- a/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json @@ -123,6 +123,16 @@ @@ -188,10 +187,10 @@ index 76c4864971fe3..480f404b581d6 100644 // First check the main search URL. if (SameDomain( diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc -index c32c5f5fe849e..2fed67724079c 100644 +index ebedf7253afab..b21cf06fc9078 100644 --- a/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc -@@ -56,10 +56,10 @@ struct EngineAndTier { +@@ -61,10 +61,10 @@ struct EngineAndTier { // Default (for countries with no better engine set) constexpr EngineAndTier engines_default[] = { @@ -206,7 +205,7 @@ index c32c5f5fe849e..2fed67724079c 100644 }; // Note, the below entries are sorted by country code, not the name in comment. -@@ -67,1216 +67,875 @@ constexpr EngineAndTier engines_default[] = { +@@ -72,1216 +72,875 @@ constexpr EngineAndTier engines_default[] = { // clang-format off // United Arab Emirates constexpr EngineAndTier engines_AE[] = { @@ -1762,7 +1761,7 @@ index c32c5f5fe849e..2fed67724079c 100644 }; // clang-format on -@@ -1609,8 +1268,6 @@ const std::vector GetPrepopulationSetFromCountryID( +@@ -1614,8 +1273,6 @@ const std::vector GetPrepopulationSetFromCountryID( for (size_t i = 0; i < num_engines; i++) { t_url.push_back(engines[i]); } @@ -1771,7 +1770,7 @@ index c32c5f5fe849e..2fed67724079c 100644 return t_url; } -@@ -1779,7 +1436,7 @@ std::vector> GetPrepopulatedEngines( +@@ -1823,7 +1480,7 @@ std::vector> GetPrepopulatedEngines( } if (default_search_provider_index) { const auto itr = diff --git a/build/e_patches/0027-Browser-Redirect-users-to-e-foundation-docs.patch b/build/e_patches/0023-Browser-Redirect-users-to-e-foundation-docs.patch similarity index 85% rename from build/e_patches/0027-Browser-Redirect-users-to-e-foundation-docs.patch rename to build/e_patches/0023-Browser-Redirect-users-to-e-foundation-docs.patch index 5c6802e5fbe774728783745ada96482e815c3939..709ccee6d36fbb688ed5ef36f6d3cc10359da26b 100644 --- a/build/e_patches/0027-Browser-Redirect-users-to-e-foundation-docs.patch +++ b/build/e_patches/0023-Browser-Redirect-users-to-e-foundation-docs.patch @@ -1,7 +1,7 @@ -From 28adc687e71e7a5aeb677c3c29960216031fb89f Mon Sep 17 00:00:00 2001 +From 1df09d83c5e787ec11b615cdc05f681f977a076b Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Tue, 11 May 2021 14:22:00 +0200 -Subject: [PATCH] Browser: Redirect users to e foundation docs +Subject: [PATCH 23/48] Browser: Redirect users to e foundation docs Signed-off-by: Aayush Gupta --- @@ -10,7 +10,7 @@ Signed-off-by: Aayush Gupta 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java -index cf2e3ae9ed8f2..aa7706f656002 100644 +index 6b41ef2adcf85..426a5be62d41c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java @@ -30,7 +30,7 @@ import java.util.Map; @@ -23,12 +23,12 @@ index cf2e3ae9ed8f2..aa7706f656002 100644 private static ProfileKeyedMap sProfileToLauncherMap; private final HelpAndFeedbackLauncherDelegate mDelegate; diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java -index 663e657e8ba94..d197e35985b3d 100644 +index b4410a1abd95f..1f99d13ab8b86 100644 --- a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java +++ b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java -@@ -16,7 +16,7 @@ import androidx.annotation.NonNull; - * Delegate that handles the display of the HelpAndFeedback flows. - */ +@@ -14,7 +14,7 @@ import androidx.annotation.NonNull; + + /** Delegate that handles the display of the HelpAndFeedback flows. */ public interface HelpAndFeedbackLauncherDelegate { - static final String FALLBACK_SUPPORT_URL = "https://support.google.com/chrome/topic/6069782"; + static final String FALLBACK_SUPPORT_URL = "https://doc.e.foundation/how-tos/"; diff --git a/build/e_patches/0028-Add-Mojeek-Search-engine.patch b/build/e_patches/0024-Add-Mojeek-Search-engine.patch similarity index 77% rename from build/e_patches/0028-Add-Mojeek-Search-engine.patch rename to build/e_patches/0024-Add-Mojeek-Search-engine.patch index f3852d88c2b3cadd90abff439dd14d0d996acf74..b385d5826df9f131b22ff7b13527781ac9bcdda1 100644 --- a/build/e_patches/0028-Add-Mojeek-Search-engine.patch +++ b/build/e_patches/0024-Add-Mojeek-Search-engine.patch @@ -1,17 +1,17 @@ -From 0fc1b090d3af2dd362a630e41a30162b1906ca9d Mon Sep 17 00:00:00 2001 +From 267045ad1d8b6e6012c5a391a8635859b9e33bb2 Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Wed, 16 Nov 2022 11:14:01 +0000 -Subject: [PATCH] Add Mojeek Search engine +Subject: [PATCH 24/48] Add Mojeek Search engine --- .../template_url_prepopulate_data.cc | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc -index 2fed67724079c..4766af2ac2c81 100644 +index b21cf06fc9078..6ab94039a785a 100644 --- a/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc -@@ -60,6 +60,7 @@ constexpr EngineAndTier engines_default[] = { +@@ -65,6 +65,7 @@ constexpr EngineAndTier engines_default[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -19,7 +19,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Note, the below entries are sorted by country code, not the name in comment. -@@ -71,6 +72,7 @@ constexpr EngineAndTier engines_AE[] = { +@@ -76,6 +77,7 @@ constexpr EngineAndTier engines_AE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -27,7 +27,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Albania -@@ -79,6 +81,7 @@ constexpr EngineAndTier engines_AL[] = { +@@ -84,6 +86,7 @@ constexpr EngineAndTier engines_AL[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -35,7 +35,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Argentina -@@ -87,6 +90,7 @@ constexpr EngineAndTier engines_AR[] = { +@@ -92,6 +95,7 @@ constexpr EngineAndTier engines_AR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -43,7 +43,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Austria -@@ -95,6 +99,7 @@ constexpr EngineAndTier engines_AT[] = { +@@ -100,6 +104,7 @@ constexpr EngineAndTier engines_AT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -51,7 +51,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Australia -@@ -103,6 +108,7 @@ constexpr EngineAndTier engines_AU[] = { +@@ -108,6 +113,7 @@ constexpr EngineAndTier engines_AU[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -59,7 +59,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Bosnia and Herzegovina -@@ -111,6 +117,7 @@ constexpr EngineAndTier engines_BA[] = { +@@ -116,6 +122,7 @@ constexpr EngineAndTier engines_BA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -67,7 +67,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Belgium -@@ -119,6 +126,7 @@ constexpr EngineAndTier engines_BE[] = { +@@ -124,6 +131,7 @@ constexpr EngineAndTier engines_BE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -75,7 +75,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Bulgaria -@@ -127,6 +135,7 @@ constexpr EngineAndTier engines_BG[] = { +@@ -132,6 +140,7 @@ constexpr EngineAndTier engines_BG[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -83,7 +83,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Bahrain -@@ -135,6 +144,7 @@ constexpr EngineAndTier engines_BH[] = { +@@ -140,6 +149,7 @@ constexpr EngineAndTier engines_BH[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -91,7 +91,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Burundi -@@ -143,6 +153,7 @@ constexpr EngineAndTier engines_BI[] = { +@@ -148,6 +158,7 @@ constexpr EngineAndTier engines_BI[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -99,7 +99,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Brunei -@@ -151,6 +162,7 @@ constexpr EngineAndTier engines_BN[] = { +@@ -156,6 +167,7 @@ constexpr EngineAndTier engines_BN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -107,7 +107,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Bolivia -@@ -159,6 +171,7 @@ constexpr EngineAndTier engines_BO[] = { +@@ -164,6 +176,7 @@ constexpr EngineAndTier engines_BO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -115,7 +115,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Brazil -@@ -167,6 +180,7 @@ constexpr EngineAndTier engines_BR[] = { +@@ -172,6 +185,7 @@ constexpr EngineAndTier engines_BR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -123,7 +123,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Belarus -@@ -175,6 +189,7 @@ constexpr EngineAndTier engines_BY[] = { +@@ -180,6 +194,7 @@ constexpr EngineAndTier engines_BY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -131,7 +131,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Belize -@@ -183,6 +198,7 @@ constexpr EngineAndTier engines_BZ[] = { +@@ -188,6 +203,7 @@ constexpr EngineAndTier engines_BZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -139,7 +139,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Canada -@@ -191,6 +207,7 @@ constexpr EngineAndTier engines_CA[] = { +@@ -196,6 +212,7 @@ constexpr EngineAndTier engines_CA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -147,7 +147,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Switzerland -@@ -199,6 +216,7 @@ constexpr EngineAndTier engines_CH[] = { +@@ -204,6 +221,7 @@ constexpr EngineAndTier engines_CH[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -155,7 +155,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Chile -@@ -207,6 +225,7 @@ constexpr EngineAndTier engines_CL[] = { +@@ -212,6 +230,7 @@ constexpr EngineAndTier engines_CL[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -163,7 +163,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // China -@@ -215,6 +234,7 @@ constexpr EngineAndTier engines_CN[] = { +@@ -220,6 +239,7 @@ constexpr EngineAndTier engines_CN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -171,7 +171,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Colombia -@@ -223,6 +243,7 @@ constexpr EngineAndTier engines_CO[] = { +@@ -228,6 +248,7 @@ constexpr EngineAndTier engines_CO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -179,7 +179,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Costa Rica -@@ -231,6 +252,7 @@ constexpr EngineAndTier engines_CR[] = { +@@ -236,6 +257,7 @@ constexpr EngineAndTier engines_CR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -187,7 +187,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Republic of Cyprus -@@ -239,6 +261,7 @@ constexpr EngineAndTier engines_CY[] = { +@@ -244,6 +266,7 @@ constexpr EngineAndTier engines_CY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -195,7 +195,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Czech Republic -@@ -247,6 +270,7 @@ constexpr EngineAndTier engines_CZ[] = { +@@ -252,6 +275,7 @@ constexpr EngineAndTier engines_CZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -203,7 +203,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Germany -@@ -255,6 +279,7 @@ constexpr EngineAndTier engines_DE[] = { +@@ -260,6 +284,7 @@ constexpr EngineAndTier engines_DE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -211,7 +211,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Denmark -@@ -263,6 +288,7 @@ constexpr EngineAndTier engines_DK[] = { +@@ -268,6 +293,7 @@ constexpr EngineAndTier engines_DK[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -219,7 +219,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Dominican Republic -@@ -271,6 +297,7 @@ constexpr EngineAndTier engines_DO[] = { +@@ -276,6 +302,7 @@ constexpr EngineAndTier engines_DO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -227,7 +227,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Algeria -@@ -279,6 +306,7 @@ constexpr EngineAndTier engines_DZ[] = { +@@ -284,6 +311,7 @@ constexpr EngineAndTier engines_DZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -235,7 +235,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Ecuador -@@ -287,6 +315,7 @@ constexpr EngineAndTier engines_EC[] = { +@@ -292,6 +320,7 @@ constexpr EngineAndTier engines_EC[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -243,7 +243,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Estonia -@@ -295,6 +324,7 @@ constexpr EngineAndTier engines_EE[] = { +@@ -300,6 +329,7 @@ constexpr EngineAndTier engines_EE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -251,7 +251,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Egypt -@@ -303,6 +333,7 @@ constexpr EngineAndTier engines_EG[] = { +@@ -308,6 +338,7 @@ constexpr EngineAndTier engines_EG[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -259,7 +259,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Spain -@@ -311,6 +342,7 @@ constexpr EngineAndTier engines_ES[] = { +@@ -316,6 +347,7 @@ constexpr EngineAndTier engines_ES[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -267,7 +267,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Finland -@@ -319,6 +351,7 @@ constexpr EngineAndTier engines_FI[] = { +@@ -324,6 +356,7 @@ constexpr EngineAndTier engines_FI[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -275,7 +275,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Faroe Islands -@@ -327,6 +360,7 @@ constexpr EngineAndTier engines_FO[] = { +@@ -332,6 +365,7 @@ constexpr EngineAndTier engines_FO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -283,7 +283,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // France -@@ -335,6 +369,7 @@ constexpr EngineAndTier engines_FR[] = { +@@ -340,6 +374,7 @@ constexpr EngineAndTier engines_FR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -291,7 +291,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // United Kingdom -@@ -343,6 +378,7 @@ constexpr EngineAndTier engines_GB[] = { +@@ -348,6 +383,7 @@ constexpr EngineAndTier engines_GB[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -299,7 +299,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Greece -@@ -351,6 +387,7 @@ constexpr EngineAndTier engines_GR[] = { +@@ -356,6 +392,7 @@ constexpr EngineAndTier engines_GR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -307,7 +307,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Guatemala -@@ -359,6 +396,7 @@ constexpr EngineAndTier engines_GT[] = { +@@ -364,6 +401,7 @@ constexpr EngineAndTier engines_GT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -315,7 +315,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Hong Kong -@@ -367,6 +405,7 @@ constexpr EngineAndTier engines_HK[] = { +@@ -372,6 +410,7 @@ constexpr EngineAndTier engines_HK[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -323,7 +323,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Honduras -@@ -375,6 +414,7 @@ constexpr EngineAndTier engines_HN[] = { +@@ -380,6 +419,7 @@ constexpr EngineAndTier engines_HN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -331,7 +331,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Croatia -@@ -383,6 +423,7 @@ constexpr EngineAndTier engines_HR[] = { +@@ -388,6 +428,7 @@ constexpr EngineAndTier engines_HR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -339,7 +339,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Hungary -@@ -391,6 +432,7 @@ constexpr EngineAndTier engines_HU[] = { +@@ -396,6 +437,7 @@ constexpr EngineAndTier engines_HU[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -347,7 +347,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Indonesia -@@ -399,6 +441,7 @@ constexpr EngineAndTier engines_ID[] = { +@@ -404,6 +446,7 @@ constexpr EngineAndTier engines_ID[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -355,7 +355,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Ireland -@@ -407,6 +450,7 @@ constexpr EngineAndTier engines_IE[] = { +@@ -412,6 +455,7 @@ constexpr EngineAndTier engines_IE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -363,7 +363,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Israel -@@ -415,6 +459,7 @@ constexpr EngineAndTier engines_IL[] = { +@@ -420,6 +464,7 @@ constexpr EngineAndTier engines_IL[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -371,7 +371,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // India -@@ -423,6 +468,7 @@ constexpr EngineAndTier engines_IN[] = { +@@ -428,6 +473,7 @@ constexpr EngineAndTier engines_IN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -379,7 +379,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Iraq -@@ -431,6 +477,7 @@ constexpr EngineAndTier engines_IQ[] = { +@@ -436,6 +482,7 @@ constexpr EngineAndTier engines_IQ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -387,7 +387,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Iran -@@ -439,6 +486,7 @@ constexpr EngineAndTier engines_IR[] = { +@@ -444,6 +491,7 @@ constexpr EngineAndTier engines_IR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -395,7 +395,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Iceland -@@ -447,6 +495,7 @@ constexpr EngineAndTier engines_IS[] = { +@@ -452,6 +500,7 @@ constexpr EngineAndTier engines_IS[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -403,7 +403,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Italy -@@ -455,6 +504,7 @@ constexpr EngineAndTier engines_IT[] = { +@@ -460,6 +509,7 @@ constexpr EngineAndTier engines_IT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -411,7 +411,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Jamaica -@@ -463,6 +513,7 @@ constexpr EngineAndTier engines_JM[] = { +@@ -468,6 +518,7 @@ constexpr EngineAndTier engines_JM[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -419,7 +419,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Jordan -@@ -471,6 +522,7 @@ constexpr EngineAndTier engines_JO[] = { +@@ -476,6 +527,7 @@ constexpr EngineAndTier engines_JO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -427,7 +427,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Japan -@@ -479,6 +531,7 @@ constexpr EngineAndTier engines_JP[] = { +@@ -484,6 +536,7 @@ constexpr EngineAndTier engines_JP[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -435,7 +435,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Kenya -@@ -487,6 +540,7 @@ constexpr EngineAndTier engines_KE[] = { +@@ -492,6 +545,7 @@ constexpr EngineAndTier engines_KE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -443,7 +443,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // South Korea -@@ -495,6 +549,7 @@ constexpr EngineAndTier engines_KR[] = { +@@ -500,6 +554,7 @@ constexpr EngineAndTier engines_KR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -451,7 +451,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Kuwait -@@ -503,6 +558,7 @@ constexpr EngineAndTier engines_KW[] = { +@@ -508,6 +563,7 @@ constexpr EngineAndTier engines_KW[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -459,7 +459,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Kazakhstan -@@ -511,6 +567,7 @@ constexpr EngineAndTier engines_KZ[] = { +@@ -516,6 +572,7 @@ constexpr EngineAndTier engines_KZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -467,7 +467,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Lebanon -@@ -519,6 +576,7 @@ constexpr EngineAndTier engines_LB[] = { +@@ -524,6 +581,7 @@ constexpr EngineAndTier engines_LB[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -475,7 +475,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Liechtenstein -@@ -527,6 +585,7 @@ constexpr EngineAndTier engines_LI[] = { +@@ -532,6 +590,7 @@ constexpr EngineAndTier engines_LI[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -483,7 +483,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Lithuania -@@ -535,6 +594,7 @@ constexpr EngineAndTier engines_LT[] = { +@@ -540,6 +599,7 @@ constexpr EngineAndTier engines_LT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -491,7 +491,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Luxembourg -@@ -543,6 +603,7 @@ constexpr EngineAndTier engines_LU[] = { +@@ -548,6 +608,7 @@ constexpr EngineAndTier engines_LU[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -499,7 +499,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Latvia -@@ -551,6 +612,7 @@ constexpr EngineAndTier engines_LV[] = { +@@ -556,6 +617,7 @@ constexpr EngineAndTier engines_LV[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -507,7 +507,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; -@@ -560,6 +622,7 @@ constexpr EngineAndTier engines_LY[] = { +@@ -565,6 +627,7 @@ constexpr EngineAndTier engines_LY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -515,7 +515,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Morocco -@@ -568,6 +631,7 @@ constexpr EngineAndTier engines_MA[] = { +@@ -573,6 +636,7 @@ constexpr EngineAndTier engines_MA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -523,7 +523,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Monaco -@@ -576,6 +640,7 @@ constexpr EngineAndTier engines_MC[] = { +@@ -581,6 +645,7 @@ constexpr EngineAndTier engines_MC[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -531,7 +531,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Moldova -@@ -584,6 +649,7 @@ constexpr EngineAndTier engines_MD[] = { +@@ -589,6 +654,7 @@ constexpr EngineAndTier engines_MD[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -539,7 +539,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Montenegro -@@ -592,6 +658,7 @@ constexpr EngineAndTier engines_ME[] = { +@@ -597,6 +663,7 @@ constexpr EngineAndTier engines_ME[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -547,7 +547,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Macedonia -@@ -600,6 +667,7 @@ constexpr EngineAndTier engines_MK[] = { +@@ -605,6 +672,7 @@ constexpr EngineAndTier engines_MK[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -555,7 +555,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Malta -@@ -608,6 +676,7 @@ constexpr EngineAndTier engines_MT[] = { +@@ -613,6 +681,7 @@ constexpr EngineAndTier engines_MT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -563,7 +563,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Mexico -@@ -616,6 +685,7 @@ constexpr EngineAndTier engines_MX[] = { +@@ -621,6 +690,7 @@ constexpr EngineAndTier engines_MX[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -571,7 +571,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Malaysia -@@ -624,6 +694,7 @@ constexpr EngineAndTier engines_MY[] = { +@@ -629,6 +699,7 @@ constexpr EngineAndTier engines_MY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -579,7 +579,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Nicaragua -@@ -632,6 +703,7 @@ constexpr EngineAndTier engines_NI[] = { +@@ -637,6 +708,7 @@ constexpr EngineAndTier engines_NI[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -587,7 +587,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Netherlands -@@ -640,6 +712,7 @@ constexpr EngineAndTier engines_NL[] = { +@@ -645,6 +717,7 @@ constexpr EngineAndTier engines_NL[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -595,7 +595,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Norway -@@ -648,6 +721,7 @@ constexpr EngineAndTier engines_NO[] = { +@@ -653,6 +726,7 @@ constexpr EngineAndTier engines_NO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -603,7 +603,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // New Zealand -@@ -656,6 +730,7 @@ constexpr EngineAndTier engines_NZ[] = { +@@ -661,6 +735,7 @@ constexpr EngineAndTier engines_NZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -611,7 +611,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Oman -@@ -664,6 +739,7 @@ constexpr EngineAndTier engines_OM[] = { +@@ -669,6 +744,7 @@ constexpr EngineAndTier engines_OM[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -619,7 +619,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Panama -@@ -672,6 +748,7 @@ constexpr EngineAndTier engines_PA[] = { +@@ -677,6 +753,7 @@ constexpr EngineAndTier engines_PA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -627,7 +627,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Peru -@@ -680,6 +757,7 @@ constexpr EngineAndTier engines_PE[] = { +@@ -685,6 +762,7 @@ constexpr EngineAndTier engines_PE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -635,7 +635,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Philippines -@@ -688,6 +766,7 @@ constexpr EngineAndTier engines_PH[] = { +@@ -693,6 +771,7 @@ constexpr EngineAndTier engines_PH[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -643,7 +643,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Pakistan -@@ -696,6 +775,7 @@ constexpr EngineAndTier engines_PK[] = { +@@ -701,6 +780,7 @@ constexpr EngineAndTier engines_PK[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -651,7 +651,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Poland -@@ -704,6 +784,7 @@ constexpr EngineAndTier engines_PL[] = { +@@ -709,6 +789,7 @@ constexpr EngineAndTier engines_PL[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -659,7 +659,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Puerto Rico -@@ -712,6 +793,7 @@ constexpr EngineAndTier engines_PR[] = { +@@ -717,6 +798,7 @@ constexpr EngineAndTier engines_PR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -667,7 +667,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Portugal -@@ -720,6 +802,7 @@ constexpr EngineAndTier engines_PT[] = { +@@ -725,6 +807,7 @@ constexpr EngineAndTier engines_PT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -675,7 +675,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Paraguay -@@ -728,6 +811,7 @@ constexpr EngineAndTier engines_PY[] = { +@@ -733,6 +816,7 @@ constexpr EngineAndTier engines_PY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -683,7 +683,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Qatar -@@ -736,6 +820,7 @@ constexpr EngineAndTier engines_QA[] = { +@@ -741,6 +825,7 @@ constexpr EngineAndTier engines_QA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -691,7 +691,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Romania -@@ -744,6 +829,7 @@ constexpr EngineAndTier engines_RO[] = { +@@ -749,6 +834,7 @@ constexpr EngineAndTier engines_RO[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -699,7 +699,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Serbia -@@ -752,6 +838,7 @@ constexpr EngineAndTier engines_RS[] = { +@@ -757,6 +843,7 @@ constexpr EngineAndTier engines_RS[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -707,7 +707,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Russia -@@ -760,6 +847,7 @@ constexpr EngineAndTier engines_RU[] = { +@@ -765,6 +852,7 @@ constexpr EngineAndTier engines_RU[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -715,7 +715,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Rwanda -@@ -768,6 +856,7 @@ constexpr EngineAndTier engines_RW[] = { +@@ -773,6 +861,7 @@ constexpr EngineAndTier engines_RW[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -723,7 +723,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Saudi Arabia -@@ -776,6 +865,7 @@ constexpr EngineAndTier engines_SA[] = { +@@ -781,6 +870,7 @@ constexpr EngineAndTier engines_SA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -731,7 +731,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Sweden -@@ -784,6 +874,7 @@ constexpr EngineAndTier engines_SE[] = { +@@ -789,6 +879,7 @@ constexpr EngineAndTier engines_SE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -739,7 +739,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Singapore -@@ -792,6 +883,7 @@ constexpr EngineAndTier engines_SG[] = { +@@ -797,6 +888,7 @@ constexpr EngineAndTier engines_SG[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -747,7 +747,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Slovenia -@@ -800,6 +892,7 @@ constexpr EngineAndTier engines_SI[] = { +@@ -805,6 +897,7 @@ constexpr EngineAndTier engines_SI[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -755,7 +755,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Slovakia -@@ -808,6 +901,7 @@ constexpr EngineAndTier engines_SK[] = { +@@ -813,6 +906,7 @@ constexpr EngineAndTier engines_SK[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -763,7 +763,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // El Salvador -@@ -816,6 +910,7 @@ constexpr EngineAndTier engines_SV[] = { +@@ -821,6 +915,7 @@ constexpr EngineAndTier engines_SV[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -771,7 +771,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Syria -@@ -824,6 +919,7 @@ constexpr EngineAndTier engines_SY[] = { +@@ -829,6 +924,7 @@ constexpr EngineAndTier engines_SY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -779,7 +779,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Thailand -@@ -832,6 +928,7 @@ constexpr EngineAndTier engines_TH[] = { +@@ -837,6 +933,7 @@ constexpr EngineAndTier engines_TH[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -787,7 +787,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Tunisia -@@ -840,6 +937,7 @@ constexpr EngineAndTier engines_TN[] = { +@@ -845,6 +942,7 @@ constexpr EngineAndTier engines_TN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -795,7 +795,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Turkey -@@ -848,6 +946,7 @@ constexpr EngineAndTier engines_TR[] = { +@@ -853,6 +951,7 @@ constexpr EngineAndTier engines_TR[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -803,7 +803,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Trinidad and Tobago -@@ -856,6 +955,7 @@ constexpr EngineAndTier engines_TT[] = { +@@ -861,6 +960,7 @@ constexpr EngineAndTier engines_TT[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -811,7 +811,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Taiwan -@@ -864,6 +964,7 @@ constexpr EngineAndTier engines_TW[] = { +@@ -869,6 +969,7 @@ constexpr EngineAndTier engines_TW[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -819,7 +819,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Tanzania -@@ -872,6 +973,7 @@ constexpr EngineAndTier engines_TZ[] = { +@@ -877,6 +978,7 @@ constexpr EngineAndTier engines_TZ[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -827,7 +827,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Ukraine -@@ -880,6 +982,7 @@ constexpr EngineAndTier engines_UA[] = { +@@ -885,6 +987,7 @@ constexpr EngineAndTier engines_UA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -835,7 +835,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // United States -@@ -888,6 +991,7 @@ constexpr EngineAndTier engines_US[] = { +@@ -893,6 +996,7 @@ constexpr EngineAndTier engines_US[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -843,7 +843,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Uruguay -@@ -896,6 +1000,7 @@ constexpr EngineAndTier engines_UY[] = { +@@ -901,6 +1005,7 @@ constexpr EngineAndTier engines_UY[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -851,7 +851,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Venezuela -@@ -904,6 +1009,7 @@ constexpr EngineAndTier engines_VE[] = { +@@ -909,6 +1014,7 @@ constexpr EngineAndTier engines_VE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -859,7 +859,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Vietnam -@@ -912,6 +1018,7 @@ constexpr EngineAndTier engines_VN[] = { +@@ -917,6 +1023,7 @@ constexpr EngineAndTier engines_VN[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -867,7 +867,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Yemen -@@ -920,6 +1027,7 @@ constexpr EngineAndTier engines_YE[] = { +@@ -925,6 +1032,7 @@ constexpr EngineAndTier engines_YE[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -875,7 +875,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // South Africa -@@ -928,6 +1036,7 @@ constexpr EngineAndTier engines_ZA[] = { +@@ -933,6 +1041,7 @@ constexpr EngineAndTier engines_ZA[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, @@ -883,7 +883,7 @@ index 2fed67724079c..4766af2ac2c81 100644 }; // Zimbabwe -@@ -936,6 +1045,7 @@ constexpr EngineAndTier engines_ZW[] = { +@@ -941,6 +1050,7 @@ constexpr EngineAndTier engines_ZW[] = { {SearchEngineTier::kTopEngines, &qwant}, {SearchEngineTier::kTopEngines, &duckduckgo}, {SearchEngineTier::kTopEngines, &duckduckgo_light}, diff --git a/build/e_patches/0029-Revert-TM-Add-themed-app-icons.patch b/build/e_patches/0025-Revert-TM-Add-themed-app-icons.patch similarity index 94% rename from build/e_patches/0029-Revert-TM-Add-themed-app-icons.patch rename to build/e_patches/0025-Revert-TM-Add-themed-app-icons.patch index 9638a440720566650770eb69809a8aca69f3052e..d0903505d77b8b71af40427c7602b2def7ac8d1c 100644 --- a/build/e_patches/0029-Revert-TM-Add-themed-app-icons.patch +++ b/build/e_patches/0025-Revert-TM-Add-themed-app-icons.patch @@ -1,7 +1,7 @@ -From 4d1a518eac81e847829a0367f2b89dda11fe75f4 Mon Sep 17 00:00:00 2001 +From 6029d6e392ce7887974a1c2ef98c1698fb360c71 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 18 Nov 2022 09:48:02 +0000 -Subject: [PATCH] Revert "[TM] Add themed app icons" +Subject: [PATCH 25/48] Revert "[TM] Add themed app icons" This reverts commit 9faa242a0c09838268d7c969acdf493f29ef3db5. --- @@ -13,10 +13,10 @@ This reverts commit 9faa242a0c09838268d7c969acdf493f29ef3db5. delete mode 100644 chrome/android/java/res_chromium_base/drawable/themed_app_icon.xml diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index aab9ff8afc0d9..d5eafa471ddce 100644 +index 0baa87d367c63..c9a2591f7dc73 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -154,7 +154,6 @@ if (current_toolchain == default_toolchain) { +@@ -156,7 +156,6 @@ if (current_toolchain == default_toolchain) { "java/res_base/values/ic_launcher_round_alias.xml", "java/res_base/values/values.xml", "java/res_base/xml/network_security_config.xml", @@ -24,7 +24,7 @@ index aab9ff8afc0d9..d5eafa471ddce 100644 "java/res_chromium_base/mipmap-hdpi/app_icon.png", "java/res_chromium_base/mipmap-hdpi/layered_app_icon.png", "java/res_chromium_base/mipmap-hdpi/layered_app_icon_background.png", -@@ -2135,7 +2134,6 @@ if (current_toolchain == default_toolchain) { +@@ -2174,7 +2173,6 @@ if (current_toolchain == default_toolchain) { android_resources("chrome_public_apk_base_module_resources") { resource_overlay = true sources = [ diff --git a/build/e_patches/0030-Browser-Use-our-custom-icon-for-browser.patch b/build/e_patches/0026-Browser-Use-our-custom-icon-for-browser.patch similarity index 99% rename from build/e_patches/0030-Browser-Use-our-custom-icon-for-browser.patch rename to build/e_patches/0026-Browser-Use-our-custom-icon-for-browser.patch index e148886c2762c0ed6036d32e21fc73859da9ceab..d79c46cb3a1b1a603b854aae91b403cc0b0f19e5 100644 --- a/build/e_patches/0030-Browser-Use-our-custom-icon-for-browser.patch +++ b/build/e_patches/0026-Browser-Use-our-custom-icon-for-browser.patch @@ -1,7 +1,7 @@ -From ff05e9415eae1eecb06fa925eaf77945c6d349e7 Mon Sep 17 00:00:00 2001 +From 9d53b2fd36cafbc58c18de323ce0036d4b4840f3 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 18 Nov 2022 10:07:39 +0000 -Subject: [PATCH] Browser: Use our custom icon for browser +Subject: [PATCH 26/48] Browser: Use our custom icon for browser --- chrome/android/BUILD.gn | 44 ++++++++++-------- @@ -64,10 +64,10 @@ Subject: [PATCH] Browser: Use our custom icon for browser delete mode 100644 chrome/android/java/res_chromium_base/mipmap-xxxhdpi/layered_app_icon_background.png diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index d5eafa471ddce..494f5886e6e0e 100644 +index c9a2591f7dc73..a17778671ad7a 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -154,22 +154,24 @@ if (current_toolchain == default_toolchain) { +@@ -156,22 +156,24 @@ if (current_toolchain == default_toolchain) { "java/res_base/values/ic_launcher_round_alias.xml", "java/res_base/values/values.xml", "java/res_base/xml/network_security_config.xml", @@ -102,7 +102,7 @@ index d5eafa471ddce..494f5886e6e0e 100644 "java/res_chromium_base/values/channel_constants.xml", ] } -@@ -2134,22 +2136,24 @@ if (current_toolchain == default_toolchain) { +@@ -2173,22 +2175,24 @@ if (current_toolchain == default_toolchain) { android_resources("chrome_public_apk_base_module_resources") { resource_overlay = true sources = [ diff --git a/build/e_patches/0031-Browser-Rename-strings-to-browser.patch b/build/e_patches/0027-Browser-Rename-strings-to-browser.patch similarity index 90% rename from build/e_patches/0031-Browser-Rename-strings-to-browser.patch rename to build/e_patches/0027-Browser-Rename-strings-to-browser.patch index 4da7204da441dcac2601bd7f59c88ae722d77798..529c1e056e9469feca124cd3b8c3cae48504c15f 100644 --- a/build/e_patches/0031-Browser-Rename-strings-to-browser.patch +++ b/build/e_patches/0027-Browser-Rename-strings-to-browser.patch @@ -1,7 +1,7 @@ -From cffff4147d9a4c559c09b2e4ca3f83cb26763c61 Mon Sep 17 00:00:00 2001 +From c53069ac917bd95f20cd0e3be45084584920669e Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Fri, 26 Nov 2021 07:12:30 +0000 -Subject: [PATCH] Browser: Rename strings to browser +Subject: [PATCH 27/48] Browser: Rename strings to browser Signed-off-by: Aayush Gupta --- @@ -27,10 +27,10 @@ index fb1dfed23052b..d5092508ce452 100644 android:key="application_version" android:title="@string/application_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 -index f59f62fdf971b..b21f56b38c685 100644 +index ee2974262b5f9..ec590dc22bf31 100644 --- 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 -@@ -30,7 +30,7 @@ public class AboutChromeSettings +@@ -28,7 +28,7 @@ public class AboutChromeSettings extends PreferenceFragmentCompat private static final String PREF_APPLICATION_VERSION = "application_version"; private static final String PREF_OS_VERSION = "os_version"; @@ -39,7 +39,7 @@ index f59f62fdf971b..b21f56b38c685 100644 // Non-translated strings: private static final String MSG_DEVELOPER_ENABLE_COUNTDOWN = -@@ -56,9 +56,9 @@ public class AboutChromeSettings +@@ -54,9 +54,9 @@ public class AboutChromeSettings extends PreferenceFragmentCompat p.setOnPreferenceClickListener(this); p = findPreference(PREF_OS_VERSION); p.setSummary(AboutSettingsBridge.getOSVersion()); @@ -53,7 +53,7 @@ index f59f62fdf971b..b21f56b38c685 100644 /** diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd -index 9354ba7b6beef..7ae63f7eb0b36 100644 +index 403649548ad3b..e96eecb96f892 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd @@ -202,6 +202,8 @@ CHAR_LIMIT guidelines: @@ -62,9 +62,9 @@ index 9354ba7b6beef..7ae63f7eb0b36 100644 + + + - diff --git a/chrome/browser/ui/android/strings/foundation_e.grdp b/chrome/browser/ui/android/strings/foundation_e.grdp new file mode 100644 index 0000000000000..49da40abd38e7 diff --git a/build/e_patches/0032-Browser-Use-adaptive-icon-for-recents-UI.patch b/build/e_patches/0028-Browser-Use-adaptive-icon-for-recents-UI.patch similarity index 83% rename from build/e_patches/0032-Browser-Use-adaptive-icon-for-recents-UI.patch rename to build/e_patches/0028-Browser-Use-adaptive-icon-for-recents-UI.patch index 7edb86d1bbcbdae6d737a6f651957323b6d4fca3..e69b765529e85b5896e4d250639bdb0090684cab 100644 --- a/build/e_patches/0032-Browser-Use-adaptive-icon-for-recents-UI.patch +++ b/build/e_patches/0028-Browser-Use-adaptive-icon-for-recents-UI.patch @@ -1,14 +1,14 @@ -From ff7babc33e13fb65a3f0d5b47ffb6e46e8255a78 Mon Sep 17 00:00:00 2001 +From 34b79d405bd96084e40b5166ab050b680d911d93 Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 14 Dec 2022 12:18:50 +0530 -Subject: [PATCH] Browser: Use adaptive icon for recents UI +Subject: [PATCH 28/48] Browser: Use adaptive icon for recents UI --- .../chrome/browser/ChromeBaseAppCompatActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java -index e7ff7e1204126..1e13e6d5e5ba5 100644 +index 243a82d64e95e..45e5887950bdc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java @@ -12,6 +12,8 @@ import android.app.ActivityManager.TaskDescription; @@ -20,9 +20,9 @@ index e7ff7e1204126..1e13e6d5e5ba5 100644 import android.os.Build; import android.os.Bundle; import android.view.MenuItem; -@@ -328,11 +330,15 @@ public class ChromeBaseAppCompatActivity extends AppCompatActivity - * Sets the default task description that will appear in the recents UI. - */ +@@ -341,11 +343,15 @@ public class ChromeBaseAppCompatActivity extends AppCompatActivity + + /** Sets the default task description that will appear in the recents UI. */ protected void setDefaultTaskDescription() { + final Resources res = getResources(); final TaskDescription taskDescription = diff --git a/build/e_patches/0033-Browser-Change-info-bar-icon.patch b/build/e_patches/0029-Browser-Change-info-bar-icon.patch similarity index 99% rename from build/e_patches/0033-Browser-Change-info-bar-icon.patch rename to build/e_patches/0029-Browser-Change-info-bar-icon.patch index 716fb405a84c4af47d2ca883a3cd24bbd919257a..aec3845d934ffca4277a6482845203c2b92b1e89 100644 --- a/build/e_patches/0033-Browser-Change-info-bar-icon.patch +++ b/build/e_patches/0029-Browser-Change-info-bar-icon.patch @@ -1,7 +1,7 @@ -From a98e6fd7c4e5b7e761b6f5beaa5a6ef951ce589e Mon Sep 17 00:00:00 2001 +From c0891db2832fb470009bbe79b9bc066bed848f61 Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 14 Dec 2022 16:17:58 +0530 -Subject: [PATCH] Browser: Change info bar icon +Subject: [PATCH 29/48] Browser: Change info bar icon --- .../java/res/drawable-hdpi/infobar_chrome.png | Bin 1039 -> 1450 bytes diff --git a/build/e_patches/0034-Browser-Remove-logo-from-chrome-version.patch b/build/e_patches/0030-Browser-Remove-logo-from-chrome-version.patch similarity index 90% rename from build/e_patches/0034-Browser-Remove-logo-from-chrome-version.patch rename to build/e_patches/0030-Browser-Remove-logo-from-chrome-version.patch index 8e73988b2d79cd1a82edf5bd0d54819f50c679c6..88326e6dbc67991d69a1169bf4a481546a18d320 100644 --- a/build/e_patches/0034-Browser-Remove-logo-from-chrome-version.patch +++ b/build/e_patches/0030-Browser-Remove-logo-from-chrome-version.patch @@ -1,7 +1,7 @@ -From 144779f2b3994f1cb55839e6d6ddaa71e7a63817 Mon Sep 17 00:00:00 2001 +From ffa32fdd95bc61918dd1ee2f79012039da108587 Mon Sep 17 00:00:00 2001 From: A Mak Date: Sat, 25 Jul 2020 17:56:47 -0700 -Subject: [PATCH] Browser: Remove logo from chrome://version +Subject: [PATCH 30/48] Browser: Remove logo from chrome://version --- components/version_ui/resources/about_version.html | 7 ------- diff --git a/build/e_patches/0035-Browser-disable-search-provider-logo.patch b/build/e_patches/0031-Browser-disable-search-provider-logo.patch similarity index 91% rename from build/e_patches/0035-Browser-disable-search-provider-logo.patch rename to build/e_patches/0031-Browser-disable-search-provider-logo.patch index 4b9975a8a5c9c92750fd35e42cf5fe16e6c4a266..8005a17730c312f2d68857231f0efa8f65e1371d 100644 --- a/build/e_patches/0035-Browser-disable-search-provider-logo.patch +++ b/build/e_patches/0031-Browser-disable-search-provider-logo.patch @@ -1,14 +1,14 @@ -From 6d7ba40d8cce227cf02177ebb72ce2834363804e Mon Sep 17 00:00:00 2001 +From c16a070e47df9899d185e0c5326b698d1ad1a23e Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 17 Jun 2019 12:03:52 -0400 -Subject: [PATCH] Browser: disable search provider logo +Subject: [PATCH 31/48] Browser: disable search provider logo --- .../android/template_url_service_android.cc | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/components/search_engines/android/template_url_service_android.cc b/components/search_engines/android/template_url_service_android.cc -index 1e3f21a5abc94..32213634a5d9d 100644 +index c43eb00e5dbb6..6f1294a497fd8 100644 --- a/components/search_engines/android/template_url_service_android.cc +++ b/components/search_engines/android/template_url_service_android.cc @@ -103,28 +103,7 @@ jboolean TemplateUrlServiceAndroid::IsSearchByImageAvailable( diff --git a/build/e_patches/0036-Browser-disable-first-run-welcome-page.patch b/build/e_patches/0032-Browser-disable-first-run-welcome-page.patch similarity index 78% rename from build/e_patches/0036-Browser-disable-first-run-welcome-page.patch rename to build/e_patches/0032-Browser-disable-first-run-welcome-page.patch index c08ce47ffee9746c762d00214b0d3547a6539c68..8f2d344dd3d712e300f88cfbd8ab1d5a45ce1ee0 100644 --- a/build/e_patches/0036-Browser-disable-first-run-welcome-page.patch +++ b/build/e_patches/0032-Browser-disable-first-run-welcome-page.patch @@ -1,7 +1,7 @@ -From d7d42c8afef11e649dd29f44a7f5eabbc3a26223 Mon Sep 17 00:00:00 2001 +From 2b1daa381ae4798f098a8a024a195aa4c16b82b3 Mon Sep 17 00:00:00 2001 From: csagan5 <32685696+csagan5@users.noreply.github.com> Date: Sun, 26 Nov 2017 22:51:43 +0100 -Subject: [PATCH] Browser: disable first run welcome page +Subject: [PATCH 32/48] Browser: disable first run welcome page --- .../org/chromium/chrome/browser/firstrun/FirstRunUtils.java | 3 --- @@ -9,10 +9,10 @@ Subject: [PATCH] Browser: disable first run welcome page 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java -index 930938e44412f..16ef9d6251b45 100644 +index cfc6c1f6d254e..97638164ecda9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java -@@ -41,15 +41,12 @@ public class FirstRunUtils { +@@ -43,15 +43,12 @@ public class FirstRunUtils { boolean javaPrefValue = javaPrefs.readBoolean(ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, false); boolean nativePrefValue = isFirstRunEulaAccepted(); @@ -29,16 +29,16 @@ index 930938e44412f..16ef9d6251b45 100644 /** diff --git a/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java -index 12c311490bd72..cea4d48c0b68c 100644 +index 4aedb8a0f1d95..d10c15f0fad1c 100644 --- a/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java +++ b/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java -@@ -52,8 +52,12 @@ public class FirstRunStatus { +@@ -50,8 +50,12 @@ public class FirstRunStatus { * includes ToS and Sign In pages if necessary. */ public static boolean getFirstRunFlowComplete() { -- return SharedPreferencesManager.getInstance().readBoolean( -+ boolean complete = SharedPreferencesManager.getInstance().readBoolean( - ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, false); +- return ChromeSharedPreferences.getInstance() ++ boolean complete = ChromeSharedPreferences.getInstance() + .readBoolean(ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, false); + if (!complete) { + setFirstRunFlowComplete(true); + } diff --git a/build/e_patches/0037-disable-seed-based-field-trials.patch b/build/e_patches/0033-disable-seed-based-field-trials.patch similarity index 78% rename from build/e_patches/0037-disable-seed-based-field-trials.patch rename to build/e_patches/0033-disable-seed-based-field-trials.patch index 366627564b24bb022a192ccc891c55b084a3928d..49717b727a5dfb05a633be18fb54dd3bb4691831 100644 --- a/build/e_patches/0037-disable-seed-based-field-trials.patch +++ b/build/e_patches/0033-disable-seed-based-field-trials.patch @@ -1,17 +1,17 @@ -From d0ddb997c6dd0fb15e5d6d8755ecb41cde69b1a8 Mon Sep 17 00:00:00 2001 +From 962e354a7a05ae1e8fa883a9dde8a4d5fb6f85a7 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 25 Dec 2018 16:19:51 -0500 -Subject: [PATCH] disable seed-based field trials +Subject: [PATCH 33/48] disable seed-based field trials --- .../variations/service/variations_field_trial_creator_base.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/variations/service/variations_field_trial_creator_base.cc b/components/variations/service/variations_field_trial_creator_base.cc -index 58d5743d4fa2a..834dd48d13ea4 100644 +index e5404d2ca1a3c..4af32223b8bbe 100644 --- a/components/variations/service/variations_field_trial_creator_base.cc +++ b/components/variations/service/variations_field_trial_creator_base.cc -@@ -299,8 +299,10 @@ bool VariationsFieldTrialCreatorBase::SetUpFieldTrials( +@@ -297,8 +297,10 @@ bool VariationsFieldTrialCreatorBase::SetUpFieldTrials( bool used_seed = false; if (!used_testing_config) { diff --git a/build/e_patches/0038-disable-fetching-variations.patch b/build/e_patches/0034-disable-fetching-variations.patch similarity index 77% rename from build/e_patches/0038-disable-fetching-variations.patch rename to build/e_patches/0034-disable-fetching-variations.patch index 9e7c6cf002bc6b68e22fa693219f3316b013b589..54176f5777acbdb62e9203625ac103e933104d14 100644 --- a/build/e_patches/0038-disable-fetching-variations.patch +++ b/build/e_patches/0034-disable-fetching-variations.patch @@ -1,17 +1,17 @@ -From 3e004c5c88bffc89260c1cee84a7877b79a22704 Mon Sep 17 00:00:00 2001 +From bf3c888a72c659846ae87191ba8ce62da5e4dacc Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 18 Nov 2020 19:08:58 -0500 -Subject: [PATCH] disable fetching variations +Subject: [PATCH 34/48] disable fetching variations --- .../org/chromium/chrome/browser/init/AsyncInitTaskRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java -index 94602ddf3aab4..c74d2c7f4c036 100644 +index e8ac4ff761d66..96c6e30913934 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java -@@ -38,7 +38,7 @@ public abstract class AsyncInitTaskRunner { +@@ -39,7 +39,7 @@ public abstract class AsyncInitTaskRunner { @VisibleForTesting boolean shouldFetchVariationsSeedDuringFirstRun() { diff --git a/build/e_patches/0039-disable-navigation-error-correction-by-default.patch b/build/e_patches/0035-disable-navigation-error-correction-by-default.patch similarity index 79% rename from build/e_patches/0039-disable-navigation-error-correction-by-default.patch rename to build/e_patches/0035-disable-navigation-error-correction-by-default.patch index 0f69a55bf3e1fbe42d6dda2cd2a8854d3407c382..1761d6cd906e0bd8f07732288a6b0033ace512f4 100644 --- a/build/e_patches/0039-disable-navigation-error-correction-by-default.patch +++ b/build/e_patches/0035-disable-navigation-error-correction-by-default.patch @@ -1,17 +1,17 @@ -From 36d5a8eed6f287dc2790b520bd6e8b6b4d4e417f Mon Sep 17 00:00:00 2001 +From ffda4c56b8acc603e8bf51d9ad2fb99ece695ce7 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 23 Nov 2016 08:29:58 -0500 -Subject: [PATCH] disable navigation error correction by default +Subject: [PATCH 35/48] disable navigation error correction by default --- chrome/browser/net/profile_network_context_service.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc -index 6271f349464b9..a3c64d526dd54 100644 +index 5923117661980..efa80132a2a4c 100644 --- a/chrome/browser/net/profile_network_context_service.cc +++ b/chrome/browser/net/profile_network_context_service.cc -@@ -411,7 +411,7 @@ void ProfileNetworkContextService::UpdateAdditionalCertificates() { +@@ -360,7 +360,7 @@ void ProfileNetworkContextService::UpdateAdditionalCertificates() { void ProfileNetworkContextService::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref(embedder_support::kAlternateErrorPagesEnabled, diff --git a/build/e_patches/0040-Handle-web-search-action-in-browser.patch b/build/e_patches/0036-Handle-web-search-action-in-browser.patch similarity index 70% rename from build/e_patches/0040-Handle-web-search-action-in-browser.patch rename to build/e_patches/0036-Handle-web-search-action-in-browser.patch index 8a633593e391d5701410dbb02f88a09c75de4439..8d39ac156a422c98397033f8cf5a7112aae1f1b6 100644 --- a/build/e_patches/0040-Handle-web-search-action-in-browser.patch +++ b/build/e_patches/0036-Handle-web-search-action-in-browser.patch @@ -1,19 +1,19 @@ -From 5f98fa434ee6bbae78e5d395c6db2d6666fef87a Mon Sep 17 00:00:00 2001 +From 1f16e13ac9dec121afee8f226cdcf29c9c95c728 Mon Sep 17 00:00:00 2001 From: fgei Date: Wed, 28 Sep 2022 05:37:00 +0200 -Subject: [PATCH] Handle web search action in browser +Subject: [PATCH 36/48] Handle web search action in browser --- .../src/org/chromium/base/PackageManagerUtils.java | 10 ++++++++++ chrome/android/java/AndroidManifest.xml | 4 ++++ - .../chrome/browser/LaunchIntentDispatcher.java | 3 ++- - 3 files changed, 16 insertions(+), 1 deletion(-) + .../chrome/browser/LaunchIntentDispatcher.java | 2 +- + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/base/android/java/src/org/chromium/base/PackageManagerUtils.java b/base/android/java/src/org/chromium/base/PackageManagerUtils.java -index 2d1661ee534f6..2c983646ab42b 100644 +index 91d814c08fffa..9661167adf22b 100644 --- a/base/android/java/src/org/chromium/base/PackageManagerUtils.java +++ b/base/android/java/src/org/chromium/base/PackageManagerUtils.java -@@ -85,6 +85,16 @@ public class PackageManagerUtils { +@@ -84,6 +84,16 @@ public class PackageManagerUtils { return canResolveActivity(intent, 0); } @@ -31,10 +31,10 @@ index 2d1661ee534f6..2c983646ab42b 100644 * @return Intent to query a list of installed home launchers. */ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml -index f4a46b731ec36..fe23affef37d9 100644 +index 23053a389696c..6d8f9e42737a0 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml -@@ -332,6 +332,10 @@ by a child template that "extends" this file. +@@ -336,6 +336,10 @@ by a child template that "extends" this file. @@ -46,24 +46,16 @@ index f4a46b731ec36..fe23affef37d9 100644 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java -index 7bc4a960b5309..0d45115bc8da6 100644 +index b4dd554b006a5..98c7c36f6dbe8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java -@@ -205,6 +205,7 @@ public class LaunchIntentDispatcher { - String query = null; - final String action = intent.getAction(); - if (Intent.ACTION_SEARCH.equals(action) -+ || Intent.ACTION_WEB_SEARCH.equals(action) - || MediaStore.INTENT_ACTION_MEDIA_SEARCH.equals(action)) { - query = IntentUtils.safeGetStringExtra(intent, SearchManager.QUERY); - } -@@ -218,7 +219,7 @@ public class LaunchIntentDispatcher { +@@ -231,7 +231,7 @@ public class LaunchIntentDispatcher { searchIntent.putExtra(SearchManager.QUERY, query); try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) { - if (PackageManagerUtils.canResolveActivity( + if (PackageManagerUtils.canOnlyOthersResolveActivity( - searchIntent, PackageManager.GET_RESOLVED_FILTER)) { + searchIntent, PackageManager.GET_RESOLVED_FILTER)) { mActivity.startActivity(searchIntent); } else { -- diff --git a/build/e_patches/0041-Browser-Replace-default-tab-favicon.patch b/build/e_patches/0037-Browser-Replace-default-tab-favicon.patch similarity index 99% rename from build/e_patches/0041-Browser-Replace-default-tab-favicon.patch rename to build/e_patches/0037-Browser-Replace-default-tab-favicon.patch index b068836b5c18a061eaf13f1a2a90548fe8b08067..4fc92d6254e5126e81768c87a7066aa9d13a448c 100644 --- a/build/e_patches/0041-Browser-Replace-default-tab-favicon.patch +++ b/build/e_patches/0037-Browser-Replace-default-tab-favicon.patch @@ -1,7 +1,7 @@ -From a5122ce27f431f7073de4b87d64bbfb22e023bcd Mon Sep 17 00:00:00 2001 +From 67e6b7751677bc85636fb40c2ee057398b66ceac Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 2 Jan 2023 15:12:41 +0530 -Subject: [PATCH] Browser: Replace default tab favicon +Subject: [PATCH 37/48] Browser: Replace default tab favicon --- .../java/res/drawable-hdpi/chromelogo16.png | Bin 425 -> 1016 bytes diff --git a/build/e_patches/0042-Browser-Spoof-as-Pixel-4a-by-default.patch b/build/e_patches/0038-Browser-Spoof-as-Pixel-4a-by-default.patch similarity index 84% rename from build/e_patches/0042-Browser-Spoof-as-Pixel-4a-by-default.patch rename to build/e_patches/0038-Browser-Spoof-as-Pixel-4a-by-default.patch index 5ccc15d0f8d8beebc322fad7c92f72517071b468..4e19047d9f2b265c27531239657ed3b631a2c2ef 100644 --- a/build/e_patches/0042-Browser-Spoof-as-Pixel-4a-by-default.patch +++ b/build/e_patches/0038-Browser-Spoof-as-Pixel-4a-by-default.patch @@ -1,7 +1,7 @@ -From 4ce4f525dc2720b1d8ce823da0e32c6142b3aacc Mon Sep 17 00:00:00 2001 +From 8a5fbc39ad48cff708c8ec1eb91d139418f8958c Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 19 Jan 2023 05:41:58 +0000 -Subject: [PATCH] Browser: Spoof as Pixel 4a by default +Subject: [PATCH 38/48] Browser: Spoof as Pixel 4a by default - Android 10 Pixel 4a QD4A.200805.003 --- @@ -9,7 +9,7 @@ Subject: [PATCH] Browser: Spoof as Pixel 4a by default 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/base/system/sys_info_android.cc b/base/system/sys_info_android.cc -index a17fafee2287d..eb49b4a7ee92e 100644 +index d4b3059270aab..71a1481f05cd9 100644 --- a/base/system/sys_info_android.cc +++ b/base/system/sys_info_android.cc @@ -23,7 +23,7 @@ namespace { @@ -30,7 +30,7 @@ index a17fafee2287d..eb49b4a7ee92e 100644 return; } } -@@ -128,9 +128,7 @@ int GetDalvikHeapGrowthLimitMB() { +@@ -62,9 +62,7 @@ void GetOsVersionStringAndNumbers(std::string* version_string, } std::string HardwareManufacturerName() { @@ -41,7 +41,7 @@ index a17fafee2287d..eb49b4a7ee92e 100644 } } // anonymous namespace -@@ -138,9 +136,7 @@ std::string HardwareManufacturerName() { +@@ -72,9 +70,7 @@ std::string HardwareManufacturerName() { namespace base { std::string SysInfo::HardwareModelName() { @@ -52,7 +52,7 @@ index a17fafee2287d..eb49b4a7ee92e 100644 } std::string SysInfo::OperatingSystemName() { -@@ -163,15 +159,11 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, +@@ -97,15 +93,11 @@ void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, } std::string SysInfo::GetAndroidBuildCodename() { diff --git a/build/e_patches/0043-Browser-Remove-broken-link-about-entries.patch b/build/e_patches/0039-Browser-Remove-broken-link-about-entries.patch similarity index 91% rename from build/e_patches/0043-Browser-Remove-broken-link-about-entries.patch rename to build/e_patches/0039-Browser-Remove-broken-link-about-entries.patch index 9f12edae9845b089958dbca175ed155aad5a0035..ad35684848646042d933af6ddd681131cdf28318 100644 --- a/build/e_patches/0043-Browser-Remove-broken-link-about-entries.patch +++ b/build/e_patches/0039-Browser-Remove-broken-link-about-entries.patch @@ -1,7 +1,7 @@ -From da149eb8434f37727e2c1dc3887da86309cf855d Mon Sep 17 00:00:00 2001 +From f7a179f55db8ab49f817ccaf920f2ba788b9e107 Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 20 Feb 2023 07:39:35 +0000 -Subject: [PATCH] Browser: Remove broken link about entries +Subject: [PATCH 39/48] Browser: Remove broken link about entries --- .../java/res/xml/legal_information_preferences.xml | 12 ------------ diff --git a/build/e_patches/0044-Browser-Disable-Android-native-autofill-by-default.patch b/build/e_patches/0040-Browser-Disable-Android-native-autofill-by-default.patch similarity index 68% rename from build/e_patches/0044-Browser-Disable-Android-native-autofill-by-default.patch rename to build/e_patches/0040-Browser-Disable-Android-native-autofill-by-default.patch index a09a5497f780331321ad788d0b4940cb0fd49bfe..3e059faa4ea339dbe281fea862944826c4612b69 100644 --- a/build/e_patches/0044-Browser-Disable-Android-native-autofill-by-default.patch +++ b/build/e_patches/0040-Browser-Disable-Android-native-autofill-by-default.patch @@ -1,25 +1,25 @@ -From e3d7fe0e9c76aab25d0c21e6f2e3dd9e4a6745f0 Mon Sep 17 00:00:00 2001 +From 49cefd3805fe75ed5c78e0bba688b8e783111c9a Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 22 Aug 2023 06:16:40 +0000 -Subject: [PATCH] Browser: Disable Android native autofill by default +Subject: [PATCH 40/48] Browser: Disable Android native autofill by default --- components/autofill/core/common/autofill_prefs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc -index 0457de82fc58a..b127c74d03eec 100644 +index dfca9d58ee26d..41b193fbf2ab9 100644 --- a/components/autofill/core/common/autofill_prefs.cc +++ b/components/autofill/core/common/autofill_prefs.cc -@@ -173,7 +173,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { +@@ -170,7 +170,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kAutofillCreditCardFidoAuthOfferCheckboxState, true); #endif - registry->RegisterBooleanPref(prefs::kAutofillAndroidEnabled, true); + registry->RegisterBooleanPref(prefs::kAutofillAndroidEnabled, false); registry->RegisterBooleanPref(prefs::kAutofillAndroidIncognitoEnabled, false); - registry->RegisterIntegerPref( - prefs::kAutofillLastVersionDisusedCreditCardsDeleted, 0); + registry->RegisterIntegerPref(prefs::kAutocompleteLastVersionRetentionPolicy, + 0); -- 2.34.1 diff --git a/build/e_patches/0045-Browser-Enable-unified-autoplay-by-default.patch b/build/e_patches/0041-Browser-Enable-unified-autoplay-by-default.patch similarity index 79% rename from build/e_patches/0045-Browser-Enable-unified-autoplay-by-default.patch rename to build/e_patches/0041-Browser-Enable-unified-autoplay-by-default.patch index 910a905ed13cad99cb080664e05c7dac9acb5319..463b221f64cbe78f13e1595941851bd867e79e19 100644 --- a/build/e_patches/0045-Browser-Enable-unified-autoplay-by-default.patch +++ b/build/e_patches/0041-Browser-Enable-unified-autoplay-by-default.patch @@ -1,7 +1,7 @@ -From ffe23e4be9064bb32e7aaf00a09eb28e9f492ccf Mon Sep 17 00:00:00 2001 +From 636a469d7e64f45766aed24980f6081127cb009e Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 29 Sep 2023 16:30:17 +0530 -Subject: [PATCH] Browser: Enable unified autoplay by default +Subject: [PATCH 41/48] Browser: Enable unified autoplay by default --- .../content_settings/core/browser/content_settings_registry.cc | 2 +- @@ -9,23 +9,23 @@ Subject: [PATCH] Browser: Enable unified autoplay by default 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc -index 372278bce3d9b..ebac34de0268a 100644 +index 8eeaf10cfd4f7..e7121a4b45f08 100644 --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -246,7 +246,7 @@ void ContentSettingsRegistry::Init() { +@@ -250,7 +250,7 @@ void ContentSettingsRegistry::Init() { ContentSettingsInfo::INHERIT_IN_INCOGNITO, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); - Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_BLOCK, + Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW, - WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_schemes=*/{}, + WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_primary_schemes=*/{}, /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -index ad6d08e8a59cf..994aa6f7416e4 100644 +index 30d1670cfdd64..acab9810dc7db 100644 --- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -@@ -417,7 +417,7 @@ bool AutoplayPolicy::IsAutoplayAllowedPerSettings() const { +@@ -439,7 +439,7 @@ bool AutoplayPolicy::IsAutoplayAllowedPerSettings() const { return false; if (auto* settings_client = frame->GetContentSettingsClient()) { return settings_client->AllowContentSetting( diff --git a/build/e_patches/0043-Use-thirdparty-autofill-by-default.patch b/build/e_patches/0043-Use-thirdparty-autofill-by-default.patch new file mode 100644 index 0000000000000000000000000000000000000000..5c4f71d6d1ff44afba4a9444770d37fc74b0b64a --- /dev/null +++ b/build/e_patches/0043-Use-thirdparty-autofill-by-default.patch @@ -0,0 +1,46 @@ +From 7cb0f3713d177a51c930504c4ac7edea36c7151a Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Mon, 12 Feb 2024 13:54:08 +0530 +Subject: [PATCH 43/48] Use thirdparty autofill by default + +--- + .../res/layout/radio_button_group_third_party_preference.xml | 2 +- + .../autofill/options/RadioButtonGroupThirdPartyPreference.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml b/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml +index 54b5038f206fe..7beb690ca1408 100644 +--- a/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml ++++ b/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml +@@ -19,7 +19,6 @@ found in the LICENSE file. + android:id="@+id/autofill_third_party_filling_default" + android:layout_width="match_parent" + android:layout_height="wrap_content" +- android:checked="true" + app:primaryText="@string/autofill_third_party_filling_default" + app:descriptionText="@string/autofill_third_party_filling_default_description"/> + +@@ -27,6 +26,7 @@ found in the LICENSE file. + android:id="@+id/autofill_third_party_filling_opt_in" + android:layout_width="match_parent" + android:layout_height="wrap_content" ++ android:checked="true" + app:primaryText="@string/autofill_third_party_filling_opt_in" + app:descriptionText="@string/autofill_third_party_filling_opt_in_description"/> + +diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java +index 2fefeb2ebd1a9..6353d074e96b5 100644 +--- a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java ++++ b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java +@@ -36,7 +36,7 @@ public final class RadioButtonGroupThirdPartyPreference extends Preference { + + private @Nullable RadioButtonWithDescription mDefaultOption; + private @Nullable RadioButtonWithDescription mOptInOption; +- private @ThirdPartyOption int mSelectedOption = getPersistedInt(ThirdPartyOption.DEFAULT); ++ private @ThirdPartyOption int mSelectedOption = getPersistedInt(ThirdPartyOption.USE_OTHER_PROVIDER); + + public RadioButtonGroupThirdPartyPreference(Context context, AttributeSet attrs) { + super(context, attrs); +-- +2.34.1 + diff --git a/build/e_patches/0044-Remove-some-privacy-UI-pref.patch b/build/e_patches/0044-Remove-some-privacy-UI-pref.patch new file mode 100644 index 0000000000000000000000000000000000000000..abdc81e326569be008f68e8e8dae590752ae55c2 --- /dev/null +++ b/build/e_patches/0044-Remove-some-privacy-UI-pref.patch @@ -0,0 +1,36 @@ +From d7cf8079c9ba2fcbd129777d43b2b42eb3a505be Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Mon, 12 Feb 2024 14:21:50 +0530 +Subject: [PATCH 44/48] Remove some privacy UI pref + +--- + .../chrome/browser/privacy/settings/PrivacySettings.java | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +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 +index 406a88c191d64..94d071e3f00f7 100644 +--- 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 +@@ -188,6 +188,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment + mContextualSearch.setSummary( + isContextualSearchEnabled ? R.string.text_on : R.string.text_off); + ++ getPreferenceScreen().removePreference(findPreference("phone_as_a_security_key")); ++ getPreferenceScreen().removePreference(findPreference(PREF_CONTEXTUAL_SEARCH)); ++ + ChromeSwitchPreference canMakePaymentPref = + (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT); + canMakePaymentPref.setOnPreferenceChangeListener(this); +@@ -228,8 +231,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment + Preference secureDnsPref = findPreference(PREF_SECURE_DNS); + secureDnsPref.setVisible(SecureDnsSettings.isUiEnabled()); + +- Preference syncAndServicesLink = findPreference(PREF_SYNC_AND_SERVICES_LINK); +- syncAndServicesLink.setSummary(buildSyncAndServicesLink()); ++ getPreferenceScreen().removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK)); + + // set up history expire days threshold preference + List options = new ArrayList<>(); +-- +2.34.1 + diff --git a/build/e_patches/0049-Browser-Remove-send-to-devices-option.patch b/build/e_patches/0045-Browser-Remove-send-to-devices-option.patch similarity index 65% rename from build/e_patches/0049-Browser-Remove-send-to-devices-option.patch rename to build/e_patches/0045-Browser-Remove-send-to-devices-option.patch index 17b6b153f3a77058f95abba3d532ceec2af648fe..db856c6121140bd8c32ec3c8bd592547ba7e2ff6 100644 --- a/build/e_patches/0049-Browser-Remove-send-to-devices-option.patch +++ b/build/e_patches/0045-Browser-Remove-send-to-devices-option.patch @@ -1,17 +1,17 @@ -From d942265360f8b79cc3fcf457f10635bbe7eeea3e Mon Sep 17 00:00:00 2001 +From e83eb353b06e16d27acca8f44b3b2605f16d0480 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 18:23:09 +0530 -Subject: [PATCH] Browser: Remove send to devices option +Subject: [PATCH 45/48] Browser: Remove send to devices option --- - ...omeProvidedSharingOptionsProviderBase.java | 28 ------------------- - 1 file changed, 28 deletions(-) + ...omeProvidedSharingOptionsProviderBase.java | 36 ------------------- + 1 file changed, 36 deletions(-) diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java -index d7aa5ad9f063d..0b5fccf620341 100644 +index 04ce10fadfe40..43bc9807fd710 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java -@@ -253,7 +253,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -269,7 +269,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { // Only show a limited first party share selection for automotive if (BuildInfo.getInstance().isAutomotive) { maybeAddCopyFirstPartyOption(); @@ -19,7 +19,7 @@ index d7aa5ad9f063d..0b5fccf620341 100644 maybeAddQrCodeFirstPartyOption(); return; } -@@ -261,7 +260,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -277,7 +276,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { maybeAddCopyFirstPartyOption(); maybeAddLongScreenshotFirstPartyOption(); maybeAddPrintFirstPartyOption(); @@ -27,7 +27,7 @@ index d7aa5ad9f063d..0b5fccf620341 100644 maybeAddQrCodeFirstPartyOption(); } else { maybeAddWebStyleNotesFirstPartyOption(); -@@ -270,22 +268,12 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -286,21 +284,12 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { // Always show the copy link option as some entries does not offer the change for copy // (e.g. feed card) maybeAddCopyFirstPartyOption(); @@ -41,8 +41,7 @@ index d7aa5ad9f063d..0b5fccf620341 100644 - private void maybeAddSendTabToSelfFirstPartyOption() { - Optional sendTabToSelfDisplayReason = - SendTabToSelfAndroidBridge.getEntryPointDisplayReason(mProfile, mUrl); -- if (sendTabToSelfDisplayReason.isPresent() -- || !ChromeFeatureList.isEnabled(ChromeFeatureList.SEND_TAB_TO_SELF_SIGNIN_PROMO)) { +- if (sendTabToSelfDisplayReason.isPresent()) { - mOrderedFirstPartyOptions.add(createSendTabToSelfFirstPartyOption()); - } - } @@ -50,23 +49,32 @@ index d7aa5ad9f063d..0b5fccf620341 100644 private void maybeAddQrCodeFirstPartyOption() { } -@@ -422,22 +410,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { +@@ -457,31 +446,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { .build(); } - private FirstPartyOption createSendTabToSelfFirstPartyOption() { - return new FirstPartyOptionBuilder( -- ContentType.LINK_PAGE_VISIBLE, ContentType.LINK_PAGE_NOT_VISIBLE, ContentType.IMAGE) +- ContentType.LINK_PAGE_VISIBLE, +- ContentType.LINK_PAGE_NOT_VISIBLE, +- ContentType.IMAGE) - .setDetailedContentTypesToDisableFor( - DetailedContentType.WEB_NOTES, DetailedContentType.SCREENSHOT) - .setIcon(R.drawable.send_tab, R.string.sharing_send_tab_to_self) - .setFeatureNameForMetrics(USER_ACTION_SEND_TAB_TO_SELF_SELECTED) -- .setOnClickCallback((view) -> { -- SendTabToSelfCoordinator sttsCoordinator = new SendTabToSelfCoordinator( -- mActivity, mWindowAndroid, mUrl, mShareParams.getTitle(), -- mBottomSheetController, mProfile, mDeviceLockActivityLauncher); -- sttsCoordinator.show(); -- }) +- .setOnClickCallback( +- (view) -> { +- SendTabToSelfCoordinator sttsCoordinator = +- new SendTabToSelfCoordinator( +- mActivity, +- mWindowAndroid, +- mUrl, +- mShareParams.getTitle(), +- mBottomSheetController, +- mProfile, +- mDeviceLockActivityLauncher); +- sttsCoordinator.show(); +- }) - .build(); - } - diff --git a/build/e_patches/0050-Browser-Enable-webRTC-by-default.patch b/build/e_patches/0046-Browser-Enable-webRTC-by-default.patch similarity index 88% rename from build/e_patches/0050-Browser-Enable-webRTC-by-default.patch rename to build/e_patches/0046-Browser-Enable-webRTC-by-default.patch index 177242d964f8cc0e2477ee83ac60478443a1cacd..a18a5824b24063989035e5f456ea51179b4cca37 100644 --- a/build/e_patches/0050-Browser-Enable-webRTC-by-default.patch +++ b/build/e_patches/0046-Browser-Enable-webRTC-by-default.patch @@ -1,7 +1,7 @@ -From dff037895a8f34d8457a38d2108831afadf367a8 Mon Sep 17 00:00:00 2001 +From 5ca8af2a62ad7739ca0421eff3cfbfd74722d02a Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 18:49:36 +0530 -Subject: [PATCH] Browser: Enable webRTC by default +Subject: [PATCH 46/48] Browser: Enable webRTC by default --- .../core/browser/bromite_content_settings/webrtc.inc | 2 +- @@ -21,10 +21,10 @@ index 69b2de0ff52fa..c4ce181e6c88c 100644 /*allowlisted_schemes=*/{}, /*valid_settings=*/{CONTENT_SETTING_ALLOW, 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 -index 42ca15d9bf3ff..94a8c92dd5553 100644 +index c056ae39ce521..ccdd7dd4e81fc 100644 --- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc +++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc -@@ -783,7 +783,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( +@@ -776,7 +776,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( WebRTCIPHandlingPolicy policy = GetWebRTCIPHandlingPolicy(webrtc_ip_handling_policy); blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); @@ -34,10 +34,10 @@ index 42ca15d9bf3ff..94a8c92dd5553 100644 } diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc -index 33cdff03d81b5..23fdabd21af42 100644 +index 70101c5dd9dac..24a9afbed8128 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc -@@ -261,7 +261,7 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state, +@@ -293,7 +293,7 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state, auto* web_frame = static_cast(WebFrame::FromCoreFrame(window->GetFrame())); blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); @@ -47,10 +47,10 @@ index 33cdff03d81b5..23fdabd21af42 100644 } diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc -index aa249d6484023..1488ebc891f8b 100644 +index eaaee7b5ce3a0..fcef33107f175 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc -@@ -1010,7 +1010,7 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, +@@ -1040,7 +1040,7 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, auto* web_frame = static_cast(WebFrame::FromCoreFrame(window->GetFrame())); blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); diff --git a/build/e_patches/0046-Change-accent-and-switch-to-match-our-palette.patch b/build/e_patches/0046-Change-accent-and-switch-to-match-our-palette.patch deleted file mode 100644 index b185cce84460e5e64604ca33f88c00378074c052..0000000000000000000000000000000000000000 --- a/build/e_patches/0046-Change-accent-and-switch-to-match-our-palette.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 40aa8674319256f28ef5b9c72c68e3e39614be8a Mon Sep 17 00:00:00 2001 -From: Nishith Khanna -Date: Tue, 3 Oct 2023 15:00:02 +0530 -Subject: [PATCH] Change accent and switch to match our palette - ---- - .../browser/tasks/tab_management/TabUiThemeProvider.java | 7 +++---- - .../res/layout/fast_checkout_autofill_profile_item.xml | 2 +- - .../java/res/layout/fast_checkout_credit_card_item.xml | 2 +- - .../java/res/layout/fast_checkout_footer_item.xml | 2 +- - .../chrome/browser/omnibox/UrlBarViewBinder.java | 2 +- - .../browser/omnibox/styles/OmniboxResourceProvider.java | 2 +- - components/browser_ui/styles/android/BUILD.gn | 4 ++++ - .../android/java/res/color/e_switch_thumb_color.xml | 5 +++++ - .../android/java/res/color/e_switch_track_color.xml | 6 ++++++ - .../android/java/res/color/text_highlight_color.xml | 2 +- - .../styles/android/java/res/drawable/e_switch_thumb.xml | 9 +++++++++ - .../styles/android/java/res/drawable/e_switch_track.xml | 9 +++++++++ - .../android/java/res/values/semantic_colors_dynamic.xml | 6 +++--- - .../browser_ui/styles/android/java/res/values/styles.xml | 4 ++-- - .../browser_ui/styles/android/java/res/values/themes.xml | 2 +- - .../browser_ui/theme/android/java/res/values/themes.xml | 4 ++-- - ui/android/java/res/values/color_palette.xml | 9 +++++++-- - 17 files changed, 57 insertions(+), 20 deletions(-) - create mode 100644 components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml - create mode 100644 components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml - create mode 100644 components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml - create mode 100644 components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml - -diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java -index ecd4dfc4ad1af..5a50363ae8eae 100644 ---- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java -+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabUiThemeProvider.java -@@ -48,7 +48,7 @@ public class TabUiThemeProvider { - float tabElevation = context.getResources().getDimension(R.dimen.tab_bg_elevation); - @ColorInt - int colorInt = isSelected -- ? MaterialColors.getColor(context, org.chromium.chrome.R.attr.colorPrimary, TAG) -+ ? context.getColor(R.color.default_control_color_active_baseline) - : new ElevationOverlayProvider(context) - .compositeOverlayWithThemeSurfaceColorIfNeeded(tabElevation); - return colorInt; -@@ -160,7 +160,7 @@ public class TabUiThemeProvider { - context, R.color.incognito_tab_bg_selected_color); - } - return ColorStateList.valueOf( -- MaterialColors.getColor(context, org.chromium.chrome.R.attr.colorPrimary, TAG)); -+ context.getColor(R.color.default_control_color_active_baseline)); - } - - /** -@@ -263,8 +263,7 @@ public class TabUiThemeProvider { - } else { - if (isSelected) { - @ColorInt -- int baseColor = MaterialColors.getColor( -- context, org.chromium.chrome.R.attr.colorPrimary, TAG); -+ int baseColor = context.getColor(R.color.default_control_color_active_baseline); - int alpha = context.getResources().getInteger( - R.integer.tab_grid_hovered_card_background_selected_color_alpha); - return ColorStateList.valueOf( -diff --git a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_autofill_profile_item.xml b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_autofill_profile_item.xml -index 3a1e173d18087..7cc57a67dba9f 100644 ---- a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_autofill_profile_item.xml -+++ b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_autofill_profile_item.xml -@@ -81,6 +81,6 @@ found in the LICENSE file. - android:layout_marginEnd="@dimen/fast_checkout_detail_sheet_selected_icon_margin_end" - android:layout_gravity="center_vertical" - android:contentDescription="@null" -- app:tint="?attr/colorPrimary" -+ app:tint="@color/default_control_color_active_baseline" - app:srcCompat="@drawable/ic_check_circle_filled_green_24dp" /> - -diff --git a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml -index 4e9e8deb14885..ab4d39f056a55 100644 ---- a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml -+++ b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_credit_card_item.xml -@@ -57,6 +57,6 @@ found in the LICENSE file. - android:layout_marginEnd="@dimen/fast_checkout_detail_sheet_selected_icon_margin_end" - android:layout_gravity="center_vertical" - android:contentDescription="@null" -- app:tint="?attr/colorPrimary" -+ app:tint="@color/default_control_color_active_baseline" - app:srcCompat="@drawable/ic_check_circle_filled_green_24dp" /> - -diff --git a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml -index ecc6bc6b9b150..175082479e551 100644 ---- a/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml -+++ b/chrome/browser/ui/android/fast_checkout/internal/java/res/layout/fast_checkout_footer_item.xml -@@ -20,4 +20,4 @@ found in the LICENSE file. - android:drawablePadding="@dimen/fast_checkout_detail_sheet_footer_icon_margin_horizontal" - app:drawableWidth="24dp" - app:drawableHeight="24dp" -- app:drawableTint="?attr/colorPrimary" /> -+ app:drawableTint="@color/default_control_color_active_baseline" /> -diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java -index 526447a79f63e..a087d027d5fbd 100644 ---- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java -+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java -@@ -152,7 +152,7 @@ class UrlBarViewBinder { - - final int color = useIncognitoColors - ? view.getContext().getColor(R.color.default_control_color_active_dark) -- : MaterialColors.getColor(view, R.attr.colorPrimary); -+ : view.getContext().getColor(R.color.default_control_color_active_baseline); - textCursor.mutate().setTint(color); - textSelectHandle.mutate().setTint(color); - textSelectHandleLeft.mutate().setTint(color); -diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java -index c896c54935809..3822a23e036ea 100644 ---- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java -+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProvider.java -@@ -351,7 +351,7 @@ public class OmniboxResourceProvider { - if (brandedColorScheme == BrandedColorScheme.INCOGNITO) { - return context.getColor(R.color.locationbar_status_preview_color_incognito); - } -- return MaterialColors.getColor(context, R.attr.colorPrimary, TAG); -+ return context.getColor(R.color.default_control_color_active_baseline); - } - - /** -diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn -index 3ec0a714e8846..0e5b8243d1f05 100644 ---- a/components/browser_ui/styles/android/BUILD.gn -+++ b/components/browser_ui/styles/android/BUILD.gn -@@ -60,6 +60,8 @@ android_resources("java_resources") { - "java/res/color/text_button_ripple_color_list.xml", - "java/res/color/text_highlight_color.xml", - "java/res/color/toolbar_button_highlight_color.xml", -+ "java/res/color/e_switch_thumb_color.xml", -+ "java/res/color/e_switch_track_color.xml", - "java/res/drawable-hdpi/btn_star_filled.png", - "java/res/drawable-hdpi/ic_chrome.png", - "java/res/drawable-hdpi/ic_delete_white_24dp.png", -@@ -235,6 +237,8 @@ android_resources("java_resources") { - "java/res/drawable/ic_youtube_searched_for_24dp.xml", - "java/res/drawable/smartphone_black_24dp.xml", - "java/res/drawable/toolbar_hairline.xml", -+ "java/res/drawable/e_switch_thumb.xml", -+ "java/res/drawable/e_switch_track.xml", - "java/res/values-night/colors.xml", - "java/res/values-night/dimens.xml", - "java/res/values-night/drawables.xml", -diff --git a/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml b/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml -new file mode 100644 -index 0000000000000..32d4f07465128 ---- /dev/null -+++ b/components/browser_ui/styles/android/java/res/color/e_switch_thumb_color.xml -@@ -0,0 +1,5 @@ -+ -+ -+ -+ -+ -diff --git a/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml b/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml -new file mode 100644 -index 0000000000000..89e09db4091c3 ---- /dev/null -+++ b/components/browser_ui/styles/android/java/res/color/e_switch_track_color.xml -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -+ -diff --git a/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml b/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml -index 141d168fd81fd..48dbfd3c1306b 100644 ---- a/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml -+++ b/components/browser_ui/styles/android/java/res/color/text_highlight_color.xml -@@ -6,5 +6,5 @@ found in the LICENSE file. - --> - - -- -+ - -diff --git a/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml b/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml -new file mode 100644 -index 0000000000000..48dfa90e45cf4 ---- /dev/null -+++ b/components/browser_ui/styles/android/java/res/drawable/e_switch_thumb.xml -@@ -0,0 +1,9 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml b/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml -new file mode 100644 -index 0000000000000..f5b1eed6f2e6f ---- /dev/null -+++ b/components/browser_ui/styles/android/java/res/drawable/e_switch_track.xml -@@ -0,0 +1,9 @@ -+ -+ -+ -+ -+ -diff --git a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml -index 5d2a8e5469496..01310af86ab2e 100644 ---- a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml -+++ b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml -@@ -8,17 +8,17 @@ found in the LICENSE file. - ?attr/colorSurface - ?attr/colorSurface - -- ?attr/colorPrimary -+ @color/default_control_color_active_baseline - ?attr/colorOnSurfaceVariant - - ?attr/colorOnSurface -- ?attr/colorPrimary -+ @color/default_control_color_active_baseline - ?attr/colorOnSurfaceInverse - ?attr/colorOnPrimary - ?attr/colorOnSurfaceVariant - - ?attr/colorOnSurface -- ?attr/colorPrimary -+ @color/default_control_color_active_baseline - ?attr/colorOnPrimary - ?attr/colorOnPrimaryContainer - ?attr/colorOnSecondaryContainer -diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml -index be1ae401f8a90..d059872c3d83f 100644 ---- a/components/browser_ui/styles/android/java/res/values/styles.xml -+++ b/components/browser_ui/styles/android/java/res/values/styles.xml -@@ -20,8 +20,8 @@ found in the LICENSE file. - @style/TextAppearance.TextMedium.Primary - - - - -