diff --git a/build/RELEASE b/build/RELEASE index dc9b3d69c..7e6013850 100644 --- a/build/RELEASE +++ b/build/RELEASE @@ -1 +1 @@ -121.0.6167.164 \ No newline at end of file +122.0.6261.64 \ No newline at end of file diff --git a/build/cromite_patches_list.txt b/build/cromite_patches_list.txt index 2a725e923..2ef0f8048 100644 --- a/build/cromite_patches_list.txt +++ b/build/cromite_patches_list.txt @@ -174,7 +174,6 @@ Partition-blobs-by-top-frame-URL.patch Override-Navigator-Language.patch Disable-add-to-home-screen-prompt.patch Remove-HTTP-referrals-in-cross-origin-navigation.patch -Enable-ECH-by-default.patch Disable-StartSurface-feature.patch Enable-PermuteTLSExtensions-by-default.patch Enable-third-party-storage-partitioning.patch @@ -216,11 +215,9 @@ Remove-ChromiumNetworkAdapter.patch Internal-firewall.patch Disable-devtools-remote-and-custom-protocols.patch Remove-detection-of-captive-portals.patch -Disable-SHA1-Server-Signature.patch Remove-auth-header-upon-cross-origin-redirect.patch Clear-CORS-Preflight-Cache-on-clearing-data.patch Multi-Screen-Window-Placement-API-fix.patch -Remove-https-connection-from-chrome-discards.patch Add-a-flag-to-disable-GamePad-API.patch Disable-WebGPU.patch Disable-FirstPartySets-and-StorageAccessAPI.patch @@ -287,6 +284,8 @@ Temp-disable-predictive-back-gesture.patch TEMP-Add-a-log-to-track-strange-behavior.patch Temp-guard-FileSystemAccessPersistentPermissions.patch Fix-chromium-build-bugs.patch +00Temp-disable-network-service-windows.patch +00Temp-fix-Content-settings-infrastructure.patch eyeo-beta-118.0.5993.48-base.patch eyeo-beta-118.0.5993.48-chrome_integration.patch @@ -296,5 +295,3 @@ eyeo-beta-118.0.5993.48-extension_api.patch Eyeo-Adblock-Remove-Privacy-Issues.patch AdblockPlus-add-blocking-in-service-workers.patch AdblockPlus-connect-popup-blocker.patch - -Temp-FIXUP-Content-settings-infrastructure.patch \ No newline at end of file diff --git a/build/patches/00Temp-disable-network-service-windows.patch b/build/patches/00Temp-disable-network-service-windows.patch new file mode 100644 index 000000000..83ee7f78c --- /dev/null +++ b/build/patches/00Temp-disable-network-service-windows.patch @@ -0,0 +1,20 @@ +From: Your Name +Date: Wed, 21 Feb 2024 09:16:27 +0000 +Subject: Temp disable network service windows + +--- + sandbox/policy/features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sandbox/policy/features.cc b/sandbox/policy/features.cc +--- a/sandbox/policy/features.cc ++++ b/sandbox/policy/features.cc +@@ -217,6 +217,6 @@ SET_CROMITE_FEATURE_ENABLED(kUseRendererProcessPolicy); + SET_CROMITE_FEATURE_ENABLED(kRestrictRendererPoliciesInBaseline); + #endif + #if BUILDFLAG(IS_WIN) +-SET_CROMITE_FEATURE_ENABLED(kNetworkServiceSandbox); ++//SET_CROMITE_FEATURE_ENABLED(kNetworkServiceSandbox); + #endif + } // namespace sandbox::policy::features +-- diff --git a/build/patches/00Temp-fix-Content-settings-infrastructure.patch b/build/patches/00Temp-fix-Content-settings-infrastructure.patch new file mode 100644 index 000000000..e67deb3ec --- /dev/null +++ b/build/patches/00Temp-fix-Content-settings-infrastructure.patch @@ -0,0 +1,23 @@ +From: Your Name +Date: Wed, 21 Feb 2024 09:16:51 +0000 +Subject: Temp fix Content settings infrastructure + +--- + .../content_settings/core/common/content_settings_types.mojom | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/components/content_settings/core/common/content_settings_types.mojom b/components/content_settings/core/common/content_settings_types.mojom +--- a/components/content_settings/core/common/content_settings_types.mojom ++++ b/components/content_settings/core/common/content_settings_types.mojom +@@ -388,6 +388,10 @@ enum ContentSettingsType { + WEB_PRINTING, + + NUM_TYPES_CHROMIUM, ++ TIMEZONE_OVERRIDE, ++ VIEWPORT, ++ WEBGL, ++ WEBRTC, + // #include "components/content_settings/core/common/bromite_content_settings.inc" + NUM_TYPES_BROMITE, + }; +-- diff --git a/build/patches/AImageReader-CFI-crash-mitigations.patch b/build/patches/AImageReader-CFI-crash-mitigations.patch index 86c2a6ffe..80b4d605d 100644 --- a/build/patches/AImageReader-CFI-crash-mitigations.patch +++ b/build/patches/AImageReader-CFI-crash-mitigations.patch @@ -20,8 +20,8 @@ See discussions at: License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - base/android/android_image_reader_compat.cc | 8 +++++++- - base/android/android_image_reader_compat.h | 4 ++++ + base/android/android_image_reader_compat.cc | 16 ++++++++++++++++ + base/android/android_image_reader_compat.h | 14 ++++++++++++++ chrome/browser/flag-metadata.json | 6 +++--- .../AImageReader-CFI-crash-mitigations.inc | 4 ++++ .../AImageReader-CFI-crash-mitigations.inc | 1 + @@ -30,63 +30,67 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html gpu/config/gpu_finch_features.h | 1 + gpu/config/gpu_util.cc | 8 ++++++++ gpu/config/gpu_workaround_list.txt | 1 + - gpu/ipc/service/gpu_init.cc | 7 +++++++ + gpu/ipc/service/gpu_init.cc | 8 ++++++++ gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++- - 12 files changed, 67 insertions(+), 5 deletions(-) + 12 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc create mode 100644 cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc --- a/base/android/android_image_reader_compat.cc +++ b/base/android/android_image_reader_compat.cc -@@ -23,6 +23,8 @@ +@@ -7,7 +7,23 @@ namespace base { namespace android { -+bool AndroidImageReader::disable_support_ = false; ++AndroidImageReader& AndroidImageReader::GetInstance() { ++ // C++11 static local variable initialization is ++ // thread-safe. ++ static AndroidImageReader instance; ++ return instance; ++} + - AndroidImageReader& AndroidImageReader::GetInstance() { - // C++11 static local variable initialization is - // thread-safe. -@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() { - return instance; - } - +void AndroidImageReader::DisableSupport() { + disable_support_ = true; +} + - bool AndroidImageReader::IsSupported() { -- return is_supported_; -+ return !disable_support_ && is_supported_; - } - - AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {} ++bool AndroidImageReader::IsSupported() { ++ return !disable_support_; ++} ++ + bool EnableAndroidImageReader() { ++ if (!AndroidImageReader::GetInstance().IsSupported()) return false; + // Currently we want to enable AImageReader only for android P+ devices. + if (__builtin_available(android 28, *)) { + return true; diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h --- a/base/android/android_image_reader_compat.h +++ b/base/android/android_image_reader_compat.h -@@ -24,6 +24,9 @@ class BASE_EXPORT AndroidImageReader { - AndroidImageReader(const AndroidImageReader&) = delete; - AndroidImageReader& operator=(const AndroidImageReader&) = delete; +@@ -10,6 +10,20 @@ + namespace base { + namespace android { ++class BASE_EXPORT AndroidImageReader { ++ public: ++ // Thread safe GetInstance. ++ static AndroidImageReader& GetInstance(); ++ ++ bool IsSupported(); ++ + // Disable image reader support. -+ static void DisableSupport(); ++ void DisableSupport(); + - // Check if the image reader usage is supported. This function returns TRUE - // if android version is >=OREO, image reader support is not disabled and all - // the required functions are loaded. -@@ -61,6 +64,7 @@ class BASE_EXPORT AndroidImageReader { - jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window); - - private: -+ static bool disable_support_; - friend class base::NoDestructor; ++ private: ++ bool disable_support_ = false; ++}; ++ + // Check if the image reader usage is supported. + BASE_EXPORT bool EnableAndroidImageReader(); - AndroidImageReader(); diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -2923,9 +2923,9 @@ +@@ -2980,9 +2980,9 @@ "expiry_milestone": 125 }, { @@ -179,7 +183,7 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc if (!gpu_preferences.enable_android_surface_control) return kGpuFeatureStatusDisabled; -@@ -355,6 +358,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) { +@@ -368,6 +371,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) { gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] = kGpuFeatureStatusBlocklisted; } @@ -205,14 +209,22 @@ diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc --- a/gpu/ipc/service/gpu_init.cc +++ b/gpu/ipc/service/gpu_init.cc -@@ -675,6 +675,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, +@@ -65,6 +65,7 @@ + + #if BUILDFLAG(IS_ANDROID) + #include "ui/gfx/android/android_surface_control_compat.h" ++#include "base/android/android_image_reader_compat.h" + #endif + + #if BUILDFLAG(ENABLE_VULKAN) +@@ -672,6 +673,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, } #endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_ANDROID) + // Disable AImageReader if the workaround is enabled. + if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) { -+ base::android::AndroidImageReader::DisableSupport(); ++ base::android::AndroidImageReader::GetInstance().DisableSupport(); + } +#endif + diff --git a/build/patches/AdblockPlus-add-blocking-in-service-workers.patch b/build/patches/AdblockPlus-add-blocking-in-service-workers.patch index 1d62f37f4..64cfad2c7 100644 --- a/build/patches/AdblockPlus-add-blocking-in-service-workers.patch +++ b/build/patches/AdblockPlus-add-blocking-in-service-workers.patch @@ -401,7 +401,7 @@ diff --git a/chrome/browser/adblock/adblock_content_browser_client.h b/chrome/br diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -6305,7 +6305,9 @@ ChromeContentBrowserClient:: +@@ -6132,7 +6132,9 @@ ChromeContentBrowserClient:: } bool ChromeContentBrowserClient::WillInterceptWebSocket( @@ -412,7 +412,7 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch #if BUILDFLAG(ENABLE_EXTENSIONS) if (!frame) { return false; -@@ -6328,9 +6330,11 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket( +@@ -6155,9 +6157,11 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket( } void ChromeContentBrowserClient::CreateWebSocket( @@ -422,12 +422,12 @@ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/ch const GURL& url, + const url::Origin& initiator_origin, const net::SiteForCookies& site_for_cookies, - const absl::optional& user_agent, + const std::optional& user_agent, mojo::PendingRemote diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h -@@ -642,11 +642,15 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -637,11 +637,15 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { CreateURLLoaderHandlerForServiceWorkerNavigationPreload( int frame_tree_node_id, const network::ResourceRequest& resource_request) override; @@ -442,12 +442,12 @@ diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chr const GURL& url, + const url::Origin& initiator_origin, const net::SiteForCookies& site_for_cookies, - const absl::optional& user_agent, + const std::optional& user_agent, mojo::PendingRemote diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/components/adblock/content/browser/adblock_url_loader_factory.cc --- a/components/adblock/content/browser/adblock_url_loader_factory.cc +++ b/components/adblock/content/browser/adblock_url_loader_factory.cc -@@ -343,12 +343,6 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestError( +@@ -344,12 +344,6 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestError( void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( CheckFilterMatchCallback callback) { @@ -460,7 +460,7 @@ diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/ auto subscription_service = factory_->config_.subscription_service; if (is_document_request_) { auto* host = content::RenderFrameHost::FromID(factory_->host_id_); -@@ -387,7 +381,7 @@ void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( +@@ -388,7 +382,7 @@ void AdblockURLLoaderFactory::InProgressRequest::CheckFilterMatch( } else { factory_->config_.resource_classifier->CheckRequestFilterMatch( subscription_service->GetCurrentSnapshot(), request_url_, @@ -469,7 +469,7 @@ diff --git a/components/adblock/content/browser/adblock_url_loader_factory.cc b/ base::BindOnce( &AdblockURLLoaderFactory::InProgressRequest::OnRequestUrlClassified, weak_factory_.GetWeakPtr(), -@@ -676,12 +670,14 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestFilterMatchResult( +@@ -677,12 +671,14 @@ void AdblockURLLoaderFactory::InProgressRequest::OnRequestFilterMatchResult( AdblockURLLoaderFactory::AdblockURLLoaderFactory( AdblockURLLoaderFactoryConfig config, @@ -528,7 +528,7 @@ diff --git a/components/adblock/content/browser/frame_hierarchy_builder.cc b/com diff --git a/components/adblock/content/browser/resource_classification_runner.h b/components/adblock/content/browser/resource_classification_runner.h --- a/components/adblock/content/browser/resource_classification_runner.h +++ b/components/adblock/content/browser/resource_classification_runner.h -@@ -81,14 +81,22 @@ class ResourceClassificationRunner : public KeyedService { +@@ -81,12 +81,20 @@ class ResourceClassificationRunner : public KeyedService { virtual void CheckRequestFilterMatch( SubscriptionService::Snapshot subscription_collections, const GURL& request_url, @@ -540,17 +540,15 @@ diff --git a/components/adblock/content/browser/resource_classification_runner.h SubscriptionService::Snapshot subscription_collections, const GURL& request_url, + const GURL& request_initiator, - content::GlobalRenderFrameHostId render_frame_host_id, - CheckFilterMatchCallback callback) = 0; ++ content::GlobalRenderFrameHostId render_frame_host_id, ++ CheckFilterMatchCallback callback) = 0; + virtual void CheckRequestFilterMatchForWebTransport( + SubscriptionService::Snapshot subscription_collections, + const GURL& request_url, + const GURL& request_initiator, -+ content::GlobalRenderFrameHostId render_frame_host_id, -+ CheckFilterMatchCallback callback); + content::GlobalRenderFrameHostId render_frame_host_id, + CheckFilterMatchCallback callback) = 0; // No callback, just notify observers - virtual void CheckDocumentAllowlisted( - SubscriptionService::Snapshot subscription_collection, diff --git a/components/adblock/content/browser/resource_classification_runner_impl.cc b/components/adblock/content/browser/resource_classification_runner_impl.cc --- a/components/adblock/content/browser/resource_classification_runner_impl.cc +++ b/components/adblock/content/browser/resource_classification_runner_impl.cc @@ -683,7 +681,7 @@ diff --git a/content/browser/websockets/websocket_connector_impl.cc b/content/br diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -1023,7 +1023,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory( +@@ -1009,7 +1009,7 @@ bool ContentBrowserClient::WillCreateURLLoaderFactory( return false; } @@ -692,7 +690,7 @@ diff --git a/content/public/browser/content_browser_client.cc b/content/public/b return false; } -@@ -1032,9 +1032,11 @@ uint32_t ContentBrowserClient::GetWebSocketOptions(RenderFrameHost* frame) { +@@ -1018,9 +1018,11 @@ uint32_t ContentBrowserClient::GetWebSocketOptions(RenderFrameHost* frame) { } void ContentBrowserClient::CreateWebSocket( @@ -702,12 +700,12 @@ diff --git a/content/public/browser/content_browser_client.cc b/content/public/b const GURL& url, + const url::Origin& initiator_origin, const net::SiteForCookies& site_for_cookies, - const absl::optional& user_agent, + const std::optional& user_agent, mojo::PendingRemote diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -1859,7 +1859,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1840,7 +1840,7 @@ class CONTENT_EXPORT ContentBrowserClient { scoped_refptr navigation_response_task_runner); // Returns true when the embedder wants to intercept a websocket connection. @@ -716,7 +714,7 @@ diff --git a/content/public/browser/content_browser_client.h b/content/public/br // Returns the WebSocket creation options. virtual uint32_t GetWebSocketOptions(RenderFrameHost* frame); -@@ -1881,9 +1881,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1862,9 +1862,11 @@ class CONTENT_EXPORT ContentBrowserClient { // Always called on the UI thread and only when the Network Service is // enabled. virtual void CreateWebSocket( @@ -726,6 +724,6 @@ diff --git a/content/public/browser/content_browser_client.h b/content/public/br const GURL& url, + const url::Origin& initiator_origin, const net::SiteForCookies& site_for_cookies, - const absl::optional& user_agent, + const std::optional& user_agent, mojo::PendingRemote -- diff --git a/build/patches/Add-AllowUserCertificates-flag.patch b/build/patches/Add-AllowUserCertificates-flag.patch index 90340f251..f54de30b1 100644 --- a/build/patches/Add-AllowUserCertificates-flag.patch +++ b/build/patches/Add-AllowUserCertificates-flag.patch @@ -20,7 +20,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java -@@ -228,6 +228,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider; +@@ -227,6 +227,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider; import org.chromium.content_public.browser.SelectionPopupController; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.common.ContentSwitches; @@ -28,7 +28,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv import org.chromium.printing.PrintManagerDelegateImpl; import org.chromium.printing.PrintingController; import org.chromium.printing.PrintingControllerImpl; -@@ -1097,6 +1098,8 @@ public abstract class ChromeActivity +@@ -1105,6 +1106,8 @@ public abstract class ChromeActivity super.onStartWithNative(); ChromeActivitySessionTracker.getInstance().onStartWithNative(); ChromeCachedFlags.getInstance().cacheNativeFlags(); @@ -40,42 +40,42 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc -@@ -144,6 +144,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -136,6 +136,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { &feed::kFeedShowSignInCommand, &feed::kFeedSignedOutViewDemotion, &feed::kFeedUserInteractionReliabilityReport, + &kAllowUserCertificates, &feed::kInterestFeedV2, - &feed::kInterestFeedV2Autoplay, &feed::kInterestFeedV2Hearts, + &feed::kWebFeed, 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 -@@ -103,6 +103,7 @@ public abstract class ChromeFeatureList { +@@ -141,6 +141,7 @@ public abstract class ChromeFeatureList { + return ChromeFeatureMap.getInstance().mutableFlagWithSafeDefault(featureName, defaultValue); } - /* Alphabetical: */ + public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates"; - public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR = "AdaptiveButtonInTopToolbar"; public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_TRANSLATE = "AdaptiveButtonInTopToolbarTranslate"; -@@ -522,6 +523,8 @@ public abstract class ChromeFeatureList { - public static final CachedFlag sAndroidAppIntegration = - new CachedFlag(ANDROID_APP_INTEGRATION, false); - public static final CachedFlag sAndroidHub = new CachedFlag(ANDROID_HUB, false); + public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_ADD_TO_BOOKMARKS = +@@ -521,6 +522,8 @@ public abstract class ChromeFeatureList { + newCachedFlag(ANDROID_ELEGANT_TEXT_HEIGHT, false); + + public static final CachedFlag sAndroidHub = newCachedFlag(ANDROID_HUB, false); + public static final CachedFlag sAllowUserCertificates = -+ new CachedFlag(ALLOW_USER_CERTIFICATES, false); - public static final CachedFlag sAppMenuMobileSiteOption = - new CachedFlag(APP_MENU_MOBILE_SITE_OPTION, false); - public static final CachedFlag sArchiveTabService = new CachedFlag(ARCHIVE_TAB_SERVICE, false); -@@ -662,6 +665,7 @@ public abstract class ChromeFeatureList { ++ newCachedFlag(ALLOW_USER_CERTIFICATES, false); + public static final CachedFlag sArchiveTabService = newCachedFlag(ARCHIVE_TAB_SERVICE, false); + public static final CachedFlag sBackGestureActivityTabProvider = + newCachedFlag(BACK_GESTURE_ACTIVITY_TAB_PROVIDER, false); +@@ -655,6 +658,7 @@ public abstract class ChromeFeatureList { public static final List sFlagsCachedFullBrowser = List.of( + sAllowUserCertificates, sAndroidAppIntegration, + sAndroidElegantTextHeight, sAndroidHub, - sAppMenuMobileSiteOption, diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc new file mode 100644 --- /dev/null diff --git a/build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch b/build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch index fa2a0be84..da1a6026e 100644 --- a/build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch +++ b/build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java --- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java -@@ -198,6 +198,8 @@ public class KeyboardShortcuts { +@@ -204,6 +204,8 @@ public class KeyboardShortcuts { R.string.keyboard_shortcut_address_bar, KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON); diff --git a/build/patches/Add-IsCleartextPermitted-flag.patch b/build/patches/Add-IsCleartextPermitted-flag.patch index 6bdfae8b5..0ec0167c6 100644 --- a/build/patches/Add-IsCleartextPermitted-flag.patch +++ b/build/patches/Add-IsCleartextPermitted-flag.patch @@ -44,7 +44,7 @@ new file mode 100644 diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc -@@ -287,6 +287,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { +@@ -301,6 +301,11 @@ std::unique_ptr URLRequestHttpJob::Create(URLRequest* request) { } } diff --git a/build/patches/Add-a-flag-to-disable-GamePad-API.patch b/build/patches/Add-a-flag-to-disable-GamePad-API.patch index 238557b3d..121925dc7 100644 --- a/build/patches/Add-a-flag-to-disable-GamePad-API.patch +++ b/build/patches/Add-a-flag-to-disable-GamePad-API.patch @@ -14,7 +14,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json -@@ -7058,9 +7058,9 @@ +@@ -7156,9 +7156,9 @@ "expiry_milestone": 123 }, { @@ -25,11 +25,11 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.js + "expiry_milestone": -1 }, { - "name": "rounded-display", + "name": "revamp-page-info-ios", diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc -@@ -3078,7 +3078,7 @@ const char kResetShortcutCustomizationsDescription[] = +@@ -3040,7 +3040,7 @@ const char kResetShortcutCustomizationsDescription[] = const char kRestrictGamepadAccessName[] = "Restrict gamepad access"; const char kRestrictGamepadAccessDescription[] = diff --git a/build/patches/Add-a-proxy-configuration-page.patch b/build/patches/Add-a-proxy-configuration-page.patch index 283ddce19..ee1fb24f0 100644 --- a/build/patches/Add-a-proxy-configuration-page.patch +++ b/build/patches/Add-a-proxy-configuration-page.patch @@ -88,7 +88,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc -@@ -301,6 +301,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() { +@@ -302,6 +302,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() { builtins_to_provide.push_back( base::ASCIIToUTF16(chrome::kChromeUISettingsURL)); #endif @@ -100,7 +100,7 @@ diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd -@@ -240,6 +240,9 @@ +@@ -237,6 +237,9 @@ @@ -113,8 +113,8 @@ diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resou diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc -@@ -388,7 +388,7 @@ absl::optional CreateProxyConfigDict( - return absl::nullopt; +@@ -387,7 +387,7 @@ std::optional CreateProxyConfigDict( + return std::nullopt; } return ProxyConfigDictionary::CreateFixedServers(proxy_rules_string, - bypass_list); @@ -197,16 +197,16 @@ diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/pro diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -191,6 +191,8 @@ +@@ -190,6 +190,8 @@ + #include "printing/buildflags/buildflags.h" #include "rlz/buildflags/buildflags.h" - #include "third_party/abseil-cpp/absl/types/optional.h" +#include "chrome/browser/net/proxy_service_factory.h" + #if BUILDFLAG(ENABLE_BACKGROUND_MODE) #include "chrome/browser/background/background_mode_manager.h" #endif -@@ -1451,6 +1453,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1412,6 +1414,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { component_updater::RegisterPrefs(registry); domain_reliability::RegisterPrefs(registry); embedder_support::OriginTrialPrefs::RegisterPrefs(registry); @@ -661,7 +661,7 @@ new file mode 100644 diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn -@@ -301,6 +301,8 @@ static_library("ui") { +@@ -310,6 +310,8 @@ static_library("ui") { "webui/metrics_internals/metrics_internals_ui.h", "webui/net_export_ui.cc", "webui/net_export_ui.h", @@ -673,15 +673,15 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc -@@ -56,6 +56,7 @@ +@@ -55,6 +55,7 @@ #include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h" #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" #include "chrome/browser/ui/webui/policy/policy_ui.h" +#include "chrome/browser/ui/webui/proxy_config_ui.h" #include "chrome/browser/ui/webui/predictors/predictors_ui.h" + #include "chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_internals_ui.h" #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h" - #include "chrome/browser/ui/webui/signin_internals_ui.h" -@@ -489,6 +490,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, +@@ -494,6 +495,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, return &NewWebUI; if (url.host_piece() == chrome::kChromeUINetExportHost) return &NewWebUI; @@ -1127,7 +1127,7 @@ new file mode 100644 diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc -@@ -51,6 +51,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert"; +@@ -49,6 +49,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert"; const char kChromeUICertificateViewerURL[] = "chrome://view-cert/"; const char kChromeUIChromeSigninHost[] = "chrome-signin"; const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/"; @@ -1136,7 +1136,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons const char kChromeUIChromeURLsHost[] = "chrome-urls"; const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/"; const char kChromeUIComponentsHost[] = "components"; -@@ -454,6 +456,7 @@ bool IsSystemWebUIHost(base::StringPiece host) { +@@ -455,6 +457,7 @@ bool IsSystemWebUIHost(base::StringPiece host) { kChromeUILockScreenNetworkHost, kChromeUILockScreenStartReauthHost, kChromeUIMobileSetupHost, @@ -1144,7 +1144,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons kChromeUIMultiDeviceSetupHost, kChromeUINetworkHost, kChromeUINotificationTesterHost, -@@ -758,6 +761,7 @@ const char* const kChromeHostURLs[] = { +@@ -757,6 +760,7 @@ const char* const kChromeHostURLs[] = { #if !BUILDFLAG(IS_ANDROID) #if !BUILDFLAG(IS_CHROMEOS) kChromeUIAppLauncherPageHost, @@ -1155,7 +1155,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h -@@ -137,6 +137,8 @@ extern const char kChromeUINTPTilesInternalsHost[]; +@@ -135,6 +135,8 @@ extern const char kChromeUINTPTilesInternalsHost[]; extern const char kChromeUINaClHost[]; extern const char kChromeUINetExportHost[]; extern const char kChromeUINetExportURL[]; @@ -1321,7 +1321,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_config/proxy_policy_handler.cc --- a/components/proxy_config/proxy_policy_handler.cc +++ b/components/proxy_config/proxy_policy_handler.cc -@@ -262,7 +262,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, +@@ -376,7 +376,7 @@ void ProxyPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, set_proxy_pref_value(ProxyConfigDictionary::CreateFixedServers( server->GetString(), bypass_list && bypass_list->is_string() ? bypass_list->GetString() @@ -1333,7 +1333,7 @@ diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_config.cc --- a/net/proxy_resolution/proxy_config.cc +++ b/net/proxy_resolution/proxy_config.cc -@@ -112,7 +112,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) { +@@ -109,7 +109,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) { &single_proxies, ProxyServer::SCHEME_HTTP); type = Type::PROXY_LIST; @@ -1342,7 +1342,7 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c } // Trim whitespace off the url scheme. -@@ -143,6 +143,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) { +@@ -140,6 +140,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) { } } @@ -1354,8 +1354,8 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c + // special case: a single proxy servers list specified + if (type == Type::PROXY_LIST) { + std::string proxy_list; -+ for (const ProxyServer& proxy_server : -+ single_proxies.GetAll()) { ++ for (const auto& proxy_chain : single_proxies.AllChains()) { ++ net::ProxyServer proxy_server = proxy_chain.GetProxyServer(/*chain_index=*/0); + proxy_list += ProxyServerToProxyUri(proxy_server) + ";"; + } + // remove last semicolon @@ -1373,20 +1373,20 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c + + // start to build a per-scheme list + std::string list; -+ for (const ProxyServer& proxy_server : -+ proxies_for_http.GetAll()) { ++ for (const auto& proxy_chain : proxies_for_http.AllChains()) { ++ net::ProxyServer proxy_server = proxy_chain.GetProxyServer(/*chain_index=*/0); + list += "http=" + ProxyServerToProxyUri(proxy_server) + ";"; + } -+ for (const ProxyServer& proxy_server : -+ proxies_for_https.GetAll()) { ++ for (const auto& proxy_chain : proxies_for_https.AllChains()) { ++ net::ProxyServer proxy_server = proxy_chain.GetProxyServer(/*chain_index=*/0); + list += "https=" + ProxyServerToProxyUri(proxy_server) + ";"; + } -+ for (const ProxyServer& proxy_server : -+ proxies_for_ftp.GetAll()) { ++ for (const auto& proxy_chain : proxies_for_ftp.AllChains()) { ++ net::ProxyServer proxy_server = proxy_chain.GetProxyServer(/*chain_index=*/0); + list += "ftp=" + ProxyServerToProxyUri(proxy_server) + ";"; + } -+ for (const ProxyServer& proxy_server : -+ fallback_proxies.GetAll()) { ++ for (const auto& proxy_chain : fallback_proxies.AllChains()) { ++ net::ProxyServer proxy_server = proxy_chain.GetProxyServer(/*chain_index=*/0); + list += "socks=" + ProxyServerToProxyUri(proxy_server) + ";"; + } + if (list.length() != 0 ) { diff --git a/build/patches/Add-an-always-incognito-mode.patch b/build/patches/Add-an-always-incognito-mode.patch index 73e30a8fb..76cdd9520 100644 --- a/build/patches/Add-an-always-incognito-mode.patch +++ b/build/patches/Add-an-always-incognito-mode.patch @@ -72,7 +72,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/ui/messages/android/BUILD.gn | 1 + .../snackbar/INeedSnackbarManager.java | 27 +++ chrome/common/pref_names.h | 6 + - .../browser/content_settings_pref_provider.cc | 8 +- + .../browser/content_settings_pref_provider.cc | 6 +- .../browser/content_settings_pref_provider.h | 2 + .../core/browser/host_content_settings_map.cc | 4 +- .../core/browser/host_content_settings_map.h | 3 + @@ -85,7 +85,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../add-an-always-incognito-mode.inc | 3 + .../add-an-always-incognito-mode.inc | 1 + net/base/file_stream_context.cc | 2 +- - 66 files changed, 773 insertions(+), 103 deletions(-) + 66 files changed, 771 insertions(+), 103 deletions(-) create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java @@ -98,7 +98,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni --- a/chrome/android/chrome_java_resources.gni +++ b/chrome/android/chrome_java_resources.gni -@@ -649,6 +649,7 @@ chrome_java_resources = [ +@@ -642,6 +642,7 @@ chrome_java_resources = [ "java/res/xml/main_preferences.xml", "java/res/xml/manage_sync_preferences.xml", "java/res/xml/phone_as_a_security_key_accessory_filter.xml", @@ -117,7 +117,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java "java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java", "java/src/org/chromium/chrome/browser/ActivityTabProvider.java", "java/src/org/chromium/chrome/browser/ActivityUtils.java", -@@ -968,6 +969,7 @@ chrome_java_sources = [ +@@ -971,6 +972,7 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/ChromeTrackingProtectionDelegate.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java", @@ -254,7 +254,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.chrome.browser.IntentHandler.TabOpenType; import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.app.metrics.LaunchCauseMetrics; -@@ -632,9 +636,14 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2036,6 +2037,9 @@ public abstract class ChromeActivity throw new IllegalStateException( "Attempting to access TabCreator before initialization"); } @@ -327,7 +327,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App /** * Base implementation of {@link AppMenuPropertiesDelegate} that handles hiding and showing menu * items based on activity state. -@@ -597,6 +602,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -599,6 +604,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) { @@ -341,7 +341,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App // We have to iterate all menu items since same menu item ID may be associated with more // than one menu items. boolean isOverviewModeMenu = menuGroup == MenuGroup.OVERVIEW_MODE_MENU; -@@ -659,7 +671,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -661,7 +673,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } if (item.getItemId() == R.id.recent_tabs_menu_id) { @@ -358,7 +358,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App } if (item.getItemId() == R.id.menu_select_tabs) { item.setVisible(isMenuSelectTabsVisible); -@@ -865,8 +885,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -870,8 +890,9 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate && !isChromeScheme && !isFileScheme && !isContentScheme @@ -452,17 +452,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java -@@ -21,6 +21,7 @@ import org.chromium.base.ContextUtils; - import org.chromium.base.supplier.ObservableSupplier; +@@ -22,6 +22,7 @@ import org.chromium.base.supplier.ObservableSupplier; + import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.chrome.browser.DefaultBrowserInfo; import org.chromium.chrome.browser.app.appmenu.AppMenuPropertiesDelegateImpl; import org.chromium.chrome.browser.app.appmenu.DividerLineMenuItemViewBinder; -@@ -195,6 +196,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat - downloadItemVisible = false; +@@ -203,6 +204,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat openInChromeItemVisible = false; + tryAddingReadAloud = false; } + if (AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()) { + downloadItemVisible = true; @@ -473,8 +473,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java -@@ -83,6 +83,9 @@ import org.chromium.components.embedder_support.util.UrlConstants; - import org.chromium.components.version_info.VersionInfo; +@@ -83,6 +83,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable; + import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.device.mojom.ScreenOrientationLockType; +import org.chromium.base.ContextUtils; @@ -483,7 +483,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; -@@ -1294,7 +1297,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid +@@ -1291,7 +1294,7 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid @Override public boolean isIncognito() { @@ -502,7 +502,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.IntentHandler; - import org.chromium.chrome.browser.app.download.home.DownloadActivity; + import org.chromium.chrome.browser.app.download.home.DownloadActivityLauncher; @@ -74,6 +75,10 @@ import org.chromium.url.GURL; import java.io.File; @@ -514,7 +514,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo /** A class containing some utility static methods. */ public class DownloadUtils { private static final String TAG = "download"; -@@ -311,7 +316,16 @@ public class DownloadUtils { +@@ -285,7 +290,16 @@ public class DownloadUtils { // Offline pages isn't supported in Incognito. This should be checked before calling // OfflinePageBridge.getForProfile because OfflinePageBridge instance will not be found // for incognito profile. @@ -535,7 +535,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryContentManager.java -@@ -243,7 +243,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver +@@ -244,7 +244,9 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver mHistoryAdapter.generateFooterItems(); // Listen to changes in sign in state. @@ -546,7 +546,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History // Create PrefChangeRegistrar to receive notifications on preference changes. mPrefChangeRegistrar = new PrefChangeRegistrar(); -@@ -278,7 +280,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver +@@ -287,7 +289,8 @@ public class HistoryContentManager implements SignInStateObserver, PrefObserver mHistoryAdapter.onDestroyed(); mLargeIconBridge.destroy(); mLargeIconBridge = null; @@ -589,7 +589,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History mSelectableListLayout = null; mRootView = getIncognitoHistoryPlaceholderView(); return; -@@ -672,7 +679,7 @@ public class HistoryManager +@@ -673,7 +680,7 @@ public class HistoryManager private void swapContentView() { boolean toHistoryClusters; @@ -598,7 +598,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History return; } else if (isHistoryClustersUIShowing()) { toHistoryClusters = false; -@@ -736,9 +743,22 @@ public class HistoryManager +@@ -737,9 +744,22 @@ public class HistoryManager && mContentView == mHistoryClustersCoordinator.getActivityContentView(); } @@ -622,10 +622,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History // If Incognito placeholder is shown no need to call any destroy method. return; } -@@ -758,7 +778,7 @@ public class HistoryManager +@@ -809,7 +829,7 @@ public class HistoryManager * @return True if manager handles this event, false if it decides to ignore. */ - public boolean onBackPressed() { + private boolean onBackPressed() { - if (mIsIncognito || mSelectableListLayout == null) { + if (shouldShowIncognitoPlaceholder() || mSelectableListLayout == null) { // If Incognito placeholder is shown, the back press should handled by HistoryActivity. @@ -681,7 +681,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.app.download.home.DownloadPage; import org.chromium.chrome.browser.bookmarks.BookmarkPage; -@@ -276,7 +277,8 @@ public class NativePageFactory { +@@ -287,7 +288,8 @@ public class NativePageFactory { String url, NativePage candidatePage, Tab tab, boolean isIncognito) { NativePage page; @@ -911,7 +911,7 @@ new file mode 100644 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java -@@ -74,6 +74,7 @@ import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; +@@ -72,6 +72,7 @@ import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate; import org.chromium.chrome.browser.sync.SyncServiceFactory; import org.chromium.chrome.browser.ui.device_lock.MissingDeviceLockLauncher; @@ -919,7 +919,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; import org.chromium.components.browser_ui.accessibility.AccessibilitySettings; -@@ -359,6 +360,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -358,6 +359,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity ((PrivacySandboxSettingsBaseFragment) fragment) .setSnackbarManager(getSnackbarManager()); } @@ -1044,16 +1044,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/tab_restore diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java -@@ -129,6 +129,8 @@ import org.chromium.components.webapps.bottomsheet.PwaBottomSheetController; +@@ -135,6 +135,8 @@ import org.chromium.components.webapps.bottomsheet.PwaBottomSheetController; import org.chromium.components.webapps.bottomsheet.PwaBottomSheetControllerFactory; import org.chromium.ui.base.ActivityWindowAndroid; import org.chromium.ui.base.DeviceFormFactor; +import org.chromium.base.ContextUtils; +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor; import org.chromium.ui.base.IntentRequestTracker; + import org.chromium.ui.dragdrop.DragDropGlobalState; import org.chromium.ui.modaldialog.ModalDialogManager; - -@@ -942,7 +944,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { +@@ -985,7 +987,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator { () -> { mTabCreatorManagerSupplier .get() @@ -1107,7 +1107,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabMod diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java -@@ -51,6 +51,8 @@ import org.chromium.components.embedder_support.util.UrlUtilities; +@@ -50,6 +50,8 @@ import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.url.GURL; @@ -1116,7 +1116,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -@@ -673,6 +675,13 @@ public class TabPersistentStore { +@@ -671,6 +673,13 @@ public class TabPersistentStore { } } } @@ -1133,7 +1133,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java -@@ -40,6 +40,7 @@ import org.chromium.base.supplier.OneshotSupplier; +@@ -41,6 +41,7 @@ import org.chromium.base.supplier.OneshotSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; @@ -1141,7 +1141,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/Toolbar import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.app.tab_activity_glue.TabReparentingController; import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton; -@@ -590,7 +591,7 @@ public class ToolbarManager +@@ -603,7 +604,7 @@ public class ToolbarManager TraceEvent.end("isOfflinePage"); return ret; } @@ -1198,7 +1198,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/android/historical_tab_saver.cc --- a/chrome/browser/android/historical_tab_saver.cc +++ b/chrome/browser/android/historical_tab_saver.cc -@@ -26,6 +26,11 @@ +@@ -27,6 +27,11 @@ #include "components/sessions/core/tab_restore_service.h" #include "content/public/browser/web_contents.h" @@ -1210,7 +1210,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and using base::android::JavaParamRef; using base::android::ScopedJavaLocalRef; -@@ -38,7 +43,8 @@ constexpr int kInvalidGroupId = -1; +@@ -39,7 +44,8 @@ constexpr int kInvalidGroupId = -1; void CreateHistoricalTab( TabAndroid* tab_android, @@ -1220,7 +1220,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and if (!tab_android) { return; } -@@ -49,9 +55,14 @@ void CreateHistoricalTab( +@@ -50,9 +56,14 @@ void CreateHistoricalTab( return; } @@ -1237,16 +1237,16 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and if (!service) { return; } -@@ -99,7 +110,7 @@ void CreateHistoricalBulkClosure( +@@ -100,7 +111,7 @@ void CreateHistoricalBulkClosure( std::vector per_tab_android_group_id, - std::vector tabs, + std::vector> tabs, std::vector web_contents_state) { - DCHECK(model); + if (!model) return; DCHECK_EQ(android_group_ids.size(), group_titles.size()); DCHECK_EQ(per_tab_android_group_id.size(), tabs.size()); -@@ -234,11 +245,12 @@ static void JNI_HistoricalTabSaverImpl_CreateHistoricalTab( +@@ -235,11 +246,12 @@ static void JNI_HistoricalTabSaverImpl_CreateHistoricalTab( JNIEnv* env, const JavaParamRef& jtab_android, const JavaParamRef& state, @@ -1264,7 +1264,7 @@ diff --git a/chrome/browser/android/historical_tab_saver.cc b/chrome/browser/and diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc -@@ -350,6 +350,15 @@ ChromeAutocompleteProviderClient::GetProviderStateService() const { +@@ -351,6 +351,15 @@ ChromeAutocompleteProviderClient::GetProviderStateService() const { return ProviderStateServiceFactory::GetForProfile(profile_); } @@ -1317,17 +1317,17 @@ diff --git a/chrome/browser/autocomplete/remote_suggestions_service_factory.cc b diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc --- a/chrome/browser/content_settings/host_content_settings_map_factory.cc +++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc -@@ -15,6 +15,7 @@ - #include "chrome/browser/profiles/profile.h" +@@ -16,6 +16,7 @@ + #include "chrome/browser/profiles/profiles_state.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/common/buildflags.h" +#include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/content_settings_pref_provider.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/permissions/features.h" -@@ -119,9 +120,25 @@ scoped_refptr - should_record_metrics && ash::ProfileHelper::IsUserProfile(profile); - #endif // BUILDFLAG(IS_CHROMEOS_ASH) +@@ -105,9 +106,25 @@ scoped_refptr + if (profile->IsOffTheRecord() && !profile->IsGuestSession()) + GetForProfile(original_profile); + bool always_incognito_enabled = false; + bool force_save_site_settings = false; @@ -1350,9 +1350,9 @@ diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.c + !force_save_site_settings && (profile->IsOffTheRecord() || profile->IsGuestSession()), + force_save_site_settings, /*store_last_modified=*/true, profile->ShouldRestoreOldSessionCookies(), - should_record_metrics)); + profiles::IsRegularUserProfile(profile))); -@@ -131,6 +148,9 @@ scoped_refptr +@@ -117,6 +134,9 @@ scoped_refptr HostContentSettingsMap::WEBUI_ALLOWLIST_PROVIDER, std::move(allowlist_provider)); @@ -1365,17 +1365,17 @@ diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.c diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc -@@ -38,6 +38,9 @@ - #include "chrome/browser/ui/android/tab_model/tab_model_list.h" +@@ -41,6 +41,9 @@ #include "components/feed/core/v2/public/feed_api.h" #include "components/feed/core/v2/public/feed_service.h" + #include "content/public/browser/web_contents.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" #else #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" -@@ -445,6 +448,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { +@@ -448,6 +451,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) { history::HistoryService* HistoryTabHelper::GetHistoryService() { Profile* profile = Profile::FromBrowserContext(web_contents()->GetBrowserContext()); @@ -1389,7 +1389,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo if (profile->IsOffTheRecord()) return nullptr; -@@ -452,6 +462,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { +@@ -455,6 +465,16 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { profile, ServiceAccessType::IMPLICIT_ACCESS); } @@ -1409,18 +1409,18 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h --- a/chrome/browser/history/history_tab_helper.h +++ b/chrome/browser/history/history_tab_helper.h -@@ -14,6 +14,8 @@ +@@ -15,6 +15,8 @@ + #include "components/translate/core/browser/translate_driver.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" - #include "third_party/abseil-cpp/absl/types/optional.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" namespace history { struct HistoryAddPageArgs; -@@ -53,6 +55,11 @@ class HistoryTabHelper - force_eligible_tab_for_testing_ = force; - } +@@ -54,6 +56,11 @@ class HistoryTabHelper + void SetAppId(const std::string& app_id) { app_id_ = app_id; } + #endif + static void RegisterProfilePrefs(PrefRegistrySimple* registry); + @@ -1430,7 +1430,7 @@ diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/histor private: explicit HistoryTabHelper(content::WebContents* web_contents); friend class content::WebContentsUserData; -@@ -83,9 +90,6 @@ class HistoryTabHelper +@@ -89,9 +96,6 @@ class HistoryTabHelper void OnLanguageDetermined( const translate::LanguageDetectionDetails& details) override; @@ -1643,9 +1643,9 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ + last_n_ongoing_snapshot_info_.get(), + /*user_requested*/ false)); - IsSavingSamePageEnum saving_same_page_value = IsSavingSamePageEnum::kNewPage; - if (last_n_latest_saved_snapshot_info_) { -@@ -420,11 +434,12 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { + last_n_latest_saved_snapshot_info_.reset(); + } +@@ -403,11 +417,12 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { downloads_latest_saved_snapshot_info_->request_id, downloads_latest_saved_snapshot_info_->origin); std::vector ids{downloads_latest_saved_snapshot_info_->request_id}; @@ -1659,7 +1659,7 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ OfflinePageModel::DeletePageResult::SUCCESS); } } -@@ -441,6 +456,7 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { +@@ -424,6 +439,7 @@ void RecentTabHelper::SaveSnapshotForDownloads(bool replace_latest) { // for early termination in case of errors. void RecentTabHelper::ContinueSnapshotWithIdsToPurge( SnapshotProgressInfo* snapshot_info, @@ -1667,7 +1667,7 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ const std::vector& page_ids) { DCHECK(snapshot_info); -@@ -450,13 +466,20 @@ void RecentTabHelper::ContinueSnapshotWithIdsToPurge( +@@ -433,13 +449,20 @@ void RecentTabHelper::ContinueSnapshotWithIdsToPurge( criteria.offline_ids = page_ids; page_model_->DeletePagesWithCriteria( criteria, base::BindOnce(&RecentTabHelper::ContinueSnapshotAfterPurge, @@ -1693,7 +1693,7 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/ diff --git a/chrome/browser/offline_pages/recent_tab_helper.h b/chrome/browser/offline_pages/recent_tab_helper.h --- a/chrome/browser/offline_pages/recent_tab_helper.h +++ b/chrome/browser/offline_pages/recent_tab_helper.h -@@ -123,8 +123,10 @@ class RecentTabHelper +@@ -106,8 +106,10 @@ class RecentTabHelper bool EnsureInitialized(); void ContinueSnapshotWithIdsToPurge(SnapshotProgressInfo* snapshot_info, @@ -1704,7 +1704,7 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.h b/chrome/browser/o OfflinePageModel::DeletePageResult result); void SavePageCallback(SnapshotProgressInfo* snapshot_info, OfflinePageModel::SavePageResult result, -@@ -146,6 +148,9 @@ class RecentTabHelper +@@ -129,6 +131,9 @@ class RecentTabHelper // Not page-specific. bool snapshots_enabled_ = false; @@ -1738,7 +1738,7 @@ diff --git a/chrome/browser/offline_pages/request_coordinator_factory.h b/chrome diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -256,6 +256,7 @@ +@@ -248,6 +248,7 @@ #if BUILDFLAG(IS_ANDROID) #include "chrome/browser/accessibility/accessibility_prefs/android/accessibility_prefs_controller.h" @@ -1746,7 +1746,7 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" #include "chrome/browser/android/ntp/recent_tabs_page_prefs.h" #include "chrome/browser/android/oom_intervention/oom_intervention_decider.h" -@@ -1857,6 +1858,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1813,6 +1814,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry); variations::VariationsService::RegisterProfilePrefs(registry); webapps::InstallPromptPrefs::RegisterProfilePrefs(registry); @@ -1790,10 +1790,10 @@ diff --git a/chrome/browser/profiles/profile_selections.h b/chrome/browser/profi @@ -6,7 +6,7 @@ #define CHROME_BROWSER_PROFILES_PROFILE_SELECTIONS_H_ - #include "base/feature_list.h" + #include - +#include "build/build_config.h" - #include "third_party/abseil-cpp/absl/types/optional.h" + #include "base/feature_list.h" class Profile; @@ -27,6 +27,11 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile); @@ -1885,7 +1885,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1225,6 +1225,37 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1222,6 +1222,37 @@ Your Google account may have other forms of browsing history like searches and a Clears history from all synced devices @@ -1991,7 +1991,7 @@ new file mode 100644 diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -3940,6 +3940,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = +@@ -3952,6 +3952,12 @@ inline constexpr char kOutOfProcessSystemDnsResolutionEnabled[] = "net.out_of_process_system_dns_resolution_enabled"; #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) @@ -2007,7 +2007,7 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc --- a/components/content_settings/core/browser/content_settings_pref_provider.cc +++ b/components/content_settings/core/browser/content_settings_pref_provider.cc -@@ -91,10 +91,12 @@ void PrefProvider::RegisterProfilePrefs( +@@ -97,10 +97,12 @@ void PrefProvider::RegisterProfilePrefs( PrefProvider::PrefProvider(PrefService* prefs, bool off_the_record, @@ -2020,7 +2020,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov store_last_modified_(store_last_modified), clock_(base::DefaultClock::GetInstance()) { TRACE_EVENT_BEGIN("startup", "PrefProvider::PrefProvider"); -@@ -117,10 +119,14 @@ PrefProvider::PrefProvider(PrefService* prefs, +@@ -124,11 +126,13 @@ PrefProvider::PrefProvider(PrefService* prefs, WebsiteSettingsRegistry* website_settings = WebsiteSettingsRegistry::GetInstance(); for (const WebsiteSettingsInfo* info : *website_settings) { @@ -2028,18 +2028,17 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov + info->incognito_behavior() == WebsiteSettingsInfo::INHERIT_IN_INCOGNITO; content_settings_prefs_.insert(std::make_pair( info->type(), std::make_unique( - info->type(), prefs_, &pref_change_registrar_, -- info->pref_name(), off_the_record_, restore_session, -+ info->pref_name(), -+ off_the_record_ && !save_site_settings, -+ restore_session, + info->type(), prefs_, pref_change_registrar_.get(), + info->pref_name(), info->partitioned_pref_name(), +- off_the_record_, restore_session, ++ off_the_record_ && !save_site_settings, restore_session, base::BindRepeating(&PrefProvider::Notify, base::Unretained(this))))); } diff --git a/components/content_settings/core/browser/content_settings_pref_provider.h b/components/content_settings/core/browser/content_settings_pref_provider.h --- a/components/content_settings/core/browser/content_settings_pref_provider.h +++ b/components/content_settings/core/browser/content_settings_pref_provider.h -@@ -37,6 +37,7 @@ class PrefProvider : public UserModifiableProvider { +@@ -38,6 +38,7 @@ class PrefProvider : public UserModifiableProvider { PrefProvider(PrefService* prefs, bool off_the_record, @@ -2047,7 +2046,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov bool store_last_modified, bool restore_session); -@@ -116,6 +117,7 @@ class PrefProvider : public UserModifiableProvider { +@@ -127,6 +128,7 @@ class PrefProvider : public UserModifiableProvider { raw_ptr prefs_; const bool off_the_record_; @@ -2058,7 +2057,7 @@ diff --git a/components/content_settings/core/browser/content_settings_pref_prov diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc -@@ -288,6 +288,7 @@ struct ContentSettingEntry { +@@ -277,6 +277,7 @@ struct ContentSettingEntry { HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, bool is_off_the_record, @@ -2066,7 +2065,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics) -@@ -297,6 +298,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -286,6 +287,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, #endif prefs_(prefs), is_off_the_record_(is_off_the_record), @@ -2074,7 +2073,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. store_last_modified_(store_last_modified), allow_invalid_secondary_pattern_for_testing_(false), clock_(base::DefaultClock::GetInstance()) { -@@ -309,7 +311,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, +@@ -298,7 +300,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, policy_provider->AddObserver(this); auto pref_provider_ptr = std::make_unique( @@ -2082,7 +2081,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. + prefs_, is_off_the_record_, force_save_site_settings_, store_last_modified_, restore_session); pref_provider_ = pref_provider_ptr.get(); content_settings_providers_[PREF_PROVIDER] = std::move(pref_provider_ptr); - user_modifiable_providers_.push_back(pref_provider_); + user_modifiable_providers_.push_back(pref_provider_.get()); diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h --- a/components/content_settings/core/browser/host_content_settings_map.h +++ b/components/content_settings/core/browser/host_content_settings_map.h @@ -2094,7 +2093,7 @@ diff --git a/components/content_settings/core/browser/host_content_settings_map. bool store_last_modified, bool restore_session, bool should_record_metrics); -@@ -531,6 +532,8 @@ class HostContentSettingsMap : public content_settings::Observer, +@@ -544,6 +545,8 @@ class HostContentSettingsMap : public content_settings::Observer, // Whether this settings map is for an incognito or guest session. bool is_off_the_record_; @@ -2117,7 +2116,7 @@ diff --git a/components/omnibox/browser/autocomplete_provider_client.cc b/compon diff --git a/components/omnibox/browser/autocomplete_provider_client.h b/components/omnibox/browser/autocomplete_provider_client.h --- a/components/omnibox/browser/autocomplete_provider_client.h +++ b/components/omnibox/browser/autocomplete_provider_client.h -@@ -138,6 +138,7 @@ class AutocompleteProviderClient : public OmniboxAction::Client { +@@ -137,6 +137,7 @@ class AutocompleteProviderClient : public OmniboxAction::Client { virtual bool IsOffTheRecord() const = 0; virtual bool IsIncognitoProfile() const = 0; virtual bool IsGuestSession() const = 0; @@ -2140,7 +2139,7 @@ diff --git a/components/omnibox/browser/base_search_provider.cc b/components/omn diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc -@@ -767,7 +767,9 @@ bool SearchProvider::IsQuerySuitableForSuggest(bool* query_is_private) const { +@@ -774,7 +774,9 @@ bool SearchProvider::IsQuerySuitableForSuggest(bool* query_is_private) const { // keyword input to a keyword suggest server, if any.) const TemplateURL* default_url = providers_.GetDefaultProviderURL(); const TemplateURL* keyword_url = providers_.GetKeywordProviderURL(); diff --git a/build/patches/Add-autoplay-site-setting.patch b/build/patches/Add-autoplay-site-setting.patch index fb3be1be3..6d9cd11b8 100644 --- a/build/patches/Add-autoplay-site-setting.patch +++ b/build/patches/Add-autoplay-site-setting.patch @@ -279,7 +279,7 @@ new file mode 100644 diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -250,7 +250,7 @@ void ContentSettingsRegistry::Init() { +@@ -255,7 +255,7 @@ void ContentSettingsRegistry::Init() { ContentSettingsInfo::INHERIT_IN_INCOGNITO, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); diff --git a/build/patches/Add-bookmark-import-export-actions.patch b/build/patches/Add-bookmark-import-export-actions.patch index d1d0f4ce6..5f0f9c69a 100644 --- a/build/patches/Add-bookmark-import-export-actions.patch +++ b/build/patches/Add-bookmark-import-export-actions.patch @@ -26,7 +26,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../bookmarks/BookmarkToolbarViewBinder.java | 6 + .../native_page/NativePageFactory.java | 11 +- chrome/browser/BUILD.gn | 11 +- - .../bookmarks/android/bookmark_bridge.cc | 283 ++++++++++++++++++ + .../bookmarks/android/bookmark_bridge.cc | 287 ++++++++++++++++++ .../bookmarks/android/bookmark_bridge.h | 30 +- .../browser/bookmarks/bookmark_html_writer.cc | 11 + .../dialogs/DownloadLocationCustomView.java | 8 +- @@ -53,7 +53,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ui/shell_dialogs/select_file_dialog_linux.cc | 4 + ui/shell_dialogs/select_file_dialog_linux.h | 2 + ui/shell_dialogs/select_file_dialog_win.cc | 5 + - 43 files changed, 918 insertions(+), 29 deletions(-) + 43 files changed, 922 insertions(+), 29 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/add-bookmark-import-export-actions.inc @@ -120,7 +120,7 @@ diff --git a/chrome/android/java/res/menu/bookmark_toolbar_menu_improved.xml b/c diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java --- a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java -@@ -11,6 +11,7 @@ import androidx.annotation.Nullable; +@@ -12,6 +12,7 @@ import androidx.annotation.Nullable; import org.chromium.base.jank_tracker.JankTracker; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; @@ -128,7 +128,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDe import org.chromium.chrome.browser.app.tab_activity_glue.ActivityTabWebContentsDelegateAndroid; import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider; import org.chromium.chrome.browser.compositor.CompositorViewHolder; -@@ -50,7 +51,7 @@ import org.chromium.ui.modaldialog.ModalDialogManager; +@@ -51,7 +52,7 @@ import org.chromium.ui.modaldialog.ModalDialogManager; * {@link ChromeTabbedActivity}. */ public class TabbedModeTabDelegateFactory implements TabDelegateFactory { @@ -137,7 +137,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDe private final BrowserControlsVisibilityDelegate mAppBrowserControlsVisibilityDelegate; private final Supplier mShareDelegateSupplier; private final Supplier mEphemeralTabCoordinatorSupplier; -@@ -77,7 +78,7 @@ public class TabbedModeTabDelegateFactory implements TabDelegateFactory { +@@ -79,7 +80,7 @@ public class TabbedModeTabDelegateFactory implements TabDelegateFactory { private NativePageFactory mNativePageFactory; public TabbedModeTabDelegateFactory( @@ -149,7 +149,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDe diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/BookmarkActivity.java -@@ -21,6 +21,11 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; +@@ -20,6 +20,11 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.embedder_support.util.UrlConstants; @@ -161,7 +161,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B /** * The activity that displays the bookmark UI on the phone. It keeps a {@link -@@ -33,6 +38,9 @@ public class BookmarkActivity extends SnackbarActivity { +@@ -32,6 +37,9 @@ public class BookmarkActivity extends SnackbarActivity { public static final int EDIT_BOOKMARK_REQUEST_CODE = 14; public static final String INTENT_VISIT_BOOKMARK_ID = "BookmarkEditActivity.VisitBookmarkId"; @@ -171,10 +171,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); -@@ -66,8 +74,23 @@ public class BookmarkActivity extends SnackbarActivity { - mBookmarkManagerCoordinator::onBackPressed, - SecondaryActivity.BOOKMARK); - } +@@ -62,8 +70,23 @@ public class BookmarkActivity extends SnackbarActivity { + getOnBackPressedDispatcher(), + mBookmarkManagerCoordinator, + SecondaryActivity.BOOKMARK); + + final boolean listenToActivityState = true; + mIntentRequestTracker = IntentRequestTracker.createFromActivity(this); @@ -195,7 +195,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B @Override protected void onDestroy() { super.onDestroy(); -@@ -77,6 +100,7 @@ public class BookmarkActivity extends SnackbarActivity { +@@ -73,6 +96,7 @@ public class BookmarkActivity extends SnackbarActivity { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -203,7 +203,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B if (requestCode == EDIT_BOOKMARK_REQUEST_CODE && resultCode == RESULT_OK) { BookmarkId bookmarkId = BookmarkId.getBookmarkIdFromString( -@@ -85,6 +109,14 @@ public class BookmarkActivity extends SnackbarActivity { +@@ -81,6 +105,14 @@ public class BookmarkActivity extends SnackbarActivity { } } @@ -221,62 +221,54 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/bookmarks/B diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java -@@ -4,7 +4,20 @@ - - package org.chromium.chrome.browser.bookmarks; +@@ -33,6 +33,46 @@ import org.chromium.url.GURL; + import java.util.ArrayList; + import java.util.List; +import android.app.Activity; +import android.content.Intent; +import android.content.Context; +import android.content.pm.PackageManager; +import android.content.DialogInterface; -+import android.content.Intent; -+import android.net.Uri; ++import android.content.res.Resources; +import android.content.ContentResolver; ++import android.net.Uri; +import android.provider.Browser; +import android.provider.DocumentsContract; +import android.Manifest.permission; ++import android.view.View; ++import android.view.LayoutInflater; ++ +import androidx.appcompat.app.AlertDialog; - import android.os.SystemClock; +import android.os.Build; - import android.text.TextUtils; - import android.util.Pair; - -@@ -36,6 +49,33 @@ import org.chromium.url.GURL; - import java.util.ArrayList; - import java.util.List; - ++ ++import java.io.File; ++ +import org.chromium.base.ContentUriUtils; ++import org.chromium.base.shared_preferences.SharedPreferencesManager; ++import org.chromium.base.task.AsyncTask; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.document.ChromeLauncherActivity; +import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; -+import org.chromium.base.shared_preferences.SharedPreferencesManager; ++import org.chromium.chrome.browser.download.DownloadLocationDialogType; ++import org.chromium.chrome.browser.download.dialogs.DownloadLocationDialogController; ++import org.chromium.chrome.browser.download.dialogs.DownloadLocationDialogCoordinator; ++import org.chromium.chrome.browser.download.dialogs.DownloadLocationCustomView; ++import org.chromium.chrome.browser.download.DirectoryOption; +import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.ui.base.PageTransition; +import org.chromium.ui.base.WindowAndroid; -+import org.chromium.ui.modaldialog.ModalDialogManager; -+ -+import android.view.View; -+import android.view.LayoutInflater; +import org.chromium.ui.modelutil.PropertyModel; ++import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.ui.modaldialog.ModalDialogProperties; +import org.chromium.ui.modaldialog.DialogDismissalCause; -+import org.chromium.chrome.browser.download.DownloadLocationDialogType; -+import org.chromium.chrome.browser.download.dialogs.DownloadLocationDialogController; -+import org.chromium.chrome.browser.download.dialogs.DownloadLocationDialogCoordinator; -+import org.chromium.chrome.browser.download.dialogs.DownloadLocationCustomView; -+import org.chromium.chrome.browser.download.DirectoryOption; -+import android.content.res.Resources; -+import org.chromium.base.task.AsyncTask; -+ -+import java.io.File; + /** * Provides the communication channel for Android to fetch and manipulate the bookmark model stored * in native. -@@ -435,6 +475,209 @@ class BookmarkBridge { +@@ -483,6 +523,209 @@ class BookmarkBridge { .getTotalBookmarkCount(mNativeBookmarkBridge, id.getId(), id.getType()); } @@ -486,7 +478,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** * Synchronously gets a list of bookmarks that match the specified search query. * -@@ -950,6 +1193,39 @@ class BookmarkBridge { +@@ -1032,6 +1275,39 @@ class BookmarkBridge { depthList.add(depth); } @@ -526,7 +518,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm private static List> createPairsList(int[] left, int[] right) { List> pairList = new ArrayList<>(); for (int i = 0; i < left.length; i++) { -@@ -994,6 +1270,10 @@ class BookmarkBridge { +@@ -1090,6 +1366,10 @@ class BookmarkBridge { void getChildIds( long nativeBookmarkBridge, long id, int type, List bookmarksList); @@ -569,7 +561,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm import org.chromium.ui.modaldialog.ModalDialogManager; import org.chromium.ui.modaldialog.ModalDialogManager.ModalDialogType; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; -@@ -320,6 +322,13 @@ public class BookmarkManagerCoordinator +@@ -317,6 +319,13 @@ public class BookmarkManagerCoordinator // Public API implementation. @@ -605,7 +597,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** Keeps track of whether drag is enabled / active for bookmark lists. */ private class BookmarkDragStateDelegate implements DragStateDelegate { private BookmarkDelegate mBookmarkDelegate; -@@ -551,6 +556,14 @@ class BookmarkManagerMediator +@@ -550,6 +555,14 @@ class BookmarkManagerMediator mNativePage = nativePage; } @@ -620,7 +612,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm /** See BookmarkManager(Coordinator)#updateForUrl */ void updateForUrl(String url) { // Bookmark model is null if the manager has been destroyed. -@@ -727,6 +740,16 @@ class BookmarkManagerMediator +@@ -726,6 +739,16 @@ class BookmarkManagerMediator } } @@ -653,14 +645,14 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm @@ -31,7 +34,7 @@ public class BookmarkPage extends BasicNativePage { ComponentName componentName, SnackbarManager snackbarManager, - boolean isIncognito, + Profile profile, - NativePageHost host) { + NativePageHost host, ChromeActivity activity) { super(host); mBookmarkManagerCoordinator = -@@ -44,6 +47,9 @@ public class BookmarkPage extends BasicNativePage { - Profile.getLastUsedRegularProfile(), +@@ -43,6 +46,9 @@ public class BookmarkPage extends BasicNativePage { + profile, new BookmarkUiPrefs(ChromeSharedPreferences.getInstance())); mBookmarkManagerCoordinator.setBasicNativePage(this); + mBookmarkManagerCoordinator.setWindow(activity.getWindowAndroid(), @@ -797,7 +789,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat private final BottomSheetController mBottomSheetController; private final BrowserControlsManager mBrowserControlsManager; private final Supplier mCurrentTabSupplier; -@@ -70,7 +71,7 @@ public class NativePageFactory { +@@ -71,7 +72,7 @@ public class NativePageFactory { private NativePageBuilder mNativePageBuilder; public NativePageFactory( @@ -806,7 +798,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat @NonNull BottomSheetController sheetController, @NonNull BrowserControlsManager browserControlsManager, @NonNull Supplier currentTabSupplier, -@@ -130,7 +131,7 @@ public class NativePageFactory { +@@ -134,7 +135,7 @@ public class NativePageFactory { @VisibleForTesting static class NativePageBuilder { @@ -815,8 +807,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat private final BottomSheetController mBottomSheetController; private final Supplier mUma; private final BrowserControlsManager mBrowserControlsManager; -@@ -146,7 +147,7 @@ public class NativePageFactory { - private final ObservableSupplier mTabContentManagerSupplier; +@@ -151,7 +152,7 @@ public class NativePageFactory { + private final ObservableSupplier mTabStripHeightSupplier; public NativePageBuilder( - Activity activity, @@ -824,10 +816,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat Supplier uma, BottomSheetController sheetController, BrowserControlsManager browserControlsManager, -@@ -208,7 +209,7 @@ public class NativePageFactory { +@@ -218,7 +219,7 @@ public class NativePageFactory { mActivity.getComponentName(), mSnackbarManagerSupplier.get(), - mTabModelSelector.isIncognitoSelected(), + tab.getProfile(), - new TabShim(tab, mBrowserControlsManager, mTabModelSelector)); + new TabShim(tab, mBrowserControlsManager, mTabModelSelector), mActivity); } @@ -836,7 +828,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -199,6 +199,8 @@ static_library("browser") { +@@ -197,6 +197,8 @@ static_library("browser") { "bluetooth/chrome_bluetooth_delegate_impl_client.h", "bookmarks/bookmark_model_factory.cc", "bookmarks/bookmark_model_factory.h", @@ -845,7 +837,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "bookmarks/chrome_bookmark_client.cc", "bookmarks/chrome_bookmark_client.h", "bookmarks/managed_bookmark_service_factory.cc", -@@ -1939,6 +1941,13 @@ static_library("browser") { +@@ -1923,6 +1925,13 @@ static_library("browser") { ] } @@ -859,7 +851,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn configs += [ "//build/config/compiler:wexit_time_destructors", "//build/config:precompiled_headers", -@@ -3664,8 +3673,6 @@ static_library("browser") { +@@ -3630,8 +3639,6 @@ static_library("browser") { "badging/badge_manager_factory.h", "banners/app_banner_manager_desktop.cc", "banners/app_banner_manager_desktop.h", @@ -871,7 +863,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc --- a/chrome/browser/bookmarks/android/bookmark_bridge.cc +++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc -@@ -56,6 +56,25 @@ +@@ -58,6 +58,28 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" @@ -893,11 +885,14 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" +#include "content/public/browser/browser_task_traits.h" ++#include "base/files/file_path.h" ++#include "ui/shell_dialogs/selected_file_info.h" ++#include "ui/shell_dialogs/select_file_dialog.h" + using base::android::AttachCurrentThread; using base::android::ConvertUTF16ToJavaString; using base::android::ConvertUTF8ToJavaString; -@@ -73,12 +92,96 @@ using bookmarks::android::JavaBookmarkIdGetType; +@@ -75,12 +97,96 @@ using bookmarks::android::JavaBookmarkIdGetType; using content::BrowserThread; using power_bookmarks::PowerBookmarkMeta; @@ -994,10 +989,10 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse class BookmarkTitleComparer { public: explicit BookmarkTitleComparer(BookmarkBridge* bookmark_bridge, -@@ -199,6 +302,10 @@ BookmarkBridge::~BookmarkBridge() { - if (partner_bookmarks_shim_) - partner_bookmarks_shim_->RemoveObserver(this); - reading_list_manager_->RemoveObserver(this); +@@ -221,6 +327,10 @@ BookmarkBridge::~BookmarkBridge() { + partner_bookmarks_shim_observation_.Reset(); + bookmark_model_observation_.Reset(); + profile_observation_.Reset(); + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (select_file_dialog_) @@ -1005,7 +1000,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse } void BookmarkBridge::Destroy(JNIEnv*) { -@@ -539,6 +646,182 @@ jint BookmarkBridge::GetTotalBookmarkCount( +@@ -638,6 +748,183 @@ jint BookmarkBridge::GetTotalBookmarkCount( return count; } @@ -1087,8 +1082,9 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + return std::make_unique(data); +} + -+void BookmarkBridge::FileSelected(const base::FilePath& path, int index, ++void BookmarkBridge::FileSelected(const ui::SelectedFileInfo& file, int index, + void* params) { ++ base::FilePath path = file.path(); + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()}, + base::BindOnce(&BookmarkBridge::FileSelectedImpl, @@ -1191,7 +1187,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser/bookmarks/android/bookmark_bridge.h --- a/chrome/browser/bookmarks/android/bookmark_bridge.h +++ b/chrome/browser/bookmarks/android/bookmark_bridge.h -@@ -20,6 +20,7 @@ +@@ -21,6 +21,7 @@ #include "base/supports_user_data.h" #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" #include "chrome/browser/image_service/image_service_factory.h" @@ -1199,7 +1195,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_observer.h" #include "chrome/browser/reading_list/android/reading_list_manager.h" -@@ -31,6 +32,9 @@ +@@ -33,6 +34,9 @@ #include "components/prefs/pref_change_registrar.h" #include "url/android/gurl_android.h" @@ -1209,22 +1205,22 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser class BookmarkBridgeTest; // The delegate to fetch bookmarks information for the Android native -@@ -42,7 +46,8 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -44,7 +48,8 @@ class BookmarkBridge : public ProfileObserver, + public bookmarks::BaseBookmarkModelObserver, public PartnerBookmarksShim::Observer, public ReadingListManager::Observer, - public ProfileObserver, - public base::SupportsUserData::Data { + public base::SupportsUserData::Data, + public ui::SelectFileDialog::Listener { public: - BookmarkBridge(Profile* profile, - bookmarks::BookmarkModel* model, -@@ -69,6 +74,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, + BookmarkBridge( + Profile* profile, +@@ -81,6 +86,12 @@ class BookmarkBridge : public ProfileObserver, bool IsDoingExtensiveChanges(JNIEnv* env); + // SelectFileDialog::Listener implementation. -+ void FileSelected(const base::FilePath& path, ++ void FileSelected(const ui::SelectedFileInfo& file, + int index, + void* params) override; + void FileSelectionCanceled(void* params) override; @@ -1232,7 +1228,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser jboolean IsEditBookmarksEnabled(JNIEnv* env); void LoadEmptyPartnerBookmarkShimForTesting(JNIEnv* env); -@@ -81,6 +92,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -93,6 +104,15 @@ class BookmarkBridge : public ProfileObserver, jlong id, jint type); @@ -1248,10 +1244,10 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser void GetAllFoldersWithDepths( JNIEnv* env, const base::android::JavaParamRef& j_folders_obj, -@@ -310,12 +330,16 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -340,12 +360,16 @@ class BookmarkBridge : public ProfileObserver, void DestroyJavaObject(); - raw_ptr profile_; + raw_ptr profile_; // weak + base::FilePath export_path_; + raw_ptr observer_; // weak + @@ -1265,9 +1261,9 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser // Information about the Partner bookmarks (must check for IsLoaded()). // This is owned by profile. -@@ -329,6 +353,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, - // Observes the profile destruction and creation. - base::ScopedObservation profile_observation_{this}; +@@ -371,6 +395,10 @@ class BookmarkBridge : public ProfileObserver, + ReadingListManager::Observer> + reading_list_manager_observations_{this}; + const std::string FileSelectedImpl(const base::FilePath& path); + void FileSelectedImplOnUIThread(const base::FilePath& path, @@ -1375,25 +1371,25 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc -@@ -189,6 +189,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -176,6 +176,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { + &kCacheActivityTaskID, &kCastDeviceFilter, &kClearOmniboxFocusAfterNavigation, - &kCloseTabSaveTabList, + &kBookmarksExportUseSaf, - &kCriticalPersistedTabData, &kCreateNewTabInitializeRenderer, - &kCCTBottomBarSwipeUpGesture, + &kCCTBrandTransparencyMemoryImprovement, + &kCCTClientDataHeader, 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 -@@ -494,6 +494,7 @@ public abstract class ChromeFeatureList { +@@ -492,6 +492,7 @@ public abstract class ChromeFeatureList { public static final String USER_BYPASS_UI = "UserBypassUI"; public static final String VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR = "VerticalAutomotiveBackButtonToolbar"; + public static final String BOOKMARKS_EXPORT_USESAF = "BookmarksExportUseSaf"; - public static final String VOICE_BUTTON_IN_TOP_TOOLBAR = "VoiceButtonInTopToolbar"; public static final String VOICE_SEARCH_AUDIO_CAPTURE_POLICY = "VoiceSearchAudioCapturePolicy"; - public static final String WEBNOTES_STYLIZE = "WebNotesStylize"; + public static final String WEB_APK_ALLOW_ICON_UPDATE = "WebApkAllowIconUpdate"; + public static final String WEB_APK_BACKUP_AND_RESTORE_BACKEND = "WebApkBackupAndRestoreBackend"; diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc --- a/chrome/browser/importer/profile_writer.cc +++ b/chrome/browser/importer/profile_writer.cc @@ -1449,7 +1445,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro /** * Whether Chrome is set as the default browser. -@@ -938,6 +940,7 @@ public final class ChromePreferenceKeys { +@@ -911,6 +913,7 @@ public final class ChromePreferenceKeys { AUTOFILL_ASSISTANT_PROACTIVE_HELP_ENABLED, APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE, APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO, @@ -1488,7 +1484,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn -@@ -403,6 +403,9 @@ static_library("common_lib") { +@@ -407,6 +407,9 @@ static_library("common_lib") { sources += [ "media/chrome_media_drm_bridge_client.cc", "media/chrome_media_drm_bridge_client.h", @@ -1762,7 +1758,7 @@ diff --git a/ui/android/java/strings/android_ui_strings.grd b/ui/android/java/st diff --git a/ui/shell_dialogs/select_file_dialog.h b/ui/shell_dialogs/select_file_dialog.h --- a/ui/shell_dialogs/select_file_dialog.h +++ b/ui/shell_dialogs/select_file_dialog.h -@@ -213,6 +213,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -199,6 +199,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog const GURL* caller = nullptr); bool HasMultipleFileTypeChoices(); @@ -1774,7 +1770,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog.h b/ui/shell_dialogs/select_fil diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/select_file_dialog_android.cc --- a/ui/shell_dialogs/select_file_dialog_android.cc +++ b/ui/shell_dialogs/select_file_dialog_android.cc -@@ -142,6 +142,12 @@ void SelectFileDialogImpl::SelectFileImpl( +@@ -137,6 +137,12 @@ void SelectFileDialogImpl::SelectFileImpl( owning_window->GetJavaObject()); } @@ -1828,7 +1824,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog_linux.h b/ui/shell_dialogs/sele diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc --- a/ui/shell_dialogs/select_file_dialog_win.cc +++ b/ui/shell_dialogs/select_file_dialog_win.cc -@@ -193,6 +193,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog, +@@ -194,6 +194,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog, int index); bool HasMultipleFileTypeChoicesImpl() override; @@ -1836,7 +1832,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/selec // Returns the filter to be used while displaying the open/save file dialog. // This is computed from the extensions for the file types being opened. -@@ -271,6 +272,10 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { +@@ -272,6 +273,10 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { return has_multiple_file_type_choices_; } diff --git a/build/patches/Add-cromite-flags-support.patch b/build/patches/Add-cromite-flags-support.patch index 57c21dd5e..c2376a6d5 100644 --- a/build/patches/Add-cromite-flags-support.patch +++ b/build/patches/Add-cromite-flags-support.patch @@ -16,7 +16,8 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- base/BUILD.gn | 4 +- base/android/feature_map.cc | 8 +- - base/feature_list.cc | 80 ++++++++++ + .../base/cached_flags/CachedFlag.java | 8 +- + base/feature_list.cc | 78 +++++++++ base/feature_list.h | 72 ++++++++- build/android/gyp/java_cpp_features.py | 17 ++ chrome/android/java/res/values/values.xml | 3 + @@ -25,10 +26,9 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../browser/settings/SettingsActivity.java | 36 +++++ chrome/browser/about_flags.cc | 11 ++ chrome/browser/browser_features.cc | 1 + - chrome/browser/flags/BUILD.gn | 12 ++ + chrome/browser/flags/BUILD.gn | 13 ++ .../flags/android/chrome_feature_list.cc | 1 + .../flags/android/chrome_feature_list.h | 1 + - .../chrome/browser/flags/CachedFlag.java | 6 + .../browser/flags/ChromeFeatureList.java | 13 +- .../flags/cromite/include_all_directory.java | 1 + .../java_template/CromiteCachedFlag.java.tmpl | 47 ++++++ @@ -87,7 +87,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html services/network/public/cpp/features.h | 1 + third_party/blink/common/features.cc | 1 + third_party/blink/public/common/features.h | 1 + - 73 files changed, 737 insertions(+), 18 deletions(-) + 73 files changed, 737 insertions(+), 19 deletions(-) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt @@ -119,7 +119,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/base/BUILD.gn b/base/BUILD.gn --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -206,6 +206,8 @@ buildflag_header("message_pump_buildflags") { +@@ -207,6 +207,8 @@ buildflag_header("message_pump_buildflags") { # This does not include test code (test support and anything in the test # directory) which should use source_set as is recommended for GN targets). component("base") { @@ -128,15 +128,15 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn sources = [ "allocator/allocator_check.cc", "allocator/allocator_check.h", -@@ -1030,7 +1032,7 @@ component("base") { +@@ -1049,7 +1051,7 @@ component("base") { "//build/config/compiler:wglobal_constructors", ] - deps = [ + deps += [ + ":check_version_internal", ":message_pump_buildflags", "//base/allocator:buildflags", - "//base/allocator/partition_allocator:raw_ptr", diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc --- a/base/android/feature_map.cc +++ b/base/android/feature_map.cc @@ -157,14 +157,38 @@ diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc return base::FeatureList::IsEnabled(*feature); } +diff --git a/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java b/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java +--- a/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java ++++ b/base/android/java/src/org/chromium/base/cached_flags/CachedFlag.java +@@ -124,7 +124,7 @@ public class CachedFlag extends Flag { + .writeBoolean(getSharedPreferenceKey(), isEnabledInNative); + } + +- String getSharedPreferenceKey() { ++ public String getSharedPreferenceKey() { + return CachedFlagsSharedPreferences.FLAGS_CACHED.createKey(mFeatureName); + } + +@@ -152,6 +152,12 @@ public class CachedFlag extends Flag { + .removeKeysWithPrefix(CachedFlagsSharedPreferences.FLAGS_CACHED); + } + ++ public void setValueReturnedOverride(@Nullable Boolean value) { ++ synchronized (ValuesReturned.sBoolValues) { ++ ValuesReturned.sBoolValues.put(getSharedPreferenceKey(), value); ++ } ++ } ++ + /** Create a Map of feature names -> {@link CachedFlag} from multiple lists of CachedFlags. */ + public static Map createCachedFlagMap( + List> allCachedFlagsLists) { diff --git a/base/feature_list.cc b/base/feature_list.cc --- a/base/feature_list.cc +++ b/base/feature_list.cc -@@ -30,6 +30,33 @@ - #include "base/strings/stringprintf.h" - #include "build/build_config.h" +@@ -37,6 +37,31 @@ + + namespace base { -+namespace base { +namespace internal { + +using DefaultStateOverrides = @@ -189,12 +213,11 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc +} + +} // namespace internal -+} // namespace base + - namespace base { - namespace { -@@ -441,6 +468,48 @@ bool FeatureList::IsEnabled(const Feature& feature) { + + // Pointer to the FeatureList instance singleton that was set via +@@ -451,6 +476,48 @@ bool FeatureList::IsEnabled(const Feature& feature) { return g_feature_list_instance->IsFeatureEnabled(feature); } @@ -243,7 +266,7 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc // static bool FeatureList::IsValidFeatureOrFieldTrialName(StringPiece name) { return IsStringASCII(name) && name.find_first_of(",<*") == std::string::npos; -@@ -662,6 +731,17 @@ void FeatureList::AddEarlyAllowedFeatureForTesting(std::string feature_name) { +@@ -693,6 +760,17 @@ void FeatureList::VisitFeaturesAndParams(FeatureVisitor& visitor) { void FeatureList::FinalizeInitialization() { DCHECK(!initialized_); @@ -264,7 +287,7 @@ diff --git a/base/feature_list.cc b/base/feature_list.cc diff --git a/base/feature_list.h b/base/feature_list.h --- a/base/feature_list.h +++ b/base/feature_list.h -@@ -94,8 +94,10 @@ enum FeatureState { +@@ -99,8 +99,10 @@ enum FeatureState { // [1]: // https://crsrc.org/c/docs/speed/binary_size/android_binary_size_trybot.md#Mutable-Constants struct BASE_EXPORT LOGICALLY_CONST Feature { @@ -277,7 +300,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h #if BUILDFLAG(ENABLE_BANNED_BASE_FEATURE_PREFIX) if (StringPiece(name).find(BUILDFLAG(BANNED_BASE_FEATURE_PREFIX)) == 0) { LOG(FATAL) << "Invalid feature name " << name << " starts with " -@@ -121,6 +123,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { +@@ -126,6 +128,9 @@ struct BASE_EXPORT LOGICALLY_CONST Feature { // command line switch. const FeatureState default_state; @@ -287,7 +310,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h private: friend class FeatureList; -@@ -396,6 +401,11 @@ class BASE_EXPORT FeatureList { +@@ -401,6 +406,11 @@ class BASE_EXPORT FeatureList { // instance, which is checked in builds with DCHECKs enabled. static bool IsEnabled(const Feature& feature); @@ -299,7 +322,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h // Some characters are not allowed to appear in feature names or the // associated field trial names, as they are used as special characters for // command-line serialization. This function checks that the strings are ASCII -@@ -652,4 +662,62 @@ class BASE_EXPORT FeatureList { +@@ -665,4 +675,62 @@ class BASE_EXPORT FeatureList { } // namespace base @@ -321,7 +344,7 @@ diff --git a/base/feature_list.h b/base/feature_list.h +} // namespace base + +#define CROMITE_FEATURE(feature, name, default_state) \ -+ CONSTINIT const base::Feature feature(name, default_state, true, true); \ ++ constinit const base::Feature feature(name, default_state, true, true); \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \ + static const ::base::internal::FeatureDefaultStateOverrider \ @@ -409,7 +432,7 @@ diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -58,6 +58,10 @@ found in the LICENSE file. +@@ -59,6 +59,10 @@ found in the LICENSE file. android:title="@string/tabgrid_use_icons_title" android:summary="@string/tabgrid_use_icons_summary" android:defaultValue="false" /> @@ -443,7 +466,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; -@@ -74,6 +75,7 @@ import org.chromium.chrome.browser.ui.device_lock.MissingDeviceLockLauncher; +@@ -72,6 +73,7 @@ import org.chromium.chrome.browser.ui.device_lock.MissingDeviceLockLauncher; import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; @@ -451,7 +474,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin import org.chromium.components.browser_ui.accessibility.AccessibilitySettings; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerFactory; -@@ -113,6 +115,36 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -112,6 +114,36 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity implements PreferenceFragmentCompat.OnPreferenceStartFragmentCallback, SnackbarManageable, DisplayStyleObserver { @@ -488,7 +511,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public static final String EXTRA_SHOW_FRAGMENT = "show_fragment"; -@@ -365,6 +397,10 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -364,6 +396,10 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity ((AccessibilitySettings) fragment) .getDelegate()).setSnackbarManager(mSnackbarManager); } @@ -502,7 +525,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -369,6 +369,10 @@ using flags_ui::kOsLinux; +@@ -372,6 +372,10 @@ using flags_ui::kOsLinux; using flags_ui::kOsMac; using flags_ui::kOsWin; @@ -513,9 +536,9 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc namespace about_flags { namespace { -@@ -3947,6 +3951,10 @@ const flags_ui::FeatureEntry::FeatureVariation - std::size(kDesktopPWAsLinkCapturingDefaultOff), nullptr}}; - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +@@ -3776,6 +3780,10 @@ const FeatureEntry::FeatureVariation + {"experimental V2", kCompressionDictionaryTransportBackendVersionV2, + std::size(kCompressionDictionaryTransportBackendVersionV2), nullptr}}; +#define FEATURE_PARAM_SECTION +#include "cromite_flags/chrome_browser_about_flags_cc.inc" @@ -524,7 +547,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc // RECORDING USER METRICS FOR FLAGS: // ----------------------------------------------------------------------------- // The first line of the entry is the internal name. -@@ -3973,6 +3981,9 @@ const flags_ui::FeatureEntry::FeatureVariation +@@ -3802,6 +3810,9 @@ const FeatureEntry::FeatureVariation const FeatureEntry kFeatureEntries[] = { // Include generated flags for flag unexpiry; see //docs/flag_expiry.md and // //tools/flags/generate_unexpire_flags.py. @@ -537,8 +560,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc --- a/chrome/browser/browser_features.cc +++ b/chrome/browser/browser_features.cc -@@ -323,4 +323,5 @@ BASE_FEATURE(kPayloadTestComponent, - "PayloadTestComponent", +@@ -335,4 +335,5 @@ BASE_FEATURE(kOmniboxTriggerForNoStatePrefetch, + "OmniboxTriggerForNoStatePrefetch", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/chrome_browser_browser_features_cc.inc" @@ -546,19 +569,22 @@ diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_feature diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn --- a/chrome/browser/flags/BUILD.gn +++ b/chrome/browser/flags/BUILD.gn -@@ -25,7 +25,11 @@ android_library("java") { - "android/java/src/org/chromium/chrome/browser/flags/ValuesReturned.java", - "android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java", +@@ -13,9 +13,14 @@ android_library("java") { + "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureMap.java", + "android/java/src/org/chromium/chrome/browser/flags/ChromeSessionState.java", ] + sources += [ + "android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java", + ] + public_deps = [ "//base:base_cached_flags_java" ] deps = [ + ":java_cromite_cached_flags", "//base:base_java", ++ "//base:base_cached_flags_java", + "//base/version_info/android:version_constants_java", "//build:chromeos_buildflags", "//build/android:build_java", -@@ -36,12 +40,20 @@ android_library("java") { +@@ -25,12 +30,20 @@ android_library("java") { "//third_party/jni_zero:jni_zero_java", ] srcjar_deps = [ @@ -582,8 +608,8 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn 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 -@@ -1216,5 +1216,6 @@ BASE_FEATURE(kWebApkInstallService, - "WebApkInstallService", +@@ -1013,5 +1013,6 @@ BASE_FEATURE(kWebApkBackupAndRestoreBackend, + "WebApkBackupAndRestoreBackend", base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/chrome_browser_flags_android_chrome_feature_list_cc.inc" @@ -592,7 +618,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h -@@ -230,6 +230,7 @@ constexpr base::FeatureParam kAuxiliarySearchMaxTabsCountParam( +@@ -195,6 +195,7 @@ constexpr base::FeatureParam kAuxiliarySearchMaxTabsCountParam( "auxiliary_search_max_donation_tab", 100); @@ -600,28 +626,12 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser } // namespace android } // namespace chrome -diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFlag.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFlag.java ---- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFlag.java -+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFlag.java -@@ -149,6 +149,12 @@ public class CachedFlag extends Flag { - .removeKeysWithPrefix(ChromePreferenceKeys.FLAGS_CACHED); - } - -+ public void setValueReturnedOverride(@Nullable Boolean value) { -+ synchronized (ValuesReturned.sBoolValues) { -+ ValuesReturned.sBoolValues.put(getSharedPreferenceKey(), value); -+ } -+ } -+ - /** Create a Map of feature names -> {@link CachedFlag} from multiple lists of CachedFlags. */ - public static Map createCachedFlagMap( - List> allCachedFlagsLists) { 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 -@@ -7,6 +7,10 @@ package org.chromium.chrome.browser.flags; - import org.chromium.base.FeatureMap; - import org.chromium.base.MutableFlagWithSafeDefault; +@@ -13,6 +13,10 @@ import org.chromium.base.cached_flags.DoubleCachedFieldTrialParameter; + import org.chromium.base.cached_flags.IntCachedFieldTrialParameter; + import org.chromium.base.cached_flags.StringCachedFieldTrialParameter; +import org.chromium.chrome.browser.flags.cromite.CromiteCachedFlagImplBase; +import java.util.Arrays; @@ -630,16 +640,16 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f import java.util.List; import java.util.Map; -@@ -673,7 +677,7 @@ public abstract class ChromeFeatureList { +@@ -667,7 +671,7 @@ public abstract class ChromeFeatureList { public static final CachedFlag sVerticalAutomotiveBackButtonToolbar = - new CachedFlag(VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR, false); + newCachedFlag(VERTICAL_AUTOMOTIVE_BACK_BUTTON_TOOLBAR, false); - public static final List sFlagsCachedFullBrowser = + public static final List sFlagsCachedFullBrowserChromium = List.of( sAllowUserCertificates, sAndroidAppIntegration, -@@ -755,6 +759,13 @@ public abstract class ChromeFeatureList { +@@ -748,6 +752,13 @@ public abstract class ChromeFeatureList { sUseLibunwindstackNativeUnwinderAndroid, sVerticalAutomotiveBackButtonToolbar); @@ -689,7 +699,7 @@ new file mode 100644 +import java.util.ArrayList; +import java.util.List; + -+import org.chromium.chrome.browser.flags.CachedFlag; ++import org.chromium.base.cached_flags.CachedFlag; + +{IMPORT_CLAUSE} + @@ -806,7 +816,7 @@ new file mode 100644 diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc -@@ -429,4 +429,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, +@@ -435,4 +435,5 @@ BASE_FEATURE(kStopLoadingAnimationForHiddenWindow, "StopLoadingAnimationForHiddenWindow", base::FEATURE_ENABLED_BY_DEFAULT); @@ -815,7 +825,7 @@ diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc -@@ -1751,4 +1751,5 @@ BASE_FEATURE(kSupportsRtcWakeOver24Hours, +@@ -1708,4 +1708,5 @@ BASE_FEATURE(kSupportsRtcWakeOver24Hours, base::FEATURE_ENABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -882,7 +892,7 @@ diff --git a/components/browser_ui/settings/android/widget/java/src/org/chromium diff --git a/components/components_strings.grd b/components/components_strings.grd --- a/components/components_strings.grd +++ b/components/components_strings.grd -@@ -339,6 +339,7 @@ +@@ -338,6 +338,7 @@ @@ -893,9 +903,9 @@ diff --git a/components/components_strings.grd b/components/components_strings.g diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc --- a/components/content_settings/core/common/features.cc +++ b/components/content_settings/core/common/features.cc -@@ -100,5 +100,6 @@ BASE_FEATURE(kHostIndexedMetadataGrants, - const base::FeatureParam kMetadataGrantsThreshold{ - &kHostIndexedMetadataGrants, kMetadataGrantsThresholdName, 1}; +@@ -111,5 +111,6 @@ BASE_FEATURE(kIndexedHostContentSettingsMap, + "IndexedHostContentSettingsMap", + base::FEATURE_DISABLED_BY_DEFAULT); +#include "cromite_flags/components_content_settings_core_common_features_cc.inc" } // namespace features @@ -1280,7 +1290,7 @@ diff --git a/components/flags_ui/resources/flags_browser_proxy.ts b/components/f diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc --- a/components/offline_pages/core/offline_page_feature.cc +++ b/components/offline_pages/core/offline_page_feature.cc -@@ -82,4 +82,5 @@ bool IsOfflinePagesNetworkStateLikelyUnknown() { +@@ -55,4 +55,5 @@ bool IsOfflinePagesNetworkStateLikelyUnknown() { return base::FeatureList::IsEnabled(kOfflinePagesNetworkStateLikelyUnknown); } @@ -1289,7 +1299,7 @@ diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/ diff --git a/components/offline_pages/core/offline_page_feature.h b/components/offline_pages/core/offline_page_feature.h --- a/components/offline_pages/core/offline_page_feature.h +++ b/components/offline_pages/core/offline_page_feature.h -@@ -64,6 +64,7 @@ bool IsOnTheFlyMhtmlHashComputationEnabled(); +@@ -50,6 +50,7 @@ bool IsOnTheFlyMhtmlHashComputationEnabled(); // offline pages to avoid showing them even when the device is online. bool IsOfflinePagesNetworkStateLikelyUnknown(); @@ -1300,7 +1310,7 @@ diff --git a/components/offline_pages/core/offline_page_feature.h b/components/o diff --git a/components/permissions/features.cc b/components/permissions/features.cc --- a/components/permissions/features.cc +++ b/components/permissions/features.cc -@@ -135,6 +135,7 @@ BASE_FEATURE(kShowRelatedWebsiteSetsPermissionGrants, +@@ -142,6 +142,7 @@ BASE_FEATURE(kShowRelatedWebsiteSetsPermissionGrants, "ShowRelatedWebsiteSetsPermissionGrants", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1323,7 +1333,7 @@ diff --git a/components/version_ui/version_handler_helper.cc b/components/versio diff --git a/content/common/features.cc b/content/common/features.cc --- a/content/common/features.cc +++ b/content/common/features.cc -@@ -586,4 +586,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, +@@ -581,4 +581,5 @@ BASE_FEATURE(kWindowOpenFileSelectFix, // Please keep features in alphabetical order. @@ -1332,7 +1342,7 @@ diff --git a/content/common/features.cc b/content/common/features.cc diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc -@@ -1388,4 +1388,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { +@@ -1418,4 +1418,5 @@ bool IsVideoCaptureServiceEnabledForBrowserProcess() { VideoCaptureServiceConfiguration::kEnabledForBrowserProcess; } @@ -1341,7 +1351,7 @@ diff --git a/content/public/common/content_features.cc b/content/public/common/c diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h -@@ -338,6 +338,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); +@@ -341,6 +341,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcPipeWireCapturer); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForOutOfProcess(); CONTENT_EXPORT bool IsVideoCaptureServiceEnabledForBrowserProcess(); @@ -1639,7 +1649,7 @@ new file mode 100755 diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc -@@ -1763,5 +1763,5 @@ uint32_t GetPassthroughAudioFormats() { +@@ -1821,5 +1821,5 @@ uint32_t GetPassthroughAudioFormats() { return 0; #endif // BUILDFLAG(ENABLE_PASSTHROUGH_AUDIO_CODECS) } @@ -1649,7 +1659,7 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc diff --git a/media/base/media_switches.h b/media/base/media_switches.h --- a/media/base/media_switches.h +++ b/media/base/media_switches.h -@@ -519,5 +519,5 @@ MEDIA_EXPORT bool IsOutOfProcessVideoDecodingEnabled(); +@@ -530,5 +530,5 @@ MEDIA_EXPORT bool IsOutOfProcessVideoDecodingEnabled(); MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); } // namespace media @@ -1659,7 +1669,7 @@ diff --git a/media/base/media_switches.h b/media/base/media_switches.h diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc -@@ -492,4 +492,5 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired, +@@ -521,4 +521,5 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired, "TreatHTTPExpiresHeaderValueZeroAsExpired", base::FEATURE_ENABLED_BY_DEFAULT); @@ -1668,7 +1678,7 @@ diff --git a/net/base/features.cc b/net/base/features.cc diff --git a/net/base/features.h b/net/base/features.h --- a/net/base/features.h +++ b/net/base/features.h -@@ -487,6 +487,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kUseAlpsNewCodepoint); +@@ -512,6 +512,7 @@ NET_EXPORT BASE_DECLARE_FEATURE(kUseNewAlpsCodepointQUIC); // while on stable channels. NET_EXPORT BASE_DECLARE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpired); @@ -1679,8 +1689,8 @@ diff --git a/net/base/features.h b/net/base/features.h diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc -@@ -454,4 +454,5 @@ const base::FeatureParam kSkipTpcdMitigationsForAdsSupport{ - &kSkipTpcdMitigationsForAds, /*name=*/"SkipTpcdMitigationsForAdsSupport", +@@ -477,4 +477,5 @@ const base::FeatureParam kSkipTpcdMitigationsForAdsTopLevelTrial{ + /*name=*/"SkipTpcdMitigationsForAdsTopLevelTrial", /*default_value=*/false}; +#include "cromite_flags/services_network_public_cpp_features_cc.inc" @@ -1688,9 +1698,9 @@ diff --git a/services/network/public/cpp/features.cc b/services/network/public/c diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h -@@ -181,6 +181,7 @@ extern const base::FeatureParam kSkipTpcdMitigationsForAdsMetadata; +@@ -196,6 +196,7 @@ extern const base::FeatureParam kSkipTpcdMitigationsForAdsTrial; COMPONENT_EXPORT(NETWORK_CPP) - extern const base::FeatureParam kSkipTpcdMitigationsForAdsSupport; + extern const base::FeatureParam kSkipTpcdMitigationsForAdsTopLevelTrial; +#include "cromite_flags/services_network_public_cpp_features_h.inc" } // namespace features @@ -1699,7 +1709,7 @@ diff --git a/services/network/public/cpp/features.h b/services/network/public/cp diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc -@@ -2305,5 +2305,6 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpiredInBlink, +@@ -2404,5 +2404,6 @@ BASE_FEATURE(kTreatHTTPExpiresHeaderValueZeroAsExpiredInBlink, "TreatHTTPExpiresHeaderValueZeroAsExpiredInBlink", base::FEATURE_ENABLED_BY_DEFAULT); @@ -1709,9 +1719,9 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h -@@ -1507,6 +1507,7 @@ BLINK_COMMON_EXPORT extern const base::FeatureParam kPixelDistanceToExpand; - BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( - kTreatHTTPExpiresHeaderValueZeroAsExpiredInBlink); +@@ -1541,6 +1541,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( + // Don't require FCP for the page to turn interactive. Useful for testing. + BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kInteractiveDetectorIgnoreFcp); +#include "cromite_flags/third_party_blink_common_features_h.inc" } // namespace features diff --git a/build/patches/Add-custom-tab-intents-privacy-option.patch b/build/patches/Add-custom-tab-intents-privacy-option.patch index cc948b9e6..517ffe100 100644 --- a/build/patches/Add-custom-tab-intents-privacy-option.patch +++ b/build/patches/Add-custom-tab-intents-privacy-option.patch @@ -13,13 +13,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- .../java/res/xml/privacy_preferences.xml | 10 ++++++++ .../browser/LaunchIntentDispatcher.java | 21 ++++++++++++++++ + .../customtabs/CustomTabsConnection.java | 1 + .../IncognitoCustomTabIntentDataProvider.java | 6 +++++ .../privacy/settings/PrivacySettings.java | 24 +++++++++++++++++++ .../chrome/browser/tab/TabAssociatedApp.java | 6 ++++- .../strings/android_chrome_strings.grd | 14 +++++++++++ .../core/common/language_experiments.cc | 1 + - .../add-custom-tab-intents-privacy-option.inc | 2 ++ - 8 files changed, 83 insertions(+), 1 deletion(-) + .../add-custom-tab-intents-privacy-option.inc | 1 + + 9 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml @@ -45,7 +46,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java --- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java -@@ -56,6 +56,9 @@ import java.lang.annotation.Retention; +@@ -55,6 +55,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Set; @@ -55,7 +56,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis /** * Dispatches incoming intents to the appropriate activity based on the current configuration and * Intent fired. -@@ -247,6 +250,9 @@ public class LaunchIntentDispatcher { +@@ -244,6 +247,9 @@ public class LaunchIntentDispatcher { */ public static boolean isCustomTabIntent(Intent intent) { if (intent == null) return false; @@ -65,7 +66,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis Log.w( TAG, "CustomTabsIntent#shouldAlwaysUseBrowserUI() = " -@@ -268,6 +274,10 @@ public class LaunchIntentDispatcher { +@@ -265,6 +271,10 @@ public class LaunchIntentDispatcher { newIntent.setData(uri); newIntent.setClassName(context, CustomTabActivity.class.getName()); @@ -76,7 +77,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis // Since configureIntentForResizableCustomTab() might change the componenet/class // associated with the passed intent, it needs to be called after #setClassName(context, // CustomTabActivity.class.getName()); -@@ -413,6 +423,17 @@ public class LaunchIntentDispatcher { +@@ -410,6 +420,17 @@ public class LaunchIntentDispatcher { if (Intent.ACTION_VIEW.equals(newIntent.getAction()) && !IntentHandler.wasIntentSenderChrome(newIntent)) { @@ -94,6 +95,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis if (!chromeTabbedTaskExists()) { newIntent.putExtra(IntentHandler.EXTRA_STARTED_TABBED_CHROME_TASK, true); } +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +@@ -849,6 +849,7 @@ public class CustomTabsConnection { + PostTask.postTask( + TaskTraits.UI_DEFAULT, + () -> { ++ if ((true)) return; // Disable CCTPostMessageAPI + // Attempt to verify origin synchronously. If successful directly initialize + // postMessage channel for session. + Uri verifiedOrigin = verifyOriginForSession(session, uid, postMessageOrigin); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java @@ -130,7 +142,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { getActivity().setTitle(R.string.prefs_privacy_security); -@@ -276,6 +279,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -274,6 +277,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment new SpanApplier.SpanInfo("", "", servicesLink)); } @@ -140,7 +152,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting @Override public boolean onPreferenceChange(Preference preference, Object newValue) { String key = preference.getKey(); -@@ -292,6 +298,14 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -290,6 +296,14 @@ public class PrivacySettings extends ChromeBaseSettingsFragment } else if (PREF_SEARCH_SUGGESTIONS.equals(key)) { UserPrefs.get(getProfile()) .setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue); @@ -155,7 +167,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting } return true; } -@@ -314,6 +328,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -312,6 +326,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment UserPrefs.get(getProfile()).getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED)); } @@ -191,7 +203,7 @@ diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAsso diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -5056,6 +5056,20 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Resume @@ -225,7 +237,6 @@ diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/a new file mode 100644 --- /dev/null +++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc -@@ -0,0 +1,2 @@ +@@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kCCTIntentFeatureOverrides); -+SET_CROMITE_FEATURE_DISABLED(kCCTPostMessageAPI); -- diff --git a/build/patches/Add-exit-menu-item.patch b/build/patches/Add-exit-menu-item.patch index aa7a6acd1..da86befa7 100644 --- a/build/patches/Add-exit-menu-item.patch +++ b/build/patches/Add-exit-menu-item.patch @@ -59,7 +59,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLife diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -252,6 +252,8 @@ import java.util.Map; +@@ -258,6 +258,8 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; @@ -68,7 +68,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct /** * This is the main activity for ChromeMobile when not running in document mode. All the tabs * are accessible via a chrome specific tab switching UI. -@@ -2762,6 +2764,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2616,6 +2617,11 @@ public abstract class ChromeActivity return true; } @@ -98,8 +98,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv + } + if (id == R.id.update_menu_id) { - UpdateMenuItemHelper.getInstance().onMenuItemClicked(this); - return true; + UpdateMenuItemHelper.getInstance( + getProfileProviderSupplier().get().getOriginalProfile()) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java @@ -119,7 +119,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLife diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -3659,6 +3659,9 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Dark theme diff --git a/build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch b/build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch index 30bbe2cd4..6ce796ddd 100644 --- a/build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch +++ b/build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch @@ -19,14 +19,14 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/ --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc @@ -20,6 +20,7 @@ - #include "base/barrier_callback.h" + #include "base/check_op.h" #include "base/containers/contains.h" +#include "base/command_line.h" #include "base/feature_list.h" #include "base/format_macros.h" #include "base/functional/bind.h" -@@ -336,6 +337,15 @@ AutocompleteController::AutocompleteController( +@@ -392,6 +393,15 @@ AutocompleteController::AutocompleteController( provider_client_->GetOmniboxTriggeredFeatureService()), steady_state_omnibox_position_( metrics::OmniboxEventProto::UNKNOWN_POSITION) { @@ -45,7 +45,7 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/ diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc -@@ -478,6 +478,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, +@@ -479,6 +479,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input, if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY) matches_.push_back(what_you_typed_match); @@ -66,7 +66,7 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/ #include "base/functional/callback.h" #include "base/i18n/break_iterator.h" #include "base/i18n/case_conversion.h" -@@ -636,6 +637,9 @@ void SearchProvider::Run(bool query_is_private) { +@@ -643,6 +644,9 @@ void SearchProvider::Run(bool query_is_private) { } void SearchProvider::DoHistoryQuery(bool minimal_changes) { diff --git a/build/patches/Add-flag-to-configure-maximum-connections-per-host.patch b/build/patches/Add-flag-to-configure-maximum-connections-per-host.patch index 6c7edc640..4a91a3147 100644 --- a/build/patches/Add-flag-to-configure-maximum-connections-per-host.patch +++ b/build/patches/Add-flag-to-configure-maximum-connections-per-host.patch @@ -103,7 +103,7 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket #include "net/ssl/ssl_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/gurl.h" -@@ -183,6 +187,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool( +@@ -168,6 +172,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool( int ClientSocketPoolManager::max_sockets_per_group( HttpNetworkSession::SocketPoolType pool_type) { DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES); diff --git a/build/patches/Add-flag-to-disable-IPv6-probes.patch b/build/patches/Add-flag-to-disable-IPv6-probes.patch index dd80869e8..1c19d3e0b 100644 --- a/build/patches/Add-flag-to-disable-IPv6-probes.patch +++ b/build/patches/Add-flag-to-disable-IPv6-probes.patch @@ -4,12 +4,12 @@ Subject: Add flag to disable IPv6 probes License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - .../add-flag-to-disable-IPv6-probes.inc | 8 ++++++++ - .../features_cc/add-flag-to-disable-IPv6-probes.inc | 3 +++ - .../features_h/add-flag-to-disable-IPv6-probes.inc | 2 ++ - net/BUILD.gn | 1 + - net/dns/host_resolver_manager.cc | 11 +++++++++++ - 5 files changed, 25 insertions(+) + .../about_flags_cc/add-flag-to-disable-IPv6-probes.inc | 8 ++++++++ + .../base/features_cc/add-flag-to-disable-IPv6-probes.inc | 3 +++ + .../base/features_h/add-flag-to-disable-IPv6-probes.inc | 2 ++ + net/BUILD.gn | 1 + + net/dns/host_resolver_manager.cc | 8 ++++++++ + 5 files changed, 22 insertions(+) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc create mode 100644 cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc create mode 100644 cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc @@ -45,7 +45,7 @@ new file mode 100644 diff --git a/net/BUILD.gn b/net/BUILD.gn --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -1033,6 +1033,7 @@ component("net") { +@@ -1028,6 +1028,7 @@ component("net") { "//build:chromeos_buildflags", "//components/miracle_parameter/common", "//net/http:transport_security_state_generated_files", @@ -56,7 +56,7 @@ diff --git a/net/BUILD.gn b/net/BUILD.gn diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc -@@ -109,6 +109,7 @@ +@@ -113,6 +113,7 @@ #include "net/log/net_log_event_type.h" #include "net/log/net_log_source.h" #include "net/log/net_log_source_type.h" @@ -64,17 +64,7 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc #include "net/log/net_log_with_source.h" #include "net/socket/client_socket_factory.h" #include "net/url_request/url_request_context.h" -@@ -681,6 +682,9 @@ class HostResolverManager::RequestImpl - // request source is LOCAL_ONLY. This is due to LOCAL_ONLY requiring a - // synchronous response, so it cannot wait on an async probe result and - // cannot make assumptions about reachability. -+ if (!base::FeatureList::IsEnabled(features::kIPv6Probing)) { -+ return OK; -+ } - if (parameters_.source == HostResolverSource::LOCAL_ONLY) { - int rv = resolver_->StartIPv6ReachabilityCheck( - source_net_log_, GetClientSocketFactory(), -@@ -3899,6 +3903,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( +@@ -1373,6 +1374,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck( return OK; } diff --git a/build/patches/Add-flag-to-disable-vibration.patch b/build/patches/Add-flag-to-disable-vibration.patch index 91ad5f843..a2f1be627 100644 --- a/build/patches/Add-flag-to-disable-vibration.patch +++ b/build/patches/Add-flag-to-disable-vibration.patch @@ -70,7 +70,7 @@ diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_pa diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc --- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc +++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc -@@ -29,6 +29,7 @@ +@@ -28,6 +28,7 @@ #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/navigator.h" #include "third_party/blink/renderer/core/page/page.h" @@ -78,7 +78,7 @@ diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.c // Maximum number of entries in a vibration pattern. const unsigned kVibrationPatternLengthMax = 99; -@@ -152,6 +153,8 @@ bool VibrationController::vibrate(Navigator& navigator, +@@ -109,6 +110,8 @@ bool VibrationController::vibrate(Navigator& navigator, // reference to |window| or |navigator| was retained in another window. if (!navigator.DomWindow()) return false; @@ -104,7 +104,7 @@ diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.c diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 -@@ -2621,6 +2621,10 @@ +@@ -2669,6 +2669,10 @@ status: {"Android": "stable"}, base_feature: "none", }, 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 3844fee27..3a9f09bf3 100644 --- a/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch +++ b/build/patches/Add-kill-switch-for-unsupported-clangd-flags.patch @@ -7,30 +7,31 @@ 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 | 6 ++++++ + build/config/compiler/BUILD.gn | 7 ++++++- build_overrides/build.gni | 3 +++ - 2 files changed, 9 insertions(+) + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1888,6 +1888,12 @@ config("default_warnings") { - # TODO(https://crbug.com/1490607): Fix and re-enable. - "-Wno-thread-safety-reference-return", - ] -+ if (skip_clangd_unsupported_options) { -+ cflags -= [ -+ "-Wno-deprecated-builtins", -+ "-Wno-thread-safety-reference-return", -+ ] -+ } - } - } - +@@ -1884,7 +1884,12 @@ config("default_warnings") { + # TODO(https://crbug.com/1490607): Fix and re-enable. + "-Wno-thread-safety-reference-return", + ] +- ++ if (skip_clangd_unsupported_options) { ++ cflags -= [ ++ "-Wno-deprecated-builtins", ++ "-Wno-thread-safety-reference-return", ++ ] ++ } + if (!is_nacl) { + cflags_cc += [ + # TODO(https://crbug.com/1513724): Fix and re-enable. diff --git a/build_overrides/build.gni b/build_overrides/build.gni --- a/build_overrides/build.gni +++ b/build_overrides/build.gni -@@ -57,6 +57,9 @@ declare_args() { +@@ -58,6 +58,9 @@ declare_args() { # to lack of toolchain support. gtest_enable_absl_printers = !is_nacl diff --git a/build/patches/Add-lifetime-options-for-permissions.patch b/build/patches/Add-lifetime-options-for-permissions.patch index 99c341f06..e23a35ffa 100644 --- a/build/patches/Add-lifetime-options-for-permissions.patch +++ b/build/patches/Add-lifetime-options-for-permissions.patch @@ -58,15 +58,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../one_time_permissions_tracker_factory.cc | 2 +- .../permissions/embedded_permission_prompt.cc | 2 +- .../permission_prompt_bubble_base_view.cc | 2 +- - .../site_settings/PermissionInfo.java | 14 +++- - .../site_settings/SingleWebsiteSettings.java | 10 +++ - .../WebsitePreferenceBridge.java | 6 +- - .../android/website_preference_bridge.cc | 7 +- + .../site_settings/PermissionInfo.java | 1 + + .../site_settings/SingleWebsiteSettings.java | 9 ++ + .../android/website_preference_bridge.cc | 2 +- .../strings/android/browser_ui_strings.grd | 5 ++ - components/content_settings/android/BUILD.gn | 1 + .../core/browser/content_settings_utils.cc | 36 ++++++++ .../core/browser/content_settings_utils.h | 6 ++ - .../common/content_settings_constraints.h | 11 +++ + .../common/content_settings_constraints.h | 9 ++ .../page_info/PageInfoController.java | 4 +- .../PermissionParamsListBuilder.java | 13 ++- .../android/page_info_controller_android.cc | 10 ++- @@ -74,21 +72,21 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/page_info/page_info.h | 1 + .../permissions/PermissionDialogDelegate.java | 13 +++ .../PermissionDialogModelFactory.java | 82 ++++++++++++++++++- - .../permission_dialog_delegate.cc | 19 +++++ + .../permission_dialog_delegate.cc | 24 +++++- .../permission_dialog_delegate.h | 1 + - .../permission_prompt_android.cc | 8 ++ - .../permission_prompt_android.h | 2 + + .../permission_prompt_android.cc | 8 +- + .../permission_prompt_android.h | 3 +- .../android/permissions_android_strings.grd | 17 ++++ - .../geolocation_permission_context_android.cc | 35 ++++++-- - .../geolocation_permission_context_android.h | 14 +++- - .../permissions/permission_context_base.cc | 51 ++++++++++-- + .../geolocation_permission_context_android.cc | 34 ++++++-- + .../geolocation_permission_context_android.h | 13 ++- + .../permissions/permission_context_base.cc | 52 ++++++++++-- .../permissions/permission_context_base.h | 23 +++++- components/permissions/permission_prompt.h | 3 +- components/permissions/permission_request.cc | 30 ++++++- components/permissions/permission_request.h | 16 +++- .../permissions/permission_request_manager.cc | 45 ++++++---- .../permissions/permission_request_manager.h | 11 ++- - 36 files changed, 511 insertions(+), 61 deletions(-) + 34 files changed, 488 insertions(+), 61 deletions(-) diff --git a/chrome/browser/permissions/last_tab_standing_tracker.cc b/chrome/browser/permissions/last_tab_standing_tracker.cc --- a/chrome/browser/permissions/last_tab_standing_tracker.cc @@ -176,18 +174,18 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker.cc b/chrome OneTimePermissionsTracker::~OneTimePermissionsTracker() = default; OneTimePermissionsTracker::OriginTrackEntry::OriginTrackEntry() = default; -@@ -108,6 +134,11 @@ void OneTimePermissionsTracker::WebContentsUnloadedOrigin( - observer.OnLastPageFromOriginClosed(origin); - } - } -+ HostContentSettingsMap* content_settings = -+ permissions::PermissionsClient::Get()->GetSettingsMap(context_); -+ RemoveSessionSettings(content_settings, origin, ContentSettingsType::GEOLOCATION); -+ RemoveSessionSettings(content_settings, origin, ContentSettingsType::MEDIASTREAM_MIC); -+ RemoveSessionSettings(content_settings, origin, ContentSettingsType::MEDIASTREAM_CAMERA); +@@ -258,6 +284,11 @@ void OneTimePermissionsTracker::NotifyLastPageFromOriginClosed( + for (auto& observer : observer_list_) { + observer.OnLastPageFromOriginClosed(origin); } ++ HostContentSettingsMap* content_settings = ++ permissions::PermissionsClient::Get()->GetSettingsMap(context_); ++ RemoveSessionSettings(content_settings, origin, ContentSettingsType::GEOLOCATION); ++ RemoveSessionSettings(content_settings, origin, ContentSettingsType::MEDIASTREAM_MIC); ++ RemoveSessionSettings(content_settings, origin, ContentSettingsType::MEDIASTREAM_CAMERA); } + bool OneTimePermissionsTracker::ShouldIgnoreOrigin(const url::Origin& origin) { diff --git a/chrome/browser/permissions/one_time_permissions_tracker.h b/chrome/browser/permissions/one_time_permissions_tracker.h --- a/chrome/browser/permissions/one_time_permissions_tracker.h +++ b/chrome/browser/permissions/one_time_permissions_tracker.h @@ -208,7 +206,7 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker.h b/chrome/ ~OneTimePermissionsTracker() override; OneTimePermissionsTracker(const OneTimePermissionsTracker&) = delete; -@@ -136,7 +137,7 @@ class OneTimePermissionsTracker : public KeyedService { +@@ -139,7 +140,7 @@ class OneTimePermissionsTracker : public KeyedService { base::ObserverList observer_list_; std::map origin_tracker_; @@ -230,7 +228,7 @@ diff --git a/chrome/browser/permissions/one_time_permissions_tracker_factory.cc diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc -@@ -236,7 +236,7 @@ void EmbeddedPermissionPrompt::Allow() { +@@ -237,7 +237,7 @@ void EmbeddedPermissionPrompt::Allow() { } void EmbeddedPermissionPrompt::AllowThisTime() { @@ -242,7 +240,7 @@ diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt.cc b diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc --- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc +++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.cc -@@ -263,7 +263,7 @@ void PermissionPromptBubbleBaseView::RunButtonCallback(int button_id) { +@@ -270,7 +270,7 @@ void PermissionPromptBubbleBaseView::RunButtonCallback(int button_id) { return; case PermissionDialogButton::kAcceptOnce: RecordDecision(permissions::PermissionAction::GRANTED_ONCE); @@ -254,59 +252,22 @@ diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_v diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java -@@ -9,6 +9,7 @@ import androidx.annotation.Nullable; - import org.chromium.components.content_settings.ContentSettingValues; +@@ -10,6 +10,7 @@ import org.chromium.components.content_settings.ContentSettingValues; import org.chromium.components.content_settings.ContentSettingsType; + import org.chromium.components.content_settings.SessionModel; import org.chromium.content_public.browser.BrowserContextHandle; +import org.chromium.components.content_settings.SessionModel; import java.io.Serializable; -@@ -18,9 +19,15 @@ public class PermissionInfo implements Serializable { - private final String mEmbedder; - private final String mOrigin; - private final @ContentSettingsType int mContentSettingsType; -+ private final @SessionModel int mSessionModel; -+ -+ public PermissionInfo(@ContentSettingsType int type, String origin, String embedder, boolean isEmbargoed) { -+ this(type, origin, embedder, isEmbargoed, 0); -+ } - - public PermissionInfo( -- @ContentSettingsType int type, String origin, String embedder, boolean isEmbargoed) { -+ @ContentSettingsType int type, String origin, String embedder, boolean isEmbargoed, -+ @SessionModel int sessionModel) { - assert WebsitePermissionsFetcher.getPermissionsType(type) - == WebsitePermissionsFetcher.WebsitePermissionsType.PERMISSION_INFO - : "invalid type: " + type; -@@ -28,6 +35,11 @@ public class PermissionInfo implements Serializable { - mEmbedder = embedder; - mContentSettingsType = type; - mIsEmbargoed = isEmbargoed; -+ mSessionModel = sessionModel; -+ } -+ -+ public @SessionModel int getSessionModel() { -+ return mSessionModel; - } - - public @ContentSettingsType int getContentSettingsType() { diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java -@@ -38,6 +38,7 @@ import org.chromium.components.browser_ui.settings.TextMessagePreference; - import org.chromium.components.browsing_data.DeleteBrowsingDataAction; - import org.chromium.components.content_settings.ContentSettingValues; - import org.chromium.components.content_settings.ContentSettingsType; -+import org.chromium.components.content_settings.SessionModel; - import org.chromium.components.embedder_support.util.Origin; - import org.chromium.components.permissions.PermissionsAndroidFeatureList; - import org.chromium.components.permissions.PermissionsAndroidFeatureMap; -@@ -567,6 +568,11 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -570,6 +570,11 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment } } -+ private boolean isSessionPermission(@ContentSettingsType int type) { ++ private boolean isSessionPermission(@ContentSettingsType.EnumType int type) { + return mSite.getPermissionInfo(type) != null && + mSite.getPermissionInfo(type).getSessionModel() == SessionModel.USER_SESSION; + } @@ -314,7 +275,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c private void setUpClearDataPreference() { ClearWebsiteStorage preference = findPreference(PREF_CLEAR_DATA); long usage = mSite.getTotalUsage(); -@@ -1094,6 +1100,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1081,6 +1086,10 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment if (contentType == mHighlightedPermission) { switchPreference.setBackgroundColor(mHighlightColor); } @@ -325,63 +286,14 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } /** -diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java ---- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -@@ -10,6 +10,7 @@ import org.jni_zero.NativeMethods; - import org.chromium.base.Callback; - import org.chromium.components.content_settings.ContentSettingValues; - import org.chromium.components.content_settings.ContentSettingsType; -+import org.chromium.components.content_settings.SessionModel; - import org.chromium.components.location.LocationUtils; - import org.chromium.content_public.browser.BrowserContextHandle; - import org.chromium.url.GURL; -@@ -54,7 +55,8 @@ public class WebsitePreferenceBridge { - ArrayList list, - String origin, - String embedder, -- boolean isEmbargoed) { -+ boolean isEmbargoed, -+ @SessionModel int sessionModel) { - if (type == ContentSettingsType.MEDIASTREAM_CAMERA - || type == ContentSettingsType.MEDIASTREAM_MIC) { - for (PermissionInfo info : list) { -@@ -63,7 +65,7 @@ public class WebsitePreferenceBridge { - } - } - } -- list.add(new PermissionInfo(type, origin, embedder, isEmbargoed)); -+ list.add(new PermissionInfo(type, origin, embedder, isEmbargoed, sessionModel)); - } - - @CalledByNative diff --git a/components/browser_ui/site_settings/android/website_preference_bridge.cc b/components/browser_ui/site_settings/android/website_preference_bridge.cc --- a/components/browser_ui/site_settings/android/website_preference_bridge.cc +++ b/components/browser_ui/site_settings/android/website_preference_bridge.cc -@@ -131,7 +131,8 @@ typedef void (*InfoListInsertionFunction)( - const base::android::JavaRef&, - const base::android::JavaRef&, - const base::android::JavaRef&, -- jboolean); -+ jboolean, -+ JniIntWrapper); - - void GetOrigins(JNIEnv* env, - const JavaParamRef& jbrowser_context_handle, -@@ -173,7 +174,7 @@ void GetOrigins(JNIEnv* env, - seen_origins.push_back(origin); - insertionFunc(env, static_cast(content_type), list, - ConvertOriginToJavaString(env, origin), jembedder, -- /*is_embargoed=*/false); -+ /*is_embargoed=*/false, static_cast(settings_it.metadata.session_model())); - } - - // Add any origins which have a default content setting value (thus skipped -@@ -195,7 +196,7 @@ void GetOrigins(JNIEnv* env, +@@ -198,7 +198,7 @@ void GetOrigins(JNIEnv* env, seen_origins.push_back(origin); insertionFunc(env, static_cast(content_type), list, ConvertOriginToJavaString(env, origin), jembedder, -- /*is_embargoed=*/true); +- /*is_embargoed=*/true, /*is_one_time=*/false); + /*is_embargoed=*/true, 0); } } @@ -389,7 +301,7 @@ diff --git a/components/browser_ui/site_settings/android/website_preference_brid diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd --- a/components/browser_ui/strings/android/browser_ui_strings.grd +++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -682,6 +682,11 @@ +@@ -676,6 +676,11 @@ URL truncated @@ -401,21 +313,10 @@ diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/comp Ad privacy -diff --git a/components/content_settings/android/BUILD.gn b/components/content_settings/android/BUILD.gn ---- a/components/content_settings/android/BUILD.gn -+++ b/components/content_settings/android/BUILD.gn -@@ -61,6 +61,7 @@ java_cpp_enum("content_settings_enums_javagen") { - "../core/common/cookie_controls_breakage_confidence_level.h", - "../core/common/cookie_controls_enforcement.h", - "../core/common/cookie_controls_status.h", -+ "../core/common/content_settings_constraints.h", - ] - visibility = [ ":*" ] # Depend on through :content_settings_enums_java - } diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc --- a/components/content_settings/core/browser/content_settings_utils.cc +++ b/components/content_settings/core/browser/content_settings_utils.cc -@@ -173,6 +173,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { +@@ -174,6 +174,42 @@ bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { return constraints.session_model() == SessionModel::Durable; } @@ -477,16 +378,7 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.h b diff --git a/components/content_settings/core/common/content_settings_constraints.h b/components/content_settings/core/common/content_settings_constraints.h --- a/components/content_settings/core/common/content_settings_constraints.h +++ b/components/content_settings/core/common/content_settings_constraints.h -@@ -23,6 +23,8 @@ namespace content_settings { - // a crash or update related restart. - // OneTime: Settings will persist for the current "tab session", meaning - // until the last tab from the origin is closed. -+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.content_settings -+// GENERATED_JAVA_CLASS_NAME_OVERRIDE: SessionModel - enum class SessionModel { - Durable = 0, - UserSession = 1, -@@ -31,6 +33,15 @@ enum class SessionModel { +@@ -33,6 +33,15 @@ enum class SessionModel : int32_t { kMaxValue = OneTime, }; @@ -604,7 +496,7 @@ diff --git a/components/page_info/android/page_info_controller_android.cc b/comp diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc --- a/components/page_info/page_info.cc +++ b/components/page_info/page_info.cc -@@ -1187,6 +1187,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1174,6 +1174,8 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, permission_info.source = info.source; permission_info.is_one_time = (info.metadata.session_model() == content_settings::SessionModel::OneTime); @@ -616,7 +508,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. diff --git a/components/page_info/page_info.h b/components/page_info/page_info.h --- a/components/page_info/page_info.h +++ b/components/page_info/page_info.h -@@ -200,6 +200,7 @@ class PageInfo : private content_settings::CookieControlsObserver, +@@ -199,6 +199,7 @@ class PageInfo : private content_settings::CookieControlsObserver { content_settings::SETTING_SOURCE_NONE; // Whether the permission is a one-time grant. bool is_one_time = false; @@ -627,26 +519,26 @@ diff --git a/components/page_info/page_info.h b/components/page_info/page_info.h diff --git a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java --- a/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java +++ b/components/permissions/android/java/src/org/chromium/components/permissions/PermissionDialogDelegate.java -@@ -11,6 +11,7 @@ import org.jni_zero.JNINamespace; +@@ -13,6 +13,7 @@ import org.jni_zero.JNINamespace; import org.jni_zero.NativeMethods; import org.chromium.ui.base.WindowAndroid; +import org.chromium.components.content_settings.LifetimeMode; - /** - * Delegate class for modal permission dialogs. Contains all of the data displayed in a prompt, -@@ -46,6 +47,9 @@ public class PermissionDialogDelegate { + import java.util.ArrayList; + import java.util.List; +@@ -57,6 +58,9 @@ public class PermissionDialogDelegate { /** The {@link ContentSettingsType}s requested in this dialog. */ private int[] mContentSettingsTypes; + /** Lifetime option selected by the user. */ + private int mSelectedLifetimeOption = LifetimeMode.ALWAYS; + - public WindowAndroid getWindow() { - return mWindow; - } -@@ -75,6 +79,15 @@ public class PermissionDialogDelegate { - PermissionDialogDelegateJni.get().accept(mNativeDelegatePtr, PermissionDialogDelegate.this); + /** + * Defines a (potentially empty) list of ranges represented as pairs of , + * which shall be used by the UI to format the specified ranges as bold text. +@@ -110,6 +114,15 @@ public class PermissionDialogDelegate { + .acceptThisTime(mNativeDelegatePtr, PermissionDialogDelegate.this); } + public void setSelectedLifetimeOption(int idx) { @@ -683,20 +575,13 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per /** This class creates the model for the permission dialog. */ class PermissionDialogModelFactory { public static PropertyModel getModel( -@@ -25,7 +37,7 @@ class PermissionDialogModelFactory { - String messageText = delegate.getMessageText(); - assert !TextUtils.isEmpty(messageText); - -- return new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) -+ PropertyModel pm = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS) - .with(ModalDialogProperties.CONTROLLER, controller) - .with(ModalDialogProperties.FOCUS_DIALOG, true) - .with(ModalDialogProperties.CUSTOM_VIEW, customView) -@@ -38,5 +50,73 @@ class PermissionDialogModelFactory { - ModalDialogProperties.BUTTON_TAP_PROTECTION_PERIOD_MS, - UiUtils.PROMPT_INPUT_PROTECTION_SHORT_DELAY_MS) - .build(); +@@ -59,6 +71,74 @@ class PermissionDialogModelFactory { + ModalDialogProperties.NEGATIVE_BUTTON_TEXT, + delegate.getNegativeButtonText()); + } +- return builder.build(); + ++ PropertyModel pm = builder.build(); + int[] types = delegate.getContentSettingsTypes(); + if (contains(types, ContentSettingsType.GEOLOCATION) || + contains(types, ContentSettingsType.MEDIASTREAM_MIC) || @@ -769,7 +654,7 @@ diff --git a/components/permissions/android/java/src/org/chromium/components/per diff --git a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc --- a/components/permissions/android/permission_prompt/permission_dialog_delegate.cc +++ b/components/permissions/android/permission_prompt/permission_dialog_delegate.cc -@@ -113,6 +113,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { +@@ -144,6 +144,11 @@ void PermissionDialogJavaDelegate::DismissDialog() { Java_PermissionDialogDelegate_dismissFromNative(env, j_delegate_); } @@ -781,10 +666,10 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ // static void PermissionDialogDelegate::Create( content::WebContents* web_contents, -@@ -141,12 +146,26 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( +@@ -172,6 +177,13 @@ PermissionDialogDelegate* PermissionDialogDelegate::CreateForTesting( void PermissionDialogDelegate::Accept(JNIEnv* env, const JavaParamRef& obj) { - DCHECK(permission_prompt_); + CHECK(permission_prompt_); + content_settings::LifetimeMode lifetimeOption = + static_cast( + java_delegate_->GetSelectedLifetimeOption()); @@ -795,9 +680,20 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ permission_prompt_->Accept(); } +@@ -179,12 +191,22 @@ void PermissionDialogDelegate::AcceptThisTime( + JNIEnv* env, + const JavaParamRef& obj) { + CHECK(permission_prompt_); +- permission_prompt_->AcceptThisTime(); ++ content_settings::LifetimeMode lifetimeOption = ++ static_cast( ++ java_delegate_->GetSelectedLifetimeOption()); ++ permission_prompt_->AcceptThisTime(lifetimeOption); + } + void PermissionDialogDelegate::Cancel(JNIEnv* env, const JavaParamRef& obj) { - DCHECK(permission_prompt_); + CHECK(permission_prompt_); + content_settings::LifetimeMode lifetimeOption = + static_cast( + java_delegate_->GetSelectedLifetimeOption()); @@ -822,28 +718,29 @@ diff --git a/components/permissions/android/permission_prompt/permission_dialog_ diff --git a/components/permissions/android/permission_prompt/permission_prompt_android.cc b/components/permissions/android/permission_prompt/permission_prompt_android.cc --- a/components/permissions/android/permission_prompt/permission_prompt_android.cc +++ b/components/permissions/android/permission_prompt/permission_prompt_android.cc -@@ -52,6 +52,14 @@ void PermissionPromptAndroid::Accept() { +@@ -53,8 +53,12 @@ void PermissionPromptAndroid::Accept() { delegate_->Accept(); } +-void PermissionPromptAndroid::AcceptThisTime() { +- delegate_->AcceptThisTime(); +void PermissionPromptAndroid::AcceptThisTime(content_settings::LifetimeMode lifetimeOption) { + delegate_->AcceptThisTime(lifetimeOption); +} + +void PermissionPromptAndroid::DenyThisTime(content_settings::LifetimeMode lifetimeOption) { + delegate_->DenyThisTime(lifetimeOption); -+} -+ - void PermissionPromptAndroid::Deny() { - delegate_->Deny(); } + + void PermissionPromptAndroid::Deny() { diff --git a/components/permissions/android/permission_prompt/permission_prompt_android.h b/components/permissions/android/permission_prompt/permission_prompt_android.h --- a/components/permissions/android/permission_prompt/permission_prompt_android.h +++ b/components/permissions/android/permission_prompt/permission_prompt_android.h -@@ -47,7 +47,9 @@ class PermissionPromptAndroid : public PermissionPrompt { +@@ -44,8 +44,9 @@ class PermissionPromptAndroid : public PermissionPrompt { void Closing(); void Accept(); +- void AcceptThisTime(); + void AcceptThisTime(content_settings::LifetimeMode lifetimeOption); void Deny(); + void DenyThisTime(content_settings::LifetimeMode lifetimeOption); @@ -880,9 +777,9 @@ diff --git a/components/permissions/android/permissions_android_strings.grd b/co diff --git a/components/permissions/contexts/geolocation_permission_context_android.cc b/components/permissions/contexts/geolocation_permission_context_android.cc --- a/components/permissions/contexts/geolocation_permission_context_android.cc +++ b/components/permissions/contexts/geolocation_permission_context_android.cc -@@ -163,7 +163,20 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( +@@ -162,7 +162,20 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( + bool is_one_time, bool is_final_decision) { - DCHECK(!is_one_time); DCHECK(is_final_decision); + NotifyPermissionSetWithLifetime(id, requesting_origin, embedding_origin, + std::move(callback), persist, content_setting, is_one_time, is_final_decision, @@ -901,71 +798,71 @@ diff --git a/components/permissions/contexts/geolocation_permission_context_andr bool is_default_search = IsRequestingOriginDSE(requesting_origin); if (content_setting == CONTENT_SETTING_ALLOW && !location_settings_->IsSystemLocationSettingEnabled()) { -@@ -176,7 +189,8 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( +@@ -175,7 +188,8 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( if (IsInLocationSettingsBackOff(is_default_search)) { FinishNotifyPermissionSet(id, requesting_origin, embedding_origin, std::move(callback), false /* persist */, -- CONTENT_SETTING_BLOCK); +- CONTENT_SETTING_BLOCK, is_one_time); + CONTENT_SETTING_BLOCK, + is_one_time, lifetime_option); return; } -@@ -194,7 +208,8 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( +@@ -193,7 +207,8 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( !location_settings_dialog_callback_.is_null()) { FinishNotifyPermissionSet(id, requesting_origin, embedding_origin, std::move(callback), false /* persist */, -- CONTENT_SETTING_BLOCK); +- CONTENT_SETTING_BLOCK, is_one_time); + CONTENT_SETTING_BLOCK, + is_one_time, lifetime_option); return; } -@@ -206,12 +221,13 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( +@@ -205,13 +220,13 @@ void GeolocationPermissionContextAndroid::NotifyPermissionSet( base::BindOnce( &GeolocationPermissionContextAndroid::OnLocationSettingsDialogShown, weak_factory_.GetWeakPtr(), requesting_origin, embedding_origin, -- persist, content_setting)); +- persist, content_setting, is_one_time)); + persist, content_setting, is_one_time, lifetime_option)); return; } FinishNotifyPermissionSet(id, requesting_origin, embedding_origin, -- std::move(callback), persist, content_setting); -+ std::move(callback), persist, content_setting, + std::move(callback), persist, content_setting, +- is_one_time); + is_one_time, lifetime_option); } content::PermissionResult -@@ -377,6 +393,7 @@ void GeolocationPermissionContextAndroid::OnLocationSettingsDialogShown( +@@ -377,7 +392,7 @@ void GeolocationPermissionContextAndroid::OnLocationSettingsDialogShown( const GURL& embedding_origin, bool persist, ContentSetting content_setting, +- bool is_one_time, + bool is_one_time, content_settings::LifetimeMode lifetime_option, LocationSettingsDialogOutcome prompt_outcome) { bool is_default_search = IsRequestingOriginDSE(requesting_origin); if (prompt_outcome == GRANTED) { -@@ -394,7 +411,8 @@ void GeolocationPermissionContextAndroid::OnLocationSettingsDialogShown( - - FinishNotifyPermissionSet( - location_settings_dialog_request_id_, requesting_origin, embedding_origin, -- std::move(location_settings_dialog_callback_), persist, content_setting); -+ std::move(location_settings_dialog_callback_), persist, content_setting, -+ is_one_time, lifetime_option); +@@ -396,7 +411,8 @@ void GeolocationPermissionContextAndroid::OnLocationSettingsDialogShown( + FinishNotifyPermissionSet(location_settings_dialog_request_id_, + requesting_origin, embedding_origin, + std::move(location_settings_dialog_callback_), +- persist, content_setting, is_one_time); ++ persist, content_setting, is_one_time, ++ lifetime_option); location_settings_dialog_request_id_ = PermissionRequestID(content::GlobalRenderFrameHostId(0, 0), -@@ -407,10 +425,11 @@ void GeolocationPermissionContextAndroid::FinishNotifyPermissionSet( - const GURL& embedding_origin, +@@ -410,10 +426,10 @@ void GeolocationPermissionContextAndroid::FinishNotifyPermissionSet( BrowserPermissionCallback callback, bool persist, -- ContentSetting content_setting) { + ContentSetting content_setting, +- bool is_one_time) { - GeolocationPermissionContext::NotifyPermissionSet( -+ ContentSetting content_setting, + bool is_one_time, content_settings::LifetimeMode lifetime_option) { + GeolocationPermissionContext::NotifyPermissionSetWithLifetime( id, requesting_origin, embedding_origin, std::move(callback), persist, -- content_setting, /*is_one_time=*/false, /*is_final_decision=*/true); +- content_setting, is_one_time, /*is_final_decision=*/true); + content_setting, is_one_time, /*is_final_decision=*/true, lifetime_option); } @@ -989,20 +886,19 @@ diff --git a/components/permissions/contexts/geolocation_permission_context_andr content::PermissionResult UpdatePermissionStatusWithDeviceStatus( content::PermissionResult result, const GURL& requesting_origin, -@@ -131,6 +140,7 @@ class GeolocationPermissionContextAndroid - const GURL& embedding_origin, +@@ -132,6 +141,7 @@ class GeolocationPermissionContextAndroid bool persist, ContentSetting content_setting, -+ bool is_one_time, content_settings::LifetimeMode lifetime_option, + bool is_one_time, ++ content_settings::LifetimeMode lifetime_option, LocationSettingsDialogOutcome prompt_outcome); void FinishNotifyPermissionSet(const PermissionRequestID& id, -@@ -138,7 +148,9 @@ class GeolocationPermissionContextAndroid - const GURL& embedding_origin, +@@ -140,7 +150,8 @@ class GeolocationPermissionContextAndroid BrowserPermissionCallback callback, bool persist, -- ContentSetting content_setting); -+ ContentSetting content_setting, + ContentSetting content_setting, +- bool is_one_time); + bool is_one_time, + content_settings::LifetimeMode lifetime_option); @@ -1011,11 +907,12 @@ diff --git a/components/permissions/contexts/geolocation_permission_context_andr diff --git a/components/permissions/permission_context_base.cc b/components/permissions/permission_context_base.cc --- a/components/permissions/permission_context_base.cc +++ b/components/permissions/permission_context_base.cc -@@ -261,6 +261,16 @@ PermissionContextBase::CreatePermissionRequest( - std::move(delete_callback)); +@@ -265,6 +265,17 @@ bool PermissionContextBase::UsesAutomaticEmbargo() const { + return true; } -+std::unique_ptr PermissionContextBase::CreatePermissionRequest( ++std::unique_ptr ++PermissionContextBase::CreatePermissionRequest( + content::WebContents* web_contents, + PermissionRequestData request_data, + PermissionRequest::PermissionDecidedCallbackWithLifetime permission_decided_callback, @@ -1028,7 +925,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm content::PermissionResult PermissionContextBase::GetPermissionStatus( content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, -@@ -505,7 +515,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -511,7 +522,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1038,7 +935,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK(content_setting == CONTENT_SETTING_ALLOW || content_setting == CONTENT_SETTING_BLOCK || content_setting == CONTENT_SETTING_DEFAULT); -@@ -520,13 +531,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -526,13 +538,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, // missing if a permission prompt was preignored and we already notified an // origin about it. if (request->second.second) { @@ -1057,7 +954,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } } -@@ -572,11 +584,27 @@ void PermissionContextBase::NotifyPermissionSet( +@@ -578,11 +591,27 @@ void PermissionContextBase::NotifyPermissionSet( ContentSetting content_setting, bool is_one_time, bool is_final_decision) { @@ -1086,7 +983,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } if (is_final_decision) { -@@ -606,6 +634,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -612,6 +641,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time) { @@ -1102,7 +999,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK_EQ(requesting_origin, requesting_origin.DeprecatedGetOriginAsURL()); DCHECK_EQ(embedding_origin, embedding_origin.DeprecatedGetOriginAsURL()); DCHECK(content_setting == CONTENT_SETTING_ALLOW || -@@ -615,6 +652,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -621,6 +659,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, constraints.set_session_model(is_one_time ? content_settings::SessionModel::OneTime : content_settings::SessionModel::Durable); @@ -1142,9 +1039,9 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi virtual void UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, -@@ -204,6 +218,12 @@ class PermissionContextBase : public content_settings::Observer { - PermissionRequest::PermissionDecidedCallback permission_decided_callback, - base::OnceClosure delete_callback) const; +@@ -207,6 +221,12 @@ class PermissionContextBase : public content_settings::Observer { + // Implementors can override this method to avoid using automatic embargo. + virtual bool UsesAutomaticEmbargo() const; + virtual std::unique_ptr CreatePermissionRequest( + content::WebContents* web_contents, @@ -1155,7 +1052,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi base::ObserverList permission_observers_; // Set by subclasses to inform the base class that they will handle adding -@@ -226,7 +246,8 @@ class PermissionContextBase : public content_settings::Observer { +@@ -229,7 +249,8 @@ class PermissionContextBase : public content_settings::Observer { const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1168,7 +1065,7 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi diff --git a/components/permissions/permission_prompt.h b/components/permissions/permission_prompt.h --- a/components/permissions/permission_prompt.h +++ b/components/permissions/permission_prompt.h -@@ -65,8 +65,9 @@ class PermissionPrompt { +@@ -67,8 +67,9 @@ class PermissionPrompt { virtual GURL GetEmbeddingOrigin() const = 0; virtual void Accept() = 0; @@ -1182,9 +1079,9 @@ diff --git a/components/permissions/permission_prompt.h b/components/permissions diff --git a/components/permissions/permission_request.cc b/components/permissions/permission_request.cc --- a/components/permissions/permission_request.cc +++ b/components/permissions/permission_request.cc -@@ -37,6 +37,14 @@ PermissionRequest::PermissionRequest( - permission_decided_callback_(std::move(permission_decided_callback)), - delete_callback_(std::move(delete_callback)) {} +@@ -43,6 +43,14 @@ PermissionRequest::PermissionRequest( + delete_callback_(std::move(delete_callback)), + uses_automatic_embargo_(uses_automatic_embargo) {} +PermissionRequest::PermissionRequest( + PermissionRequestData request_data, @@ -1197,7 +1094,7 @@ diff --git a/components/permissions/permission_request.cc b/components/permissio PermissionRequest::~PermissionRequest() { DCHECK(delete_callback_.is_null()); } -@@ -279,19 +287,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { +@@ -363,19 +371,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { permissions::features::kPermissionStorageAccessAPI); } @@ -1240,7 +1137,7 @@ diff --git a/components/permissions/permission_request.cc b/components/permissio diff --git a/components/permissions/permission_request.h b/components/permissions/permission_request.h --- a/components/permissions/permission_request.h +++ b/components/permissions/permission_request.h -@@ -44,6 +44,11 @@ class PermissionRequest { +@@ -43,6 +43,11 @@ class PermissionRequest { bool /*is_one_time*/, bool /*is_final_decision*/)>; @@ -1253,8 +1150,8 @@ diff --git a/components/permissions/permission_request.h b/components/permission // resolved by the user (see comment on PermissionDecidedCallback above). // `delete_callback` is called when the permission request is no longer needed @@ -63,6 +68,10 @@ class PermissionRequest { - PermissionDecidedCallback permission_decided_callback, - base::OnceClosure delete_callback); + base::OnceClosure delete_callback, + bool uses_automatic_embargo); + PermissionRequest(PermissionRequestData request_data, + PermissionDecidedCallbackWithLifetime permission_decided_callback, @@ -1263,7 +1160,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission PermissionRequest(const PermissionRequest&) = delete; PermissionRequest& operator=(const PermissionRequest&) = delete; -@@ -128,10 +137,10 @@ class PermissionRequest { +@@ -159,10 +168,10 @@ class PermissionRequest { // If |is_one_time| is true the permission will last until all tabs of // |origin| are closed or navigated away from, and then the permission will // automatically expire after 1 day. @@ -1276,7 +1173,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission // Called when the user has cancelled the permission request. This // corresponds to a denial, but is segregated in case the context needs to -@@ -180,6 +189,9 @@ class PermissionRequest { +@@ -216,6 +225,9 @@ class PermissionRequest { // Called once a decision is made about the permission. PermissionDecidedCallback permission_decided_callback_; @@ -1289,7 +1186,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission diff --git a/components/permissions/permission_request_manager.cc b/components/permissions/permission_request_manager.cc --- a/components/permissions/permission_request_manager.cc +++ b/components/permissions/permission_request_manager.cc -@@ -155,7 +155,7 @@ void PermissionRequestManager::AddRequest( +@@ -156,7 +156,7 @@ void PermissionRequestManager::AddRequest( if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDenyPermissionPrompts)) { @@ -1298,7 +1195,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p request->RequestFinished(); return; } -@@ -231,7 +231,7 @@ void PermissionRequestManager::AddRequest( +@@ -232,7 +232,7 @@ void PermissionRequestManager::AddRequest( if (auto_approval_origin) { if (url::Origin::Create(request->requesting_origin()) == auto_approval_origin.value()) { @@ -1307,7 +1204,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } request->RequestFinished(); return; -@@ -574,7 +574,8 @@ void PermissionRequestManager::Accept() { +@@ -578,7 +578,8 @@ void PermissionRequestManager::Accept() { (*requests_iter)->request_type(), PermissionAction::GRANTED); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1317,7 +1214,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p #if !BUILDFLAG(IS_ANDROID) absl::optional content_settings_type = -@@ -592,7 +593,7 @@ void PermissionRequestManager::Accept() { +@@ -596,7 +597,7 @@ void PermissionRequestManager::Accept() { CurrentRequestsDecided(PermissionAction::GRANTED); } @@ -1326,7 +1223,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -603,7 +604,8 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -608,7 +609,8 @@ void PermissionRequestManager::AcceptThisTime() { (*requests_iter)->request_type(), PermissionAction::GRANTED_ONCE); PermissionGrantedIncludingDuplicates(*requests_iter, @@ -1336,7 +1233,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::GRANTED_ONCE); -@@ -611,6 +613,15 @@ void PermissionRequestManager::AcceptThisTime() { +@@ -616,6 +618,15 @@ void PermissionRequestManager::AcceptThisTime() { } void PermissionRequestManager::Deny() { @@ -1352,7 +1249,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p if (ignore_callbacks_from_prompt_) return; DCHECK(view_); -@@ -633,7 +644,7 @@ void PermissionRequestManager::Deny() { +@@ -639,7 +650,7 @@ void PermissionRequestManager::Deny() { StorePermissionActionForUMA((*requests_iter)->requesting_origin(), (*requests_iter)->request_type(), PermissionAction::DENIED); @@ -1361,7 +1258,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p } NotifyRequestDecided(PermissionAction::DENIED); -@@ -1190,32 +1201,32 @@ PermissionRequestManager::VisitDuplicateRequests( +@@ -1180,32 +1191,32 @@ PermissionRequestManager::VisitDuplicateRequests( void PermissionRequestManager::PermissionGrantedIncludingDuplicates( PermissionRequest* request, @@ -1404,7 +1301,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p request); } -@@ -1467,7 +1478,7 @@ void PermissionRequestManager::LogWarningToConsole(const char* message) { +@@ -1457,7 +1468,7 @@ void PermissionRequestManager::LogWarningToConsole(const char* message) { void PermissionRequestManager::DoAutoResponseForTesting() { switch (auto_response_for_test_) { case ACCEPT_ONCE: @@ -1416,7 +1313,7 @@ diff --git a/components/permissions/permission_request_manager.cc b/components/p diff --git a/components/permissions/permission_request_manager.h b/components/permissions/permission_request_manager.h --- a/components/permissions/permission_request_manager.h +++ b/components/permissions/permission_request_manager.h -@@ -159,8 +159,10 @@ class PermissionRequestManager +@@ -161,8 +161,10 @@ class PermissionRequestManager GURL GetRequestingOrigin() const override; GURL GetEmbeddingOrigin() const override; void Accept() override; @@ -1428,7 +1325,7 @@ diff --git a/components/permissions/permission_request_manager.h b/components/pe void Dismiss() override; void Ignore() override; void FinalizeCurrentRequests() override; -@@ -365,9 +367,12 @@ class PermissionRequestManager +@@ -367,9 +369,12 @@ class PermissionRequestManager // Calls PermissionGranted on a request and all its duplicates. void PermissionGrantedIncludingDuplicates(PermissionRequest* request, diff --git a/build/patches/Add-menu-item-to-bookmark-all-tabs.patch b/build/patches/Add-menu-item-to-bookmark-all-tabs.patch index 2377193ef..5a60750cd 100644 --- a/build/patches/Add-menu-item-to-bookmark-all-tabs.patch +++ b/build/patches/Add-menu-item-to-bookmark-all-tabs.patch @@ -13,20 +13,19 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../dialogs/DownloadLocationCustomView.java | 4 +- .../strings/android_chrome_strings.grd | 3 + components/bookmark_bar_strings.grdp | 6 ++ - .../bookmarks/browser/bookmark_client.cc | 2 + .../bookmarks/browser/bookmark_codec.cc | 22 ++++-- components/bookmarks/browser/bookmark_codec.h | 7 +- - .../browser/bookmark_load_details.cc | 4 ++ + .../browser/bookmark_load_details.cc | 2 + .../bookmarks/browser/bookmark_load_details.h | 3 + .../bookmarks/browser/bookmark_model.cc | 3 +- components/bookmarks/browser/bookmark_model.h | 7 ++ components/bookmarks/browser/bookmark_node.cc | 11 +++ - components/bookmarks/browser/bookmark_node.h | 4 ++ + components/bookmarks/browser/bookmark_node.h | 3 + .../bookmarks/browser/bookmark_uuids.cc | 3 + components/bookmarks/browser/bookmark_uuids.h | 1 + components/bookmarks/browser/model_loader.cc | 3 +- .../bookmark_specifics_conversions.cc | 1 + - 22 files changed, 232 insertions(+), 10 deletions(-) + 21 files changed, 227 insertions(+), 10 deletions(-) diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml --- a/chrome/android/java/res/menu/main_menu.xml @@ -63,7 +62,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome; import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChromePhone; -@@ -2787,6 +2788,8 @@ public class ChromeTabbedActivity extends ChromeActivity getTabModelSelector().closeAllTabs()); RecordUserAction.record("MobileMenuCloseAllTabs"); @@ -72,8 +71,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct } else if (id == R.id.close_all_incognito_tabs_menu_id) { // Close only incognito tabs CloseAllTabsDialog.show( -@@ -2858,6 +2861,27 @@ public class ChromeTabbedActivity extends ChromeActivity mObservers = new ObserverList<>(); @@ -132,7 +129,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm private long mNativeBookmarkBridge; private boolean mIsDestroyed; private boolean mIsDoingExtensiveChanges; -@@ -374,6 +382,16 @@ class BookmarkBridge { +@@ -400,6 +408,16 @@ class BookmarkBridge { return mMobileFolderId; } @@ -146,11 +143,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + mNativeBookmarkBridge, BookmarkBridge.this); + } + - /** - * @return Id representing the special "other" folder from bookmark model. - */ -@@ -1018,6 +1036,50 @@ class BookmarkBridge { - return BookmarkBridgeJni.get().addToReadingList(mNativeBookmarkBridge, title, url); + /** Returns Id representing the special "other" folder from bookmark model. */ + public BookmarkId getOtherFolderId() { + ThreadUtils.assertOnUiThread(); +@@ -1084,6 +1102,50 @@ class BookmarkBridge { + .addToReadingList(mNativeBookmarkBridge, parentId, title, url); } + // Used to bookmark all tabs in a specific folder, created if not existing @@ -198,9 +195,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + } + /** - * Helper method to mark an article as read. + * Helper method to mark an item as read. * -@@ -1243,6 +1305,9 @@ class BookmarkBridge { +@@ -1325,6 +1387,9 @@ class BookmarkBridge { BookmarkId getMostRecentlyAddedUserBookmarkIdForUrl(long nativeBookmarkBridge, GURL url); @@ -209,8 +206,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm + BookmarkItem getBookmarkById(long nativeBookmarkBridge, long id, int type); - void getTopLevelFolderIds(long nativeBookmarkBridge, List bookmarksList); -@@ -1254,6 +1319,8 @@ class BookmarkBridge { + void getTopLevelFolderIds( +@@ -1344,6 +1409,8 @@ class BookmarkBridge { BookmarkId getRootFolderId(long nativeBookmarkBridge); @@ -222,7 +219,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browser/bookmarks/android/bookmark_bridge.cc --- a/chrome/browser/bookmarks/android/bookmark_bridge.cc +++ b/chrome/browser/bookmarks/android/bookmark_bridge.cc -@@ -331,6 +331,33 @@ void BookmarkBridge::GetImageUrlForBookmark( +@@ -356,6 +356,33 @@ void BookmarkBridge::GetImageUrlForBookmark( base::BindOnce(&HandleImageUrlResponse, callback)); } @@ -237,11 +234,11 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + bookmarks::BookmarkModel* model = + BookmarkModelFactory::GetForBrowserContext(profile_); + -+ std::vector nodes = ++ std::vector> nodes = + model->GetNodesByURL(gurl); + std::sort(nodes.begin(), nodes.end(), &bookmarks::MoreRecentlyAdded); + -+ for (const auto* node : nodes) { ++ for (const BookmarkNode* node : nodes) { + for (const auto& child : model->tabs_collection_node()->children()) { + if (node->id() == child->id()) { + return JavaBookmarkIdCreateBookmarkId(env, node->id(), @@ -256,7 +253,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse base::android::ScopedJavaLocalRef BookmarkBridge::GetMostRecentlyAddedUserBookmarkIdForUrl( JNIEnv* env, -@@ -421,6 +448,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( +@@ -464,6 +491,7 @@ void BookmarkBridge::GetAllFoldersWithDepths( // Vector to temporarily contain all child bookmarks at same level for sorting std::vector bookmarks = { bookmark_model_->mobile_node(), @@ -264,7 +261,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse bookmark_model_->bookmark_bar_node(), bookmark_model_->other_node(), }; -@@ -474,6 +502,11 @@ std::vector BookmarkBridge::GetTopLevelFolderIdsImpl() { +@@ -521,6 +549,11 @@ std::vector BookmarkBridge::GetTopLevelFolderIdsImpl( top_level_folders.push_back(root_child.get()); } @@ -273,10 +270,10 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse + top_level_folders.push_back(node.get()); + } + - if (reading_list_manager_->GetRoot()) { - top_level_folders.push_back(reading_list_manager_->GetRoot()); - } -@@ -1027,6 +1060,17 @@ void BookmarkBridge::GetBookmarksOfType( + if (account_reading_list_manager_ && + account_reading_list_manager_->GetRoot()) { + top_level_folders.push_back(account_reading_list_manager_->GetRoot()); +@@ -1147,6 +1180,17 @@ void BookmarkBridge::GetBookmarksOfType( AddBookmarkNodesToBookmarkIdList(env, j_list, results); } @@ -297,7 +294,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser/bookmarks/android/bookmark_bridge.h --- a/chrome/browser/bookmarks/android/bookmark_bridge.h +++ b/chrome/browser/bookmarks/android/bookmark_bridge.h -@@ -67,6 +67,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -77,6 +77,10 @@ class BookmarkBridge : public ProfileObserver, const base::android::JavaParamRef& j_url, const base::android::JavaParamRef& j_callback); @@ -308,7 +305,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.h b/chrome/browser base::android::ScopedJavaLocalRef GetMostRecentlyAddedUserBookmarkIdForUrl( JNIEnv* env, -@@ -197,6 +201,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver, +@@ -227,6 +231,10 @@ class BookmarkBridge : public ProfileObserver, const base::android::JavaParamRef& j_list, jint type); @@ -376,7 +373,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -3789,6 +3789,9 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Select tabs @@ -409,18 +406,6 @@ diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_stri Other Bookmarks -diff --git a/components/bookmarks/browser/bookmark_client.cc b/components/bookmarks/browser/bookmark_client.cc ---- a/components/bookmarks/browser/bookmark_client.cc -+++ b/components/bookmarks/browser/bookmark_client.cc -@@ -55,6 +55,8 @@ bool BookmarkClient::IsPermanentNodeVisibleWhenEmpty( - case BookmarkNode::MOBILE: - // Either MOBILE or OTHER_NODE is visible when empty, but never both. - return !IsPermanentNodeVisibleWhenEmpty(BookmarkNode::OTHER_NODE); -+ case bookmarks::BookmarkNode::TABS_COLLECTION: -+ return !is_desktop; - } - NOTREACHED_NORETURN(); - } diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc --- a/components/bookmarks/browser/bookmark_codec.cc +++ b/components/bookmarks/browser/bookmark_codec.cc @@ -432,7 +417,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar const char BookmarkCodec::kVersionKey[] = "version"; const char BookmarkCodec::kChecksumKey[] = "checksum"; const char BookmarkCodec::kIdKey[] = "id"; -@@ -74,7 +75,8 @@ BookmarkCodec::~BookmarkCodec() = default; +@@ -72,7 +73,8 @@ BookmarkCodec::~BookmarkCodec() = default; base::Value::Dict BookmarkCodec::Encode(BookmarkModel* model, std::string sync_metadata_str) { return Encode(model->bookmark_bar_node(), model->other_node(), @@ -442,7 +427,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar std::move(sync_metadata_str)); } -@@ -82,6 +84,7 @@ base::Value::Dict BookmarkCodec::Encode( +@@ -80,6 +82,7 @@ base::Value::Dict BookmarkCodec::Encode( const BookmarkNode* bookmark_bar_node, const BookmarkNode* other_folder_node, const BookmarkNode* mobile_folder_node, @@ -450,7 +435,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar const BookmarkNode::MetaInfoMap* model_meta_info_map, std::string sync_metadata_str) { ids_reassigned_ = false; -@@ -102,6 +105,7 @@ base::Value::Dict BookmarkCodec::Encode( +@@ -100,6 +103,7 @@ base::Value::Dict BookmarkCodec::Encode( roots.Set(kBookmarkBarFolderNameKey, EncodeNode(bookmark_bar_node)); roots.Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node)); roots.Set(kMobileBookmarkFolderNameKey, EncodeNode(mobile_folder_node)); @@ -458,7 +443,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar if (model_meta_info_map) roots.Set(kMetaInfo, EncodeMetaInfo(*model_meta_info_map)); -@@ -119,6 +123,7 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, +@@ -117,6 +121,7 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -466,7 +451,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar int64_t* max_id, std::string* sync_metadata_str) { ids_.clear(); -@@ -126,7 +131,8 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, +@@ -124,7 +129,8 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, base::Uuid::ParseLowercase(kBookmarkBarNodeUuid), base::Uuid::ParseLowercase(kOtherBookmarksNodeUuid), base::Uuid::ParseLowercase(kMobileBookmarksNodeUuid), @@ -476,7 +461,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar ids_reassigned_ = false; uuids_reassigned_ = false; ids_valid_ = true; -@@ -134,12 +140,13 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, +@@ -132,12 +138,13 @@ bool BookmarkCodec::Decode(const base::Value::Dict& value, stored_checksum_.clear(); InitializeChecksum(); bool success = DecodeHelper(bb_node, other_folder_node, mobile_folder_node, @@ -491,7 +476,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar *max_id = maximum_id_ + 1; return success; } -@@ -191,6 +198,7 @@ base::Value::Dict BookmarkCodec::EncodeMetaInfo( +@@ -189,6 +196,7 @@ base::Value::Dict BookmarkCodec::EncodeMetaInfo( bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkNode* mobile_folder_node, @@ -499,7 +484,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar const base::Value::Dict& value, std::string* sync_metadata_str) { absl::optional version = value.FindInt(kVersionKey); -@@ -215,6 +223,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, +@@ -213,6 +221,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, roots->FindDict(kOtherBookmarkFolderNameKey); const base::Value::Dict* mobile_folder_value = roots->FindDict(kMobileBookmarkFolderNameKey); @@ -508,7 +493,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar if (!bb_value || !other_folder_value || !mobile_folder_value) return false; -@@ -222,6 +232,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, +@@ -220,6 +230,8 @@ bool BookmarkCodec::DecodeHelper(BookmarkNode* bb_node, DecodeNode(*bb_value, nullptr, bb_node); DecodeNode(*other_folder_value, nullptr, other_folder_node); DecodeNode(*mobile_folder_value, nullptr, mobile_folder_node); @@ -517,7 +502,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar if (!DecodeMetaInfo(*roots, &model_meta_info_map_)) return false; -@@ -463,11 +475,13 @@ void BookmarkCodec::DecodeMetaInfoHelper( +@@ -461,11 +473,13 @@ void BookmarkCodec::DecodeMetaInfoHelper( void BookmarkCodec::ReassignIDs(BookmarkNode* bb_node, BookmarkNode* other_node, @@ -580,14 +565,12 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark diff --git a/components/bookmarks/browser/bookmark_load_details.cc b/components/bookmarks/browser/bookmark_load_details.cc --- a/components/bookmarks/browser/bookmark_load_details.cc +++ b/components/bookmarks/browser/bookmark_load_details.cc -@@ -37,6 +37,10 @@ BookmarkLoadDetails::BookmarkLoadDetails(BookmarkClient* client) - root_node_->Add(BookmarkPermanentNode::CreateMobileBookmarks( - max_id_++, - client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::MOBILE)))); +@@ -31,6 +31,8 @@ BookmarkLoadDetails::BookmarkLoadDetails(BookmarkClient* client) + root_node_->Add(BookmarkPermanentNode::CreateOtherBookmarks(max_id_++))); + mobile_folder_node_ = static_cast( + root_node_->Add(BookmarkPermanentNode::CreateMobileBookmarks(max_id_++))); + tabs_collection_folder_node_ = static_cast( -+ root_node_->Add(BookmarkPermanentNode::CreateTabsCollectionBookmarks( -+ max_id_++, -+ client->IsPermanentNodeVisibleWhenEmpty(BookmarkNode::TABS_COLLECTION)))); ++ root_node_->Add(BookmarkPermanentNode::CreateTabsCollectionBookmarks(max_id_++))); } BookmarkLoadDetails::~BookmarkLoadDetails() = default; @@ -614,7 +597,7 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/b diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc --- a/components/bookmarks/browser/bookmark_model.cc +++ b/components/bookmarks/browser/bookmark_model.cc -@@ -829,7 +829,7 @@ bool BookmarkModel::HasBookmarks() const { +@@ -838,7 +838,7 @@ bool BookmarkModel::HasBookmarks() const { bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return bookmark_bar_node_->children().empty() && @@ -623,18 +606,18 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar } bool BookmarkModel::IsBookmarked(const GURL& url) const { -@@ -1166,6 +1166,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr details) { +@@ -1149,6 +1149,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr details) { bookmark_bar_node_ = details->bb_node(); other_node_ = details->other_folder_node(); mobile_node_ = details->mobile_folder_node(); + tabs_collection_node_ = details->tabs_collection_folder_node(); - // TODO(crbug.com/1494120): Load nodes for account storage as well. - + // TODO(crbug.com/1520418): Load nodes for account storage as well and load + // UUIDs onto `uuid_index_`. diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h --- a/components/bookmarks/browser/bookmark_model.h +++ b/components/bookmarks/browser/bookmark_model.h -@@ -159,6 +159,12 @@ class BookmarkModel final : public BookmarkUndoProvider, +@@ -160,6 +160,12 @@ class BookmarkModel final : public BookmarkUndoProvider, // bookmarks in the account storage). const BookmarkNode* account_mobile_node() const; @@ -647,7 +630,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark bool is_root_node(const BookmarkNode* node) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return node == root_; -@@ -528,6 +534,7 @@ class BookmarkModel final : public BookmarkUndoProvider, +@@ -585,6 +591,7 @@ class BookmarkModel final : public BookmarkUndoProvider, raw_ptr account_bookmark_bar_node_ = nullptr; raw_ptr account_other_node_ = nullptr; raw_ptr account_mobile_node_ = nullptr; @@ -658,19 +641,26 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmarks/browser/bookmark_node.cc --- a/components/bookmarks/browser/bookmark_node.cc +++ b/components/bookmarks/browser/bookmark_node.cc -@@ -189,6 +189,17 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id, - visible_when_empty)); +@@ -161,6 +161,8 @@ bool BookmarkPermanentNode::IsTypeVisibleWhenEmpty(Type type) { + #endif + + switch (type) { ++ case bookmarks::BookmarkNode::TABS_COLLECTION: ++ return !is_desktop; + case BookmarkNode::URL: + NOTREACHED_NORETURN(); + case BookmarkNode::FOLDER: +@@ -211,6 +213,15 @@ BookmarkPermanentNode::CreateMobileBookmarks(int64_t id) { + l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME))); } +// static +std::unique_ptr -+BookmarkPermanentNode::CreateTabsCollectionBookmarks(int64_t id, -+ bool visible_when_empty) { ++BookmarkPermanentNode::CreateTabsCollectionBookmarks(int64_t id) { + // base::WrapUnique() used because the constructor is private. + return base::WrapUnique(new BookmarkPermanentNode( + id, TABS_COLLECTION, base::Uuid::ParseLowercase(kTabsCollectionBookmarksNodeUuid), -+ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME), -+ visible_when_empty)); ++ l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_TABS_COLLECTION_FOLDER_NAME))); +} + BookmarkPermanentNode::BookmarkPermanentNode(int64_t id, @@ -687,13 +677,12 @@ diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks MOBILE }; -@@ -246,6 +247,9 @@ class BookmarkPermanentNode : public BookmarkNode { +@@ -247,6 +248,8 @@ class BookmarkPermanentNode : public BookmarkNode { + int64_t id); static std::unique_ptr CreateMobileBookmarks( - int64_t id, - bool visible_when_empty); + int64_t id); + static std::unique_ptr CreateTabsCollectionBookmarks( -+ int64_t id, -+ bool visible_when_empty); ++ int64_t id); // Constructor is private to disallow the construction of permanent nodes // other than the well-known ones, see factory methods. diff --git a/build/patches/Add-menu-item-to-view-source.patch b/build/patches/Add-menu-item-to-view-source.patch index 711552f3c..95fa03e74 100644 --- a/build/patches/Add-menu-item-to-view-source.patch +++ b/build/patches/Add-menu-item-to-view-source.patch @@ -16,7 +16,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml --- a/chrome/android/java/res/menu/custom_tabs_menu.xml +++ b/chrome/android/java/res/menu/custom_tabs_menu.xml -@@ -55,6 +55,9 @@ found in the LICENSE file. +@@ -59,6 +59,9 @@ found in the LICENSE file. @@ -42,7 +42,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -2813,6 +2813,8 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -2763,6 +2763,11 @@ public abstract class ChromeActivity return doOpenWebApk(currentTab); } @@ -69,7 +69,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java -@@ -578,6 +578,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -580,6 +580,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate isChromeScheme, isFileScheme, isContentScheme, isIncognito, url)); updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isChromeScheme); @@ -77,7 +77,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App updateAutoDarkMenuItem(menu, currentTab, isChromeScheme); -@@ -1181,6 +1182,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate +@@ -1189,6 +1190,23 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate } } @@ -104,7 +104,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java -@@ -260,6 +260,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat +@@ -276,6 +276,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat updateRequestDesktopSiteMenuItem( menu, currentTab, requestDesktopSiteVisible, isChromeScheme); diff --git a/build/patches/Add-option-to-disable-snapshots.patch b/build/patches/Add-option-to-disable-snapshots.patch index fb374aafc..b79a0e2d8 100644 --- a/build/patches/Add-option-to-disable-snapshots.patch +++ b/build/patches/Add-option-to-disable-snapshots.patch @@ -72,7 +72,7 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -53,6 +53,11 @@ found in the LICENSE file. +@@ -54,6 +54,11 @@ found in the LICENSE file. android:title="@string/open_external_links_incognito_title" android:summary="@string/open_external_links_incognito_summary" android:defaultValue="false" /> @@ -87,7 +87,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java -@@ -145,6 +145,7 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; +@@ -144,6 +144,7 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.printing.TabPrinter; @@ -95,7 +95,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.readaloud.ReadAloudController; import org.chromium.chrome.browser.selection.SelectionPopupBackPressHandler; -@@ -736,7 +737,7 @@ public abstract class ChromeActivity +@@ -743,7 +744,7 @@ public abstract class ChromeActivity new TabContentManager( this, mBrowserControlsManagerSupplier.get(), @@ -107,7 +107,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java -@@ -325,11 +325,14 @@ public class TabContentManager { +@@ -326,11 +326,14 @@ public class TabContentManager { */ public void getTabThumbnailWithCallback( @NonNull int tabId, @@ -176,7 +176,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting Preference privacyGuidePreference = findPreference(PREF_PRIVACY_GUIDE); // Record the launch of PG from the S&P link-row entry point privacyGuidePreference.setOnPreferenceClickListener( -@@ -323,6 +351,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -321,6 +349,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents"; public static final String PREF_OPEN_EXTERNAL_LINKS_INCOGNITO = "open_external_links_incognito"; @@ -184,7 +184,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting @Override public boolean onPreferenceChange(Preference preference, Object newValue) { -@@ -348,6 +377,13 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -346,6 +375,13 @@ public class PrivacySettings extends ChromeBaseSettingsFragment SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit(); sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue); sharedPreferencesEditor.apply(); @@ -198,7 +198,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting } return true; } -@@ -388,6 +424,10 @@ public class PrivacySettings extends ChromeBaseSettingsFragment +@@ -386,6 +422,10 @@ public class PrivacySettings extends ChromeBaseSettingsFragment : R.string.text_off); } @@ -212,7 +212,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting 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 -@@ -5275,6 +5275,14 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

%1$swww.amazon.com timer ran out. It'll start again tomorrow. diff --git a/build/patches/Add-option-to-force-tablet-UI.patch b/build/patches/Add-option-to-force-tablet-UI.patch index dd9be165b..b1dab30ae 100644 --- a/build/patches/Add-option-to-force-tablet-UI.patch +++ b/build/patches/Add-option-to-force-tablet-UI.patch @@ -52,7 +52,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java --- a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java -@@ -987,7 +987,9 @@ public final class ReturnToChromeUtil { +@@ -975,7 +975,9 @@ public final class ReturnToChromeUtil { public static boolean isScrollableMvtEnabled(Context context) { boolean isSurfacePolishEnabled = ChromeFeatureList.sSurfacePolish.isEnabled(); @@ -66,7 +66,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToC diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java -@@ -98,6 +98,7 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; +@@ -100,6 +100,7 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher; import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; @@ -74,7 +74,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordi import org.chromium.chrome.browser.price_tracking.PriceTrackingButtonController; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.quick_delete.QuickDeleteController; -@@ -1588,7 +1589,9 @@ public class RootUiCoordinator +@@ -1634,7 +1635,9 @@ public class RootUiCoordinator if (!mSupportsFindInPageSupplier.getAsBoolean()) return; int stubId = R.id.find_toolbar_stub; @@ -88,7 +88,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordi diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BUILD.gn --- a/chrome/browser/preferences/BUILD.gn +++ b/chrome/browser/preferences/BUILD.gn -@@ -25,6 +25,7 @@ android_library("java") { +@@ -26,6 +26,7 @@ android_library("java") { "//components/browser_ui/site_settings/android:constants_java", "//third_party/androidx:androidx_annotation_annotation_java", "//third_party/jni_zero:jni_zero_java", @@ -99,7 +99,7 @@ diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BU diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java -@@ -310,6 +310,7 @@ public final class ChromePreferenceKeys { +@@ -294,6 +294,7 @@ public final class ChromePreferenceKeys { AccessibilityConstants.FONT_USER_SET_FORCE_ENABLE_ZOOM; public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info"; @@ -146,7 +146,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java -@@ -777,7 +777,7 @@ public class LocationBarCoordinator +@@ -760,7 +760,7 @@ public class LocationBarCoordinator } private boolean isTabletWindow() { @@ -158,7 +158,7 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1561,6 +1561,13 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1558,6 +1558,13 @@ Your Google account may have other forms of browsing history like searches and a Manage third-party cookies and tracking protections @@ -175,7 +175,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/components/BUILD.gn b/components/BUILD.gn --- a/components/BUILD.gn +++ b/components/BUILD.gn -@@ -68,7 +68,7 @@ if (is_ios) { +@@ -69,7 +69,7 @@ if (is_ios) { # Omit Lacros because it allows //components to depend on //chrome, which in # turn depends on //extensions. @@ -184,7 +184,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn disallowed_extension_deps_ = [ # Components should largely not depend on //extensions. Since // extensions # is not a component target and is linked with //chrome, depending on most -@@ -819,7 +819,7 @@ test("components_unittests") { +@@ -829,7 +829,7 @@ test("components_unittests") { # On other platforms, no components should depend on Chrome. # Since //chrome depends on //extensions, we also only assert_no_deps on # extensions targets for non-lacros builds. @@ -193,7 +193,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn assert_no_deps = [ "//chrome/*" ] assert_no_deps += disallowed_extension_deps_ } -@@ -1107,7 +1107,7 @@ if (use_blink) { +@@ -1120,7 +1120,7 @@ if (use_blink) { # dependency. On other platforms, no components should depend on Chrome. # Since //chrome depends on //extensions, we also only assert_no_deps on # extensions targets for non-lacros builds. @@ -205,7 +205,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml --- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml +++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml -@@ -35,6 +35,11 @@ found in the LICENSE file. +@@ -40,6 +40,11 @@ found in the LICENSE file. android:summary="@string/reader_for_accessibility_summary" android:title="@string/reader_for_accessibility_title" /> @@ -220,7 +220,7 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java --- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java +++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -@@ -31,6 +31,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -32,6 +32,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat public static final String PREF_CAPTIONS = "captions"; public static final String PREF_ZOOM_INFO = "zoom_info"; @@ -228,8 +228,8 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c + static final String PREF_FORCE_TABLET_UI = "force_tablet_ui"; private TextScalePreference mTextScalePref; private PageZoomPreference mPageZoomDefaultZoomPref; - private ChromeSwitchPreference mPageZoomAlwaysShowPref; -@@ -123,6 +125,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat + private ChromeSwitchPreference mPageZoomIncludeOSAdjustment; +@@ -129,6 +131,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat getPreferenceScreen().removePreference(readerForAccessibilityPref); } @@ -242,7 +242,7 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c Preference captions = findPreference(PREF_CAPTIONS); captions.setOnPreferenceClickListener( preference -> { -@@ -182,6 +190,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -190,6 +198,8 @@ public class AccessibilitySettings extends PreferenceFragmentCompat mFontSizePrefs.setUserFontScaleFactor((Float) newValue); } else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) { mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue); diff --git a/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch b/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch index 2d68ac2bc..a88246da9 100644 --- a/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch +++ b/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch @@ -36,7 +36,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.base.IntentUtils; import org.chromium.base.Log; import org.chromium.base.MemoryPressureListener; -@@ -1484,8 +1485,10 @@ public class ChromeTabbedActivity extends ChromeActivity<resetlink>reset sync

<resetlink>reset sync

IMAGE 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 aea46321f..06cc33e8a 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 @@ -23,15 +23,15 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html 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 -@@ -18,6 +18,7 @@ import org.chromium.base.Callback; - import org.chromium.base.ResettersForTesting; - import org.chromium.base.metrics.RecordUserAction; +@@ -22,6 +22,7 @@ import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; + import org.chromium.base.task.PostTask; + import org.chromium.base.task.TaskTraits; +import org.chromium.chrome.browser.homepage.HomepageManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabCreationState; import org.chromium.chrome.browser.tab.TabLaunchType; -@@ -44,6 +45,7 @@ import org.chromium.ui.KeyboardVisibilityDelegate; +@@ -47,6 +48,7 @@ import org.chromium.ui.KeyboardVisibilityDelegate; import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.text.EmptyTextWatcher; @@ -39,7 +39,7 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser import java.util.ArrayList; import java.util.List; -@@ -615,11 +617,16 @@ public class TabGridDialogMediator +@@ -634,11 +636,16 @@ public class TabGridDialogMediator assert relatedTabs.size() > 0; @@ -201,7 +201,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/Chrome diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java -@@ -323,6 +323,7 @@ public final class ChromePreferenceKeys { +@@ -307,6 +307,7 @@ public final class ChromePreferenceKeys { public static final String HOMEPAGE_USE_CHROME_NTP = "Chrome.Homepage.UseNTP"; public static final String HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled"; @@ -223,7 +223,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1334,6 +1334,9 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1331,6 +1331,9 @@ Your Google account may have other forms of browsing history like searches and a Last hour @@ -241,14 +241,14 @@ diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_u registry->RegisterBooleanPref(prefs::kShowHomeButton, false, GetHomeButtonAndHomePageIsNewTabPageFlags()); + registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false, -+ GetHomeButtonAndHomePageIsNewTabPageFlags()); ++ PrefRegistry::NO_REGISTRATION_FLAGS); registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0); bool reset_check_default = false; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -1311,6 +1311,10 @@ inline constexpr char kUsedPolicyCertificates[] = +@@ -1304,6 +1304,10 @@ inline constexpr char kUsedPolicyCertificates[] = // visible on the toolbar. inline constexpr char kShowHomeButton[] = "browser.show_home_button"; diff --git a/build/patches/Add-search-engine.patch b/build/patches/Add-search-engine.patch index f3562c93b..328f61fcb 100644 --- a/build/patches/Add-search-engine.patch +++ b/build/patches/Add-search-engine.patch @@ -33,7 +33,7 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se "ecosia": { "name": "Ecosia", "keyword": "ecosia.org", -@@ -171,6 +181,27 @@ +@@ -172,6 +182,27 @@ "id": 111 }, @@ -64,19 +64,19 @@ diff --git a/components/search_engines/prepopulated_engines.json b/components/se diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h --- a/components/search_engines/search_engine_type.h +++ b/components/search_engines/search_engine_type.h -@@ -88,6 +88,8 @@ enum SearchEngineType { - SEARCH_ENGINE_QUENDU = 69, +@@ -89,6 +89,8 @@ enum SearchEngineType { SEARCH_ENGINE_BRAVE = 70, SEARCH_ENGINE_KARMA = 71, -+ SEARCH_ENGINE_GOOGLE_EN = 72, -+ SEARCH_ENGINE_DUCKDUCKGOLIGHT = 73, + SEARCH_ENGINE_YOU = 72, ++ SEARCH_ENGINE_GOOGLE_EN = 73, ++ SEARCH_ENGINE_DUCKDUCKGOLIGHT = 74, SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro. }; diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc --- a/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc -@@ -61,6 +61,7 @@ struct EngineAndTier { +@@ -63,6 +63,7 @@ struct EngineAndTier { // Default (for countries with no better engine set) constexpr EngineAndTier engines_default[] = { @@ -84,7 +84,7 @@ diff --git a/components/search_engines/template_url_prepopulate_data.cc b/compon {SearchEngineTier::kTopEngines, &google}, {SearchEngineTier::kTopEngines, &bing}, {SearchEngineTier::kTopEngines, &yahoo}, -@@ -1613,6 +1614,8 @@ const std::vector GetPrepopulationSetFromCountryID( +@@ -1683,6 +1684,8 @@ const std::vector GetPrepopulationSetFromCountryID( for (size_t i = 0; i < num_engines; i++) { t_url.push_back(engines[i]); } diff --git a/build/patches/Add-setting-to-clear-data-on-exit.patch b/build/patches/Add-setting-to-clear-data-on-exit.patch index 40d7918e0..5d59a6bf8 100644 --- a/build/patches/Add-setting-to-clear-data-on-exit.patch +++ b/build/patches/Add-setting-to-clear-data-on-exit.patch @@ -26,16 +26,16 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../core/browsing_data_policies_utils.h | 11 +++ .../browsing_data/core/browsing_data_utils.cc | 34 +++++++++ .../core/clear_browsing_data_tab.h | 2 +- - components/browsing_data/core/pref_names.cc | 27 +++++++ - components/browsing_data/core/pref_names.h | 9 +++ + components/browsing_data/core/pref_names.cc | 17 +++++ + components/browsing_data/core/pref_names.h | 10 +++ content/browser/storage_partition_impl.cc | 1 + - 25 files changed, 321 insertions(+), 17 deletions(-) + 25 files changed, 312 insertions(+), 17 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAtStart.java diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -303,6 +303,7 @@ chrome_java_sources = [ +@@ -305,6 +305,7 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentAdvanced.java", "java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasic.java", "java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataTabsFragment.java", @@ -46,7 +46,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -159,6 +159,7 @@ import org.chromium.chrome.browser.profiles.ProfileProvider; +@@ -164,6 +164,7 @@ import org.chromium.chrome.browser.profiles.ProfileProvider; import org.chromium.chrome.browser.quick_delete.QuickDeleteController; import org.chromium.chrome.browser.quick_delete.QuickDeleteDelegateImpl; import org.chromium.chrome.browser.quick_delete.QuickDeleteMetricsDelegate; @@ -54,7 +54,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct import org.chromium.chrome.browser.read_later.ReadingListBackPressHandler; import org.chromium.chrome.browser.read_later.ReadingListUtils; import org.chromium.chrome.browser.reengagement.ReengagementNotificationController; -@@ -1484,7 +1485,11 @@ public class ChromeTabbedActivity extends ChromeActivity Clear browsing data @@ -281,7 +281,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager. diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc -@@ -432,6 +432,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( +@@ -434,6 +434,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( delete_end_, CreateTaskCompletionClosure(TracingDataType::kHistory), &history_task_tracker_); } @@ -291,7 +291,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate. if (ClipboardRecentContent::GetInstance()) ClipboardRecentContent::GetInstance()->SuppressClipboardContent(); -@@ -482,7 +485,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( +@@ -484,7 +487,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( prerender::NoStatePrefetchManager::CLEAR_PRERENDER_CONTENTS | prerender::NoStatePrefetchManager::CLEAR_PRERENDER_HISTORY); } @@ -301,7 +301,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate. // The saved Autofill profiles and credit cards can include the origin from // which these profiles and credit cards were learned. These are a form of // history, so clear them as well. -@@ -503,7 +508,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( +@@ -505,7 +510,9 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( if (data_manager) data_manager->Refresh(); } @@ -311,7 +311,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate. base::ThreadPool::PostTaskAndReply( FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()}, base::BindOnce( -@@ -578,9 +585,13 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( +@@ -580,9 +587,13 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( } device_event_log::Clear(delete_begin_, delete_end_); @@ -328,7 +328,7 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate. diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc -@@ -506,6 +506,23 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { +@@ -502,6 +502,23 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { (*s_allowlist)[browsing_data::prefs::kLastClearBrowsingDataTab] = settings_api::PrefType::kNumber; @@ -386,7 +386,7 @@ diff --git a/chrome/browser/profiles/android/profile_manager_utils.cc b/chrome/b diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc -@@ -1495,6 +1495,19 @@ void ProfileManager::DoFinalInit(ProfileInfo* profile_info, +@@ -1496,6 +1496,19 @@ void ProfileManager::DoFinalInit(ProfileInfo* profile_info, } } @@ -406,10 +406,10 @@ diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profile void ProfileManager::DoFinalInitForServices(Profile* profile, bool go_off_the_record) { if (!do_final_services_init_ || -@@ -2166,7 +2179,7 @@ void ProfileManager::OnBrowserClosed(Browser* browser) { +@@ -2171,7 +2184,7 @@ void ProfileManager::OnBrowserClosed(Browser* browser) { Profile* original_profile = profile->GetOriginalProfile(); // Do nothing if the closed window is not the last window of the same profile. - for (auto* browser_iter : *BrowserList::GetInstance()) { + for (Browser* browser_iter : *BrowserList::GetInstance()) { - if (browser_iter->profile()->GetOriginalProfile() == original_profile) + if (browser_iter->profile() == profile) return; @@ -503,7 +503,7 @@ diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_ 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 -@@ -1429,6 +1429,9 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1426,6 +1426,9 @@ Your Google account may have other forms of browsing history like searches and a Basic @@ -516,7 +516,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -1660,6 +1660,7 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, +@@ -1661,6 +1661,7 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, {"clearedData", IDS_SETTINGS_CLEARED_DATA}, {"clearBrowsingData", IDS_SETTINGS_CLEAR_BROWSING_DATA}, {"clearBrowsingDataDescription", IDS_SETTINGS_CLEAR_DATA_DESCRIPTION}, @@ -639,24 +639,7 @@ diff --git a/components/browsing_data/core/clear_browsing_data_tab.h b/component diff --git a/components/browsing_data/core/pref_names.cc b/components/browsing_data/core/pref_names.cc --- a/components/browsing_data/core/pref_names.cc +++ b/components/browsing_data/core/pref_names.cc -@@ -26,6 +26,16 @@ const char kClearBrowsingDataOnExitDeletionPending[] = - // delete just before browser shutdown. - const char kClearBrowsingDataOnExitList[] = "browser.clear_data.clear_on_exit"; - -+// Clear Browsing Data dialog datatype preferences. -+const char kDeleteBrowsingHistoryAtStart[] = "browser.clear_data.browsing_history_at_start"; -+const char kDeleteDownloadHistoryAtStart[] = "browser.clear_data.download_history_at_start"; -+const char kDeleteCacheAtStart[] = "browser.clear_data.cache_at_start"; -+const char kDeleteCookiesAtStart[] = "browser.clear_data.cookies_at_start"; -+const char kDeletePasswordsAtStart[] = "browser.clear_data.passwords_at_start"; -+const char kDeleteFormDataAtStart[] = "browser.clear_data.form_data_at_start"; -+const char kDeleteHostedAppsDataAtStart[] = "browser.clear_data.hosted_apps_data_at_start"; -+const char kDeleteSiteSettingsAtStart[] = "browser.clear_data.site_settings_at_start"; -+ - // Clear browsing data deletion time period. - const char kDeleteTimePeriod[] = "browser.clear_data.time_period"; - const char kDeleteTimePeriodBasic[] = "browser.clear_data.time_period_basic"; -@@ -99,6 +109,23 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { +@@ -47,6 +47,23 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterIntegerPref( kClearBrowsingDataHistoryNoticeShownTimes, 0); @@ -683,26 +666,27 @@ diff --git a/components/browsing_data/core/pref_names.cc b/components/browsing_d diff --git a/components/browsing_data/core/pref_names.h b/components/browsing_data/core/pref_names.h --- a/components/browsing_data/core/pref_names.h +++ b/components/browsing_data/core/pref_names.h -@@ -17,6 +17,15 @@ extern const char kBrowsingDataLifetime[]; - extern const char kClearBrowsingDataOnExitDeletionPending[]; - extern const char kClearBrowsingDataOnExitList[]; - -+extern const char kDeleteBrowsingHistoryAtStart[]; -+extern const char kDeleteDownloadHistoryAtStart[]; -+extern const char kDeleteCacheAtStart[]; -+extern const char kDeleteCookiesAtStart[]; -+extern const char kDeletePasswordsAtStart[]; -+extern const char kDeleteFormDataAtStart[]; -+extern const char kDeleteHostedAppsDataAtStart[]; -+extern const char kDeleteSiteSettingsAtStart[]; -+ - extern const char kDeleteTimePeriod[]; - extern const char kDeleteTimePeriodBasic[]; +@@ -28,6 +28,16 @@ inline constexpr char kClearBrowsingDataOnExitDeletionPending[] = + inline constexpr char kClearBrowsingDataOnExitList[] = + "browser.clear_data.clear_on_exit"; ++// Clear Browsing Data dialog datatype preferences. ++inline constexpr char kDeleteBrowsingHistoryAtStart[] = "browser.clear_data.browsing_history_at_start"; ++inline constexpr char kDeleteDownloadHistoryAtStart[] = "browser.clear_data.download_history_at_start"; ++inline constexpr char kDeleteCacheAtStart[] = "browser.clear_data.cache_at_start"; ++inline constexpr char kDeleteCookiesAtStart[] = "browser.clear_data.cookies_at_start"; ++inline constexpr char kDeletePasswordsAtStart[] = "browser.clear_data.passwords_at_start"; ++inline constexpr char kDeleteFormDataAtStart[] = "browser.clear_data.form_data_at_start"; ++inline constexpr char kDeleteHostedAppsDataAtStart[] = "browser.clear_data.hosted_apps_data_at_start"; ++inline constexpr char kDeleteSiteSettingsAtStart[] = "browser.clear_data.site_settings_at_start"; ++ + // Clear browsing data deletion time period. + inline constexpr char kDeleteTimePeriod[] = "browser.clear_data.time_period"; + inline constexpr char kDeleteTimePeriodBasic[] = diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc -@@ -1571,6 +1571,7 @@ void StoragePartitionImpl::Initialize( +@@ -1553,6 +1553,7 @@ void StoragePartitionImpl::Initialize( .AppendASCII("Code Cache"); } DCHECK_GE(settings.size_in_bytes(), 0); diff --git a/build/patches/Add-setting-to-invert-tap-and-long-tap.patch b/build/patches/Add-setting-to-invert-tap-and-long-tap.patch index 5251c91d6..d0ae4e401 100644 --- a/build/patches/Add-setting-to-invert-tap-and-long-tap.patch +++ b/build/patches/Add-setting-to-invert-tap-and-long-tap.patch @@ -116,7 +116,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/Chr if (FirstRunStatus.getFirstRunFlowComplete() && !isEmptyUrl(mParams.getUrl()) && UrlUtilities.isAcceptedScheme(mParams.getUrl())) { -@@ -643,6 +646,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { +@@ -631,6 +634,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator { getProfile(), false); }); @@ -158,18 +158,18 @@ diff --git a/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/con 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 -@@ -327,6 +327,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { - &kTabDragDropAndroid, - &kTabAndLinkDragDropAndroid, - &kTabEngagementReportingAndroid, +@@ -288,6 +288,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { + &kTabGroupParityAndroid, + &kTabletTabSwitcherLongPressMenu, + &kTabletToolbarIncognitoStatus, + &blink::features::kShowAlwaysContextMenuOnLinks, &kTabletToolbarReordering, + &kTabResumptionModuleAndroid, &kTabStateFlatBuffer, - &kTabStripStartupRefactoring, 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 -@@ -327,6 +327,8 @@ public abstract class ChromeFeatureList { +@@ -337,6 +337,8 @@ public abstract class ChromeFeatureList { public static final String NEW_TAB_SEARCH_ENGINE_URL_ANDROID = "NewTabSearchEngineUrlAndroid"; public static final String MOVE_TOP_TOOLBAR_TO_BOTTOM = "MoveTopToolbarToBottom"; @@ -178,17 +178,17 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f public static final String NOTIFICATION_PERMISSION_VARIANT = "NotificationPermissionVariant"; public static final String NOTIFICATION_PERMISSION_BOTTOM_SHEET = "NotificationPermissionBottomSheet"; -@@ -614,6 +616,8 @@ public abstract class ChromeFeatureList { - new CachedFlag(OMNIBOX_MATCH_TOOLBAR_AND_STATUS_BAR_COLOR, false); +@@ -605,6 +607,8 @@ public abstract class ChromeFeatureList { + newCachedFlag(OMNIBOX_MATCH_TOOLBAR_AND_STATUS_BAR_COLOR, false); public static final CachedFlag sMoveTopToolbarToBottom = - new CachedFlag(MOVE_TOP_TOOLBAR_TO_BOTTOM, false); + newCachedFlag(MOVE_TOP_TOOLBAR_TO_BOTTOM, false); + public static final CachedFlag sShowAlwaysContextMenuOnLinks = -+ new CachedFlag(SHOW_ALWAYS_CONTEXT_MENU_ON_LINKS, false); ++ newCachedFlag(SHOW_ALWAYS_CONTEXT_MENU_ON_LINKS, false); public static final CachedFlag sOmniboxModernizeVisualUpdate = - new CachedFlag(OMNIBOX_MODERNIZE_VISUAL_UPDATE, true); + newCachedFlag(OMNIBOX_MODERNIZE_VISUAL_UPDATE, true); public static final CachedFlag sOptimizationGuidePushNotifications = -@@ -747,6 +751,7 @@ public abstract class ChromeFeatureList { - sTabToGTSAnimation, +@@ -740,6 +744,7 @@ public abstract class ChromeFeatureList { + sTabWindowManagerReportIndicesMismatch, sToolbarUseHardwareBitmapDraw, sUseChimeAndroidSdk, + sShowAlwaysContextMenuOnLinks, @@ -198,7 +198,7 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f 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 -@@ -1635,6 +1635,12 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1632,6 +1632,12 @@ Your Google account may have other forms of browsing history like searches and a Move toolbar to bottom @@ -211,7 +211,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro -@@ -2675,6 +2681,9 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Open in new Chrome tab @@ -224,7 +224,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml --- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml +++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml -@@ -30,6 +30,11 @@ found in the LICENSE file. +@@ -35,6 +35,11 @@ found in the LICENSE file. android:summary="@string/page_zoom_always_show_preference_summary" android:title="@string/page_zoom_always_show_preference_title" /> @@ -239,15 +239,15 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java --- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java +++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java -@@ -34,6 +34,7 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -35,6 +35,7 @@ public class AccessibilitySettings extends PreferenceFragmentCompat private BooleanPreferenceDelegate mForceTabletUIDelegate; static final String PREF_FORCE_TABLET_UI = "force_tablet_ui"; static final String PREF_MOVE_TOOLBAR_TO_BOTTOM = "move_toolbar_bottom"; + static final String PREF_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS = "always_show_contextmenu_on_links"; private TextScalePreference mTextScalePref; private PageZoomPreference mPageZoomDefaultZoomPref; - private ChromeSwitchPreference mPageZoomAlwaysShowPref; -@@ -43,6 +44,7 @@ public class AccessibilitySettings extends PreferenceFragmentCompat + private ChromeSwitchPreference mPageZoomIncludeOSAdjustment; +@@ -45,6 +46,7 @@ public class AccessibilitySettings extends PreferenceFragmentCompat private BooleanPreferenceDelegate mReaderForAccessibilityDelegate; private double mPageZoomLatestDefaultZoomPrefValue; private BooleanPreferenceDelegate mMoveTopToolbarToBottomDelegate; @@ -255,7 +255,7 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c private FontSizePrefs mFontSizePrefs; private FontSizePrefsObserver mFontSizePrefsObserver = -@@ -143,6 +145,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -149,6 +151,12 @@ public class AccessibilitySettings extends PreferenceFragmentCompat mMoveToolbarToBottomPref.setChecked(mMoveTopToolbarToBottomDelegate.isEnabled()); mMoveToolbarToBottomPref.setOnPreferenceChangeListener(this); @@ -268,16 +268,16 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c Preference captions = findPreference(PREF_CAPTIONS); captions.setOnPreferenceClickListener( preference -> { -@@ -218,6 +226,9 @@ public class AccessibilitySettings extends PreferenceFragmentCompat +@@ -226,6 +234,9 @@ public class AccessibilitySettings extends PreferenceFragmentCompat } else if (PREF_MOVE_TOOLBAR_TO_BOTTOM.equals(preference.getKey())) { mMoveTopToolbarToBottomDelegate.setEnabled((Boolean) newValue); mDelegate.requestRestart(getActivity()); + } else if (PREF_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS.equals(preference.getKey())) { + mShowAlwaysContextMenuOnLinksDelegate.setEnabled((Boolean) newValue); + mDelegate.requestRestart(getActivity()); + } else if (PREF_PAGE_ZOOM_INCLUDE_OS_ADJUSTMENT.equals(preference.getKey())) { + // TODO(mschillaci): Implement the override behavior for OS level. } - - return true; diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java --- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java +++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java @@ -441,7 +441,7 @@ diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_ #include "third_party/blink/renderer/core/frame/attribution_src_loader.h" #include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" -@@ -63,6 +64,7 @@ +@@ -64,6 +65,7 @@ #include "third_party/blink/renderer/core/media_type_names.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/page.h" @@ -449,7 +449,7 @@ diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_ #include "third_party/blink/renderer/core/paint/timing/paint_timing.h" #include "third_party/blink/renderer/core/probe/core_probes.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h" -@@ -794,6 +796,21 @@ void HTMLImageElement::DidFinishLifecycleUpdate( +@@ -802,6 +804,21 @@ void HTMLImageElement::DidFinishLifecycleUpdate( } } @@ -474,7 +474,7 @@ diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_ diff --git a/third_party/blink/renderer/core/html/html_image_element.h b/third_party/blink/renderer/core/html/html_image_element.h --- a/third_party/blink/renderer/core/html/html_image_element.h +++ b/third_party/blink/renderer/core/html/html_image_element.h -@@ -232,6 +232,8 @@ class CORE_EXPORT HTMLImageElement final +@@ -236,6 +236,8 @@ class CORE_EXPORT HTMLImageElement final void DidAddUserAgentShadowRoot(ShadowRoot&) override; void AdjustStyle(ComputedStyleBuilder&) override; @@ -532,7 +532,7 @@ diff --git a/third_party/blink/renderer/core/page/context_menu_controller.cc b/t // Clear any previously set cached results if we are resetting the hit test // result. image_selection_cached_result_ = nullptr; -@@ -835,11 +847,13 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame, +@@ -840,11 +852,13 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame, SetAutofillData(result.InnerNode(), data); SetPasswordManagerData(result.InnerElement(), data); diff --git a/build/patches/Add-site-engagement-flag.patch b/build/patches/Add-site-engagement-flag.patch index 667d1b171..2e151856e 100644 --- a/build/patches/Add-site-engagement-flag.patch +++ b/build/patches/Add-site-engagement-flag.patch @@ -23,7 +23,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -152,6 +152,7 @@ +@@ -153,6 +153,7 @@ #include "components/send_tab_to_self/features.h" #include "components/services/heap_profiling/public/cpp/switches.h" #include "components/services/storage/public/cpp/buckets/bucket_info.h" @@ -42,7 +42,7 @@ diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components #include "components/feature_engagement/internal/availability_model_impl.h" #include "components/feature_engagement/internal/blocked_iph_features.h" #include "components/feature_engagement/internal/chrome_variations_configuration.h" -@@ -187,6 +188,8 @@ TrackerImpl::TrackerImpl( +@@ -207,6 +208,8 @@ TrackerImpl::TrackerImpl( TrackerImpl::~TrackerImpl() = default; void TrackerImpl::NotifyEvent(const std::string& event) { diff --git a/build/patches/Add-support-for-ISupportHelpAndFeedback.patch b/build/patches/Add-support-for-ISupportHelpAndFeedback.patch index 56f129f95..5a7066b6b 100644 --- a/build/patches/Add-support-for-ISupportHelpAndFeedback.patch +++ b/build/patches/Add-support-for-ISupportHelpAndFeedback.patch @@ -12,7 +12,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java -@@ -85,6 +85,7 @@ import org.chromium.components.browser_ui.settings.CustomDividerFragment; +@@ -83,6 +83,7 @@ import org.chromium.components.browser_ui.settings.CustomDividerFragment; import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher; import org.chromium.components.browser_ui.settings.PaddedItemDecorationWithDivider; import org.chromium.components.browser_ui.settings.SettingsLauncher; @@ -20,7 +20,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin import org.chromium.components.browser_ui.site_settings.BaseSiteSettingsFragment; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.browser_ui.util.TraceEventVectorDrawableCompat; -@@ -454,8 +455,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity +@@ -453,8 +454,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity finish(); return true; } else if (item.getItemId() == R.id.menu_id_general_help) { diff --git a/build/patches/Add-support-to-jxl.patch b/build/patches/Add-support-to-jxl.patch index f7c6ee092..94f820cf2 100644 --- a/build/patches/Add-support-to-jxl.patch +++ b/build/patches/Add-support-to-jxl.patch @@ -56,8 +56,9 @@ Enabled by default third_party/libjxl/OWNERS | 9 + third_party/libjxl/README.chromium | 15 + .../libjxl/gen_headers/jxl/jxl_export.h | 11 + - tools/metrics/histograms/enums.xml | 3 +- - 52 files changed, 1995 insertions(+), 17 deletions(-) + tools/metrics/histograms/enums.xml | 1 + + .../histograms/metadata/blink/enums.xml | 2 +- + 53 files changed, 1995 insertions(+), 17 deletions(-) create mode 100644 build/linux/unbundle/libjxl.gn create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-support-to-jxl.inc create mode 100644 cromite_flags/third_party/blink/common/features_cc/Add-support-to-jxl.inc @@ -83,7 +84,7 @@ Enabled by default diff --git a/DEPS b/DEPS --- a/DEPS +++ b/DEPS -@@ -485,6 +485,10 @@ vars = { +@@ -487,6 +487,10 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -94,7 +95,7 @@ diff --git a/DEPS b/DEPS 'highway_revision': '8f20644eca693cfb74aa795b0006b6779c370e7a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ffmpeg -@@ -1103,6 +1107,9 @@ deps = { +@@ -1105,6 +1109,9 @@ deps = { 'src/third_party/dawn': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'), @@ -315,7 +316,7 @@ diff --git a/media/BUILD.gn b/media/BUILD.gn diff --git a/media/media_options.gni b/media/media_options.gni --- a/media/media_options.gni +++ b/media/media_options.gni -@@ -129,6 +129,9 @@ declare_args() { +@@ -132,6 +132,9 @@ declare_args() { # `enable_libaom` should likely also be overriddent to false. enable_av1_decoder = enable_dav1d_decoder @@ -374,7 +375,7 @@ diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc diff --git a/third_party/.gitignore b/third_party/.gitignore --- a/third_party/.gitignore +++ b/third_party/.gitignore -@@ -97,6 +97,7 @@ +@@ -91,6 +91,7 @@ /libgifcodec /libjingle/source /libupnp @@ -393,7 +394,7 @@ diff --git a/third_party/blink/common/loader/network_utils.cc b/third_party/blin namespace blink { namespace network_utils { -@@ -33,7 +34,20 @@ bool AlwaysAccessNetwork( +@@ -34,7 +35,20 @@ bool AlwaysAccessNetwork( } const char* ImageAcceptHeader() { @@ -466,7 +467,7 @@ diff --git a/third_party/blink/common/mime_util/mime_util_unittest.cc b/third_pa diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl -@@ -4246,6 +4246,7 @@ domain Emulation +@@ -4258,6 +4258,7 @@ domain Emulation experimental type DisabledImageType extends string enum avif @@ -477,7 +478,7 @@ diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/t diff --git a/third_party/blink/renderer/core/inspector/inspector_emulation_agent.cc b/third_party/blink/renderer/core/inspector/inspector_emulation_agent.cc --- a/third_party/blink/renderer/core/inspector/inspector_emulation_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_emulation_agent.cc -@@ -495,10 +495,10 @@ AtomicString InspectorEmulationAgent::OverrideAcceptImageHeader( +@@ -502,10 +502,10 @@ AtomicString InspectorEmulationAgent::OverrideAcceptImageHeader( String header(network_utils::ImageAcceptHeader()); for (String type : *disabled_image_types) { // The header string is expected to be like @@ -491,7 +492,7 @@ diff --git a/third_party/blink/renderer/core/inspector/inspector_emulation_agent header.Replace(String(type + ","), ""); } return AtomicString(header); -@@ -843,6 +843,7 @@ protocol::Response InspectorEmulationAgent::setDisabledImageTypes( +@@ -850,6 +850,7 @@ protocol::Response InspectorEmulationAgent::setDisabledImageTypes( namespace DisabledImageTypeEnum = protocol::Emulation::DisabledImageTypeEnum; for (protocol::Emulation::DisabledImageType type : *disabled_types) { if (DisabledImageTypeEnum::Avif == type || @@ -607,7 +608,7 @@ diff --git a/third_party/blink/renderer/modules/webcodecs/image_decoder_fuzzer.c diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -2264,6 +2264,10 @@ source_set("blink_platform_unittests_sources") { +@@ -2277,6 +2277,10 @@ source_set("blink_platform_unittests_sources") { sources += [ "text/locale_icu_test.cc" ] } @@ -618,7 +619,7 @@ diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/re sources += [ "testing/run_all_tests.cc" ] configs += [ -@@ -2307,6 +2311,7 @@ source_set("blink_platform_unittests_sources") { +@@ -2320,6 +2324,7 @@ source_set("blink_platform_unittests_sources") { "//third_party/blink/renderer/platform/scheduler:unit_tests", "//third_party/blink/renderer/platform/wtf", "//third_party/libavif:libavif", @@ -2221,7 +2222,7 @@ diff --git a/third_party/blink/tools/commit_stats/git-dirs.txt b/third_party/bli diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations -@@ -4852,6 +4852,12 @@ crbug.com/1199522 http/tests/devtools/layers/layers-3d-view-hit-testing.js [ Fai +@@ -4569,6 +4569,12 @@ crbug.com/1199522 http/tests/devtools/layers/layers-3d-view-hit-testing.js [ Fai # Started failing after rolling new version of check-layout-th.js css3/flexbox/perpendicular-writing-modes-inside-flex-item.html [ Failure ] @@ -2237,7 +2238,7 @@ diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/we diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites -@@ -441,6 +441,15 @@ +@@ -102,6 +102,15 @@ "--disable-threaded-compositing", "--disable-threaded-animation"], "expires": "Jul 1, 2023" }, @@ -2251,8 +2252,8 @@ diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/w + "expires": "Jul 1, 2023" + }, { - "prefix": "scalefactor150", - "platforms": ["Linux", "Win"], + "prefix": "unsafe_webgpu", + "platforms": ["Linux", "Mac", "Win"], diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/emulation/emulation-set-disabled-image-types-jxl-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/emulation/emulation-set-disabled-image-types-jxl-expected.txt new file mode 100644 --- /dev/null @@ -2652,16 +2653,7 @@ new file mode 100644 diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml -@@ -11344,7 +11344,7 @@ to ensure that the crash string is shown properly on the user-facing crash UI. - - - -- -+ - - - -@@ -34310,6 +34310,7 @@ from previous Chrome versions. +@@ -23856,6 +23856,7 @@ from previous Chrome versions. @@ -2669,4 +2661,16 @@ diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums +diff --git a/tools/metrics/histograms/metadata/blink/enums.xml b/tools/metrics/histograms/metadata/blink/enums.xml +--- a/tools/metrics/histograms/metadata/blink/enums.xml ++++ b/tools/metrics/histograms/metadata/blink/enums.xml +@@ -227,7 +227,7 @@ chromium-metrics-reviews@google.com. + + + +- ++ + + + -- diff --git a/build/patches/Add-webGL-site-setting.patch b/build/patches/Add-webGL-site-setting.patch index db26b62d7..7d91453fb 100644 --- a/build/patches/Add-webGL-site-setting.patch +++ b/build/patches/Add-webGL-site-setting.patch @@ -218,7 +218,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -309,6 +309,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits( +@@ -310,6 +310,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits( } } @@ -232,7 +232,7 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba unsigned WebGLRenderingContextBase::CurrentMaxGLContexts() { base::AutoLock locker(WebGLContextLimitLock()); DCHECK(webgl_context_limits_initialized_); -@@ -582,25 +589,6 @@ static String ExtractWebGLContextCreationError( +@@ -583,25 +590,6 @@ static String ExtractWebGLContextCreationError( const Platform::GraphicsInfo& info) { StringBuilder builder; builder.Append("Could not create a WebGL context"); @@ -258,7 +258,7 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba FormatWebGLStatusString("ErrorMessage", info.error_message.Utf8().c_str(), builder); builder.Append('.'); -@@ -660,6 +648,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider( +@@ -661,6 +649,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider( const CanvasContextCreationAttributesCore& attributes, Platform::ContextType context_type, Platform::GraphicsInfo* graphics_info) { @@ -274,7 +274,7 @@ diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_ba diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h -@@ -1952,6 +1952,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, +@@ -1959,6 +1959,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, DOMArrayBufferView* pixels, int64_t offset); diff --git a/build/patches/Add-webRTC-site-settings.patch b/build/patches/Add-webRTC-site-settings.patch index b1dd0017e..c363af11e 100644 --- a/build/patches/Add-webRTC-site-settings.patch +++ b/build/patches/Add-webRTC-site-settings.patch @@ -195,7 +195,7 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_d #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h" #include "third_party/blink/public/web/web_document.h" -@@ -774,6 +775,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator( +@@ -807,6 +808,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator( // origin. WebRTCIPHandlingPolicy policy = GetWebRTCIPHandlingPolicy(webrtc_ip_handling_policy); @@ -244,9 +244,9 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +#include "third_party/blink/public/platform/web_content_settings_client.h" +#include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" + #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoding_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h" - #include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_rtcp_parameters.h" -@@ -1034,6 +1036,14 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, +@@ -1062,6 +1064,14 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, if (kind != "audio" && kind != "video") return nullptr; diff --git a/build/patches/Allow-DocumentPiP-if-PopupsAndRedirects-are-active.patch b/build/patches/Allow-DocumentPiP-if-PopupsAndRedirects-are-active.patch index aab15cee9..6e1db858f 100644 --- a/build/patches/Allow-DocumentPiP-if-PopupsAndRedirects-are-active.patch +++ b/build/patches/Allow-DocumentPiP-if-PopupsAndRedirects-are-active.patch @@ -12,7 +12,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc b/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc --- a/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc +++ b/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc -@@ -376,6 +376,13 @@ void PictureInPictureControllerImpl::CreateDocumentPictureInPictureWindow( +@@ -367,6 +367,13 @@ void PictureInPictureControllerImpl::CreateDocumentPictureInPictureWindow( return; } diff --git a/build/patches/Allow-building-without-enable_reporting.patch b/build/patches/Allow-building-without-enable_reporting.patch index 3f8470996..1024f7150 100644 --- a/build/patches/Allow-building-without-enable_reporting.patch +++ b/build/patches/Allow-building-without-enable_reporting.patch @@ -72,7 +72,7 @@ diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/ void CrossOriginEmbedderPolicyReporter::QueueAndNotify( std::initializer_list> body, bool report_only) { -- const absl::optional& endpoint = +- const std::optional& endpoint = - report_only ? report_only_endpoint_ : endpoint_; const char* const disposition = report_only ? "reporting" : "enforce"; if (observer_) { @@ -88,7 +88,7 @@ diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/ base::Value::Dict body_to_pass; for (const auto& pair : body) { @@ -125,6 +127,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify( - /*user_agent=*/absl::nullopt, std::move(body_to_pass)); + /*user_agent=*/std::nullopt, std::move(body_to_pass)); } } +#endif @@ -152,7 +152,7 @@ diff --git a/content/browser/network/cross_origin_opener_policy_reporter.cc b/co @@ -280,12 +275,14 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport( storage_partition_->GetNetworkContext()->QueueReport( "coop", endpoint, context_url_, reporting_source_, - network_anonymization_key_, absl::nullopt, std::move(body)); + network_anonymization_key_, std::nullopt, std::move(body)); +#endif } @@ -167,7 +167,7 @@ diff --git a/content/browser/network/cross_origin_opener_policy_reporter.cc b/co @@ -294,6 +291,7 @@ void CrossOriginOpenerPolicyReporter::QueueNavigationReport( "coop", endpoint, context_url_, reporting_source_, network_anonymization_key_, - /*user_agent=*/absl::nullopt, std::move(body)); + /*user_agent=*/std::nullopt, std::move(body)); +#endif } @@ -193,7 +193,7 @@ diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browse return; rph->GetStoragePartition()->GetNetworkContext()->QueueReport( type, group, url, reporting_source_, network_anonymization_key_, - /*user_agent=*/absl::nullopt, std::move(body)); + /*user_agent=*/std::nullopt, std::move(body)); +#endif } @@ -201,7 +201,7 @@ diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browse diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -13593,12 +13593,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport( +@@ -13726,12 +13726,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport( base::Value::Dict body; if (!reason.empty()) body.Set("reason", reason); @@ -210,7 +210,7 @@ diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/b - GetProcess()->GetStoragePartition()->GetNetworkContext()->QueueReport( - /*type=*/"crash", /*group=*/"default", last_committed_url_, - GetReportingSource(), isolation_info_.network_anonymization_key(), -- absl::nullopt /* user_agent */, std::move(body)); +- std::nullopt /* user_agent */, std::move(body)); } void RenderFrameHostImpl::SendCommitNavigation( @@ -254,7 +254,7 @@ new file mode 100644 diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc -@@ -227,6 +227,7 @@ extern const base::FeatureParam kTimeoutTcpConnectAttemptMax( +@@ -215,6 +215,7 @@ extern const base::FeatureParam kTimeoutTcpConnectAttemptMax( base::Seconds(30)); #if BUILDFLAG(ENABLE_REPORTING) @@ -265,7 +265,7 @@ diff --git a/net/base/features.cc b/net/base/features.cc diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc --- a/net/reporting/reporting_service.cc +++ b/net/reporting/reporting_service.cc -@@ -211,6 +211,12 @@ class ReportingServiceImpl : public ReportingService { +@@ -214,6 +214,12 @@ class ReportingServiceImpl : public ReportingService { base::Value::Dict body, int depth, base::TimeTicks queued_ticks) { @@ -281,7 +281,7 @@ diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_servic diff --git a/services/network/network_context.h b/services/network/network_context.h --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -472,10 +472,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -464,10 +464,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext const absl::optional& reporting_source, const net::NetworkAnonymizationKey& network_anonymization_key, const absl::optional& user_agent, @@ -297,7 +297,7 @@ diff --git a/services/network/network_context.h b/services/network/network_conte diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn -@@ -1435,7 +1435,6 @@ mojom("mojom") { +@@ -1439,7 +1439,6 @@ mojom("mojom") { export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" export_header_blink = "third_party/blink/public/platform/web_common.h" if (enable_reporting) { @@ -308,7 +308,7 @@ diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mo diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1197,6 +1197,7 @@ interface NetworkContext { +@@ -1223,6 +1223,7 @@ interface NetworkContext { // provided |network_isolation_key|. // // Spec: https://w3c.github.io/reporting/#concept-reports @@ -316,7 +316,7 @@ diff --git a/services/network/public/mojom/network_context.mojom b/services/netw QueueReport(string type, string group, url.mojom.Url url, -@@ -1210,6 +1211,7 @@ interface NetworkContext { +@@ -1236,6 +1237,7 @@ interface NetworkContext { // Note that this queued report will never be delivered if no reporting // endpoint matching is registered for with the provided // |network_isolation_key|. @@ -335,7 +335,7 @@ diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.c #include "base/containers/contains.h" #include "base/debug/dump_without_crashing.h" #include "services/network/public/cpp/web_sandbox_flags.h" -@@ -1169,6 +1170,7 @@ void ContentSecurityPolicy::ReportViolation( +@@ -1166,6 +1167,7 @@ void ContentSecurityPolicy::ReportViolation( return; } @@ -343,7 +343,7 @@ diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.c PostViolationReport(violation_data, context_frame, report_endpoints, use_reporting_api); -@@ -1176,6 +1178,7 @@ void ContentSecurityPolicy::ReportViolation( +@@ -1173,6 +1175,7 @@ void ContentSecurityPolicy::ReportViolation( // `context_frame` (i.e. we're not processing 'frame-ancestors'). if (delegate_ && !context_frame) delegate_->DispatchViolationEvent(*violation_data, element); @@ -362,7 +362,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/ #include "services/network/public/cpp/features.h" #include "services/network/public/mojom/content_security_policy.mojom-blink.h" #include "services/network/public/mojom/source_location.mojom-blink.h" -@@ -2585,9 +2586,11 @@ void LocalFrame::MainFrameInteractive() { +@@ -2601,9 +2602,11 @@ void LocalFrame::MainFrameInteractive() { v8_local_compile_hints_producer_->GenerateData(); } @@ -385,7 +385,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/b #include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "services/network/public/mojom/fetch_api.mojom-blink-forward.h" -@@ -657,8 +658,9 @@ class CORE_EXPORT LocalFrame final +@@ -655,8 +656,9 @@ class CORE_EXPORT LocalFrame final void FinishedScrollSequence(); SmoothScrollSequencer* GetSmoothScrollSequencer() const; diff --git a/build/patches/Allow-building-without-supervised-users.patch b/build/patches/Allow-building-without-supervised-users.patch index 09f5949f0..03a7bf3f7 100644 --- a/build/patches/Allow-building-without-supervised-users.patch +++ b/build/patches/Allow-building-without-supervised-users.patch @@ -24,7 +24,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -3657,7 +3657,6 @@ generate_jni("chrome_jni_headers") { +@@ -3691,7 +3691,6 @@ generate_jni("chrome_jni_headers") { "java/src/org/chromium/chrome/browser/status_indicator/StatusIndicatorSceneLayer.java", "java/src/org/chromium/chrome/browser/suggestions/mostvisited/MostVisitedSites.java", "java/src/org/chromium/chrome/browser/suggestions/mostvisited/MostVisitedSitesBridge.java", @@ -46,7 +46,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java -@@ -69,7 +69,6 @@ import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; +@@ -68,7 +68,6 @@ import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.prefs.PrefService; @@ -54,7 +54,7 @@ diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/ import org.chromium.components.user_prefs.UserPrefs; import org.chromium.third_party.android.swiperefresh.SwipeRefreshLayout; import org.chromium.ui.base.DeviceFormFactor; -@@ -848,9 +847,7 @@ public class FeedSurfaceCoordinator +@@ -775,9 +774,7 @@ public class FeedSurfaceCoordinator * Returns true if the supervised user feed should be displayed. */ public boolean shouldDisplaySupervisedFeed() { @@ -68,7 +68,7 @@ diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -3161,8 +3161,6 @@ static_library("browser") { +@@ -3147,8 +3147,6 @@ static_library("browser") { "feed/android/refresh_task_scheduler_impl.cc", "feed/android/refresh_task_scheduler_impl.h", "feed/android/web_feed_bridge.cc", @@ -77,7 +77,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn "file_select_helper_contacts_android.cc", "file_select_helper_contacts_android.h", "first_run/android/first_run_prefs.cc", -@@ -3381,10 +3379,6 @@ static_library("browser") { +@@ -3354,10 +3352,6 @@ static_library("browser") { "ssl/chrome_security_state_model_delegate.h", "ssl/known_interception_disclosure_infobar.cc", "ssl/known_interception_disclosure_infobar.h", @@ -91,7 +91,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc -@@ -1001,9 +1001,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { +@@ -999,9 +999,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { settings_api::PrefType::kBoolean; #endif @@ -106,7 +106,7 @@ diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chro diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc -@@ -696,10 +696,12 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) { +@@ -683,10 +683,12 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) { prefs->SetTime(prefs::kProfileCreationTime, path_creation_time_); pref_change_registrar_.Init(prefs); @@ -119,7 +119,7 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p // Changes in the profile avatar. pref_change_registrar_.Add( -@@ -1625,11 +1627,13 @@ GURL ProfileImpl::GetHomePage() { +@@ -1614,11 +1616,13 @@ GURL ProfileImpl::GetHomePage() { } void ProfileImpl::UpdateSupervisedUserIdInStorage() { @@ -136,7 +136,7 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc -@@ -1222,6 +1222,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { +@@ -1223,6 +1223,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { profile->GetPrefs()->SetString(prefs::kProfileName, profile_name); } @@ -144,7 +144,7 @@ diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profile base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); bool force_supervised_user_id = #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -1243,6 +1244,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { +@@ -1244,6 +1245,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { profile->GetPrefs()->SetString(prefs::kSupervisedUserId, supervised_user_id); } @@ -152,7 +152,7 @@ diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profile #if !BUILDFLAG(IS_ANDROID) if (profile->IsNewProfile()) { profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, false); -@@ -2046,8 +2048,10 @@ void ProfileManager::AddProfileToStorage(Profile* profile) { +@@ -2051,8 +2053,10 @@ void ProfileManager::AddProfileToStorage(Profile* profile) { init_params.icon_index = profile->GetPrefs()->GetInteger(prefs::kProfileAvatarIndex); @@ -181,7 +181,7 @@ diff --git a/chrome/browser/ui/webui/managed_ui_handler.cc b/chrome/browser/ui/w diff --git a/chrome/browser/ui/webui/management/management_ui_handler.cc b/chrome/browser/ui/webui/management/management_ui_handler.cc --- a/chrome/browser/ui/webui/management/management_ui_handler.cc +++ b/chrome/browser/ui/webui/management/management_ui_handler.cc -@@ -1456,10 +1456,12 @@ void ManagementUIHandler::AddObservers() { +@@ -1507,10 +1507,12 @@ void ManagementUIHandler::AddObservers() { pref_registrar_.Init(profile->GetPrefs()); @@ -223,7 +223,7 @@ diff --git a/components/supervised_user/core/browser/supervised_user_preferences diff --git a/components/supervised_user/core/common/features.cc b/components/supervised_user/core/common/features.cc --- a/components/supervised_user/core/common/features.cc +++ b/components/supervised_user/core/common/features.cc -@@ -165,4 +165,5 @@ bool IsShadowKidsApiWithSafeSitesEnabled() { +@@ -174,4 +174,5 @@ bool IsShadowKidsApiWithSafeSitesEnabled() { return base::FeatureList::IsEnabled(kShadowKidsApiWithSafeSites); } diff --git a/build/patches/Allow-playing-audio-in-background.patch b/build/patches/Allow-playing-audio-in-background.patch index f1987a08d..514ca2a80 100644 --- a/build/patches/Allow-playing-audio-in-background.patch +++ b/build/patches/Allow-playing-audio-in-background.patch @@ -11,7 +11,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc --- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc -@@ -1177,6 +1177,12 @@ bool WebMediaPlayerImpl::HasAudio() const { +@@ -1181,6 +1181,12 @@ bool WebMediaPlayerImpl::HasAudio() const { return pipeline_metadata_.has_audio; } @@ -24,7 +24,7 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc void WebMediaPlayerImpl::EnabledAudioTracksChanged( const WebVector& enabledTrackIds) { DCHECK(main_task_runner_->BelongsToCurrentThread()); -@@ -3504,7 +3510,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const { +@@ -3524,7 +3530,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const { : HasAudio(); // Audio only stream is allowed to play when in background. diff --git a/build/patches/Always-use-new-tab-page-for-default-home-page.patch b/build/patches/Always-use-new-tab-page-for-default-home-page.patch index 11eaf6546..53961e67d 100644 --- a/build/patches/Always-use-new-tab-page-for-default-home-page.patch +++ b/build/patches/Always-use-new-tab-page-for-default-home-page.patch @@ -54,7 +54,7 @@ diff --git a/components/search_engines/android/java/src/org/chromium/components/ diff --git a/components/search_engines/android/template_url_service_android.cc b/components/search_engines/android/template_url_service_android.cc --- a/components/search_engines/android/template_url_service_android.cc +++ b/components/search_engines/android/template_url_service_android.cc -@@ -324,6 +324,7 @@ jboolean TemplateUrlServiceAndroid::SetPlayAPISearchEngine( +@@ -330,6 +330,7 @@ jboolean TemplateUrlServiceAndroid::SetPlayAPISearchEngine( const base::android::JavaParamRef& jimage_translate_target_language_param_key, jboolean set_as_default) { diff --git a/build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch b/build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch index 67cf3c401..297bce197 100644 --- a/build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch +++ b/build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch @@ -161,15 +161,15 @@ diff --git a/third_party/blink/renderer/modules/webaudio/offline_audio_context.c diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc --- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc +++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc -@@ -29,6 +29,7 @@ - #include +@@ -31,6 +31,7 @@ + #include #include +#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h" #include "third_party/blink/renderer/platform/audio/audio_bus.h" #include "third_party/blink/renderer/platform/audio/audio_utilities.h" #include "third_party/blink/renderer/platform/audio/vector_math.h" -@@ -154,6 +155,7 @@ void RealtimeAnalyser::GetFloatTimeDomainData( +@@ -155,6 +156,7 @@ void RealtimeAnalyser::GetFloatTimeDomainData( input_buffer[(i + write_index - fft_size + kInputBufferSize) % kInputBufferSize]; @@ -177,7 +177,7 @@ diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/ destination[i] = value; } } -@@ -181,6 +183,8 @@ void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array) { +@@ -182,6 +184,8 @@ void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array) { input_buffer[(i + write_index - fft_size + kInputBufferSize) % kInputBufferSize]; @@ -186,7 +186,7 @@ diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/ // Scale from nominal -1 -> +1 to unsigned byte. double scaled_value = 128 * (value + 1); -@@ -300,6 +304,8 @@ void RealtimeAnalyser::ConvertToByteData(DOMUint8Array* destination_array) { +@@ -301,6 +305,8 @@ void RealtimeAnalyser::ConvertToByteData(DOMUint8Array* destination_array) { double scaled_value = UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor; @@ -195,7 +195,7 @@ diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/ // Clip to valid range. destination[i] = static_cast(ClampTo(scaled_value, 0, UCHAR_MAX)); -@@ -319,6 +325,7 @@ void RealtimeAnalyser::ConvertFloatToDb(DOMFloat32Array* destination_array) { +@@ -320,6 +326,7 @@ void RealtimeAnalyser::ConvertFloatToDb(DOMFloat32Array* destination_array) { float linear_value = source[i]; double db_mag = audio_utilities::LinearToDecibels(linear_value); destination[i] = static_cast(db_mag); diff --git a/build/patches/Block-gateway-attacks-via-websockets.patch b/build/patches/Block-gateway-attacks-via-websockets.patch index 907162294..80191aa68 100644 --- a/build/patches/Block-gateway-attacks-via-websockets.patch +++ b/build/patches/Block-gateway-attacks-via-websockets.patch @@ -50,7 +50,7 @@ diff --git a/third_party/blink/renderer/core/execution_context/execution_context diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h --- a/third_party/blink/renderer/core/execution_context/execution_context.h +++ b/third_party/blink/renderer/core/execution_context/execution_context.h -@@ -391,6 +391,7 @@ class CORE_EXPORT ExecutionContext : public Supplementable, +@@ -390,6 +390,7 @@ class CORE_EXPORT ExecutionContext : public Supplementable, void SetAddressSpace(network::mojom::blink::IPAddressSpace ip_address_space); HeapObserverSet& ContextLifecycleObserverSet(); @@ -225,7 +225,7 @@ diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetc diff --git a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc --- a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc +++ b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc -@@ -276,6 +276,11 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) { +@@ -277,6 +277,11 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) { return false; } diff --git a/build/patches/Block-qjz9zk-or-trk-requests.patch b/build/patches/Block-qjz9zk-or-trk-requests.patch index 4e38f1320..29d9a5436 100644 --- a/build/patches/Block-qjz9zk-or-trk-requests.patch +++ b/build/patches/Block-qjz9zk-or-trk-requests.patch @@ -119,7 +119,7 @@ diff --git a/content/browser/child_process_security_policy_impl.cc b/content/bro diff --git a/net/BUILD.gn b/net/BUILD.gn --- a/net/BUILD.gn +++ b/net/BUILD.gn -@@ -995,6 +995,8 @@ component("net") { +@@ -990,6 +990,8 @@ component("net") { "url_request/url_request_http_job.cc", "url_request/url_request_http_job.h", "url_request/url_request_interceptor.cc", @@ -228,7 +228,7 @@ diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc -@@ -48,6 +48,7 @@ +@@ -47,6 +47,7 @@ #include "net/socket/network_binding_client_socket_factory.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/static_http_user_agent_settings.h" @@ -236,7 +236,7 @@ diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/ur #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_throttler_manager.h" -@@ -574,6 +575,8 @@ std::unique_ptr URLRequestContextBuilder::Build() { +@@ -565,6 +566,8 @@ std::unique_ptr URLRequestContextBuilder::Build() { job_factory->SetProtocolHandler(scheme_handler.first, std::move(scheme_handler.second)); } @@ -270,7 +270,7 @@ diff --git a/url/url_constants.h b/url/url_constants.h diff --git a/url/url_util.cc b/url/url_util.cc --- a/url/url_util.cc +++ b/url/url_util.cc -@@ -46,6 +46,7 @@ struct SchemeRegistry { +@@ -47,6 +47,7 @@ struct SchemeRegistry { std::vector standard_schemes = { {kHttpsScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, {kHttpScheme, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION}, @@ -278,7 +278,7 @@ diff --git a/url/url_util.cc b/url/url_util.cc // Yes, file URLs can have a hostname, so file URLs should be handled as // "standard". File URLs never have a port as specified by the SchemeType // field. Unlike other SCHEME_WITH_HOST schemes, the 'host' in a file -@@ -91,6 +92,7 @@ struct SchemeRegistry { +@@ -92,6 +93,7 @@ struct SchemeRegistry { kAboutScheme, kJavaScriptScheme, kDataScheme, diff --git a/build/patches/Bromite-auto-updater.patch b/build/patches/Bromite-auto-updater.patch index 926a22ef9..46ffb4d38 100644 --- a/build/patches/Bromite-auto-updater.patch +++ b/build/patches/Bromite-auto-updater.patch @@ -21,10 +21,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../inline/BromiteInlineUpdateController.java | 272 ++++++++++++++++++ .../omaha/inline/InlineUpdateController.java | 51 ++++ .../inline/InlineUpdateControllerFactory.java | 21 ++ - chrome/browser/endpoint_fetcher/BUILD.gn | 2 + - .../endpoint_fetcher_android.cc | 50 ++++ - .../endpoint_fetcher/EndpointFetcher.java | 27 ++ + chrome/browser/BUILD.gn | 2 + + chrome/browser/endpoint_fetcher/BUILD.gn | 32 +++ + chrome/browser/endpoint_fetcher/DEPS | 3 + + chrome/browser/endpoint_fetcher/OWNERS | 1 + + .../endpoint_fetcher_android.cc | 183 ++++++++++++ + .../endpoint_fetcher/EndpointFetcher.java | 165 +++++++++++ .../EndpointHeaderResponse.java | 31 ++ + .../endpoint_fetcher/EndpointResponse.java | 30 ++ .../flags/android/chrome_feature_list.cc | 1 + .../browser/flags/ChromeFeatureList.java | 1 + .../strings/android_chrome_strings.grd | 23 +- @@ -32,11 +36,17 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../endpoint_fetcher/endpoint_fetcher.h | 23 +- .../Bromite-auto-updater.inc | 3 + .../Bromite-auto-updater.inc | 1 + - 24 files changed, 932 insertions(+), 52 deletions(-) + 28 files changed, 1269 insertions(+), 52 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java + create mode 100644 chrome/browser/endpoint_fetcher/BUILD.gn + create mode 100644 chrome/browser/endpoint_fetcher/DEPS + create mode 100644 chrome/browser/endpoint_fetcher/OWNERS + create mode 100644 chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc + create mode 100644 chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java create mode 100644 chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java + create mode 100644 chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Bromite-auto-updater.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Bromite-auto-updater.inc @@ -55,7 +65,7 @@ diff --git a/build/android/java/templates/BuildConfig.template b/build/android/j diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni -@@ -1908,6 +1908,9 @@ if (enable_java_templates && is_android) { +@@ -1910,6 +1910,9 @@ if (enable_java_templates && is_android) { sources = [ "//build/android/java/templates/BuildConfig.template" ] defines = [] @@ -68,7 +78,7 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -872,6 +872,9 @@ chrome_java_sources = [ +@@ -875,6 +875,9 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java", "java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java", "java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java", @@ -76,8 +86,8 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java + "java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java", + "java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java", "java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java", - "java/src/org/chromium/chrome/browser/omaha/metrics/HistogramUtils.java", "java/src/org/chromium/chrome/browser/omaha/metrics/TrackingProvider.java", + "java/src/org/chromium/chrome/browser/omaha/metrics/UpdateSuccessMetrics.java", diff --git a/chrome/android/java/res/xml/about_chrome_preferences.xml b/chrome/android/java/res/xml/about_chrome_preferences.xml --- a/chrome/android/java/res/xml/about_chrome_preferences.xml +++ b/chrome/android/java/res/xml/about_chrome_preferences.xml @@ -318,7 +328,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMen import org.chromium.base.BuildInfo; import org.chromium.base.Callback; -@@ -138,8 +139,21 @@ public class UpdateMenuItemHelper { +@@ -146,8 +147,21 @@ public class UpdateMenuItemHelper { Log.e(TAG, "Failed to launch Activity for: %s", mStatus.updateUrl); } break; @@ -340,7 +350,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMen default: return; } -@@ -188,7 +202,7 @@ public class UpdateMenuItemHelper { +@@ -196,7 +210,7 @@ public class UpdateMenuItemHelper { mMenuUiState = new MenuUiState(); switch (mStatus.updateState) { @@ -349,7 +359,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMen // The badge is hidden if the update menu item has been clicked until there is an // even newer version of Chrome available. showBadge |= -@@ -247,6 +261,72 @@ public class UpdateMenuItemHelper { +@@ -255,6 +269,72 @@ public class UpdateMenuItemHelper { mMenuUiState.itemState.icon = R.drawable.ic_error_24dp_filled; mMenuUiState.itemState.enabled = false; break; @@ -1100,39 +1110,115 @@ new file mode 100644 + return new BromiteInlineUpdateController(callback); + } +} +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -3094,6 +3094,7 @@ static_library("browser") { + "download/android/service/download_task_scheduler.h", + "download/android/string_utils.cc", + "download/download_crx_util_android.cc", ++ "endpoint_fetcher/endpoint_fetcher_android.cc", + "enterprise/reporting/browser_report_generator_android.cc", + "enterprise/reporting/browser_report_generator_android.h", + "enterprise/reporting/profile_report_generator_android.cc", +@@ -3431,6 +3432,7 @@ static_library("browser") { + "//chrome/browser/consent_auditor/android:jni_headers", + "//chrome/browser/device_reauth/android:jni_headers", + "//chrome/browser/download/internal/android", ++ "//chrome/browser/endpoint_fetcher:jni_headers", + "//chrome/browser/feed/android:jni_headers", + "//chrome/browser/feedback/android", + "//chrome/browser/feedback/android:jni_headers", diff --git a/chrome/browser/endpoint_fetcher/BUILD.gn b/chrome/browser/endpoint_fetcher/BUILD.gn ---- a/chrome/browser/endpoint_fetcher/BUILD.gn +new file mode 100644 +--- /dev/null +++ b/chrome/browser/endpoint_fetcher/BUILD.gn -@@ -19,6 +19,7 @@ android_library("java") { - sources = [ - "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java", - "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java", +@@ -0,0 +1,32 @@ ++# Copyright 2020 The Chromium Authors ++# Use of this source code is governed by a BSD-style license that can be ++# found in the LICENSE file. ++ ++import("//build/config/android/rules.gni") ++import("//third_party/jni_zero/jni_zero.gni") ++ ++android_library("java") { ++ deps = [ ++ ":jni_headers", ++ "//base:base_java", ++ "//build/android:build_java", ++ "//chrome/browser/profiles/android:java", ++ "//net/android:net_java", ++ "//third_party/androidx:androidx_annotation_annotation_java", ++ "//third_party/jni_zero:jni_zero_java", ++ ] ++ srcjar_deps = [ ":jni_headers" ] ++ sources = [ ++ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java", ++ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java", + "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java", - ] - } - -@@ -26,5 +27,6 @@ generate_jni("jni_headers") { - sources = [ - "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java", - "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java", ++ ] ++} ++ ++generate_jni("jni_headers") { ++ sources = [ ++ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java", ++ "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java", + "java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java", - ] - } ++ ] ++} +diff --git a/chrome/browser/endpoint_fetcher/DEPS b/chrome/browser/endpoint_fetcher/DEPS +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/endpoint_fetcher/DEPS +@@ -0,0 +1,3 @@ ++include_rules = [ ++ "+components/endpoint_fetcher", ++] +diff --git a/chrome/browser/endpoint_fetcher/OWNERS b/chrome/browser/endpoint_fetcher/OWNERS +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/endpoint_fetcher/OWNERS +@@ -0,0 +1 @@ ++file://chrome/browser/complex_tasks/OWNERS diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc b/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc ---- a/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc +new file mode 100644 +--- /dev/null +++ b/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc -@@ -9,6 +9,7 @@ - #include "base/android/jni_string.h" - #include "chrome/browser/endpoint_fetcher/jni_headers/EndpointFetcher_jni.h" - #include "chrome/browser/endpoint_fetcher/jni_headers/EndpointResponse_jni.h" +@@ -0,0 +1,183 @@ ++// 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. ++ ++#include "components/endpoint_fetcher/endpoint_fetcher.h" ++ ++#include "base/android/callback_android.h" ++#include "base/android/jni_array.h" ++#include "base/android/jni_string.h" ++#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointFetcher_jni.h" ++#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointResponse_jni.h" +#include "chrome/browser/endpoint_fetcher/jni_headers/EndpointHeaderResponse_jni.h" - #include "chrome/browser/profiles/profile_android.h" - #include "chrome/browser/signin/identity_manager_factory.h" - #include "chrome/common/channel_info.h" -@@ -31,6 +32,24 @@ static void OnEndpointFetcherComplete( - base::android::AttachCurrentThread(), - std::move(endpoint_response->response)))); - } ++#include "chrome/browser/profiles/profile_android.h" ++#include "chrome/browser/signin/identity_manager_factory.h" ++#include "chrome/common/channel_info.h" ++#include "components/signin/public/base/consent_level.h" ++#include "components/version_info/channel.h" ++#include "content/public/browser/storage_partition.h" ++ ++namespace { ++static void OnEndpointFetcherComplete( ++ const base::android::JavaRef& jcaller, ++ // Passing the endpoint_fetcher ensures the endpoint_fetcher's ++ // lifetime extends to the callback and is not destroyed ++ // prematurely (which would result in cancellation of the request). ++ std::unique_ptr endpoint_fetcher, ++ std::unique_ptr endpoint_response) { ++ base::android::RunObjectCallbackAndroid( ++ jcaller, Java_EndpointResponse_createEndpointResponse( ++ base::android::AttachCurrentThread(), ++ base::android::ConvertUTF8ToJavaString( ++ base::android::AttachCurrentThread(), ++ std::move(endpoint_response->response)))); ++} + +static void OnEndpointFetcherHeadComplete( + const base::android::JavaRef& jcaller, @@ -1151,31 +1237,110 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc b/chrom + base::android::AttachCurrentThread(), + std::move(endpoint_response->redirect_url)))); +} - } // namespace - - // TODO(crbug.com/1077537) Create a KeyProvider so -@@ -113,6 +132,7 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth( - JNIEnv* env, - const base::android::JavaParamRef& jprofile, - const base::android::JavaParamRef& jurl, ++} // 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( ++ ProfileAndroid::FromProfileAndroid(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, ++ jtimeout, base::android::ConvertJavaStringToUTF8(env, jpost_data), ++ net::NetworkTrafficAnnotationTag::FromJavaAnnotation( ++ jannotation_hash_code), ++ IdentityManagerFactory::GetForProfile( ++ ProfileAndroid::FromProfileAndroid(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_NativeFetchChromeAPIKey( ++ JNIEnv* env, ++ const base::android::JavaParamRef& jprofile, ++ const base::android::JavaParamRef& jurl, ++ const base::android::JavaParamRef& jhttps_method, ++ const base::android::JavaParamRef& jcontent_type, ++ const base::android::JavaParamRef& jpost_data, ++ jlong jtimeout, ++ const base::android::JavaParamRef& jheaders, ++ jint jannotation_hash_code, ++ const base::android::JavaParamRef& jcallback) { ++ std::vector headers; ++ base::android::AppendJavaStringArrayToStringVector(env, jheaders, &headers); ++ auto endpoint_fetcher = std::make_unique( ++ ProfileAndroid::FromProfileAndroid(jprofile) ++ ->GetDefaultStoragePartition() ++ ->GetURLLoaderFactoryForBrowserProcess(), ++ GURL(base::android::ConvertJavaStringToUTF8(env, jurl)), ++ base::android::ConvertJavaStringToUTF8(env, jhttps_method), ++ base::android::ConvertJavaStringToUTF8(env, jcontent_type), jtimeout, ++ base::android::ConvertJavaStringToUTF8(env, jpost_data), headers, ++ net::NetworkTrafficAnnotationTag::FromJavaAnnotation( ++ jannotation_hash_code), ++ chrome::GetChannel() == version_info::Channel::STABLE); ++ auto* const endpoint_fetcher_ptr = endpoint_fetcher.get(); ++ endpoint_fetcher_ptr->PerformRequest( ++ 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)), ++ nullptr); ++} ++ ++static void JNI_EndpointFetcher_NativeFetchWithNoAuth( ++ JNIEnv* env, ++ const base::android::JavaParamRef& jprofile, ++ const base::android::JavaParamRef& jurl, + jlong jtimeout, jboolean intercept_redirect, - jint jannotation_hash_code, - const base::android::JavaParamRef& jcallback) { - auto endpoint_fetcher = std::make_unique( -@@ -120,6 +140,9 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth( - ->GetDefaultStoragePartition() - ->GetURLLoaderFactoryForBrowserProcess(), - GURL(base::android::ConvertJavaStringToUTF8(env, jurl)), ++ jint jannotation_hash_code, ++ const base::android::JavaParamRef& jcallback) { ++ auto endpoint_fetcher = std::make_unique( ++ ProfileAndroid::FromProfileAndroid(jprofile) ++ ->GetDefaultStoragePartition() ++ ->GetURLLoaderFactoryForBrowserProcess(), ++ GURL(base::android::ConvertJavaStringToUTF8(env, jurl)), + "GET", + jtimeout, + intercept_redirect, - net::NetworkTrafficAnnotationTag::FromJavaAnnotation( - jannotation_hash_code)); - auto* const endpoint_fetcher_ptr = endpoint_fetcher.get(); -@@ -131,3 +154,30 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth( - std::move(endpoint_fetcher)), - nullptr); - } ++ net::NetworkTrafficAnnotationTag::FromJavaAnnotation( ++ jannotation_hash_code)); ++ auto* const endpoint_fetcher_ptr = endpoint_fetcher.get(); ++ endpoint_fetcher_ptr->PerformRequest( ++ 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)), ++ nullptr); ++} + +static void JNI_EndpointFetcher_NativeHeadWithNoAuth( + JNIEnv* env, @@ -1204,12 +1369,116 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher_android.cc b/chrom + nullptr); +} diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java ---- a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java +new file mode 100644 +--- /dev/null +++ b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointFetcher.java -@@ -104,6 +104,24 @@ public final class EndpointFetcher { - callback); - } - +@@ -0,0 +1,165 @@ ++// 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. ++ ++package org.chromium.chrome.browser.endpoint_fetcher; ++ ++import androidx.annotation.MainThread; ++ ++import org.jni_zero.NativeMethods; ++ ++import org.chromium.base.Callback; ++import org.chromium.chrome.browser.profiles.Profile; ++import org.chromium.net.NetworkTrafficAnnotationTag; ++ ++/** ++ * EndpointFetcher uses native EndpointFetcher to call a HTTPS endpoint and return ++ * the response. The call to native EndpointFetcher is achieved over a static call ++ * over JNI. The native EndpointFetcher is created during the static call and ++ * destroyed in the callback function. ++ * EndpointFetcher currently doesn't support incognito mode. ++ * If the request times out an empty response will be returned. There will also ++ * be an error code indicating timeout once more detailed error messaging is added ++ * TODO(crbug.com/993393). ++ */ ++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); ++ } ++ ++ /** ++ * Calls an endpoint using Chrome API Key returns the response via a callback ++ * @param callback to pass the response back in ++ * @param profile via which the endpoint is called ++ * @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 postData data for a "POST" request ++ * @param timeout time after which the request will terminate in the event a response hasn't ++ * been received ++ * @param headers headers for the request. Key/value pairs are stored sequentially in the array. ++ */ ++ @MainThread ++ public static void fetchUsingChromeAPIKey( ++ Callback callback, ++ Profile profile, ++ String url, ++ String httpsMethod, ++ String contentType, ++ String postData, ++ long timeout, ++ String[] headers, ++ NetworkTrafficAnnotationTag annotation) { ++ // EndpointFetcher currently does not support incognito mode ++ // assert !profile.isOffTheRecord(); ++ EndpointFetcherJni.get() ++ .nativeFetchChromeAPIKey( ++ profile, ++ url, ++ httpsMethod, ++ contentType, ++ postData, ++ timeout, ++ headers, ++ annotation.getHashCode(), ++ callback); ++ } ++ + @MainThread + public static void nativeHeadWithNoAuth( + Callback callback, Profile profile, @@ -1228,17 +1497,38 @@ diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browse + profile, url, timeout, allow_redirect, annotation.getHashCode(), callback); + } + - @NativeMethods - public interface Natives { - void nativeFetchOAuth( -@@ -132,7 +150,16 @@ public final class EndpointFetcher { - void nativeFetchWithNoAuth( - Profile profile, - String url, ++ @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 nativeFetchChromeAPIKey( ++ Profile profile, ++ String url, ++ String httpsMethod, ++ String contentType, ++ String postData, ++ long timeout, ++ String[] headers, ++ int annotationHashCode, ++ Callback callback); ++ ++ void nativeFetchWithNoAuth( ++ Profile profile, ++ String url, + long timeout, + boolean allow_redirect, - int annotationHashCode, - Callback callback); ++ int annotationHashCode, ++ Callback callback); + void nativeHeadWithNoAuth( + Profile profile, + String url, @@ -1246,8 +1536,8 @@ diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browse + boolean allow_redirect, + int annotationHashCode, + Callback callback); - } - } ++ } ++} diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java new file mode 100644 --- /dev/null @@ -1284,32 +1574,67 @@ new file mode 100644 + return new EndpointHeaderResponse(response, redirectUrl); + } +} +diff --git a/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointResponse.java +@@ -0,0 +1,30 @@ ++// 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. ++ ++package org.chromium.chrome.browser.endpoint_fetcher; ++ ++import org.jni_zero.CalledByNative; ++ ++/** Encapsulates the response from the {@Link EndpointFetcher} */ ++public class EndpointResponse { ++ private final String mResponseString; ++ ++ /** ++ * Create the EndpointResponse ++ * @param responseString the response string acquired from the endpoint ++ */ ++ public EndpointResponse(String responseString) { ++ mResponseString = responseString; ++ } ++ ++ /** Response string acquired from calling an endpoint */ ++ public String getResponseString() { ++ return mResponseString; ++ } ++ ++ @CalledByNative ++ private static EndpointResponse createEndpointResponse(String response) { ++ return new EndpointResponse(response); ++ } ++} 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 -@@ -264,6 +264,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { +@@ -234,6 +234,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { &kPreconnectOnTabCreation, &kPriceChangeModule, &kPwaRestoreUi, + &kInlineUpdateFlow, - &kBookmarksImprovedSaveFlow, - &kBookmarksRefresh, + &kPwaUniversalInstallUi, &kOmahaMinSdkVersionAndroid, + &kShortCircuitUnfocusAnimation, 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 -@@ -303,6 +303,7 @@ public abstract class ChromeFeatureList { +@@ -313,6 +313,7 @@ public abstract class ChromeFeatureList { "IncognitoReauthenticationForAndroid"; public static final String INCOGNITO_SCREENSHOT = "IncognitoScreenshot"; - public static final String INFOBAR_SCROLL_OPTIMIZATION = "InfobarScrollOptimization"; -+ public static final String INLINE_UPDATE_FLOW = "InlineUpdateFlow"; - public static final String INSTALLABLE_AMBIENT_BADGE_MESSAGE = "InstallableAmbientBadgeMessage"; - public static final String INSTANCE_SWITCHER = "InstanceSwitcher"; public static final String INSTANT_START = "InstantStart"; ++ public static final String INLINE_UPDATE_FLOW = "InlineUpdateFlow"; + public static final String INTEREST_FEED_V2_HEARTS = "InterestFeedV2Hearts"; + public static final String KID_FRIENDLY_CONTENT_FEED = "KidFriendlyContentFeed"; + public static final String LENS_CAMERA_ASSISTED_SEARCH = "LensCameraAssistedSearch"; 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 -@@ -2012,6 +2012,12 @@ Your Google account may have other forms of browsing history like searches and a +@@ -2038,6 +2038,12 @@ Your Google account may have other forms of browsing history like searches and a Chrome updates are no longer supported for this version of Android @@ -1322,7 +1647,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro -@@ -3640,7 +3646,10 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

@@ -1334,7 +1659,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Newer version is available -@@ -3651,6 +3660,18 @@ To change this setting, <resetlink>reset sync

<resetlink>reset sync

Android version is unsupported diff --git a/build/patches/Bromite-subresource-adblocker.patch b/build/patches/Bromite-subresource-adblocker.patch index 855fd7a44..a3a6ffa89 100644 --- a/build/patches/Bromite-subresource-adblocker.patch +++ b/build/patches/Bromite-subresource-adblocker.patch @@ -29,7 +29,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/browser_process_impl.cc | 21 ++ chrome/browser/browser_process_impl.h | 2 + chrome/browser/chrome_browser_main.cc | 3 + - chrome/browser/flags/BUILD.gn | 3 + + chrome/browser/flags/BUILD.gn | 4 + .../flags/android/adblock_native_gateway.cc | 31 ++ .../browser/flags/AdBlockNativeGateway.java | 30 ++ .../net/system_network_context_manager.cc | 8 + @@ -48,7 +48,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../content/browser/ruleset_service.h | 7 +- .../content/browser/ruleset_version.h | 4 + .../unindexed_ruleset_stream_generator.cc | 3 + - .../browser/verified_ruleset_dealer.cc | 4 + + .../browser/verified_ruleset_dealer.cc | 3 + .../browser/subresource_filter_features.cc | 116 +------- .../core/common/indexed_ruleset.cc | 5 +- .../Bromite-subresource-adblocker.inc | 3 + @@ -68,8 +68,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -304,6 +304,7 @@ if (current_toolchain == default_toolchain) { - "//chrome/android/modules/image_editor/provider:java", +@@ -302,6 +302,7 @@ if (current_toolchain == default_toolchain) { + "//chrome/android/modules/cablev2_authenticator/public:java", "//chrome/android/modules/stack_unwinder/provider:java", "//chrome/android/webapk/libs/client:client_java", + "//chrome/browser/endpoint_fetcher:java", @@ -79,7 +79,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni --- a/chrome/android/chrome_java_resources.gni +++ b/chrome/android/chrome_java_resources.gni -@@ -434,6 +434,7 @@ chrome_java_resources = [ +@@ -429,6 +429,7 @@ chrome_java_resources = [ "java/res/layout/account_chooser_dialog_title.xml", "java/res/layout/account_divider_preference.xml", "java/res/layout/account_management_account_row.xml", @@ -87,7 +87,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja "java/res/layout/auto_sign_in_first_run_dialog.xml", "java/res/layout/autofill_billing_address_dropdown.xml", "java/res/layout/autofill_card_name_and_number.xml", -@@ -638,6 +639,7 @@ chrome_java_resources = [ +@@ -631,6 +632,7 @@ chrome_java_resources = [ "java/res/xml/about_chrome_preferences.xml", "java/res/xml/account_management_preferences.xml", "java/res/xml/ad_services_config.xml", @@ -98,7 +98,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -961,6 +961,8 @@ chrome_java_sources = [ +@@ -964,6 +964,8 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java", "java/src/org/chromium/chrome/browser/permissions/PermissionUpdateRequester.java", "java/src/org/chromium/chrome/browser/photo_picker/DecoderServiceImpl.java", @@ -254,9 +254,9 @@ new file mode 100644 diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml -@@ -72,6 +72,11 @@ found in the LICENSE file. +@@ -78,6 +78,11 @@ found in the LICENSE file. android:key="safety_check" - android:order="12" + android:order="13" android:title="@string/prefs_safety_check"/> + @@ -511,7 +511,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc -@@ -1138,6 +1138,27 @@ BrowserProcessImpl::component_updater() { +@@ -1147,6 +1147,27 @@ BrowserProcessImpl::component_updater() { return component_updater_.get(); } @@ -542,7 +542,7 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -210,6 +210,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -209,6 +209,7 @@ class BrowserProcessImpl : public BrowserProcess, #endif component_updater::ComponentUpdateService* component_updater() override; @@ -550,7 +550,7 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc MediaFileSystemRegistry* media_file_system_registry() override; WebRtcLogUploader* webrtc_log_uploader() override; network_time::NetworkTimeTracker* network_time_tracker() override; -@@ -406,6 +407,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -405,6 +406,7 @@ class BrowserProcessImpl : public BrowserProcess, // to concerns over integrity of data shared between profiles, // but some users of component updater only install per-user. std::unique_ptr component_updater_; @@ -561,7 +561,7 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc -@@ -448,6 +448,9 @@ StartupProfileInfo CreateInitialProfile( +@@ -445,6 +445,9 @@ StartupProfileInfo CreateInitialProfile( // missing code in the above test. CHECK(profile_info.profile) << "Cannot get default profile."; @@ -574,15 +574,15 @@ diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_brows diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn --- a/chrome/browser/flags/BUILD.gn +++ b/chrome/browser/flags/BUILD.gn -@@ -23,6 +23,7 @@ android_library("java") { - "android/java/src/org/chromium/chrome/browser/flags/StringCachedFieldTrialParameter.java", - "android/java/src/org/chromium/chrome/browser/flags/ValuesOverridden.java", - "android/java/src/org/chromium/chrome/browser/flags/ValuesReturned.java", +@@ -8,6 +8,7 @@ import("//third_party/jni_zero/jni_zero.gni") + android_library("java") { + sources = [ "android/java/src/org/chromium/chrome/browser/flags/CromiteNativeUtils.java" ] + sources += [ + "android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java", - ] - deps = [ - "//base:base_java", -@@ -44,6 +45,7 @@ android_library("java") { + "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java", + "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureMap.java", + "android/java/src/org/chromium/chrome/browser/flags/ChromeSessionState.java", +@@ -33,6 +34,7 @@ android_library("java") { generate_jni("jni_headers") { sources = [ "android/java/src/org/chromium/chrome/browser/flags/CromiteNativeUtils.java" ] sources += [ @@ -590,7 +590,7 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureMap.java", "android/java/src/org/chromium/chrome/browser/flags/ChromeSessionState.java", ] -@@ -58,6 +60,7 @@ static_library("flags_android") { +@@ -47,6 +49,7 @@ static_library("flags_android") { "android/chrome_session_state.cc", "android/chrome_session_state.h", ] @@ -598,6 +598,14 @@ diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn deps = [ ":jni_headers", "//base", +@@ -71,6 +74,7 @@ robolectric_library("flags_junit_tests") { + "android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlagsAnnotationUnitTest.java", + "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureListWithProcessorUnitTest.java", + "android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureListWithoutProcessorUnitTest.java", ++ "android/java/src/org/chromium/chrome/browser/flags/AdBlockNativeGateway.java", + ] + deps = [ + ":java", diff --git a/chrome/browser/flags/android/adblock_native_gateway.cc b/chrome/browser/flags/android/adblock_native_gateway.cc new file mode 100755 --- /dev/null @@ -672,7 +680,7 @@ new file mode 100755 diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc -@@ -602,6 +602,14 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { +@@ -638,6 +638,14 @@ SystemNetworkContextManager::~SystemNetworkContextManager() { void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) { StubResolverConfigReader::RegisterPrefs(registry); @@ -730,7 +738,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h -@@ -2659,6 +2659,11 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; +@@ -2657,6 +2657,11 @@ inline constexpr char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled"; inline constexpr char kAudioCaptureAllowedUrls[] = "hardware.audio_capture_allowed_urls"; @@ -745,7 +753,7 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp --- a/components/browser_ui/strings/android/site_settings.grdp +++ b/components/browser_ui/strings/android/site_settings.grdp -@@ -371,6 +371,9 @@ +@@ -362,6 +362,9 @@ This site shows intrusive or misleading ads @@ -771,12 +779,12 @@ diff --git a/components/component_updater/BUILD.gn b/components/component_update "component_updater_service.cc", "component_updater_service.h", "component_updater_service_internal.h", -@@ -47,6 +53,7 @@ static_library("component_updater") { - "//components/prefs", +@@ -48,6 +54,7 @@ static_library("component_updater") { "//components/update_client", "//components/version_info", + "//net", + "//services/network/public/mojom", - "//third_party/boringssl:boringssl", + "//third_party/boringssl", "//ui/base", "//url", diff --git a/components/component_updater/adblock_updater_service.cc b/components/component_updater/adblock_updater_service.cc @@ -1554,8 +1562,8 @@ new file mode 100644 diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc --- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc -@@ -15,6 +15,9 @@ - #include "base/trace_event/trace_conversion_helper.h" +@@ -14,6 +14,9 @@ + #include "base/metrics/histogram_macros.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/traced_value.h" +#include "components/content_settings/core/common/content_settings_types.h" @@ -1564,7 +1572,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f #include "components/subresource_filter/content/browser/activation_state_computing_navigation_throttle.h" #include "components/subresource_filter/content/browser/async_document_subresource_filter.h" #include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h" -@@ -149,6 +152,7 @@ ContentSubresourceFilterThrottleManager:: +@@ -148,6 +151,7 @@ ContentSubresourceFilterThrottleManager:: profile_interaction_manager_( std::make_unique( profile_context)), @@ -1572,7 +1580,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f web_contents_helper_(web_contents_helper) {} ContentSubresourceFilterThrottleManager:: -@@ -668,6 +672,17 @@ ContentSubresourceFilterThrottleManager:: +@@ -667,6 +671,17 @@ ContentSubresourceFilterThrottleManager:: throttle->NotifyPageActivationWithRuleset(EnsureRulesetHandle(), ad_tagging_state); } @@ -1708,8 +1716,8 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.cc b/ IndexAndWriteRulesetResult::FAILED_PARSING_UNINDEXED_RULESET); return IndexedRulesetVersion(); @@ -328,8 +346,12 @@ IndexedRulesetVersion RulesetService::IndexAndWriteRuleset( - indexed_ruleset_version_dir, unindexed_ruleset_info.license_path, - indexer.data(), indexer.size()); + WriteRuleset(indexed_ruleset_version_dir, + unindexed_ruleset_info.license_path, indexer.data()); RecordIndexAndWriteRulesetResult(result); - if (result != IndexAndWriteRulesetResult::SUCCESS) + if (result != IndexAndWriteRulesetResult::SUCCESS) { @@ -1736,11 +1744,11 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.cc b/ - publisher_->TryOpenAndSetRulesetFile( file_path, version.checksum, - base::BindOnce(&RulesetService::OnRulesetSet, AsWeakPtr())); + base::BindOnce(&RulesetService::OnRulesetSet, diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/components/subresource_filter/content/browser/ruleset_service.h --- a/components/subresource_filter/content/browser/ruleset_service.h +++ b/components/subresource_filter/content/browser/ruleset_service.h -@@ -182,7 +182,7 @@ class RulesetService : public base::SupportsWeakPtr { +@@ -182,7 +182,7 @@ class RulesetService { // // Virtual so that it can be mocked out in tests. virtual void IndexAndStoreAndPublishRulesetIfNeeded( @@ -1749,7 +1757,7 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/c // Get the ruleset version associated with the current local_state_. IndexedRulesetVersion GetMostRecentlyIndexedVersion() const; -@@ -215,6 +215,11 @@ class RulesetService : public base::SupportsWeakPtr { +@@ -215,6 +215,11 @@ class RulesetService { const base::FilePath& indexed_ruleset_base_dir, const UnindexedRulesetInfo& unindexed_ruleset_info); @@ -1798,15 +1806,7 @@ diff --git a/components/subresource_filter/content/browser/unindexed_ruleset_str diff --git a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc --- a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc +++ b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc -@@ -11,6 +11,7 @@ - #include "base/functional/bind.h" - #include "base/functional/callback_helpers.h" - #include "base/location.h" -+#include "base/logging.h" - #include "base/metrics/histogram_macros.h" - #include "base/notreached.h" - #include "base/task/sequenced_task_runner.h" -@@ -39,6 +40,9 @@ RulesetFilePtr VerifiedRulesetDealer::OpenAndSetRulesetFile( +@@ -38,6 +38,9 @@ RulesetFilePtr VerifiedRulesetDealer::OpenAndSetRulesetFile( TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("loading"), "VerifiedRulesetDealer::OpenAndSetRulesetFile", "file_valid", file->IsValid()); @@ -1819,8 +1819,8 @@ diff --git a/components/subresource_filter/content/browser/verified_ruleset_deal diff --git a/components/subresource_filter/core/browser/subresource_filter_features.cc b/components/subresource_filter/core/browser/subresource_filter_features.cc --- a/components/subresource_filter/core/browser/subresource_filter_features.cc +++ b/components/subresource_filter/core/browser/subresource_filter_features.cc -@@ -54,72 +54,7 @@ class CommaSeparatedStrings { - const std::vector pieces_; +@@ -55,72 +55,7 @@ class CommaSeparatedStrings { + const std::vector pieces_; }; -std::string TakeVariationParamOrReturnEmpty( @@ -1835,7 +1835,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu -} - -mojom::ActivationLevel ParseActivationLevel( -- const base::StringPiece activation_level) { +- const std::string_view activation_level) { - if (base::EqualsCaseInsensitiveASCII(activation_level, - kActivationLevelEnabled)) - return mojom::ActivationLevel::kEnabled; @@ -1845,7 +1845,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu - return mojom::ActivationLevel::kDisabled; -} - --ActivationScope ParseActivationScope(const base::StringPiece activation_scope) { +-ActivationScope ParseActivationScope(const std::string_view activation_scope) { - if (base::EqualsCaseInsensitiveASCII(activation_scope, - kActivationScopeAllSites)) - return ActivationScope::ALL_SITES; @@ -1881,7 +1881,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu - return value < 1 ? value : 1; -} - --int ParseInt(const base::StringPiece value) { +-int ParseInt(const std::string_view value) { - int result = 0; - base::StringToInt(value, &result); - return result; @@ -1893,7 +1893,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu // If ad tagging is enabled, turn on the dryrun automatically. bool ad_tagging_enabled = base::FeatureList::IsEnabled(kAdTagging); const struct { -@@ -127,23 +62,16 @@ std::vector FillEnabledPresetConfigurations( +@@ -128,23 +63,16 @@ std::vector FillEnabledPresetConfigurations( bool enabled_by_default; Configuration (*factory_method)(); } kAvailablePresetConfigurations[] = { @@ -1919,7 +1919,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu enabled_configurations.push_back(available_preset.factory_method()); } } -@@ -151,46 +79,10 @@ std::vector FillEnabledPresetConfigurations( +@@ -152,46 +80,10 @@ std::vector FillEnabledPresetConfigurations( return enabled_configurations; } @@ -1978,15 +1978,14 @@ diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/comp #include "base/metrics/histogram_macros.h" #include "base/trace_event/trace_event.h" #include "components/subresource_filter/core/common/first_party_origin.h" -@@ -37,8 +38,10 @@ VerifyStatus GetVerifyStatus(const uint8_t* buffer, +@@ -36,7 +37,9 @@ VerifyStatus GetVerifyStatus(base::span buffer, // least once. The verifier detects a subset of the errors detected by the // checksum, and is unneeded once expected_checksum is consistently nonzero. - flatbuffers::Verifier verifier(buffer, size); -+ int local_checksum = LocalGetChecksum(buffer, size); + flatbuffers::Verifier verifier(buffer.data(), buffer.size()); +- if (expected_checksum != 0 && expected_checksum != LocalGetChecksum(buffer)) { ++ int local_checksum = LocalGetChecksum(buffer); + LOG(INFO) << "GetVerifyStatus: expected checksum = 0x" << std::hex << expected_checksum << ", local checksum = 0x" << std::hex << local_checksum; - if (expected_checksum != 0 && -- expected_checksum != LocalGetChecksum(buffer, size)) { -+ expected_checksum != local_checksum) { ++ if (expected_checksum != 0 && expected_checksum != local_checksum) { return flat::VerifyIndexedRulesetBuffer(verifier) ? VerifyStatus::kChecksumFailVerifierPass : VerifyStatus::kChecksumFailVerifierFail; diff --git a/build/patches/Change-popup-site-setting.patch b/build/patches/Change-popup-site-setting.patch index 99ae352f7..94f9f30ae 100644 --- a/build/patches/Change-popup-site-setting.patch +++ b/build/patches/Change-popup-site-setting.patch @@ -250,7 +250,7 @@ new file mode 100644 diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -126,7 +126,7 @@ void ContentSettingsRegistry::Init() { +@@ -131,7 +131,7 @@ void ContentSettingsRegistry::Init() { WebsiteSettingsInfo::SYNCABLE, /*allowlisted_primary_schemes=*/ {kChromeUIScheme, kChromeDevToolsScheme, kExtensionScheme}, diff --git a/build/patches/Chrome-web-store-protection.patch b/build/patches/Chrome-web-store-protection.patch index 9a9e15ddd..7b0077da7 100644 --- a/build/patches/Chrome-web-store-protection.patch +++ b/build/patches/Chrome-web-store-protection.patch @@ -16,7 +16,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/app/extensions_strings.grdp | 6 +++ .../developer_private_api.cc | 37 ++++++++++++- .../developer_private/developer_private_api.h | 3 ++ - .../webstore_private/webstore_private_api.cc | 12 ++++- + .../webstore_private/webstore_private_api.cc | 15 +++++- .../extensions/extension_system_impl.cc | 2 + .../chrome_extension_downloader_factory.cc | 1 - .../extensions/updater/extension_updater.cc | 40 ++++++++------ @@ -42,7 +42,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html extensions/common/extension_features.cc | 15 ++++++ extensions/common/extension_features.h | 4 ++ .../definitions/developer_private.d.ts | 4 +- - 29 files changed, 249 insertions(+), 92 deletions(-) + 29 files changed, 251 insertions(+), 93 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Webstore-protection.inc diff --git a/chrome/app/extensions_strings.grdp b/chrome/app/extensions_strings.grdp @@ -64,7 +64,7 @@ diff --git a/chrome/app/extensions_strings.grdp b/chrome/app/extensions_strings. diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc -@@ -125,6 +125,12 @@ +@@ -126,6 +126,12 @@ #include "url/gurl.h" #include "url/origin.h" @@ -77,7 +77,7 @@ diff --git a/chrome/browser/extensions/api/developer_private/developer_private_a #if BUILDFLAG(ENABLE_SUPERVISED_USERS) #include "components/supervised_user/core/browser/supervised_user_preferences.h" #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) -@@ -520,9 +526,32 @@ std::unique_ptr DeveloperPrivateAPI::CreateProfileInfo( +@@ -521,9 +527,32 @@ std::unique_ptr DeveloperPrivateAPI::CreateProfileInfo( info->can_load_unpacked = ExtensionManagementFactory::GetForBrowserContext(profile) ->HasAllowlistedExtension(); @@ -110,7 +110,7 @@ diff --git a/chrome/browser/extensions/api/developer_private/developer_private_a template <> void BrowserContextKeyedAPIFactory< DeveloperPrivateAPI>::DeclareFactoryDependencies() { -@@ -951,6 +980,7 @@ ExtensionFunction::ResponseAction DeveloperPrivateAutoUpdateFunction::Run() { +@@ -952,6 +981,7 @@ ExtensionFunction::ResponseAction DeveloperPrivateAutoUpdateFunction::Run() { ExtensionUpdater::CheckParams params; params.fetch_priority = DownloadFetchPriority::kForeground; params.install_immediately = true; @@ -118,7 +118,7 @@ diff --git a/chrome/browser/extensions/api/developer_private/developer_private_a params.callback = base::BindOnce(&DeveloperPrivateAutoUpdateFunction::OnComplete, this); updater->CheckNow(std::move(params)); -@@ -1090,7 +1120,7 @@ DeveloperPrivateUpdateProfileConfigurationFunction::Run() { +@@ -1092,7 +1122,7 @@ DeveloperPrivateUpdateProfileConfigurationFunction::Run() { const developer::ProfileConfigurationUpdate& update = params->update; @@ -127,7 +127,7 @@ diff --git a/chrome/browser/extensions/api/developer_private/developer_private_a Profile* profile = Profile::FromBrowserContext(browser_context()); CHECK(profile); #if BUILDFLAG(ENABLE_SUPERVISED_USERS) -@@ -1102,6 +1132,11 @@ DeveloperPrivateUpdateProfileConfigurationFunction::Run() { +@@ -1104,6 +1134,11 @@ DeveloperPrivateUpdateProfileConfigurationFunction::Run() { util::SetDeveloperModeForProfile(profile, *update.in_developer_mode); } @@ -199,15 +199,22 @@ diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api } WebstorePrivateIsPendingCustodianApprovalFunction:: -@@ -1263,6 +1271,8 @@ WebstorePrivateGetReferrerChainFunction::Run() { +@@ -1262,11 +1270,14 @@ WebstorePrivateGetReferrerChainFunction::Run() { + request.mutable_referrer_chain_options()->set_recent_navigations_to_collect( recent_navigations_to_collect); - std::string serialized_referrer_proto = request.SerializeAsString(); ++ std::string serialized_referrer_proto = request.SerializeAsString(); + if (!base::FeatureList::IsEnabled(extensions_features::kEnableExtensionManagementToChromeStore)) + serialized_referrer_proto = ""; - // Base64 encode the proto to avoid issues with base::Value rejecting strings - // which are not valid UTF8. - base::Base64Encode(serialized_referrer_proto, &serialized_referrer_proto); + // Base64 encode the request to avoid issues with base::Value rejecting + // strings which are not valid UTF8. + return RespondNow( + ArgumentList(api::webstore_private::GetReferrerChain::Results::Create( +- base::Base64Encode(request.SerializeAsString())))); ++ base::Base64Encode(serialized_referrer_proto)))); + } + + WebstorePrivateGetExtensionStatusFunction:: diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc --- a/chrome/browser/extensions/extension_system_impl.cc +++ b/chrome/browser/extensions/extension_system_impl.cc @@ -445,7 +452,7 @@ diff --git a/chrome/browser/resources/extensions/manager.html b/chrome/browser/r diff --git a/chrome/browser/resources/extensions/manager.ts b/chrome/browser/resources/extensions/manager.ts --- a/chrome/browser/resources/extensions/manager.ts +++ b/chrome/browser/resources/extensions/manager.ts -@@ -121,6 +121,11 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { +@@ -122,6 +122,11 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { value: () => loadTimeData.getBoolean('inDevMode'), }, @@ -457,7 +464,7 @@ diff --git a/chrome/browser/resources/extensions/manager.ts b/chrome/browser/res showActivityLog: { type: Boolean, value: () => loadTimeData.getBoolean('showActivityLog'), -@@ -222,6 +227,7 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { +@@ -223,6 +228,7 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { canLoadUnpacked: boolean; delegate: Service; inDevMode: boolean; @@ -465,7 +472,7 @@ diff --git a/chrome/browser/resources/extensions/manager.ts b/chrome/browser/res showActivityLog: boolean; enableEnhancedSiteControls: boolean; devModeControlledByPolicy: boolean; -@@ -292,6 +298,7 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { +@@ -293,6 +299,7 @@ export class ExtensionsManagerElement extends ExtensionsManagerElementBase { profileInfo.isDeveloperModeControlledByPolicy; this.inDevMode = profileInfo.inDeveloperMode; this.canLoadUnpacked = profileInfo.canLoadUnpacked; @@ -503,7 +510,7 @@ diff --git a/chrome/browser/resources/extensions/toolbar.html b/chrome/browser/r cr-toolbar { --cr-toolbar-center-basis: 680px; --cr-toolbar-field-max-width: var(--cr-toolbar-center-basis); -@@ -87,6 +92,13 @@ +@@ -88,6 +93,13 @@ checked="[[inDevMode]]" aria-labelledby="devModeLabel"> @@ -729,7 +736,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_urls.h" #include "extensions/common/manifest.h" -@@ -88,6 +92,27 @@ std::vector CreateWarningsList(const Extension* extension) { +@@ -89,6 +93,27 @@ std::vector CreateWarningsList(const Extension* extension) { return warnings_list; } @@ -757,7 +764,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br std::vector GetAvailableLaunchTypes( const Extension& extension, const ManagementAPIDelegate* delegate) { -@@ -261,6 +286,8 @@ void AddExtensionInfo(const Extension* source_extension, +@@ -262,6 +287,8 @@ void AddExtensionInfo(const Extension* source_extension, const ExtensionSet& extensions, ExtensionInfoList* extension_list, content::BrowserContext* context) { @@ -766,7 +773,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br for (ExtensionSet::const_iterator iter = extensions.begin(); iter != extensions.end(); ++iter) { const Extension& extension = **iter; -@@ -306,10 +333,9 @@ ExtensionFunction::ResponseAction ManagementGetFunction::Run() { +@@ -307,10 +334,9 @@ ExtensionFunction::ResponseAction ManagementGetFunction::Run() { std::optional params = management::Get::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -778,7 +785,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br if (!target_extension) return RespondNow(Error(keys::kNoExtensionError, params->id)); -@@ -329,8 +355,7 @@ ManagementGetPermissionWarningsByIdFunction::Run() { +@@ -330,8 +356,7 @@ ManagementGetPermissionWarningsByIdFunction::Run() { EXTENSION_FUNCTION_VALIDATE(params); const Extension* extension = @@ -788,7 +795,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br if (!extension) return RespondNow(Error(keys::kNoExtensionError, params->id)); -@@ -396,8 +421,7 @@ ExtensionFunction::ResponseAction ManagementLaunchAppFunction::Run() { +@@ -397,8 +422,7 @@ ExtensionFunction::ResponseAction ManagementLaunchAppFunction::Run() { return RespondNow(Error(keys::kNotAllowedInKioskError)); const Extension* extension = @@ -798,7 +805,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br if (!extension) return RespondNow(Error(keys::kNoExtensionError, params->id)); if (!extension->is_app()) -@@ -432,7 +456,7 @@ ExtensionFunction::ResponseAction ManagementSetEnabledFunction::Run() { +@@ -433,7 +457,7 @@ ExtensionFunction::ResponseAction ManagementSetEnabledFunction::Run() { ->GetDelegate(); const Extension* target_extension = @@ -807,7 +814,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br if (!target_extension || !ShouldExposeViaManagementAPI(*target_extension)) { return RespondNow(Error(keys::kNoExtensionError, extension_id_)); } -@@ -627,8 +651,7 @@ ExtensionFunction::ResponseAction ManagementUninstallFunctionBase::Uninstall( +@@ -628,8 +652,7 @@ ExtensionFunction::ResponseAction ManagementUninstallFunctionBase::Uninstall( ->GetDelegate(); target_extension_id_ = target_extension_id; const Extension* target_extension = @@ -817,7 +824,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br ExtensionRegistry::EVERYTHING); if (!target_extension || !ShouldExposeViaManagementAPI(*target_extension)) { return RespondNow(Error(keys::kNoExtensionError, target_extension_id_)); -@@ -692,8 +715,7 @@ void ManagementUninstallFunctionBase::UninstallExtension() { +@@ -693,8 +716,7 @@ void ManagementUninstallFunctionBase::UninstallExtension() { // The extension can be uninstalled in another window while the UI was // showing. Do nothing in that case. const Extension* target_extension = @@ -827,7 +834,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br ExtensionRegistry::EVERYTHING); std::string error; bool success = false; -@@ -774,8 +796,7 @@ ExtensionFunction::ResponseAction ManagementCreateAppShortcutFunction::Run() { +@@ -775,8 +797,7 @@ ExtensionFunction::ResponseAction ManagementCreateAppShortcutFunction::Run() { management::CreateAppShortcut::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); const Extension* extension = @@ -837,7 +844,7 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br if (!extension) { return RespondNow(Error( ErrorUtils::FormatErrorMessage(keys::kNoExtensionError, params->id))); -@@ -825,8 +846,7 @@ ExtensionFunction::ResponseAction ManagementSetLaunchTypeFunction::Run() { +@@ -826,8 +847,7 @@ ExtensionFunction::ResponseAction ManagementSetLaunchTypeFunction::Run() { management::SetLaunchType::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); const Extension* extension = @@ -850,9 +857,9 @@ diff --git a/extensions/browser/api/management/management_api.cc b/extensions/br diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc --- a/extensions/browser/updater/extension_downloader.cc +++ b/extensions/browser/updater/extension_downloader.cc -@@ -491,8 +491,8 @@ void ExtensionDownloader::CreateManifestLoader() { - std::vector id_vector(extension_ids.begin(), - extension_ids.end()); +@@ -493,8 +493,8 @@ void ExtensionDownloader::CreateManifestLoader() { + std::vector id_vector(extension_ids.begin(), + extension_ids.end()); std::string id_list = base::JoinString(id_vector, ","); - VLOG(2) << "Fetching " << active_request->full_url() << " for " << id_list; - VLOG(2) << "Update interactivity: " @@ -861,7 +868,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro << (active_request->foreground_check() ? kUpdateInteractivityForeground : kUpdateInteractivityBackground); -@@ -517,7 +517,7 @@ void ExtensionDownloader::CreateManifestLoader() { +@@ -519,7 +519,7 @@ void ExtensionDownloader::CreateManifestLoader() { destination: WEBSITE } policy { @@ -870,7 +877,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro cookies_store: "user" setting: "This feature cannot be disabled. It is only enabled when the user " -@@ -534,6 +534,7 @@ void ExtensionDownloader::CreateManifestLoader() { +@@ -536,6 +536,7 @@ void ExtensionDownloader::CreateManifestLoader() { auto resource_request = std::make_unique(); resource_request->url = active_request->full_url(), resource_request->load_flags = net::LOAD_DISABLE_CACHE; @@ -878,7 +885,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro if (active_request->fetch_priority() == DownloadFetchPriority::kForeground) { resource_request->priority = net::MEDIUM; -@@ -542,10 +543,6 @@ void ExtensionDownloader::CreateManifestLoader() { +@@ -544,10 +545,6 @@ void ExtensionDownloader::CreateManifestLoader() { // Send traffic-management headers to the webstore, and omit credentials. // https://bugs.chromium.org/p/chromium/issues/detail?id=647516 if (extension_urls::IsWebstoreUpdateUrl(active_request->full_url())) { @@ -889,7 +896,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro resource_request->headers.SetHeader(kUpdateAppIdHeader, id_list); resource_request->headers.SetHeader( kUpdateUpdaterHeader, -@@ -830,20 +827,6 @@ void ExtensionDownloader::HandleManifestResults( +@@ -832,20 +829,6 @@ void ExtensionDownloader::HandleManifestResults( update.second->info); } @@ -910,7 +917,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro ExtensionIdSet extension_ids_with_errors; for (const auto& failure : failures) extension_ids_with_errors.insert(failure.first.id); -@@ -865,7 +848,7 @@ ExtensionDownloader::GetUpdateAvailability( +@@ -867,7 +850,7 @@ ExtensionDownloader::GetUpdateAvailability( // extensions that have already existed in the system. if (!delegate_->GetExtensionExistingVersion(extension_id, &extension_version)) { @@ -919,7 +926,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro return UpdateAvailability::kBadUpdateSpecification; } VLOG(2) << extension_id << " is at '" << extension_version << "'"; -@@ -876,11 +859,11 @@ ExtensionDownloader::GetUpdateAvailability( +@@ -878,11 +861,11 @@ ExtensionDownloader::GetUpdateAvailability( const std::string& update_version_str = update->version; if (VLOG_IS_ON(2)) { if (update_version_str.empty()) @@ -933,7 +940,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro << " latest version is '" << update_version_str << "'"; } -@@ -890,21 +873,21 @@ ExtensionDownloader::GetUpdateAvailability( +@@ -892,21 +875,21 @@ ExtensionDownloader::GetUpdateAvailability( // we don't want it. if (update_version_str.empty()) { // If update manifest doesn't have version number => no update. @@ -956,9 +963,9 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro - VLOG(2) << extension_id << " version is not older than '" + LOG(INFO) << extension_id << " version is not older than '" << update_version_str << "'"; - has_noupdate = true; - continue; -@@ -925,7 +908,9 @@ ExtensionDownloader::GetUpdateAvailability( + bool can_rollback = + update_version.CompareTo(existing_version) < 0 && +@@ -933,7 +916,9 @@ ExtensionDownloader::GetUpdateAvailability( } // Stop checking as soon as an update for |extension_id| is found. @@ -969,7 +976,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro *update_result_out = const_cast(update); return UpdateAvailability::kAvailable; } -@@ -1170,7 +1155,7 @@ void ExtensionDownloader::CreateExtensionLoader() { +@@ -1178,7 +1163,7 @@ void ExtensionDownloader::CreateExtensionLoader() { int load_flags = net::LOAD_DISABLE_CACHE; bool is_secure = fetch->url.SchemeIsCryptographic(); extension_loader_resource_request_->load_flags = load_flags; @@ -978,7 +985,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro extension_loader_resource_request_->credentials_mode = network::mojom::CredentialsMode::kOmit; } else { -@@ -1178,7 +1163,7 @@ void ExtensionDownloader::CreateExtensionLoader() { +@@ -1186,7 +1171,7 @@ void ExtensionDownloader::CreateExtensionLoader() { net::SiteForCookies::FromUrl(fetch->url); } @@ -987,7 +994,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro is_secure) { if (access_token_.empty()) { // We should try OAuth2, but we have no token cached. This -@@ -1203,7 +1188,7 @@ void ExtensionDownloader::CreateExtensionLoader() { +@@ -1211,7 +1196,7 @@ void ExtensionDownloader::CreateExtensionLoader() { base::StringPrintf("Bearer %s", access_token_.c_str())); } @@ -996,7 +1003,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro StartExtensionLoader(); } -@@ -1225,7 +1210,7 @@ void ExtensionDownloader::StartExtensionLoader() { +@@ -1233,7 +1218,7 @@ void ExtensionDownloader::StartExtensionLoader() { destination: WEBSITE } policy { @@ -1005,7 +1012,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro cookies_store: "user" setting: "This feature cannot be disabled. It is only enabled when the user " -@@ -1296,6 +1281,7 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) { +@@ -1304,6 +1289,7 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) { RETRY_HISTOGRAM("CrxFetchSuccess", extensions_queue_.active_request_failure_count(), url); @@ -1013,7 +1020,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro std::unique_ptr fetch_data = std::move(extensions_queue_.reset_active_request().fetch); delegate_->OnExtensionDownloadStageChanged( -@@ -1316,7 +1302,7 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) { +@@ -1324,7 +1310,7 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) { } else { const std::set request_ids = active_request.GetRequestIds(); const ExtensionDownloaderDelegate::PingResult& ping = ping_results_[id]; @@ -1022,7 +1029,7 @@ diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/bro << "' response code:" << response_code; if (ShouldRetryRequest(extension_loader_.get()) && extensions_queue_.active_request_failure_count() < kMaxRetries) { -@@ -1410,6 +1396,7 @@ void ExtensionDownloader::NotifyExtensionsDownloadFailedWithList( +@@ -1418,6 +1404,7 @@ void ExtensionDownloader::NotifyExtensionsDownloadFailedWithList( bool ExtensionDownloader::IterateFetchCredentialsAfterFailure( ExtensionFetch* fetch, int response_code) { @@ -1086,7 +1093,7 @@ diff --git a/extensions/browser/updater/safe_manifest_parser.cc b/extensions/bro diff --git a/extensions/common/extension_features.cc b/extensions/common/extension_features.cc --- a/extensions/common/extension_features.cc +++ b/extensions/common/extension_features.cc -@@ -154,4 +154,19 @@ BASE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching, +@@ -158,4 +158,19 @@ BASE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching, "DeclarativeNetRequestResponseHeaderMatching", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1109,7 +1116,7 @@ diff --git a/extensions/common/extension_features.cc b/extensions/common/extensi diff --git a/extensions/common/extension_features.h b/extensions/common/extension_features.h --- a/extensions/common/extension_features.h +++ b/extensions/common/extension_features.h -@@ -193,6 +193,10 @@ BASE_DECLARE_FEATURE(kDeclarativeNetRequestSafeRuleLimits); +@@ -200,6 +200,10 @@ BASE_DECLARE_FEATURE(kDeclarativeNetRequestSafeRuleLimits); // matching condition. BASE_DECLARE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching); diff --git a/build/patches/Clear-CORS-Preflight-Cache-on-clearing-data.patch b/build/patches/Clear-CORS-Preflight-Cache-on-clearing-data.patch index b780a355e..7f73e785f 100644 --- a/build/patches/Clear-CORS-Preflight-Cache-on-clearing-data.patch +++ b/build/patches/Clear-CORS-Preflight-Cache-on-clearing-data.patch @@ -79,7 +79,7 @@ diff --git a/services/network/cors/preflight_result.cc b/services/network/cors/p diff --git a/services/network/network_context.cc b/services/network/network_context.cc --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1136,6 +1136,8 @@ void NetworkContext::ClearHttpCache(base::Time start_time, +@@ -1179,6 +1179,8 @@ void NetworkContext::ClearHttpCache(base::Time start_time, base::BindOnce(&NetworkContext::OnHttpCacheCleared, base::Unretained(this), std::move(callback)))); diff --git a/build/patches/Client-hints-overrides.patch b/build/patches/Client-hints-overrides.patch index 305420c40..5f63b4cfa 100644 --- a/build/patches/Client-hints-overrides.patch +++ b/build/patches/Client-hints-overrides.patch @@ -7,17 +7,20 @@ Use Google Chrome branding for client hints License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - components/embedder_support/user_agent_utils.cc | 4 +--- - content/browser/client_hints/client_hints.cc | 3 ++- - content/browser/loader/navigation_url_loader_impl.cc | 5 +++++ - .../content/common/features_cc/Client-hints-overrides.inc | 1 + - .../public/cpp/features_cc/Client-hints-overrides.inc | 1 + - net/http/http_network_transaction.cc | 1 + - services/network/public/cpp/client_hints.cc | 1 + - third_party/blink/common/client_hints/client_hints.cc | 1 + - .../blink/common/client_hints/enabled_client_hints.cc | 4 +++- - .../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++-- - 10 files changed, 18 insertions(+), 7 deletions(-) + components/embedder_support/user_agent_utils.cc | 4 +--- + content/browser/client_hints/client_hints.cc | 17 +++++++++++------ + .../loader/navigation_url_loader_impl.cc | 5 +++++ + .../features_cc/Client-hints-overrides.inc | 1 + + .../cpp/features_cc/Client-hints-overrides.inc | 1 + + net/http/http_network_transaction.cc | 1 + + services/network/public/cpp/client_hints.cc | 1 + + .../blink/common/client_hints/client_hints.cc | 1 + + .../common/client_hints/enabled_client_hints.cc | 4 +++- + .../blink/renderer/core/frame/navigator_ua.idl | 4 +++- + .../renderer/core/frame/navigator_ua_data.idl | 5 ++++- + .../renderer/core/loader/base_fetch_context.cc | 6 ++++-- + .../platform/runtime_enabled_features.json5 | 4 ++++ + 13 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 cromite_flags/content/common/features_cc/Client-hints-overrides.inc create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Client-hints-overrides.inc @@ -38,7 +41,15 @@ diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedd diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/client_hints/client_hints.cc --- a/content/browser/client_hints/client_hints.cc +++ b/content/browser/client_hints/client_hints.cc -@@ -516,7 +516,8 @@ void AddPrefersReducedTransparencyHeader(net::HttpRequestHeaders* headers, +@@ -55,6 +55,7 @@ + #include "third_party/blink/public/common/permissions_policy/origin_with_possible_wildcards.h" + #include "third_party/blink/public/common/permissions_policy/permissions_policy.h" + #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" ++#include "third_party/blink/renderer/platform/runtime_enabled_features.h" + #include "ui/display/display.h" + #include "ui/display/screen.h" + #include "url/origin.h" +@@ -516,7 +517,8 @@ void AddPrefersReducedTransparencyHeader(net::HttpRequestHeaders* headers, : network::kPrefersReducedTransparencyNoPreference); } @@ -48,10 +59,37 @@ diff --git a/content/browser/client_hints/client_hints.cc b/content/browser/clie return network::IsOriginPotentiallyTrustworthy(origin); } +@@ -718,7 +720,8 @@ void UpdateNavigationRequestClientUaHeadersImpl( + // value, disable them. This overwrites previous decision from UI. + disable_due_to_custom_ua = !ua_metadata.has_value(); + } +- ++ if (!blink::RuntimeEnabledFeatures::UserAgentClientHintEnabled()) ++ disable_due_to_custom_ua = true; + if (!disable_due_to_custom_ua) { + if (!ua_metadata.has_value()) + ua_metadata = delegate->GetUserAgentMetadata(); +@@ -900,10 +903,12 @@ void AddRequestClientHintsHeaders( + AddEctHeader(headers, network_quality_tracker, url); + } + +- UpdateNavigationRequestClientUaHeadersImpl( +- delegate, is_ua_override_on, frame_tree_node, +- ClientUaHeaderCallType::kDuringCreation, headers, container_policy, +- request_url, data); ++ if (blink::RuntimeEnabledFeatures::UserAgentClientHintEnabled()) { ++ UpdateNavigationRequestClientUaHeadersImpl( ++ delegate, is_ua_override_on, frame_tree_node, ++ ClientUaHeaderCallType::kDuringCreation, headers, container_policy, ++ request_url, data); ++ } + + if (ShouldAddClientHint(data, WebClientHintsType::kPrefersColorScheme)) { + AddPrefersColorSchemeHeader(headers, frame_tree_node); diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc -@@ -1064,6 +1064,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( +@@ -1070,6 +1070,11 @@ void NavigationURLLoaderImpl::OnAcceptCHFrameReceived( return; } @@ -119,7 +157,7 @@ diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/thi switch (type) { case WebClientHintsType::kUA: case WebClientHintsType::kUAArch: -@@ -99,7 +100,7 @@ bool IsDisabledByFeature(const WebClientHintsType type) { +@@ -96,7 +97,7 @@ bool IsDisabledByFeature(const WebClientHintsType type) { } // namespace bool EnabledClientHints::IsEnabled(const WebClientHintsType type) const { @@ -128,7 +166,7 @@ diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/thi } void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, -@@ -110,6 +111,7 @@ void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, +@@ -107,6 +108,7 @@ void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, std::vector EnabledClientHints::GetEnabledHints() const { std::vector hints; @@ -136,18 +174,76 @@ diff --git a/third_party/blink/common/client_hints/enabled_client_hints.cc b/thi for (const auto& elem : network::GetClientHintToNameMap()) { const auto& type = elem.first; if (IsEnabled(type)) +diff --git a/third_party/blink/renderer/core/frame/navigator_ua.idl b/third_party/blink/renderer/core/frame/navigator_ua.idl +--- a/third_party/blink/renderer/core/frame/navigator_ua.idl ++++ b/third_party/blink/renderer/core/frame/navigator_ua.idl +@@ -4,6 +4,8 @@ + + // https://github.com/WICG/ua-client-hints + +-interface mixin NavigatorUA { ++[ ++ RuntimeEnabled=UserAgentClientHint ++] interface mixin NavigatorUA { + [SecureContext] readonly attribute NavigatorUAData userAgentData; + }; +diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.idl b/third_party/blink/renderer/core/frame/navigator_ua_data.idl +--- a/third_party/blink/renderer/core/frame/navigator_ua_data.idl ++++ b/third_party/blink/renderer/core/frame/navigator_ua_data.idl +@@ -4,7 +4,10 @@ + + // https://github.com/WICG/ua-client-hints + +-[Exposed=(Window,Worker)] interface NavigatorUAData { ++[ ++ RuntimeEnabled=UserAgentClientHint, ++ Exposed=(Window,Worker) ++] interface NavigatorUAData { + [HighEntropy, MeasureAs=NavigatorUAData_Brands] readonly attribute FrozenArray brands; + [HighEntropy=Direct, MeasureAs=NavigatorUAData_Mobile] readonly attribute boolean mobile; + [HighEntropy=Direct, MeasureAs=NavigatorUAData_Platform] readonly attribute DOMString platform; +diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.cc b/third_party/blink/renderer/core/loader/base_fetch_context.cc +--- a/third_party/blink/renderer/core/loader/base_fetch_context.cc ++++ b/third_party/blink/renderer/core/loader/base_fetch_context.cc +@@ -167,7 +167,7 @@ void BaseFetchContext::AddClientHintsIfNecessary( + // specifying accomponying client hints, in which case we disable sending + // them. + using network::mojom::blink::WebClientHintsType; +- if (ua) { ++ if (RuntimeEnabledFeatures::UserAgentClientHintEnabled() && ua) { + // ShouldSendClientHint is called to make sure UA is controlled by + // Permissions Policy. + if (ShouldSendClientHint(policy, resource_origin, is_1p_origin, +@@ -329,7 +329,7 @@ void BaseFetchContext::AddClientHintsIfNecessary( + } + + // Only send User Agent hints if the info is available +- if (ua) { ++ if (RuntimeEnabledFeatures::UserAgentClientHintEnabled() && ua) { + if (ShouldSendClientHint(policy, resource_origin, is_1p_origin, + WebClientHintsType::kUAArch, hints_preferences)) { + SetHttpHeader(WebClientHintsType::kUAArch, +@@ -652,6 +652,8 @@ bool BaseFetchContext::ShouldSendClientHint( + bool is_1p_origin, + network::mojom::blink::WebClientHintsType type, + const ClientHintsPreferences& hints_preferences) const { ++ if (!RuntimeEnabledFeatures::UserAgentClientHintEnabled()) ++ return false; + // For subresource requests, sending the hint in the fetch request based on + // the permissions policy. + if ((!policy || 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 -@@ -3903,8 +3903,8 @@ - public: true, +@@ -536,6 +536,10 @@ + name: "ByobFetch", + status: "stable", }, - { -- name: "UserAgentClientHint", -- status: "stable", ++ { + name: "UserAgentClientHint", // always disabled + status: "experimental", // in bromite - }, ++ }, { - // https://chromestatus.com/feature/5132477781245952 + name: "CacheStorageCodeCacheHint", + origin_trial_feature_name: "CacheStorageCodeCacheHint", -- diff --git a/build/patches/Compress-libchrome-to-free-up-some-space.patch b/build/patches/Compress-libchrome-to-free-up-some-space.patch index e3d103b18..5f215ba45 100644 --- a/build/patches/Compress-libchrome-to-free-up-some-space.patch +++ b/build/patches/Compress-libchrome-to-free-up-some-space.patch @@ -13,7 +13,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni -@@ -638,6 +638,7 @@ template("chrome_common_apk_or_module_tmpl") { +@@ -641,6 +641,7 @@ template("chrome_common_apk_or_module_tmpl") { [ "//components/crash/core/app:chrome_crashpad_handler_named_as_so" ] loadable_modules += [ "$root_out_dir/libchrome_crashpad_handler.so" ] library_always_compress += [ "libchrome_crashpad_handler.so" ] diff --git a/build/patches/Content-settings-infrastructure.patch b/build/patches/Content-settings-infrastructure.patch index f8a8826ac..4fe0d5afe 100644 --- a/build/patches/Content-settings-infrastructure.patch +++ b/build/patches/Content-settings-infrastructure.patch @@ -27,7 +27,7 @@ Require: bromite-build-utils.patch .../site_settings_page_util.ts | 55 +++ chrome/browser/ui/BUILD.gn | 1 + .../controls/rich_controls_container_view.h | 7 + - .../ui/views/page_info/page_info_main_view.cc | 27 +- + .../ui/views/page_info/page_info_main_view.cc | 28 +- .../views/page_info/page_info_view_factory.cc | 19 + .../views/page_info/page_info_view_factory.h | 3 + .../page_info/permission_toggle_row_view.cc | 163 ++++++- @@ -42,10 +42,10 @@ Require: bromite-build-utils.patch .../BromiteCustomContentSetting.java | 155 +++++++ .../BromiteCustomContentSettingImpl.java | 409 ++++++++++++++++++ ...tomTriStateSiteSettingsPreferenceImpl.java | 24 + - .../ContentSettingsResources.java | 14 +- + .../ContentSettingsResources.java | 16 +- .../site_settings/SingleCategorySettings.java | 50 ++- .../site_settings/SingleWebsiteSettings.java | 58 ++- - .../site_settings/SiteSettings.java | 14 +- + .../site_settings/SiteSettings.java | 31 +- .../site_settings/SiteSettingsCategory.java | 18 +- .../site_settings/SiteSettingsDelegate.java | 2 + .../TriStateSiteSettingsPreference.java | 13 +- @@ -72,7 +72,7 @@ Require: bromite-build-utils.patch .../common/content_settings_mojom_traits.cc | 12 +- .../common/content_settings_mojom_traits.h | 24 + .../common/content_settings_param_traits.h | 2 +- - .../core/common/content_settings_types.h | 4 +- + .../core/common/content_settings_types.mojom | 4 +- .../renderer/content_settings_agent_impl.cc | 33 ++ .../renderer/content_settings_agent_impl.h | 5 + .../PageInfoPermissionsController.java | 9 + @@ -84,7 +84,7 @@ Require: bromite-build-utils.patch .../platform/web_content_settings_client.h | 5 + .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + - 73 files changed, 1821 insertions(+), 76 deletions(-) + 73 files changed, 1832 insertions(+), 85 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 @@ -109,7 +109,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C /** A SiteSettingsDelegate instance that contains Chrome-specific Site Settings logic. */ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { public static final String EMBEDDED_CONTENT_HELP_CENTER_URL = -@@ -202,7 +206,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { +@@ -199,7 +203,7 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { @Override public boolean isHelpAndFeedbackEnabled() { @@ -118,7 +118,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/C } @Override -@@ -315,6 +319,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { +@@ -312,6 +316,17 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { return PrivacySandboxBridge.getFirstPartySetOwner(memberOrigin); } @@ -151,7 +151,7 @@ diff --git a/chrome/browser/installable/installed_webapp_bridge.cc b/chrome/brow diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html -@@ -1326,4 +1326,5 @@ +@@ -1390,4 +1390,5 @@ @@ -263,7 +263,7 @@ diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resourc /** * Add all of the child routes that originate from the privacy route, -@@ -136,6 +137,7 @@ function addPrivacyChildRoutes(r: Partial) { +@@ -140,6 +141,7 @@ function addPrivacyChildRoutes(r: Partial) { r.SITE_SETTINGS_STORAGE_ACCESS = r.SITE_SETTINGS.createChild('storageAccess'); } @@ -338,7 +338,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d private getAllowOptionForCategory_(): ContentSetting { switch (this.category) { case ContentSettingsTypes.ADS: -@@ -161,6 +176,8 @@ export class SettingsCategoryDefaultRadioGroupElement extends +@@ -163,6 +178,8 @@ export class SettingsCategoryDefaultRadioGroupElement extends // "Ask" vs "Blocked". return ContentSetting.ASK; default: @@ -347,7 +347,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d assertNotReached('Invalid category: ' + this.category); } } -@@ -185,6 +202,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends +@@ -187,6 +204,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends /** @type {!ContentSetting} */ (this.getAllowOptionForCategory_()); this.browserProxy.setDefaultValueForContentType( this.category, @@ -355,7 +355,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d this.categoryEnabled_ ? allowOption : ContentSetting.BLOCK); } -@@ -216,7 +234,9 @@ export class SettingsCategoryDefaultRadioGroupElement extends +@@ -218,7 +236,9 @@ export class SettingsCategoryDefaultRadioGroupElement extends } const enabled = this.computeIsSettingEnabled(update.setting); @@ -369,7 +369,7 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html --- a/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chrome/browser/resources/settings/site_settings/site_details.html -@@ -279,4 +279,5 @@ +@@ -289,4 +289,5 @@ label="$i18n{siteSettingsAutoPictureInPicture}"> @@ -588,7 +588,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ { route: routes.SITE_SETTINGS_ADS, id: Id.ADS, -@@ -371,10 +371,36 @@ function getCategoryItemMap(): Map { +@@ -389,10 +389,36 @@ function getCategoryItemMap(): Map { disabledLabel: 'trackingProtectionLinkRowSubLabel', }); } @@ -625,7 +625,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ function buildItemListFromIds(orderedIdList: ContentSettingsTypes[]): CategoryListItem[] { const map = getCategoryItemMap(); -@@ -465,7 +491,7 @@ export class SettingsSiteSettingsPageElement extends +@@ -484,7 +510,7 @@ export class SettingsSiteSettingsPageElement extends Id.IMAGES, Id.POPUPS, ]), @@ -692,7 +692,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ /** * Determine localization string for i18n for a given content settings type. * Sorted alphabetically by |ContentSettingsType|. -@@ -90,6 +138,13 @@ export function getLocalizationStringForContentType( +@@ -93,6 +141,13 @@ export function getLocalizationStringForContentType( case ContentSettingsTypes.SITE_DATA: return null; default: @@ -709,7 +709,7 @@ diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn -@@ -2047,6 +2047,7 @@ static_library("ui") { +@@ -2068,6 +2068,7 @@ static_library("ui") { "//components/commerce/core/mojom:mojo_bindings", "//components/commerce/core/webui", "//components/endpoint_fetcher:endpoint_fetcher", @@ -720,7 +720,7 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn diff --git a/chrome/browser/ui/views/controls/rich_controls_container_view.h b/chrome/browser/ui/views/controls/rich_controls_container_view.h --- a/chrome/browser/ui/views/controls/rich_controls_container_view.h +++ b/chrome/browser/ui/views/controls/rich_controls_container_view.h -@@ -42,6 +42,13 @@ class RichControlsContainerView : public views::FlexLayoutView { +@@ -43,6 +43,13 @@ class RichControlsContainerView : public views::FlexLayoutView { return AddChildView(std::move(control_view)); } @@ -737,7 +737,7 @@ diff --git a/chrome/browser/ui/views/controls/rich_controls_container_view.h b/c diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/browser/ui/views/page_info/page_info_main_view.cc --- a/chrome/browser/ui/views/page_info/page_info_main_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_main_view.cc -@@ -49,6 +49,7 @@ +@@ -50,6 +50,7 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" @@ -745,7 +745,7 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/b #include "ui/views/view_class_properties.h" #if BUILDFLAG(FULL_SAFE_BROWSING) -@@ -243,8 +244,20 @@ void PageInfoMainView::SetPermissionInfo( +@@ -244,8 +245,20 @@ void PageInfoMainView::SetPermissionInfo( scroll_view->SetDrawOverflowIndicator(false); auto* content_view = scroll_view->SetContents(std::make_unique()); @@ -768,7 +768,7 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/b content_view->SetID(PageInfoViewFactory::VIEW_ID_PAGE_INFO_PERMISSION_VIEW); content_view->SetProperty(views::kElementIdentifierKey, kPermissionsElementId); -@@ -259,17 +272,24 @@ void PageInfoMainView::SetPermissionInfo( +@@ -260,17 +273,24 @@ void PageInfoMainView::SetPermissionInfo( } } @@ -793,10 +793,11 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/b // The view takes ownership of the object info. auto object_view = std::make_unique( std::move(object), -@@ -280,6 +300,9 @@ void PageInfoMainView::SetPermissionInfo( +@@ -281,6 +301,10 @@ void PageInfoMainView::SetPermissionInfo( content_view->AddChildView(std::move(object_view))); } ++ table_layout->AddRows(/*n=*/1, views::TableLayout::kFixedSize); + if (++count % 2 == 0) + content_view->AddChildView(std::make_unique()); + @@ -815,7 +816,7 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrom #include "components/page_info/core/features.h" #include "components/page_info/core/proto/about_this_site_metadata.pb.h" #include "components/page_info/page_info.h" -@@ -253,7 +255,13 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( +@@ -254,7 +256,13 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( ContentSetting setting = info.setting == CONTENT_SETTING_DEFAULT ? info.default_setting : info.setting; @@ -829,7 +830,7 @@ diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrom // For guard content settings and Automatic Picture-in-Picture, ASK is treated // as an "on" state. const bool show_blocked_badge = -@@ -507,6 +515,17 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( +@@ -508,6 +516,17 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( icon = &vector_icons::kPictureInPictureIcon; break; default: @@ -1101,10 +1102,10 @@ diff --git a/chrome/browser/ui/views/page_info/permission_toggle_row_view.h b/ch -class PermissionToggleRowView : public views::View { +class PermissionToggleRowView : public views::View, + public ui::SimpleMenuModel::Delegate { + METADATA_HEADER(PermissionToggleRowView, views::View) + public: - METADATA_HEADER(PermissionToggleRowView); - PermissionToggleRowView(ChromePageInfoUiDelegate* delegate, -@@ -52,6 +58,12 @@ class PermissionToggleRowView : public views::View { +@@ -55,6 +61,12 @@ class PermissionToggleRowView : public views::View { private: friend class test::PageInfoBubbleViewTestApi; @@ -1117,7 +1118,7 @@ diff --git a/chrome/browser/ui/views/page_info/permission_toggle_row_view.h b/ch void OnToggleButtonPressed(); void InitForUserSource(bool should_show_spacer_view, const std::u16string& toggle_accessible_name); -@@ -65,6 +77,10 @@ class PermissionToggleRowView : public views::View { +@@ -68,6 +80,10 @@ class PermissionToggleRowView : public views::View { raw_ptr toggle_button_ = nullptr; raw_ptr spacer_view_ = nullptr; @@ -1149,7 +1150,7 @@ diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provide #include "components/password_manager/core/browser/leak_detection_dialog_utils.h" #include "components/password_manager/core/browser/manage_passwords_referrer.h" #include "components/password_manager/core/common/password_manager_features.h" -@@ -3628,6 +3632,56 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, +@@ -3738,6 +3742,56 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source, policy_indicator::AddLocalizedStrings(html_source); AddSecurityKeysStrings(html_source); @@ -1218,7 +1219,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_utils.h" -@@ -209,7 +211,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { +@@ -215,7 +217,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { static_assert(std::size(kContentSettingsTypeGroupNames) == // ContentSettingsType starts at -1, so add 1 here. @@ -1227,7 +1228,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b "kContentSettingsTypeGroupNames should have " "CONTENT_SETTINGS_NUM_TYPES elements"); -@@ -462,6 +464,13 @@ bool HasRegisteredGroupName(ContentSettingsType type) { +@@ -468,6 +470,13 @@ bool HasRegisteredGroupName(ContentSettingsType type) { return true; } } @@ -1241,7 +1242,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b return false; } -@@ -475,11 +484,24 @@ ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { +@@ -481,11 +490,24 @@ ContentSettingsType ContentSettingsTypeFromGroupName(base::StringPiece name) { return entry.type; } } @@ -1267,7 +1268,7 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b for (const auto& entry : kContentSettingsTypeGroupNames) { if (type == entry.type) { // Content setting types that aren't represented in the settings UI -@@ -494,7 +516,6 @@ base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type) { +@@ -500,7 +522,6 @@ base::StringPiece ContentSettingsTypeToGroupName(ContentSettingsType type) { return entry.name ? entry.name : base::StringPiece(); } } @@ -1275,8 +1276,8 @@ diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/b NOTREACHED() << static_cast(type) << " is not a recognized content settings type."; return base::StringPiece(); -@@ -574,6 +595,13 @@ const std::vector& GetVisiblePermissionCategories() { - base_types->push_back(ContentSettingsType::MIDI_SYSEX); +@@ -585,6 +606,13 @@ const std::vector& GetVisiblePermissionCategories() { + base_types->push_back(ContentSettingsType::WEB_PRINTING); } + content_settings::WebsiteSettingsRegistry* website_settings = @@ -1455,7 +1456,7 @@ diff --git a/components/browser_ui/settings/android/widget/java/src/org/chromium diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn --- a/components/browser_ui/site_settings/android/BUILD.gn +++ b/components/browser_ui/site_settings/android/BUILD.gn -@@ -149,6 +149,23 @@ android_library("java") { +@@ -141,6 +141,23 @@ android_library("java") { ":site_settings_jni_headers", "//components/content_settings/android:java_pref_names_srcjar", ] @@ -1479,7 +1480,7 @@ diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/b } android_library("javatests") { -@@ -194,6 +211,7 @@ robolectric_library("junit") { +@@ -186,6 +203,7 @@ robolectric_library("junit") { } android_resources("java_resources") { @@ -1549,7 +1550,7 @@ new file mode 100644 + +public abstract class BromiteCustomContentSetting { + -+ private @ContentSettingsType int mContentSettingsType; ++ private @ContentSettingsType.EnumType int mContentSettingsType; + private @SiteSettingsCategory.Type int mSiteSettingsCategory; + private @ContentSettingValues Integer mDefaultEnabledValue; + private @ContentSettingValues Integer mDefaultDisabledValue; @@ -1557,7 +1558,7 @@ new file mode 100644 + private String mPreferenceKey; + private String mProfilePrefKey; + -+ public BromiteCustomContentSetting(@ContentSettingsType int contentSettingsType, ++ public BromiteCustomContentSetting(@ContentSettingsType.EnumType int contentSettingsType, + @ContentSettingValues Integer defaultEnabledValue, + @ContentSettingValues Integer defaultDisabledValue, + boolean allowException, @@ -1571,7 +1572,7 @@ new file mode 100644 + mProfilePrefKey = profilePrefKey; + } + -+ public @ContentSettingsType int getContentSetting() { ++ public @ContentSettingsType.EnumType int getContentSetting() { + return mContentSettingsType; + } + @@ -1636,7 +1637,7 @@ new file mode 100644 + + public abstract @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value); + -+ public ContentSettingException createCustomException(@ContentSettingsType int type, ++ public ContentSettingException createCustomException(@ContentSettingsType.EnumType int type, + @ContentSettingValues int value, + WebsiteAddress websiteAddress) { + return null; @@ -1753,7 +1754,7 @@ new file mode 100644 + return BromiteCustomContentSettingImplBase.NUM_ENTRIES(); + } + -+ public static BromiteCustomContentSetting getContentSetting(@ContentSettingsType int type) { ++ public static BromiteCustomContentSetting getContentSetting(@ContentSettingsType.EnumType int type) { + for (BromiteCustomContentSetting cs : mItemList) { + if (type == cs.getContentSetting()) { + return cs; @@ -1763,7 +1764,7 @@ new file mode 100644 + } + + public static Preference createWebSitePreference( -+ @ContentSettingsType int type, ++ @ContentSettingsType.EnumType int type, + Context context, + @ContentSettingValues @Nullable Integer value) { + BromiteCustomContentSetting cs = getContentSetting(type); @@ -1808,7 +1809,7 @@ new file mode 100644 + } + + public static void setWebSitePreferenceValue( -+ @ContentSettingsType int type, ++ @ContentSettingsType.EnumType int type, + Preference preference, + @ContentSettingValues @Nullable Integer value) { + BromiteCustomContentSetting cs = getContentSetting(type); @@ -1826,7 +1827,7 @@ new file mode 100644 + } + + public static Integer getWebSitePreferenceValue( -+ @ContentSettingsType int type, ++ @ContentSettingsType.EnumType int type, + Object newValue) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) { @@ -1850,13 +1851,13 @@ new file mode 100644 + return null; + } + -+ public static String getProfilePrefKey(@ContentSettingsType int type) { ++ public static String getProfilePrefKey(@ContentSettingsType.EnumType int type) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.getProfilePrefKey(); + return null; + } + -+ public static @ContentSettingsType int contentSettingsType(@SiteSettingsCategory.Type int type) { ++ public static @ContentSettingsType.EnumType int contentSettingsType(@SiteSettingsCategory.Type int type) { + for (BromiteCustomContentSetting cs : mItemList) { + if (type == cs.getSiteSettingsCategory()) { + return cs.getContentSetting(); @@ -1867,31 +1868,31 @@ new file mode 100644 + } + + public static WebsitePermissionsFetcher.WebsitePermissionsType getPermissionsType( -+ @ContentSettingsType int type) { ++ @ContentSettingsType.EnumType int type) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.getPermissionsType(); + return null; + } + -+ public static ContentSettingsResources.ResourceItem getResourceItem(@ContentSettingsType int type) { ++ public static ContentSettingsResources.ResourceItem getResourceItem(@ContentSettingsType.EnumType int type) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.getResourceItem(); + return null; + } + -+ public static int getCategorySummary(@ContentSettingsType int type, @Nullable @ContentSettingValues int value) { ++ public static int getCategorySummary(@ContentSettingsType.EnumType int type, @Nullable @ContentSettingValues int value) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.getCategorySummary(value); + return 0; + } + -+ public static boolean requiresTriStateContentSetting(@ContentSettingsType int type) { ++ public static boolean requiresTriStateContentSetting(@ContentSettingsType.EnumType int type) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.requiresTriStateContentSetting(); + return false; + } + -+ public static int[] getTriStateSettingDescriptionIDs(@ContentSettingsType int type) { ++ public static int[] getTriStateSettingDescriptionIDs(@ContentSettingsType.EnumType int type) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.getTriStateSettingDescriptionIDs(); + return null; @@ -1927,13 +1928,13 @@ new file mode 100644 + return false; + } + -+ public static boolean processOnBlockList(@ContentSettingsType int type, @ContentSettingValues Integer value) { ++ public static boolean processOnBlockList(@ContentSettingsType.EnumType int type, @ContentSettingValues Integer value) { + BromiteCustomContentSetting cs = getContentSetting(type); + if (cs != null) return cs.processOnBlockList(value); + return false; + } + -+ public static boolean isOnBlockList(@ContentSettingsType int type, ++ public static boolean isOnBlockList(@ContentSettingsType.EnumType int type, + WebsitePreference website, + @ContentSettingValues Integer contentSetting) { + BromiteCustomContentSetting cs = getContentSetting(type); @@ -2023,7 +2024,7 @@ new file mode 100644 + return ""; + } + -+ public static ContentSettingException createCustomException(@ContentSettingsType int type, ++ public static ContentSettingException createCustomException(@ContentSettingsType.EnumType int type, + @ContentSettingValues int value, + WebsiteAddress websiteAddress) { + BromiteCustomContentSetting cs = getContentSetting(type); @@ -2039,7 +2040,7 @@ new file mode 100644 + return null; + } + -+ public static AlertDialog.Builder buildPreferenceDialog(Website site, @ContentSettingsType int type, ++ public static AlertDialog.Builder buildPreferenceDialog(Website site, @ContentSettingsType.EnumType int type, + BrowserContextHandle browserContextHandle, + Context context, + final DialogInterface.OnClickListener listener) { @@ -2142,20 +2143,22 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c assert false; // NOTREACHED return null; } -@@ -617,6 +619,12 @@ public class ContentSettingsResources { - } +@@ -600,6 +602,14 @@ public class ContentSettingsResources { + return getResourceItem(contentType, null).getDefaultDisabledValue(); } -+ public static int getCategorySummary(int contentType, @Nullable @ContentSettingValues int value) { ++ public static int getCategorySummary(int contentType, ++ @Nullable @ContentSettingValues int value, ++ boolean isOneTime) { + int result = BromiteCustomContentSettingImpl.getCategorySummary(contentType, value); + if (result != 0) return result; -+ return getCategorySummary(value); ++ return getCategorySummary(value, isOneTime); + } + /** - * Returns the string resource id for a content type to show with a permission category. - * @param enabled Whether the content type is enabled. -@@ -769,6 +777,8 @@ public class ContentSettingsResources { + * Returns the string resource id for a given ContentSetting to show with a permission category. + * +@@ -762,6 +772,8 @@ public class ContentSettingsResources { * Blocked states, in that order. */ public static int[] getTriStateSettingDescriptionIDs(int contentType) { @@ -2167,7 +2170,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java -@@ -337,6 +337,10 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -329,6 +329,10 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment website.site() .getContentSetting( browserContextHandle, mCategory.getContentSettingsType()); @@ -2178,7 +2181,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (contentSetting != null) { return ContentSettingValues.BLOCK == contentSetting; } -@@ -501,6 +505,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -493,6 +497,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment ? new HashSet<>(getArguments().getStringArrayList(EXTRA_SELECTED_DOMAINS)) : null; @@ -2186,7 +2189,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c configureGlobalToggles(); if (mCategory.getType() == SiteSettingsCategory.Type.REQUEST_DESKTOP_SITE) { RecordUserAction.record("DesktopSiteContentSetting.SettingsPage.Entered"); -@@ -531,7 +536,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -523,7 +528,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment if (queryHasChanged) getInfoForOrigins(); }); @@ -2196,7 +2199,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c MenuItem help = menu.add( Menu.NONE, -@@ -543,12 +549,20 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -535,12 +541,20 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment getResources(), R.drawable.ic_help_and_feedback, getContext().getTheme())); @@ -2217,7 +2220,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (mCategory.getType() == SiteSettingsCategory.Type.PROTECTED_MEDIA) { getSiteSettingsDelegate() .launchProtectedContentHelpAndFeedbackActivity(getActivity()); -@@ -620,6 +634,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -612,6 +626,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment BrowserContextHandle browserContextHandle = getSiteSettingsDelegate().getBrowserContextHandle(); PrefService prefService = UserPrefs.get(browserContextHandle); @@ -2229,7 +2232,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (BINARY_TOGGLE_KEY.equals(preference.getKey())) { assert !mCategory.isManaged(); boolean toggleValue = (boolean) newValue; -@@ -817,6 +836,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -804,6 +823,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment .website_settings_allowed_group_heading_request_desktop_site; break; } @@ -2238,7 +2241,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c assert resource > 0; return getString(resource); } -@@ -934,6 +955,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -921,6 +942,8 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment default: break; } @@ -2247,7 +2250,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (allowSpecifyingExceptions) { getPreferenceScreen() .addPreference( -@@ -1122,8 +1145,16 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1109,8 +1132,16 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment private boolean isBlocked() { switch (mGlobalToggleLayout) { case GlobalToggleLayout.TRI_STATE_TOGGLE: @@ -2264,7 +2267,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK); case GlobalToggleLayout.TRI_STATE_COOKIE_TOGGLE: TriStateCookieSettingsPreference triStateCookieToggle = -@@ -1190,7 +1221,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1175,7 +1206,11 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment } else if (mCategory.getType() == SiteSettingsCategory.Type.STORAGE_ACCESS) { infoText.setSummary(getStorageAccessSummary()); } else { @@ -2277,7 +2280,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } // Hide the anti-abuse text preferences, as needed. -@@ -1214,6 +1249,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1199,6 +1234,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment screen.removePreference(antiAbuseThingsToConsiderHeader); screen.removePreference(antiAbuseThingsToConsiderSectionOne); } @@ -2285,7 +2288,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c if (permissionBlockedByOs) { maybeShowOsWarning(screen); -@@ -1378,7 +1414,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1350,7 +1386,7 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment getSiteSettingsDelegate().getBrowserContextHandle(), contentType); int[] descriptionIds = ContentSettingsResources.getTriStateSettingDescriptionIDs(contentType); @@ -2294,7 +2297,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } private void configureBinaryToggle(ChromeSwitchPreference binaryToggle, int contentType) { -@@ -1517,6 +1553,14 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment +@@ -1461,6 +1497,14 @@ public class SingleCategorySettings extends BaseSiteSettingsFragment @ContentSettingValues Integer value = site.getContentSetting(browserContextHandle, contentSettingsType); @@ -2312,7 +2315,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java -@@ -49,6 +49,7 @@ import java.util.Collection; +@@ -48,6 +48,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -2320,7 +2323,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c /** Shows the permissions and other settings for a particular website. */ public class SingleWebsiteSettings extends BaseSiteSettingsFragment -@@ -169,7 +170,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -168,7 +169,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment case ContentSettingsType.CLIPBOARD_READ_WRITE: return "clipboard_permission_list"; default: @@ -2329,14 +2332,14 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } } -@@ -544,8 +545,21 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -545,8 +546,21 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment private void setupContentSettingsPreferences() { mMaxPermissionOrder = findPreference(PREF_PERMISSIONS_HEADER).getOrder(); -- for (@ContentSettingsType int type : SiteSettingsUtil.SETTINGS_ORDER) { +- for (@ContentSettingsType.EnumType int type : SiteSettingsUtil.SETTINGS_ORDER) { - Preference preference = new ChromeSwitchPreference(getStyledContext()); + List order = BromiteCustomContentSettingImpl.getSettingsOrder(); -+ for (@ContentSettingsType int type : order) { ++ for (@ContentSettingsType.EnumType int type : order) { + @ContentSettingValues @Nullable Integer value = + mSite.getContentSetting( + getSiteSettingsDelegate().getBrowserContextHandle(), type); @@ -2353,10 +2356,10 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c preference.setKey(getPreferenceKey(type)); if (type == ContentSettingsType.ADS) { -@@ -1085,20 +1099,32 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment - Preference preference, +@@ -1071,20 +1085,32 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment @ContentSettingValues @Nullable Integer value, - boolean isEmbargoed) { + boolean isEmbargoed, + boolean isOneTime) { - if (value == null) return; + int content_type = getContentSettingsTypeFromPreferenceKey(preference.getKey()); + BromiteCustomContentSetting cs = @@ -2380,10 +2383,10 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c switchPreference.setSummary( isEmbargoed ? getString(R.string.automatically_blocked) -- : getString(ContentSettingsResources.getCategorySummary(value))); -+ : getString(ContentSettingsResources.getCategorySummary(content_type, value))); +- : getString(ContentSettingsResources.getCategorySummary(value, isOneTime))); ++ : getString(ContentSettingsResources.getCategorySummary(content_type, value, isOneTime))); switchPreference.setOnPreferenceChangeListener(this); - @ContentSettingsType + @ContentSettingsType.EnumType int contentType = getContentSettingsTypeFromPreferenceKey(preference.getKey()); - if (contentType == mHighlightedPermission) { - switchPreference.setBackgroundColor(mHighlightColor); @@ -2392,16 +2395,16 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } if (isSessionPermission(contentType)) { switchPreference.setSummary(switchPreference.getSummary() + " " + -@@ -1256,7 +1282,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment - public @ContentSettingsType int getContentSettingsTypeFromPreferenceKey(String preferenceKey) { +@@ -1261,7 +1287,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment if (mPreferenceMap == null) { mPreferenceMap = new HashMap<>(); -- for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES; type++) { -+ for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES_BROMITE; type++) { + for (@ContentSettingsType.EnumType int type = 0; +- type < ContentSettingsType.NUM_TYPES; ++ type < ContentSettingsType.NUM_TYPES_BROMITE; + type++) { String key = getPreferenceKey(type); if (key != null) { - mPreferenceMap.put(key, type); -@@ -1293,11 +1319,17 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment +@@ -1299,14 +1325,20 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment permission = (Boolean) newValue ? ContentSettingValues.ALLOW : ContentSettingValues.BLOCK; } else { @@ -2416,20 +2419,23 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } mSite.setContentSetting(browserContextHandle, type, permission); -- preference.setSummary(getString(ContentSettingsResources.getCategorySummary(permission))); -+ preference.setSummary(getString(ContentSettingsResources.getCategorySummary(type, permission))); + // In Clank, one time grants are only possible via prompt, not via page + // info. + preference.setSummary( +- getString(ContentSettingsResources.getCategorySummary(permission, false))); ++ getString(ContentSettingsResources.getCategorySummary(type, permission, false))); preference.setIcon(getContentSettingsIcon(type, permission)); if (mWebsiteSettingsObserver != null) { -@@ -1325,7 +1357,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment - // TODO(mvanouwerkerk): Refactor this class so that it does not depend on the screen state +@@ -1335,7 +1367,7 @@ public class SingleWebsiteSettings extends BaseSiteSettingsFragment // for its logic. This class should maintain its own data model, and only update the screen // after a change is made. -- for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES; type++) { -+ for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES_BROMITE; type++) { + for (@ContentSettingsType.EnumType int type = 0; +- type < ContentSettingsType.NUM_TYPES; ++ type < ContentSettingsType.NUM_TYPES_BROMITE; + type++) { String key = getPreferenceKey(type); if (key != null) { - removePreferenceSafely(key); diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java @@ -2459,19 +2465,36 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c Preference p = findPreference(prefCategory); int contentType = SiteSettingsCategory.contentSettingsType(prefCategory); // p can be null if the Preference was removed in configurePreferences. -@@ -139,10 +140,13 @@ public class SiteSettings extends BaseSiteSettingsFragment +@@ -142,19 +143,21 @@ public class SiteSettings extends BaseSiteSettingsFragment } else if (Type.ZOOM == prefCategory) { // Don't want to set a summary for Zoom because we don't want any message to display // under the Zoom row on site settings. - } else if (requiresTriStateSetting) { -- p.setSummary(ContentSettingsResources.getCategorySummary(setting)); +- p.setSummary( +- ContentSettingsResources.getCategorySummary( +- setting, /* isOneTime= */ false)); } else { -- p.setSummary(ContentSettingsResources.getCategorySummary(contentType, checked)); -+ int summary = ContentSettingsResources.getCategorySummary(contentType, setting); +- @ContentSettingValues +- int defaultForToggle = +- checked +- ? ContentSettingsResources.getDefaultEnabledValue(contentType) +- : ContentSettingsResources.getDefaultDisabledValue(contentType); +- p.setSummary( +- ContentSettingsResources.getCategorySummary( +- defaultForToggle, /* isOneTime= */ false)); ++ int summary = ContentSettingsResources.getCategorySummary( ++ contentType, setting, /* isOneTime= */ false); + if (summary != 0) { + p.setSummary(summary); + } else { -+ p.setSummary(ContentSettingsResources.getCategorySummary(contentType, checked)); ++ @ContentSettingValues ++ int defaultForToggle = ++ checked ++ ? ContentSettingsResources.getDefaultEnabledValue(contentType) ++ : ContentSettingsResources.getDefaultDisabledValue(contentType); ++ p.setSummary( ++ ContentSettingsResources.getCategorySummary( ++ defaultForToggle, /* isOneTime= */ false)); + } } @@ -2508,7 +2531,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } @@ -162,7 +165,7 @@ public class SiteSettingsCategory { - @ContentSettingsType int contentSettingsType) { + @ContentSettingsType.EnumType int contentSettingsType) { assert contentSettingsType != -1; assert Type.ALL_SITES == 0; - for (@Type int i = Type.ALL_SITES; i < Type.NUM_ENTRIES; i++) { @@ -2551,7 +2574,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsDelegate.java -@@ -152,6 +152,8 @@ public interface SiteSettingsDelegate { +@@ -149,6 +149,8 @@ public interface SiteSettingsDelegate { */ String getFirstPartySetOwner(String memberOrigin); @@ -2575,7 +2598,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c private RadioButtonWithDescription mAsk; private RadioButtonWithDescription mBlocked; private RadioGroup mRadioGroup; -+ private @ContentSettingsType int mContentType; ++ private @ContentSettingsType.EnumType int mContentType; public TriStateSiteSettingsPreference(Context context, AttributeSet attrs) { super(context, attrs); @@ -2584,7 +2607,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c * Allowed, Ask and Blocked states, in that order. */ - public void initialize(@ContentSettingValues int setting, int[] descriptionIds) { -+ public void initialize(@ContentSettingsType int contentType, ++ public void initialize(@ContentSettingsType.EnumType int contentType, + @ContentSettingValues int setting, int[] descriptionIds) { + mContentType = contentType; mSetting = setting; @@ -2632,19 +2655,19 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } } -@@ -228,7 +228,7 @@ public class WebsitePermissionsFetcher { - if (SiteSettingsFeatureMap.isEnabled(SiteSettingsFeatureList.SITE_DATA_IMPROVEMENTS)) { - queue.add(new CookiesInfoFetcher()); - } -- for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES; type++) { -+ for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES_BROMITE; type++) { +@@ -226,7 +226,7 @@ public class WebsitePermissionsFetcher { + addFetcherForStorage(queue); + queue.add(new CookiesInfoFetcher()); + for (@ContentSettingsType.EnumType int type = 0; +- type < ContentSettingsType.NUM_TYPES; ++ type < ContentSettingsType.NUM_TYPES_BROMITE; + type++) { addFetcherForContentSettingsType(queue, type); } - } diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -@@ -283,7 +283,7 @@ public class WebsitePreferenceBridge { +@@ -291,7 +291,7 @@ public class WebsitePreferenceBridge { case ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER: return true; default: @@ -2653,10 +2676,10 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } } -@@ -299,7 +299,6 @@ public class WebsitePreferenceBridge { +@@ -307,7 +307,6 @@ public class WebsitePreferenceBridge { public static boolean isCategoryEnabled( BrowserContextHandle browserContextHandle, - @ContentSettingsType int contentSettingsType) { + @ContentSettingsType.EnumType int contentSettingsType) { - assert !requiresTriStateContentSetting(contentSettingsType); return isContentSettingEnabled(browserContextHandle, contentSettingsType); } @@ -2729,7 +2752,7 @@ new file mode 100644 diff --git a/components/content_settings/android/BUILD.gn b/components/content_settings/android/BUILD.gn --- a/components/content_settings/android/BUILD.gn +++ b/components/content_settings/android/BUILD.gn -@@ -53,6 +53,7 @@ android_library("content_settings_enums_java") { +@@ -57,6 +57,7 @@ android_library("content_settings_enums_java") { } java_cpp_enum("content_settings_enums_javagen") { @@ -2763,7 +2786,7 @@ new file mode 100644 diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc -@@ -15,6 +15,7 @@ +@@ -16,6 +16,7 @@ #include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/features.h" @@ -2771,8 +2794,8 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. namespace content_settings { -@@ -654,6 +655,7 @@ void ContentSettingsRegistry::Init() { - WebsiteSettingsRegistry::DESKTOP, +@@ -711,6 +712,7 @@ void ContentSettingsRegistry::Init() { + WebsiteSettingsRegistry::PLATFORM_CHROMEOS, ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); +#include "components/content_settings/core/browser/bromite_content_settings.inc" @@ -2782,7 +2805,7 @@ diff --git a/components/content_settings/core/browser/content_settings_registry. diff --git a/components/content_settings/core/browser/content_settings_uma_util.cc b/components/content_settings/core/browser/content_settings_uma_util.cc --- a/components/content_settings/core/browser/content_settings_uma_util.cc +++ b/components/content_settings/core/browser/content_settings_uma_util.cc -@@ -180,8 +180,9 @@ void RecordContentSettingsHistogram(const std::string& name, +@@ -184,8 +184,9 @@ void RecordContentSettingsHistogram(const std::string& name, } int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting) { @@ -2802,9 +2825,9 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/common/content_settings.h" + #include "components/content_settings/core/common/content_settings_types.h" #include "components/content_settings/core/common/content_settings_utils.h" - #include "components/content_settings/core/common/features.h" -@@ -121,6 +122,17 @@ PatternPair ParsePatternString(const std::string& pattern_str) { +@@ -122,6 +123,17 @@ PatternPair ParsePatternString(const std::string& pattern_str) { void GetRendererContentSettingRules(const HostContentSettingsMap* map, RendererContentSettingRules* rules) { @@ -2819,13 +2842,13 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc + rules->settings_rules.push_back(rule); + } + } - #if !BUILDFLAG(IS_ANDROID) + #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) rules->image_rules = map->GetSettingsForOneType(ContentSettingsType::IMAGES); rules->mixed_content_rules = diff --git a/components/content_settings/core/browser/website_settings_info.h b/components/content_settings/core/browser/website_settings_info.h --- a/components/content_settings/core/browser/website_settings_info.h +++ b/components/content_settings/core/browser/website_settings_info.h -@@ -132,6 +132,32 @@ class WebsiteSettingsInfo { +@@ -135,6 +135,32 @@ class WebsiteSettingsInfo { ScopingType scoping_type() const { return scoping_type_; } IncognitoBehavior incognito_behavior() const { return incognito_behavior_; } @@ -2858,7 +2881,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ private: const ContentSettingsType type_; const std::string name_; -@@ -143,6 +169,18 @@ class WebsiteSettingsInfo { +@@ -147,6 +173,18 @@ class WebsiteSettingsInfo { const LossyStatus lossy_status_; const ScopingType scoping_type_; const IncognitoBehavior incognito_behavior_; @@ -2880,7 +2903,7 @@ diff --git a/components/content_settings/core/browser/website_settings_info.h b/ diff --git a/components/content_settings/core/browser/website_settings_registry.cc b/components/content_settings/core/browser/website_settings_registry.cc --- a/components/content_settings/core/browser/website_settings_registry.cc +++ b/components/content_settings/core/browser/website_settings_registry.cc -@@ -45,6 +45,12 @@ const WebsiteSettingsInfo* WebsiteSettingsRegistry::Get( +@@ -46,6 +46,12 @@ const WebsiteSettingsInfo* WebsiteSettingsRegistry::Get( return nullptr; } @@ -2907,7 +2930,7 @@ diff --git a/components/content_settings/core/browser/website_settings_registry. diff --git a/components/content_settings/core/common/BUILD.gn b/components/content_settings/core/common/BUILD.gn --- a/components/content_settings/core/common/BUILD.gn +++ b/components/content_settings/core/common/BUILD.gn -@@ -52,6 +52,13 @@ static_library("common") { +@@ -56,6 +56,13 @@ static_library("common") { "//net", "//url", ] @@ -2938,7 +2961,7 @@ diff --git a/components/content_settings/core/common/content_settings.cc b/compo namespace { -@@ -92,6 +93,13 @@ bool ContentSettingPatternSource::operator==( +@@ -103,6 +104,13 @@ std::ostream& operator<<(std::ostream& os, // static bool RendererContentSettingRules::IsRendererContentSetting( ContentSettingsType content_type) { @@ -2952,7 +2975,7 @@ diff --git a/components/content_settings/core/common/content_settings.cc b/compo return content_type == ContentSettingsType::IMAGES || content_type == ContentSettingsType::JAVASCRIPT || content_type == ContentSettingsType::POPUPS || -@@ -101,6 +109,9 @@ bool RendererContentSettingRules::IsRendererContentSetting( +@@ -112,6 +120,9 @@ bool RendererContentSettingRules::IsRendererContentSetting( void RendererContentSettingRules::FilterRulesByOutermostMainFrameURL( const GURL& outermost_main_frame_url) { @@ -2962,7 +2985,7 @@ diff --git a/components/content_settings/core/common/content_settings.cc b/compo FilterRulesForType(image_rules, outermost_main_frame_url); FilterRulesForType(script_rules, outermost_main_frame_url); FilterRulesForType(popup_redirect_rules, outermost_main_frame_url); -@@ -132,3 +143,10 @@ bool RendererContentSettingRules::operator==( +@@ -143,3 +154,10 @@ bool RendererContentSettingRules::operator==( other.popup_redirect_rules, other.mixed_content_rules, other.auto_dark_content_rules); } @@ -2976,9 +2999,9 @@ diff --git a/components/content_settings/core/common/content_settings.cc b/compo diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h --- a/components/content_settings/core/common/content_settings.h +++ b/components/content_settings/core/common/content_settings.h -@@ -66,10 +66,20 @@ struct ContentSettingPatternSource { - - typedef std::vector ContentSettingsForOneType; +@@ -74,10 +74,20 @@ typedef std::vector ContentSettingsForOneType; + typedef std::map + HostIndexedContentSettings; +struct ContentSettingRuleSource { + int type; @@ -3000,7 +3023,7 @@ diff --git a/components/content_settings/core/common/content_settings.h b/compon diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom --- a/components/content_settings/core/common/content_settings.mojom +++ b/components/content_settings/core/common/content_settings.mojom -@@ -79,6 +79,11 @@ struct RuleMetaData { +@@ -76,6 +76,11 @@ struct RuleMetaData { mojo_base.mojom.TimeDelta lifetime; }; @@ -3012,7 +3035,7 @@ diff --git a/components/content_settings/core/common/content_settings.mojom b/co // This mirrors the C++ type in content_settings.h. struct ContentSettingPatternSource { ContentSettingsPattern primary_pattern; -@@ -92,6 +97,7 @@ struct ContentSettingPatternSource { +@@ -89,6 +94,7 @@ struct ContentSettingPatternSource { // This mirrors the C++ type in content_settings.h. // TODO(https://crbug.com/1485360): This should be removed. struct RendererContentSettingRules { @@ -3097,24 +3120,23 @@ diff --git a/components/content_settings/core/common/content_settings_param_trai 1) #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PARAM_TRAITS_H_ -diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h ---- a/components/content_settings/core/common/content_settings_types.h -+++ b/components/content_settings/core/common/content_settings_types.h -@@ -371,7 +371,9 @@ enum class ContentSettingsType : int32_t { - // shown to the user, for a given origin. - FILE_SYSTEM_ACCESS_RESTORE_PERMISSION, +diff --git a/components/content_settings/core/common/content_settings_types.mojom b/components/content_settings/core/common/content_settings_types.mojom +--- a/components/content_settings/core/common/content_settings_types.mojom ++++ b/components/content_settings/core/common/content_settings_types.mojom +@@ -387,6 +387,8 @@ enum ContentSettingsType { + // Content settings for access to printers for the Web Printing API. + WEB_PRINTING, - NUM_TYPES, + NUM_TYPES_CHROMIUM, -+#include "components/content_settings/core/common/bromite_content_settings.inc" ++// #include "components/content_settings/core/common/bromite_content_settings.inc" + NUM_TYPES_BROMITE, }; - struct ContentSettingsTypeHash { diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc --- a/components/content_settings/renderer/content_settings_agent_impl.cc +++ b/components/content_settings/renderer/content_settings_agent_impl.cc -@@ -202,6 +202,39 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( +@@ -200,6 +200,39 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( std::move(renderer_settings)); } @@ -3157,7 +3179,7 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc diff --git a/components/content_settings/renderer/content_settings_agent_impl.h b/components/content_settings/renderer/content_settings_agent_impl.h --- a/components/content_settings/renderer/content_settings_agent_impl.h +++ b/components/content_settings/renderer/content_settings_agent_impl.h -@@ -75,6 +75,11 @@ class ContentSettingsAgentImpl +@@ -76,6 +76,11 @@ class ContentSettingsAgentImpl static mojom::ContentSettingsManager::StorageType ConvertToMojoStorageType( StorageType storage_type); @@ -3252,7 +3274,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. #include "components/content_settings/browser/ui/cookie_controls_controller.h" #include "components/content_settings/core/browser/content_settings_registry.h" #include "components/content_settings/core/browser/content_settings_uma_util.h" -@@ -1249,6 +1250,14 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, +@@ -1236,6 +1237,14 @@ void PageInfo::PopulatePermissionInfo(PermissionInfo& permission_info, // applies to permissions listed in |kPermissionType|. bool PageInfo::ShouldShowPermission( const PageInfo::PermissionInfo& info) const { @@ -3267,7 +3289,7 @@ diff --git a/components/page_info/page_info.cc b/components/page_info/page_info. // Note |ContentSettingsType::ADS| will show up regardless of its default // value when it has been activated on the current origin. if (info.type == ContentSettingsType::ADS) { -@@ -1375,7 +1384,19 @@ void PageInfo::PresentSitePermissions() { +@@ -1362,7 +1371,19 @@ void PageInfo::PresentSitePermissions() { HostContentSettingsMap* content_settings = GetContentSettings(); DCHECK(web_contents_); @@ -3299,7 +3321,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in #include "components/page_info/core/features.h" #include "components/page_info/page_info.h" #include "components/page_info/page_info_ui_delegate.h" -@@ -622,6 +623,12 @@ PageInfoUI::~PageInfoUI() = default; +@@ -624,6 +625,12 @@ PageInfoUI::~PageInfoUI() = default; // static std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { @@ -3312,7 +3334,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in for (const PermissionUIInfo& info : GetContentSettingsUIInfo()) { if (info.type == type) return l10n_util::GetStringUTF16(info.string_id); -@@ -633,6 +640,12 @@ std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { +@@ -635,6 +642,12 @@ std::u16string PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) { // static std::u16string PageInfoUI::PermissionTypeToUIStringMidSentence( ContentSettingsType type) { @@ -3325,7 +3347,7 @@ diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_in for (const PermissionUIInfo& info : GetContentSettingsUIInfo()) { if (info.type == type) return l10n_util::GetStringUTF16(info.string_id_mid_sentence); -@@ -1067,6 +1080,11 @@ bool PageInfoUI::ContentSettingsTypeInPageInfo(ContentSettingsType type) { +@@ -1069,6 +1082,11 @@ bool PageInfoUI::ContentSettingsTypeInPageInfo(ContentSettingsType type) { if (info.type == type) return true; } diff --git a/build/patches/Cromite-Branding.patch b/build/patches/Cromite-Branding.patch index 9367c92fb..3755b73b7 100644 --- a/build/patches/Cromite-Branding.patch +++ b/build/patches/Cromite-Branding.patch @@ -13147,7 +13147,7 @@ e)fqMZZ`3a)Ds&5H @@ -13230,7 +13230,7 @@ diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h #if BUILDFLAG(IS_CHROMEOS_ASH) inline constexpr char kChromeOsHelpViaWebUIURL[] = #if BUILDFLAG(GOOGLE_CHROME_BRANDING) -@@ -180,7 +180,7 @@ inline constexpr char kChromeUIUntrustedNewTabPageUrl[] = +@@ -177,7 +177,7 @@ inline constexpr char kChromeUIUntrustedNewTabPageUrl[] = "chrome-untrusted://new-tab-page/"; // The URL for the Chromium project used in the About dialog. @@ -13242,7 +13242,7 @@ diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h diff --git a/components/browser_ui/strings/android/browser_ui_strings.grd b/components/browser_ui/strings/android/browser_ui_strings.grd --- a/components/browser_ui/strings/android/browser_ui_strings.grd +++ b/components/browser_ui/strings/android/browser_ui_strings.grd -@@ -1003,7 +1003,7 @@ +@@ -997,7 +997,7 @@ @@ -18202,7 +18202,7 @@ diff --git a/tools/grit/grit/grd_reader.py b/tools/grit/grit/grd_reader.py diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc -@@ -636,4 +636,6 @@ BASE_FEATURE(kUseGammaContrastRegistrySettings, +@@ -625,4 +625,6 @@ BASE_FEATURE(kUseGammaContrastRegistrySettings, base::FEATURE_DISABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_WIN) diff --git a/build/patches/Customize-selection-popup.patch b/build/patches/Customize-selection-popup.patch index 57962342d..d9dbb147c 100644 --- a/build/patches/Customize-selection-popup.patch +++ b/build/patches/Customize-selection-popup.patch @@ -20,7 +20,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -693,10 +693,17 @@ public class ChromeTabbedActivity extends ChromeActivity @@ -170,15 +170,15 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/SelectActionMenuHelper.java b/content/public/android/java/src/org/chromium/content/browser/selection/SelectActionMenuHelper.java --- a/content/public/android/java/src/org/chromium/content/browser/selection/SelectActionMenuHelper.java +++ b/content/public/android/java/src/org/chromium/content/browser/selection/SelectActionMenuHelper.java -@@ -25,6 +25,7 @@ import androidx.annotation.VisibleForTesting; - import androidx.core.content.ContextCompat; +@@ -26,6 +26,7 @@ import androidx.core.content.ContextCompat; + import org.chromium.base.ContextUtils; import org.chromium.base.Log; +import org.chromium.base.ContextUtils; import org.chromium.base.PackageManagerUtils; import org.chromium.base.StrictModeContext; import org.chromium.content.R; -@@ -50,38 +51,84 @@ import java.util.TreeSet; +@@ -51,38 +52,84 @@ import java.util.TreeSet; public class SelectActionMenuHelper { private static final String TAG = "SelectActionMenu"; // 20 char limit. @@ -293,7 +293,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select } @Retention(RetentionPolicy.SOURCE) -@@ -158,7 +205,7 @@ public class SelectActionMenuHelper { +@@ -159,7 +206,7 @@ public class SelectActionMenuHelper { if (!additionalMenuItems.isEmpty()) { // Additional menu item group which comes after default menu items. SelectionMenuGroup additionalItemGroup = @@ -302,7 +302,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select additionalItemGroup.addItems(additionalMenuItems); pasteMenuItems.add(additionalItemGroup); } -@@ -224,7 +271,7 @@ public class SelectActionMenuHelper { +@@ -225,7 +272,7 @@ public class SelectActionMenuHelper { } SelectionMenuGroup primaryAssistGroup = new SelectionMenuGroup( @@ -311,7 +311,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select View.OnClickListener clickListener = null; if (classificationResult.onClickListener != null) { clickListener = classificationResult.onClickListener; -@@ -250,7 +297,7 @@ public class SelectActionMenuHelper { +@@ -251,7 +298,7 @@ public class SelectActionMenuHelper { String selectedText) { SelectionMenuGroup defaultGroup = new SelectionMenuGroup( @@ -320,7 +320,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select List menuItemBuilders = new ArrayList<>(); menuItemBuilders.add(cut(delegate.canCut())); menuItemBuilders.add(copy(delegate.canCopy())); -@@ -301,7 +348,7 @@ public class SelectActionMenuHelper { +@@ -302,7 +349,7 @@ public class SelectActionMenuHelper { // these menu items. SelectionMenuGroup secondaryAssistItems = new SelectionMenuGroup( @@ -329,7 +329,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select // First action is reserved for primary action so start at index 1. final int startIndex = 1; -@@ -334,7 +381,7 @@ public class SelectActionMenuHelper { +@@ -335,7 +382,7 @@ public class SelectActionMenuHelper { SelectionMenuGroup textProcessingItems = new SelectionMenuGroup( R.id.select_action_menu_text_processing_items, @@ -338,7 +338,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select if (isSelectionPassword || intentHandler == null) { addAdditionalTextProcessingItems(textProcessingItems, selectionActionMenuDelegate); return textProcessingItems; -@@ -430,7 +477,7 @@ public class SelectActionMenuHelper { +@@ -431,7 +478,7 @@ public class SelectActionMenuHelper { .setId(R.id.select_action_menu_cut) .setIconAttr(android.R.attr.actionModeCutDrawable) .setAlphabeticShortcut(ItemKeyShortcuts.CUT) @@ -347,7 +347,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled) -@@ -442,7 +489,7 @@ public class SelectActionMenuHelper { +@@ -443,7 +490,7 @@ public class SelectActionMenuHelper { .setId(R.id.select_action_menu_copy) .setIconAttr(android.R.attr.actionModeCopyDrawable) .setAlphabeticShortcut(ItemKeyShortcuts.COPY) @@ -356,7 +356,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled) -@@ -454,7 +501,7 @@ public class SelectActionMenuHelper { +@@ -455,7 +502,7 @@ public class SelectActionMenuHelper { .setId(R.id.select_action_menu_paste) .setIconAttr(android.R.attr.actionModePasteDrawable) .setAlphabeticShortcut(ItemKeyShortcuts.PASTE) @@ -365,8 +365,8 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled) -@@ -465,7 +512,7 @@ public class SelectActionMenuHelper { - return new SelectionMenuItem.Builder(R.string.actionbar_share) +@@ -469,7 +516,7 @@ public class SelectActionMenuHelper { + return new SelectionMenuItem.Builder(context.getString(R.string.actionbar_share)) .setId(R.id.select_action_menu_share) .setIconAttr(android.R.attr.actionModeShareDrawable) - .setOrderInCategory(DefaultItemOrder.SHARE) @@ -374,7 +374,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled) -@@ -477,7 +524,7 @@ public class SelectActionMenuHelper { +@@ -481,7 +528,7 @@ public class SelectActionMenuHelper { .setId(R.id.select_action_menu_select_all) .setIconAttr(android.R.attr.actionModeSelectAllDrawable) .setAlphabeticShortcut(ItemKeyShortcuts.SELECT_ALL) @@ -383,7 +383,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled) -@@ -490,7 +537,7 @@ public class SelectActionMenuHelper { +@@ -494,7 +541,7 @@ public class SelectActionMenuHelper { SelectionMenuItem.Builder builder = new SelectionMenuItem.Builder(android.R.string.paste_as_plain_text) .setId(R.id.select_action_menu_paste_as_plain_text) @@ -392,8 +392,8 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select .setShowAsActionFlags( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT) .setIsEnabled(isEnabled); -@@ -506,7 +553,7 @@ public class SelectActionMenuHelper { - return new SelectionMenuItem.Builder(R.string.actionbar_web_search) +@@ -514,7 +561,7 @@ public class SelectActionMenuHelper { + return new SelectionMenuItem.Builder(context.getString(R.string.actionbar_web_search)) .setId(R.id.select_action_menu_web_search) .setIconAttr(android.R.attr.actionModeWebSearchDrawable) - .setOrderInCategory(DefaultItemOrder.WEB_SEARCH) diff --git a/build/patches/Deprecate-Data-URL-in-SVGUseElement.patch b/build/patches/Deprecate-Data-URL-in-SVGUseElement.patch index 3032b8a3c..28fc03d4f 100644 --- a/build/patches/Deprecate-Data-URL-in-SVGUseElement.patch +++ b/build/patches/Deprecate-Data-URL-in-SVGUseElement.patch @@ -10,7 +10,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html 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 -@@ -3129,8 +3129,8 @@ +@@ -3187,8 +3187,8 @@ status: "stable", }, { diff --git a/build/patches/Dictionary-suggestions-for-the-Omnibox.patch b/build/patches/Dictionary-suggestions-for-the-Omnibox.patch index 7a60a7690..68e2f22f2 100644 --- a/build/patches/Dictionary-suggestions-for-the-Omnibox.patch +++ b/build/patches/Dictionary-suggestions-for-the-Omnibox.patch @@ -27,7 +27,7 @@ diff --git a/chrome/android/java/res/layout/url_bar.xml b/chrome/android/java/re diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java -@@ -288,8 +288,17 @@ class LocationBarMediator +@@ -286,8 +286,17 @@ class LocationBarMediator if (mNativeInitialized) RecordUserAction.record("FocusLocation"); // Don't clear Omnibox if the user just pasted text to NTP Omnibox. if (mShouldClearOmniboxOnFocus) { diff --git a/build/patches/Disable-Android-AppRestrictions.patch b/build/patches/Disable-Android-AppRestrictions.patch index 9b88f3347..eabb9bd4c 100644 --- a/build/patches/Disable-Android-AppRestrictions.patch +++ b/build/patches/Disable-Android-AppRestrictions.patch @@ -5,12 +5,12 @@ Subject: Disable Android AppRestrictions License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- chrome/browser/flags/BUILD.gn | 1 + - .../cromite/sEnableAndroidAppRestriction.java | 38 +++++++++++++++++++ + .../cromite/sEnableAndroidAppRestriction.java | 39 +++++++++++++++++++ .../policy/AppRestrictionsProvider.java | 8 ++++ .../DisableAndroidAppRestriction.inc | 13 +++++++ .../disable-android-app-restriction.inc | 3 ++ .../disable-android-app-restriction.inc | 1 + - 6 files changed, 64 insertions(+) + 6 files changed, 65 insertions(+) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sEnableAndroidAppRestriction.java create mode 100644 cromite_flags/chrome/browser/about_flags_cc/DisableAndroidAppRestriction.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/disable-android-app-restriction.inc @@ -19,19 +19,19 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/chrome/browser/flags/BUILD.gn b/chrome/browser/flags/BUILD.gn --- a/chrome/browser/flags/BUILD.gn +++ b/chrome/browser/flags/BUILD.gn -@@ -34,6 +34,7 @@ android_library("java") { +@@ -25,6 +25,7 @@ android_library("java") { "//build:chromeos_buildflags", "//build/android:build_java", "//chrome/browser/preferences:java", + "//components/policy/android:policy_java", - "//components/version_info/android:version_constants_java", "//third_party/android_deps:guava_android_java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/jni_zero:jni_zero_java", diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sEnableAndroidAppRestriction.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sEnableAndroidAppRestriction.java new file mode 100644 --- /dev/null +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sEnableAndroidAppRestriction.java -@@ -0,0 +1,38 @@ +@@ -0,0 +1,39 @@ +/* + This file is part of Cromite. + @@ -51,14 +51,15 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.chrome.browser.flags.CachedFlag; ++import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.chrome.browser.flags.ChromeFeatureMap; +import org.chromium.components.policy.AppRestrictionsProvider; + +public class sEnableAndroidAppRestriction { + private static boolean initialized_ = false; + + private static final CachedFlag sInstance = -+ new CachedFlag("EnableAndroidAppRestriction", false); ++ new CachedFlag(ChromeFeatureMap.getInstance(), "EnableAndroidAppRestriction", false); + + private sEnableAndroidAppRestriction() {} + diff --git a/build/patches/Disable-Component-Updates.patch b/build/patches/Disable-Component-Updates.patch index 417c7d91d..76f4f5dfb 100644 --- a/build/patches/Disable-Component-Updates.patch +++ b/build/patches/Disable-Component-Updates.patch @@ -12,7 +12,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/component_updater/registration.cc --- a/chrome/browser/component_updater/registration.cc +++ b/chrome/browser/component_updater/registration.cc -@@ -102,6 +102,7 @@ +@@ -100,6 +100,7 @@ namespace component_updater { void RegisterComponentsForUpdate() { @@ -23,18 +23,18 @@ diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/c diff --git a/components/component_updater/component_installer.cc b/components/component_updater/component_installer.cc --- a/components/component_updater/component_installer.cc +++ b/components/component_updater/component_installer.cc -@@ -92,6 +92,7 @@ void ComponentInstaller::Register(RegisterCallback register_callback, +@@ -97,6 +97,7 @@ void ComponentInstaller::Register(ComponentUpdateService* cus, + void ComponentInstaller::Register(RegisterCallback register_callback, base::OnceClosure callback, - base::TaskPriority task_priority, const base::Version& registered_version) { + if ((true)) return; DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( + if (!installer_policy_) { diff --git a/components/component_updater/component_updater_service.cc b/components/component_updater/component_updater_service.cc --- a/components/component_updater/component_updater_service.cc +++ b/components/component_updater/component_updater_service.cc -@@ -535,7 +535,7 @@ std::unique_ptr ComponentUpdateServiceFactory( +@@ -530,7 +530,7 @@ std::unique_ptr ComponentUpdateServiceFactory( // Register prefs required by the component update service. void RegisterComponentUpdateServicePrefs(PrefRegistrySimple* registry) { // The component updates are enabled by default, if the preference is not set. diff --git a/build/patches/Disable-Compression-Dictionary-Transport.patch b/build/patches/Disable-Compression-Dictionary-Transport.patch index f3b6767fe..5b0b882e2 100644 --- a/build/patches/Disable-Compression-Dictionary-Transport.patch +++ b/build/patches/Disable-Compression-Dictionary-Transport.patch @@ -10,8 +10,8 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html 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 -@@ -721,16 +721,18 @@ - status: "stable", +@@ -705,16 +705,18 @@ + } }, { - name: "CompressionDictionaryTransport", diff --git a/build/patches/Disable-FLoC-and-privacy-sandbox.patch b/build/patches/Disable-FLoC-and-privacy-sandbox.patch index 439ee4a0a..97f2a48f3 100644 --- a/build/patches/Disable-FLoC-and-privacy-sandbox.patch +++ b/build/patches/Disable-FLoC-and-privacy-sandbox.patch @@ -12,20 +12,20 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/chrome_content_browser_client.cc | 3 +++ .../privacy_sandbox_settings_delegate.cc | 1 + .../privacy_sandbox/privacy_sandbox_prompt.cc | 1 + - .../history/core/browser/history_backend.cc | 13 +--------- + .../history/core/browser/history_backend.cc | 13 +------------ .../privacy_sandbox_attestations.cc | 2 -- - .../privacy_sandbox_features.cc | 6 ++++- + .../privacy_sandbox_features.cc | 4 ++++ .../privacy_sandbox/privacy_sandbox_prefs.cc | 4 ++-- - .../privacy_sandbox_settings_impl.cc | 24 +++++++++++++------ + .../privacy_sandbox_settings_impl.cc | 19 ++++++++++++++----- .../Disable-FLoC-and-privacy-sandbox.inc | 1 + third_party/blink/common/features.cc | 1 + - 10 files changed, 32 insertions(+), 24 deletions(-) + 10 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc -@@ -3381,6 +3381,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed( +@@ -3240,6 +3240,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed( const url::Origin* destination_origin, const url::Origin* reporting_origin, bool* can_bypass) { @@ -82,7 +82,7 @@ diff --git a/components/history/core/browser/history_backend.cc b/components/his diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc --- a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc +++ b/components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.cc -@@ -405,8 +405,6 @@ void PrivacySandboxAttestations::OnAttestationsParsed( +@@ -478,8 +478,6 @@ void PrivacySandboxAttestations::OnAttestationsParsed( if (attestations_map.has_value() && (!file_version_.IsValid() || file_version_.CompareTo(version) < 0)) { // Parsing succeeded and the attestations file has newer version. @@ -94,15 +94,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_attestations/privacy_san diff --git a/components/privacy_sandbox/privacy_sandbox_features.cc b/components/privacy_sandbox/privacy_sandbox_features.cc --- a/components/privacy_sandbox/privacy_sandbox_features.cc +++ b/components/privacy_sandbox/privacy_sandbox_features.cc -@@ -145,11 +145,15 @@ BASE_FEATURE(kAttributionDebugReportingCookieDeprecationTesting, - BASE_FEATURE(kPrivateAggregationDebugReportingCookieDeprecationTesting, - "PrivateAggregationDebugReportingCookieDeprecationTesting", - base::FEATURE_DISABLED_BY_DEFAULT); -- -+ - #if BUILDFLAG(IS_ANDROID) - BASE_FEATURE(kTrackingProtectionNoticeRequestTracking, - "TrackingProtectionNoticeRequestTracking", +@@ -164,4 +164,8 @@ BASE_FEATURE(kTrackingProtectionNoticeRequestTracking, base::FEATURE_DISABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_ANDROID) @@ -121,17 +113,17 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/pr - prefs::kPrivacySandboxApisEnabled, true, + prefs::kPrivacySandboxApisEnabled, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2, false); registry->RegisterBooleanPref(prefs::kPrivacySandboxM1ConsentDecisionMade, -@@ -28,7 +28,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + false); +@@ -27,7 +27,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref(prefs::kPrivacySandboxM1FledgeEnabled, false); registry->RegisterBooleanPref(prefs::kPrivacySandboxM1AdMeasurementEnabled, false); - registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, false); + registry->RegisterBooleanPref(prefs::kPrivacySandboxM1Restricted, true); - registry->RegisterBooleanPref(prefs::kPrivacySandboxManuallyControlledV2, - false); + registry->RegisterTimePref(prefs::kPrivacySandboxTopicsDataAccessibleSince, + base::Time()); diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc --- a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc +++ b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc @@ -182,27 +174,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo ScopedDictPrefUpdate scoped_pref_update( pref_service_, prefs::kPrivacySandboxFledgeJoinBlocked); auto& pref_data = scoped_pref_update.Get(); -@@ -693,7 +697,8 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationDebugModeAllowed( - delegate_->AreThirdPartyCookiesBlockedByCookieDeprecationExperiment(); - } - --bool PrivacySandboxSettingsImpl::IsPrivacySandboxEnabled() const { -+bool PrivacySandboxSettingsImpl::IsPrivacySandboxEnabled() const { // disabled in Bromite -+ if ((true)) return false; - PrivacySandboxSettingsImpl::Status status = GetPrivacySandboxAllowedStatus(); - if (!IsAllowed(status)) { - return false; -@@ -720,7 +725,8 @@ void PrivacySandboxSettingsImpl::SetTopicsBlockedForTesting() { - pref_service_->SetBoolean(prefs::kPrivacySandboxM1TopicsEnabled, false); - } - --void PrivacySandboxSettingsImpl::SetPrivacySandboxEnabled(bool enabled) { -+void PrivacySandboxSettingsImpl::SetPrivacySandboxEnabled(bool enabled) { // disabled in Bromite -+ enabled = false; - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, enabled); - } - -@@ -767,7 +773,10 @@ void PrivacySandboxSettingsImpl::SetDelegateForTesting( +@@ -742,7 +746,10 @@ void PrivacySandboxSettingsImpl::SetDelegateForTesting( delegate_ = std::move(delegate); } @@ -214,7 +186,7 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo pref_service_->SetTime(prefs::kPrivacySandboxTopicsDataAccessibleSince, base::Time::Now()); -@@ -780,6 +789,7 @@ PrivacySandboxSettingsImpl::Status +@@ -755,6 +762,7 @@ PrivacySandboxSettingsImpl::Status PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus( const url::Origin& top_frame_origin, const GURL& url) const { @@ -222,6 +194,14 @@ diff --git a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/compo // Relying on |host_content_settings_map_| instead of |cookie_settings_| // allows to query whether the site associated with the |url| is allowed to // access Site data (aka ContentSettingsType::COOKIES) without considering any +@@ -769,6 +777,7 @@ PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus( + PrivacySandboxSettingsImpl::Status + PrivacySandboxSettingsImpl::GetPrivacySandboxAllowedStatus( + bool should_ignore_restriction /*=false*/) const { ++ if ((true)) return Status::kRestricted; + if (delegate_->IsIncognitoProfile()) { + return Status::kIncognitoProfile; + } diff --git a/cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc b/cromite_flags/third_party/blink/common/features_cc/Disable-FLoC-and-privacy-sandbox.inc new file mode 100644 --- /dev/null @@ -231,7 +211,7 @@ new file mode 100644 diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc -@@ -2239,6 +2239,7 @@ bool IsAllowPageWithIDBConnectionAndTransactionInBFCacheEnabled() { +@@ -2329,6 +2329,7 @@ bool IsAllowPageWithIDBConnectionAndTransactionInBFCacheEnabled() { } bool IsAllowURNsInIframeEnabled() { diff --git a/build/patches/Disable-FedCm.patch b/build/patches/Disable-FedCm.patch index 76fb1fddf..d0eacd470 100644 --- a/build/patches/Disable-FedCm.patch +++ b/build/patches/Disable-FedCm.patch @@ -18,7 +18,7 @@ new file mode 100644 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 -@@ -1591,7 +1591,7 @@ +@@ -1600,7 +1600,7 @@ { name: "FedCm", public: true, diff --git a/build/patches/Disable-FirstPartySets-and-StorageAccessAPI.patch b/build/patches/Disable-FirstPartySets-and-StorageAccessAPI.patch index f573aad40..fec38d973 100644 --- a/build/patches/Disable-FirstPartySets-and-StorageAccessAPI.patch +++ b/build/patches/Disable-FirstPartySets-and-StorageAccessAPI.patch @@ -4,21 +4,66 @@ Subject: Disable FirstPartySets and StorageAccessAPI License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- + .../first_party_sets/first_party_sets_navigation_throttle.cc | 2 +- + .../first_party_sets/first_party_sets_policy_service.cc | 3 ++- + .../browser/privacy_sandbox/privacy_sandbox_service_impl.cc | 2 +- components/privacy_sandbox/privacy_sandbox_prefs.cc | 2 +- components/privacy_sandbox/tracking_protection_prefs.cc | 4 ++-- - .../Disable-FirstPartySets-and-StorageAccessAPI.inc | 1 + - 3 files changed, 4 insertions(+), 3 deletions(-) - create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc + 5 files changed, 7 insertions(+), 6 deletions(-) +diff --git a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc +--- a/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc ++++ b/chrome/browser/first_party_sets/first_party_sets_navigation_throttle.cc +@@ -77,7 +77,7 @@ FirstPartySetsNavigationThrottle::MaybeCreateNavigationThrottle( + // The `service` might be null for some irregular profiles. + // TODO(https://crbug.com/1348572): regular profiles and guest sessions + // aren't mutually exclusive on ChromeOS. +- if (!profile->IsRegularProfile() || profile->IsGuestSession()) ++ if (((true)) || !profile->IsRegularProfile() || profile->IsGuestSession()) + return nullptr; + + FirstPartySetsPolicyService* service = +diff --git a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc +--- a/chrome/browser/first_party_sets/first_party_sets_policy_service.cc ++++ b/chrome/browser/first_party_sets/first_party_sets_policy_service.cc +@@ -58,6 +58,7 @@ const base::Value::Dict* GetOverridesPolicyForProfile( + } + + ServiceState GetServiceState(Profile* profile, bool pref_enabled) { ++ if ((true)) return ServiceState::kPermanentlyDisabled; + if (profile->IsSystemProfile() || profile->IsGuestSession() || + profile->IsOffTheRecord()) { + return ServiceState::kPermanentlyDisabled; +@@ -107,7 +108,7 @@ void FirstPartySetsPolicyService::Init() { + profile, profile->GetPrefs() && + profile->GetPrefs()->GetBoolean( + prefs::kPrivacySandboxRelatedWebsiteSetsEnabled)); +- ++ service_state_ = ServiceState::kPermanentlyDisabled; + if (service_state_ == ServiceState::kPermanentlyDisabled) { + OnReadyToNotifyDelegates(net::FirstPartySetsContextConfig(), + net::FirstPartySetsCacheFilter()); +diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc +--- a/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc ++++ b/chrome/browser/privacy_sandbox/privacy_sandbox_service_impl.cc +@@ -418,7 +418,7 @@ bool PrivacySandboxServiceImpl::IsRestrictedNoticeEnabled() { + void PrivacySandboxServiceImpl::SetFirstPartySetsDataAccessEnabled( + bool enabled) { + pref_service_->SetBoolean(prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, +- enabled); ++ false); + } + + bool PrivacySandboxServiceImpl::IsFirstPartySetsDataAccessEnabled() const { diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc --- a/components/privacy_sandbox/privacy_sandbox_prefs.cc +++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc -@@ -55,7 +55,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { +@@ -51,7 +51,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref( prefs::kPrivacySandboxFirstPartySetsDataAccessAllowedInitialized, false); registry->RegisterBooleanPref( - prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, true, -+ prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, false, ++ prefs::kPrivacySandboxRelatedWebsiteSetsEnabled, false, // must be disabled user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterBooleanPref(prefs::kPrivacySandboxTopicsConsentGiven, @@ -39,12 +84,6 @@ diff --git a/components/privacy_sandbox/tracking_protection_prefs.cc b/component - registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); + registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); // with true enables FPS registry->RegisterBooleanPref( - prefs::kEnableDoNotTrack, false, + prefs::kIpProtectionEnabled, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); -diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc b/cromite_flags/content/public/common/content_features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc -new file mode 100644 ---- /dev/null -+++ b/cromite_flags/content/public/common/content_features_cc/Disable-FirstPartySets-and-StorageAccessAPI.inc -@@ -0,0 +1 @@ -+SET_CROMITE_FEATURE_DISABLED(kFirstPartySets); -- diff --git a/build/patches/Disable-GSA-by-default.patch b/build/patches/Disable-GSA-by-default.patch index 938d56bbb..57323e99c 100644 --- a/build/patches/Disable-GSA-by-default.patch +++ b/build/patches/Disable-GSA-by-default.patch @@ -4,11 +4,11 @@ Subject: Disable GSA by default License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - .../org/chromium/chrome/browser/IntentHandler.java | 5 ----- - .../org/chromium/chrome/browser/share/LensUtils.java | 12 +----------- - .../org/chromium/chrome/browser/gsa/GSAState.java | 11 +++++------ - .../Disable-GSA-by-default.inc | 2 ++ - 4 files changed, 8 insertions(+), 22 deletions(-) + .../org/chromium/chrome/browser/IntentHandler.java | 5 ----- + .../chromium/chrome/browser/share/LensUtils.java | 14 ++------------ + .../org/chromium/chrome/browser/gsa/GSAState.java | 11 +++++------ + .../Disable-GSA-by-default.inc | 1 + + 4 files changed, 8 insertions(+), 23 deletions(-) create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Disable-GSA-by-default.inc diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java @@ -22,7 +22,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.j import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteControllerProvider; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.renderer_host.ChromeNavigationUIData; -@@ -239,8 +238,6 @@ public class IntentHandler { +@@ -243,8 +242,6 @@ public class IntentHandler { private static int sReferrerId; private static String sPendingIncognitoUrl; @@ -31,7 +31,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.j private static final String PACKAGE_GMAIL = "com.google.android.gm"; private static final String PACKAGE_PLUS = "com.google.android.apps.plus"; private static final String PACKAGE_HANGOUTS = "com.google.android.talk"; -@@ -456,8 +453,6 @@ public class IntentHandler { +@@ -460,8 +457,6 @@ public class IntentHandler { return ExternalAppId.LINE; } else if (packageName.equals(PACKAGE_WHATSAPP)) { return ExternalAppId.WHATSAPP; @@ -43,7 +43,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.j diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java --- a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils.java -@@ -11,7 +11,6 @@ import android.text.TextUtils; +@@ -10,7 +10,6 @@ import android.os.Build; import org.chromium.base.ResettersForTesting; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -51,7 +51,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils import org.chromium.components.externalauth.ExternalAuthUtils; /** This class provides utilities for intenting into Google Lens. */ -@@ -55,12 +54,7 @@ public class LensUtils { +@@ -54,12 +53,7 @@ public class LensUtils { if (context == null) { return ""; } @@ -64,7 +64,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils } } -@@ -112,11 +106,7 @@ public class LensUtils { +@@ -98,15 +92,11 @@ public class LensUtils { * @return Whether the package is valid. */ public static boolean isValidAgsaPackage(final ExternalAuthUtils externalAuthUtils) { @@ -77,6 +77,11 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/share/LensUtils } public static boolean isGoogleLensFeatureEnabled(boolean isIncognito) { +- return !isIncognito; ++ return false; + } + + public static boolean shouldLogUkmForLensContextMenuFeatures() { diff --git a/chrome/browser/gsa/java/src/org/chromium/chrome/browser/gsa/GSAState.java b/chrome/browser/gsa/java/src/org/chromium/chrome/browser/gsa/GSAState.java --- a/chrome/browser/gsa/java/src/org/chromium/chrome/browser/gsa/GSAState.java +++ b/chrome/browser/gsa/java/src/org/chromium/chrome/browser/gsa/GSAState.java @@ -111,7 +116,7 @@ diff --git a/chrome/browser/gsa/java/src/org/chromium/chrome/browser/gsa/GSAStat */ public boolean isAgsaVersionBelowMinimum( String installedVersionName, String minimumVersionName) { -+ if ((true)) return true; ++ if ((true)) return false; if (TextUtils.isEmpty(installedVersionName) || TextUtils.isEmpty(minimumVersionName)) { return true; } @@ -137,7 +142,6 @@ diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/D new file mode 100644 --- /dev/null +++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Disable-GSA-by-default.inc -@@ -0,0 +1,2 @@ -+SET_CROMITE_FEATURE_DISABLED(kContextMenuSearchWithGoogleLens); +@@ -0,0 +1 @@ +SET_CROMITE_FEATURE_DISABLED(kExperimentsForAgsa); -- diff --git a/build/patches/Disable-GetInstalledRelatedApps-API.patch b/build/patches/Disable-GetInstalledRelatedApps-API.patch index 2c089ee62..29dd61cbd 100644 --- a/build/patches/Disable-GetInstalledRelatedApps-API.patch +++ b/build/patches/Disable-GetInstalledRelatedApps-API.patch @@ -43,7 +43,7 @@ new file mode 100644 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 -@@ -2133,9 +2133,9 @@ +@@ -2160,9 +2160,9 @@ status: {"Android": "test", "default": "stable"}, }, { diff --git a/build/patches/Disable-PrivacyGuide.patch b/build/patches/Disable-PrivacyGuide.patch index 61cf841d6..af2c60183 100644 --- a/build/patches/Disable-PrivacyGuide.patch +++ b/build/patches/Disable-PrivacyGuide.patch @@ -4,15 +4,27 @@ Subject: Disable PrivacyGuide License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/browser/ui/webui/settings/settings_ui.cc | 2 +- - .../common/chrome_features_cc/Disable-PrivacyGuide.inc | 10 ++++++++++ - 2 files changed, 11 insertions(+), 1 deletion(-) + chrome/android/java/res/xml/privacy_preferences.xml | 1 + + chrome/browser/ui/webui/settings/settings_ui.cc | 2 +- + .../common/chrome_features_cc/Disable-PrivacyGuide.inc | 9 +++++++++ + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-PrivacyGuide.inc +diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml +--- a/chrome/android/java/res/xml/privacy_preferences.xml ++++ b/chrome/android/java/res/xml/privacy_preferences.xml +@@ -21,6 +21,7 @@ found in the LICENSE file. + android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTabsFragment" /> + diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc -@@ -351,7 +351,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) +@@ -357,7 +357,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) #endif // !BUILDFLAG(IS_CHROMEOS_LACROS) bool show_privacy_guide = @@ -25,7 +37,7 @@ diff --git a/cromite_flags/chrome/common/chrome_features_cc/Disable-PrivacyGuide new file mode 100644 --- /dev/null +++ b/cromite_flags/chrome/common/chrome_features_cc/Disable-PrivacyGuide.inc -@@ -0,0 +1,10 @@ +@@ -0,0 +1,9 @@ +SET_CROMITE_FEATURE_DISABLED(kPrivacyGuide3); +SET_CROMITE_FEATURE_DISABLED(kPrivacyGuidePreload); + @@ -33,7 +45,6 @@ new file mode 100644 + +SET_CROMITE_FEATURE_DISABLED(kPrivacyGuideAndroid3); +SET_CROMITE_FEATURE_DISABLED(kPrivacyGuidePreloadAndroid); -+SET_CROMITE_FEATURE_DISABLED(kPrivacyGuideAndroid); + +#endif -- diff --git a/build/patches/Disable-Real-Box.patch b/build/patches/Disable-Real-Box.patch index d83eade3b..56754cc05 100644 --- a/build/patches/Disable-Real-Box.patch +++ b/build/patches/Disable-Real-Box.patch @@ -4,10 +4,24 @@ Subject: Disable Real Box Real-box is search box in ntp --- - chrome/browser/resources/new_tab_page/app.html | 5 ----- - components/search/ntp_features.cc | 10 +++++----- - 2 files changed, 5 insertions(+), 10 deletions(-) + chrome/browser/prefs/browser_prefs.cc | 2 +- + chrome/browser/resources/new_tab_page/app.html | 5 ----- + chrome/browser/ui/webui/realbox/realbox_handler.cc | 2 +- + components/search/ntp_features.cc | 6 +++--- + 4 files changed, 5 insertions(+), 10 deletions(-) +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -2027,7 +2027,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + registry->RegisterBooleanPref( + prefs::kLensRegionSearchEnabled, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); +- registry->RegisterBooleanPref(prefs::kLensDesktopNTPSearchEnabled, true); ++ registry->RegisterBooleanPref(prefs::kLensDesktopNTPSearchEnabled, false); + #endif + + #if !BUILDFLAG(IS_ANDROID) diff --git a/chrome/browser/resources/new_tab_page/app.html b/chrome/browser/resources/new_tab_page/app.html --- a/chrome/browser/resources/new_tab_page/app.html +++ b/chrome/browser/resources/new_tab_page/app.html @@ -16,17 +30,29 @@ diff --git a/chrome/browser/resources/new_tab_page/app.html b/chrome/browser/res

- -