From 705a8e4ee7488a4470d9b762e059469beab0b2f5 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 29 Oct 2025 17:46:16 +0100 Subject: [PATCH] Patches for v142 (final version) --- .../Add-an-always-incognito-mode.patch | 4 +- build/patches/Add-cromite-flags-support.patch | 6 +- ...dd-custom-tab-intents-privacy-option.patch | 11 +- ...-switch-for-unsupported-clangd-flags.patch | 11 +- .../Add-option-to-disable-snapshots.patch | 2 +- .../Add-option-to-use-home-page-as-NTP.patch | 16 +- build/patches/Add-site-engagement-flag.patch | 24 +- .../patches/Android-Pixel-Perfect-Mode.patch | 4 +- build/patches/Bromite-auto-updater.patch | 263 +++++++++-------- .../Bromite-subresource-adblocker.patch | 2 +- build/patches/Change-popup-site-setting.patch | 36 ++- .../Content-settings-infrastructure.patch | 21 +- .../patches/Disable-all-predictors-code.patch | 73 ++++- ...e-privacy-issues-in-password-manager.patch | 2 +- .../Enable-native-Android-autofill.patch | 16 +- ...le-search-engine-settings-desktop-ui.patch | 37 +-- build/patches/Eyeo-Adblock-for-Cromite.patch | 17 +- .../Force-use-vpython3-for-some-scripts.patch | 73 ++++- ...ing-against-incognito-mode-detection.patch | 13 +- build/patches/Internal-firewall.patch | 2 +- .../patches/Keep-disabled-FetchLaterAPI.patch | 9 +- ...ing-attributes-in-some-html-elements.patch | 25 +- .../patches/Modify-default-preferences.patch | 13 +- .../Move-navigation-bar-to-bottom.patch | 80 ++++-- .../Partition-Blink-memory-cache.patch | 46 ++- .../Partition-MediaDeviceId-by-default.patch | 15 +- build/patches/Remove-help-menu-item.patch | 2 +- .../Restore-Simplified-NTP-launch.patch | 85 +++++- .../Restore-chrome-password-store.patch | 264 +++++++++++++++++- .../Set-the-screen-frame-rate-to-60-Hz.patch | 2 +- build/patches/Site-setting-for-images.patch | 2 +- .../Use-list-mode-for-tab-switcher.patch | 2 +- .../eyeo-133.0.6943.49-android_api.patch | 9 +- build/patches/eyeo-133.0.6943.49-base.patch | 4 +- 34 files changed, 892 insertions(+), 299 deletions(-) diff --git a/build/patches/Add-an-always-incognito-mode.patch b/build/patches/Add-an-always-incognito-mode.patch index 8196adc4..71b68aa7 100644 --- a/build/patches/Add-an-always-incognito-mode.patch +++ b/build/patches/Add-an-always-incognito-mode.patch @@ -727,7 +727,7 @@ new file mode 100644 + +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.preferences.Pref; @@ -2007,7 +2007,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.ui.messages.snackbar; + -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; + +/** diff --git a/build/patches/Add-cromite-flags-support.patch b/build/patches/Add-cromite-flags-support.patch index 03fc35be..30619cba 100644 --- a/build/patches/Add-cromite-flags-support.patch +++ b/build/patches/Add-cromite-flags-support.patch @@ -505,7 +505,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Fragme import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.OneshotSupplier; import org.chromium.build.annotations.NullMarked; @@ -557,7 +557,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin import org.chromium.base.DeviceInfo; import org.chromium.base.Log; import org.chromium.base.metrics.RecordHistogram; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.OneshotSupplier; import org.chromium.base.supplier.OneshotSupplierImpl; @@ -868,7 +868,7 @@ diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browse import org.chromium.build.annotations.Initializer; import org.chromium.build.annotations.NullMarked; import org.chromium.build.annotations.Nullable; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherFactory; import org.chromium.chrome.browser.flags.ChromeFeatureList; diff --git a/build/patches/Add-custom-tab-intents-privacy-option.patch b/build/patches/Add-custom-tab-intents-privacy-option.patch index 0781dad2..c5ecd490 100644 --- a/build/patches/Add-custom-tab-intents-privacy-option.patch +++ b/build/patches/Add-custom-tab-intents-privacy-option.patch @@ -18,14 +18,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../customtabs/CustomTabsConnection.java | 3 +- .../IncognitoCustomTabIntentDataProvider.java | 14 +++++ .../privacy/settings/PrivacySettings.java | 51 +++++++++++++++++++ - .../flags/android/chrome_feature_list.cc | 2 +- + .../flags/android/chrome_feature_list.cc | 5 +- .../browser/flags/ChromeFeatureList.java | 3 ++ .../chrome/browser/tab/TabAssociatedApp.java | 6 ++- ...Add-custom-tab-intents-privacy-option.grdp | 25 +++++++++ .../OriginVerifier.java | 5 ++ .../core/common/language_experiments.cc | 1 + .../add-custom-tab-intents-privacy-option.inc | 1 + - 13 files changed, 156 insertions(+), 13 deletions(-) + 13 files changed, 158 insertions(+), 14 deletions(-) create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-custom-tab-intents-privacy-option.grdp create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc @@ -327,15 +327,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting 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 -@@ -909,7 +909,7 @@ BASE_FEATURE(kMagicStackAndroid, base::FEATURE_ENABLED_BY_DEFAULT); +@@ -909,8 +909,9 @@ BASE_FEATURE(kMagicStackAndroid, base::FEATURE_ENABLED_BY_DEFAULT); // Enables an experimental feature which forces mayLaunchUrl to use a different // storage partition. This may reduce performance. This should not be enabled by // default. -BASE_FEATURE(kMayLaunchUrlUsesSeparateStoragePartition, +- base::FEATURE_DISABLED_BY_DEFAULT); +CROMITE_FEATURE(kMayLaunchUrlUsesSeparateStoragePartition, - base::FEATURE_DISABLED_BY_DEFAULT); ++ "MayLaunchUrlUsesSeparateStoragePartition", ++ base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kMediaIndicatorsAndroid, base::FEATURE_DISABLED_BY_DEFAULT); + diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java --- 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 diff --git a/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch b/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch index e4fb1153..8cc46d0c 100644 --- a/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch +++ b/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch @@ -7,9 +7,9 @@ Allows build with clangd by suppressing unsupported parameters Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - build/config/compiler/BUILD.gn | 14 +++++++++++--- + build/config/compiler/BUILD.gn | 17 ++++++++++++++--- build_overrides/build.gni | 3 +++ - 2 files changed, 14 insertions(+), 3 deletions(-) + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn @@ -32,15 +32,18 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn from_build_root = rebase_path(clang_warning_suppression_file, root_build_dir) inputs = [ clang_warning_suppression_file ] -@@ -2183,7 +2183,6 @@ config("default_warnings") { +@@ -2183,7 +2183,9 @@ config("default_warnings") { # TODO(crbug.com/432275627): Fix and re-enable. "-Wno-uninitialized-const-pointer", ] - ++ if (skip_clangd_unsupported_options) { ++ cflags -= [ "-Wno-uninitialized-const-pointer" ] ++ } cflags_cc += [ # TODO(crbug.com/328490295): Fix and re-enable for C flags. "-Wenum-compare-conditional", -@@ -2237,6 +2236,15 @@ config("default_warnings") { +@@ -2237,6 +2239,15 @@ config("default_warnings") { ldflags += [ "-Wno-version-check" ] } diff --git a/build/patches/Add-option-to-disable-snapshots.patch b/build/patches/Add-option-to-disable-snapshots.patch index 8a3c2db2..f7400b72 100644 --- a/build/patches/Add-option-to-disable-snapshots.patch +++ b/build/patches/Add-option-to-disable-snapshots.patch @@ -109,7 +109,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting import org.chromium.base.IntentUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.build.annotations.NullMarked; diff --git a/build/patches/Add-option-to-use-home-page-as-NTP.patch b/build/patches/Add-option-to-use-home-page-as-NTP.patch index 068130c8..ac639836 100644 --- a/build/patches/Add-option-to-use-home-page-as-NTP.patch +++ b/build/patches/Add-option-to-use-home-page-as-NTP.patch @@ -6,7 +6,7 @@ And allow use about:blank as default homepage License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../tab_management/TabGridDialogMediator.java | 11 ++++++++++- + .../tab_management/TabGridDialogMediator.java | 12 +++++++++++- .../tasks/tab_management/TabGroupUiMediator.java | 8 +++++++- .../java/res/xml/homepage_preferences.xml | 5 +++++ .../strip/TabGroupContextMenuCoordinator.java | 11 ++++++++++- @@ -19,12 +19,20 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../android/strings/android_chrome_strings.grd | 3 +++ chrome/browser/ui/browser_ui_prefs.cc | 2 ++ chrome/common/pref_names.h | 4 ++++ - 13 files changed, 79 insertions(+), 4 deletions(-) + 13 files changed, 80 insertions(+), 4 deletions(-) diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java -@@ -120,6 +120,9 @@ import java.util.Objects; +@@ -100,6 +100,7 @@ import org.chromium.components.collaboration.messaging.PersistentNotificationTyp + import org.chromium.components.data_sharing.DataSharingService; + import org.chromium.components.data_sharing.GroupMember; + import org.chromium.components.data_sharing.member_role.MemberRole; ++import org.chromium.components.embedder_support.util.UrlConstants; + import org.chromium.components.tab_group_sync.EitherId.EitherGroupId; + import org.chromium.components.tab_group_sync.LocalTabGroupId; + import org.chromium.components.tab_group_sync.TabGroupSyncService; +@@ -120,6 +121,9 @@ import java.util.Objects; import java.util.Set; import java.util.function.Supplier; @@ -34,7 +42,7 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser /** * A mediator for the TabGridDialog component, responsible for communicating with the components' * coordinator as well as managing the business logic for dialog show/hide. -@@ -1033,9 +1036,15 @@ public class TabGridDialogMediator +@@ -1033,9 +1037,15 @@ public class TabGridDialogMediator UrlConstantResolver urlConstantResolver = UrlConstantResolverFactory.getForProfile(profile); diff --git a/build/patches/Add-site-engagement-flag.patch b/build/patches/Add-site-engagement-flag.patch index ddd927c2..e005b42c 100644 --- a/build/patches/Add-site-engagement-flag.patch +++ b/build/patches/Add-site-engagement-flag.patch @@ -9,6 +9,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- chrome/browser/about_flags.cc | 1 + .../engagement/important_sites_util.cc | 9 +++++ + .../browser/media/media_engagement_service.cc | 4 ++- .../internal/tracker_impl.cc | 3 ++ .../public/feature_configurations.cc | 7 ++++ .../content/site_engagement_score.cc | 5 +++ @@ -16,7 +17,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/site_engagement/core/features.cc | 30 ++++++++++++++++ components/site_engagement/core/features.h | 34 +++++++++++++++++++ .../Add-site-engagement-flag.inc | 10 ++++++ - 9 files changed, 105 insertions(+) + 10 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 components/site_engagement/core/features.cc create mode 100644 components/site_engagement/core/features.h create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc @@ -65,6 +66,27 @@ diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/ std::map important_info; std::map engagement_map; +diff --git a/chrome/browser/media/media_engagement_service.cc b/chrome/browser/media/media_engagement_service.cc +--- a/chrome/browser/media/media_engagement_service.cc ++++ b/chrome/browser/media/media_engagement_service.cc +@@ -25,6 +25,7 @@ + #include "components/history/core/browser/history_service.h" + #include "components/no_state_prefetch/browser/no_state_prefetch_contents.h" + #include "components/prefs/pref_service.h" ++#include "components/site_engagement/core/features.h" + #include "content/public/browser/web_contents.h" + #include "media/base/media_switches.h" + #include "url/origin.h" +@@ -54,7 +55,8 @@ enum class MediaEngagementClearReason { + + // static + bool MediaEngagementService::IsEnabled() { +- return base::FeatureList::IsEnabled(media::kRecordMediaEngagementScores); ++ return base::FeatureList::IsEnabled(media::kRecordMediaEngagementScores) ++ && base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement); + } + + // static diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc --- a/components/feature_engagement/internal/tracker_impl.cc +++ b/components/feature_engagement/internal/tracker_impl.cc diff --git a/build/patches/Android-Pixel-Perfect-Mode.patch b/build/patches/Android-Pixel-Perfect-Mode.patch index 6d3387de..a07a5f0b 100644 --- a/build/patches/Android-Pixel-Perfect-Mode.patch +++ b/build/patches/Android-Pixel-Perfect-Mode.patch @@ -2185,8 +2185,8 @@ diff --git a/third_party/blink/renderer/platform/widget/input/input_handler_prox cc::TouchAction touch_action = cc::TouchAction::kAuto; - const gfx::Point point(touch_event.touches[i].PositionInWidget().x(), - touch_event.touches[i].PositionInWidget().y()); -+ const gfx::Point ScalePoint(point(touch_event.touches[i].PositionInWidget().x(), -+ touch_event.touches[i].PositionInWidget().y())); ++ const gfx::Point point(ScalePoint(gfx::Point(touch_event.touches[i].PositionInWidget().x(), ++ touch_event.touches[i].PositionInWidget().y()))); // TODO(crbug.com/355578906): This is just some rough math for now. The main // thread counterpart is AdjustPointerEvent. The buffer math on the main and // cc thread(s) need to match. diff --git a/build/patches/Bromite-auto-updater.patch b/build/patches/Bromite-auto-updater.patch index 9af9699b..88a9ee6a 100644 --- a/build/patches/Bromite-auto-updater.patch +++ b/build/patches/Bromite-auto-updater.patch @@ -21,12 +21,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/endpoint_fetcher/BUILD.gn | 32 ++ chrome/browser/endpoint_fetcher/DEPS | 3 + chrome/browser/endpoint_fetcher/OWNERS | 1 + - .../endpoint_fetcher_android.cc | 149 +++++++++ - .../endpoint_fetcher/EndpointFetcher.java | 116 +++++++ + .../endpoint_fetcher_android.cc | 107 +++++++ + .../endpoint_fetcher/EndpointFetcher.java | 63 ++++ .../EndpointHeaderResponse.java | 31 ++ .../endpoint_fetcher/EndpointResponse.java | 30 ++ .../flags/android/chrome_feature_list.cc | 1 + .../browser/flags/ChromeFeatureList.java | 1 + + .../access_code_cast_discovery_interface.cc | 2 +- chrome/browser/omaha/android/BUILD.gn | 3 + .../chrome/browser/omaha/OmahaPrefUtils.java | 52 +++- .../chrome/browser/omaha/UpdateConfigs.java | 27 +- @@ -34,15 +35,22 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/omaha/VersionNumberGetter.java | 4 +- .../omaha/inline/InlineUpdateController.java | 57 ++++ .../safety_hub/SafetyHubFetchService.java | 5 - + .../browser/save_to_drive/drive_uploader.cc | 2 +- .../strings/android_chrome_strings.grd | 23 +- - .../ui/lens/lens_overlay_query_controller.cc | 1 + - .../endpoint_fetcher/endpoint_fetcher.cc | 125 ++++++-- + .../ui/lens/lens_overlay_query_controller.cc | 2 +- + components/commerce/core/account_checker.cc | 2 +- + .../core/compare/cluster_server_proxy.cc | 2 +- + .../product_specifications_server_proxy.cc | 2 +- + .../subscriptions_server_proxy.cc | 2 +- + .../data_sharing_network_loader_impl.cc | 2 +- + .../internal/preview_server_proxy.cc | 2 +- + .../endpoint_fetcher/endpoint_fetcher.cc | 127 ++++++-- .../endpoint_fetcher/endpoint_fetcher.h | 28 +- - components/manta/base_provider.cc | 1 + + components/manta/base_provider.cc | 4 +- .../composebox/composebox_query_controller.cc | 2 +- .../Bromite-auto-updater.inc | 3 + .../Bromite-auto-updater.inc | 1 + - 34 files changed, 1239 insertions(+), 94 deletions(-) + 42 files changed, 1154 insertions(+), 106 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/CromiteUpdateStatusProvider.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java create mode 100644 chrome/browser/endpoint_fetcher/BUILD.gn @@ -746,7 +754,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc b/chrom new file mode 100644 --- /dev/null +++ b/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc -@@ -0,0 +1,149 @@ +@@ -0,0 +1,107 @@ +// Copyright 2019 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. @@ -801,48 +809,6 @@ new file mode 100644 +} +} // namespace + -+// TODO(crbug.com/1077537) Create a KeyProvider so -+// we can have one centralized API. -+ -+static void JNI_EndpointFetcher_NativeFetchOAuth( -+ JNIEnv* env, -+ const base::android::JavaParamRef& jprofile, -+ const base::android::JavaParamRef& joauth_consumer_name, -+ const base::android::JavaParamRef& jurl, -+ const base::android::JavaParamRef& jhttps_method, -+ const base::android::JavaParamRef& jcontent_type, -+ const base::android::JavaParamRef& jscopes, -+ const base::android::JavaParamRef& jpost_data, -+ jlong jtimeout, -+ jint jannotation_hash_code, -+ const base::android::JavaParamRef& jcallback) { -+ std::vector scopes; -+ base::android::AppendJavaStringArrayToStringVector(env, jscopes, &scopes); -+ auto endpoint_fetcher = std::make_unique( -+ Profile::FromJavaObject(jprofile) -+ ->GetDefaultStoragePartition() -+ ->GetURLLoaderFactoryForBrowserProcess(), -+ base::android::ConvertJavaStringToUTF8(env, joauth_consumer_name), -+ GURL(base::android::ConvertJavaStringToUTF8(env, jurl)), -+ base::android::ConvertJavaStringToUTF8(env, jhttps_method), -+ base::android::ConvertJavaStringToUTF8(env, jcontent_type), scopes, -+ base::Milliseconds(jtimeout), base::android::ConvertJavaStringToUTF8(env, jpost_data), -+ net::NetworkTrafficAnnotationTag::FromJavaAnnotation( -+ jannotation_hash_code), -+ IdentityManagerFactory::GetForProfile( -+ Profile::FromJavaObject(jprofile)), -+ // TODO(crbug.com/1466445): ConsentLevel::kSync is deprecated and should -+ // be removed. See ConsentLevel::kSync documentation for details. -+ signin::ConsentLevel::kSync); -+ auto* const endpoint_fetcher_ptr = endpoint_fetcher.get(); -+ endpoint_fetcher_ptr->Fetch( -+ base::BindOnce(&OnEndpointFetcherComplete, -+ base::android::ScopedJavaGlobalRef(jcallback), -+ // unique_ptr endpoint_fetcher is passed until the callback -+ // to ensure its lifetime across the request. -+ std::move(endpoint_fetcher))); -+} -+ +static void JNI_EndpointFetcher_NativeFetchWithNoAuth( + JNIEnv* env, + const base::android::JavaParamRef& jprofile, @@ -900,7 +866,7 @@ diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browse new file mode 100644 --- /dev/null +++ b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java -@@ -0,0 +1,116 @@ +@@ -0,0 +1,63 @@ +// Copyright 2019 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. @@ -928,47 +894,6 @@ new file mode 100644 +public final class EndpointFetcher { + private EndpointFetcher() {} + -+ /** -+ * Calls an endpoint using OAuth and returns the response via a callback -+ * @param callback callback function response is returned in -+ * @param profile profile via which the endpoint is called -+ * @param oathConsumerName consumer name for OAuth -+ * @param url endpoint URL called -+ * @param httpsMethod the HTTPS method used e.g. "GET" or "POST" -+ * @param contentType the content type e.g. "application/json" -+ * @param scopes scopes used as part of authentication -+ * @param postData data for a "POST" request -+ * @param timeout time after which the request will terminate in the event a response hasn't -+ * been received -+ */ -+ @MainThread -+ public static void fetchUsingOAuth( -+ Callback callback, -+ Profile profile, -+ String oathConsumerName, -+ String url, -+ String httpsMethod, -+ String contentType, -+ String[] scopes, -+ String postData, -+ long timeout, -+ NetworkTrafficAnnotationTag annotation) { -+ // EndpointFetcher currently does not support incognito mode -+ assert !profile.isOffTheRecord(); -+ EndpointFetcherJni.get() -+ .nativeFetchOAuth( -+ profile, -+ oathConsumerName, -+ url, -+ httpsMethod, -+ contentType, -+ scopes, -+ postData, -+ timeout, -+ annotation.getHashCode(), -+ callback); -+ } -+ + @MainThread + public static void nativeHeadWithNoAuth( + Callback callback, Profile profile, @@ -989,18 +914,6 @@ new file mode 100644 + + @NativeMethods + public interface Natives { -+ void nativeFetchOAuth( -+ Profile profile, -+ String oathConsumerName, -+ String url, -+ String httpsMethod, -+ String contentType, -+ String[] scopes, -+ String postData, -+ long timeout, -+ int annotationHashCode, -+ Callback callback); -+ + void nativeFetchWithNoAuth( + Profile profile, + String url, @@ -1110,6 +1023,18 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f public static final String INSTANCE_SWITCHER_V2 = "InstanceSwitcherV2"; public static final String IP_PROTECTION_UX = "IpProtectionUx"; public static final String KEYBOARD_ESC_BACK_NAVIGATION = "KeyboardEscBackNavigation"; +diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.cc +--- a/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.cc ++++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.cc +@@ -270,7 +270,7 @@ AccessCodeCastDiscoveryInterface::CreateEndpointFetcher( + .SetOauthScopes(discovery_scopes) + .SetOauthConsumerName(kDiscoveryOAuthConsumerName) + .SetPostData(kEmptyPostData) +- .Build()); ++ .Build(), kTrafficAnnotation); + } + + void AccessCodeCastDiscoveryInterface::ValidateDiscoveryAccessCode( diff --git a/chrome/browser/omaha/android/BUILD.gn b/chrome/browser/omaha/android/BUILD.gn --- a/chrome/browser/omaha/android/BUILD.gn +++ b/chrome/browser/omaha/android/BUILD.gn @@ -1677,6 +1602,18 @@ diff --git a/chrome/browser/safety_hub/android/java/src/org/chromium/chrome/brow } /** See {@link ChromeActivitySessionTracker#onForegroundSessionStart()}. */ +diff --git a/chrome/browser/save_to_drive/drive_uploader.cc b/chrome/browser/save_to_drive/drive_uploader.cc +--- a/chrome/browser/save_to_drive/drive_uploader.cc ++++ b/chrome/browser/save_to_drive/drive_uploader.cc +@@ -288,7 +288,7 @@ DriveUploader::CreateEndpointFetcher( + return std::make_unique( + /*url_loader_factory=*/url_loader_factory_.get(), + /*identity_manager=*/identity_manager_, +- /*request_params=*/std::move(request_params)); ++ /*request_params=*/std::move(request_params), kTrafficAnnotationTag); + } + + DriveUploaderType DriveUploader::get_drive_uploader_type() const { 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 @@ -1727,14 +1664,87 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/browser/ui/lens/lens_overlay_query_controller.cc b/chrome/browser/ui/lens/lens_overlay_query_controller.cc --- a/chrome/browser/ui/lens/lens_overlay_query_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_query_controller.cc -@@ -712,6 +712,7 @@ LensOverlayQueryController::CreateEndpointFetcher( - /*url_loader_factory=*/profile_ - ? profile_->GetURLLoaderFactory().get() - : g_browser_process->shared_url_loader_factory(), -+ kTrafficAnnotationTag, - /*identity_manager=*/nullptr, - EndpointFetcher::RequestParams::Builder(http_method, - kTrafficAnnotationTag) +@@ -726,7 +726,7 @@ LensOverlayQueryController::CreateEndpointFetcher( + .SetTimeout(timeout) + .SetUrl(fetch_url) + .SetUploadProgressCallback(std::move(upload_progress_callback)) +- .Build()); ++ .Build(), kTrafficAnnotationTag); + } + + void LensOverlayQueryController::SendLatencyGen204IfEnabled( +diff --git a/components/commerce/core/account_checker.cc b/components/commerce/core/account_checker.cc +--- a/components/commerce/core/account_checker.cc ++++ b/components/commerce/core/account_checker.cc +@@ -331,7 +331,7 @@ std::unique_ptr AccountChecker::CreateEndpointFetcher( + .SetPostData(post_data); + MaybeUseAlternateShoppingServer(request_params); + return std::make_unique( +- url_loader_factory_, identity_manager_, request_params.Build()); ++ url_loader_factory_, identity_manager_, request_params.Build(), annotation_tag); + } + + } // namespace commerce +diff --git a/components/commerce/core/compare/cluster_server_proxy.cc b/components/commerce/core/compare/cluster_server_proxy.cc +--- a/components/commerce/core/compare/cluster_server_proxy.cc ++++ b/components/commerce/core/compare/cluster_server_proxy.cc +@@ -158,7 +158,7 @@ std::unique_ptr ClusterServerProxy::CreateEndpointFetcher( + .SetPostData(post_data); + commerce::MaybeUseAlternateShoppingServer(request_params); + return std::make_unique( +- url_loader_factory_, identity_manager_, request_params.Build()); ++ url_loader_factory_, identity_manager_, request_params.Build(), kGetComparableProductsTrafficAnnotation); + } + + void ClusterServerProxy::HandleCompareResponse( +diff --git a/components/commerce/core/compare/product_specifications_server_proxy.cc b/components/commerce/core/compare/product_specifications_server_proxy.cc +--- a/components/commerce/core/compare/product_specifications_server_proxy.cc ++++ b/components/commerce/core/compare/product_specifications_server_proxy.cc +@@ -298,7 +298,7 @@ ProductSpecificationsServerProxy::CreateEndpointFetcher( + .SetPostData(post_data); + MaybeUseAlternateShoppingServer(request_params); + return std::make_unique( +- url_loader_factory_, identity_manager_, request_params.Build()); ++ url_loader_factory_, identity_manager_, request_params.Build(), kShoppingListTrafficAnnotation); + } + + std::optional +diff --git a/components/commerce/core/subscriptions/subscriptions_server_proxy.cc b/components/commerce/core/subscriptions/subscriptions_server_proxy.cc +--- a/components/commerce/core/subscriptions/subscriptions_server_proxy.cc ++++ b/components/commerce/core/subscriptions/subscriptions_server_proxy.cc +@@ -304,7 +304,7 @@ SubscriptionsServerProxy::CreateEndpointFetcher( + .SetPostData(post_data); + MaybeUseAlternateShoppingServer(request_params); + return std::make_unique( +- url_loader_factory_, identity_manager_, request_params.Build()); ++ url_loader_factory_, identity_manager_, request_params.Build(), annotation_tag); + } + + void SubscriptionsServerProxy::HandleManageSubscriptionsResponses( +diff --git a/components/data_sharing/internal/data_sharing_network_loader_impl.cc b/components/data_sharing/internal/data_sharing_network_loader_impl.cc +--- a/components/data_sharing/internal/data_sharing_network_loader_impl.cc ++++ b/components/data_sharing/internal/data_sharing_network_loader_impl.cc +@@ -78,7 +78,7 @@ DataSharingNetworkLoaderImpl::CreateEndpointFetcher( + .SetOauthScopes(scopes) + .SetOauthConsumerName(kOauthConsumerName) + .SetPostData(post_data) +- .Build()); ++ .Build(), annotation_tag); + } + + void DataSharingNetworkLoaderImpl::OnDownloadComplete( +diff --git a/components/data_sharing/internal/preview_server_proxy.cc b/components/data_sharing/internal/preview_server_proxy.cc +--- a/components/data_sharing/internal/preview_server_proxy.cc ++++ b/components/data_sharing/internal/preview_server_proxy.cc +@@ -351,7 +351,7 @@ std::unique_ptr PreviewServerProxy::CreateEndpointFetcher( + .SetUrl(url) + .SetOauthScopes(std::vector{kOAuthScope}) + .SetOauthConsumerName(kOAuthName) +- .Build()); ++ .Build(), kGetSharedDataPreviewTrafficAnnotation); + } + + void PreviewServerProxy::HandleServerResponse( diff --git a/components/endpoint_fetcher/endpoint_fetcher.cc b/components/endpoint_fetcher/endpoint_fetcher.cc --- a/components/endpoint_fetcher/endpoint_fetcher.cc +++ b/components/endpoint_fetcher/endpoint_fetcher.cc @@ -1777,8 +1787,9 @@ diff --git a/components/endpoint_fetcher/endpoint_fetcher.cc b/components/endpoi EndpointFetcher::EndpointFetcher( const scoped_refptr& url_loader_factory, signin::IdentityManager* identity_manager, -+ const net::NetworkTrafficAnnotationTag& annotation_tag, - RequestParams request_params) +- RequestParams request_params) ++ RequestParams request_params, ++ const net::NetworkTrafficAnnotationTag& annotation_tag) : url_loader_factory_(url_loader_factory), identity_manager_(identity_manager), + intercept_redirect_(false), @@ -2031,14 +2042,24 @@ diff --git a/components/endpoint_fetcher/endpoint_fetcher.h b/components/endpoin diff --git a/components/manta/base_provider.cc b/components/manta/base_provider.cc --- a/components/manta/base_provider.cc +++ b/components/manta/base_provider.cc -@@ -156,6 +156,7 @@ std::unique_ptr BaseProvider::CreateEndpointFetcherForDemoMode( - return std::make_unique( - /*url_loader_factory=*/url_loader_factory_, - /*identity_manager=*/nullptr, -+ annotation_tag, - EndpointFetcher::RequestParams::Builder(kHttpMethod, annotation_tag) - .SetAuthType(endpoint_fetcher::CHROME_API_KEY) - .SetUrl(url) +@@ -145,7 +145,7 @@ std::unique_ptr BaseProvider::CreateEndpointFetcher( + .SetOauthScopes(scopes) + .SetOauthConsumerName(oauth_consumer_name) + .SetPostData(post_data) +- .Build()); ++ .Build(), annotation_tag); + } + + std::unique_ptr BaseProvider::CreateEndpointFetcherForDemoMode( +@@ -163,7 +163,7 @@ std::unique_ptr BaseProvider::CreateEndpointFetcherForDemoMode( + .SetTimeout(timeout) + .SetPostData(post_data) + .SetChannel(version_info::Channel::STABLE) +- .Build()); ++ .Build(), annotation_tag); + } + + } // namespace manta diff --git a/components/omnibox/composebox/composebox_query_controller.cc b/components/omnibox/composebox/composebox_query_controller.cc --- a/components/omnibox/composebox/composebox_query_controller.cc +++ b/components/omnibox/composebox/composebox_query_controller.cc diff --git a/build/patches/Bromite-subresource-adblocker.patch b/build/patches/Bromite-subresource-adblocker.patch index 3aebf23a..f8e1538e 100644 --- a/build/patches/Bromite-subresource-adblocker.patch +++ b/build/patches/Bromite-subresource-adblocker.patch @@ -377,7 +377,7 @@ new file mode 100644 + +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.ObservableSupplierImpl; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; + +import org.chromium.content_public.browser.BrowserContextHandle; +import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; diff --git a/build/patches/Change-popup-site-setting.patch b/build/patches/Change-popup-site-setting.patch index 7879328c..d054733b 100644 --- a/build/patches/Change-popup-site-setting.patch +++ b/build/patches/Change-popup-site-setting.patch @@ -6,20 +6,33 @@ In site settings added ability to block all popups per site License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- + .../settings/site_settings/popups_page.html | 2 + .../tab_under_navigation_throttle.cc | 11 +- .../android/popup_blocked_message_delegate.cc | 20 +++- .../android/popup_blocked_message_delegate.h | 1 + components/blocked_content/popup_blocker.cc | 3 + components/blocked_content_strings.grdp | 3 + .../impl/BromitePopupContentSetting.java | 106 ++++++++++++++++++ - .../bromite_content_settings/popups.grdp | 12 ++ - .../bromite_content_settings/popups.inc | 8 ++ + .../bromite_content_settings/popups.grdp | 18 +++ + .../bromite_content_settings/popups.inc | 13 +++ .../core/browser/content_settings_registry.cc | 2 +- - 9 files changed, 160 insertions(+), 6 deletions(-) + 10 files changed, 173 insertions(+), 6 deletions(-) create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromitePopupContentSetting.java create mode 100644 components/browser_ui/strings/bromite_content_settings/popups.grdp create mode 100644 components/content_settings/core/browser/bromite_content_settings/popups.inc +diff --git a/chrome/browser/resources/settings/site_settings/popups_page.html b/chrome/browser/resources/settings/site_settings/popups_page.html +--- a/chrome/browser/resources/settings/site_settings/popups_page.html ++++ b/chrome/browser/resources/settings/site_settings/popups_page.html +@@ -9,6 +9,8 @@ + category="[[contentSettingsTypesEnum_.POPUPS]]" + allow-option-label="$i18n{siteSettingsPopupsAllowed}" + allow-option-icon="cr:open-in-new" ++ ask-option-label="$i18n{brSiteSettingspopupsAsk}" ++ ask-option-icon="privacy:open-in-new-off" + block-option-label="$i18n{siteSettingsPopupsBlocked}" + block-option-icon="privacy:open-in-new-off"> + diff --git a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc --- a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc +++ b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc @@ -244,9 +257,15 @@ diff --git a/components/browser_ui/strings/bromite_content_settings/popups.grdp new file mode 100644 --- /dev/null +++ b/components/browser_ui/strings/bromite_content_settings/popups.grdp -@@ -0,0 +1,12 @@ +@@ -0,0 +1,18 @@ + + ++ ++ Block sites from showing pop-ups and redirects ++ ++ ++ When on, sites can use pop-ups and redirects. When off, sites can’t use pop-ups and redirects. ++ + + Block all popups + @@ -261,15 +280,20 @@ diff --git a/components/content_settings/core/browser/bromite_content_settings/p new file mode 100644 --- /dev/null +++ b/components/content_settings/core/browser/bromite_content_settings/popups.inc -@@ -0,0 +1,8 @@ +@@ -0,0 +1,13 @@ + content_settings::WebsiteSettingsRegistry::GetInstance() + ->GetMutable(ContentSettingsType::POPUPS) + ->set_show_into_info_page() + .set_desktop_ui() + .set_is_renderer_content_setting() ++ .set_title_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP) ++ .set_description_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_DESCRIPTION) + .set_allowed_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_ALLOWED) + .set_ask_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_BLOCK_ALL) -+ .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_BLOCKED); ++ .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_BLOCKED) ++ .set_allowed_exceptions_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_ALLOWED) ++ .set_blocked_exceptions_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP_BLOCKED) ++ .set_mid_sentence_ui(IDS_WEBSITE_SETTINGS_CATEGORY_POPUP); diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc diff --git a/build/patches/Content-settings-infrastructure.patch b/build/patches/Content-settings-infrastructure.patch index 329d8bf2..0514c821 100644 --- a/build/patches/Content-settings-infrastructure.patch +++ b/build/patches/Content-settings-infrastructure.patch @@ -15,7 +15,7 @@ Require: bromite-build-utils.patch ...page_specific_content_settings_delegate.cc | 2 +- chrome/browser/resources/settings/BUILD.gn | 2 +- .../privacy_page/privacy_page_index.html | 1 + - .../privacy_page/privacy_page_index.ts | 77 +++- + .../privacy_page/privacy_page_index.ts | 82 +++- chrome/browser/resources/settings/route.ts | 2 + ...settings_category_default_radio_group.html | 12 + .../settings_category_default_radio_group.ts | 23 +- @@ -85,7 +85,7 @@ Require: bromite-build-utils.patch .../platform/web_content_settings_client.h | 13 + .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + - 74 files changed, 1967 insertions(+), 108 deletions(-) + 74 files changed, 1972 insertions(+), 108 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 @@ -180,22 +180,23 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page_index.h diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts b/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts --- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts -@@ -29,6 +29,7 @@ import {PrivacyGuideAvailabilityMixin} from './privacy_guide/privacy_guide_avail +@@ -29,6 +29,8 @@ import {PrivacyGuideAvailabilityMixin} from './privacy_guide/privacy_guide_avail import type {PrivacyGuideBrowserProxy} from './privacy_guide/privacy_guide_browser_proxy.js'; import {MAX_PRIVACY_GUIDE_PROMO_IMPRESSION, PrivacyGuideBrowserProxyImpl} from './privacy_guide/privacy_guide_browser_proxy.js'; import {getTemplate} from './privacy_page_index.html.js'; -+import { SettingsCategoryDefaultRadioGroupElement } from '../site_settings/settings_category_default_radio_group.js'; ++import {ContentSettingsTypes} from '../site_settings/constants.js'; ++import {SettingsCategoryDefaultRadioGroupElement} from '../site_settings/settings_category_default_radio_group.js'; // clang-format off // -@@ -53,8 +54,82 @@ export class SettingsPrivacyPageIndexElement extends +@@ -53,8 +55,86 @@ export class SettingsPrivacyPageIndexElement extends return 'settings-privacy-page-index'; } + static getSettingTemplate(template: HTMLTemplateElement, + name: string) : SettingsCategoryDefaultRadioGroupElement | undefined { + let value : SettingsCategoryDefaultRadioGroupElement | undefined = undefined; -+ let page : any = template.content.querySelector("settings-animated-pages"); ++ let page : any = template.content.querySelector("cr-view-manager"); + + page.querySelectorAll("template")!.forEach( + (subTemplate: HTMLTemplateElement) => { @@ -234,9 +235,14 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page_index.t + subpage.setAttribute("page-title", loadTimeData.getString(`brSiteSettings${name}`)); + subpage.setAttribute("search-title", loadTimeData.getString("siteSettingsAllSitesSearch")); + subpage.setAttribute("search-term", "{{searchFilter_}}"); ++ subpage.setAttribute("slot", "view"); ++ subpage.setAttribute("data-parent-view-id", "privacy"); ++ subpage.setAttribute("id", `siteSettings${name}`); ++ subpage.setAttribute("route-path", `/content/${tag_name}`); + + let divElement = document.createElement("div"); + divElement.setAttribute("class", "content-settings-header secondary"); ++ divElement.setAttribute("style", "padding: 0 var(--cr-section-padding)"); + divElement.innerText = loadTimeData.getString(`brSiteSettings${name}Description`); + subpage.appendChild(divElement); + @@ -261,8 +267,7 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page_index.t + + let tag = document.createElement("template"); + tag.setAttribute("is", "dom-if"); -+ tag.setAttribute("route-path", `/content/${tag_name}`); -+ tag.setAttribute("no-search", ""); ++ tag.setAttribute("if", `[[renderView_(routes_.SITE_SETTINGS_${name.toUpperCase()}, currentRoute, inSearchMode)]]`); + tag.content.appendChild(subpage); + + content.parentElement!.insertBefore(tag, content); diff --git a/build/patches/Disable-all-predictors-code.patch b/build/patches/Disable-all-predictors-code.patch index aa8974ac..ac10b20c 100644 --- a/build/patches/Disable-all-predictors-code.patch +++ b/build/patches/Disable-all-predictors-code.patch @@ -15,8 +15,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/permissions/BUILD.gn | 2 -- .../permissions/chrome_permissions_client.cc | 2 -- .../passage_embedder_delegate.cc | 2 ++ + .../permissions_ai_ui_selector.cc | 1 + .../prediction_model_handler_provider.cc | 9 ++++++--- .../prediction_model_handler_provider.h | 2 ++ + .../quiet_notification_permission_ui_state.cc | 4 ++-- .../predictors/autocomplete_action_predictor.cc | 2 ++ .../predictors/loading_predictor_config.cc | 4 ++-- .../browser/predictors/predictors_features.cc | 3 +-- @@ -38,7 +40,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/utility/BUILD.gn | 2 +- chrome/utility/services.cc | 8 -------- components/BUILD.gn | 2 +- - .../browser/foundations/autofill_manager.cc | 2 ++ + .../browser/foundations/autofill_manager.cc | 6 ++++++ .../core/browser/foundations/autofill_manager.h | 3 +++ .../autofill_optimization_guide_decider.cc | 5 +++-- .../field_classification_model_handler.cc | 12 ++++++++---- @@ -59,7 +61,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../Disable-all-predictors-code.inc | 2 ++ .../Disable-all-predictors-code.inc | 1 + .../Disable-all-predictors-code.inc | 1 + - .../features_cc/Disable-all-predictors-code.inc | 3 +++ + .../features_cc/Disable-all-predictors-code.inc | 5 +++++ .../features_cc/Disable-all-predictors-code.inc | 1 + .../features_cc/Disable-all-predictors-code.inc | 1 + .../features_cc/Disable-all-predictors-code.inc | 2 ++ @@ -72,7 +74,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../core/html/parser/html_document_parser.cc | 1 + .../document_speculation_rules.cc | 1 + .../platform/runtime_enabled_features.json5 | 2 +- - 67 files changed, 165 insertions(+), 94 deletions(-) + 69 files changed, 174 insertions(+), 96 deletions(-) create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc @@ -268,6 +270,17 @@ diff --git a/chrome/browser/permissions/prediction_service/passage_embedder_dele return nullptr; } +diff --git a/chrome/browser/permissions/prediction_service/permissions_ai_ui_selector.cc b/chrome/browser/permissions/prediction_service/permissions_ai_ui_selector.cc +--- a/chrome/browser/permissions/prediction_service/permissions_ai_ui_selector.cc ++++ b/chrome/browser/permissions/prediction_service/permissions_ai_ui_selector.cc +@@ -718,6 +718,7 @@ bool PermissionsAiUiSelector::ShouldHoldBack( + + PredictionSource PermissionsAiUiSelector::GetPredictionTypeToUse( + permissions::RequestType request_type) { ++ if ((true)) return PredictionSource::kNoCpssModel; + const bool is_msbb_enabled = profile_->GetPrefs()->GetBoolean( + unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled); + diff --git a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc --- a/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc +++ b/chrome/browser/permissions/prediction_service/prediction_model_handler_provider.cc @@ -312,6 +325,21 @@ diff --git a/chrome/browser/permissions/prediction_service/prediction_model_hand std::unique_ptr permissions_aiv1_handler_; #if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +diff --git a/chrome/browser/permissions/quiet_notification_permission_ui_state.cc b/chrome/browser/permissions/quiet_notification_permission_ui_state.cc +--- a/chrome/browser/permissions/quiet_notification_permission_ui_state.cc ++++ b/chrome/browser/permissions/quiet_notification_permission_ui_state.cc +@@ -25,9 +25,9 @@ void QuietNotificationPermissionUiState::RegisterProfilePrefs( + registry->RegisterTimePref(prefs::kQuietNotificationPermissionUiDisabledTime, + base::Time()); + registry->RegisterBooleanPref(prefs::kEnableNotificationCPSS, +- /*default_value=*/true); ++ /*default_value=*/false); + registry->RegisterBooleanPref(prefs::kEnableGeolocationCPSS, +- /*default_value=*/true); ++ /*default_value=*/false); + registry->RegisterBooleanPref( + prefs::kDidMigrateAdaptiveNotifiationQuietingToCPSS, + /*default_value=*/false); diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc --- a/chrome/browser/predictors/autocomplete_action_predictor.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor.cc @@ -805,7 +833,34 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn diff --git a/components/autofill/core/browser/foundations/autofill_manager.cc b/components/autofill/core/browser/foundations/autofill_manager.cc --- a/components/autofill/core/browser/foundations/autofill_manager.cc +++ b/components/autofill/core/browser/foundations/autofill_manager.cc -@@ -955,6 +955,7 @@ void AutofillManager::LogCurrentFieldTypes( +@@ -137,8 +137,10 @@ struct AutofillManager::AsyncContext { + + std::vector forms; + std::vector regex_predictions; ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + std::vector autofill_predictions; + std::vector password_manager_predictions; ++#endif + GeoIpCountryCode country_code; + LanguageCode current_page_language; + std::unique_ptr log_manager; +@@ -707,6 +709,7 @@ void AutofillManager::ParseFormsAsyncCommon( + } + } + ++#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) + if (!context.autofill_predictions.empty()) { + context.autofill_predictions[i].ApplyTo(form_structure->fields()); + } +@@ -714,6 +717,7 @@ void AutofillManager::ParseFormsAsyncCommon( + context.password_manager_predictions[i].ApplyTo( + form_structure->fields()); + } ++#endif + if (!context.regex_predictions.empty()) { + context.regex_predictions[i].ApplyTo(form_structure->fields()); + } +@@ -955,6 +959,7 @@ void AutofillManager::LogCurrentFieldTypes( } } @@ -813,7 +868,7 @@ diff --git a/components/autofill/core/browser/foundations/autofill_manager.cc b/ void AutofillManager::SubscribeToMlModelChanges( FieldClassificationModelHandler& handler) { switch (handler.optimization_target()) { -@@ -978,5 +979,6 @@ void AutofillManager::SubscribeToMlModelChanges( +@@ -978,5 +983,6 @@ void AutofillManager::SubscribeToMlModelChanges( NOTREACHED(); } } @@ -1243,10 +1298,12 @@ diff --git a/cromite_flags/components/permissions/features_cc/Disable-all-predic new file mode 100644 --- /dev/null +++ b/cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc -@@ -0,0 +1,3 @@ -+SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceNotificationPredictions); -+SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceGeolocationPredictions); +@@ -0,0 +1,5 @@ +SET_CROMITE_FEATURE_DISABLED(kPermissionPredictionsV2); ++ ++#if BUILDFLAG(IS_ANDROID) ++SET_CROMITE_FEATURE_DISABLED(kPermissionDedicatedCpssSettingAndroid); ++#endif diff --git a/cromite_flags/net/base/features_cc/Disable-all-predictors-code.inc b/cromite_flags/net/base/features_cc/Disable-all-predictors-code.inc new file mode 100644 --- /dev/null diff --git a/build/patches/Disable-privacy-issues-in-password-manager.patch b/build/patches/Disable-privacy-issues-in-password-manager.patch index 6adf97b2..6f1cef0c 100644 --- a/build/patches/Disable-privacy-issues-in-password-manager.patch +++ b/build/patches/Disable-privacy-issues-in-password-manager.patch @@ -181,7 +181,7 @@ diff --git a/components/password_manager/core/browser/password_manager.cc b/comp #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || // BUILDFLAG(IS_CHROMEOS) #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) // Desktop -@@ -612,7 +612,7 @@ void PasswordManager::RegisterProfilePrefs( +@@ -610,7 +610,7 @@ void PasswordManager::RegisterProfilePrefs( registry->RegisterBooleanPref(prefs::kAccountStoreMigratedToOSCryptAsync, false); registry->RegisterBooleanPref( diff --git a/build/patches/Enable-native-Android-autofill.patch b/build/patches/Enable-native-Android-autofill.patch index 96805a25..0c3a23e5 100644 --- a/build/patches/Enable-native-Android-autofill.patch +++ b/build/patches/Enable-native-Android-autofill.patch @@ -18,7 +18,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../settings/PasswordSettings.java | 84 ++++++++++++++++++- .../chrome/browser/settings/MainSettings.java | 16 +--- .../chromium/chrome/browser/tab/TabImpl.java | 42 ++++++++-- - chrome/browser/android/tab_android.cc | 3 +- + chrome/browser/android/tab_android.cc | 4 +- chrome/browser/autofill/android/BUILD.gn | 2 +- .../autofill/AutofillClientProviderUtils.java | 2 +- ...AutofillThirdPartyModeContentProvider.java | 1 + @@ -45,7 +45,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../autofill/core/common/autofill_features.cc | 1 - .../autofill/core/common/autofill_prefs.cc | 4 +- .../autofill/core/common/autofill_prefs.h | 5 ++ - 30 files changed, 278 insertions(+), 121 deletions(-) + 30 files changed, 279 insertions(+), 121 deletions(-) create mode 100644 components/android_autofill/browser/java/src/org/chromium/components/autofill/BrowserSelectionActionMenuDelegate.java diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java @@ -56,7 +56,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manage import androidx.preference.PreferenceGroup; +import org.chromium.base.StrictModeContext; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.build.annotations.Nullable; @@ -297,7 +297,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.jav diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc --- a/chrome/browser/android/tab_android.cc +++ b/chrome/browser/android/tab_android.cc -@@ -449,8 +449,7 @@ void TabAndroid::InitializeAutofillIfNecessary(JNIEnv* env) { +@@ -36,6 +36,7 @@ + #include "chrome/browser/resource_coordinator/tab_load_tracker.h" + #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" + #include "chrome/browser/tab_contents/tab_util.h" ++#include "chrome/browser/ui/autofill/chrome_autofill_client.h" + #include "chrome/browser/ui/android/context_menu_helper.h" + #include "chrome/browser/ui/android/tab_model/tab_model.h" + #include "chrome/browser/ui/android/tab_model/tab_model_list.h" +@@ -449,8 +450,7 @@ void TabAndroid::InitializeAutofillIfNecessary(JNIEnv* env) { ->MaybeInitKeyboardSuppressor(); return; } diff --git a/build/patches/Enable-search-engine-settings-desktop-ui.patch b/build/patches/Enable-search-engine-settings-desktop-ui.patch index 696043a3..bf872cf7 100644 --- a/build/patches/Enable-search-engine-settings-desktop-ui.patch +++ b/build/patches/Enable-search-engine-settings-desktop-ui.patch @@ -12,7 +12,6 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/app/settings_strings.grdp | 3 + chrome/app/settings_strings_android.grdp | 260 ++++++++++++++++++ chrome/browser/BUILD.gn | 3 + - .../chrome_browser_interface_binders_webui.cc | 1 + ...r_interface_binders_webui_parts_desktop.cc | 3 + chrome/browser/extensions/extension_util.h | 2 +- chrome/browser/resources/BUILD.gn | 7 + @@ -28,7 +27,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../browser/resources/settings/settings.html | 8 +- .../settings/settings_ui/settings_ui.html | 6 + .../resources/settings_shared/BUILD.gn | 2 +- - chrome/browser/search/background/BUILD.gn | 4 +- + chrome/browser/search/background/BUILD.gn | 2 +- .../browser/search_engines/android/BUILD.gn | 1 + .../java/res/layout/search_engine_layout.xml | 25 ++ .../settings/SearchEngineSettings.java | 21 ++ @@ -80,7 +79,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html ui/webui/resources/images/BUILD.gn | 2 +- ui/webui/resources/js/BUILD.gn | 2 +- ui/webui/resources/js/load_time_data.ts | 17 +- - 73 files changed, 1151 insertions(+), 73 deletions(-) + 72 files changed, 1148 insertions(+), 73 deletions(-) create mode 100644 chrome/app/settings_strings_android.grdp create mode 100644 chrome/browser/search_engines/android/java/res/layout/search_engine_layout.xml create mode 100644 chrome/browser/ui/webui/settings/settings_localized_strings_provider_android.cc @@ -431,17 +430,6 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn } else { #!is_android sources += [ -diff --git a/chrome/browser/chrome_browser_interface_binders_webui.cc b/chrome/browser/chrome_browser_interface_binders_webui.cc ---- a/chrome/browser/chrome_browser_interface_binders_webui.cc -+++ b/chrome/browser/chrome_browser_interface_binders_webui.cc -@@ -119,6 +119,7 @@ void PopulateChromeWebUIFrameBinders( - - #if BUILDFLAG(IS_ANDROID) - PopulateChromeWebUIFrameBindersPartsAndroid(map, render_frame_host); -+#error "Check this patch" - #else - PopulateChromeWebUIFrameBindersPartsDesktop(map, render_frame_host); - #endif // BUILDFLAG(IS_ANDROID) diff --git a/chrome/browser/chrome_browser_interface_binders_webui_parts_desktop.cc b/chrome/browser/chrome_browser_interface_binders_webui_parts_desktop.cc --- a/chrome/browser/chrome_browser_interface_binders_webui_parts_desktop.cc +++ b/chrome/browser/chrome_browser_interface_binders_webui_parts_desktop.cc @@ -786,7 +774,7 @@ diff --git a/chrome/browser/resources/settings_shared/BUILD.gn b/chrome/browser/ diff --git a/chrome/browser/search/background/BUILD.gn b/chrome/browser/search/background/BUILD.gn --- a/chrome/browser/search/background/BUILD.gn +++ b/chrome/browser/search/background/BUILD.gn -@@ -2,10 +2,11 @@ +@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -795,18 +783,6 @@ diff --git a/chrome/browser/search/background/BUILD.gn b/chrome/browser/search/b import("//third_party/protobuf/proto_library.gni") -+if (!is_android) { - source_set("background") { - public = [ - "ntp_background_service_factory.h", -@@ -73,6 +74,7 @@ source_set("background") { - ] - } - } -+} - - source_set("constants") { - sources = [ "ntp_custom_background_service_constants.h" ] diff --git a/chrome/browser/search_engines/android/BUILD.gn b/chrome/browser/search_engines/android/BUILD.gn --- a/chrome/browser/search_engines/android/BUILD.gn +++ b/chrome/browser/search_engines/android/BUILD.gn @@ -1171,20 +1147,19 @@ diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui parsed.force_empty_default_favicon ? DefaultFaviconBehavior::kUseEmptyIcon : DefaultFaviconBehavior::kUseGlobeIcon); -@@ -289,9 +295,13 @@ void FaviconSource::SendDefaultResponse( +@@ -289,8 +295,12 @@ void FaviconSource::SendDefaultResponse( DefaultFaviconBehavior behavior) { SendDefaultResponse(std::move(callback), 16, 1.0f, !force_light_mode && +#if !BUILDFLAG(IS_ANDROID) GetNativeTheme(wc_getter)->preferred_color_scheme() == ui::NativeTheme::PreferredColorScheme::kDark, - behavior); +#else -+ : false); ++ false, +#endif + behavior); } - void FaviconSource::SendDefaultResponse( @@ -309,6 +319,7 @@ void FaviconSource::SendDefaultResponse( int resource_id; diff --git a/build/patches/Eyeo-Adblock-for-Cromite.patch b/build/patches/Eyeo-Adblock-for-Cromite.patch index 920ad8a3..be8fc981 100644 --- a/build/patches/Eyeo-Adblock-for-Cromite.patch +++ b/build/patches/Eyeo-Adblock-for-Cromite.patch @@ -31,7 +31,7 @@ suit Cromite logic. .../settings/adblock_page/adblock_page.html | 218 + .../settings/adblock_page/adblock_page.ts | 311 + .../resources/settings/page_visibility.ts | 1 + - chrome/browser/resources/settings/route.ts | 5 + + chrome/browser/resources/settings/route.ts | 4 + chrome/browser/resources/settings/router.ts | 1 + chrome/browser/resources/settings/settings.ts | 1 + .../settings/settings_main/settings_main.html | 7 + @@ -131,7 +131,7 @@ suit Cromite logic. .../renderer/core/exported/web_document.cc | 13 +- .../blink/renderer/core/html/html_element.cc | 8 +- .../definitions/adblock_private.d.ts | 14 + - 126 files changed, 9337 insertions(+), 689 deletions(-) + 126 files changed, 9336 insertions(+), 689 deletions(-) rename chrome/browser/adblock/android/java/res/xml/{adblock_preferences.xml => eyeo_adblock_preferences.xml} (59%) create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.html create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.ts @@ -1782,13 +1782,12 @@ diff --git a/chrome/browser/resources/settings/page_visibility.ts b/chrome/brows diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts --- a/chrome/browser/resources/settings/route.ts +++ b/chrome/browser/resources/settings/route.ts -@@ -226,6 +226,11 @@ function createRoutes(): SettingsRoutes { +@@ -226,6 +226,10 @@ function createRoutes(): SettingsRoutes { r.FONTS = r.APPEARANCE.createChild('/fonts'); } + if (visibility.adblock !== false) { + r.ADBLOCK = r.BASIC.createSection('/adblock', 'adblock'); -+ r.ADBLOCK.hasMigratedToPlugin = true; + } + if (visibility.autofill !== false) { @@ -1949,8 +1948,8 @@ diff --git a/components/adblock/android/adblock_controller_jni.cc b/components/a + long download_success_count, long download_error_count, const std::vector& languages, const bool autoinstalled) { - ScopedJavaLocalRef url_param( -@@ -57,24 +62,40 @@ ScopedJavaLocalRef ToJava(JNIEnv* env, + ScopedJavaLocalRef url_param = +@@ -58,24 +63,40 @@ ScopedJavaLocalRef ToJava(JNIEnv* env, return Java_Subscription_Constructor(env, url_param, ConvertUTF8ToJavaString(env, title), ConvertUTF8ToJavaString(env, version), @@ -1993,7 +1992,7 @@ diff --git a/components/adblock/android/adblock_controller_jni.cc b/components/a } return jobjects; } -@@ -93,7 +114,11 @@ std::vector> CSubscriptionsToJObjects( +@@ -94,7 +115,11 @@ std::vector> CSubscriptionsToJObjects( DCHECK(sub.url.is_valid()); if (sub.url.is_valid()) { jobjects.push_back(ToJava(env, url_class, url_constructor, @@ -2006,7 +2005,7 @@ diff --git a/components/adblock/android/adblock_controller_jni.cc b/components/a false)); } } -@@ -103,6 +128,52 @@ std::vector> CSubscriptionsToJObjects( +@@ -104,6 +129,52 @@ std::vector> CSubscriptionsToJObjects( } // namespace @@ -2059,7 +2058,7 @@ diff --git a/components/adblock/android/adblock_controller_jni.cc b/components/a static base::android::ScopedJavaLocalRef JNI_AdblockController_GetInstalledSubscriptions( JNIEnv* env, -@@ -118,7 +189,7 @@ JNI_AdblockController_GetInstalledSubscriptions( +@@ -119,7 +190,7 @@ JNI_AdblockController_GetInstalledSubscriptions( return ToJavaArrayOfObjects( env, CSubscriptionsToJObjects( diff --git a/build/patches/Force-use-vpython3-for-some-scripts.patch b/build/patches/Force-use-vpython3-for-some-scripts.patch index 2718a9ee..cf810c30 100644 --- a/build/patches/Force-use-vpython3-for-some-scripts.patch +++ b/build/patches/Force-use-vpython3-for-some-scripts.patch @@ -8,16 +8,16 @@ required by the chromium build tools. License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - build/config/android/internal_rules.gni | 5 ++++- - build/config/python.gni | 7 ++++++- - .../metrics/generate_expired_histograms_array.gni | 7 +++++-- - components/variations/field_trial_config/BUILD.gn | 4 +++- - third_party/perfetto/gn/BUILD.gn | 5 ++++- - tools/grit/grit_rule.gni | 4 +++- - tools/json_schema_compiler/json_schema_api.gni | 12 +++++++++--- - tools/json_to_struct/json_to_struct.gni | 4 +++- - .../generate_allowlist_from_histograms_file.gni | 5 +++-- - 9 files changed, 40 insertions(+), 13 deletions(-) + build/config/android/internal_rules.gni | 22 ++++++++++++++----- + build/config/python.gni | 7 +++++- + .../generate_expired_histograms_array.gni | 7 ++++-- + .../variations/field_trial_config/BUILD.gn | 4 +++- + third_party/perfetto/gn/BUILD.gn | 5 ++++- + tools/grit/grit_rule.gni | 4 +++- + .../json_schema_compiler/json_schema_api.gni | 12 +++++++--- + tools/json_to_struct/json_to_struct.gni | 4 +++- + ...enerate_allowlist_from_histograms_file.gni | 5 +++-- + 9 files changed, 52 insertions(+), 18 deletions(-) diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni --- a/build/config/android/internal_rules.gni @@ -39,6 +39,59 @@ diff --git a/build/config/android/internal_rules.gni b/build/config/android/inte "--output", rebase_path(invoker.build_config, root_build_dir), "--depfile", +@@ -3018,17 +3021,18 @@ if (enable_java_templates) { + } + + action_with_pydeps(target_name) { ++ script = "//build/gn_run_binary.py" + if (invoker.use_turbine) { +- script = "//build/android/gyp/turbine.py" ++ original_script = "//build/android/gyp/turbine.py" + inputs = [ + "//third_party/jdk/current/bin/java", + android_sdk_jar, + ] + } else if (invoker.enable_errorprone) { +- script = "//build/android/gyp/errorprone.py" ++ original_script = "//build/android/gyp/errorprone.py" + inputs = javac_paths_for_inputs + } else { +- script = "//build/android/gyp/compile_java.py" ++ original_script = "//build/android/gyp/compile_java.py" + inputs = javac_paths_for_inputs + } + +@@ -3044,7 +3048,10 @@ if (enable_java_templates) { + deps += invoker.deps + } + +- args = [] ++ args = [ ++ rebase_path("//third_party/depot_tools/vpython3"), ++ rebase_path(original_script), ++ ] + if (invoker.enable_errorprone) { + _stamp_file = "$target_out_dir/$target_name.stamp" + outputs = [ _stamp_file ] +@@ -3242,7 +3249,8 @@ if (enable_java_templates) { + } + + action_with_pydeps(target_name) { +- script = "//build/android/gyp/compile_kt.py" ++ script = "//build/gn_run_binary.py" ++ original_script = "//build/android/gyp/compile_kt.py" + depfile = "$target_gen_dir/$target_name.d" + deps = _srcjar_deps + if (defined(invoker.deps)) { +@@ -3271,6 +3279,8 @@ if (enable_java_templates) { + "$target_gen_dir/${invoker.main_target_name}/generated_java", + root_build_dir) + args = [ ++ rebase_path("//third_party/depot_tools/vpython3"), ++ rebase_path(original_script), + "--depfile=$_rebased_depfile", + "--generated-dir=$_rebased_generated_dir", + "--jar-path=$_rebased_output_jar_path", diff --git a/build/config/python.gni b/build/config/python.gni --- a/build/config/python.gni +++ b/build/config/python.gni diff --git a/build/patches/Hardening-against-incognito-mode-detection.patch b/build/patches/Hardening-against-incognito-mode-detection.patch index bdf818dc..db89635f 100644 --- a/build/patches/Hardening-against-incognito-mode-detection.patch +++ b/build/patches/Hardening-against-incognito-mode-detection.patch @@ -4,9 +4,9 @@ Subject: Hardening against incognito mode detection License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - storage/browser/quota/quota_manager_impl.cc | 2 +- + storage/browser/quota/quota_manager_impl.cc | 4 ++-- storage/browser/quota/quota_settings.cc | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/browser/quota/quota_manager_impl.cc b/storage/browser/quota/quota_manager_impl.cc --- a/storage/browser/quota/quota_manager_impl.cc @@ -20,6 +20,15 @@ diff --git a/storage/browser/quota/quota_manager_impl.cc b/storage/browser/quota storage_key.origin().GetURL())) { return settings.session_only_per_storage_key_quota; } +@@ -2445,7 +2445,7 @@ void QuotaManagerImpl::SimulateStoragePressure(const url::Origin& origin_url) { + void QuotaManagerImpl::IsSimulateStoragePressureAvailable( + IsSimulateStoragePressureAvailableCallback callback) { + // We assume this is only the case in incognito. If it changes, update this. +- DCHECK_EQ(is_incognito_, storage_pressure_callback_.is_null()); ++ // DCHECK_EQ(is_incognito_, storage_pressure_callback_.is_null()); + + std::move(callback).Run(!storage_pressure_callback_.is_null()); + } diff --git a/storage/browser/quota/quota_settings.cc b/storage/browser/quota/quota_settings.cc --- a/storage/browser/quota/quota_settings.cc +++ b/storage/browser/quota/quota_settings.cc diff --git a/build/patches/Internal-firewall.patch b/build/patches/Internal-firewall.patch index eade03c2..922cfedf 100644 --- a/build/patches/Internal-firewall.patch +++ b/build/patches/Internal-firewall.patch @@ -1254,7 +1254,7 @@ new file mode 100644 +""", + event_template=""" +const char k{event.name}EntryName[] = "{event.raw_name}"; -+constexpr uint64_t k{event.name}EntryNameHash = COMPUTE_NETWORK_TRAFFIC_ANNOTATION_ID_HASH("{event.raw_name}"); ++constexpr uint64_t k{event.name}EntryNameHash = net::internal::ComputeAnnotationHash("{event.raw_name}"); +""", + metric_template=""" +""") diff --git a/build/patches/Keep-disabled-FetchLaterAPI.patch b/build/patches/Keep-disabled-FetchLaterAPI.patch index 92e1a109..280f98e5 100644 --- a/build/patches/Keep-disabled-FetchLaterAPI.patch +++ b/build/patches/Keep-disabled-FetchLaterAPI.patch @@ -11,12 +11,12 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- .../browser/loader/keep_alive_url_loader.cc | 33 +++++++++++++++++-- .../browser/loader/keep_alive_url_loader.h | 3 -- - .../Keep-disabled-FetchLaterAPI.inc | 2 ++ + .../Keep-disabled-FetchLaterAPI.inc | 1 + .../renderer/core/fetch/fetch_manager.cc | 21 ++++++++++-- .../loader/child_url_loader_factory_bundle.cc | 16 +++++++++ .../platform/loader/fetch/resource_fetcher.cc | 2 +- .../platform/runtime_enabled_features.json5 | 4 +-- - 7 files changed, 71 insertions(+), 10 deletions(-) + 7 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 cromite_flags/third_party/blink/common/features_cc/Keep-disabled-FetchLaterAPI.inc diff --git a/content/browser/loader/keep_alive_url_loader.cc b/content/browser/loader/keep_alive_url_loader.cc @@ -93,9 +93,8 @@ diff --git a/cromite_flags/third_party/blink/common/features_cc/Keep-disabled-Fe new file mode 100644 --- /dev/null +++ b/cromite_flags/third_party/blink/common/features_cc/Keep-disabled-FetchLaterAPI.inc -@@ -0,0 +1,2 @@ +@@ -0,0 +1 @@ +SET_CROMITE_FEATURE_ENABLED(kKeepAliveInBrowserMigration); -+SET_CROMITE_FEATURE_DISABLED(kAttributionReportingInBrowserMigration); diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc @@ -186,7 +185,7 @@ diff --git a/third_party/blink/renderer/platform/loader/child_url_loader_factory diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc -@@ -3107,7 +3107,7 @@ void ResourceFetcher::PrepareForLeakDetection() { +@@ -3108,7 +3108,7 @@ void ResourceFetcher::PrepareForLeakDetection() { void ResourceFetcher::StopFetchingInternal(StopFetchingTarget target) { // TODO(toyoshim): May want to suspend scheduler while canceling loaders so // that the cancellations below do not awake unnecessary scheduling. diff --git a/build/patches/Log-dangling-attributes-in-some-html-elements.patch b/build/patches/Log-dangling-attributes-in-some-html-elements.patch index fe092da2..a62fee63 100644 --- a/build/patches/Log-dangling-attributes-in-some-html-elements.patch +++ b/build/patches/Log-dangling-attributes-in-some-html-elements.patch @@ -13,7 +13,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../blink/renderer/core/dom/document.cc | 18 +++++++++++++++ .../blink/renderer/core/dom/element.cc | 20 ++++++++++++++++- third_party/blink/renderer/core/dom/element.h | 3 ++- - .../editing/serializers/markup_formatter.cc | 11 ++++++++++ + .../editing/serializers/markup_formatter.cc | 12 ++++++++++ .../core/html/forms/html_form_element.cc | 2 +- .../renderer/core/html/html_base_element.cc | 6 +++++ .../renderer/core/html/html_base_element.h | 2 ++ @@ -23,7 +23,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../core/loader/frame_load_request.cc | 9 ++++++++ .../blink/renderer/core/page/frame_tree.cc | 22 +++++++++++++++++++ .../platform/runtime_enabled_features.json5 | 6 +++++ - 14 files changed, 132 insertions(+), 3 deletions(-) + 14 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Log-dangling-attributes-in-some-html-elements.inc diff --git a/cromite_flags/chrome/browser/about_flags_cc/Log-dangling-attributes-in-some-html-elements.inc b/cromite_flags/chrome/browser/about_flags_cc/Log-dangling-attributes-in-some-html-elements.inc @@ -137,19 +137,20 @@ diff --git a/third_party/blink/renderer/core/editing/serializers/markup_formatte #include "third_party/blink/renderer/core/dom/comment.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/document_fragment.h" -@@ -208,6 +210,15 @@ void MarkupFormatter::AppendEndMarkup(StringBuilder& result, +@@ -208,6 +210,16 @@ void MarkupFormatter::AppendEndMarkup(StringBuilder& result, void MarkupFormatter::AppendAttributeValue(StringBuilder& result, const String& attribute, bool document_is_html) { -+ if (RuntimeEnabledFeatures::LogDanglingAttributesEnabled()) { -+ if (attribute.Contains('<') || attribute.Contains('>')) { -+ document.AddConsoleMessage(MakeGarbageCollected( -+ mojom::ConsoleMessageSource::kSecurity, -+ mojom::ConsoleMessageLevel::kInfo, -+ "Bromite Dangling Markup Prevention: '" + attribute + -+ "' is not allowed as parameter value.")); -+ } -+ } ++ // https://chromium-review.googlesource.com/c/chromium/src/+/6905283 ++ // if (RuntimeEnabledFeatures::LogDanglingAttributesEnabled()) { ++ // if (attribute.Contains('<') || attribute.Contains('>')) { ++ // document.AddConsoleMessage(MakeGarbageCollected( ++ // mojom::ConsoleMessageSource::kSecurity, ++ // mojom::ConsoleMessageLevel::kInfo, ++ // "Bromite Dangling Markup Prevention: '" + attribute + ++ // "' is not allowed as parameter value.")); ++ // } ++ // } EntityMask entity_mask = document_is_html ? kEntityMaskInHTMLAttributeValue : kEntityMaskInAttributeValue; AppendCharactersReplacingEntities(result, attribute, entity_mask); diff --git a/build/patches/Modify-default-preferences.patch b/build/patches/Modify-default-preferences.patch index 47b8fd8c..87884bc8 100644 --- a/build/patches/Modify-default-preferences.patch +++ b/build/patches/Modify-default-preferences.patch @@ -15,14 +15,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/bookmarks/browser/bookmark_utils.cc | 7 +++++-- components/bookmarks/browser/features.cc | 17 +++++++++++++++++ components/bookmarks/browser/features.h | 18 ++++++++++++++++++ - .../core/browser/content_settings_registry.cc | 6 +++--- + .../core/browser/content_settings_registry.cc | 8 ++++---- .../core/browser/cookie_settings.cc | 2 +- components/payments/core/payment_prefs.cc | 2 +- .../core/common/safe_browsing_prefs.cc | 4 ++-- .../primary_account_manager.cc | 2 +- .../Modify-default-preferences.inc | 8 ++++++++ .../features_cc/Modify-default-preferences.inc | 1 + - 18 files changed, 68 insertions(+), 18 deletions(-) + 18 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 components/bookmarks/browser/features.cc create mode 100644 components/bookmarks/browser/features.h create mode 100755 cromite_flags/chrome/browser/about_flags_cc/Modify-default-preferences.inc @@ -227,6 +227,15 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. /*allowlisted_primary_schemes=*/{}, /*valid_settings=*/ {CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, CONTENT_SETTING_ASK}, +@@ -218,7 +218,7 @@ void ContentSettingsRegistry::Init() { + PermissionSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); + + Register(ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER, +- "protected-media-identifier", CONTENT_SETTING_ALLOW, ++ "protected-media-identifier", CONTENT_SETTING_BLOCK, + WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_primary_schemes=*/{}, + #if BUILDFLAG(IS_ANDROID) + /*valid_settings=*/ @@ -245,7 +245,7 @@ void ContentSettingsRegistry::Init() { PermissionSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); diff --git a/build/patches/Move-navigation-bar-to-bottom.patch b/build/patches/Move-navigation-bar-to-bottom.patch index 3b2ac503..e9ec41f3 100644 --- a/build/patches/Move-navigation-bar-to-bottom.patch +++ b/build/patches/Move-navigation-bar-to-bottom.patch @@ -47,6 +47,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../chrome/browser/ntp/NewTabPage.java | 14 +- .../chrome/browser/ntp/NewTabPageLayout.java | 10 +- .../chrome/browser/ntp/RecentTabsPage.java | 31 +++- + .../browser/page_info/ChromePageInfo.java | 2 + .../browser/searchwidget/SearchActivity.java | 14 ++ .../settings/FragmentDependencyProvider.java | 5 + .../StatusIndicatorCoordinator.java | 9 ++ @@ -73,12 +74,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../ui/appmenu/AppMenuHandlerImpl.java | 10 ++ .../EdgeToEdgeControllerImpl.java | 1 + .../ui/edge_to_edge/EdgeToEdgeUtils.java | 2 + - ...rredIMEWindowInsetApplicationCallback.java | 7 + + ...rredIMEWindowInsetApplicationCallback.java | 17 ++ .../omnibox/LocationBarCoordinator.java | 1 + - ...mniboxSuggestionsDropdownEmbedderImpl.java | 31 ++++ + ...mniboxSuggestionsDropdownEmbedderImpl.java | 32 ++++ .../suggestions/AutocompleteCoordinator.java | 16 ++ .../suggestions/AutocompleteMediator.java | 6 +- - .../OmniboxSuggestionsDropdown.java | 8 + + .../OmniboxSuggestionsDropdown.java | 5 + .../OmniboxSuggestionsDropdownEmbedder.java | 6 + .../base/BaseSuggestionViewBinder.java | 7 + .../strings/android_chrome_strings.grd | 6 + @@ -101,7 +102,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/viz/common/features.cc | 2 + .../render_widget_host_view_android.cc | 3 + .../Move-navigation-bar-to-bottom.inc | 17 ++ - 88 files changed, 1058 insertions(+), 88 deletions(-) + 89 files changed, 1068 insertions(+), 88 deletions(-) create mode 100644 chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/ReversedLinearLayout.java create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Move-navigation-bar-to-bottom.inc @@ -758,7 +759,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s +import org.chromium.chrome.R; +import android.app.Activity; -+import org.chromium.base.supplier.Supplier; ++import java.util.function.Supplier; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; +import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager; +import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; @@ -1480,6 +1481,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsP if (topMargin != layoutParams.topMargin || bottomMargin != layoutParams.bottomMargin) { layoutParams.topMargin = topMargin; layoutParams.bottomMargin = bottomMargin; +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java +@@ -14,6 +14,7 @@ import org.chromium.build.annotations.Nullable; + import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; + import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider.ControlsPosition; + import org.chromium.chrome.browser.ephemeraltab.EphemeralTabCoordinator; ++import org.chromium.chrome.browser.flags.ChromeFeatureList; + import org.chromium.chrome.browser.fullscreen.BrowserControlsManagerSupplier; + import org.chromium.chrome.browser.merchant_viewer.PageInfoStoreInfoController.StoreInfoActionHandler; + import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; +@@ -77,6 +78,7 @@ public class ChromePageInfo { + if (stateProvider != null) { + dialogPosition = + stateProvider.getControlsPosition() == ControlsPosition.BOTTOM ++ || ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled() + ? Gravity.BOTTOM + : Gravity.TOP; + } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java @@ -2345,7 +2365,7 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow @Override public void onPrepare(WindowInsetsAnimationCompat animation) { if ((animation.getTypeMask() & WindowInsetsCompat.Type.ime()) == 0) return; -@@ -121,11 +126,13 @@ public class DeferredIMEWindowInsetApplicationCallback +@@ -121,11 +126,14 @@ public class DeferredIMEWindowInsetApplicationCallback public WindowInsetsCompat onApplyWindowInsets( View view, WindowInsetsCompat windowInsetsCompat) { int newKeyboardHeight = 0; @@ -2355,10 +2375,27 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow Insets systemBarInsets = windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemBars()); newKeyboardHeight = imeInsets.bottom - systemBarInsets.bottom; -+ mSystemBarInsetsBottom = systemBarInsets.bottom; ++ if (!hasTappableNavigationBarFromInsets(windowInsetsCompat)) ++ mSystemBarInsetsBottom = systemBarInsets.bottom; // Since the ime insets are greater than 0, the keyboard is showing, but its height is // being suppressed in that this class deliberately wants to avoid application resizing. +@@ -173,6 +181,15 @@ public class DeferredIMEWindowInsetApplicationCallback + return builder.build(); + } + ++ static boolean hasTappableNavigationBarFromInsets(WindowInsetsCompat insets) { ++ Insets navigationBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars()); ++ Insets tappableElementInsets = insets.getInsets(WindowInsetsCompat.Type.tappableElement()); ++ // Return whether there is any overlap in navigation bar and tappable element insets. ++ return (navigationBarInsets.bottom > 0 && tappableElementInsets.bottom > 0) ++ || (navigationBarInsets.left > 0 && tappableElementInsets.left > 0) ++ || (navigationBarInsets.right > 0 && tappableElementInsets.right > 0); ++ } ++ + private void commitKeyboardHeight(int newKeyboardHeight) { + mKeyboardHeight = newKeyboardHeight; + mDeferredKeyboardHeight = NO_DEFERRED_KEYBOARD_HEIGHT; 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 @@ -2446,7 +2483,7 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow } if (isTablet()) { -@@ -311,6 +328,12 @@ class OmniboxSuggestionsDropdownEmbedderImpl +@@ -311,6 +328,13 @@ class OmniboxSuggestionsDropdownEmbedderImpl height = Math.min(windowSpace, contentSpace) - top; } @@ -2454,12 +2491,13 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow + ViewCompat.setPaddingRelative( + contentView, 0, 0, 0, keyboardHeight + mSystemBarInsetsBottomSupplier.get()); + top = 0; ++ height -= mSystemBarInsetsBottomSupplier.get(); + } + // TODO(pnoland@, https://crbug.com/1416985): avoid pushing changes that are identical to // the previous alignment value. OmniboxAlignment omniboxAlignment = -@@ -319,6 +342,14 @@ class OmniboxSuggestionsDropdownEmbedderImpl +@@ -319,6 +343,14 @@ class OmniboxSuggestionsDropdownEmbedderImpl mOmniboxAlignmentSupplier.set(omniboxAlignment); } @@ -2554,17 +2592,7 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdown.java -@@ -37,6 +37,9 @@ import org.chromium.components.omnibox.OmniboxFeatures; - import org.chromium.ui.base.KeyNavigationUtil; - import org.chromium.ui.util.MotionEventUtils; - -+import android.graphics.Rect; -+import org.chromium.chrome.browser.flags.ChromeFeatureList; -+ - /** A widget for showing a list of omnibox suggestions. */ - @NullMarked - public class OmniboxSuggestionsDropdown extends RecyclerView { -@@ -292,6 +295,9 @@ public class OmniboxSuggestionsDropdown extends RecyclerView { +@@ -292,6 +292,9 @@ public class OmniboxSuggestionsDropdown extends RecyclerView { resources.getDimensionPixelOffset(R.dimen.omnibox_suggestion_list_padding_bottom); int paddingTop = resources.getDimensionPixelOffset(R.dimen.omnibox_suggestion_list_padding_top); @@ -2574,15 +2602,15 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow this.setPaddingRelative(0, paddingTop, 0, mBaseBottomPadding); if (OmniboxFeatures.sAsyncViewInflation.isEnabled()) { -@@ -509,6 +515,8 @@ public class OmniboxSuggestionsDropdown extends RecyclerView { - } - - void setToolbarPosition(@ControlsPosition int toolbarPosition) { -+ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) -+ toolbarPosition = ControlsPosition.BOTTOM; +@@ -512,6 +515,8 @@ public class OmniboxSuggestionsDropdown extends RecyclerView { mToolbarOnTop = !(ChromeFeatureList.sAndroidBottomToolbarV2ReverseOrderSuggestionsList.getValue() && toolbarPosition == ControlsPosition.BOTTOM); ++ if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) ++ mToolbarOnTop = false; + mLayoutScrollListener.setToolbarPosition(mToolbarOnTop); + + var params = (FrameLayout.LayoutParams) getLayoutParams(); diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdownEmbedder.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdownEmbedder.java --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdownEmbedder.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionsDropdownEmbedder.java diff --git a/build/patches/Partition-Blink-memory-cache.patch b/build/patches/Partition-Blink-memory-cache.patch index c741cf61..ce720db3 100644 --- a/build/patches/Partition-Blink-memory-cache.patch +++ b/build/patches/Partition-Blink-memory-cache.patch @@ -20,9 +20,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../renderer/core/loader/image_loader.cc | 3 +- .../platform/loader/fetch/memory_cache.cc | 8 +-- .../platform/loader/fetch/memory_cache.h | 5 +- - .../platform/loader/fetch/resource_fetcher.cc | 57 ++++++++++++++++--- - .../platform/loader/fetch/resource_fetcher.h | 7 ++- - 8 files changed, 64 insertions(+), 23 deletions(-) + .../platform/loader/fetch/resource_fetcher.cc | 62 +++++++++++++++---- + .../platform/loader/fetch/resource_fetcher.h | 10 ++- + .../platform/runtime_enabled_features.json5 | 2 +- + 9 files changed, 70 insertions(+), 27 deletions(-) diff --git a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc b/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc --- a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc @@ -210,7 +211,7 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.c } // Requests that can be satisfied via `archive_` (i.e. MHTML) or -@@ -2942,7 +2981,7 @@ String ResourceFetcher::GetCacheIdentifier(const KURL& url, +@@ -2942,12 +2981,13 @@ String ResourceFetcher::GetCacheIdentifier(const KURL& url, return bundle->GetCacheIdentifier(); } @@ -219,10 +220,26 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.c } String ResourceFetcher::GetCacheIdentifier(ResourceType type, + const KURL& url, +- bool skip_service_worker) const { ++ bool skip_service_worker, ++ const ResourceRequest& resource_request) const { + // For SVG resource documents, use the SVG-specific cache identifier when the + // feature is enabled and a cache identifier is available from the fetch + // context. +@@ -2960,7 +3000,7 @@ String ResourceFetcher::GetCacheIdentifier(ResourceType type, + } + + // Fallback to the standard cache identifier logic. +- return GetCacheIdentifier(url, skip_service_worker); ++ return GetCacheIdentifier(url, skip_service_worker, resource_request); + } + + std::optional diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h -@@ -287,7 +287,12 @@ class PLATFORM_EXPORT ResourceFetcher +@@ -287,10 +287,16 @@ class PLATFORM_EXPORT ResourceFetcher // `url` is used for finding a matching WebBundle. // If `skip_service_worker` is true, the identifier won't be a ServiceWorker's // identifier to keep the cache separated. @@ -235,5 +252,22 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h + const String origin_url) const; String GetCacheIdentifier(ResourceType type, const KURL& url, - bool skip_service_worker) const; +- bool skip_service_worker) const; ++ bool skip_service_worker, ++ const ResourceRequest& resource_request) const; + + // If `url` exists as a resource in a subresource bundle in this frame, + // returns its UnguessableToken; otherwise, returns std::nullopt. +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 +@@ -4886,7 +4886,7 @@ + }, + { + name: "SvgPartitionSVGDocumentResourcesInMemoryCache", +- status: "stable", ++ status: "experimental", + }, + { + name: "SvgScriptElementAsyncAttribute", -- diff --git a/build/patches/Partition-MediaDeviceId-by-default.patch b/build/patches/Partition-MediaDeviceId-by-default.patch index 27c21387..0ad2f1d8 100644 --- a/build/patches/Partition-MediaDeviceId-by-default.patch +++ b/build/patches/Partition-MediaDeviceId-by-default.patch @@ -5,24 +5,23 @@ Subject: Partition MediaDeviceId by default and, in windows, hide the presence of the webcam if the user has not given permission License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - .../core/browser/bromite_content_settings/camera.inc | 8 ++++++++ - components/media_device_salt/media_device_salt_service.cc | 2 ++ - content/browser/media/media_devices_util.cc | 3 +++ - .../browser/renderer_host/media/media_devices_manager.cc | 5 +++++ - 4 files changed, 18 insertions(+) + .../core/browser/bromite_content_settings/camera.inc | 7 +++++++ + components/media_device_salt/media_device_salt_service.cc | 2 ++ + content/browser/media/media_devices_util.cc | 3 +++ + .../browser/renderer_host/media/media_devices_manager.cc | 5 +++++ + 4 files changed, 17 insertions(+) create mode 100644 components/content_settings/core/browser/bromite_content_settings/camera.inc diff --git a/components/content_settings/core/browser/bromite_content_settings/camera.inc b/components/content_settings/core/browser/bromite_content_settings/camera.inc new file mode 100644 --- /dev/null +++ b/components/content_settings/core/browser/bromite_content_settings/camera.inc -@@ -0,0 +1,8 @@ +@@ -0,0 +1,7 @@ +#if !BUILDFLAG(IS_ANDROID) + + content_settings::WebsiteSettingsRegistry::GetInstance() + ->GetMutable(ContentSettingsType::MEDIASTREAM_CAMERA) -+ ->set_show_into_info_page() -+ .set_desktop_ui(); ++ ->set_show_into_info_page(); + +#endif diff --git a/components/media_device_salt/media_device_salt_service.cc b/components/media_device_salt/media_device_salt_service.cc diff --git a/build/patches/Remove-help-menu-item.patch b/build/patches/Remove-help-menu-item.patch index f12c96e0..cdaa261d 100644 --- a/build/patches/Remove-help-menu-item.patch +++ b/build/patches/Remove-help-menu-item.patch @@ -217,7 +217,7 @@ diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages. // shown in the last active browser. If there is no such browser, a new browser // is created. void ShowHelpImpl(Browser* browser, Profile* profile, HelpSource source) { -+ if (source == chrome::HELP_SOURCE_WEBUI) { ++ if (source == HelpSource::kWebUI) { + GURL url = GURL("https://github.com/uazo/cromite/issues"); + if (browser) { + ShowSingletonTab(browser, url); diff --git a/build/patches/Restore-Simplified-NTP-launch.patch b/build/patches/Restore-Simplified-NTP-launch.patch index f2389ebd..4d4aa72c 100644 --- a/build/patches/Restore-Simplified-NTP-launch.patch +++ b/build/patches/Restore-Simplified-NTP-launch.patch @@ -28,14 +28,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../native_page/NativePageFactory.java | 20 +- .../NativePageNavigationDelegateImpl.java | 2 +- .../chrome/browser/ntp/NewTabPage.java | 8 +- - .../chrome/browser/ntp/NewTabPageLayout.java | 28 +- + .../chrome/browser/ntp/NewTabPageLayout.java | 33 +- .../suggestions/SuggestionsConfig.java | 2 +- .../SuggestionsNavigationDelegate.java | 27 +- .../tile/MostVisitedTilesCoordinator.java | 6 +- .../tile/MostVisitedTilesGridLayout.java | 287 ++++++++++++++++++ .../tile/MostVisitedTilesMediator.java | 8 +- .../tile/TileDragDelegateImpl.java | 16 +- - .../suggestions/tile/TileRenderer.java | 8 +- + .../suggestions/tile/TileRenderer.java | 12 +- .../suggestions/tile/TilesLinearLayout.java | 2 +- .../engagement/important_sites_util.cc | 2 +- .../flags/android/chrome_feature_list.cc | 1 + @@ -44,10 +44,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../strings/android_chrome_strings.grd | 6 + .../core/browser/top_sites_constants.h | 2 +- components/ntp_tiles/custom_links_store.cc | 2 - + components/omnibox/common/omnibox_features.cc | 2 + + components/search_engines/template_url.h | 4 +- .../Restore-Simplified-NTP-launch.inc | 12 + .../Restore-Simplified-NTP-launch.inc | 10 + .../Restore-Simplified-NTP-launch.inc | 1 + - 41 files changed, 639 insertions(+), 55 deletions(-) + 43 files changed, 648 insertions(+), 61 deletions(-) create mode 100644 chrome/android/java/res/drawable-hdpi/ic_most_visited_placeholder.png create mode 100644 chrome/android/java/res/drawable-mdpi/ic_most_visited_placeholder.png create mode 100644 chrome/android/java/res/drawable-xhdpi/ic_most_visited_placeholder.png @@ -893,6 +895,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageL private boolean mSearchProviderIsGoogle; private boolean mShowingNonStandardGoogleLogo; private boolean mIsOmniboxMobileParityUpdateV2Enabled; +@@ -124,7 +129,7 @@ public class NewTabPageLayout extends LinearLayout + private boolean mInitialized; + + private float mUrlFocusChangePercent; +- private boolean mDisableUrlFocusChangeAnimations; ++ private boolean mDisableUrlFocusChangeAnimations = true; + private boolean mIsViewMoving; + + /** Flag used to request some layout changes after the next layout pass is completed. */ @@ -299,6 +304,7 @@ public class NewTabPageLayout extends LinearLayout initializeMostVisitedTilesCoordinator( mProfile, lifecycleDispatcher, tileGroupDelegate, touchEnabledDelegate); @@ -901,15 +912,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageL initializeSearchBoxTextView(); initializeVoiceSearchButton(); initializeLensButton(); -@@ -686,7 +692,7 @@ public class NewTabPageLayout extends LinearLayout +@@ -686,8 +692,8 @@ public class NewTabPageLayout extends LinearLayout private void calculateTabletMvtWidth(int totalWidth) { if (mMvTilesContainerLayout.getVisibility() == GONE) return; - MostVisitedTilesLayout mvTilesLayout = findViewById(R.id.mv_tiles_layout); +- mMvtContentFits = mvTilesLayout.contentFitsOnTablet(totalWidth); + MostVisitedTilesGridLayout mvTilesLayout = findViewById(R.id.mv_tiles_layout); - mMvtContentFits = mvTilesLayout.contentFitsOnTablet(totalWidth); ++ mMvtContentFits = false; updateMvtOnTablet(); } + @@ -737,7 +743,7 @@ public class NewTabPageLayout extends LinearLayout && mInitialized) { return; @@ -919,7 +932,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageL mSearchProviderIsGoogle = isGoogle; if (!mSearchProviderIsGoogle) { -@@ -1188,6 +1194,22 @@ public class NewTabPageLayout extends LinearLayout +@@ -786,6 +792,7 @@ public class NewTabPageLayout extends LinearLayout + * @param disable Whether to disable the animations. + */ + void setUrlFocusAnimationsDisabled(boolean disable) { ++ disable = true; + if (disable == mDisableUrlFocusChangeAnimations) return; + mDisableUrlFocusChangeAnimations = disable; + if (!disable) onUrlFocusAnimationChanged(); +@@ -1188,6 +1195,22 @@ public class NewTabPageLayout extends LinearLayout return mMostVisitedTilesCoordinator; } @@ -1422,6 +1443,24 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/til TileGroup.TileSetupDelegate setupDelegate) { try (TraceEvent e = TraceEvent.scoped("TileRenderer.renderTileSection")) { // Map the old tile views by url so they can be reused later. +@@ -212,7 +212,7 @@ public class TileRenderer { + if (prevTile != null + && (prevTile.getData().source == TileSource.CUSTOM_LINKS) + != (tile.getData().source == TileSource.CUSTOM_LINKS)) { +- parent.addDivider(buildDivider(parent)); ++ //parent.addDivider(buildDivider(parent)); + } + parent.addTile(tileView); + if (focusedUrl != null && focusedUrl.equals(tile.getUrl().getSpec())) { +@@ -228,7 +228,7 @@ public class TileRenderer { + + if (shouldShowAddNewButton(sectionTiles)) { + TileView addCustomLinksButton = buildAddCustomLinksButton(parent, setupDelegate); +- parent.addUiView(addCustomLinksButton, mTileWidth); ++ //parent.addUiView(addCustomLinksButton, mTileWidth); + } + } + } @@ -263,7 +263,7 @@ public class TileRenderer { */ @VisibleForTesting @@ -1555,6 +1594,40 @@ diff --git a/components/ntp_tiles/custom_links_store.cc b/components/ntp_tiles/c } return links; +diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc +--- a/components/omnibox/common/omnibox_features.cc ++++ b/components/omnibox/common/omnibox_features.cc +@@ -206,6 +206,7 @@ BASE_FEATURE(kRemoveSearchReadyOmnibox, DISABLED); + BASE_FEATURE(kDefaultTypedNavigationsToHttps, + "OmniboxDefaultTypedNavigationsToHttps", + enable_if(IS_IOS)); ++SET_CROMITE_FEATURE_ENABLED(kDefaultTypedNavigationsToHttps); + + // Override the delay to create a spare renderer when the omnibox is focused + // on Android. +@@ -292,6 +293,7 @@ BASE_FEATURE(kOmniboxMobileParityUpdate, ENABLED); + // Updates various NTP/Omnibox assets and descriptions for visual alignment on + // Android and iOS, V2. + BASE_FEATURE(kOmniboxMobileParityUpdateV2, ENABLED); ++SET_CROMITE_FEATURE_DISABLED(kOmniboxMobileParityUpdateV2); + + #if BUILDFLAG(IS_IOS) + // Updates the search engine logo on NTP. iOS only. +diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h +--- a/components/search_engines/template_url.h ++++ b/components/search_engines/template_url.h +@@ -802,9 +802,9 @@ class TemplateURL { + } + const GURL& favicon_url() const { return data().favicon_url; } + +- const GURL& logo_url() const { return data().logo_url; } ++ const GURL logo_url() const { return GURL(); } + +- const GURL& doodle_url() const { return data().doodle_url; } ++ const GURL doodle_url() const { return GURL(); } + + const GURL& originating_url() const { return data().originating_url; } + diff --git a/cromite_flags/chrome/browser/about_flags_cc/Restore-Simplified-NTP-launch.inc b/cromite_flags/chrome/browser/about_flags_cc/Restore-Simplified-NTP-launch.inc new file mode 100644 --- /dev/null diff --git a/build/patches/Restore-chrome-password-store.patch b/build/patches/Restore-chrome-password-store.patch index 829f79e2..0689054d 100644 --- a/build/patches/Restore-chrome-password-store.patch +++ b/build/patches/Restore-chrome-password-store.patch @@ -64,6 +64,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../android/password_ui_view_android.cc | 449 +++++++++++ .../android/password_ui_view_android.h | 196 +++++ .../android/pwm_disabled/BUILD.gn | 2 - + .../password_store_backend_factory.cc | 14 +- ...ssword_manager_settings_service_factory.cc | 4 +- .../strings/android_chrome_strings.grd | 123 +++- .../Import-Password-Android.grdp | 9 + @@ -71,9 +72,18 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../settings/SettingsNavigation.java | 3 + .../password_manager_features_util.cc | 1 + .../core/browser/import/password_importer.cc | 11 + + .../core/browser/password_manager.cc | 2 - + .../browser/password_manager_constants.cc | 2 - + .../core/browser/password_manager_constants.h | 2 - + .../core/browser/password_store/BUILD.gn | 13 + + .../password_store/login_database_posix.cc | 4 +- + .../password_store_built_in_backend.cc | 6 + + .../browser/password_store_factory_util.cc | 6 - + .../browser/password_store_factory_util.h | 4 - + .../core/common/password_manager_pref_names.h | 2 - components/sync/service/sync_prefs.cc | 2 +- .../Restore-chrome-password-store.inc | 1 + - 65 files changed, 5509 insertions(+), 36 deletions(-) + 75 files changed, 5536 insertions(+), 64 deletions(-) create mode 100644 chrome/android/java/res/layout/password_no_result.xml create mode 100644 chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java @@ -5928,6 +5938,47 @@ diff --git a/chrome/browser/password_manager/android/pwm_disabled/BUILD.gn b/chr "java/src/org/chromium/chrome/browser/pwm_disabled/PwmDeprecationDialogsMetricsRecorder.java", "java/src/org/chromium/chrome/browser/pwm_disabled/SingleThreadBarrierClosure.java", "java/src/org/chromium/chrome/browser/pwm_disabled/TimedCallbackDelayer.java", +diff --git a/chrome/browser/password_manager/factories/password_store_backend_factory.cc b/chrome/browser/password_manager/factories/password_store_backend_factory.cc +--- a/chrome/browser/password_manager/factories/password_store_backend_factory.cc ++++ b/chrome/browser/password_manager/factories/password_store_backend_factory.cc +@@ -17,6 +17,8 @@ + #include "chrome/browser/password_manager/android/password_store_android_account_backend.h" + #include "chrome/browser/password_manager/android/password_store_android_local_backend.h" + #include "chrome/browser/password_manager/android/password_store_empty_backend.h" ++#include "components/password_manager/core/browser/password_store/login_database.h" ++#include "components/password_manager/core/browser/password_store/password_store_built_in_backend.h" + #else // BUILDFLAG(IS_ANDROID) + #include "components/password_manager/core/browser/password_store/login_database.h" + #include "components/password_manager/core/browser/password_store/password_store_built_in_backend.h" +@@ -53,24 +55,20 @@ CreatePasswordStoreBackend(password_manager::IsAccountStore is_account_store, + + #if BUILDFLAG(IS_ANDROID) + using password_manager_android_util::PasswordManagerUtilBridge; +- if (!password_manager_android_util::IsPasswordManagerAvailable( +- std::make_unique())) { +- return std::make_unique(); +- } + if (is_account_store) { + return std::make_unique< +- password_manager::PasswordStoreAndroidAccountBackend>(); ++ password_manager::PasswordStoreEmptyBackend>(); + } +- return std::make_unique(); +-#else // BUILDFLAG(IS_ANDROID) ++#endif // BUILDFLAG(IS_ANDROID) + std::unique_ptr login_db( + password_manager::CreateLoginDatabase(is_account_store, + login_db_directory, prefs)); ++#if !BUILDFLAG(IS_ANDROID) + SetIsUserDataDirPolicySet(login_db.get()); ++#endif + auto behavior = is_account_store + ? syncer::WipeModelUponSyncDisabledBehavior::kAlways + : syncer::WipeModelUponSyncDisabledBehavior::kNever; + return std::make_unique( + std::move(login_db), behavior, prefs, os_crypt_async); +-#endif // BUILDFLAG(IS_ANDROID) + } diff --git a/chrome/browser/password_manager/password_manager_settings_service_factory.cc b/chrome/browser/password_manager/password_manager_settings_service_factory.cc --- a/chrome/browser/password_manager/password_manager_settings_service_factory.cc +++ b/chrome/browser/password_manager/password_manager_settings_service_factory.cc @@ -6159,6 +6210,217 @@ diff --git a/components/password_manager/core/browser/import/password_importer.c std::optional file_size = base::GetFileSize(path); if (file_size.has_value()) { +diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc +--- a/components/password_manager/core/browser/password_manager.cc ++++ b/components/password_manager/core/browser/password_manager.cc +@@ -598,9 +598,7 @@ void PasswordManager::RegisterProfilePrefs( + registry->RegisterIntegerPref(prefs::kTotalPasswordsAvailableForProfile, 0); + registry->RegisterIntegerPref(prefs::kPasswordRemovalReasonForAccount, 0); + registry->RegisterIntegerPref(prefs::kPasswordRemovalReasonForProfile, 0); +-#if !BUILDFLAG(IS_ANDROID) + registry->RegisterBooleanPref(prefs::kClearingUndecryptablePasswords, false); +-#endif + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_IOS) +diff --git a/components/password_manager/core/browser/password_manager_constants.cc b/components/password_manager/core/browser/password_manager_constants.cc +--- a/components/password_manager/core/browser/password_manager_constants.cc ++++ b/components/password_manager/core/browser/password_manager_constants.cc +@@ -8,7 +8,6 @@ + + namespace password_manager { + +-#if !BUILDFLAG(IS_ANDROID) + const base::FilePath::CharType kLoginDataForProfileFileName[] = + FILE_PATH_LITERAL("Login Data"); + const base::FilePath::CharType kLoginDataForAccountFileName[] = +@@ -17,7 +16,6 @@ const base::FilePath::CharType kLoginDataJournalForProfileFileName[] = + FILE_PATH_LITERAL("Login Data-journal"); + const base::FilePath::CharType kLoginDataJournalForAccountFileName[] = + FILE_PATH_LITERAL("Login Data For Account-journal"); +-#endif // !BUILDFLAG(IS_ANDROID) + + const char kPasswordManagerAccountDashboardURL[] = + "https://passwords.google.com"; +diff --git a/components/password_manager/core/browser/password_manager_constants.h b/components/password_manager/core/browser/password_manager_constants.h +--- a/components/password_manager/core/browser/password_manager_constants.h ++++ b/components/password_manager/core/browser/password_manager_constants.h +@@ -11,12 +11,10 @@ + + namespace password_manager { + +-#if !BUILDFLAG(IS_ANDROID) + extern const base::FilePath::CharType kLoginDataForProfileFileName[]; + extern const base::FilePath::CharType kLoginDataForAccountFileName[]; + extern const base::FilePath::CharType kLoginDataJournalForProfileFileName[]; + extern const base::FilePath::CharType kLoginDataJournalForAccountFileName[]; +-#endif // !BUILDFLAG(IS_ANDROID) + + // URL to the password manager account dashboard. + extern const char kPasswordManagerAccountDashboardURL[]; +diff --git a/components/password_manager/core/browser/password_store/BUILD.gn b/components/password_manager/core/browser/password_store/BUILD.gn +--- a/components/password_manager/core/browser/password_store/BUILD.gn ++++ b/components/password_manager/core/browser/password_store/BUILD.gn +@@ -75,6 +75,19 @@ source_set("password_store_impl") { + "android_backend_error.h", + "password_data_type_controller_delegate_android.cc", + "password_data_type_controller_delegate_android.h", ++ "insecure_credentials_table.cc", ++ "insecure_credentials_table.h", ++ "login_database.cc", ++ "login_database.h", ++ "login_database_async_helper.cc", ++ "login_database_async_helper.h", ++ "password_notes_table.cc", ++ "password_notes_table.h", ++ "password_store_built_in_backend.cc", ++ "password_store_built_in_backend.h", ++ "statistics_table.cc", ++ "statistics_table.h", ++ "login_database_posix.cc", + ] + deps += [ + "//components/sync/base", +diff --git a/components/password_manager/core/browser/password_store/login_database_posix.cc b/components/password_manager/core/browser/password_store/login_database_posix.cc +--- a/components/password_manager/core/browser/password_store/login_database_posix.cc ++++ b/components/password_manager/core/browser/password_store/login_database_posix.cc +@@ -44,7 +44,7 @@ EncryptionResult LoginDatabase::DecryptedString( + const std::string& cipher_text, + std::u16string* plain_text) const { + #if !BUILDFLAG(IS_FUCHSIA) +-#if BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) + // On ChromeOS, we have a mix of obfuscated and plain-text + // passwords. Obfuscated passwords always start with "v10", therefore anything + // else is plain-text. +@@ -66,7 +66,7 @@ EncryptionResult LoginDatabase::DecryptedString( + bool decryption_success = + encryptor_ ? encryptor_->DecryptString16(cipher_text, plain_text) + : OSCrypt::DecryptString16(cipher_text, plain_text); +-#if BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS) + // If decryption failed, we assume it was because the value was actually a + // plain-text password which started with "v10". + // TODO(crbug.com/41457193): Remove this when there isn't a mix of plain-text +diff --git a/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc b/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc +--- a/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc ++++ b/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc +@@ -154,6 +154,7 @@ void PasswordStoreBuiltInBackend::InitBackend( + DCHECK(helper_); + affiliated_match_helper_ = affiliated_match_helper; + ++#if !BUILDFLAG(IS_ANDROID) + // To ensure that groups of the kClearUndecryptablePasswords will stay + // balanced, after the cleanup is done an additional flag check is needed. + // Users won't reach the flag the normal way since the LoginDB is working +@@ -162,6 +163,7 @@ void PasswordStoreBuiltInBackend::InitBackend( + if (pref_service_->GetBoolean(prefs::kClearingUndecryptablePasswords)) { + base::FeatureList::IsEnabled(features::kClearUndecryptablePasswords); + } ++#endif + + background_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&LoginDatabaseAsyncHelper::CreateSyncBackend, +@@ -450,11 +452,15 @@ void PasswordStoreBuiltInBackend::OnEncryptorReceived( + weak_ptr_factory_.GetWeakPtr())) + .Then(std::move(remote_form_changes_received)); + ++#if BUILDFLAG(IS_ANDROID) ++ auto on_undecryptable_passwords_removed = base::DoNothing(); ++#else + auto on_undecryptable_passwords_removed = + base::BindPostTaskToCurrentDefault(base::BindRepeating( + &PasswordStoreBuiltInBackend:: + SetClearingUndecryptablePasswordsIsEnabledPref, + weak_ptr_factory_.GetWeakPtr())); ++#endif + + background_task_runner_->PostTaskAndReplyWithResult( + FROM_HERE, +diff --git a/components/password_manager/core/browser/password_store_factory_util.cc b/components/password_manager/core/browser/password_store_factory_util.cc +--- a/components/password_manager/core/browser/password_store_factory_util.cc ++++ b/components/password_manager/core/browser/password_store_factory_util.cc +@@ -21,15 +21,12 @@ + #include "components/password_manager/core/common/password_manager_pref_names.h" + #include "components/prefs/pref_service.h" + +-#if !BUILDFLAG(IS_ANDROID) + #include "components/password_manager/core/browser/password_store/login_database.h" +-#endif // !BUILDFLAG(IS_ANDROID) + + namespace password_manager { + + namespace { + +-#if !BUILDFLAG(IS_ANDROID) + LoginDatabase::DeletingUndecryptablePasswordsEnabled GetPolicyFromPrefs( + PrefService* prefs) { + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ +@@ -40,11 +37,9 @@ LoginDatabase::DeletingUndecryptablePasswordsEnabled GetPolicyFromPrefs( + return LoginDatabase::DeletingUndecryptablePasswordsEnabled(true); + #endif + } +-#endif // !BUILDFLAG(IS_ANDROID) + + } // namespace + +-#if !BUILDFLAG(IS_ANDROID) + std::unique_ptr CreateLoginDatabase( + password_manager::IsAccountStore is_account_store, + const base::FilePath& db_directory, +@@ -55,7 +50,6 @@ std::unique_ptr CreateLoginDatabase( + return std::make_unique(login_db_file_path, is_account_store, + GetPolicyFromPrefs(prefs)); + } +-#endif // !BUILDFLAG(IS_ANDROID) + + // TODO(http://crbug.com/890318): Add unitests to check cleaners are correctly + // created. +diff --git a/components/password_manager/core/browser/password_store_factory_util.h b/components/password_manager/core/browser/password_store_factory_util.h +--- a/components/password_manager/core/browser/password_store_factory_util.h ++++ b/components/password_manager/core/browser/password_store_factory_util.h +@@ -13,9 +13,7 @@ + #include "build/build_config.h" + #include "components/password_manager/core/browser/password_store/password_store_interface.h" + +-#if !BUILDFLAG(IS_ANDROID) + #include "components/password_manager/core/browser/password_store/login_database.h" +-#endif // !BUILDFLAG(IS_ANDROID) + + namespace network::mojom { + class NetworkContext; +@@ -27,7 +25,6 @@ namespace password_manager { + + class CredentialsCleanerRunner; + +-#if !BUILDFLAG(IS_ANDROID) + // Creates a LoginDatabase. Looks in |db_directory| for the database file. + // Does not call LoginDatabase::Init() -- to avoid UI jank, that needs to be + // called by PasswordStore::Init() on the background thread. +@@ -35,7 +32,6 @@ std::unique_ptr CreateLoginDatabase( + password_manager::IsAccountStore is_account_store, + const base::FilePath& db_directory, + PrefService* prefs); +-#endif // !BUILDFLAG(IS_ANDROID) + + // This function handles the following clean-ups of credentials: + // (1) Removing blocklisted duplicates: if two blocklisted credentials have the +diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h +--- a/components/password_manager/core/common/password_manager_pref_names.h ++++ b/components/password_manager/core/common/password_manager_pref_names.h +@@ -259,12 +259,10 @@ inline constexpr char kRelaunchChromeBubbleDismissedCounter[] = + "password_manager.relaunch_chrome_bubble_dismissed_counter"; + #endif + +-#if !BUILDFLAG(IS_ANDROID) + // Boolean pref indicating if the user is in one of the groups of the + // kClearUndecryptablePasswords experiment. + inline constexpr char kClearingUndecryptablePasswords[] = + "password_manager.clearing_undecryptable_passwords"; +-#endif + + // Boolean pref indicating if passwords were migrated to OSCryptAsync. Two for + // each store. diff --git a/components/sync/service/sync_prefs.cc b/components/sync/service/sync_prefs.cc --- a/components/sync/service/sync_prefs.cc +++ b/components/sync/service/sync_prefs.cc diff --git a/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch b/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch index 2d432a2c..b831b2ed 100644 --- a/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch +++ b/build/patches/Set-the-screen-frame-rate-to-60-Hz.patch @@ -36,7 +36,7 @@ diff --git a/cc/base/features.cc b/cc/base/features.cc BASE_FEATURE(kInitImageDecodeLastUseTime, base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kThrottleMainFrameTo60Hz, base::FEATURE_DISABLED_BY_DEFAULT); -+CROMITE_FEATURE(kThrottleMainFrameTo60Hz, base::FEATURE_ENABLED_BY_DEFAULT); ++CROMITE_FEATURE(kThrottleMainFrameTo60Hz, "ThrottleMainFrameTo60Hz", base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kBoostFrameRateForUrgentMainFrame, base::FEATURE_DISABLED_BY_DEFAULT); diff --git a/build/patches/Site-setting-for-images.patch b/build/patches/Site-setting-for-images.patch index 56c17e3d..59bd1277 100644 --- a/build/patches/Site-setting-for-images.patch +++ b/build/patches/Site-setting-for-images.patch @@ -504,7 +504,7 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h FetchContext& Context() const; void ClearContext(); -@@ -711,6 +712,7 @@ class PLATFORM_EXPORT ResourceFetcher +@@ -712,6 +713,7 @@ class PLATFORM_EXPORT ResourceFetcher bool is_in_request_resource_ = false; bool auto_load_images_ : 1; diff --git a/build/patches/Use-list-mode-for-tab-switcher.patch b/build/patches/Use-list-mode-for-tab-switcher.patch index a48605a8..f1718a26 100644 --- a/build/patches/Use-list-mode-for-tab-switcher.patch +++ b/build/patches/Use-list-mode-for-tab-switcher.patch @@ -213,7 +213,7 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser import org.chromium.chrome.browser.tabmodel.TabClosingSource; import org.chromium.chrome.browser.tabmodel.TabClosureParamsUtils; import org.chromium.chrome.browser.tabmodel.TabGroupModelFilter; -@@ -907,6 +908,13 @@ public class TabGridDialogMediator +@@ -908,6 +909,13 @@ public class TabGridDialogMediator TabGridDialogProperties.DIALOG_UNGROUP_BAR_HOVERED_TEXT_COLOR, ungroupBarHoveredTextColor); mModel.set(TabGridDialogProperties.IS_INCOGNITO, isIncognito); diff --git a/build/patches/eyeo-133.0.6943.49-android_api.patch b/build/patches/eyeo-133.0.6943.49-android_api.patch index cbe7a805..f9c9399a 100644 --- a/build/patches/eyeo-133.0.6943.49-android_api.patch +++ b/build/patches/eyeo-133.0.6943.49-android_api.patch @@ -13,7 +13,7 @@ Pre-requisites: eyeo Browser Ad filtering Solution: Base Module .../android/adblock/tab_id_translator_jni.cc | 41 ++ chrome/browser/ui/BUILD.gn | 6 + components/adblock/android/BUILD.gn | 107 ++++ - .../adblock/android/adblock_controller_jni.cc | 132 +++++ + .../adblock/android/adblock_controller_jni.cc | 133 +++++ .../filtering_configuration_android.cc | 244 ++++++++ .../android/filtering_configuration_android.h | 94 +++ .../components/adblock/AdblockController.java | 283 +++++++++ @@ -46,7 +46,7 @@ Pre-requisites: eyeo Browser Ad filtering Solution: Base Module .../adblock/TestVerificationUtils.java | 220 +++++++ ...esource_classification_notifier_android.cc | 163 +++++ ...resource_classification_notifier_android.h | 72 +++ - 40 files changed, 5609 insertions(+) + 40 files changed, 5610 insertions(+) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/adblock/TabIdTranslator.java create mode 100644 chrome/browser/android/adblock/tab_id_translator_jni.cc create mode 100644 components/adblock/android/BUILD.gn @@ -396,7 +396,7 @@ diff --git a/components/adblock/android/adblock_controller_jni.cc b/components/a new file mode 100644 --- /dev/null +++ b/components/adblock/android/adblock_controller_jni.cc -@@ -0,0 +1,132 @@ +@@ -0,0 +1,133 @@ +/* + * This file is part of eyeo Chromium SDK, + * Copyright (C) 2006-present eyeo GmbH @@ -449,7 +449,8 @@ new file mode 100644 + const std::string& version, + const std::vector& languages, + const bool autoinstalled) { -+ ScopedJavaLocalRef url_param( ++ ScopedJavaLocalRef url_param = ++ ScopedJavaLocalRef::Adopt( + env, env->NewObject(url_class.obj(), url_constructor, + ConvertUTF8ToJavaString(env, url).obj())); + CheckException(env); diff --git a/build/patches/eyeo-133.0.6943.49-base.patch b/build/patches/eyeo-133.0.6943.49-base.patch index e37f6c4a..20e6f1c5 100644 --- a/build/patches/eyeo-133.0.6943.49-base.patch +++ b/build/patches/eyeo-133.0.6943.49-base.patch @@ -51039,7 +51039,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b } +void LocalFrameMojoHandler::InsertAbpElemhideStylesheet( -+ const WTF::String& stylesheet) { ++ const String& stylesheet) { + WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(frame_); + DCHECK(web_frame); + web_frame->GetDocument().InsertAbpElemhideStylesheet(stylesheet, nullptr, @@ -51067,7 +51067,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.h b/ void AddMessageToConsole(mojom::blink::ConsoleMessageLevel level, const String& message, bool discard_duplicates) final; -+ void InsertAbpElemhideStylesheet(const WTF::String& stylesheet) final; ++ void InsertAbpElemhideStylesheet(const String& stylesheet) final; void SwapInImmediately() final; void CheckCompleted() final; void StopLoading() final;