diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b53b4e4bf431a431932beccc654ed8aec0dd11a..460d6bb1055addec0ec53df9af34419a7b7c6af3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,19 +7,20 @@ variables: GIT_SUBMODULE_STRATEGY: recursive build-docker: - image: docker:19-git + image: docker:25.0.5-git stage: prepare tags: - generic_privileged variables: DOCKER_DRIVER: overlay2 services: - - docker:19-dind + - docker:25.0.5-dind script: - echo "$CI_JOB_TOKEN" | docker login registry.gitlab.e.foundation:5000 -u gitlab-ci-token --password-stdin - docker pull $CONTAINER_IMAGE:latest || true - docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:latest ${CI_PROJECT_DIR} - docker push $CONTAINER_IMAGE:latest + retry: 2 .build-cromite: image: $CONTAINER_IMAGE @@ -30,6 +31,7 @@ build-docker: paths: - apks/* - bin/* + expire_in: 1 week build-cromite-arm: stage: build diff --git a/Dockerfile b/Dockerfile index c3ffed22e6a22034df3886f4cd35fd23f099b5b0..474ba143d78d1c28827612a2a9fb91820e21eada 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,21 @@ FROM ubuntu:20.04 ENV CHROMIUM_DIR "/srv/chromium" -ENV CHROMIUM_VER "127.0.6533.106" +ENV CHROMIUM_VER "129.0.6668.71" + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive \ + apt-get install -y software-properties-common && \ + add-apt-repository ppa:deadsnakes/ppa && \ + add-apt-repository ppa:git-core/ppa RUN dpkg --add-architecture i386 -RUN apt-get update &&\ +RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive \ - apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils ccache jq python3 \ + apt-get -f -y install sudo lsb-release cl-base64 bash wget apt-utils ccache jq python3.10 \ python-is-python3 sed tzdata build-essential lib32gcc-9-dev g++-multilib dos2unix wiggle git curl -RUN apt-get update &&\ - apt-get -y install p7zip-full - RUN mkdir ${CHROMIUM_DIR} RUN curl -s https://raw.githubusercontent.com/chromium/chromium/${CHROMIUM_VER}/build/install-build-deps.py \ diff --git a/build.sh b/build.sh index c4fa1abcdedc9497cf5ff0528f07783802e37c4f..e5c325ea8f9e06da9ead2de44110cb33808f031d 100755 --- a/build.sh +++ b/build.sh @@ -33,8 +33,7 @@ usage() { build() { echo ">> [$(date)] Head commit: $(git show -s --format=%s)" - apks="ChromePublic MonochromePublic SystemWebView TrichromeChrome \ - TrichromeLibrary TrichromeWebView TrichromeChrome6432 \ + apks="TrichromeChrome TrichromeLibrary TrichromeWebView TrichromeChrome6432 \ TrichromeLibrary6432 TrichromeWebView6432" build_args="$(cat "${root_dir}"/build/browser.gn_args) target_cpu=\"${1}\" " @@ -64,19 +63,23 @@ build() { build_args+=' cc_wrapper="ccache"' + echo ">> [$(date)] Using AOSP test-key for release build" + 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)] Building chromium $chromium_version for $1" gn gen "out/$1" --args="$build_args" if [ $1 '==' "x64" ] || [ $1 '==' "arm64" ]; then build_targets="trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk" - build_targets="$build_targets chrome_public_apk system_webview_apk monochrome_public_apk" else 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 + mkdir -p "${root_dir}/apks/${apk_arch}" for apk in $apks; do if [ -f "out/${1}/apks/$apk.apk" ]; then @@ -85,21 +88,6 @@ build() { 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 - - # Create the 7z archive - echo ">> [$(date)] Creating archive with debug apks" - archive_name="${root_dir}/apks/${apk_arch}/browser_${apk_arch}_debug_apks.7z" - 7z a -t7z -mx=9 "$archive_name" "out/${1}/apks"/*.apk - if [ $1 '==' "x64" ]; then echo ">> [$(date)] Building chromium subresource_filter_tools" mkdir -p "${root_dir}/bin" @@ -253,6 +241,11 @@ shift $((OPTIND - 1)) # Add depot_tools to PATH if [ ! -d "$chromium_dir/depot_tools" ]; then git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git "$chromium_dir/depot_tools" +else + cd $chromium_dir/depot_tools + git fetch https://chromium.googlesource.com/chromium/tools/depot_tools.git main + git reset --hard FETCH_HEAD + cd $chromium_dir fi export PATH="$chromium_dir/depot_tools:$PATH" diff --git a/build/browser.gn_args b/build/browser.gn_args index 4819d36a0e750a707319854eba342da7e05f98b6..b52615de37547e65ca7a4e2e144c91665c40cb9f 100644 --- a/build/browser.gn_args +++ b/build/browser.gn_args @@ -21,7 +21,9 @@ enable_platform_dolby_vision=false enable_platform_dts_audio=false enable_platform_encrypted_dolby_vision=false enable_platform_hevc=true +enable_precompiled_headers=false enable_reporting=false +enable_request_header_integrity=false enable_remoting=false enable_vr=false exclude_unwind_tables=false @@ -33,6 +35,7 @@ is_debug=false is_official_build=true proprietary_codecs=true rtc_build_examples=false +safe_browsing_use_unrar=false symbol_level=1 target_os="android" treat_warnings_as_errors=true diff --git a/build/copy_cromite_patches.sh b/build/copy_cromite_patches.sh index f512f2c52a0f0b5f55bbbb89168e39ba315b00ec..c47de496c2cbf78ea7f29d27d7b3c503aac3625a 100755 --- a/build/copy_cromite_patches.sh +++ b/build/copy_cromite_patches.sh @@ -1,12 +1,13 @@ #!/bin/bash +branch="v129.0.6668.71-385912cca32ce2d15a3e295f79d5c4dc3a6f7785" if [ -d cromite ]; then cd cromite - git fetch origin v127.0.6533.94-5fe9b924075b8c565742b4844362e71aaa9ec0d8 + git fetch origin $branch git reset --hard FETCH_HEAD cd .. else - git clone https://gitlab.e.foundation/e/os/cromite.git -b v127.0.6533.94-5fe9b924075b8c565742b4844362e71aaa9ec0d8 cromite --depth=1 + git clone https://gitlab.e.foundation/e/os/cromite.git -b $branch cromite --depth=1 fi cromite_patches_list=$(cat "cromite_patches_list.txt") diff --git a/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch b/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch index 908d824ca8ca81d15d697814ef950e4f94fcc7c7..7de74ef55405f62c2cd86b6ee644543a3819b85b 100644 --- a/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch +++ b/build/cromite_patches/AImageReader-CFI-crash-mitigations.patch @@ -90,7 +90,7 @@ 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 -@@ -3286,9 +3286,9 @@ +@@ -3406,9 +3406,9 @@ "expiry_milestone": 135 }, { @@ -121,7 +121,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 -@@ -2696,6 +2696,22 @@ +@@ -2606,6 +2606,22 @@ "no_downscaled_overlay_promotion" ] }, @@ -183,9 +183,9 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc if (!gpu_preferences.enable_android_surface_control) return kGpuFeatureStatusDisabled; -@@ -387,6 +390,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) { - gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] = - kGpuFeatureStatusBlocklisted; +@@ -379,6 +382,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info, + kGpuFeatureStatusSoftware; + } } + + if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) { @@ -198,8 +198,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 -@@ -10,6 +10,7 @@ clamp_texture_base_level_and_max_level - clear_pixel_unpack_buffer_before_copyteximage +@@ -7,6 +7,7 @@ check_egl_fence_before_wait + check_ycbcr_studio_g22_left_p709_for_nv12_support disable_2d_canvas_auto_flush disable_accelerated_av1_decode +disable_aimagereader @@ -209,7 +209,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 -@@ -69,6 +69,7 @@ +@@ -68,6 +68,7 @@ #if BUILDFLAG(IS_ANDROID) #include "ui/gfx/android/android_surface_control_compat.h" @@ -217,7 +217,7 @@ diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc #endif #if BUILDFLAG(ENABLE_VULKAN) -@@ -721,6 +722,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, +@@ -702,6 +703,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, } #endif // BUILDFLAG(IS_WIN) diff --git a/build/cromite_patches/Add-AllowUserCertificates-flag.patch b/build/cromite_patches/Add-AllowUserCertificates-flag.patch index ca35a3108b449d0f60d162dd5e6ba6e36d91c2b8..c7331745ea7516da49596e31fc986b79230827f1 100644 --- a/build/cromite_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 -@@ -229,6 +229,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider; +@@ -233,6 +233,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,8 +28,8 @@ 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; -@@ -1070,6 +1071,8 @@ public abstract class ChromeActivity - super.onStartWithNative(); +@@ -1054,6 +1055,8 @@ public abstract class ChromeActivity + ChromeActivitySessionTracker.getInstance().onStartWithNative(getProfileProviderSupplier()); ChromeCachedFlags.getInstance().cacheNativeFlags(); + X509Util.AllowUserCertificates = ChromeFeatureList.isEnabled( @@ -40,10 +40,10 @@ 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 -@@ -144,6 +144,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -157,6 +157,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { + &feed::kFeedPerformanceStudy, &feed::kFeedShowSignInCommand, &feed::kFeedSignedOutViewDemotion, - &feed::kFeedUserInteractionReliabilityReport, + &kAllowUserCertificates, &feed::kInterestFeedV2, &feed::kInterestFeedV2Hearts, @@ -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 -@@ -153,6 +153,7 @@ public abstract class ChromeFeatureList { +@@ -159,6 +159,7 @@ public abstract class ChromeFeatureList { /* Alphabetical: */ public static final String ACCOUNT_REAUTHENTICATION_RECENT_TIME_WINDOW = "AccountReauthenticationRecentTimeWindow"; @@ -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_TRANSLATE = "AdaptiveButtonInTopToolbarTranslate"; public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_ADD_TO_BOOKMARKS = -@@ -555,6 +556,8 @@ public abstract class ChromeFeatureList { - public static final CachedFlag sAppInfoTabResumptionModule = - newCachedFlag(APP_INFO_TAB_RESUMPTION_MODULE, false); - public static final CachedFlag sAppSpecificHistory = newCachedFlag(APP_SPECIFIC_HISTORY, false); +@@ -572,6 +573,8 @@ public abstract class ChromeFeatureList { + public static final CachedFlag sAndroidTabDeclutterDedupeTabIdsKillSwitch = + newCachedFlag(ANDROID_TAB_DECLUTTER_DEDUPE_TAB_IDS_KILL_SWITCH, true); + public static final CachedFlag sAppSpecificHistory = newCachedFlag(APP_SPECIFIC_HISTORY, true); + public static final CachedFlag sAllowUserCertificates = + newCachedFlag(ALLOW_USER_CERTIFICATES, false); - public static final CachedFlag sArchiveTabService = newCachedFlag(ARCHIVE_TAB_SERVICE, false); public static final CachedFlag sAsyncNotificationManager = newCachedFlag(ASYNC_NOTIFICATION_MANAGER, false); -@@ -704,6 +707,7 @@ public abstract class ChromeFeatureList { - public static final List sFlagsCachedFullBrowser = + public static final CachedFlag sBackGestureActivityTabProvider = +@@ -725,6 +728,7 @@ public abstract class ChromeFeatureList { + public static final List sFlagsCachedFullBrowserChromium = List.of( sAccountReauthenticationRecentTimeWindow, + sAllowUserCertificates, sAndroidAppIntegration, sAndroidElegantTextHeight, - sAndroidHub, + sAndroidGoogleSansText, 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 diff --git a/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch b/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch index da1a6026ea5eb366479ad5efaa1bfc112dbfda9c..ec406d8a2c619ab9539221a7da30dcbaff444736 100644 --- a/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.patch +++ b/build/cromite_patches/Add-Alt-D-hotkey-to-focus-address-bar.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/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 -@@ -204,6 +204,8 @@ public class KeyboardShortcuts { +@@ -392,6 +392,8 @@ public class KeyboardShortcuts { R.string.keyboard_shortcut_address_bar, KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON); diff --git a/build/cromite_patches/Add-IsCleartextPermitted-flag.patch b/build/cromite_patches/Add-IsCleartextPermitted-flag.patch index f7453e5a66547ff62e350ca9d99c78723aea000d..b97584d3a45ce9d519513843868c29de1db3ee13 100644 --- a/build/cromite_patches/Add-IsCleartextPermitted-flag.patch +++ b/build/cromite_patches/Add-IsCleartextPermitted-flag.patch @@ -44,7 +44,7 @@ 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 -@@ -360,6 +360,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { +@@ -390,6 +390,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { } } diff --git a/build/cromite_patches/Add-a-proxy-configuration-page.patch b/build/cromite_patches/Add-a-proxy-configuration-page.patch index 5bd4de3663a24497a98589f61e3298cda4fbdb60..98066a1deb9da62d0a378f4aebd89e3aaf5f1080 100644 --- a/build/cromite_patches/Add-a-proxy-configuration-page.patch +++ b/build/cromite_patches/Add-a-proxy-configuration-page.patch @@ -18,7 +18,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/android/java/res/values/values.xml | 3 + .../java/res/xml/privacy_preferences.xml | 4 + .../privacy/settings/PrivacySettings.java | 1 + - .../chrome_autocomplete_provider_client.cc | 2 + + .../chrome_autocomplete_provider_client.cc | 1 + chrome/browser/browser_resources.grd | 3 + .../extensions/api/proxy/proxy_api_helpers.cc | 2 +- chrome/browser/net/proxy_service_factory.cc | 24 +- @@ -30,9 +30,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/resources/proxy_config.js | 278 +++++++++++++ chrome/browser/ui/BUILD.gn | 2 + .../webui/chrome_web_ui_controller_factory.cc | 3 + - chrome/browser/ui/webui/proxy_config_ui.cc | 392 ++++++++++++++++++ + chrome/browser/ui/webui/proxy_config_ui.cc | 389 ++++++++++++++++++ chrome/browser/ui/webui/proxy_config_ui.h | 31 ++ - chrome/common/webui_url_constants.cc | 4 + + chrome/common/webui_url_constants.cc | 2 + chrome/common/webui_url_constants.h | 2 + .../pref_proxy_config_tracker_impl.cc | 5 +- .../proxy_config/proxy_config_dictionary.cc | 30 +- @@ -40,7 +40,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../proxy_config/proxy_policy_handler.cc | 2 +- net/proxy_resolution/proxy_config.cc | 51 ++- net/proxy_resolution/proxy_config.h | 3 + - 25 files changed, 979 insertions(+), 17 deletions(-) + 25 files changed, 973 insertions(+), 17 deletions(-) create mode 100644 chrome/browser/resources/proxy_config.css create mode 100644 chrome/browser/resources/proxy_config.html create mode 100644 chrome/browser/resources/proxy_config.js @@ -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 -@@ -19,6 +19,9 @@ found in the LICENSE file. +@@ -22,6 +22,9 @@ found in the LICENSE file. true @@ -77,7 +77,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java -@@ -74,6 +74,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -73,6 +73,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment private static final String PREF_SAFE_BROWSING = "safe_browsing"; private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link"; private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox"; @@ -88,19 +88,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting 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 -@@ -309,6 +309,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() { - builtins_to_provide.push_back( - base::ASCIIToUTF16(chrome::kChromeUISettingsURL)); +@@ -319,6 +319,7 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() { + builtins_to_provide.push_back(chrome::kChromeUISettingsURL16); #endif -+ builtins_to_provide.push_back( -+ base::ASCIIToUTF16(chrome::kChromeUIProxyConfigURL)); - builtins_to_provide.push_back( - base::ASCIIToUTF16(chrome::kChromeUIVersionURL)); + builtins_to_provide.push_back(chrome::kChromeUIVersionURL16); ++ builtins_to_provide.push_back(chrome::kChromeUIProxyConfigURL16); return builtins_to_provide; + } + diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd -@@ -241,6 +241,9 @@ +@@ -244,6 +244,9 @@ @@ -113,7 +112,7 @@ diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resou diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc -@@ -387,7 +387,7 @@ std::optional CreateProxyConfigDict( +@@ -392,7 +392,7 @@ std::optional CreateProxyConfigDict( return std::nullopt; } return ProxyConfigDictionary::CreateFixedServers(proxy_rules_string, @@ -197,16 +196,16 @@ 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 -@@ -195,6 +195,8 @@ +@@ -201,6 +201,8 @@ + #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" - #include "services/screen_ai/buildflags/buildflags.h" +#include "chrome/browser/net/proxy_service_factory.h" + #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" #endif -@@ -1697,6 +1699,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1496,6 +1498,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { component_updater::RegisterPrefs(registry); domain_reliability::RegisterPrefs(registry); embedder_support::OriginTrialPrefs::RegisterPrefs(registry); @@ -661,7 +660,7 @@ new file mode 100644 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 -@@ -327,6 +327,8 @@ static_library("ui") { +@@ -336,6 +336,8 @@ static_library("ui") { "webui/metrics_internals/metrics_internals_ui.h", "webui/net_export_ui.cc", "webui/net_export_ui.h", @@ -673,7 +672,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 -@@ -49,6 +49,7 @@ +@@ -50,6 +50,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 +680,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/privacy_sandbox/privacy_sandbox_internals_ui.h" #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h" -@@ -450,6 +451,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, +@@ -419,6 +420,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, #endif // BUILDFLAG(IS_CHROMEOS_ASH) if (url.host_piece() == chrome::kChromeUINetExportHost) return &NewWebUI; @@ -694,7 +693,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webu new file mode 100644 --- /dev/null +++ b/chrome/browser/ui/webui/proxy_config_ui.cc -@@ -0,0 +1,392 @@ +@@ -0,0 +1,389 @@ +/* + This file is part of Bromite. + @@ -756,7 +755,6 @@ new file mode 100644 +// this class's public methods are expected to run on the UI thread. +class ProxyConfigMessageHandler + : public WebUIMessageHandler, -+ public base::SupportsWeakPtr, + public net::ProxyConfigService::Observer { + public: + ProxyConfigMessageHandler(const ProxyConfigMessageHandler&) = delete; @@ -794,12 +792,10 @@ new file mode 100644 + + void apply(const net::ProxyConfig& config); + -+ base::WeakPtrFactory weak_ptr_factory_; ++ base::WeakPtrFactory weak_ptr_factory_{this}; +}; + -+ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile) -+ : -+ weak_ptr_factory_(this) { ++ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile) { + + // used to set new configuration preferences + pref_service_ = g_browser_process->local_state(); @@ -1126,16 +1122,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 -@@ -50,6 +50,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert"; - const char kChromeUICertificateViewerURL[] = "chrome://view-cert/"; - const char kChromeUIChromeSigninHost[] = "chrome-signin"; - const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/"; -+const char kChromeUIProxyConfigHost[] = "proxy"; -+const char kChromeUIProxyConfigURL[] = "chrome://proxy/"; - const char kChromeUIChromeURLsHost[] = "chrome-urls"; - const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/"; - const char kChromeUIComponentsHost[] = "components"; -@@ -471,6 +473,7 @@ bool IsSystemWebUIHost(std::string_view host) { +@@ -53,6 +53,7 @@ bool IsSystemWebUIHost(std::string_view host) { kChromeUILockScreenNetworkHost, kChromeUILockScreenStartReauthHost, kChromeUIMobileSetupHost, @@ -1143,26 +1130,26 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons kChromeUIMultiDeviceSetupHost, kChromeUINetworkHost, kChromeUINotificationTesterHost, -@@ -766,6 +769,7 @@ const char* const kChromeHostURLs[] = { +@@ -75,6 +76,7 @@ bool IsSystemWebUIHost(std::string_view host) { + // These hosts will also be suggested by BuiltinProvider. + base::span ChromeURLHosts() { + static constexpr auto kChromeURLHosts = std::to_array({ ++ kChromeUIProxyConfigHost, + kChromeUIAboutHost, + kChromeUIAccessibilityHost, #if !BUILDFLAG(IS_ANDROID) - #if !BUILDFLAG(IS_CHROMEOS) - kChromeUIAppLauncherPageHost, -+ kChromeUIProxyConfigHost, - #endif - kChromeUIBookmarksHost, - kChromeUIDownloadsHost, 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 -@@ -137,6 +137,8 @@ extern const char kChromeUINTPTilesInternalsHost[]; - extern const char kChromeUINaClHost[]; - extern const char kChromeUINetExportHost[]; - extern const char kChromeUINetExportURL[]; -+extern const char kChromeUIProxyConfigHost[]; -+extern const char kChromeUIProxyConfigURL[]; - extern const char kChromeUINetInternalsHost[]; - extern const char kChromeUINetInternalsURL[]; - extern const char kChromeUINewTabHost[]; +@@ -171,6 +171,8 @@ inline constexpr char kChromeUINetExportURL[] = "chrome://net-export"; + inline constexpr char kChromeUINetInternalsHost[] = "net-internals"; + inline constexpr char kChromeUINetInternalsURL[] = "chrome://net-internals/"; + inline constexpr char kChromeUINewTabHost[] = "newtab"; ++inline constexpr char16_t kChromeUIProxyConfigURL16[] = u"chrome://proxy/"; ++inline constexpr char kChromeUIProxyConfigHost[] = "proxy"; + inline constexpr char kChromeUINewTabPageHost[] = "new-tab-page"; + inline constexpr char kChromeUINewTabPageThirdPartyHost[] = + "new-tab-page-third-party"; diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/components/proxy_config/pref_proxy_config_tracker_impl.cc --- a/components/proxy_config/pref_proxy_config_tracker_impl.cc +++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc @@ -1320,7 +1307,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_config/proxy_policy_handler.cc --- a/components/proxy_config/proxy_policy_handler.cc +++ b/components/proxy_config/proxy_policy_handler.cc -@@ -376,7 +376,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, +@@ -381,7 +381,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, set_proxy_pref_value(ProxyConfigDictionary::CreateFixedServers( server->GetString(), bypass_list && bypass_list->is_string() ? bypass_list->GetString() diff --git a/build/cromite_patches/Add-an-always-incognito-mode.patch b/build/cromite_patches/Add-an-always-incognito-mode.patch index b064cfd1ac4559f97e5e3bd8526959bc0880d750..930cac46c8d5bd8b723d979bab148566c3e8401c 100644 --- a/build/cromite_patches/Add-an-always-incognito-mode.patch +++ b/build/cromite_patches/Add-an-always-incognito-mode.patch @@ -24,13 +24,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../java/res/xml/incognito_preferences.xml | 37 ++++ .../java/res/xml/privacy_preferences.xml | 5 + .../AlwaysIncognitoLinkInterceptor.java | 54 ++++++ - .../chrome/browser/ChromeTabbedActivity.java | 22 ++- + .../chrome/browser/ChromeTabbedActivity.java | 26 ++- .../chrome/browser/app/ChromeActivity.java | 4 + .../AppMenuPropertiesDelegateImpl.java | 28 ++- .../ChromeContextMenuPopulator.java | 7 +- - .../CustomTabActivityLifecycleUmaTracker.java | 31 ---- + .../CustomTabActivityLifecycleUmaTracker.java | 39 ----- .../CustomTabAppMenuPropertiesDelegate.java | 4 + - .../CustomTabIntentDataProvider.java | 5 +- + .../CustomTabIntentDataProvider.java | 10 ++ .../browser/download/DownloadUtils.java | 16 +- .../history/HistoryContentManager.java | 7 +- .../browser/history/HistoryManager.java | 27 ++- @@ -47,7 +47,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../tabmodel/TabModelSelectorImpl.java | 3 + .../browser/tabmodel/TabPersistentStore.java | 9 + .../browser/toolbar/ToolbarManager.java | 3 +- - .../webapps/WebappIntentDataProvider.java | 14 ++ + .../webapps/WebappIntentDataProvider.java | 15 ++ .../browser/android/historical_tab_saver.cc | 24 ++- .../chrome_autocomplete_provider_client.cc | 9 + .../chrome_autocomplete_provider_client.h | 1 + @@ -66,8 +66,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/profiles/profile_selections.cc | 10 ++ chrome/browser/profiles/profile_selections.h | 7 +- .../browser/ui/android/native_page/BUILD.gn | 2 + - .../browser/ui/native_page/NativePage.java | 23 ++- - .../strings/android_chrome_strings.grd | 31 ++++ + .../browser/ui/native_page/NativePage.java | 22 ++- + .../strings/android_chrome_strings.grd | 25 +++ .../browser/toolbar/LocationBarModel.java | 5 +- chrome/browser/ui/messages/android/BUILD.gn | 1 + .../snackbar/INeedSnackbarManager.java | 27 +++ @@ -84,8 +84,7 @@ 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 + - net/base/file_stream_context.cc | 2 +- - 66 files changed, 781 insertions(+), 103 deletions(-) + 65 files changed, 782 insertions(+), 111 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 @@ -98,7 +97,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 -@@ -632,6 +632,7 @@ chrome_java_resources = [ +@@ -635,6 +635,7 @@ chrome_java_resources = [ "java/res/xml/manage_sync_preferences.xml", "java/res/xml/personalize_google_services_preferences.xml", "java/res/xml/phone_as_a_security_key_accessory_filter.xml", @@ -117,14 +116,14 @@ 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_sandbox/TrackingProtectionOnboardingType.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionOnboardingView.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionSnackbarController.java", +@@ -946,6 +947,7 @@ chrome_java_sources = [ + "java/src/org/chromium/chrome/browser/privacy/settings/IncognitoLockSettings.java", + "java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerImpl.java", + "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.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", - "java/src/org/chromium/chrome/browser/provider/ChromeBrowserProviderImpl.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/CctHandler.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/ChromeTrackingProtectionDelegate.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionSnackbarController.java", diff --git a/chrome/android/java/res/xml/incognito_preferences.xml b/chrome/android/java/res/xml/incognito_preferences.xml new file mode 100644 --- /dev/null @@ -170,7 +169,7 @@ 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 -@@ -82,6 +82,11 @@ found in the LICENSE file. +@@ -86,6 +86,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" /> @@ -255,13 +254,15 @@ 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; -@@ -694,10 +698,15 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2044,6 +2045,9 @@ public abstract class ChromeActivity throw new IllegalStateException( "Attempting to access TabCreator before initialization"); } @@ -311,8 +314,8 @@ 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 -@@ -37,6 +37,8 @@ import org.chromium.base.supplier.OneshotSupplier; - import org.chromium.base.supplier.Supplier; +@@ -38,6 +38,8 @@ import org.chromium.base.supplier.Supplier; + import org.chromium.build.BuildConfig; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; @@ -320,7 +323,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App import org.chromium.chrome.browser.bookmarks.BookmarkModel; import org.chromium.chrome.browser.bookmarks.PowerBookmarkUtils; import org.chromium.chrome.browser.commerce.ShoppingFeatures; -@@ -99,6 +101,10 @@ import java.util.ArrayList; +@@ -100,6 +102,10 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -331,7 +334,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. -@@ -594,6 +600,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -584,6 +590,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) { @@ -345,7 +348,7 @@ 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; -@@ -657,7 +670,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -647,7 +660,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } if (item.getItemId() == R.id.recent_tabs_menu_id) { @@ -362,7 +365,7 @@ 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); -@@ -866,8 +887,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -860,8 +881,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate && !isNativePage && !isFileScheme && !isContentScheme @@ -385,7 +388,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr 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; -@@ -258,6 +259,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -265,6 +266,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { public List> buildContextMenu() { mShowEphemeralTabNewLabel = null; @@ -395,7 +398,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr List> groupedItems = new ArrayList<>(); if (mParams.isAnchor()) { -@@ -268,6 +272,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -275,6 +279,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)); @@ -403,7 +406,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)); } -@@ -292,7 +297,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -299,7 +304,7 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { } } if (FirstRunStatus.getFirstRunFlowComplete()) { @@ -415,15 +418,22 @@ 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 -@@ -70,37 +70,6 @@ public class CustomTabActivityLifecycleUmaTracker +@@ -71,45 +71,6 @@ public class CustomTabActivityLifecycleUmaTracker private boolean mIsInitialResume = true; private void recordIncognitoLaunchReason() { -- IncognitoCustomTabIntentDataProvider incognitoProvider = -- (IncognitoCustomTabIntentDataProvider) mIntentDataProvider; +- // TODO(crbug.com/352525607): Separate Ephemeral and Incognito CCT metrics. +- @IntentHandler.IncognitoCCTCallerId int incognitoCCTCallerId; +- if (mIntentDataProvider.getCustomTabMode() == CustomTabProfileType.INCOGNITO) { +- incognitoCCTCallerId = +- ((IncognitoCustomTabIntentDataProvider) mIntentDataProvider) +- .getFeatureIdForMetricsCollection(); +- } else { +- incognitoCCTCallerId = +- ((EphemeralCustomTabIntentDataProvider) mIntentDataProvider) +- .getFeatureIdForMetricsCollection(); +- } - -- @IntentHandler.IncognitoCCTCallerId -- int incognitoCCTCallerId = incognitoProvider.getFeatureIdForMetricsCollection(); - RecordHistogram.recordEnumeratedHistogram( - "CustomTabs.IncognitoCCTCallerId", - incognitoCCTCallerId, @@ -431,7 +441,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust - - // Record which 1P app launched Incognito CCT. - if (incognitoCCTCallerId == IntentHandler.IncognitoCCTCallerId.GOOGLE_APPS) { -- String sendersPackageName = incognitoProvider.getSendersPackageName(); +- String sendersPackageName = mIntentDataProvider.getClientPackageName(); - @IntentHandler.ExternalAppId - int externalId = IntentHandler.mapPackageToExternalAppId(sendersPackageName); - if (externalId != IntentHandler.ExternalAppId.OTHER) { @@ -443,7 +453,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust - // 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()); +- IntentHandler.determineExternalIntentSource( +- mIntentDataProvider.getIntent()); - RecordHistogram.recordEnumeratedHistogram( - "CustomTabs.ClientAppId.Incognito", - externalId, @@ -464,7 +475,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; -@@ -216,6 +217,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat +@@ -225,6 +226,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat openInChromeItemVisible = false; tryAddingReadAloud = false; } @@ -477,9 +488,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust 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 -@@ -88,6 +88,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable; - import org.chromium.components.embedder_support.util.UrlConstants; +@@ -88,6 +88,9 @@ import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.device.mojom.ScreenOrientationLockType; + import org.chromium.net.NetId; +import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; @@ -487,15 +498,20 @@ 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; -@@ -1390,7 +1393,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid - - @Override - public boolean isIncognito() { -- return false; -+ return AlwaysIncognitoLinkInterceptor.isAlwaysIncognito(); +@@ -1161,6 +1164,13 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid + return getInitialActivityWidth() > 0; } ++ @Override ++ public @CustomTabProfileType int getCustomTabMode() { ++ return AlwaysIncognitoLinkInterceptor.isAlwaysIncognito() ++ ? CustomTabProfileType.INCOGNITO ++ : CustomTabProfileType.REGULAR; ++ } ++ @Override + public boolean isPartialCustomTab() { + return isPartialHeightCustomTab() || isPartialWidthCustomTab(); 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 @@ -563,7 +579,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java -@@ -56,6 +56,14 @@ import org.chromium.ui.base.Clipboard; +@@ -57,6 +57,14 @@ import org.chromium.ui.base.Clipboard; import java.util.List; @@ -578,7 +594,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History /** Combines and manages the different UI components of browsing history. */ public class HistoryManager implements OnMenuItemClickListener, -@@ -168,7 +176,7 @@ public class HistoryManager +@@ -169,7 +177,7 @@ public class HistoryManager mUmaRecorder.recordOpenHistory(); // If incognito placeholder is shown, we don't need to create History UI elements. @@ -587,7 +603,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History mSelectableListLayout = null; mRootView = getIncognitoHistoryPlaceholderView(); return; -@@ -420,9 +428,22 @@ public class HistoryManager +@@ -436,9 +444,22 @@ public class HistoryManager onBackPressStateChanged(); } @@ -611,7 +627,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History // If Incognito placeholder is shown no need to call any destroy method. return; } -@@ -482,7 +503,7 @@ public class HistoryManager +@@ -498,7 +519,7 @@ public class HistoryManager * @return True if manager handles this event, false if it decides to ignore. */ private boolean onBackPressed() { @@ -902,10 +918,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin +import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; - import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; -@@ -374,6 +375,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity - ((PrivacySandboxSettingsBaseFragment) fragment) - .setSnackbarManager(getSnackbarManager()); + import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; +@@ -403,6 +404,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity + ((ChromeBaseSettingsFragment)fragment).setRequestRestartDelegate( + new RequestRestartDelegate(mSnackbarManager, this)); } + if (fragment instanceof INeedSnackbarManager) { + ((INeedSnackbarManager)fragment).setSnackbarManager(mSnackbarManager); @@ -916,7 +932,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabModelObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabModelObserver.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabModelObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore/HistoricalTabModelObserver.java -@@ -22,6 +22,8 @@ import java.util.HashMap; +@@ -24,6 +24,8 @@ import java.util.HashMap; import java.util.List; import java.util.Set; @@ -925,7 +941,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore /** A tab model observer for managing bulk closures. */ public class HistoricalTabModelObserver implements TabModelObserver { private final TabGroupModelFilter mTabGroupModelFilter; -@@ -53,9 +55,10 @@ public class HistoricalTabModelObserver implements TabModelObserver { +@@ -72,9 +74,10 @@ public class HistoricalTabModelObserver implements TabModelObserver { if (tabs.isEmpty() || !canRestore) return; if (tabs.size() == 1) { @@ -940,8 +956,8 @@ 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 -@@ -14,7 +14,7 @@ public interface HistoricalTabSaver { - * Creates a Tab entry in TabRestoreService. +@@ -32,7 +32,7 @@ public interface HistoricalTabSaver { + * * @param tab The {@link Tab} to create an entry for. */ - void createHistoricalTab(Tab tab); @@ -961,9 +977,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore /** Creates historical entries in TabRestoreService. */ @JNINamespace("historical_tab_saver") public class HistoricalTabSaverImpl implements HistoricalTabSaver { -@@ -67,10 +69,10 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -85,10 +87,10 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { + } - // HistoricalTabSaver implementation. @Override - public void createHistoricalTab(Tab tab) { + public void createHistoricalTab(Tab tab, boolean is_always_incognito) { @@ -974,7 +990,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore } @Override -@@ -131,7 +133,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -149,7 +151,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()) { @@ -983,7 +999,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore return; } -@@ -172,14 +174,15 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -190,14 +192,15 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { CollectionUtil.integerCollectionToIntArray(savedStateVersions)); } @@ -1001,16 +1017,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore } /** -@@ -187,7 +190,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -205,7 +208,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) { - if (tab.isIncognito()) return false; + if (tab.isIncognito() && !AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()) return false; + // Check the secondary tab model to see if the tab was moved instead of deleted. + if (tabIdExistsInSecondaryModel(tab.getId())) return false; - // {@link GURL#getScheme()} is not available in unit tests. - if (mIgnoreUrlSchemesForTesting) return true; -@@ -268,7 +271,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { +@@ -295,7 +298,7 @@ public class HistoricalTabSaverImpl implements HistoricalTabSaver { @NativeMethods interface Natives { @@ -1022,16 +1038,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/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 -@@ -154,6 +154,8 @@ import org.chromium.components.webapps.bottomsheet.PwaBottomSheetControllerFacto - import org.chromium.ui.InsetObserver; +@@ -144,6 +144,8 @@ import org.chromium.ui.InsetObserver; + import org.chromium.ui.UiUtils; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.base.DeviceFormFactor; +import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.ui.base.IntentRequestTracker; + import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.dragdrop.DragDropGlobalState; - import org.chromium.ui.modaldialog.ModalDialogManager; -@@ -1045,7 +1047,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { +@@ -975,7 +977,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { () -> { mTabCreatorManagerSupplier .get() @@ -1043,7 +1059,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/Tab diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java -@@ -50,6 +50,10 @@ import org.chromium.ui.base.PageTransition; +@@ -47,6 +47,10 @@ import org.chromium.ui.base.PageTransition; import org.chromium.ui.base.WindowAndroid; import org.chromium.url.GURL; @@ -1053,8 +1069,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/Chrome + /** 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. */ -@@ -534,7 +538,6 @@ public class ChromeTabCreator extends TabCreator { + private final Activity mActivity; +@@ -502,7 +506,6 @@ public class ChromeTabCreator extends TabCreator { // TODO(crbug.com/40691614): Clean up the launches from SearchActivity/Chrome. public Tab launchUrlFromExternalApp( LoadUrlParams loadUrlParams, String appId, boolean forceNewTab, Intent intent) { @@ -1085,7 +1101,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 -@@ -49,6 +49,8 @@ import org.chromium.chrome.features.start_surface.StartSurfaceUserData; +@@ -48,6 +48,8 @@ import org.chromium.chrome.browser.tabpersistence.TabStateFileManager; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.content_public.browser.LoadUrlParams; @@ -1094,7 +1110,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.DataInputStream; -@@ -764,6 +766,13 @@ public class TabPersistentStore { +@@ -777,6 +779,13 @@ public class TabPersistentStore { } } } @@ -1111,15 +1127,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java -@@ -42,6 +42,7 @@ import org.chromium.base.supplier.OneshotSupplier; - import org.chromium.base.supplier.Supplier; +@@ -43,6 +43,7 @@ import org.chromium.base.supplier.Supplier; + import org.chromium.cc.input.BrowserControlsState; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.chrome.browser.IntentHandler; - import org.chromium.chrome.browser.app.tab_activity_glue.TabReparentingController; import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton; -@@ -650,7 +651,7 @@ public class ToolbarManager + import org.chromium.chrome.browser.back_press.BackPressManager; +@@ -644,7 +645,7 @@ public class ToolbarManager TraceEvent.end("isOfflinePage"); return ret; } @@ -1131,17 +1147,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/Toolbar diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java -@@ -33,6 +33,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable; +@@ -33,6 +33,8 @@ import org.chromium.components.browser_ui.widget.TintedDrawable; import org.chromium.device.mojom.ScreenOrientationLockType; import org.chromium.ui.util.ColorUtils; -+import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; + /** Stores info about a web app. */ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider { private final Drawable mCloseButtonIcon; -@@ -45,6 +48,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider +@@ -45,6 +47,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider private final ColorProviderImpl mColorProvider; private final ColorProviderImpl mDarkColorProvider; @@ -1150,7 +1165,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI /** 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 +@@ -80,6 +84,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider mWebappExtras = webappExtras; mWebApkExtras = webApkExtras; mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP; @@ -1161,13 +1176,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI } @Override -@@ -175,6 +184,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider +@@ -175,6 +183,13 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider return mWebApkExtras; } + @Override -+ public boolean isIncognito() { -+ return mIsIncognito; ++ public @CustomTabProfileType int getCustomTabMode() { ++ return mIsIncognito ++ ? CustomTabProfileType.INCOGNITO ++ : CustomTabProfileType.REGULAR; + } + @Override @@ -1176,7 +1193,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/android/historical_tab_saver.cc --- a/chrome/browser/android/historical_tab_saver.cc +++ b/chrome/browser/android/historical_tab_saver.cc -@@ -32,6 +32,11 @@ +@@ -33,6 +33,11 @@ // Must come after all headers that specialize FromJniType() / ToJniType(). #include "chrome/android/chrome_jni_headers/HistoricalTabSaverImpl_jni.h" @@ -1188,7 +1205,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and using base::android::JavaParamRef; using base::android::JavaRef; using base::android::ScopedJavaLocalRef; -@@ -106,7 +111,8 @@ std::vector> StringsToUuids( +@@ -107,7 +112,8 @@ std::vector> StringsToUuids( void CreateHistoricalTab( TabAndroid* tab_android, @@ -1198,7 +1215,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and if (!tab_android) { return; } -@@ -117,9 +123,14 @@ void CreateHistoricalTab( +@@ -118,9 +124,14 @@ void CreateHistoricalTab( return; } @@ -1215,7 +1232,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and if (!service) { return; } -@@ -185,7 +196,7 @@ void CreateHistoricalBulkClosure( +@@ -186,7 +197,7 @@ void CreateHistoricalBulkClosure( std::vector per_tab_root_id, std::vector> tabs, std::vector web_contents_state) { @@ -1224,7 +1241,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and DCHECK_EQ(root_ids.size(), group_titles.size()); DCHECK_EQ(root_ids.size(), group_colors.size()); DCHECK_EQ(root_ids.size(), optional_tab_group_ids.size()); -@@ -318,11 +329,12 @@ static void JNI_HistoricalTabSaverImpl_CreateHistoricalTab( +@@ -319,11 +330,12 @@ static void JNI_HistoricalTabSaverImpl_CreateHistoricalTab( JNIEnv* env, const JavaParamRef& jtab_android, const JavaParamRef& state, @@ -1242,7 +1259,7 @@ 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 -@@ -358,6 +358,15 @@ ChromeAutocompleteProviderClient::GetProviderStateService() const { +@@ -366,6 +366,15 @@ ChromeAutocompleteProviderClient::GetProviderStateService() const { return ProviderStateServiceFactory::GetForProfile(profile_); } @@ -1303,7 +1320,7 @@ diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.c #include "components/content_settings/core/browser/content_settings_pref_provider.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/permissions/features.h" -@@ -101,9 +102,25 @@ scoped_refptr +@@ -104,9 +105,25 @@ scoped_refptr if (profile->IsOffTheRecord() && !profile->IsGuestSession()) GetForProfile(original_profile); @@ -1330,7 +1347,7 @@ diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.c /*store_last_modified=*/true, profile->ShouldRestoreOldSessionCookies(), profiles::IsRegularUserProfile(profile))); -@@ -112,6 +129,9 @@ scoped_refptr +@@ -115,6 +132,9 @@ scoped_refptr settings_map->RegisterProvider(ProviderType::kWebuiAllowlistProvider, std::move(allowlist_provider)); @@ -1343,9 +1360,9 @@ diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.c diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc -@@ -40,6 +40,9 @@ - #include "chrome/browser/ui/android/tab_model/tab_model.h" - #include "chrome/browser/ui/android/tab_model/tab_model_list.h" +@@ -42,6 +42,9 @@ + #include "components/feed/core/v2/public/feed_api.h" // nogncheck + #include "components/feed/core/v2/public/feed_service.h" // nogncheck #include "content/public/browser/web_contents.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_registry_simple.h" @@ -1353,7 +1370,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" -@@ -458,6 +461,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { +@@ -457,6 +460,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { history::HistoryService* HistoryTabHelper::GetHistoryService() { Profile* profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext()); @@ -1367,7 +1384,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo if (profile->IsOffTheRecord()) return nullptr; -@@ -465,6 +475,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { +@@ -464,6 +474,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { profile, ServiceAccessType::IMPLICIT_ACCESS); } @@ -1716,7 +1733,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 -@@ -248,6 +248,7 @@ +@@ -247,6 +247,7 @@ #if BUILDFLAG(IS_ANDROID) #include "chrome/browser/accessibility/accessibility_prefs/android/accessibility_prefs_controller.h" @@ -1724,7 +1741,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" -@@ -2126,6 +2127,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1950,6 +1951,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry); variations::VariationsService::RegisterProfilePrefs(registry); webapps::InstallPromptPrefs::RegisterProfilePrefs(registry); @@ -1748,7 +1765,7 @@ diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/prof #include "chrome/browser/profiles/profile.h" #include "components/profile_metrics/browser_profile_type.h" -@@ -109,6 +112,13 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const { +@@ -112,6 +115,13 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const { return nullptr; case ProfileSelection::kOriginalOnly: return profile->IsOffTheRecord() ? nullptr : profile; @@ -1768,13 +1785,13 @@ diff --git a/chrome/browser/profiles/profile_selections.h b/chrome/browser/profi @@ -6,7 +6,7 @@ #define CHROME_BROWSER_PROFILES_PROFILE_SELECTIONS_H_ - #include + #include - +#include "build/build_config.h" - #include "base/feature_list.h" - class Profile; -@@ -27,6 +27,11 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile); + + // A helper function that checks whether Keyed Services should be created for +@@ -25,6 +25,11 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile); enum class ProfileSelection { kNone, // Original: No Profile -- OTR: No Profile kOriginalOnly, // Original: Self -- OTR: No Profile @@ -1796,8 +1813,8 @@ diff --git a/chrome/browser/ui/android/native_page/BUILD.gn b/chrome/browser/ui/ + "//base:base_java", + "//components/embedder_support/android:util_java", "//base:base_junit_test_support", + "//third_party/android_deps:org_mockito_mockito_core_java", "//third_party/junit", - "//url:url_java", diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/browser/ui/native_page/NativePage.java b/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/browser/ui/native_page/NativePage.java --- a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/browser/ui/native_page/NativePage.java +++ b/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/browser/ui/native_page/NativePage.java @@ -1810,18 +1827,17 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ /** An interface for pages that will be using Android views instead of html/rendered Web content. */ public interface NativePage { -@@ -157,7 +159,9 @@ public interface NativePage { - * @return Whether the URL would navigate to a native page. +@@ -166,7 +168,8 @@ public interface NativePage { */ - static boolean isNativePageUrl(GURL url, boolean isIncognito, boolean isPdf) { -- return url != null && nativePageType(url, null, isIncognito, isPdf) != NativePageType.NONE; -+ return url != null -+ && nativePageType(url, null, isIncognito, isPdf, /*isAlwaysIncognito*/ false) + static boolean isNativePageUrl(GURL url, boolean isIncognito, boolean hasPdfDownload) { + return url != null +- && nativePageType(url, null, isIncognito, hasPdfDownload) != NativePageType.NONE; ++ && nativePageType(url, null, isIncognito, hasPdfDownload, /*isAlwaysIncognito*/ false) + != NativePageType.NONE; } /** -@@ -167,7 +171,7 @@ public interface NativePage { +@@ -176,7 +179,7 @@ public interface NativePage { * not have chrome or chrome-native scheme. */ static boolean isChromePageUrl(GURL url, boolean isIncognito) { @@ -1830,35 +1846,41 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ } /** -@@ -179,11 +183,12 @@ public interface NativePage { +@@ -188,11 +191,12 @@ public interface NativePage { */ // TODO(crbug.com/40549331) - Convert to using GURL. static @NativePageType int nativePageType( -- String url, NativePage candidatePage, boolean isIncognito, boolean isPdf) { -+ String url, NativePage candidatePage, boolean isIncognito, boolean isPdf, +- String url, NativePage candidatePage, boolean isIncognito, boolean hasPdfDownload) { ++ String url, NativePage candidatePage, boolean isIncognito, boolean hasPdfDownload, + boolean isAlwaysIncognito) { if (url == null) return NativePageType.NONE; GURL gurl = new GURL(url); -- return nativePageType(gurl, candidatePage, isIncognito, isPdf); -+ return nativePageType(gurl, candidatePage, isIncognito, isPdf, isAlwaysIncognito); +- return nativePageType(gurl, candidatePage, isIncognito, hasPdfDownload); ++ return nativePageType(gurl, candidatePage, isIncognito, hasPdfDownload, isAlwaysIncognito); } /** -@@ -194,9 +199,10 @@ public interface NativePage { +@@ -203,7 +207,8 @@ public interface NativePage { * @return Type of the native page defined in {@link NativePageType}. */ private static @NativePageType int nativePageType( -- GURL url, NativePage candidatePage, boolean isIncognito, boolean isPdf) { -+ GURL url, NativePage candidatePage, boolean isIncognito, boolean isPdf, +- GURL url, NativePage candidatePage, boolean isIncognito, boolean hasPdfDownload) { ++ GURL url, NativePage candidatePage, boolean isIncognito, boolean hasPdfDownload, + boolean isAlwaysIncognito) { - if (!isPdf) { + if (hasPdfDownload) { + // For navigation with associated pdf download (e.g. open a pdf link), pdf page should + // be created. +@@ -221,7 +226,7 @@ public interface NativePage { + // created after the pdf document is re-downloaded in other parts of the code. + return NativePageType.NONE; + } else { - return chromePageType(url, candidatePage, isIncognito); + return chromePageType(url, candidatePage, isIncognito, isAlwaysIncognito); } + } - if (candidatePage != null && candidatePage.getUrl().equals(url.getSpec())) { -@@ -214,7 +220,7 @@ public interface NativePage { +@@ -233,7 +238,7 @@ public interface NativePage { * which do not have chrome or chrome-native scheme. */ private static @NativePageType int chromePageType( @@ -1867,7 +1889,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ String host = url.getHost(); String scheme = url.getScheme(); if (!UrlConstants.CHROME_NATIVE_SCHEME.equals(scheme) -@@ -234,7 +240,8 @@ public interface NativePage { +@@ -253,7 +258,8 @@ public interface NativePage { return NativePageType.DOWNLOADS; } else if (UrlConstants.HISTORY_HOST.equals(host)) { return NativePageType.HISTORY; @@ -1880,7 +1902,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 -@@ -1296,6 +1296,37 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1344,6 +1344,31 @@ Your Google account may have other forms of browsing history like searches and a Deletes history from all synced devices @@ -1897,12 +1919,6 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro + + Opens links in incognito tabs when you click on new tab or on a link + -+ -+ Relaunch -+ -+ -+ Your changes will take effect the next time you relaunch Bromite. -+ + + Enable history + @@ -1921,7 +1937,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 -@@ -162,6 +162,7 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro +@@ -161,6 +161,7 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro protected String mFormattedFullUrl; protected String mUrlForDisplay; private boolean mOmniboxUpdatedConnectionSecurityIndicatorsEnabled; @@ -1929,7 +1945,7 @@ 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 -@@ -185,7 +186,9 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro +@@ -184,7 +185,9 @@ public class LocationBarModel implements ToolbarDataProvider, LocationBarDataPro Context context, NewTabPageDelegate newTabPageDelegate, @NonNull UrlFormatter urlFormatter, @@ -1986,7 +2002,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 -@@ -4077,6 +4077,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = +@@ -4187,6 +4187,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = "net.out_of_process_system_dns_resolution_enabled"; #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) @@ -2002,7 +2018,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 -@@ -96,10 +96,12 @@ void PrefProvider::RegisterProfilePrefs( +@@ -98,10 +98,12 @@ void PrefProvider::RegisterProfilePrefs( PrefProvider::PrefProvider(PrefService* prefs, bool off_the_record, @@ -2015,7 +2031,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"); -@@ -122,11 +124,13 @@ PrefProvider::PrefProvider(PrefService* prefs, +@@ -124,11 +126,13 @@ PrefProvider::PrefProvider(PrefService* prefs, WebsiteSettingsRegistry* website_settings = WebsiteSettingsRegistry::GetInstance(); for (const WebsiteSettingsInfo* info : *website_settings) { @@ -2052,7 +2068,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 -@@ -270,6 +270,7 @@ struct ContentSettingEntry { +@@ -264,6 +264,7 @@ struct ContentSettingEntry { HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, bool is_off_the_record, @@ -2060,7 +2076,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics) -@@ -279,6 +280,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -273,6 +274,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, #endif prefs_(prefs), is_off_the_record_(is_off_the_record), @@ -2068,7 +2084,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()) { -@@ -292,7 +294,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -286,7 +288,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, policy_provider->AddObserver(this); auto pref_provider_ptr = std::make_unique( @@ -2088,7 +2104,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics); -@@ -507,6 +508,8 @@ class HostContentSettingsMap : public content_settings::Observer, +@@ -510,6 +511,8 @@ class HostContentSettingsMap : public content_settings::Observer, // Whether this settings map is for an incognito or guest session. bool is_off_the_record_; @@ -2100,7 +2116,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. diff --git a/components/omnibox/browser/autocomplete_provider_client.cc b/components/omnibox/browser/autocomplete_provider_client.cc --- a/components/omnibox/browser/autocomplete_provider_client.cc +++ b/components/omnibox/browser/autocomplete_provider_client.cc -@@ -38,3 +38,7 @@ base::WeakPtr +@@ -46,3 +46,7 @@ base::WeakPtr AutocompleteProviderClient::GetWeakPtr() { return nullptr; } @@ -2122,7 +2138,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 -@@ -376,7 +376,7 @@ bool BaseSearchProvider::CanSendSuggestRequestWithoutPageURL( +@@ -386,7 +386,7 @@ bool BaseSearchProvider::CanSendSuggestRequestWithoutPageURL( } // Don't make a suggest request if in incognito mode. @@ -2183,16 +2199,4 @@ 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 -@@ -171,7 +171,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 { -- diff --git a/build/cromite_patches/Add-autoplay-site-setting.patch b/build/cromite_patches/Add-autoplay-site-setting.patch index 4cda1d334583b5285ee4b07f71cc4338c9c8c1a2..90f82c574ed3f36aa393f824b639ffdc6cd6b1c4 100644 --- a/build/cromite_patches/Add-autoplay-site-setting.patch +++ b/build/cromite_patches/Add-autoplay-site-setting.patch @@ -291,15 +291,15 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc --- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -@@ -8,6 +8,7 @@ - #include "third_party/blink/public/mojom/autoplay/autoplay.mojom-blink.h" +@@ -9,6 +9,7 @@ + #include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h" #include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" #include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink.h" +#include "third_party/blink/public/platform/web_content_settings_client.h" #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" -@@ -331,6 +332,8 @@ void AutoplayPolicy::TryUnlockingUserGesture() { +@@ -338,6 +339,8 @@ void AutoplayPolicy::TryUnlockingUserGesture() { } bool AutoplayPolicy::IsGestureNeededForPlayback() const { @@ -308,7 +308,7 @@ diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/thi if (!IsLockedPendingUserGesture()) return false; -@@ -429,6 +432,17 @@ void AutoplayPolicy::MaybeSetAutoplayInitiated() { +@@ -450,6 +453,17 @@ void AutoplayPolicy::MaybeSetAutoplayInitiated() { } } @@ -329,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 -@@ -142,6 +142,10 @@ class CORE_EXPORT AutoplayPolicy final +@@ -151,6 +151,10 @@ class CORE_EXPORT AutoplayPolicy final // should use, if checking to see if an action is allowed. bool IsLockedPendingUserGesture() const; diff --git a/build/cromite_patches/Add-bookmark-import-export-actions.patch b/build/cromite_patches/Add-bookmark-import-export-actions.patch index d7f1800a0fa573e063df79753bdfaa3b83f4d11f..5ec27e45980583582c1f52bbc29c0c39a871d06f 100644 --- a/build/cromite_patches/Add-bookmark-import-export-actions.patch +++ b/build/cromite_patches/Add-bookmark-import-export-actions.patch @@ -15,7 +15,7 @@ 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 | 285 +++++++++++++++++ + .../browser/bookmarks/BookmarkBridge.java | 285 ++++++++++++++++++ .../browser/bookmarks/BookmarkDelegate.java | 10 + .../bookmarks/BookmarkManagerCoordinator.java | 9 + .../bookmarks/BookmarkManagerMediator.java | 23 ++ @@ -26,8 +26,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../bookmarks/BookmarkToolbarViewBinder.java | 6 + .../native_page/NativePageFactory.java | 11 +- chrome/browser/BUILD.gn | 11 +- - .../bookmarks/android/bookmark_bridge.cc | 287 ++++++++++++++++++ - .../bookmarks/android/bookmark_bridge.h | 30 +- + .../bookmarks/android/bookmark_bridge.cc | 282 +++++++++++++++++ + .../bookmarks/android/bookmark_bridge.h | 29 +- .../browser/bookmarks/bookmark_html_writer.cc | 11 + .../dialogs/DownloadLocationCustomView.java | 8 +- .../DownloadLocationDialogCoordinator.java | 10 +- @@ -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 + - 42 files changed, 919 insertions(+), 30 deletions(-) + 42 files changed, 913 insertions(+), 30 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 @@ -542,7 +542,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; -@@ -303,6 +305,13 @@ public class BookmarkManagerCoordinator +@@ -302,6 +304,13 @@ public class BookmarkManagerCoordinator // Public API implementation. @@ -559,15 +559,15 @@ 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/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 -@@ -52,6 +52,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.commerce.core.CommerceSubscription; import org.chromium.components.commerce.core.ShoppingService; import org.chromium.components.commerce.core.SubscriptionsObserver; +import org.chromium.ui.base.ActivityWindowAndroid; +import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.components.favicon.LargeIconBridge; - import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.power_bookmarks.PowerBookmarkMeta; + import org.chromium.components.power_bookmarks.PowerBookmarkType; @@ -81,6 +83,9 @@ class BookmarkManagerMediator private static boolean sPreventLoadingForTesting; @@ -578,7 +578,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** Keeps track of whether drag is enabled / active for bookmark lists. */ private class BookmarkDragStateDelegate implements DragStateDelegate { private BookmarkDelegate mBookmarkDelegate; -@@ -568,6 +573,14 @@ class BookmarkManagerMediator +@@ -544,6 +549,14 @@ class BookmarkManagerMediator mNativePage = nativePage; } @@ -593,7 +593,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** See BookmarkManager(Coordinator)#updateForUrl */ void updateForUrl(String url) { // Bookmark model is null if the manager has been destroyed. -@@ -748,6 +761,16 @@ class BookmarkManagerMediator +@@ -724,6 +737,16 @@ class BookmarkManagerMediator } } @@ -814,7 +814,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 -@@ -203,6 +203,8 @@ static_library("browser") { +@@ -200,6 +200,8 @@ static_library("browser") { "bluetooth/chrome_bluetooth_delegate_impl_client.h", "bookmarks/bookmark_model_factory.cc", "bookmarks/bookmark_model_factory.h", @@ -823,9 +823,9 @@ 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", -@@ -1935,6 +1937,13 @@ static_library("browser") { - ] - } +@@ -1785,6 +1787,13 @@ static_library("browser") { + "webid/identity_provider_permission_request.h", + ] + if (is_android) { + sources += [ @@ -837,10 +837,10 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn configs += [ "//build/config/compiler:wexit_time_destructors", "//build/config:precompiled_headers", -@@ -3746,8 +3755,6 @@ static_library("browser") { - "badging/badge_manager_factory.h", - "banners/app_banner_manager_desktop.cc", - "banners/app_banner_manager_desktop.h", +@@ -3476,8 +3485,6 @@ static_library("browser") { + "bookmarks/bookmark_expanded_state_tracker.h", + "bookmarks/bookmark_expanded_state_tracker_factory.cc", + "bookmarks/bookmark_expanded_state_tracker_factory.h", - "bookmarks/bookmark_html_writer.cc", - "bookmarks/bookmark_html_writer.h", "bookmarks/url_and_id.h", @@ -849,7 +849,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 -@@ -59,6 +59,28 @@ +@@ -64,6 +64,28 @@ #include "content/public/browser/web_contents.h" #include "url/gurl.h" @@ -878,7 +878,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse // Must come after all headers that specialize FromJniType() / ToJniType(). #include "chrome/android/chrome_jni_headers/BookmarkBridge_jni.h" -@@ -77,12 +99,96 @@ using bookmarks::android::JavaBookmarkIdGetType; +@@ -82,12 +104,97 @@ using bookmarks::android::JavaBookmarkIdGetType; using content::BrowserThread; using power_bookmarks::PowerBookmarkMeta; @@ -910,14 +910,15 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + return true; + + GURL fixed_url(url_formatter::FixupURL(url.spec(), std::string())); -+ for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { -+ if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) ++ const base::span hosts = chrome::ChromeURLHosts(); ++ for (const base::cstring_view host : hosts) { ++ if (fixed_url.DomainIs(host)) { + return true; ++ } + } + -+ for (size_t i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) { -+ if (fixed_url == chrome::kChromeDebugURLs[i]) -+ return true; ++ if (base::Contains(chrome::ChromeDebugURLs(), fixed_url)) { ++ return true; + } + + // If url has either chrome:// or about: schemes but wasn't found in the @@ -975,7 +976,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse class BookmarkTitleComparer { public: explicit BookmarkTitleComparer(BookmarkBridge* bookmark_bridge, -@@ -223,6 +329,10 @@ BookmarkBridge::~BookmarkBridge() { +@@ -228,6 +335,10 @@ BookmarkBridge::~BookmarkBridge() { partner_bookmarks_shim_observation_.Reset(); bookmark_model_observation_.Reset(); profile_observation_.Reset(); @@ -986,7 +987,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse } void BookmarkBridge::Destroy(JNIEnv* env) { -@@ -762,6 +872,183 @@ jint BookmarkBridge::GetTotalBookmarkCount( +@@ -767,6 +878,177 @@ jint BookmarkBridge::GetTotalBookmarkCount( return count; } @@ -1007,10 +1008,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + ui::SelectFileDialog::FileTypeInfo file_type_info; + + const std::vector v_accept_types = { u"text/html" }; -+ -+ // Android needs the original MIME types and an additional capture value. -+ std::pair, bool> accept_types = -+ std::make_pair(v_accept_types, /* use_media_capture */ false); ++ select_file_dialog_->SetAcceptTypes(v_accept_types); + + select_file_dialog_->SelectFile( + ui::SelectFileDialog::SELECT_OPEN_FILE, @@ -1019,8 +1017,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + &file_type_info, + 0, + base::FilePath::StringType(), -+ window, -+ &accept_types ++ window + ); +} + @@ -1068,8 +1065,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + return std::make_unique(data); +} + -+void BookmarkBridge::FileSelected(const ui::SelectedFileInfo& file, int index, -+ void* params) { ++void BookmarkBridge::FileSelected(const ui::SelectedFileInfo& file, int index) { + base::FilePath path = file.path(); + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()}, @@ -1084,7 +1080,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse +const std::string BookmarkBridge::FileSelectedImpl(const base::FilePath& path) { + base::File file; + if (path.IsContentUri()) { -+ file = base::OpenContentUriForRead(path); ++ file = base::OpenContentUri(path, base::File::FLAG_OPEN | base::File::FLAG_READ); + } else { + file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ); + } @@ -1164,8 +1160,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + LOG(INFO) << result; +} + -+void BookmarkBridge::FileSelectionCanceled(void* params) { -+} ++void BookmarkBridge::FileSelectionCanceled() {} + void BookmarkBridge::SetBookmarkTitle(JNIEnv* env, jlong id, @@ -1201,20 +1196,19 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser public: // All of the injected pointers must be non-null and must outlive `this`. BookmarkBridge(Profile* profile, -@@ -81,6 +86,12 @@ class BookmarkBridge : public ProfileObserver, +@@ -81,6 +86,11 @@ class BookmarkBridge : public ProfileObserver, bool IsDoingExtensiveChanges(JNIEnv* env); + // SelectFileDialog::Listener implementation. + void FileSelected(const ui::SelectedFileInfo& file, -+ int index, -+ void* params) override; -+ void FileSelectionCanceled(void* params) override; ++ int index) override; ++ void FileSelectionCanceled() override; + jboolean IsEditBookmarksEnabled(JNIEnv* env); void LoadEmptyPartnerBookmarkShimForTesting(JNIEnv* env); -@@ -93,6 +104,15 @@ class BookmarkBridge : public ProfileObserver, +@@ -93,6 +103,15 @@ class BookmarkBridge : public ProfileObserver, jlong id, jint type); @@ -1230,7 +1224,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser void GetAllFoldersWithDepths( JNIEnv* env, const base::android::JavaParamRef& j_folders_obj, -@@ -363,6 +383,9 @@ class BookmarkBridge : public ProfileObserver, +@@ -363,6 +382,9 @@ class BookmarkBridge : public ProfileObserver, void CreateOrDestroyAccountReadingListManagerIfNeeded(); const raw_ptr profile_; // weak @@ -1240,7 +1234,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser base::android::ScopedJavaGlobalRef java_bookmark_model_; const raw_ptr bookmark_model_; // weak const raw_ptr -@@ -377,6 +400,7 @@ class BookmarkBridge : public ProfileObserver, +@@ -377,6 +399,7 @@ class BookmarkBridge : public ProfileObserver, std::unique_ptr grouped_bookmark_actions_; PrefChangeRegistrar pref_change_registrar_; @@ -1248,7 +1242,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser // Information about the Partner bookmarks (must check for IsLoaded()). // This is owned by profile. -@@ -408,6 +432,10 @@ class BookmarkBridge : public ProfileObserver, +@@ -408,6 +431,10 @@ class BookmarkBridge : public ProfileObserver, bool suppress_observer_notifications_ = false; @@ -1365,10 +1359,10 @@ 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 -@@ -188,6 +188,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -200,6 +200,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { &kCacheActivityTaskID, &kCastDeviceFilter, - &kCCTAuthView, + &kCCTAuthTab, + &kBookmarksExportUseSaf, &kCCTBeforeUnload, &kCCTClientDataHeader, @@ -1376,7 +1370,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 -@@ -517,6 +517,7 @@ public abstract class ChromeFeatureList { +@@ -530,6 +530,7 @@ public abstract class ChromeFeatureList { public static final String VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR = "VerticalAutomotiveBackButtonToolbar"; public static final String VISITED_URL_RANKING_SERVICE = "VisitedURLRankingService"; @@ -1439,7 +1433,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro /** Whether Chrome is set as the default browser. Default value is false. */ public static final String CHROME_DEFAULT_BROWSER = "applink.chrome_default_browser"; -@@ -921,6 +923,7 @@ public final class ChromePreferenceKeys { +@@ -920,6 +922,7 @@ public final class ChromePreferenceKeys { AUTOFILL_ASSISTANT_PROACTIVE_HELP_ENABLED, APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE, APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO, @@ -1450,7 +1444,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: +@@ -246,6 +246,24 @@ CHAR_LIMIT guidelines: Sites @@ -1478,7 +1472,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 -@@ -395,6 +395,9 @@ static_library("common_lib") { +@@ -355,6 +355,9 @@ static_library("common_lib") { sources += [ "media/chrome_media_drm_bridge_client.cc", "media/chrome_media_drm_bridge_client.h", @@ -1500,7 +1494,7 @@ diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn "importer/bookmarks_file_importer.cc", "importer/bookmarks_file_importer.h", "importer/external_process_importer_bridge.cc", -@@ -228,6 +226,11 @@ static_library("utility") { +@@ -225,6 +223,11 @@ static_library("utility") { ] } @@ -1616,7 +1610,7 @@ diff --git a/chrome/utility/importer/bookmark_html_reader.h b/chrome/utility/imp diff --git a/components/headless/select_file_dialog/headless_select_file_dialog.cc b/components/headless/select_file_dialog/headless_select_file_dialog.cc --- a/components/headless/select_file_dialog/headless_select_file_dialog.cc +++ b/components/headless/select_file_dialog/headless_select_file_dialog.cc -@@ -58,6 +58,10 @@ class HeadlessSelectFileDialog : public ui::SelectFileDialog { +@@ -57,6 +57,10 @@ class HeadlessSelectFileDialog : public ui::SelectFileDialog { // ui::SelectFileDialog: bool HasMultipleFileTypeChoicesImpl() override { return false; } @@ -1678,7 +1672,7 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui private static final String AUDIO_TYPE = "audio"; private static final String ALL_TYPES = "*/*"; -@@ -306,6 +308,11 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -307,6 +309,11 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick ResettersForTesting.register(() -> mFileTypes = oldValue); } @@ -1689,8 +1683,8 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui + /** * Creates and starts an intent based on the passed fileTypes and capture value. - * @param fileTypes MIME types requested (i.e. "image/*") -@@ -332,7 +339,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick + * +@@ -343,7 +350,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick List missingPermissions = new ArrayList<>(); String storagePermission = Manifest.permission.READ_EXTERNAL_STORAGE; boolean shouldUsePhotoPicker = shouldUsePhotoPicker(); @@ -1699,7 +1693,7 @@ 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 -@@ -385,7 +392,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -396,7 +403,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick // TODO(finnur): Remove once we figure out the cause of // crbug.com/950024. @@ -1708,7 +1702,7 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui if (permissions.length != requestPermissions.length) { throw new RuntimeException( String.format( -@@ -402,7 +409,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -413,7 +420,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick } } @@ -1717,7 +1711,7 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui if (permissions[i].equals(storagePermission) || permissions[i].equals( Manifest.permission.READ_MEDIA_IMAGES) -@@ -685,6 +692,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -701,6 +708,7 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick } if (!mimeTypes.contains(mimeType)) mimeTypes.add(mimeType); } @@ -1725,7 +1719,7 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui return mimeTypes; } -@@ -1034,6 +1042,10 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick +@@ -1062,6 +1070,10 @@ public class SelectFileDialog implements WindowAndroid.IntentCallback, PhotoPick return countAcceptTypesFor(superType) == mFileTypes.size(); } @@ -1752,7 +1746,7 @@ diff --git a/ui/android/java/strings/android_ui_strings.grd b/ui/android/java/st diff --git a/ui/shell_dialogs/select_file_dialog.h b/ui/shell_dialogs/select_file_dialog.h --- a/ui/shell_dialogs/select_file_dialog.h +++ b/ui/shell_dialogs/select_file_dialog.h -@@ -209,6 +209,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -224,6 +224,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog const GURL* caller = nullptr); bool HasMultipleFileTypeChoices(); @@ -1764,8 +1758,8 @@ diff --git a/ui/shell_dialogs/select_file_dialog.h b/ui/shell_dialogs/select_fil diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/select_file_dialog_android.cc --- a/ui/shell_dialogs/select_file_dialog_android.cc +++ b/ui/shell_dialogs/select_file_dialog_android.cc -@@ -139,6 +139,12 @@ void SelectFileDialogImpl::SelectFileImpl( - owning_window->GetJavaObject()); +@@ -160,6 +160,12 @@ void SelectFileDialogImpl::SelectFileImpl( + accept_multiple_files, owning_window->GetJavaObject()); } +void SelectFileDialogImpl::ShowToast(const std::string& message) { @@ -1780,8 +1774,8 @@ diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/s diff --git a/ui/shell_dialogs/select_file_dialog_android.h b/ui/shell_dialogs/select_file_dialog_android.h --- a/ui/shell_dialogs/select_file_dialog_android.h +++ b/ui/shell_dialogs/select_file_dialog_android.h -@@ -58,6 +58,8 @@ class SelectFileDialogImpl : public SelectFileDialog { - void* params, +@@ -53,6 +53,8 @@ class SelectFileDialogImpl : public SelectFileDialog { + gfx::NativeWindow owning_window, const GURL* caller) override; + void ShowToast(const std::string& message) override; @@ -1818,7 +1812,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog_linux.h b/ui/shell_dialogs/sele diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc --- a/ui/shell_dialogs/select_file_dialog_win.cc +++ b/ui/shell_dialogs/select_file_dialog_win.cc -@@ -195,6 +195,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog, +@@ -193,6 +193,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog, int index); bool HasMultipleFileTypeChoicesImpl() override; @@ -1826,7 +1820,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/selec // Returns the filter to be used while displaying the open/save file dialog. // This is computed from the extensions for the file types being opened. -@@ -273,6 +274,10 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { +@@ -270,6 +271,10 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { return has_multiple_file_type_choices_; } diff --git a/build/cromite_patches/Add-cromite-flags-support.patch b/build/cromite_patches/Add-cromite-flags-support.patch index fced281cda2b9a443abe22833f4e194256239314..6f5fba89e1558e102f9075f7f0060e687311bd7f 100644 --- a/build/cromite_patches/Add-cromite-flags-support.patch +++ b/build/cromite_patches/Add-cromite-flags-support.patch @@ -26,7 +26,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../privacy/settings/PrivacySettings.java | 2 +- .../browser/settings/SettingsActivity.java | 36 ++++ chrome/browser/about_flags.cc | 11 ++ - chrome/browser/browser_features.cc | 1 + + chrome/browser/browser_features.cc | 2 + chrome/browser/flags/BUILD.gn | 13 ++ .../flags/android/chrome_feature_list.cc | 1 + .../flags/android/chrome_feature_list.h | 1 + @@ -36,6 +36,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/browser/settings/BUILD.gn | 1 + .../settings/ChromeBaseSettingsFragment.java | 47 +++++ .../strings/android_chrome_strings.grd | 1 + + .../Add-cromite-flags-support.grdp | 9 + .../placeholder.txt | 1 + chrome/browser/ui/ui_features.cc | 1 + chrome/common/chrome_features.cc | 1 + @@ -45,8 +46,8 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html components/components_strings.grd | 1 + .../content_settings/core/common/features.cc | 1 + .../placeholder.txt | 1 + - components/flags_ui/flags_state.cc | 55 +++++- - components/flags_ui/resources/app.html | 42 ++++- + components/flags_ui/flags_state.cc | 54 ++++++ + components/flags_ui/resources/app.html | 40 +++++ components/flags_ui/resources/app.ts | 41 ++++- components/flags_ui/resources/experiment.html | 7 +- components/flags_ui/resources/experiment.ts | 16 ++ @@ -95,9 +96,10 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html third_party/blink/public/common/features.h | 1 + ui/base/ui_base_features.cc | 1 + ui/base/ui_base_features.h | 1 + - 82 files changed, 762 insertions(+), 22 deletions(-) + 83 files changed, 771 insertions(+), 20 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/Add-cromite-flags-support.grdp 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 @@ -130,7 +132,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/base/BUILD.gn b/base/BUILD.gn --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -202,6 +202,8 @@ buildflag_header("message_pump_buildflags") { +@@ -196,6 +196,8 @@ buildflag_header("message_pump_buildflags") { # This does not include test code (test support and anything in the test # directory) which should use source_set as is recommended for GN targets). component("base") { @@ -139,7 +141,7 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn sources = [ "allocator/allocator_check.cc", "allocator/allocator_check.h", -@@ -1054,7 +1056,7 @@ component("base") { +@@ -1048,7 +1050,7 @@ component("base") { "//build/config/compiler:wglobal_constructors", ] @@ -291,7 +293,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 -@@ -108,8 +108,10 @@ enum class FeatureMacroHandshake { kSecret }; +@@ -153,8 +153,10 @@ enum class FeatureMacroHandshake { kSecret }; struct BASE_EXPORT LOGICALLY_CONST Feature { constexpr Feature(const char* name, FeatureState default_state, @@ -304,7 +306,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h #if BUILDFLAG(ENABLE_BANNED_BASE_FEATURE_PREFIX) if (std::string_view(name).find(BUILDFLAG(BANNED_BASE_FEATURE_PREFIX)) == 0) { -@@ -136,6 +138,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { +@@ -181,6 +183,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { // command line switch. const FeatureState default_state; @@ -314,7 +316,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h private: friend class FeatureList; -@@ -411,6 +416,11 @@ class BASE_EXPORT FeatureList { +@@ -456,6 +461,11 @@ class BASE_EXPORT FeatureList { // instance, which is checked in builds with DCHECKs enabled. static bool IsEnabled(const Feature& feature); @@ -326,7 +328,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h // 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 -@@ -676,4 +686,62 @@ class BASE_EXPORT FeatureList { +@@ -721,4 +731,62 @@ class BASE_EXPORT FeatureList { } // namespace base @@ -436,10 +438,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 -@@ -75,6 +75,10 @@ found in the LICENSE file. - android:title="@string/tabgrid_use_icons_title" - android:summary="@string/tabgrid_use_icons_summary" - android:defaultValue="false" /> +@@ -55,6 +55,10 @@ found in the LICENSE file. + android:key="do_not_track" + android:title="@string/do_not_track_title" + android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" /> + kAuxiliarySearchMaxTabsCountParam( - "auxiliary_search_max_donation_tab", - 100); +@@ -208,6 +208,7 @@ constexpr base::FeatureParam kQuickDeleteAndroidSurveyTriggerId( + "trigger_id", + /*default_value=*/""); +#include "cromite_flags/chrome_browser_flags_android_chrome_feature_list_h.inc" } // namespace android @@ -674,7 +677,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser 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 -@@ -15,6 +15,10 @@ import org.chromium.base.cached_flags.DoubleCachedFieldTrialParameter; +@@ -16,6 +16,10 @@ import org.chromium.base.cached_flags.DoubleCachedFieldTrialParameter; import org.chromium.base.cached_flags.IntCachedFieldTrialParameter; import org.chromium.base.cached_flags.StringCachedFieldTrialParameter; @@ -685,18 +688,18 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f import java.util.List; import java.util.Map; -@@ -719,7 +723,7 @@ public abstract class ChromeFeatureList { - public static final CachedFlag sVerticalAutomotiveBackButtonToolbar = - newCachedFlag(VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR, true); +@@ -712,7 +716,7 @@ public abstract class ChromeFeatureList { + public static final CachedFlag sWebApkMinShellApkVersion = + newCachedFlag(WEB_APK_MIN_SHELL_APK_VERSION, true); - public static final List sFlagsCachedFullBrowser = + public static final List sFlagsCachedFullBrowserChromium = List.of( sAccountReauthenticationRecentTimeWindow, - sAllowUserCertificates, -@@ -816,6 +820,13 @@ public abstract class ChromeFeatureList { - sUseLibunwindstackNativeUnwinderAndroid, - sVerticalAutomotiveBackButtonToolbar); + sAndroidAppIntegration, +@@ -805,6 +809,13 @@ public abstract class ChromeFeatureList { + sVerticalAutomotiveBackButtonToolbar, + sWebApkMinShellApkVersion); + private static List concatenateLists(List... collections) { + return Arrays.stream(collections).flatMap(x -> x.stream()).collect(Collectors.toList()); @@ -769,9 +772,9 @@ new file mode 100644 diff --git a/chrome/browser/settings/BUILD.gn b/chrome/browser/settings/BUILD.gn --- a/chrome/browser/settings/BUILD.gn +++ b/chrome/browser/settings/BUILD.gn -@@ -14,6 +14,7 @@ android_library("java") { - deps = [ +@@ -35,6 +35,7 @@ android_library("java") { "//base:base_java", + "//chrome/browser/feedback/android:factory_java", "//chrome/browser/feedback/android:java", + "//chrome/browser/flags:java", "//chrome/browser/preferences:java", @@ -780,8 +783,8 @@ diff --git a/chrome/browser/settings/BUILD.gn b/chrome/browser/settings/BUILD.gn diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeBaseSettingsFragment.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeBaseSettingsFragment.java --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeBaseSettingsFragment.java +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeBaseSettingsFragment.java -@@ -11,6 +11,12 @@ import org.chromium.chrome.browser.feedback.FragmentHelpAndFeedbackLauncher; - import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; +@@ -11,6 +11,12 @@ import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; + import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherFactory; import org.chromium.chrome.browser.profiles.Profile; +import android.os.Bundle; @@ -793,9 +796,9 @@ diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browse /** * Base class for settings in Chrome. * -@@ -22,6 +28,47 @@ public abstract class ChromeBaseSettingsFragment extends PreferenceFragmentCompa +@@ -21,6 +27,47 @@ public abstract class ChromeBaseSettingsFragment extends PreferenceFragmentCompa + implements ProfileDependentSetting { private Profile mProfile; - private HelpAndFeedbackLauncher mHelpAndFeedbackLauncher; + private RequireRestartDelegate mRequireRestartDelegate; + @@ -838,9 +841,9 @@ diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browse + } + } + - /** @return The profile associated with the current Settings screen. */ - public Profile getProfile() { - assert mProfile != null : "Attempting to use the profile before initialization."; + /** + * @return The profile associated with the current Settings screen. + */ 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 @@ -852,6 +855,20 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro +diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp +@@ -0,0 +1,9 @@ ++ ++ ++ ++ Relaunch ++ ++ ++ Your changes will take effect the next time you relaunch Cromite. ++ ++ 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 @@ -861,16 +878,16 @@ new file mode 100644 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 -@@ -517,4 +517,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, - "StopLoadingAnimationForHiddenWindow", - base::FEATURE_ENABLED_BY_DEFAULT); +@@ -477,4 +477,5 @@ BASE_FEATURE(kUsePortalAccentColor, + + BASE_FEATURE(kCompactMode, "CompactMode", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/chrome_browser_ui_ui_features_cc.inc" } // namespace features 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 -@@ -1674,4 +1674,5 @@ BASE_FEATURE(kEventBasedLogUpload, +@@ -1760,4 +1760,5 @@ BASE_FEATURE(kPeriodicLogUploadMigration, base::FEATURE_DISABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -887,8 +904,8 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil + - - - +@@ -281,6 +281,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 @@ -977,11 +994,10 @@ new file mode 100644 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 -@@ -359,7 +359,21 @@ void FlagsState::GetSwitchesAndFeaturesFromFlags( +@@ -365,6 +365,21 @@ 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('@'); @@ -997,10 +1013,10 @@ diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_stat + } + NOTREACHED_NORETURN(); + } + CHECK(entry_it != name_to_switch_map.end(), base::NotFatalUntil::M130); const SwitchEntry& entry = entry_it->second; - if (!entry.switch_name.empty()) -@@ -676,6 +690,27 @@ void FlagsState::GetFlagFeatureEntries( +@@ -682,6 +697,27 @@ void FlagsState::GetFlagFeatureEntries( data.Set("links", std::move(links)); } @@ -1028,7 +1044,7 @@ 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: -@@ -804,6 +839,16 @@ void FlagsState::AddSwitchesToCommandLine( +@@ -810,6 +846,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()) { @@ -1045,7 +1061,7 @@ diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_stat NOTREACHED_IN_MIGRATION(); continue; } -@@ -1056,6 +1101,14 @@ const FeatureEntry* FlagsState::FindFeatureEntryByName( +@@ -1062,6 +1108,14 @@ const FeatureEntry* FlagsState::FindFeatureEntryByName( bool FlagsState::IsSupportedFeature(const FlagsStorage* storage, const std::string& name, int platform_mask) const { @@ -1096,9 +1112,9 @@ diff --git a/components/flags_ui/resources/app.html b/components/flags_ui/resour + + + diff --git a/components/flags_ui/resources/app.ts b/components/flags_ui/resources/app.ts @@ -1367,16 +1380,16 @@ diff --git a/components/offline_pages/core/offline_page_feature.h b/components/o diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc --- a/components/password_manager/core/browser/features/password_features.cc +++ b/components/password_manager/core/browser/features/password_features.cc -@@ -207,4 +207,5 @@ BASE_FEATURE(kUsernameFirstFlowWithIntermediateValuesVoting, - "UsernameFirstFlowWithIntermediateValuesVoting", - base::FEATURE_ENABLED_BY_DEFAULT); +@@ -159,4 +159,5 @@ BASE_FEATURE(kUseAsyncOsCryptInLoginDatabase, + "UseAsyncOsCryptInLoginDatabase", + base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/components_password_manager_core_browser_features_password_features_cc.inc" } // namespace password_manager::features diff --git a/components/permissions/features.cc b/components/permissions/features.cc --- a/components/permissions/features.cc +++ b/components/permissions/features.cc -@@ -149,6 +149,7 @@ BASE_FEATURE(kCpssQuietChipTextUpdate, +@@ -150,6 +150,7 @@ BASE_FEATURE(kCpssQuietChipTextUpdate, "CpssQuietChipTextUpdate", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1399,7 +1412,7 @@ diff --git a/components/version_ui/version_handler_helper.cc b/components/versio diff --git a/content/common/features.cc b/content/common/features.cc --- a/content/common/features.cc +++ b/content/common/features.cc -@@ -579,4 +579,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, +@@ -592,4 +592,5 @@ BASE_FEATURE(kScrollBubblingFix, // Please keep features in alphabetical order. @@ -1408,7 +1421,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 -@@ -1295,4 +1295,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { +@@ -1380,4 +1380,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { VideoCaptureServiceConfiguration::kEnabledForBrowserProcess; } @@ -1417,7 +1430,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 -@@ -286,6 +286,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); +@@ -311,6 +311,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForOutOfProcess(); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForBrowserProcess(); @@ -1751,7 +1764,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 -@@ -1904,5 +1904,5 @@ uint32_t GetPassthroughAudioFormats() { +@@ -1912,5 +1912,5 @@ uint32_t GetPassthroughAudioFormats() { return 0; #endif // BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) } @@ -1761,7 +1774,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 -@@ -576,5 +576,5 @@ MEDIA_EXPORT OOPVDMode GetOutOfProcessVideoDecodingMode(); +@@ -580,5 +580,5 @@ MEDIA_EXPORT OOPVDMode GetOutOfProcessVideoDecodingMode(); MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); } // namespace media @@ -1771,8 +1784,8 @@ 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 -@@ -550,4 +550,5 @@ BASE_FEATURE(kSpdySessionForProxyAdditionalChecks, - "SpdySessionForProxyAdditionalChecks", +@@ -594,4 +594,5 @@ BASE_FEATURE(kLegacyPKCS1ForTLS13, + "LegacyPKCS1ForTLS13", base::FEATURE_ENABLED_BY_DEFAULT); +#include "cromite_flags/net_base_features_cc.inc" @@ -1780,9 +1793,9 @@ diff --git a/net/base/features.cc b/net/base/features.cc diff --git a/net/base/features.h b/net/base/features.h --- a/net/base/features.h +++ b/net/base/features.h -@@ -522,6 +522,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kStorageAccessHeaders); - // not causing any problems. - NET_EXPORT BASE_DECLARE_FEATURE(kSpdySessionForProxyAdditionalChecks); +@@ -600,6 +600,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kOptimizeParsingDataUrls); + // support RSA-PSS. + NET_EXPORT BASE_DECLARE_FEATURE(kLegacyPKCS1ForTLS13); +#include "cromite_flags/net_base_features_h.inc" } // namespace net::features @@ -1791,18 +1804,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 -@@ -518,4 +518,5 @@ const base::FeatureParam kNetworkContextPrefetchMaxLoaders{ - &kNetworkContextPrefetch, - /*name=*/"max_loaders", /*default_value=*/10}; +@@ -475,4 +475,5 @@ BASE_FEATURE(kTreatNullIPAsPublicAddressSpace, + "TreatNullIPAsPublicAddressSpace", + base::FEATURE_DISABLED_BY_DEFAULT); +#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 -@@ -212,6 +212,7 @@ BASE_DECLARE_FEATURE(kNetworkContextPrefetch); +@@ -186,6 +186,7 @@ extern const base::FeatureParam kNetworkContextPrefetchMaxLoaders; COMPONENT_EXPORT(NETWORK_CPP) - extern const base::FeatureParam kNetworkContextPrefetchMaxLoaders; + BASE_DECLARE_FEATURE(kTreatNullIPAsPublicAddressSpace); +#include "cromite_flags/services_network_public_cpp_features_h.inc" } // namespace network::features @@ -1811,19 +1824,18 @@ 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 -@@ -2678,5 +2678,6 @@ BASE_FEATURE(kOptimizeLoadingDataUrls, - "OptimizeLoadingDataUrls", - base::FEATURE_DISABLED_BY_DEFAULT); +@@ -2708,4 +2708,5 @@ bool IsCanvasSharedBitmapConversionEnabled() { + features::kCanvasSharedBitmapToSharedImage); + } +#include "cromite_flags/third_party_blink_common_features_cc.inc" - } // namespace features - } // namespace blink + } // namespace blink::features 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 -@@ -1747,6 +1747,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRenderSizeInScoreAdBrowserSignals); - // Optimize loading data: URLs. - BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOptimizeLoadingDataUrls); +@@ -1831,6 +1831,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOptimizeLoadingDataUrls); + + BLINK_COMMON_EXPORT bool IsCanvasSharedBitmapConversionEnabled(); +#include "cromite_flags/third_party_blink_common_features_h.inc" } // namespace features @@ -1832,8 +1844,8 @@ diff --git a/third_party/blink/public/common/features.h b/third_party/blink/publ diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc -@@ -529,4 +529,5 @@ BASE_FEATURE(kEnableGestureBeginEndTypes, - "EnableGestureBeginEndTypes", +@@ -536,4 +536,5 @@ BASE_FEATURE(kAsyncFullscreenWindowState, + "AsyncFullscreenWindowState", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/ui_base_features_cc.inc" @@ -1841,9 +1853,9 @@ diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h --- a/ui/base/ui_base_features.h +++ b/ui/base/ui_base_features.h -@@ -247,6 +247,7 @@ BASE_DECLARE_FEATURE(kBubbleFrameViewTitleIsHeading); +@@ -262,6 +262,7 @@ BASE_DECLARE_FEATURE(kUseUtf8EncodingForSvgImage); COMPONENT_EXPORT(UI_BASE_FEATURES) - BASE_DECLARE_FEATURE(kEnableGestureBeginEndTypes); + BASE_DECLARE_FEATURE(kAsyncFullscreenWindowState); +#include "cromite_flags/ui_base_features_h.inc" } // namespace features diff --git a/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch b/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch index 052e21d3524e570f6420e25d5f74ab8096daf38a..0d59e17e94c71ef722772325552229e2091e377b 100644 --- a/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch +++ b/build/cromite_patches/Add-custom-tab-intents-privacy-option.patch @@ -18,18 +18,19 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../privacy/settings/PrivacySettings.java | 24 +++++++++++++++++++ .../chrome/browser/tab/TabAssociatedApp.java | 6 ++++- .../strings/android_chrome_strings.grd | 14 +++++++++++ + .../OriginVerifier.java | 5 ++++ .../core/common/language_experiments.cc | 1 + .../add-custom-tab-intents-privacy-option.inc | 1 + - 9 files changed, 83 insertions(+), 1 deletion(-) + 10 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc 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 -@@ -59,6 +59,16 @@ found in the LICENSE file. - android:key="do_not_track" - android:title="@string/do_not_track_title" - android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" /> +@@ -63,6 +63,16 @@ found in the LICENSE file. + android:key="cromite_flags" + android:title="@string/cromite_flags_title" + app:url="@string/cromite_flags_url" /> + ", "", servicesLink)); } @@ -152,7 +153,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(); -@@ -335,6 +341,14 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -328,6 +334,14 @@ public class PrivacySettings extends ChromeBaseSettingsFragment } else if (PREF_SEARCH_SUGGESTIONS.equals(key)) { UserPrefs.get(getProfile()) .setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue); @@ -167,7 +168,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting } return true; } -@@ -357,6 +371,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -350,6 +364,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment UserPrefs.get(getProfile()).getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED)); } @@ -203,7 +204,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 -@@ -5454,6 +5454,20 @@ To change this setting, BEGIN_LINKdelete the Chrome d +@@ -5696,6 +5696,20 @@ To change this setting, BEGIN_LINKdelete the Chrome d Resume @@ -219,11 +220,26 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro + Open external links in incognito + + -+ Force the opening of all external links in incognito mode ++ Force the opening of all external links in incognito mode. Caution: there is only one incognito profile. + Show your Chrome activity in Digital Wellbeing? +diff --git a/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java b/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java +--- a/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java ++++ b/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java +@@ -180,6 +180,11 @@ public abstract class OriginVerifier { + assert mNativeOriginVerifier != 0 + : "Either provide a browserContextHandle to " + + "OriginVerifier#ctor or call initNativeOriginVerifier."; ++ if ((true)) { ++ PostTask.runOrPostTask( ++ TaskTraits.UI_DEFAULT, new VerifiedCallback(origin, false, null)); ++ return; ++ } + + String scheme = origin.uri().getScheme(); + String host = origin.uri().getHost(); diff --git a/components/language/core/common/language_experiments.cc b/components/language/core/common/language_experiments.cc --- a/components/language/core/common/language_experiments.cc +++ b/components/language/core/common/language_experiments.cc diff --git a/build/cromite_patches/Add-exit-menu-item.patch b/build/cromite_patches/Add-exit-menu-item.patch index 7b4f857a1b115ef8840b802adc1ff48e5de540de..c2c33791b33d6d318e37b9cf4278e29ad5a045be 100644 --- a/build/cromite_patches/Add-exit-menu-item.patch +++ b/build/cromite_patches/Add-exit-menu-item.patch @@ -16,7 +16,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml --- a/chrome/android/java/res/menu/main_menu.xml +++ b/chrome/android/java/res/menu/main_menu.xml -@@ -160,6 +160,9 @@ found in the LICENSE file. +@@ -163,6 +163,9 @@ found in the LICENSE file. @@ -26,7 +26,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re -@@ -186,6 +189,9 @@ found in the LICENSE file. +@@ -192,6 +195,9 @@ found in the LICENSE file. @@ -58,7 +58,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 -@@ -268,6 +268,8 @@ import java.util.Set; +@@ -263,6 +263,8 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.DoubleConsumer; @@ -67,15 +67,15 @@ 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. -@@ -2960,6 +2962,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2566,6 +2567,11 @@ public abstract class ChromeActivity return true; } @@ -102,7 +102,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv 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 -@@ -4063,6 +4063,9 @@ To change this setting, BEGIN_LINKdelete the Chrome d +@@ -4245,6 +4245,9 @@ To change this setting, BEGIN_LINKdelete the Chrome d Dark theme diff --git a/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch b/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch index 3f1f7eccdb40ec45910feab03ca0770456cc1da7..2cd9a8112ac93b16dba5aaaad721318adb1431dd 100644 --- a/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch +++ b/build/cromite_patches/Add-flag-for-omnibox-autocomplete-filtering.patch @@ -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" -@@ -500,6 +501,15 @@ AutocompleteController::AutocompleteController( +@@ -541,6 +542,15 @@ AutocompleteController::AutocompleteController( provider_client_->GetOmniboxTriggeredFeatureService()), steady_state_omnibox_position_( metrics::OmniboxEventProto::UNKNOWN_POSITION) { @@ -45,7 +45,7 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/ diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc -@@ -487,6 +487,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, +@@ -488,6 +488,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY) matches_.push_back(what_you_typed_match); @@ -79,7 +79,7 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/ diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc --- a/components/url_formatter/url_fixer.cc +++ b/components/url_formatter/url_fixer.cc -@@ -9,6 +9,8 @@ +@@ -14,6 +14,8 @@ #include #include "base/check_op.h" @@ -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" -@@ -620,6 +622,8 @@ GURL FixupURLInternal(const std::string& text, +@@ -625,6 +627,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()) diff --git a/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch b/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch index dfceddc87580630c4d7d36e96f718fa7f173947c..fbc9bdad064f0f3718833f75e26d853e30a0d8a9 100644 --- a/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch +++ b/build/cromite_patches/Add-flag-to-configure-maximum-connections-per-host.patch @@ -59,7 +59,7 @@ diff --git a/components/network_session_configurator/common/network_switch_list. diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn --- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn +++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn -@@ -89,6 +89,7 @@ executable("make_top_domain_list_variables") { +@@ -90,6 +90,7 @@ executable("make_top_domain_list_variables") { "//base:i18n", "//components/url_formatter/spoof_checks/common_words:common", "//third_party/icu", diff --git a/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch b/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch index fd65a8506e082266c854b2d2862be219c07d90af..7a5b9bb46c99b835cad9ab987b1a9ebd4b399e94 100644 --- a/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch +++ b/build/cromite_patches/Add-flag-to-disable-IPv6-probes.patch @@ -45,7 +45,7 @@ new file mode 100644 diff --git a/net/BUILD.gn b/net/BUILD.gn --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -1047,6 +1047,7 @@ component("net") { +@@ -1081,6 +1081,7 @@ component("net") { "//build:chromeos_buildflags", "//components/miracle_parameter/common", "//net/http:transport_security_state_generated_files", @@ -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 -@@ -113,6 +113,7 @@ +@@ -114,6 +114,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" -@@ -1429,6 +1430,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( +@@ -1430,6 +1431,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( return OK; } diff --git a/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch b/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch index 4682e102b7390c403e23e40583216deaaf486c0d..8c896f961fe3aa7cb9f1d1fee41357a7ac30bc0b 100644 --- a/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch +++ b/build/cromite_patches/Add-flag-to-disable-external-intent-requests.patch @@ -7,10 +7,107 @@ when flag is disabled no external intent will ever be allowed, for any URL. License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - ...Add-flag-to-disable-external-intent-requests.inc | 13 +++++++++++++ - 1 file changed, 13 insertions(+) + .../java/res/xml/privacy_preferences.xml | 7 +++- + .../ExternalNavigationDelegateImpl.java | 3 +- + .../cromite/sAllowExternalIntentRequests.java | 33 +++++++++++++++++++ + ...g-to-disable-external-intent-requests.grdp | 9 +++++ + ...ag-to-disable-external-intent-requests.inc | 13 ++++++++ + ...ag-to-disable-external-intent-requests.inc | 3 ++ + 6 files changed, 66 insertions(+), 2 deletions(-) + create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java + create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc + create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc +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 +@@ -83,7 +83,12 @@ found in the LICENSE file. + android:title="@string/settings_incognito_tab_lock_title" + android:summary="@string/settings_incognito_tab_lock_summary_android_setting_off" + android:persistent="false" /> +- ++ + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java +@@ -19,6 +19,7 @@ import org.chromium.base.IntentUtils; + import org.chromium.base.PackageManagerUtils; + import org.chromium.base.supplier.Supplier; + import org.chromium.chrome.browser.ChromeTabbedActivity2; ++import org.chromium.chrome.browser.flags.cromite.sAllowExternalIntentRequests; + import org.chromium.chrome.browser.IntentHandler; + import org.chromium.chrome.browser.tab.EmptyTabObserver; + import org.chromium.chrome.browser.tab.Tab; +@@ -103,7 +104,7 @@ public class ExternalNavigationDelegateImpl implements ExternalNavigationDelegat + + @Override + public boolean shouldDisableExternalIntentRequestsForUrl(GURL url) { +- return false; ++ return !sAllowExternalIntentRequests.getInstance().isEnabled(); + } + + @Override +diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java +@@ -0,0 +1,33 @@ ++/* ++ This file is part of Cromite. ++ ++ Cromite is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ Cromite is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with Cromite. If not, see . ++*/ ++ ++package org.chromium.chrome.browser.flags.cromite; ++ ++import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.chrome.browser.flags.ChromeFeatureMap; ++ ++public class sAllowExternalIntentRequests { ++ private static final CachedFlag sInstance = ++ new CachedFlag(ChromeFeatureMap.getInstance(), ++ "AllowExternalIntentRequests", false); ++ ++ private sAllowExternalIntentRequests() {} ++ ++ public static CachedFlag getInstance() { ++ return sInstance; ++ } ++} +diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp +@@ -0,0 +1,9 @@ ++ ++ ++ ++ Allow forward URL requests to external intents ++ ++ ++ If disabled, URL requests will never allow redirection to an external intent, such as open application or dialer. Caution: since no verification is possible on the information, allows linkage between browser browsing and activity on the application. ++ ++ diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc new file mode 100644 --- /dev/null @@ -29,4 +126,12 @@ new file mode 100644 +#endif + +#endif +diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc +new file mode 100644 +--- /dev/null ++++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc +@@ -0,0 +1,3 @@ ++CROMITE_FEATURE(kAllowExternalIntentRequests, ++ "AllowExternalIntentRequests", ++ base::FEATURE_DISABLED_BY_DEFAULT); -- diff --git a/build/cromite_patches/Add-flag-to-disable-vibration.patch b/build/cromite_patches/Add-flag-to-disable-vibration.patch index 9d4b7e34ff058e626d5f894d322acfa3be065e15..e7237dec6ef7a47a0f2d92c92b4b674a0e89798f 100644 --- a/build/cromite_patches/Add-flag-to-disable-vibration.patch +++ b/build/cromite_patches/Add-flag-to-disable-vibration.patch @@ -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 -@@ -672,6 +672,10 @@ +@@ -757,6 +757,10 @@ status: {"Android": "stable"}, base_feature: "none", }, diff --git a/build/cromite_patches/Add-lifetime-options-for-permissions.patch b/build/cromite_patches/Add-lifetime-options-for-permissions.patch index 3c5ab86b23a4e6a1c9691b19dd48689d0898c09d..4f6830dab7c5900d54bcffd625186ef04cb6970f 100644 --- a/build/cromite_patches/Add-lifetime-options-for-permissions.patch +++ b/build/cromite_patches/Add-lifetime-options-for-permissions.patch @@ -207,7 +207,7 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker.h b/chrome/ ~OneTimePermissionsTracker() override; OneTimePermissionsTracker(const OneTimePermissionsTracker&) = delete; -@@ -139,7 +140,7 @@ class OneTimePermissionsTracker : public KeyedService { +@@ -138,7 +139,7 @@ class OneTimePermissionsTracker : public KeyedService { base::ObserverList observer_list_; std::map origin_tracker_; @@ -219,7 +219,7 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker.h b/chrome/ diff --git a/chrome/browser/permissions/one_time_permissions_tracker_factory.cc b/chrome/browser/permissions/one_time_permissions_tracker_factory.cc --- a/chrome/browser/permissions/one_time_permissions_tracker_factory.cc +++ b/chrome/browser/permissions/one_time_permissions_tracker_factory.cc -@@ -41,5 +41,5 @@ bool OneTimePermissionsTrackerFactory::ServiceIsCreatedWithBrowserContext() +@@ -44,5 +44,5 @@ bool OneTimePermissionsTrackerFactory::ServiceIsCreatedWithBrowserContext() std::unique_ptr OneTimePermissionsTrackerFactory::BuildServiceInstanceForBrowserContext( content::BrowserContext* context) const { @@ -229,7 +229,7 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker_factory.cc 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 -@@ -658,7 +658,7 @@ void EmbeddedPermissionPrompt::SendDelegateAction(Action action) { +@@ -654,7 +654,7 @@ void EmbeddedPermissionPrompt::SendDelegateAction(Action action) { delegate_->Accept(); break; case Action::kAllowThisTime: @@ -288,7 +288,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(); -@@ -1091,6 +1096,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1092,6 +1097,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment AppCompatResources.getColorStateList(getContext(), mHighlightColor) .getDefaultColor()); } @@ -329,7 +329,7 @@ diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/comp 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 -@@ -155,6 +155,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { +@@ -160,6 +160,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { return constraints.session_model() == mojom::SessionModel::DURABLE; } @@ -509,7 +509,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 -@@ -1171,6 +1171,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1179,6 +1179,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, permission_info.is_one_time = (info.metadata.session_model() == content_settings::mojom::SessionModel::ONE_TIME); @@ -606,8 +606,8 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per + TextView lifetimeOptionsText = new TextView(context); + lifetimeOptionsText.setText(context.getString( + org.chromium.components.permissions.R.string.session_permissions_title)); -+ ApiCompatibilityUtils.setTextAppearance( -+ lifetimeOptionsText, R.style.TextAppearance_TextMedium_Primary); ++ lifetimeOptionsText.setTextAppearance( ++ lifetimeOptionsText.getContext(), R.style.TextAppearance_TextMedium_Primary); + + LinearLayout.LayoutParams lifetimeOptionsTextLayoutParams = + new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); @@ -667,7 +667,7 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per 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 -@@ -159,6 +159,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { +@@ -158,6 +158,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { Java_PermissionDialogDelegate_dismissFromNative(env, j_delegate_); } @@ -679,7 +679,7 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ // static void PermissionDialogDelegate::Create( content::WebContents* web_contents, -@@ -187,6 +192,13 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( +@@ -186,6 +191,13 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( void PermissionDialogDelegate::Accept(JNIEnv* env, const JavaParamRef& obj) { CHECK(permission_prompt_); @@ -693,7 +693,7 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ permission_prompt_->Accept(); } -@@ -194,12 +206,22 @@ void PermissionDialogDelegate::AcceptThisTime( +@@ -193,12 +205,22 @@ void PermissionDialogDelegate::AcceptThisTime( JNIEnv* env, const JavaParamRef& obj) { CHECK(permission_prompt_); @@ -731,7 +731,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 -@@ -62,8 +62,12 @@ void PermissionPromptAndroid::Accept() { +@@ -67,8 +67,12 @@ void PermissionPromptAndroid::Accept() { delegate_->Accept(); } @@ -749,7 +749,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 -@@ -47,8 +47,9 @@ class PermissionPromptAndroid : public PermissionPrompt { +@@ -49,8 +49,9 @@ class PermissionPromptAndroid : public PermissionPrompt { void Closing(); void Accept(); @@ -920,7 +920,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 -@@ -265,6 +265,17 @@ bool PermissionContextBase::UsesAutomaticEmbargo() const { +@@ -266,6 +266,17 @@ bool PermissionContextBase::UsesAutomaticEmbargo() const { return true; } @@ -938,7 +938,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, -@@ -501,7 +512,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -502,7 +513,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -948,7 +948,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); -@@ -516,13 +528,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -517,13 +529,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) { @@ -967,7 +967,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } } -@@ -590,11 +603,27 @@ void PermissionContextBase::NotifyPermissionSet( +@@ -591,11 +604,27 @@ void PermissionContextBase::NotifyPermissionSet( ContentSetting content_setting, bool is_one_time, bool is_final_decision) { @@ -996,7 +996,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } if (is_final_decision) { -@@ -634,6 +663,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -635,6 +664,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time) { @@ -1012,7 +1012,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 || -@@ -643,6 +681,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -644,6 +682,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, constraints.set_session_model( is_one_time ? content_settings::mojom::SessionModel::ONE_TIME : content_settings::mojom::SessionModel::DURABLE); @@ -1078,7 +1078,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi diff --git a/components/permissions/permission_prompt.h b/components/permissions/permission_prompt.h --- a/components/permissions/permission_prompt.h +++ b/components/permissions/permission_prompt.h -@@ -67,8 +67,9 @@ class PermissionPrompt { +@@ -68,8 +68,9 @@ class PermissionPrompt { virtual GURL GetEmbeddingOrigin() const = 0; virtual void Accept() = 0; @@ -1107,7 +1107,7 @@ diff --git a/components/permissions/permission_request.cc b/components/permissio PermissionRequest::~PermissionRequest() { DCHECK(delete_callback_.is_null()); } -@@ -370,19 +378,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { +@@ -386,19 +394,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { return request_type() == RequestType::kStorageAccess; } @@ -1199,7 +1199,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission diff --git a/components/permissions/permission_request_manager.cc b/components/permissions/permission_request_manager.cc --- a/components/permissions/permission_request_manager.cc +++ b/components/permissions/permission_request_manager.cc -@@ -169,7 +169,7 @@ void PermissionRequestManager::AddRequest( +@@ -172,7 +172,7 @@ void PermissionRequestManager::AddRequest( if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDenyPermissionPrompts)) { @@ -1208,16 +1208,16 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p request->RequestFinished(); return; } -@@ -246,7 +246,7 @@ void PermissionRequestManager::AddRequest( +@@ -249,7 +249,7 @@ void PermissionRequestManager::AddRequest( if (should_auto_approve_request) { if (should_auto_approve_request == PermissionAction::GRANTED) { -- request->PermissionGranted(/*is_one_time=*/false); -+ request->PermissionGranted(/*is_one_time=*/false, content_settings::mojom::LifetimeMode::ALWAYS); +- request->PermissionGranted(/*is_one_time=*/true); ++ request->PermissionGranted(/*is_one_time=*/true, content_settings::mojom::LifetimeMode::UNTIL_ORIGIN_CLOSED); } request->RequestFinished(); return; -@@ -615,7 +615,8 @@ void PermissionRequestManager::Accept() { +@@ -618,7 +618,8 @@ void PermissionRequestManager::Accept() { (*requests_iter)->request_type(), PermissionAction::GRANTED); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1227,7 +1227,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p #if !BUILDFLAG(IS_ANDROID) std::optional content_settings_type = -@@ -633,7 +634,7 @@ void PermissionRequestManager::Accept() { +@@ -636,7 +637,7 @@ void PermissionRequestManager::Accept() { CurrentRequestsDecided(PermissionAction::GRANTED); } @@ -1236,7 +1236,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -645,7 +646,8 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -648,7 +649,8 @@ void PermissionRequestManager::AcceptThisTime() { (*requests_iter)->request_type(), PermissionAction::GRANTED_ONCE); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1246,7 +1246,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::GRANTED_ONCE); -@@ -653,6 +655,15 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -656,6 +658,15 @@ void PermissionRequestManager::AcceptThisTime() { } void PermissionRequestManager::Deny() { @@ -1262,7 +1262,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -676,7 +687,7 @@ void PermissionRequestManager::Deny() { +@@ -679,7 +690,7 @@ void PermissionRequestManager::Deny() { StorePermissionActionForUMA((*requests_iter)->requesting_origin(), (*requests_iter)->request_type(), PermissionAction::DENIED); @@ -1271,7 +1271,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::DENIED); -@@ -1243,32 +1254,32 @@ PermissionRequestManager::VisitDuplicateRequests( +@@ -1255,32 +1266,32 @@ PermissionRequestManager::VisitDuplicateRequests( void PermissionRequestManager::PermissionGrantedIncludingDuplicates( PermissionRequest* request, @@ -1314,7 +1314,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p request); } -@@ -1529,7 +1540,7 @@ void PermissionRequestManager::DoAutoResponseForTesting() { +@@ -1541,7 +1552,7 @@ void PermissionRequestManager::DoAutoResponseForTesting() { } switch (auto_response_for_test_) { case ACCEPT_ONCE: @@ -1326,7 +1326,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p diff --git a/components/permissions/permission_request_manager.h b/components/permissions/permission_request_manager.h --- a/components/permissions/permission_request_manager.h +++ b/components/permissions/permission_request_manager.h -@@ -162,8 +162,10 @@ class PermissionRequestManager +@@ -165,8 +165,10 @@ class PermissionRequestManager GURL GetRequestingOrigin() const override; GURL GetEmbeddingOrigin() const override; void Accept() override; @@ -1338,7 +1338,7 @@ diff --git a/components/permissions/permission_request_manager.h b/components/pe void Dismiss() override; void Ignore() override; void FinalizeCurrentRequests() override; -@@ -372,9 +374,12 @@ class PermissionRequestManager +@@ -375,9 +377,12 @@ class PermissionRequestManager // Calls PermissionGranted on a request and all its duplicates. void PermissionGrantedIncludingDuplicates(PermissionRequest* request, diff --git a/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch b/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch index afe20bf146a649f6a3280c603d6528220d6f7d5c..fd8e45bcbd2ec4da517c209e1d43f024f152a192 100644 --- a/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch +++ b/build/cromite_patches/Add-menu-item-to-bookmark-all-tabs.patch @@ -31,7 +31,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml --- a/chrome/android/java/res/menu/main_menu.xml +++ b/chrome/android/java/res/menu/main_menu.xml -@@ -71,6 +71,10 @@ found in the LICENSE file. +@@ -74,6 +74,10 @@ found in the LICENSE file. @@ -42,20 +42,20 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re -@@ -180,6 +184,9 @@ found in the LICENSE file. - +@@ -186,6 +190,9 @@ found in the LICENSE file. + + + android:icon="@drawable/ic_select_check_box_24dp" /> 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 -@@ -91,6 +91,7 @@ import org.chromium.chrome.browser.base.ColdStartTracker; +@@ -92,6 +92,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,16 +63,16 @@ 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; -@@ -2985,6 +2986,8 @@ public class ChromeTabbedActivity extends ChromeActivityGetJavaObject(), @@ -229,7 +229,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse result == Result::kSuccess); delete this; } -@@ -349,6 +349,33 @@ jboolean BookmarkBridge::AreAccountBookmarkFoldersActive(JNIEnv* env) { +@@ -355,6 +355,33 @@ jboolean BookmarkBridge::AreAccountBookmarkFoldersActive(JNIEnv* env) { return bookmark_model_->account_mobile_node() != nullptr; } @@ -263,7 +263,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse base::android::ScopedJavaLocalRef BookmarkBridge::GetMostRecentlyAddedUserBookmarkIdForUrl(JNIEnv* env, const GURL& url) { -@@ -461,6 +488,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( +@@ -467,6 +494,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( // Vector to temporarily contain all child bookmarks at same level for sorting std::vector bookmarks = { bookmark_model_->mobile_node(), @@ -271,7 +271,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse bookmark_model_->bookmark_bar_node(), bookmark_model_->other_node(), }; -@@ -554,6 +582,9 @@ std::vector BookmarkBridge::GetTopLevelFolderIdsImpl( +@@ -560,6 +588,9 @@ std::vector BookmarkBridge::GetTopLevelFolderIdsImpl( top_level_folders.push_back(other_node); } @@ -313,7 +313,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser base::android::ScopedJavaLocalRef GetMostRecentlyAddedUserBookmarkIdForUrl(JNIEnv* env, const GURL& url); const bookmarks::BookmarkNode* GetMostRecentlyAddedUserBookmarkIdForUrlImpl( -@@ -223,6 +227,10 @@ class BookmarkBridge : public ProfileObserver, +@@ -222,6 +226,10 @@ class BookmarkBridge : public ProfileObserver, const base::android::JavaParamRef& j_list, jint type); @@ -391,7 +391,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 -@@ -4196,6 +4196,9 @@ To change this setting, BEGIN_LINKdelete the Chrome d +@@ -4372,6 +4372,9 @@ To change this setting, BEGIN_LINKdelete the Chrome d Select tabs @@ -654,7 +654,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 -@@ -914,7 +914,7 @@ bool BookmarkModel::HasBookmarks() const { +@@ -802,7 +802,7 @@ bool BookmarkModel::HasBookmarks() const { bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return bookmark_bar_node_->children().empty() && @@ -663,7 +663,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar } bool BookmarkModel::IsBookmarked(const GURL& url) const { -@@ -1246,6 +1246,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr details) { +@@ -1110,6 +1110,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(); @@ -674,7 +674,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar 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 -@@ -157,6 +157,12 @@ class BookmarkModel : public CoreBookmarkModel, +@@ -149,6 +149,12 @@ class BookmarkModel : public BookmarkUndoProvider, // bookmarks in the account storage). const BookmarkNode* account_mobile_node() const; @@ -687,7 +687,7 @@ 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_; -@@ -639,6 +645,7 @@ class BookmarkModel : public CoreBookmarkModel, +@@ -566,6 +572,7 @@ class BookmarkModel : public BookmarkUndoProvider, raw_ptr account_bookmark_bar_node_ = nullptr; raw_ptr account_other_node_ = nullptr; raw_ptr account_mobile_node_ = nullptr; @@ -705,7 +705,7 @@ diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmark + case bookmarks::BookmarkNode::TABS_COLLECTION: + return !is_desktop; case BookmarkNode::URL: - NOTREACHED_NORETURN(); + NOTREACHED(); case BookmarkNode::FOLDER: @@ -211,6 +213,15 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id) { l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME))); @@ -789,7 +789,7 @@ diff --git a/components/bookmarks/browser/bookmark_uuids.h b/components/bookmark diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks/browser/model_loader.cc --- a/components/bookmarks/browser/model_loader.cc +++ b/components/bookmarks/browser/model_loader.cc -@@ -71,6 +71,8 @@ std::unique_ptr LoadBookmarks( +@@ -70,6 +70,8 @@ std::unique_ptr LoadBookmarks( BookmarkPermanentNode::CreateOtherBookmarks(0); std::unique_ptr account_mobile_folder_node = BookmarkPermanentNode::CreateMobileBookmarks(0); @@ -798,7 +798,7 @@ diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks std::optional root_dict = LoadFileToDict(account_file_path); -@@ -78,7 +80,8 @@ std::unique_ptr LoadBookmarks( +@@ -77,7 +79,8 @@ std::unique_ptr LoadBookmarks( if (root_dict.has_value() && codec.Decode(*root_dict, /*already_assigned_ids=*/{}, account_bb_node.get(), account_other_folder_node.get(), @@ -808,7 +808,7 @@ diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks &sync_metadata_str)) { ids_assigned_to_account_nodes = codec.release_assigned_ids(); -@@ -127,7 +130,8 @@ std::unique_ptr LoadBookmarks( +@@ -119,7 +122,8 @@ std::unique_ptr LoadBookmarks( if (root_dict.has_value() && codec.Decode(*root_dict, std::move(ids_assigned_to_account_nodes), details->bb_node(), details->other_folder_node(), diff --git a/build/cromite_patches/Add-menu-item-to-view-source.patch b/build/cromite_patches/Add-menu-item-to-view-source.patch index b0ff0eb65ab56eb4135e3c3d0a2b684d70cd3776..771a10069cd17afb4163adbd0761ad99253203fb 100644 --- a/build/cromite_patches/Add-menu-item-to-view-source.patch +++ b/build/cromite_patches/Add-menu-item-to-view-source.patch @@ -16,7 +16,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml --- a/chrome/android/java/res/menu/custom_tabs_menu.xml +++ b/chrome/android/java/res/menu/custom_tabs_menu.xml -@@ -62,6 +62,9 @@ found in the LICENSE file. +@@ -58,6 +58,9 @@ found in the LICENSE file. @@ -29,7 +29,7 @@ diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml --- a/chrome/android/java/res/menu/main_menu.xml +++ b/chrome/android/java/res/menu/main_menu.xml -@@ -107,6 +107,9 @@ found in the LICENSE file. +@@ -110,6 +110,9 @@ found in the LICENSE file. @@ -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 -@@ -3011,6 +3011,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2723,6 +2723,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 -@@ -576,6 +576,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -566,6 +566,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate isNativePage, isFileScheme, isContentScheme, isIncognito, url)); updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isNativePage); @@ -77,7 +77,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App updateAutoDarkMenuItem(menu, currentTab, isNativePage); -@@ -1304,6 +1305,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -1298,6 +1299,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate findInPageMenuRow.setVisible(itemVisible); } @@ -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 -@@ -294,6 +294,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat +@@ -299,6 +299,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat updateRequestDesktopSiteMenuItem( menu, currentTab, requestDesktopSiteVisible, isNativePage); @@ -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 -@@ -311,6 +311,10 @@ CHAR_LIMIT guidelines: +@@ -312,6 +312,10 @@ CHAR_LIMIT guidelines: USB diff --git a/build/cromite_patches/Add-option-to-force-tablet-UI.patch b/build/cromite_patches/Add-option-to-force-tablet-UI.patch index 7fde5ed0917cc9c6ec8f99d94aef17560617447c..55ed9629bd2e84d76504d027689474ce432183c7 100644 --- a/build/cromite_patches/Add-option-to-force-tablet-UI.patch +++ b/build/cromite_patches/Add-option-to-force-tablet-UI.patch @@ -4,62 +4,39 @@ Subject: Add option to force tablet UI License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - .../start_surface/StartSurfaceMediator.java | 5 +++- .../layout/custom_tabs_control_container.xml | 2 +- .../java/res/layout/recent_tabs_page.xml | 2 +- - .../java/res/values-sw600dp/dimens.xml | 4 +-- - chrome/android/java/res/values/dimens.xml | 6 +++- - .../chrome/browser/ChromeTabbedActivity.java | 4 ++- + .../java/res/values-sw600dp/dimens.xml | 4 ++-- + chrome/android/java/res/values/dimens.xml | 6 ++++- .../chrome/browser/WarmupManager.java | 5 +++- - .../settings/AccessibilitySettings.java | 13 +++++++++ - .../ChromeAccessibilitySettingsDelegate.java | 19 +++++++++++++ - .../chrome/browser/app/ChromeActivity.java | 4 ++- - .../overlays/strip/StripLayoutHelper.java | 10 +++++-- - .../strip/StripLayoutHelperManager.java | 7 ++++- + .../settings/AccessibilitySettings.java | 13 ++++++++++ + .../ChromeAccessibilitySettingsDelegate.java | 19 +++++++++++++++ + .../chrome/browser/app/ChromeActivity.java | 4 +++- + .../overlays/strip/StripLayoutHelper.java | 10 ++++++-- + .../strip/StripLayoutHelperManager.java | 7 +++++- + .../tabbed_mode/TabbedRootUiCoordinator.java | 4 +++- .../chrome/browser/ui/RootUiCoordinator.java | 5 +++- chrome/browser/preferences/BUILD.gn | 1 + .../preferences/ChromePreferenceKeys.java | 1 + - .../preferences/ChromeSharedPreferences.java | 8 ++++++ + .../preferences/ChromeSharedPreferences.java | 8 +++++++ .../LegacyChromePreferenceKeys.java | 1 + .../SingleTabSwitcherOnNtpMediator.java | 1 + .../omnibox/LocationBarCoordinator.java | 2 +- - .../strings/android_chrome_strings.grd | 7 +++++ - .../java/res/layout/control_container.xml | 12 ++++---- + .../strings/android_chrome_strings.grd | 7 ++++++ + .../java/res/layout/control_container.xml | 10 ++++---- .../java/res/layout/toolbar_tablet.xml | 2 +- .../java/res/values-sw600dp/dimens.xml | 5 ++-- .../toolbar/java/res/values/dimens.xml | 5 ++-- .../browser/toolbar/ControlContainer.java | 2 +- - .../top/TabStripTransitionCoordinator.java | 2 +- - .../toolbar/top/ToolbarControlContainer.java | 28 ++++++++++++++++++- + .../toolbar/top/ToolbarControlContainer.java | 24 ++++++++++++++++++- .../browser/toolbar/top/ToolbarLayout.java | 5 +++- - components/BUILD.gn | 6 ++-- + .../TabStripTransitionCoordinator.java | 2 +- + components/BUILD.gn | 6 ++--- .../res/xml/accessibility_preferences.xml | 5 ++++ - .../AccessibilitySettingsDelegate.java | 11 ++++++++ - .../chromium/ui/base/DeviceFormFactor.java | 9 ++++++ - 32 files changed, 167 insertions(+), 32 deletions(-) + .../AccessibilitySettingsDelegate.java | 11 +++++++++ + .../chromium/ui/base/DeviceFormFactor.java | 9 +++++++ + 31 files changed, 158 insertions(+), 30 deletions(-) -diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java ---- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java -+++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java -@@ -97,6 +97,7 @@ import org.chromium.components.browser_ui.widget.gesture.BackPressHandler; - import org.chromium.components.embedder_support.util.UrlUtilities; - import org.chromium.components.prefs.PrefService; - import org.chromium.content_public.browser.LoadUrlParams; -+import org.chromium.ui.base.DeviceFormFactor; - import org.chromium.ui.modelutil.PropertyModel; - import org.chromium.ui.text.EmptyTextWatcher; - import org.chromium.ui.util.ColorUtils; -@@ -1124,7 +1125,9 @@ class StartSurfaceMediator - int getTopToolbarPlaceholderHeight() { - // If logo is visible in Start surface instead of in the toolbar, we don't need to show the - // top margin of the fake search box. -- return getPixelSize(R.dimen.control_container_height) -+ return DeviceFormFactor.isForceTabletUI() -+ ? getPixelSize(R.dimen.control_container_height_tabletui) -+ : getPixelSize(R.dimen.control_container_height_cromite) - + (isLogoVisible() - ? 0 - : getPixelSize(R.dimen.start_surface_fake_search_box_top_margin)); diff --git a/chrome/android/java/res/layout/custom_tabs_control_container.xml b/chrome/android/java/res/layout/custom_tabs_control_container.xml --- a/chrome/android/java/res/layout/custom_tabs_control_container.xml +++ b/chrome/android/java/res/layout/custom_tabs_control_container.xml @@ -97,11 +74,11 @@ diff --git a/chrome/android/java/res/values-sw600dp/dimens.xml b/chrome/android/ + 96dp - 60dp + 60dp diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml -@@ -120,9 +120,13 @@ found in the LICENSE file. +@@ -118,9 +118,13 @@ found in the LICENSE file. 16dp @@ -116,33 +93,19 @@ diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res 375dp 60dp -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 -@@ -2280,7 +2280,9 @@ public class ChromeTabbedActivity extends ChromeActivity { -@@ -214,6 +224,9 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -216,6 +226,9 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment mFontSizePrefs.setUserFontScaleFactor((Float) newValue); } else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) { mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue); @@ -228,7 +191,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s 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 -@@ -862,7 +862,9 @@ public abstract class ChromeActivity +@@ -870,7 +870,9 @@ public abstract class ChromeActivity // Inflate the correct toolbar layout for the device. int toolbarLayoutId = getToolbarLayoutId(); if (toolbarLayoutId != ActivityUtils.NO_RESOURCE_ID && controlContainer != null) { @@ -242,15 +205,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java -@@ -84,6 +84,7 @@ import org.chromium.components.feature_engagement.Tracker; - import org.chromium.components.prefs.PrefService; +@@ -89,6 +89,7 @@ import org.chromium.components.prefs.PrefService; import org.chromium.components.tab_groups.TabGroupColorId; import org.chromium.components.user_prefs.UserPrefs; + import org.chromium.ui.MotionEventUtils; +import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.interpolators.Interpolators; -@@ -5059,8 +5060,13 @@ public class StripLayoutHelper implements StripLayoutTabDelegate, StripLayoutGro +@@ -5176,8 +5177,13 @@ public class StripLayoutHelper implements StripLayoutTabDelegate, StripLayoutGro mTabMenu.setAnchorView(tabView); // 3. Set the vertical offset to align the tab menu with bottom of the tab strip int tabHeight = mManagerHost.getHeight(); @@ -269,7 +232,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/over diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java -@@ -80,6 +80,7 @@ import org.chromium.chrome.browser.ui.system.StatusBarColorController; +@@ -90,6 +90,7 @@ import org.chromium.chrome.browser.ui.system.StatusBarColorController; import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.scrim.ScrimProperties; import org.chromium.content_public.browser.LoadUrlParams; @@ -277,7 +240,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/over import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.base.PageTransition; import org.chromium.ui.base.WindowAndroid; -@@ -405,11 +406,15 @@ public class StripLayoutHelperManager +@@ -455,11 +456,15 @@ public class StripLayoutHelperManager mIsLayoutOptimizationsEnabled = ToolbarFeatures.isTabStripWindowLayoutOptimizationEnabled(true); @@ -293,19 +256,33 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/over + mTopPadding = mHeight - mScrollableStripHeight; mDesktopWindowStateProvider = desktopWindowStateProvider; + mStripVisibilityStateSupplier = new ObservableSupplierImpl<>(StripVisibilityState.UNKNOWN); +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 +@@ -531,7 +531,9 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { + + @Override + public int getControlContainerHeightResource() { +- return R.dimen.control_container_height; ++ if (DeviceFormFactor.isForceTabletUI()) ++ return R.dimen.control_container_height_tabletui; ++ return R.dimen.control_container_height_cromite; + } + @Override 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 -@@ -98,6 +98,7 @@ import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; +@@ -103,6 +103,7 @@ import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher; import org.chromium.chrome.browser.pdf.PdfPage; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; + import org.chromium.chrome.browser.price_insights.PriceInsightsButtonController; import org.chromium.chrome.browser.price_tracking.CurrentTabPriceTrackingStateSupplier; import org.chromium.chrome.browser.price_tracking.PriceTrackingButtonController; - import org.chromium.chrome.browser.profiles.Profile; -@@ -1611,7 +1612,9 @@ public class RootUiCoordinator +@@ -1740,7 +1741,9 @@ public class RootUiCoordinator if (!mSupportsFindInPageSupplier.getAsBoolean()) return; int stubId = R.id.find_toolbar_stub; @@ -377,7 +354,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro diff --git a/chrome/browser/single_tab/android/java/src/org/chromium/chrome/browser/single_tab/SingleTabSwitcherOnNtpMediator.java b/chrome/browser/single_tab/android/java/src/org/chromium/chrome/browser/single_tab/SingleTabSwitcherOnNtpMediator.java --- a/chrome/browser/single_tab/android/java/src/org/chromium/chrome/browser/single_tab/SingleTabSwitcherOnNtpMediator.java +++ b/chrome/browser/single_tab/android/java/src/org/chromium/chrome/browser/single_tab/SingleTabSwitcherOnNtpMediator.java -@@ -40,6 +40,7 @@ import org.chromium.components.browser_ui.widget.displaystyle.HorizontalDisplayS +@@ -41,6 +41,7 @@ import org.chromium.components.browser_ui.widget.displaystyle.HorizontalDisplayS import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig.DisplayStyle; import org.chromium.components.embedder_support.util.UrlUtilities; @@ -388,7 +365,7 @@ diff --git a/chrome/browser/single_tab/android/java/src/org/chromium/chrome/brow 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 -@@ -778,7 +778,7 @@ public class LocationBarCoordinator +@@ -765,7 +765,7 @@ public class LocationBarCoordinator } private boolean isTabletWindow() { @@ -453,7 +430,7 @@ diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/control_container android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height_no_shadow" android:layout="@layout/find_toolbar" /> -@@ -55,14 +55,14 @@ found in the LICENSE file. +@@ -55,7 +55,7 @@ found in the LICENSE file. android:id="@+id/target_view_stub" android:inflatedId="@+id/toolbar_drag_drop_target_view" android:layout_width="match_parent" @@ -461,15 +438,7 @@ diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/control_container + android:layout_marginTop="@dimen/tab_strip_height_cromite" android:layout_height="@dimen/toolbar_height_no_shadow" android:layout="@layout/drag_drop_target_view" /> - - + diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml --- a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml +++ b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml @@ -508,8 +477,8 @@ diff --git a/chrome/browser/ui/android/toolbar/java/res/values/dimens.xml b/chro + 40dp + 0dp - true @@ -428,19 +426,21 @@ 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 -@@ -865,7 +865,7 @@ public class TabModelImpl extends TabModelJniBridge { - protected boolean createTabWithWebContents( - Tab parent, Profile profile, WebContents webContents) { - return getTabCreator(profile.isOffTheRecord()) -- .createTabWithWebContents(parent, webContents, TabLaunchType.FROM_RECENT_TABS); -+ .createTabWithWebContents(parent, webContents, TabLaunchType.FROM_LINK); +@@ -853,9 +853,7 @@ public class TabModelImpl extends TabModelJniBridge { + .createTabWithWebContents( + parent, + webContents, +- select +- ? TabLaunchType.FROM_RECENT_TABS_FOREGROUND +- : TabLaunchType.FROM_RECENT_TABS); ++ TabLaunchType.FROM_LINK); } @Override 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 -@@ -15679,6 +15679,16 @@ Please help our engineers fix this problem. Tell us what happened right before y +@@ -15905,6 +15905,16 @@ Please help our engineers fix this problem. Tell us what happened right before y Never show this again. @@ -481,7 +481,7 @@ diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_s diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h -@@ -21,6 +21,7 @@ +@@ -31,6 +31,7 @@ #include "build/chromeos_buildflags.h" #include "chrome/common/buildflags.h" #include "media/media_buildflags.h" @@ -489,7 +489,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h class BackgroundModeManager; class BrowserProcessPlatformPart; -@@ -71,6 +72,10 @@ namespace component_updater { +@@ -86,6 +87,10 @@ namespace component_updater { class ComponentUpdateService; } @@ -497,10 +497,10 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h +class AdBlockUpdaterService; +} + - namespace extensions { - class EventRouterForwarder; + namespace gcm { + class GCMDriver; } -@@ -254,6 +259,7 @@ class BrowserProcess { +@@ -264,6 +269,7 @@ class BrowserProcess { #endif virtual component_updater::ComponentUpdateService* component_updater() = 0; @@ -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 -@@ -215,6 +215,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -214,6 +214,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; -@@ -420,6 +421,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -419,6 +420,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_; @@ -582,7 +582,7 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureMap.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeSessionState.java", -@@ -33,6 +34,7 @@ android_library("java") { +@@ -46,6 +47,7 @@ java_bromite_impl("java_cromite_cached_flags") { 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", ] -@@ -47,6 +49,7 @@ static_library("flags_android") { +@@ -60,6 +62,7 @@ static_library("flags_android") { "android/chrome_session_state.cc", "android/chrome_session_state.h", ] @@ -672,7 +672,7 @@ new file mode 100755 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 -@@ -642,6 +642,10 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { +@@ -635,6 +635,10 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) { StubResolverConfigReader::RegisterPrefs(registry); @@ -686,14 +686,15 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/brows diff --git a/chrome/browser/sessions/session_restore_android.cc b/chrome/browser/sessions/session_restore_android.cc --- a/chrome/browser/sessions/session_restore_android.cc +++ b/chrome/browser/sessions/session_restore_android.cc -@@ -56,8 +56,10 @@ content::WebContents* SessionRestore::RestoreForeignSessionTab( +@@ -57,8 +57,11 @@ content::WebContents* SessionRestore::RestoreForeignSessionTab( DCHECK(current_tab); // If swapped, return the current tab's most up-to-date web contents. if (disposition == WindowOpenDisposition::CURRENT_TAB) { - current_tab->SwapWebContents(std::move(new_web_contents), false, false); - return current_tab->web_contents(); + int active_tab_index = tab_model->GetActiveIndex(); -+ tab_model->CreateTab(current_tab, new_web_contents.release()); ++ tab_model->CreateTab(current_tab, new_web_contents.release(), ++ disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB); + tab_model->CloseTabAt(active_tab_index); + return raw_new_web_contents; } @@ -702,7 +703,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: +@@ -218,6 +218,20 @@ CHAR_LIMIT guidelines: Advanced @@ -726,7 +727,7 @@ 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 -@@ -2754,6 +2754,11 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; +@@ -2824,6 +2824,11 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; inline constexpr char kAudioCaptureAllowedUrls[] = "hardware.audio_capture_allowed_urls"; @@ -741,7 +742,7 @@ 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 -@@ -368,6 +368,9 @@ +@@ -371,6 +371,9 @@ This site shows intrusive or misleading ads @@ -1550,7 +1551,7 @@ new file mode 100644 diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc --- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc -@@ -17,6 +17,9 @@ +@@ -18,6 +18,9 @@ #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/traced_value.h" @@ -1560,7 +1561,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f #include "components/subresource_filter/content/browser/ad_tagging_utils.h" #include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h" #include "components/subresource_filter/content/browser/profile_interaction_manager.h" -@@ -108,6 +111,7 @@ ContentSubresourceFilterThrottleManager:: +@@ -110,6 +113,7 @@ ContentSubresourceFilterThrottleManager:: profile_interaction_manager_( std::make_unique( profile_context)), @@ -1568,7 +1569,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f web_contents_helper_(web_contents_helper) {} ContentSubresourceFilterThrottleManager:: -@@ -641,6 +645,17 @@ ContentSubresourceFilterThrottleManager:: +@@ -667,6 +671,17 @@ ContentSubresourceFilterThrottleManager:: throttle->NotifyPageActivationWithRuleset(EnsureRulesetHandle(), ad_tagging_state); } @@ -1589,7 +1590,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 -@@ -413,6 +413,8 @@ class ContentSubresourceFilterThrottleManager +@@ -411,6 +411,8 @@ class ContentSubresourceFilterThrottleManager std::unique_ptr profile_interaction_manager_; @@ -1601,7 +1602,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f diff --git a/components/subresource_filter/content/shared/browser/ruleset_service.cc b/components/subresource_filter/content/shared/browser/ruleset_service.cc --- a/components/subresource_filter/content/shared/browser/ruleset_service.cc +++ b/components/subresource_filter/content/shared/browser/ruleset_service.cc -@@ -52,9 +52,7 @@ namespace { +@@ -51,9 +51,7 @@ namespace { void RecordIndexAndWriteRulesetResult( std::string_view uma_tag, RulesetService::IndexAndWriteRulesetResult result) { @@ -1612,7 +1613,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic } // Implements operations on a `sentinel file`, which is used as a safeguard to -@@ -235,10 +233,13 @@ RulesetService::RulesetService( +@@ -234,10 +232,13 @@ RulesetService::RulesetService( RulesetService::~RulesetService() {} void RulesetService::IndexAndStoreAndPublishRulesetIfNeeded( @@ -1628,7 +1629,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic // Trying to store a ruleset with the same version for a second time would // not only be futile, but would fail on Windows due to "File System // Tunneling" as long as the previously stored copy of the rules is still -@@ -248,13 +249,16 @@ void RulesetService::IndexAndStoreAndPublishRulesetIfNeeded( +@@ -247,13 +248,16 @@ void RulesetService::IndexAndStoreAndPublishRulesetIfNeeded( if (most_recently_indexed_version.IsCurrentFormatVersion() && most_recently_indexed_version.content_version == unindexed_ruleset_info.content_version) { @@ -1645,7 +1646,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic return; } -@@ -274,6 +278,23 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -273,6 +277,23 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( const RulesetConfig& config, const base::FilePath& indexed_ruleset_base_dir, const UnindexedRulesetInfo& unindexed_ruleset_info) { @@ -1669,7 +1670,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::MAY_BLOCK); -@@ -281,6 +302,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -280,6 +301,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( unindexed_ruleset_info); if (!unindexed_ruleset_stream_generator.ruleset_stream()) { @@ -1677,7 +1678,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic RecordIndexAndWriteRulesetResult( config.uma_tag, IndexAndWriteRulesetResult::FAILED_OPENING_UNINDEXED_RULESET); -@@ -295,6 +317,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -294,6 +316,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( indexed_ruleset_base_dir, indexed_version); if (!base::CreateDirectory(indexed_ruleset_version_dir)) { @@ -1685,7 +1686,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic RecordIndexAndWriteRulesetResult( config.uma_tag, IndexAndWriteRulesetResult::FAILED_CREATING_VERSION_DIR); -@@ -303,13 +326,11 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -302,13 +325,11 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( SentinelFile sentinel_file(indexed_ruleset_version_dir); if (sentinel_file.IsPresent()) { @@ -1701,7 +1702,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic RecordIndexAndWriteRulesetResult( config.uma_tag, IndexAndWriteRulesetResult::FAILED_CREATING_SENTINEL_FILE); -@@ -324,6 +345,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -323,6 +344,7 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( RulesetIndexer indexer; if (!(*g_index_ruleset_func)(config, &unindexed_ruleset_stream_generator, &indexer)) { @@ -1709,7 +1710,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic RecordIndexAndWriteRulesetResult( config.uma_tag, IndexAndWriteRulesetResult::FAILED_PARSING_UNINDEXED_RULESET); -@@ -343,8 +365,12 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( +@@ -342,8 +364,12 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( WriteRuleset(indexed_ruleset_version_dir, unindexed_ruleset_info.license_path, indexer.data()); RecordIndexAndWriteRulesetResult(config.uma_tag, result); @@ -1723,7 +1724,7 @@ diff --git a/components/subresource_filter/content/shared/browser/ruleset_servic CHECK(indexed_version.IsValid(), base::NotFatalUntil::M129); return indexed_version; -@@ -472,6 +498,7 @@ void RulesetService::IndexAndStoreRuleset( +@@ -467,6 +493,7 @@ void RulesetService::IndexAndStoreRuleset( void RulesetService::OnWrittenRuleset(WriteRulesetCallback result_callback, const IndexedRulesetVersion& version) { CHECK(!result_callback.is_null(), base::NotFatalUntil::M129); @@ -1952,7 +1953,7 @@ diff --git a/components/subresource_filter/core/browser/verified_ruleset_dealer. #include "base/not_fatal_until.h" #include "base/notreached.h" #include "base/task/sequenced_task_runner.h" -@@ -39,6 +40,9 @@ RulesetFilePtr VerifiedRulesetDealer::OpenAndSetRulesetFile( +@@ -40,6 +41,9 @@ RulesetFilePtr VerifiedRulesetDealer::OpenAndSetRulesetFile( TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("loading"), "VerifiedRulesetDealer::OpenAndSetRulesetFile", "file_valid", file->IsValid()); @@ -1970,10 +1971,10 @@ diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/comp #include "base/check.h" #include "base/hash/hash.h" +#include "base/logging.h" - #include "base/metrics/histogram_macros.h" + #include "base/metrics/histogram_functions.h" #include "base/not_fatal_until.h" - #include "base/trace_event/trace_event.h" -@@ -37,7 +38,9 @@ VerifyStatus GetVerifyStatus(base::span buffer, + #include "base/strings/strcat.h" +@@ -38,7 +39,9 @@ VerifyStatus GetVerifyStatus(base::span buffer, // least once. The verifier detects a subset of the errors detected by the // checksum, and is unneeded once expected_checksum is consistently nonzero. flatbuffers::Verifier verifier(buffer.data(), buffer.size()); @@ -1984,12 +1985,4 @@ diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/comp return flat::VerifyIndexedRulesetBuffer(verifier) ? VerifyStatus::kChecksumFailVerifierPass : VerifyStatus::kChecksumFailVerifierFail; -diff --git a/cromite_flags/third_party/blink/common/features_cc/Bromite-subresource-adblocker.inc b/cromite_flags/third_party/blink/common/features_cc/Bromite-subresource-adblocker.inc -new file mode 100644 ---- /dev/null -+++ b/cromite_flags/third_party/blink/common/features_cc/Bromite-subresource-adblocker.inc -@@ -0,0 +1,3 @@ -+SET_CROMITE_FEATURE_ENABLED(kAutomaticLazyFrameLoadingToAds); -+SET_CROMITE_FEATURE_DISABLED(kAutomaticLazyFrameLoadingToEmbeds); -+SET_CROMITE_FEATURE_DISABLED(kAutomaticLazyFrameLoadingToEmbedUrls); -- diff --git a/build/cromite_patches/Client-hints-overrides.patch b/build/cromite_patches/Client-hints-overrides.patch index 9583bb15b0643753a3c7c3f0856795261cef610c..f5479ed8a4509c715576865e40c9041c5be14b8c 100644 --- a/build/cromite_patches/Client-hints-overrides.patch +++ b/build/cromite_patches/Client-hints-overrides.patch @@ -7,22 +7,22 @@ Use Google Chrome branding for client hints License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - components/embedder_support/user_agent_utils.cc | 4 +--- - content/browser/client_hints/client_hints.cc | 17 +++++++++++------ - .../loader/navigation_url_loader_impl.cc | 5 +++++ - .../about_flags_cc/Client-hints-overrides.inc | 9 +++++++++ - .../features_cc/Client-hints-overrides.inc | 1 + - .../cpp/features_cc/Client-hints-overrides.inc | 1 + - net/http/http_network_transaction.cc | 1 + - services/network/public/cpp/client_hints.cc | 1 + - .../blink/common/client_hints/client_hints.cc | 6 ++++-- - .../common/client_hints/enabled_client_hints.cc | 4 +++- - .../blink/renderer/core/frame/navigator_ua.idl | 4 +++- - .../renderer/core/frame/navigator_ua_data.cc | 1 + - .../renderer/core/frame/navigator_ua_data.idl | 5 ++++- - .../renderer/core/loader/base_fetch_context.cc | 6 ++++-- - .../platform/runtime_enabled_features.json5 | 5 +++++ - 15 files changed, 54 insertions(+), 16 deletions(-) + components/embedder_support/user_agent_utils.cc | 4 +--- + content/browser/client_hints/client_hints.cc | 15 ++++++++++----- + .../browser/loader/navigation_url_loader_impl.cc | 5 +++++ + .../about_flags_cc/Client-hints-overrides.inc | 9 +++++++++ + .../common/features_cc/Client-hints-overrides.inc | 1 + + .../cpp/features_cc/Client-hints-overrides.inc | 1 + + net/http/http_network_transaction.cc | 1 + + services/network/public/cpp/client_hints.cc | 1 + + .../blink/common/client_hints/client_hints.cc | 6 ++++-- + .../common/client_hints/enabled_client_hints.cc | 6 ++++++ + .../blink/renderer/core/frame/navigator_ua.idl | 4 +++- + .../renderer/core/frame/navigator_ua_data.cc | 1 + + .../renderer/core/frame/navigator_ua_data.idl | 5 ++++- + .../renderer/core/loader/frame_fetch_context.cc | 4 +++- + .../platform/runtime_enabled_features.json5 | 5 +++++ + 15 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Client-hints-overrides.inc create mode 100644 cromite_flags/content/common/features_cc/Client-hints-overrides.inc create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Client-hints-overrides.inc @@ -52,17 +52,7 @@ diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/clie #include "ui/display/display.h" #include "ui/display/screen.h" #include "url/origin.h" -@@ -521,7 +522,8 @@ void AddPrefersReducedTransparencyHeader(net::HttpRequestHeaders* headers, - : network::kPrefersReducedTransparencyNoPreference); - } - --bool IsValidURLForClientHints(const url::Origin& origin) { -+bool IsValidURLForClientHints(const url::Origin& origin) { // disabled in Bromite -+ if ((true)) return false; - return network::IsOriginPotentiallyTrustworthy(origin); - } - -@@ -723,7 +725,8 @@ void UpdateNavigationRequestClientUaHeadersImpl( +@@ -722,7 +723,8 @@ void UpdateNavigationRequestClientUaHeadersImpl( // value, disable them. This overwrites previous decision from UI. disable_due_to_custom_ua = !ua_metadata.has_value(); } @@ -72,7 +62,7 @@ diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/clie if (!disable_due_to_custom_ua) { if (!ua_metadata.has_value()) ua_metadata = delegate->GetUserAgentMetadata(); -@@ -905,10 +908,12 @@ void AddRequestClientHintsHeaders( +@@ -904,10 +906,12 @@ void AddRequestClientHintsHeaders( AddEctHeader(headers, network_quality_tracker, url); } @@ -89,10 +79,18 @@ diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/clie if (ShouldAddClientHint(data, WebClientHintsType::kPrefersColorScheme)) { AddPrefersColorSchemeHeader(headers, frame_tree_node); +@@ -1001,6 +1005,7 @@ ParseAndPersistAcceptCHForNavigation( + BrowserContext* context, + ClientHintsControllerDelegate* delegate, + FrameTreeNode* frame_tree_node) { ++ if ((true)) return std::nullopt; + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK(context); + DCHECK(parsed_headers); 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 -@@ -1202,6 +1202,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( +@@ -1208,6 +1208,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( return; } @@ -133,7 +131,7 @@ 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 -@@ -107,6 +107,7 @@ const size_t kMaxRestarts = 32; +@@ -108,6 +108,7 @@ const size_t kMaxRestarts = 32; // Returns true when Early Hints are allowed on the given protocol. bool EarlyHintsAreAllowedOn(HttpConnectionInfo connection_info) { @@ -159,7 +157,7 @@ diff --git a/third_party/blink/common/client_hints/client_hints.cc b/third_party #include "base/strings/string_util.h" #include "services/network/public/cpp/client_hints.h" #include "third_party/blink/public/common/features.h" -+#include "third_party/blink/renderer/platform/runtime_enabled_features.h" ++#include "third_party/blink/public/common/features_generated.h" #include "third_party/blink/public/common/permissions_policy/permissions_policy.h" #include "url/origin.h" @@ -172,7 +170,7 @@ diff --git a/third_party/blink/common/client_hints/client_hints.cc b/third_party case network::mojom::WebClientHintsType::kUAMobile: case network::mojom::WebClientHintsType::kUAPlatform: - return true; -+ return RuntimeEnabledFeatures::UserAgentClientHintEnabled(); ++ return base::FeatureList::IsEnabled(blink::features::kUserAgentClientHint); + case network::mojom::WebClientHintsType::kSaveData: + return false; default: @@ -181,31 +179,19 @@ diff --git a/third_party/blink/common/client_hints/client_hints.cc b/third_party diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/third_party/blink/common/client_hints/enabled_client_hints.cc --- a/third_party/blink/common/client_hints/enabled_client_hints.cc +++ b/third_party/blink/common/client_hints/enabled_client_hints.cc -@@ -15,6 +15,7 @@ namespace { +@@ -15,6 +15,12 @@ namespace { using ::network::mojom::WebClientHintsType; bool IsDisabledByFeature(const WebClientHintsType type) { ++ if (type == WebClientHintsType::kUA || ++ type == WebClientHintsType::kUAMobile || ++ type == WebClientHintsType::kUAPlatform) { ++ return false; ++ } + if ((true)) return true; switch (type) { case WebClientHintsType::kUA: case WebClientHintsType::kUAArch: -@@ -96,7 +97,7 @@ bool IsDisabledByFeature(const WebClientHintsType type) { - } // namespace - - bool EnabledClientHints::IsEnabled(const WebClientHintsType type) const { -- return enabled_types_[static_cast(type)]; -+ return false; - } - - void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, -@@ -107,6 +108,7 @@ void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, - - std::vector EnabledClientHints::GetEnabledHints() const { - std::vector hints; -+ if ((true)) return hints; - for (const auto& elem : network::GetClientHintToNameMap()) { - const auto& type = elem.first; - if (IsEnabled(type)) diff --git a/third_party/blink/renderer/core/frame/navigator_ua.idl b/third_party/blink/renderer/core/frame/navigator_ua.idl --- a/third_party/blink/renderer/core/frame/navigator_ua.idl +++ b/third_party/blink/renderer/core/frame/navigator_ua.idl @@ -245,40 +231,31 @@ diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.idl b/third [HighEntropy, MeasureAs=NavigatorUAData_Brands] readonly attribute FrozenArray brands; [HighEntropy=Direct, MeasureAs=NavigatorUAData_Mobile] readonly attribute boolean mobile; [HighEntropy=Direct, MeasureAs=NavigatorUAData_Platform] readonly attribute DOMString platform; -diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.cc b/third_party/blink/renderer/core/loader/base_fetch_context.cc ---- a/third_party/blink/renderer/core/loader/base_fetch_context.cc -+++ b/third_party/blink/renderer/core/loader/base_fetch_context.cc -@@ -167,7 +167,7 @@ void BaseFetchContext::AddClientHintsIfNecessary( - // specifying accomponying client hints, in which case we disable sending - // them. - using network::mojom::blink::WebClientHintsType; -- if (ua) { -+ if (RuntimeEnabledFeatures::UserAgentClientHintEnabled() && ua) { - // ShouldSendClientHint is called to make sure UA is controlled by - // Permissions Policy. - if (ShouldSendClientHint(policy, resource_origin, is_1p_origin, -@@ -329,7 +329,7 @@ void BaseFetchContext::AddClientHintsIfNecessary( +diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc +--- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc ++++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc +@@ -216,6 +216,8 @@ bool ShouldSendClientHint(const PermissionsPolicy& policy, + bool is_1p_origin, + network::mojom::blink::WebClientHintsType type, + const ClientHintsPreferences& hints_preferences) { ++ if (!RuntimeEnabledFeatures::UserAgentClientHintEnabled()) ++ return false; + // For subresource requests, sending the hint in the fetch request based on + // the permissions policy. + if (!policy.IsFeatureEnabledForOrigin( +@@ -600,7 +602,7 @@ void FrameFetchContext::AddClientHintsIfNecessary( } // Only send User Agent hints if the info is available - if (ua) { + if (RuntimeEnabledFeatures::UserAgentClientHintEnabled() && ua) { - if (ShouldSendClientHint(policy, resource_origin, is_1p_origin, - WebClientHintsType::kUAArch, hints_preferences)) { - SetHttpHeader(WebClientHintsType::kUAArch, -@@ -667,6 +667,8 @@ bool BaseFetchContext::ShouldSendClientHint( - bool is_1p_origin, - network::mojom::blink::WebClientHintsType type, - const ClientHintsPreferences& hints_preferences) const { -+ if (!RuntimeEnabledFeatures::UserAgentClientHintEnabled()) -+ return false; - // For subresource requests, sending the hint in the fetch request based on - // the permissions policy. - if ((!policy || + // ShouldSendClientHint is called to make sure UA is controlled by + // Permissions Policy. + if (ShouldSendClientHint(*policy, resource_origin, is_1p_origin, 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 -@@ -337,6 +337,11 @@ +@@ -381,6 +381,11 @@ name: "AtomicMoveAPI", status: "test", }, @@ -289,5 +266,5 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 + }, { name: "AttributionReporting", - origin_trial_feature_name: "PrivacySandboxAdsAPIs", + status: "stable", -- diff --git a/build/cromite_patches/Content-settings-infrastructure.patch b/build/cromite_patches/Content-settings-infrastructure.patch index 16f9ffc2fc20f90c29c77ed94f693c4c2930e56a..e5ffba29460404ef5cb0e4b7016cdc6e51d2a80c 100644 --- a/build/cromite_patches/Content-settings-infrastructure.patch +++ b/build/cromite_patches/Content-settings-infrastructure.patch @@ -64,7 +64,7 @@ Require: bromite-build-utils.patch .../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 + + .../content_settings/core/common/BUILD.gn | 8 + .../bromite_content_settings/placeholder.txt | 1 + .../core/common/content_settings.cc | 30 +- .../core/common/content_settings.h | 12 + @@ -83,7 +83,7 @@ Require: bromite-build-utils.patch .../platform/web_content_settings_client.h | 9 + .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + - 72 files changed, 1867 insertions(+), 95 deletions(-) + 72 files changed, 1868 insertions(+), 95 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 @@ -108,7 +108,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C /** A SiteSettingsDelegate instance that contains Chrome-specific Site Settings logic. */ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { public static final String EMBEDDED_CONTENT_HELP_CENTER_URL = -@@ -216,7 +220,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { +@@ -217,7 +221,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { @Override public boolean isHelpAndFeedbackEnabled() { @@ -117,7 +117,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C } @Override -@@ -337,6 +341,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { +@@ -349,6 +353,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { return mPrivacySandboxBridge.getFirstPartySetOwner(memberOrigin); } @@ -138,7 +138,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C diff --git a/chrome/browser/content_settings/page_specific_content_settings_delegate.cc b/chrome/browser/content_settings/page_specific_content_settings_delegate.cc --- a/chrome/browser/content_settings/page_specific_content_settings_delegate.cc +++ b/chrome/browser/content_settings/page_specific_content_settings_delegate.cc -@@ -168,7 +168,7 @@ namespace { +@@ -166,7 +166,7 @@ namespace { void GetGuestViewDefaultContentSettingRules( bool incognito, RendererContentSettingRules* rules) { @@ -150,7 +150,7 @@ diff --git a/chrome/browser/content_settings/page_specific_content_settings_dele 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 -@@ -1489,4 +1489,5 @@ +@@ -1474,4 +1474,5 @@ @@ -159,7 +159,7 @@ 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 -@@ -52,6 +52,7 @@ import {SiteSettingsPrefsBrowserProxyImpl} from '../site_settings/site_settings_ +@@ -53,6 +53,7 @@ import {SiteSettingsPrefsBrowserProxyImpl} from '../site_settings/site_settings_ import {PrivacyGuideAvailabilityMixin} from './privacy_guide/privacy_guide_availability_mixin.js'; import {getTemplate} from './privacy_page.html.js'; @@ -167,7 +167,7 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/ch interface BlockAutoplayStatus { enabled: boolean; -@@ -75,8 +76,82 @@ export class SettingsPrivacyPageElement extends SettingsPrivacyPageElementBase { +@@ -76,8 +77,82 @@ export class SettingsPrivacyPageElement extends SettingsPrivacyPageElementBase { return 'settings-privacy-page'; } @@ -262,7 +262,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, -@@ -156,6 +157,7 @@ function addPrivacyChildRoutes(r: Partial) { +@@ -154,6 +155,7 @@ function addPrivacyChildRoutes(r: Partial) { r.SITE_SETTINGS_AUTOMATIC_FULLSCREEN = r.SITE_SETTINGS.createChild('automaticFullScreen'); } @@ -369,7 +369,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d 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 -@@ -308,4 +308,5 @@ +@@ -309,4 +309,5 @@ label="$i18n{siteSettingsPointerLock}"> @@ -378,7 +378,7 @@ 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 -@@ -62,8 +62,39 @@ export class SiteDetailsElement extends SiteDetailsElementBase { +@@ -63,8 +63,39 @@ export class SiteDetailsElement extends SiteDetailsElementBase { return 'site-details'; } @@ -422,7 +422,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/c 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 @@ +@@ -57,7 +57,9 @@