diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 5bc7158cd..3a69bd1aa 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/124.0.6367.0' + 'chromium_checkout': 'refs/tags/125.0.6422.0' } diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index a8baec9dc..83ea1e815 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "984fcdc779268524c848d94232e2d045d9a42852" +#define CEF_API_HASH_UNIVERSAL "faa8a52df058a26e1228da66052a9900a7120de4" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "3975a9042b7124d15f39044972f879066f61e9dd" +#define CEF_API_HASH_PLATFORM "41a15a683e4a2b927f043c22d8a9f07671168170" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "ffdd4259a0790d813627975952d0e714818c24b2" +#define CEF_API_HASH_PLATFORM "6933ff4566b919c045ff0743682889d45ffcba28" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "f0dff25daca39032db1f882545b3ad880e731060" +#define CEF_API_HASH_PLATFORM "b12778ab8fd0974e45a246484a31d12f097c7936" #endif #ifdef __cplusplus diff --git a/include/internal/cef_types_content_settings.h b/include/internal/cef_types_content_settings.h index cb2528754..1e669dcda 100644 --- a/include/internal/cef_types_content_settings.h +++ b/include/internal/cef_types_content_settings.h @@ -380,6 +380,13 @@ typedef enum { /// a requesting-origin/top-level-site combination and persistent. CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL, + /// Content Setting for a first-party origin trial that allows websites to + /// enable third-party cookie deprecation. + /// ALLOW (default): no effect (e.g. third-party cookies allowed, if not + /// blocked otherwise). + /// BLOCK: third-party cookies blocked, but 3PCD mitigations enabled. + CEF_CONTENT_SETTING_TOP_LEVEL_TPCD_ORIGIN_TRIAL, + /// Content setting used to indicate whether entering picture-in-picture /// automatically should be enabled. CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE, @@ -428,6 +435,15 @@ typedef enum { /// Pointer Lock API allows a site to hide the cursor and have exclusive /// access to mouse inputs. CEF_CONTENT_SETTING_TYPE_POINTER_LOCK, + + /// Website setting which is used for UnusedSitePermissionsService to store + /// auto-revoked notification permissions from abusive sites. + REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS, + + /// Content setting that controls tracking protection status per site. + /// BLOCK: Protections enabled. This is the default state. + /// ALLOW: Protections disabled. + TRACKING_PROTECTION, } cef_content_setting_types_t; /// diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index 38da74632..72a346c71 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -452,6 +452,12 @@ void AlloyBrowserContext::RebuildTable( enumerator->OnComplete(true); } +void AlloyBrowserContext::BuildVisitedLinkTable( + const scoped_refptr& enumerator) { + // Called when visited links will not or cannot be loaded from disk. + enumerator->OnVisitedLinkComplete(true); +} + DownloadPrefs* AlloyBrowserContext::GetDownloadPrefs() { CEF_REQUIRE_UIT(); if (!download_prefs_) { diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index 89dac5223..60a48e91b 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -110,6 +110,8 @@ class AlloyBrowserContext : public ChromeProfileAlloy, // visitedlink::VisitedLinkDelegate methods. void RebuildTable(const scoped_refptr& enumerator) override; + void BuildVisitedLinkTable( + const scoped_refptr& enumerator) override; // Manages extensions. extensions::CefExtensionSystem* extension_system() const { diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 425db3122..ec4635032 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -618,7 +618,7 @@ bool AlloyBrowserHostImpl::MaybeAllowNavigation( CEF_POST_TASK(CEF_UIT, base::BindOnce( base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab), - this, nullptr, params)); + this, nullptr, params, base::NullCallback())); return false; } @@ -926,8 +926,11 @@ bool AlloyBrowserHostImpl::IsAudioMuted() { content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab( content::WebContents* source, - const content::OpenURLParams& params) { - auto target_contents = contents_delegate_->OpenURLFromTab(source, params); + const content::OpenURLParams& params, + base::OnceCallback + navigation_handle_callback) { + auto target_contents = contents_delegate_->OpenURLFromTabEx( + source, params, navigation_handle_callback); if (target_contents) { // Start a navigation in the current browser that will result in the // creation of a new render process. @@ -1282,6 +1285,12 @@ content::PreloadingEligibility AlloyBrowserHostImpl::IsPrerender2Supported( return content::PreloadingEligibility::kEligible; } +void AlloyBrowserHostImpl::DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) { + contents_delegate_->DraggableRegionsChanged(regions, contents); +} + // content::WebContentsObserver methods. // ----------------------------------------------------------------------------- diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index dea815050..e5e03e67e 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -184,7 +184,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, // content::WebContentsDelegate methods. content::WebContents* OpenURLFromTab( content::WebContents* source, - const content::OpenURLParams& params) override; + const content::OpenURLParams& params, + base::OnceCallback + navigation_handle_callback) override; bool ShouldAllowRendererInitiatedCrossProcessNavigation( bool is_main_frame_navigation) override; void AddNewContents(content::WebContents* source, @@ -279,6 +281,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, bool IsBackForwardCacheSupported() override; content::PreloadingEligibility IsPrerender2Supported( content::WebContents& web_contents) override; + void DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) override; // content::WebContentsObserver methods. using content::WebContentsObserver::BeforeUnloadFired; diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 0ddd4db5b..5ecd68f77 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -6,10 +6,11 @@ #define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_MAIN_H_ #pragma once +#include + #include "libcef/browser/request_context_impl.h" #include "base/command_line.h" -#include "base/strings/string_piece.h" #include "build/build_config.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_main_parts.h" diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index a057b26df..75ec51ec9 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -92,6 +92,7 @@ #include "components/pdf/browser/pdf_navigation_throttle.h" #include "components/pdf/browser/pdf_url_loader_request_interceptor.h" #include "components/pdf/common/constants.h" +#include "components/pdf/common/pdf_util.h" #include "components/policy/core/common/policy_pref_names.h" #include "components/spellcheck/common/spellcheck.mojom.h" #include "components/version_info/version_info.h" @@ -449,7 +450,7 @@ bool AlloyContentBrowserClient::DoesSiteRequireDedicatedProcess( } bool AlloyContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel( - base::StringPiece scheme, + std::string_view scheme, bool is_embedded_origin_secure) { // This is needed to bypass the normal SameSite rules for any chrome:// page // embedding a secure origin, regardless of the registrable domains of any @@ -470,7 +471,7 @@ bool AlloyContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel( bool AlloyContentBrowserClient:: ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel( - base::StringPiece scheme, + std::string_view scheme, bool is_embedded_origin_secure) { return is_embedded_origin_secure && scheme == content::kChromeUIScheme; } @@ -913,10 +914,10 @@ void AlloyContentBrowserClient:: }, &render_frame_host)); - associated_registry.AddInterface(base::BindRepeating( + associated_registry.AddInterface(base::BindRepeating( [](content::RenderFrameHost* render_frame_host, - mojo::PendingAssociatedReceiver receiver) { - pdf::PDFDocumentHelper::BindPdfService( + mojo::PendingAssociatedReceiver receiver) { + pdf::PDFDocumentHelper::BindPdfHost( std::move(receiver), render_frame_host, std::make_unique()); }, @@ -1179,6 +1180,7 @@ void AlloyContentBrowserClient::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, + const net::IsolationInfo& isolation_info, std::optional navigation_id, ukm::SourceIdObj ukm_source_id, network::URLLoaderFactoryBuilder& factory_builder, diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 4974f3244..6fedc9f2d 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -45,10 +45,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context, const GURL& effective_site_url) override; bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel( - base::StringPiece scheme, + std::string_view scheme, bool is_embedded_origin_secure) override; bool ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel( - base::StringPiece scheme, + std::string_view scheme, bool is_embedded_origin_secure) override; void OverrideURLLoaderFactoryParams( content::BrowserContext* browser_context, @@ -186,6 +186,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, + const net::IsolationInfo& isolation_info, std::optional navigation_id, ukm::SourceIdObj ukm_source_id, network::URLLoaderFactoryBuilder& factory_builder, diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index d28e73ff6..51d031c07 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -370,6 +370,12 @@ ChromeBrowserProcessAlloy::subresource_filter_ruleset_service() { return nullptr; } +subresource_filter::RulesetService* +ChromeBrowserProcessAlloy::fingerprinting_protection_ruleset_service() { + DCHECK(false); + return nullptr; +} + StartupData* ChromeBrowserProcessAlloy::startup_data() { DCHECK(false); return nullptr; diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index 4da76d33f..f0ec6a91a 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -92,6 +92,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { safe_browsing::SafeBrowsingService* safe_browsing_service() override; subresource_filter::RulesetService* subresource_filter_ruleset_service() override; + subresource_filter::RulesetService* + fingerprinting_protection_ruleset_service() override; StartupData* startup_data() override; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) diff --git a/libcef/browser/alloy/devtools/devtools_file_manager.cc b/libcef/browser/alloy/devtools/devtools_file_manager.cc index 0babf80b5..a7e3150e5 100644 --- a/libcef/browser/alloy/devtools/devtools_file_manager.cc +++ b/libcef/browser/alloy/devtools/devtools_file_manager.cc @@ -35,7 +35,7 @@ void WriteToFile(const base::FilePath& path, const std::string& content) { void AppendToFile(const base::FilePath& path, const std::string& content) { DCHECK(!path.empty()); - base::AppendToFile(path, base::StringPiece(content)); + base::AppendToFile(path, std::string_view(content)); } } // namespace diff --git a/libcef/browser/alloy/devtools/devtools_frontend.cc b/libcef/browser/alloy/devtools/devtools_frontend.cc index 839c4c5a8..38a52b627 100644 --- a/libcef/browser/alloy/devtools/devtools_frontend.cc +++ b/libcef/browser/alloy/devtools/devtools_frontend.cc @@ -166,7 +166,7 @@ void LogProtocolMessage(const base::FilePath& log_file, WriteTimestamp(stream); stream << ": " << type_label << ": " << to_log << "\n"; const std::string& str = stream.str(); - if (!base::AppendToFile(log_file, base::StringPiece(str))) { + if (!base::AppendToFile(log_file, std::string_view(str))) { LOG(ERROR) << "Failed to write file " << log_file.value(); log_error = true; } @@ -200,7 +200,7 @@ class CefDevToolsFrontend::NetworkResourceLoader response_headers_ = response_head.headers; } - void OnDataReceived(base::StringPiece chunk, + void OnDataReceived(std::string_view chunk, base::OnceClosure resume) override { base::Value chunkValue; @@ -577,8 +577,8 @@ void CefDevToolsFrontend::DispatchProtocolMessage( return; } - base::StringPiece str_message(reinterpret_cast(message.data()), - message.size()); + std::string_view str_message(reinterpret_cast(message.data()), + message.size()); if (ProtocolLoggingEnabled()) { // Quick check to avoid parsing the JSON object. Events begin with a // "method" value whereas method results begin with an "id" value. @@ -595,7 +595,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage( size_t total_size = str_message.length(); for (size_t pos = 0; pos < str_message.length(); pos += kMaxMessageChunkSize) { - base::StringPiece str_message_chunk = + std::string_view str_message_chunk = str_message.substr(pos, kMaxMessageChunkSize); CallClientFunction( @@ -643,7 +643,7 @@ bool CefDevToolsFrontend::ProtocolLoggingEnabled() const { } void CefDevToolsFrontend::LogProtocolMessage(ProtocolMessageType type, - const base::StringPiece& message) { + const std::string_view& message) { DCHECK(ProtocolLoggingEnabled()); std::string to_log(message.substr(0, kMaxLogLineLength)); diff --git a/libcef/browser/alloy/devtools/devtools_frontend.h b/libcef/browser/alloy/devtools/devtools_frontend.h index 3b82c7f4d..45f88459e 100644 --- a/libcef/browser/alloy/devtools/devtools_frontend.h +++ b/libcef/browser/alloy/devtools/devtools_frontend.h @@ -87,7 +87,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, bool ProtocolLoggingEnabled() const; void LogProtocolMessage(ProtocolMessageType type, - const base::StringPiece& message); + const std::string_view& message); PrefService* GetPrefs() const; diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index ec43f0ff8..bce8f19d9 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -25,6 +25,7 @@ #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" #include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h" +#include "third_party/blink/public/mojom/page/draggable_region.mojom.h" #include "third_party/blink/public/mojom/widget/platform_widget.mojom-test-utils.h" #if defined(OS_WIN) @@ -112,9 +113,11 @@ void CefBrowserContentsDelegate::RemoveObserver(Observer* observer) { // |source| may be NULL for navigations in the current tab, or if the // navigation originates from a guest view via MaybeAllowNavigation. -content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab( +content::WebContents* CefBrowserContentsDelegate::OpenURLFromTabEx( content::WebContents* source, - const content::OpenURLParams& params) { + const content::OpenURLParams& params, + base::OnceCallback& + navigation_handle_callback) { bool cancel = false; if (auto c = client()) { @@ -133,8 +136,13 @@ content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab( } } + if (!cancel) { + // TODO: Do something with |navigation_handle_callback|. + return web_contents(); + } + // Returning nullptr will cancel the navigation. - return cancel ? nullptr : web_contents(); + return nullptr; } void CefBrowserContentsDelegate::LoadingStateChanged( @@ -228,11 +236,9 @@ void CefBrowserContentsDelegate::CanDownload( base::OnceCallback callback) { bool allow = true; - if (auto delegate = platform_delegate()) { - if (auto c = client()) { - if (auto handler = c->GetDownloadHandler()) { - allow = handler->CanDownload(browser(), url.spec(), request_method); - } + if (auto c = client()) { + if (auto handler = c->GetDownloadHandler()) { + allow = handler->CanDownload(browser(), url.spec(), request_method); } } @@ -294,6 +300,23 @@ bool CefBrowserContentsDelegate::HandleKeyboardEvent( return false; } +void CefBrowserContentsDelegate::DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) { + // Already converted to window bounds in WebViewImpl::DraggableRegionsChanged. + std::vector cef_regions; + if (!regions.empty()) { + cef_regions.reserve(regions.size()); + for (const auto& region : regions) { + auto cef_region = cef::mojom::DraggableRegionEntry::New( + region->bounds, region->draggable); + cef_regions.emplace_back(std::move(cef_region)); + } + } + + browser_info_->GetMainFrame()->UpdateDraggableRegions(std::move(cef_regions)); +} + void CefBrowserContentsDelegate::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { browser_info_->MaybeCreateFrame(render_frame_host, false /* is_guest_view */); diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index d222af272..2b83a0ee7 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -80,10 +80,15 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); - // WebContentsDelegate methods: - content::WebContents* OpenURLFromTab( + // Same as OpenURLFromTab but only taking |navigation_handle_callback| + // if the return value is non-nullptr. + content::WebContents* OpenURLFromTabEx( content::WebContents* source, - const content::OpenURLParams& params) override; + const content::OpenURLParams& params, + base::OnceCallback& + navigation_handle_callback); + + // WebContentsDelegate methods: void LoadingStateChanged(content::WebContents* source, bool should_show_loading_ui) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -105,6 +110,9 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, bool HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; + void DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) override; // WebContentsObserver methods: void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; diff --git a/libcef/browser/chrome/browser_delegate.h b/libcef/browser/chrome/browser_delegate.h index 0c15c27eb..032b8b886 100644 --- a/libcef/browser/chrome/browser_delegate.h +++ b/libcef/browser/chrome/browser_delegate.h @@ -12,12 +12,17 @@ #include "base/memory/scoped_refptr.h" #include "chrome/browser/ui/page_action/page_action_icon_type.h" #include "content/public/browser/web_contents_delegate.h" +#include "third_party/blink/public/mojom/page/draggable_region.mojom-forward.h" #include "third_party/skia/include/core/SkRegion.h" #include "ui/base/window_open_disposition.h" class Browser; class Profile; +namespace content { +class NavigationHandle; +} + namespace cef { // Delegate for the chrome Browser object. Lifespan is controlled by the Browser @@ -151,16 +156,22 @@ class BrowserDelegate : public content::WebContentsDelegate { return std::nullopt; } - // Set the draggable region relative to web contents. - // Called from DraggableRegionsHostImpl::UpdateDraggableRegions. - virtual void UpdateDraggableRegion(const SkRegion& region) {} - // Called at the end of a fullscreen transition. virtual void WindowFullscreenStateChanged() {} // Returns true if this browser has a Views-hosted opener. Only // applicable for Browsers of type picture_in_picture and devtools. virtual bool HasViewsHostedOpener() const { return false; } + + // Same as OpenURLFromTab but only taking |navigation_handle_callback| + // if the return value is non-nullptr. + virtual content::WebContents* OpenURLFromTabEx( + content::WebContents* source, + const content::OpenURLParams& params, + base::OnceCallback& + navigation_handle_callback) { + return nullptr; + } }; } // namespace cef diff --git a/libcef/browser/chrome/chrome_browser_delegate.cc b/libcef/browser/chrome/chrome_browser_delegate.cc index d336d130d..c7d159430 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.cc +++ b/libcef/browser/chrome/chrome_browser_delegate.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include - #include "libcef/browser/chrome/chrome_browser_delegate.h" +#include + #include "libcef/browser/browser_contents_delegate.h" #include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_info_manager.h" @@ -22,12 +22,14 @@ #include "libcef/browser/views/window_impl.h" #include "libcef/common/app_manager.h" #include "libcef/common/frame_util.h" +#include "third_party/blink/public/mojom/page/draggable_region.mojom.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/keyboard_event_processing_result.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/common/input/native_web_keyboard_event.h" @@ -454,9 +456,23 @@ const std::optional ChromeBrowserDelegate::GetDraggableRegion() return draggable_region_; } -void ChromeBrowserDelegate::UpdateDraggableRegion(const SkRegion& region) { - DCHECK(SupportsDraggableRegion()); - draggable_region_ = region; +void ChromeBrowserDelegate::DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) { + if (SupportsDraggableRegion()) { + SkRegion sk_region; + for (const auto& region : regions) { + sk_region.op( + SkIRect::MakeLTRB(region->bounds.x(), region->bounds.y(), + region->bounds.x() + region->bounds.width(), + region->bounds.y() + region->bounds.height()), + region->draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); + } + + draggable_region_ = sk_region; + } else if (auto delegate = GetDelegateForWebContents(contents)) { + delegate->DraggableRegionsChanged(regions, contents); + } } void ChromeBrowserDelegate::WindowFullscreenStateChanged() { @@ -512,9 +528,11 @@ void ChromeBrowserDelegate::WebContentsCreated( /*is_devtools_popup=*/false, opener); } -content::WebContents* ChromeBrowserDelegate::OpenURLFromTab( +content::WebContents* ChromeBrowserDelegate::OpenURLFromTabEx( content::WebContents* source, - const content::OpenURLParams& params) { + const content::OpenURLParams& params, + base::OnceCallback& + navigation_handle_callback) { // |source| may be nullptr when opening a link from chrome UI such as the // Reading List sidebar. In that case we default to using the Browser's // currently active WebContents. @@ -526,7 +544,8 @@ content::WebContents* ChromeBrowserDelegate::OpenURLFromTab( // Return nullptr to cancel the navigation. Otherwise, proceed with default // chrome handling. if (auto delegate = GetDelegateForWebContents(source)) { - return delegate->OpenURLFromTab(source, params); + return delegate->OpenURLFromTabEx(source, params, + navigation_handle_callback); } return nullptr; } diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 6cc81cf05..f092f09d9 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -87,9 +87,13 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { std::optional SupportsWindowFeature(int feature) const override; bool SupportsDraggableRegion() const override; const std::optional GetDraggableRegion() const override; - void UpdateDraggableRegion(const SkRegion& region) override; void WindowFullscreenStateChanged() override; bool HasViewsHostedOpener() const override; + content::WebContents* OpenURLFromTabEx( + content::WebContents* source, + const content::OpenURLParams& params, + base::OnceCallback& + navigation_handle_callback) override; // WebContentsDelegate methods: void WebContentsCreated(content::WebContents* source_contents, @@ -98,9 +102,6 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { const std::string& frame_name, const GURL& target_url, content::WebContents* new_contents) override; - content::WebContents* OpenURLFromTab( - content::WebContents* source, - const content::OpenURLParams& params) override; void LoadingStateChanged(content::WebContents* source, bool should_show_loading_ui) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -122,6 +123,9 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { bool HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; + void DraggableRegionsChanged( + const std::vector& regions, + content::WebContents* contents) override; Browser* browser() const { return browser_; } diff --git a/libcef/browser/chrome/chrome_browser_host_impl.cc b/libcef/browser/chrome/chrome_browser_host_impl.cc index b19e828c4..e0aaee8e7 100644 --- a/libcef/browser/chrome/chrome_browser_host_impl.cc +++ b/libcef/browser/chrome/chrome_browser_host_impl.cc @@ -146,7 +146,12 @@ void ChromeBrowserHostImpl::OnWebContentsDestroyed( // CefBrowserInfoManager::DestroyAllBrowsers(). if (platform_delegate_) { platform_delegate_->WebContentsDestroyed(web_contents); - DestroyBrowser(); + + // Destroy the browser asynchronously to allow the current call stack + // to unwind (we may have been called via the TabStripModel owned by the + // Browser). + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&ChromeBrowserHostImpl::DestroyBrowser, this)); } } diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index a4e6c8a27..80cdaf87b 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -236,6 +236,7 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, + const net::IsolationInfo& isolation_info, std::optional navigation_id, ukm::SourceIdObj ukm_source_id, network::URLLoaderFactoryBuilder& factory_builder, @@ -252,9 +253,9 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( if (!CefBrowserContext::FromProfile(profile)) { ChromeContentBrowserClient::WillCreateURLLoaderFactory( browser_context, frame, render_process_id, type, request_initiator, - navigation_id, ukm_source_id, factory_builder, header_client, - bypass_redirect_checks, disable_secure_dns, factory_override, - navigation_response_task_runner); + isolation_info, navigation_id, ukm_source_id, factory_builder, + header_client, bypass_redirect_checks, disable_secure_dns, + factory_override, navigation_response_task_runner); return; } @@ -283,7 +284,7 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( // TODO(chrome): Is it necessary to proxy |header_client| callbacks? ChromeContentBrowserClient::WillCreateURLLoaderFactory( browser_context, frame, render_process_id, type, request_initiator, - navigation_id, ukm_source_id, factory_builder, + isolation_info, navigation_id, ukm_source_id, factory_builder, /*header_client=*/nullptr, bypass_redirect_checks, disable_secure_dns, handler_override, navigation_response_task_runner); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index d63645341..1ef61c2be 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -62,6 +62,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, + const net::IsolationInfo& isolation_info, std::optional navigation_id, ukm::SourceIdObj ukm_source_id, network::URLLoaderFactoryBuilder& factory_builder, diff --git a/libcef/browser/devtools/devtools_controller.cc b/libcef/browser/devtools/devtools_controller.cc index 30f577616..182beb8f1 100644 --- a/libcef/browser/devtools/devtools_controller.cc +++ b/libcef/browser/devtools/devtools_controller.cc @@ -29,7 +29,7 @@ CefDevToolsController::~CefDevToolsController() { } bool CefDevToolsController::SendDevToolsMessage( - const base::StringPiece& message) { + const std::string_view& message) { CEF_REQUIRE_UIT(); if (!EnsureAgentHost()) { return false; @@ -100,8 +100,8 @@ void CefDevToolsController::DispatchProtocolMessage( return; } - base::StringPiece str_message(reinterpret_cast(message.data()), - message.size()); + std::string_view str_message(reinterpret_cast(message.data()), + message.size()); if (!devtools_util::ProtocolParser::IsValidMessage(str_message)) { LOG(WARNING) << "Invalid message: " << str_message.substr(0, 100); return; diff --git a/libcef/browser/devtools/devtools_controller.h b/libcef/browser/devtools/devtools_controller.h index 52790d676..4d443a7af 100644 --- a/libcef/browser/devtools/devtools_controller.h +++ b/libcef/browser/devtools/devtools_controller.h @@ -7,13 +7,12 @@ #include -#include "content/public/browser/devtools_agent_host_client.h" - #include "base/containers/span.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/values.h" +#include "content/public/browser/devtools_agent_host_client.h" namespace content { class WebContents; @@ -24,12 +23,12 @@ class CefDevToolsController : public content::DevToolsAgentHostClient { class Observer : public base::CheckedObserver { public: // See CefDevToolsMessageObserver documentation. - virtual bool OnDevToolsMessage(const base::StringPiece& message) = 0; + virtual bool OnDevToolsMessage(const std::string_view& message) = 0; virtual void OnDevToolsMethodResult(int message_id, bool success, - const base::StringPiece& result) = 0; - virtual void OnDevToolsEvent(const base::StringPiece& method, - const base::StringPiece& params) = 0; + const std::string_view& result) = 0; + virtual void OnDevToolsEvent(const std::string_view& method, + const std::string_view& params) = 0; virtual void OnDevToolsAgentAttached() = 0; virtual void OnDevToolsAgentDetached() = 0; @@ -48,7 +47,7 @@ class CefDevToolsController : public content::DevToolsAgentHostClient { ~CefDevToolsController() override; // See CefBrowserHost methods of the same name for documentation. - bool SendDevToolsMessage(const base::StringPiece& message); + bool SendDevToolsMessage(const std::string_view& message); int ExecuteDevToolsMethod(int message_id, const std::string& method, const base::Value::Dict* params); diff --git a/libcef/browser/devtools/devtools_protocol_manager.cc b/libcef/browser/devtools/devtools_protocol_manager.cc index 4815b9fa4..d8c89c87f 100644 --- a/libcef/browser/devtools/devtools_protocol_manager.cc +++ b/libcef/browser/devtools/devtools_protocol_manager.cc @@ -50,7 +50,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration, private: // CefDevToolsController::Observer methods: - bool OnDevToolsMessage(const base::StringPiece& message) override { + bool OnDevToolsMessage(const std::string_view& message) override { CEF_REQUIRE_UIT(); return observer_->OnDevToolsMessage(browser_, message.data(), message.size()); @@ -58,14 +58,14 @@ class CefDevToolsRegistrationImpl : public CefRegistration, void OnDevToolsMethodResult(int message_id, bool success, - const base::StringPiece& result) override { + const std::string_view& result) override { CEF_REQUIRE_UIT(); observer_->OnDevToolsMethodResult(browser_, message_id, success, result.data(), result.size()); } - void OnDevToolsEvent(const base::StringPiece& method, - const base::StringPiece& params) override { + void OnDevToolsEvent(const std::string_view& method, + const std::string_view& params) override { CEF_REQUIRE_UIT(); observer_->OnDevToolsEvent(browser_, std::string(method), params.data(), params.size()); @@ -119,7 +119,7 @@ bool CefDevToolsProtocolManager::SendDevToolsMessage(const void* message, } return devtools_controller_->SendDevToolsMessage( - base::StringPiece(static_cast(message), message_size)); + std::string_view(static_cast(message), message_size)); } int CefDevToolsProtocolManager::ExecuteDevToolsMethod( diff --git a/libcef/browser/devtools/devtools_util.cc b/libcef/browser/devtools/devtools_util.cc index 1ba53b124..d4228b39f 100644 --- a/libcef/browser/devtools/devtools_util.cc +++ b/libcef/browser/devtools/devtools_util.cc @@ -11,16 +11,16 @@ namespace devtools_util { namespace { -bool IsValidDictionary(const base::StringPiece& str, bool allow_empty) { +bool IsValidDictionary(const std::string_view& str, bool allow_empty) { return str.length() >= (allow_empty ? 2 : 3) && str[0] == '{' && str[str.length() - 1] == '}'; } // Example: // {"method":"Target.targetDestroyed","params":{"targetId":"1234..."}} -bool ParseEvent(const base::StringPiece& message, - base::StringPiece& method, - base::StringPiece& params) { +bool ParseEvent(const std::string_view& message, + std::string_view& method, + std::string_view& params) { static const char kMethodStart[] = "{\"method\":\""; static const char kMethodEnd[] = "\""; static const char kParamsStart[] = ",\"params\":"; @@ -31,7 +31,7 @@ bool ParseEvent(const base::StringPiece& message, const size_t method_start = sizeof(kMethodStart) - 1; const size_t method_end = message.find(kMethodEnd, method_start); - if (method_end == base::StringPiece::npos) { + if (method_end == std::string_view::npos) { return false; } method = message.substr(method_start, method_end - method_start); @@ -42,9 +42,9 @@ bool ParseEvent(const base::StringPiece& message, size_t remainder_start = method_end + sizeof(kMethodEnd) - 1; if (remainder_start == message.size() - 1) { // No more contents. - params = base::StringPiece(); + params = std::string_view(); } else { - const base::StringPiece& remainder = message.substr(remainder_start); + const std::string_view& remainder = message.substr(remainder_start); if (base::StartsWith(remainder, kParamsStart)) { // Stop immediately before the message closing bracket. remainder_start += sizeof(kParamsStart) - 1; @@ -67,10 +67,10 @@ bool ParseEvent(const base::StringPiece& message, // {"id":3,"result":{}} // {"id":4,"result":{"debuggerId":"-2193881606781505058.81393575456727957"}} // {"id":5,"error":{"code":-32000,"message":"Not supported"}} -bool ParseResult(const base::StringPiece& message, +bool ParseResult(const std::string_view& message, int& message_id, bool& success, - base::StringPiece& result) { + std::string_view& result) { static const char kIdStart[] = "{\"id\":"; static const char kIdEnd[] = ","; static const char kResultStart[] = "\"result\":"; @@ -82,16 +82,16 @@ bool ParseResult(const base::StringPiece& message, const size_t id_start = sizeof(kIdStart) - 1; const size_t id_end = message.find(kIdEnd, id_start); - if (id_end == base::StringPiece::npos) { + if (id_end == std::string_view::npos) { return false; } - const base::StringPiece& id_str = message.substr(id_start, id_end - id_start); + const std::string_view& id_str = message.substr(id_start, id_end - id_start); if (id_str.empty() || !base::StringToInt(id_str, &message_id)) { return false; } size_t remainder_start = id_end + sizeof(kIdEnd) - 1; - const base::StringPiece& remainder = message.substr(remainder_start); + const std::string_view& remainder = message.substr(remainder_start); if (base::StartsWith(remainder, kResultStart)) { // Stop immediately before the message closing bracket. remainder_start += sizeof(kResultStart) - 1; @@ -119,11 +119,11 @@ bool ParseResult(const base::StringPiece& message, } // namespace // static -bool ProtocolParser::IsValidMessage(const base::StringPiece& message) { +bool ProtocolParser::IsValidMessage(const std::string_view& message) { return IsValidDictionary(message, /*allow_empty=*/false); } -bool ProtocolParser::Initialize(const base::StringPiece& message) { +bool ProtocolParser::Initialize(const std::string_view& message) { if (status_ != UNINITIALIZED) { return false; } diff --git a/libcef/browser/devtools/devtools_util.h b/libcef/browser/devtools/devtools_util.h index 848e1684e..9a35f1465 100644 --- a/libcef/browser/devtools/devtools_util.h +++ b/libcef/browser/devtools/devtools_util.h @@ -6,7 +6,7 @@ #define CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_UTIL_H_ #pragma once -#include "base/strings/string_piece.h" +#include namespace devtools_util { @@ -31,10 +31,10 @@ struct ProtocolParser { ProtocolParser() = default; // Checks for a non-empty JSON dictionary. - static bool IsValidMessage(const base::StringPiece& message); + static bool IsValidMessage(const std::string_view& message); // Returns false if already initialized. - bool Initialize(const base::StringPiece& message); + bool Initialize(const std::string_view& message); bool IsInitialized() const { return status_ != UNINITIALIZED; } bool IsEvent() const { return status_ == EVENT; } @@ -45,7 +45,7 @@ struct ProtocolParser { // For event messages: // "method" string: - base::StringPiece method_; + std::string_view method_; // For result messages: // "id" int: @@ -55,7 +55,7 @@ struct ProtocolParser { // For both: // "params", "result" or "error" dictionary: - base::StringPiece params_; + std::string_view params_; private: enum Status { @@ -69,4 +69,4 @@ struct ProtocolParser { } // namespace devtools_util -#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_UTIL_H_ \ No newline at end of file +#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_UTIL_H_ diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 2e8a9270a..01fba44ca 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -59,7 +59,7 @@ namespace { // Implementation based on ComponentLoader::ParseManifest. std::optional ParseManifest( - base::StringPiece manifest_contents) { + std::string_view manifest_contents) { JSONStringValueDeserializer deserializer(manifest_contents); std::unique_ptr manifest = deserializer.Deserialize(nullptr, nullptr); diff --git a/libcef/browser/media_stream_registrar.cc b/libcef/browser/media_stream_registrar.cc index bdf3dd922..4a3de13f9 100644 --- a/libcef/browser/media_stream_registrar.cc +++ b/libcef/browser/media_stream_registrar.cc @@ -39,7 +39,8 @@ class CefMediaStreamUI : public content::MediaStreamUI { void OnDeviceStoppedForSourceChange( const std::string& label, const content::DesktopMediaID& old_media_id, - const content::DesktopMediaID& new_media_id) override {} + const content::DesktopMediaID& new_media_id, + bool captured_surface_control_active) override {} void OnDeviceStopped(const std::string& label, const content::DesktopMediaID& media_id) override {} diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 4a1f40d61..31055c329 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -500,7 +500,7 @@ class CefBrowserURLRequest::Context } // SimpleURLLoaderStreamConsumer methods: - void OnDataReceived(base::StringPiece string_piece, + void OnDataReceived(std::string_view string_piece, base::OnceClosure resume) override { DCHECK(CalledOnValidThread()); DCHECK_EQ(status_, UR_IO_PENDING); diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index e16182473..49b293d75 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -253,7 +253,8 @@ void LoadCookies(const CefBrowserContext::Getter& browser_context_getter, !request.trusted_params->isolation_info.IsEmpty()) { partition_key_collection = net::CookiePartitionKeyCollection::FromOptional( net::CookiePartitionKey::FromNetworkIsolationKey( - request.trusted_params->isolation_info.network_isolation_key())); + request.trusted_params->isolation_info.network_isolation_key(), + request.site_for_cookies, net::SchemefulSite(request.url))); } CEF_POST_TASK( @@ -286,7 +287,7 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter, response_date = base::Time(); } - const base::StringPiece name(net_service::kHTTPSetCookieHeaderName); + const std::string_view name(net_service::kHTTPSetCookieHeaderName); std::string cookie_string; size_t iter = 0; net::CookieList allowed_cookies; @@ -300,7 +301,8 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter, request.url, cookie_string, base::Time::Now(), std::make_optional(response_date), /*cookie_partition_key=*/std::nullopt, - /*block_truncated=*/true, &returned_status); + /*block_truncated=*/true, net::CookieSourceType::kHTTP, + &returned_status); if (!returned_status.IsInclude()) { continue; } diff --git a/libcef/browser/net_service/cookie_manager_impl.cc b/libcef/browser/net_service/cookie_manager_impl.cc index 2ae1ef95b..a7fcc6d41 100644 --- a/libcef/browser/net_service/cookie_manager_impl.cc +++ b/libcef/browser/net_service/cookie_manager_impl.cc @@ -303,7 +303,7 @@ bool CefCookieManagerImpl::SetCookieInternal( /*creation_time=*/base::Time(), expiration_time, /*last_access_time=*/base::Time(), cookie.secure ? true : false, cookie.httponly ? true : false, same_site, priority, - /*partition_key=*/std::nullopt); + /*partition_key=*/std::nullopt, /*status=*/nullptr); if (!canonical_cookie) { SetCookieCallbackImpl( diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 4f77e1925..55270725c 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -6,14 +6,14 @@ #ifndef CEF_LIBCEF_BROWSER_NET_SERVICE_PROXY_URL_LOADER_FACTORY_H_ #define CEF_LIBCEF_BROWSER_NET_SERVICE_PROXY_URL_LOADER_FACTORY_H_ -#include "libcef/browser/net_service/stream_reader_url_loader.h" - #include +#include + +#include "libcef/browser/net_service/stream_reader_url_loader.h" #include "base/containers/unique_ptr_adapters.h" #include "base/functional/callback.h" #include "base/hash/hash.h" -#include "base/strings/string_piece.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" #include "mojo/public/cpp/bindings/pending_receiver.h" diff --git a/libcef/browser/net_service/response_filter_wrapper.cc b/libcef/browser/net_service/response_filter_wrapper.cc index bc185a1b3..11cf2f272 100644 --- a/libcef/browser/net_service/response_filter_wrapper.cc +++ b/libcef/browser/net_service/response_filter_wrapper.cc @@ -215,7 +215,7 @@ void ResponseFilterWrapper::Write(std::unique_ptr data) { write_pending_ = true; - base::StringPiece string_piece(*data); + std::string_view string_piece(*data); forwarder_->Write(std::make_unique( string_piece, mojo::StringDataSource::AsyncWritingMode:: STRING_STAYS_VALID_UNTIL_COMPLETION), diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index adb48a75a..8f0cabed3 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -45,8 +45,8 @@ scoped_refptr URLLoaderFactoryGetter::Create( // Allow DevTools to potentially inject itself into the proxy pipe. content::devtools_instrumentation::WillCreateURLLoaderFactoryParams:: ForFrame(static_cast(render_frame_host)) - .Run(false /* is_navigation */, false /* is_download */, - factory_builder, nullptr /* factory_override */); + .Run(/*is_navigation=*/false, /*is_download=*/false, + factory_builder, /*factory_override=*/nullptr); } auto browser_client = CefAppManager::Get()->GetContentClient()->browser(); @@ -55,11 +55,11 @@ scoped_refptr URLLoaderFactoryGetter::Create( browser_client->WillCreateURLLoaderFactory( browser_context, render_frame_host, render_process_id, content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, - url::Origin(), std::nullopt /* navigation_id */, ukm::SourceIdObj(), - factory_builder, nullptr /* header_client */, - nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, - nullptr /* factory_override */, - nullptr /* navigation_response_task_runner */); + url::Origin(), net::IsolationInfo(), /*navigation_id=*/std::nullopt, + ukm::SourceIdObj(), factory_builder, /*header_client=*/nullptr, + /*bypass_redirect_checks=*/nullptr, /*disable_secure_dns=*/nullptr, + /*factory_override=*/nullptr, + /*navigation_response_task_runner=*/nullptr); return base::WrapRefCounted(new URLLoaderFactoryGetter( loader_factory->Clone(), std::move(factory_builder))); diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index 6a12762f7..1c9508229 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -328,17 +328,21 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( gfx::PointF transformed_pt; // Some random crashes occured when GetWeakPtr is called on a null pointer - // that is the return of GetRenderWidgetHostAtPoint As the root cause is not - // yet understood (no reproducible scenario yet), the current fix is only a - // protection against null pointer dereferencing. - content::RenderWidgetHostImpl* ptr_current_rwh_for_drag = - web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( + // that is the return of GetRenderWidgetHostViewInputAtPoint. As the root + // cause is not yet understood (no reproducible scenario yet), the current fix + // is only a protection against null pointer dereferencing. + auto* view = + web_contents->GetInputEventRouter()->GetRenderWidgetHostViewInputAtPoint( web_contents->GetRenderViewHost()->GetWidget()->GetView(), gfx::PointF(client_pt), &transformed_pt); - if (!ptr_current_rwh_for_drag) { + if (!view) { return; } - current_rwh_for_drag_ = ptr_current_rwh_for_drag->GetWeakPtr(); + auto* target_rwh = content::RenderWidgetHostImpl::From( + static_cast(view) + ->GetRenderWidgetHost()); + + current_rwh_for_drag_ = target_rwh->GetWeakPtr(); current_rvh_for_drag_ = web_contents->GetRenderViewHost(); @@ -387,10 +391,13 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragOver( GetScreenPoint(client_pt, /*want_dip_coords=*/false); gfx::PointF transformed_pt; - content::RenderWidgetHostImpl* target_rwh = - web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( + auto* view = + web_contents->GetInputEventRouter()->GetRenderWidgetHostViewInputAtPoint( web_contents->GetRenderViewHost()->GetWidget()->GetView(), gfx::PointF(client_pt), &transformed_pt); + auto* target_rwh = content::RenderWidgetHostImpl::From( + static_cast(view) + ->GetRenderWidgetHost()); if (target_rwh != current_rwh_for_drag_.get()) { if (current_rwh_for_drag_) { @@ -458,10 +465,13 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) { GetScreenPoint(client_pt, /*want_dip_coords=*/false); gfx::PointF transformed_pt; - content::RenderWidgetHostImpl* target_rwh = - web_contents->GetInputEventRouter()->GetRenderWidgetHostAtPoint( + auto* view = + web_contents->GetInputEventRouter()->GetRenderWidgetHostViewInputAtPoint( web_contents->GetRenderViewHost()->GetWidget()->GetView(), gfx::PointF(client_pt), &transformed_pt); + auto* target_rwh = content::RenderWidgetHostImpl::From( + static_cast(view) + ->GetRenderWidgetHost()); if (target_rwh != current_rwh_for_drag_.get()) { if (current_rwh_for_drag_) { diff --git a/libcef/browser/permission_prompt.cc b/libcef/browser/permission_prompt.cc index 5904aadca..e9af2e862 100644 --- a/libcef/browser/permission_prompt.cc +++ b/libcef/browser/permission_prompt.cc @@ -129,6 +129,10 @@ class CefPermissionPrompt : public permissions::PermissionPrompt { return std::nullopt; } bool ShouldFinalizeRequestAfterDecided() const override { return true; } + std::vector GetPromptVariants() + const override { + return {}; + } private: // We don't expose AcceptThisTime() because it's a special case for diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 3ab50382e..45034ce66 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -27,7 +27,9 @@ #include "chrome/browser/preloading/preloading_prefs.h" #include "chrome/browser/printing/print_preview_sticky_settings.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_key.h" #include "chrome/browser/ssl/ssl_config_service_manager.h" +#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/browser_view_prefs.h" #include "chrome/browser/ui/webui/accessibility/accessibility_ui.h" @@ -61,7 +63,8 @@ #include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/safe_search_api/safe_search_util.h" #include "components/spellcheck/browser/pref_names.h" -#include "components/supervised_user/core/common/buildflags.h" +#include "components/supervised_user/core/browser/supervised_user_pref_store.h" +#include "components/supervised_user/core/browser/supervised_user_settings_service.h" #include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable_factory.h" #include "components/unified_consent/unified_consent_service.h" @@ -77,13 +80,6 @@ #include "components/os_crypt/sync/os_crypt.h" #endif -#if BUILDFLAG(ENABLE_SUPERVISED_USERS) -#include "chrome/browser/profiles/profile_key.h" -#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h" -#include "components/supervised_user/core/browser/supervised_user_pref_store.h" -#include "components/supervised_user/core/browser/supervised_user_settings_service.h" -#endif - namespace browser_prefs { namespace { @@ -170,7 +166,6 @@ std::unique_ptr CreatePrefService(Profile* profile, factory.set_user_prefs(cef_pref_store.get()); } -#if BUILDFLAG(ENABLE_SUPERVISED_USERS) if (profile) { // Used to store supervised user preferences. auto* supervised_user_settings = @@ -191,7 +186,6 @@ std::unique_ptr CreatePrefService(Profile* profile, DCHECK(supervised_user_prefs->IsInitializationComplete()); factory.set_supervised_user_prefs(supervised_user_prefs); } -#endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) // Registry that will be populated with all known preferences. Preferences // are registered with default values that may be changed via a *PrefStore. diff --git a/libcef/browser/prefs/pref_store.cc b/libcef/browser/prefs/pref_store.cc index e465893ad..35d00b684 100644 --- a/libcef/browser/prefs/pref_store.cc +++ b/libcef/browser/prefs/pref_store.cc @@ -12,7 +12,7 @@ CefPrefStore::CefPrefStore() = default; -bool CefPrefStore::GetValue(base::StringPiece key, +bool CefPrefStore::GetValue(std::string_view key, const base::Value** value) const { return prefs_.GetValue(key, value); } diff --git a/libcef/browser/prefs/pref_store.h b/libcef/browser/prefs/pref_store.h index 92ea86409..d17122b5c 100644 --- a/libcef/browser/prefs/pref_store.h +++ b/libcef/browser/prefs/pref_store.h @@ -24,7 +24,7 @@ class CefPrefStore : public PersistentPrefStore { CefPrefStore& operator=(const CefPrefStore&) = delete; // Overriden from PrefStore. - bool GetValue(base::StringPiece key, + bool GetValue(std::string_view key, const base::Value** result) const override; base::Value::Dict GetValues() const override; void AddObserver(PrefStore::Observer* observer) override; diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 75b054584..3e6244d92 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -89,3 +89,7 @@ bool CefSpeechRecognitionManagerDelegate::FilterProfanities( int render_process_id) { return filter_profanities_; } + +void CefSpeechRecognitionManagerDelegate::BindSpeechRecognitionContext( + mojo::PendingReceiver + recognition_receiver) {} diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index 4897495c9..9b8969adf 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -52,6 +52,9 @@ class CefSpeechRecognitionManagerDelegate override; content::SpeechRecognitionEventListener* GetEventListener() override; bool FilterProfanities(int render_process_id) override; + void BindSpeechRecognitionContext( + mojo::PendingReceiver receiver) + override; private: bool filter_profanities_; diff --git a/libcef/browser/test/test_server_impl.cc b/libcef/browser/test/test_server_impl.cc index 7a10f4ede..a0c1396af 100644 --- a/libcef/browser/test/test_server_impl.cc +++ b/libcef/browser/test/test_server_impl.cc @@ -33,9 +33,9 @@ class CefTestServerConnectionImpl : public CefTestServerConnection { size_t data_size) override { auto response = std::make_unique(); response->set_code(net::HTTP_OK); - response->set_content_type(base::StringPiece(content_type.ToString())); + response->set_content_type(std::string_view(content_type.ToString())); response->set_content( - base::StringPiece(reinterpret_cast(data), data_size)); + std::string_view(reinterpret_cast(data), data_size)); SendBasicHttpResponse(std::move(response)); } @@ -48,8 +48,8 @@ class CefTestServerConnectionImpl : public CefTestServerConnection { void SendHttp500Response(const CefString& error_message) override { auto response = std::make_unique(); response->set_code(net::HTTP_INTERNAL_SERVER_ERROR); - response->set_content_type(base::StringPiece("text/html")); - response->set_content(base::StringPiece(error_message.ToString())); + response->set_content_type(std::string_view("text/html")); + response->set_content(std::string_view(error_message.ToString())); SendBasicHttpResponse(std::move(response)); } @@ -60,9 +60,9 @@ class CefTestServerConnectionImpl : public CefTestServerConnection { const HeaderMap& extra_headers) override { auto response = std::make_unique(); response->set_code(static_cast(response_code)); - response->set_content_type(base::StringPiece(content_type.ToString())); + response->set_content_type(std::string_view(content_type.ToString())); response->set_content( - base::StringPiece(reinterpret_cast(data), data_size)); + std::string_view(reinterpret_cast(data), data_size)); for (const auto& [key, value] : extra_headers) { response->AddCustomHeader(key.ToString(), value.ToString()); } diff --git a/libcef/browser/views/view_impl.h b/libcef/browser/views/view_impl.h index 78b5e5fd3..c13d57b76 100644 --- a/libcef/browser/views/view_impl.h +++ b/libcef/browser/views/view_impl.h @@ -299,6 +299,7 @@ #include "base/logging.h" #include "base/values.h" #include "ui/gfx/color_palette.h" +#include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/view.h" @@ -667,7 +668,7 @@ CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsFocusable() { CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsAccessibilityFocusable() { CEF_REQUIRE_VALID_RETURN(false); - return root_view()->IsAccessibilityFocusable(); + return root_view()->GetViewAccessibility().IsAccessibilityFocusable(); } CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::RequestFocus() { diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index cc6827942..7a03f2531 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -7,6 +7,8 @@ #include +#include + #include "include/cef_stream.h" #include "include/cef_version.h" #include "libcef/common/app_manager.h" @@ -18,7 +20,6 @@ #include "base/json/json_reader.h" #include "base/logging.h" #include "base/path_service.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index e194b4fd1..5cce052a5 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -299,7 +299,7 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { if (settings_->log_items == LOG_ITEMS_NONE) { log_items_str = std::string(switches::kLogItems_None); } else { - std::vector added_items; + std::vector added_items; if (settings_->log_items & LOG_ITEMS_FLAG_PROCESS_ID) { added_items.emplace_back(switches::kLogItems_PId); } @@ -472,9 +472,7 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { #endif // BUILDFLAG(IS_WIN) if (dest == LoggingDest::kFile) { - log_settings.log_file_path = log_file.value().c_str(); - } else { - log_settings.log_file_path = nullptr; + log_settings.log_file_path = log_file.value(); } log_settings.lock_log = logging::DONT_LOCK_LOG_FILE; diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index c6cdf52c5..4e6724e6e 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -4,6 +4,7 @@ #include "libcef/common/crash_reporter_client.h" +#include #include #if BUILDFLAG(IS_WIN) @@ -14,7 +15,6 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -250,7 +250,7 @@ CefCrashReporterClient* g_crash_reporter_client = nullptr; const char kKeyMapDelim = ','; -std::string NormalizeCrashKey(const base::StringPiece& key) { +std::string NormalizeCrashKey(const std::string_view& key) { std::string str(key); std::replace(str.begin(), str.end(), kKeyMapDelim, '-'); if (str.length() > crashpad::Annotation::kNameMaxLength) { @@ -297,7 +297,7 @@ int __declspec(dllexport) __cdecl SetCrashKeyValueImpl(const char* key, size_t value_size) { if (g_crash_reporter_client) { return g_crash_reporter_client->SetCrashKeyValue( - base::StringPiece(key, key_size), base::StringPiece(value, value_size)); + std::string_view(key, key_size), std::string_view(value, value_size)); } return 0; } @@ -537,7 +537,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() { for (auto& id : ids) { size_t length = std::min(map_keys.size() - offset, crashpad::Annotation::kValueMaxSize); - id.Set(base::StringPiece(map_keys.data() + offset, length)); + id.Set(std::string_view(map_keys.data() + offset, length)); offset += length; if (offset >= map_keys.size()) { break; @@ -751,21 +751,21 @@ bool CefCrashReporterClient::EnableBrowserCrashForwarding() { IDKEY(n "-V"), IDKEY(n "-W"), IDKEY(n "-X"), IDKEY(n "-Y"), \ IDKEY(n "-Z") -#define IDKEY_FUNCTION(name, size_) \ - static_assert(size_ <= crashpad::Annotation::kValueMaxSize, \ - "Annotation size is too large."); \ - bool Set##name##Annotation(size_t index, const base::StringPiece& value) { \ - using IDKey = crash_reporter::CrashKeyString; \ - static IDKey ids[] = {IDKEY_ENTRIES(#name)}; \ - if (index < std::size(ids)) { \ - if (value.empty()) { \ - ids[index].Clear(); \ - } else { \ - ids[index].Set(value); \ - } \ - return true; \ - } \ - return false; \ +#define IDKEY_FUNCTION(name, size_) \ + static_assert(size_ <= crashpad::Annotation::kValueMaxSize, \ + "Annotation size is too large."); \ + bool Set##name##Annotation(size_t index, const std::string_view& value) { \ + using IDKey = crash_reporter::CrashKeyString; \ + static IDKey ids[] = {IDKEY_ENTRIES(#name)}; \ + if (index < std::size(ids)) { \ + if (value.empty()) { \ + ids[index].Clear(); \ + } else { \ + ids[index].Set(value); \ + } \ + return true; \ + } \ + return false; \ } // The first argument must be kept synchronized with the logic in @@ -775,8 +775,8 @@ IDKEY_FUNCTION(S, 64) IDKEY_FUNCTION(M, 256) IDKEY_FUNCTION(L, 1024) -bool CefCrashReporterClient::SetCrashKeyValue(const base::StringPiece& key, - const base::StringPiece& value) { +bool CefCrashReporterClient::SetCrashKeyValue(const std::string_view& key, + const std::string_view& value) { if (key.empty() || crash_keys_.empty()) { return false; } diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 2fd9c73d4..f5352c3f4 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -6,11 +6,11 @@ #define CEF_LIBCEF_COMMON_CRASH_REPORTER_CLIENT_H_ #include +#include #include #include "include/cef_version.h" -#include "base/strings/string_piece.h" #include "base/synchronization/lock.h" #include "build/build_config.h" #include "components/crash/core/app/crash_reporter_client.h" @@ -78,8 +78,8 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { #endif // Set or clear a crash key value. - bool SetCrashKeyValue(const base::StringPiece& key, - const base::StringPiece& value); + bool SetCrashKeyValue(const std::string_view& key, + const std::string_view& value); private: bool has_crash_config_file_ = false; diff --git a/libcef/common/crash_reporting.cc b/libcef/common/crash_reporting.cc index b827119d4..997b1cba5 100644 --- a/libcef/common/crash_reporting.cc +++ b/libcef/common/crash_reporting.cc @@ -4,6 +4,8 @@ #include "libcef/common/crash_reporting.h" +#include + #include "include/cef_crash_util.h" #include "libcef/common/cef_switches.h" #include "libcef/features/runtime.h" @@ -13,7 +15,6 @@ #include "base/debug/crash_logging.h" #include "base/logging.h" #include "base/stl_util.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "chrome/common/crash_keys.h" #include "components/crash/core/common/crash_key.h" @@ -51,8 +52,8 @@ typedef int(__cdecl* SetCrashKeyValue)(const char*, // int __declspec(dllexport) __cdecl IsCrashReportingEnabledImpl. typedef int(__cdecl* IsCrashReportingEnabled)(); -bool SetCrashKeyValueTrampoline(const base::StringPiece& key, - const base::StringPiece& value) { +bool SetCrashKeyValueTrampoline(const std::string_view& key, + const std::string_view& value) { static SetCrashKeyValue set_crash_key = []() { HMODULE elf_module = GetModuleHandle(kChromeElfDllName); return reinterpret_cast( @@ -176,8 +177,8 @@ bool Enabled() { return g_crash_reporting_enabled; } -bool SetCrashKeyValue(const base::StringPiece& key, - const base::StringPiece& value) { +bool SetCrashKeyValue(const std::string_view& key, + const std::string_view& value) { if (!g_crash_reporting_enabled) { return false; } diff --git a/libcef/common/crash_reporting.h b/libcef/common/crash_reporting.h index 36f534b71..557889005 100644 --- a/libcef/common/crash_reporting.h +++ b/libcef/common/crash_reporting.h @@ -3,8 +3,8 @@ // governed by a BSD-style license that can be found in the LICENSE file. #include +#include -#include "base/strings/string_piece.h" #include "build/build_config.h" namespace base { @@ -17,8 +17,8 @@ namespace crash_reporting { bool Enabled(); // Set or clear a crash key value. -bool SetCrashKeyValue(const base::StringPiece& key, - const base::StringPiece& value); +bool SetCrashKeyValue(const std::string_view& key, + const std::string_view& value); // Functions are called from similarly named methods in AlloyMainDelegate. diff --git a/libcef/common/extensions/api/_api_features.json b/libcef/common/extensions/api/_api_features.json index db253cfaa..645869885 100644 --- a/libcef/common/extensions/api/_api_features.json +++ b/libcef/common/extensions/api/_api_features.json @@ -14,7 +14,7 @@ // Required by the PDF extension which is hosted in a guest view. "contentSettings": { "dependencies": ["permission:contentSettings"], - "contexts": ["blessed_extension"] + "contexts": ["privileged_extension"] }, "mimeHandlerViewGuestInternal": { "internal": true, @@ -24,12 +24,12 @@ }, "pdfViewerPrivate": { "dependencies": ["permission:pdfViewerPrivate"], - "contexts": ["blessed_extension"] + "contexts": ["privileged_extension"] }, "resourcesPrivate": [ { "dependencies": ["permission:resourcesPrivate"], - "contexts": ["blessed_extension"] + "contexts": ["privileged_extension"] }, { "channel": "stable", @@ -40,7 +40,7 @@ "tabs": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], - "contexts": ["blessed_extension"], + "contexts": ["privileged_extension"], "disallow_for_service_workers": false } } diff --git a/libcef/common/extensions/chrome_generated_schemas.cc b/libcef/common/extensions/chrome_generated_schemas.cc index b7b04055f..c8b3be30a 100644 --- a/libcef/common/extensions/chrome_generated_schemas.cc +++ b/libcef/common/extensions/chrome_generated_schemas.cc @@ -11,9 +11,9 @@ namespace extensions::api::cef { // static -base::StringPiece ChromeGeneratedSchemas::Get(const std::string& name) { +std::string_view ChromeGeneratedSchemas::Get(const std::string& name) { if (!ChromeFunctionRegistry::IsSupported(name)) { - return base::StringPiece(); + return std::string_view(); } return extensions::api::ChromeGeneratedSchemas::Get(name); } diff --git a/libcef/common/extensions/chrome_generated_schemas.h b/libcef/common/extensions/chrome_generated_schemas.h index cd8ea9d1b..67930c20c 100644 --- a/libcef/common/extensions/chrome_generated_schemas.h +++ b/libcef/common/extensions/chrome_generated_schemas.h @@ -11,8 +11,7 @@ #include #include - -#include "base/strings/string_piece.h" +#include namespace extensions::api::cef { @@ -22,7 +21,7 @@ class ChromeGeneratedSchemas { static bool IsGenerated(std::string name); // Gets the API schema named |name|. - static base::StringPiece Get(const std::string& name); + static std::string_view Get(const std::string& name); }; } // namespace extensions::api::cef diff --git a/libcef/common/json_impl.cc b/libcef/common/json_impl.cc index ae88b922e..2a88f2c1b 100644 --- a/libcef/common/json_impl.cc +++ b/libcef/common/json_impl.cc @@ -48,7 +48,7 @@ CefRefPtr CefParseJSON(const void* json, return nullptr; } std::optional parse_result = base::JSONReader::Read( - base::StringPiece(static_cast(json), json_size), + std::string_view(static_cast(json), json_size), GetJSONReaderOptions(options)); if (parse_result) { return new CefValueImpl(std::move(parse_result.value())); diff --git a/libcef/common/parser_impl.cc b/libcef/common/parser_impl.cc index d939fb367..1c0a8acf1 100644 --- a/libcef/common/parser_impl.cc +++ b/libcef/common/parser_impl.cc @@ -132,7 +132,7 @@ CefString CefBase64Encode(const void* data, size_t data_size) { return CefString(); } - base::StringPiece input(static_cast(data), data_size); + std::string_view input(static_cast(data), data_size); return base::Base64Encode(input); } diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index b0c939b68..4230eb935 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -80,7 +80,7 @@ int GetCacheControlHeaderPolicy(CefRequest::HeaderMap headerMap) { if (!line.empty()) { HttpHeaderUtils::MakeASCIILower(&line); - std::vector pieces = base::SplitStringPiece( + std::vector pieces = base::SplitStringPiece( line, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (const auto& piece : pieces) { if (base::EqualsCaseInsensitiveASCII(piece, diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index cc7d32c91..31015e7aa 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -43,7 +43,7 @@ std::optional CefResourceBundleDelegate::LoadDataResourceString( bool CefResourceBundleDelegate::GetRawDataResource( int resource_id, ui::ResourceScaleFactor scale_factor, - base::StringPiece* value) const { + std::string_view* value) const { auto application = CefAppManager::Get()->GetApplication(); if (application) { CefRefPtr handler = @@ -55,10 +55,10 @@ bool CefResourceBundleDelegate::GetRawDataResource( if (handler->GetDataResourceForScale( resource_id, static_cast(scale_factor), data, data_size)) { - *value = base::StringPiece(static_cast(data), data_size); + *value = std::string_view(static_cast(data), data_size); } } else if (handler->GetDataResource(resource_id, data, data_size)) { - *value = base::StringPiece(static_cast(data), data_size); + *value = std::string_view(static_cast(data), data_size); } } } diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index 5d552da5f..c66e38534 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -35,7 +35,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { std::optional LoadDataResourceString(int resource_id) override; bool GetRawDataResource(int resource_id, ui::ResourceScaleFactor scale_factor, - base::StringPiece* value) const override; + std::string_view* value) const override; bool GetLocalizedString(int message_id, std::u16string* value) const override; private: diff --git a/libcef/common/string_types_impl.cc b/libcef/common/string_types_impl.cc index ae85c0e82..ab8bda135 100644 --- a/libcef/common/string_types_impl.cc +++ b/libcef/common/string_types_impl.cc @@ -26,7 +26,7 @@ void string_utf16_dtor(char16_t* str) { } // Originally from base/strings/utf_string_conversions.cc -std::wstring ASCIIToWide(const base::StringPiece& ascii) { +std::wstring ASCIIToWide(const std::string_view& ascii) { DCHECK(base::IsStringASCII(ascii)) << ascii; return std::wstring(ascii.begin(), ascii.end()); } diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index 8bcbf5703..688493630 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -795,7 +795,7 @@ bool CefDictionaryValueImpl::Clear() { bool CefDictionaryValueImpl::HasKey(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, 0); - return const_value().GetDict().contains(base::StringPiece(key.ToString())); + return const_value().GetDict().contains(std::string_view(key.ToString())); } bool CefDictionaryValueImpl::GetKeys(KeyList& keys) { @@ -817,7 +817,7 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID); const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value) { switch (value->type()) { case base::Value::Type::NONE: @@ -846,7 +846,7 @@ CefRefPtr CefDictionaryValueImpl::GetValue(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value) { return CefValueImpl::GetOrCreateRefOrCopy(const_cast(value), mutable_value_unchecked(), @@ -862,7 +862,7 @@ bool CefDictionaryValueImpl::GetBool(const CefString& key) { bool ret_value = false; const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_bool()) { ret_value = value->GetBool(); } @@ -876,7 +876,7 @@ int CefDictionaryValueImpl::GetInt(const CefString& key) { int ret_value = 0; const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_int()) { ret_value = value->GetInt(); } @@ -890,7 +890,7 @@ double CefDictionaryValueImpl::GetDouble(const CefString& key) { double ret_value = 0; const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_double()) { ret_value = value->GetDouble(); } @@ -904,7 +904,7 @@ CefString CefDictionaryValueImpl::GetString(const CefString& key) { std::string ret_value; const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_string()) { ret_value = value->GetString(); } @@ -917,7 +917,7 @@ CefRefPtr CefDictionaryValueImpl::GetBinary( CEF_VALUE_VERIFY_RETURN(false, nullptr); const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_blob()) { base::Value* binary_value = const_cast(value); return CefBinaryValueImpl::GetOrCreateRef( @@ -932,7 +932,7 @@ CefRefPtr CefDictionaryValueImpl::GetDictionary( CEF_VALUE_VERIFY_RETURN(false, nullptr); const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_dict()) { base::Value* dict_value = const_cast(value); return CefDictionaryValueImpl::GetOrCreateRef( @@ -946,7 +946,7 @@ CefRefPtr CefDictionaryValueImpl::GetList(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); const base::Value* value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (value && value->is_list()) { base::Value* list_value = const_cast(value); return CefListValueImpl::GetOrCreateRef( @@ -1042,14 +1042,14 @@ bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) { // retrieve the actual Value pointer as it current exists first, for later // comparison purposes. const base::Value* actual_value = - const_value().GetDict().Find(base::StringPiece(key.ToString())); + const_value().GetDict().Find(std::string_view(key.ToString())); if (!actual_value) { return false; } // |actual_value| is no longer valid after this call. std::optional out_value = - mutable_value()->GetDict().Extract(base::StringPiece(key.ToString())); + mutable_value()->GetDict().Extract(std::string_view(key.ToString())); if (!out_value.has_value()) { return false; } @@ -1076,7 +1076,7 @@ base::Value* CefDictionaryValueImpl::SetInternal( // contents of the passed-in base::Value instead of keeping the same object. // Set() then returns the actual Value pointer as it currently exists. base::Value* actual_value = mutable_value()->GetDict().Set( - base::StringPiece(key.ToString()), std::move(*value)); + std::string_view(key.ToString()), std::move(*value)); CHECK(actual_value); // |value| will be deleted when this method returns. Update the controller to diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index a4b765d36..843303132 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -59,6 +59,7 @@ #include "components/content_settings/core/common/content_settings_types.h" #include "components/nacl/common/nacl_constants.h" #include "components/pdf/common/constants.h" +#include "components/pdf/common/pdf_util.h" #include "components/pdf/renderer/internal_plugin_renderer_helpers.h" #include "components/printing/renderer/print_render_frame_helper.h" #include "components/spellcheck/renderer/spellcheck.h" @@ -430,10 +431,11 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin( return true; } -std::unique_ptr +std::unique_ptr AlloyContentRendererClient::GetSupportedKeySystems( + content::RenderFrame* render_frame, media::GetSupportedKeySystemsCB cb) { - return GetChromeKeySystems(std::move(cb)); + return GetChromeKeySystems(render_frame, std::move(cb)); } void AlloyContentRendererClient::RunScriptsAtDocumentStart( diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index 6a6db9e84..5bf95e150 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -20,7 +20,6 @@ #include "chrome/common/plugin.mojom.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/render_thread.h" -#include "media/base/key_systems_support_observer.h" #include "mojo/public/cpp/bindings/generic_pending_receiver.h" #include "services/service_manager/public/cpp/local_interface_provider.h" @@ -100,7 +99,8 @@ class AlloyContentRendererClient uint64_t VisitedLinkHash(std::string_view canonical_url) override; bool IsLinkVisited(uint64_t link_hash) override; bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; - std::unique_ptr GetSupportedKeySystems( + std::unique_ptr GetSupportedKeySystems( + content::RenderFrame* render_frame, media::GetSupportedKeySystemsCB cb) override; void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index ca18cbd22..c78a6cad9 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -18,7 +18,6 @@ #include "extensions/common/permissions/permissions_data.h" #include "extensions/renderer/api/core_extensions_renderer_api_provider.h" #include "extensions/renderer/dispatcher.h" -#include "extensions/renderer/dispatcher_delegate.h" #include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extensions_render_frame_observer.h" #include "extensions/renderer/extensions_renderer_api_provider.h" @@ -87,9 +86,8 @@ bool CefExtensionsRendererClient::ExtensionAPIEnabledForServiceWorkerScript( void CefExtensionsRendererClient::RenderThreadStarted() { content::RenderThread* thread = content::RenderThread::Get(); - extension_dispatcher_ = std::make_unique( - std::make_unique(), - std::move(api_providers_)); + extension_dispatcher_ = + std::make_unique(std::move(api_providers_)); extension_dispatcher_->OnRenderThreadStarted(thread); resource_request_policy_ = std::make_unique( diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 2176b2130..62669fb30 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -358,9 +358,8 @@ void CefFrameImpl::OnDidFinishLoad() { } void CefFrameImpl::OnDraggableRegionsChanged() { - // Match the behavior in ChromeRenderFrameObserver::DraggableRegionsChanged. // Only the main frame is allowed to control draggable regions, to avoid other - // frames manipulate the regions in the browser process. + // frames trying to manipulate the regions in the browser process. if (frame_->Parent() != nullptr) { return; } @@ -376,7 +375,7 @@ void CefFrameImpl::OnDraggableRegionsChanged() { auto region = cef::mojom::DraggableRegionEntry::New(webregion.bounds, webregion.draggable); render_frame->ConvertViewportToWindow(®ion->bounds); - regions.push_back(std::move(region)); + regions.emplace_back(std::move(region)); } } diff --git a/libcef/renderer/frame_impl.h b/libcef/renderer/frame_impl.h index 42aa1c854..96186e800 100644 --- a/libcef/renderer/frame_impl.h +++ b/libcef/renderer/frame_impl.h @@ -85,7 +85,6 @@ class CefFrameImpl void OnWasShown(); void OnDidCommitProvisionalLoad(); void OnDidFinishLoad(); - void OnDraggableRegionsChanged(); void OnContextCreated(v8::Local context); void OnContextReleased(); void OnDetached(); @@ -93,6 +92,11 @@ class CefFrameImpl blink::WebLocalFrame* web_frame() const { return frame_; } private: + // Called for draggable region changes due to navigation. This is in addition + // to the standard notifications delivered via + // WebContentsDelegate::DraggableRegionsChanged. + void OnDraggableRegionsChanged(); + // Execute an action on the associated WebLocalFrame. This will queue the // action if the JavaScript context is not yet created. using LocalFrameAction = diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index 5e013e87c..d199d6aeb 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -118,12 +118,6 @@ void CefRenderFrameObserver::FocusedElementChanged( documentImpl->Detach(); } -void CefRenderFrameObserver::DraggableRegionsChanged() { - if (frame_) { - frame_->OnDraggableRegionsChanged(); - } -} - void CefRenderFrameObserver::DidCreateScriptContext( v8::Handle context, int world_id) { diff --git a/libcef/renderer/render_frame_observer.h b/libcef/renderer/render_frame_observer.h index 6211056d1..54e59ee6a 100644 --- a/libcef/renderer/render_frame_observer.h +++ b/libcef/renderer/render_frame_observer.h @@ -33,7 +33,6 @@ class CefRenderFrameObserver : public content::RenderFrameObserver { void DidFinishLoad() override; void WillDetach(blink::DetachReason detach_reason) override; void FocusedElementChanged(const blink::WebElement& element) override; - void DraggableRegionsChanged() override; void DidCreateScriptContext(v8::Handle context, int world_id) override; void WillReleaseScriptContext(v8::Handle context, diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index 976c7bdd1..eeadcf4c7 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -125,7 +125,7 @@ void CefRenderManager::RenderFrameCreated( // Enable support for draggable regions. // TODO: This has performance consequences so consider making it configurable // (e.g. only enabled for frameless windows). See issue #3636. - render_frame->GetWebView()->SetSupportsAppRegion(true); + render_frame->GetWebView()->SetSupportsDraggableRegions(true); } void CefRenderManager::WebViewCreated( diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index be981daef..0e2f5c220 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -2364,7 +2364,7 @@ bool CefV8ValueImpl::NeuterArrayBuffer() { if (!arr->IsDetachable()) { return false; } - arr->Detach(); + [[maybe_unused]] auto result = arr->Detach(v8::Local()); return true; } diff --git a/patch/patch.cfg b/patch/patch.cfg index 5b77d15e5..ab7110b3e 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -44,6 +44,12 @@ patches = [ # https://bugs.chromium.org/p/chromium/issues/detail?id=623342 'name': 'runhooks', }, + { + # Don't sort CEF and Chromium header includes into the same block. + # Partially reverts: + # https://chromium-review.googlesource.com/c/chromium/src/+/5197064 + 'name': 'clang_format_includes', + }, { # Support component builds (GN is_component_build=true). # https://github.com/chromiumembedded/cef/issues/1617 @@ -745,12 +751,6 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/3645 'name': 'win_taskbar_decorator_3645' }, - { - # chrome: Fix crash on static FontList destruction with - # multi-threaded-message-loop. - # https://chromium-review.googlesource.com/c/chromium/src/+/5388128 - 'name': 'chrome_watermark_5388128' - }, { # views: Update textfield colors when enabled state changes # https://chromium-review.googlesource.com/c/chromium/src/+/5399416 diff --git a/patch/patches/base_command_line_1872.patch b/patch/patches/base_command_line_1872.patch index fc3d0dc86..d2df4f78b 100644 --- a/patch/patches/base_command_line_1872.patch +++ b/patch/patches/base_command_line_1872.patch @@ -1,8 +1,8 @@ diff --git base/command_line.cc base/command_line.cc -index 15d57c1c78956..2241eb0c32572 100644 +index 3596432cb48b3..b7846f07f7b1d 100644 --- base/command_line.cc +++ base/command_line.cc -@@ -383,11 +383,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, +@@ -384,11 +384,10 @@ void CommandLine::AppendSwitchNative(std::string_view switch_string, #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) sequence_checker_.Check(); #endif @@ -11,7 +11,7 @@ index 15d57c1c78956..2241eb0c32572 100644 +#if BUILDFLAG(IS_WIN) StringType combined_switch_string(UTF8ToWide(switch_key)); #elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA) -- StringPiece switch_key = switch_string; +- std::string_view switch_key = switch_string; StringType combined_switch_string(switch_key); #endif size_t prefix_length = GetSwitchPrefixLength(combined_switch_string); diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 1c009082e..9c6f3a733 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index 25356ec40cdbf..250bac82d893a 100644 +index 5dc15da08eeff..4d98f417eabc3 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -41,6 +41,7 @@ import("//build/nocompile.gni") @@ -10,7 +10,7 @@ index 25356ec40cdbf..250bac82d893a 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") -@@ -1515,7 +1516,11 @@ component("base") { +@@ -1525,7 +1526,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 25356ec40cdbf..250bac82d893a 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1944,6 +1949,12 @@ component("base") { +@@ -1954,6 +1959,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } diff --git a/patch/patches/base_test_4396276.patch b/patch/patches/base_test_4396276.patch index d45ddbff4..82a428b84 100644 --- a/patch/patches/base_test_4396276.patch +++ b/patch/patches/base_test_4396276.patch @@ -1,8 +1,8 @@ diff --git base/test/BUILD.gn base/test/BUILD.gn -index 4c0357370dffc..cdb90b96e1a4a 100644 +index f50c2e942aed5..3a682be935a99 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn -@@ -190,11 +190,6 @@ static_library("test_support") { +@@ -191,11 +191,6 @@ static_library("test_support") { if (enable_base_tracing) { public_deps += [ "//third_party/perfetto:perfetto_test_support" ] @@ -14,7 +14,7 @@ index 4c0357370dffc..cdb90b96e1a4a 100644 deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", -@@ -560,7 +555,7 @@ if (enable_base_tracing) { +@@ -563,7 +558,7 @@ if (enable_base_tracing) { # processor depends on dev_sqlite. The two share the same symbols but have # different implementations, so we need to hide dev_sqlite in this shared # library even in non-component builds to prevent duplicate symbols. @@ -23,7 +23,7 @@ index 4c0357370dffc..cdb90b96e1a4a 100644 if (is_ios) { _target_type = "ios_framework_bundle" } -@@ -569,6 +564,8 @@ if (enable_base_tracing) { +@@ -572,6 +567,8 @@ if (enable_base_tracing) { defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] testonly = true sources = [ @@ -32,7 +32,7 @@ index 4c0357370dffc..cdb90b96e1a4a 100644 "test_trace_processor_export.h", "test_trace_processor_impl.cc", "test_trace_processor_impl.h", -@@ -586,33 +583,6 @@ if (enable_base_tracing) { +@@ -589,33 +586,6 @@ if (enable_base_tracing) { output_name = "TestTraceProcessor" bundle_deps_filter = [ "//third_party/icu:icudata" ] } @@ -88,10 +88,10 @@ index f5191b804bc07..aadb7d66ba4c3 100644 + #endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_ diff --git content/shell/BUILD.gn content/shell/BUILD.gn -index d04abf8d841cc..61caa4266685b 100644 +index c469f1ee966ea..dec797956143f 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn -@@ -878,7 +878,6 @@ if (is_mac) { +@@ -871,7 +871,6 @@ if (is_mac) { # Specify a sensible install_name for static builds. The library is # dlopen()ed so this is not used to resolve the module. ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ] diff --git a/patch/patches/blink_web_element_4200240.patch b/patch/patches/blink_web_element_4200240.patch index f795c84d0..3020671e2 100644 --- a/patch/patches/blink_web_element_4200240.patch +++ b/patch/patches/blink_web_element_4200240.patch @@ -13,10 +13,10 @@ index 103cbab74b515..3b763e5100340 100644 // Returns true if the element's contenteditable attribute is in the true // state or in the plaintext-only state: diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc -index 3c71a93d1a6ea..df2c5cd35b846 100644 +index f05470ff9c673..7ffee95e4540b 100644 --- third_party/blink/renderer/core/exported/web_element.cc +++ third_party/blink/renderer/core/exported/web_element.cc -@@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name, +@@ -118,6 +118,24 @@ void WebElement::SetAttribute(const WebString& attr_name, IGNORE_EXCEPTION_FOR_TESTING); } diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index c191d7a01..92a28bd22 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index 5daf5aba13046..f0922951ee2b3 100644 +index d660380d5d9ca..c0480add36259 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1904,6 +1904,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( +@@ -1953,6 +1953,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessMaybeOpaqueOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,10 +20,10 @@ index 5daf5aba13046..f0922951ee2b3 100644 // Make an exception to allow most visited tiles to commit in diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 52cdd617511bd..1d52c8473304c 100644 +index 5b2a0a561b948..2f0c7f9941877 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -7966,10 +7966,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( +@@ -7944,10 +7944,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -47,7 +47,7 @@ index 52cdd617511bd..1d52c8473304c 100644 } return origin_and_debug_info; -@@ -8077,6 +8089,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -8055,6 +8067,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { DetermineInitiatorRelationship(initiator_rfh, frame_tree_node_->current_frame_host())); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 9bd09cb4e..a5dcb3221 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index bd7dd25175f1e..de5b560a8bb3e 100644 +index 973d8bcbd2f1f..385c865f0159e 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -138,6 +138,9 @@ declare_args() { +@@ -137,6 +137,9 @@ declare_args() { # The cache can lead to non-determinism: https://crbug.com/1486045 thin_lto_enable_cache = true @@ -12,7 +12,7 @@ index bd7dd25175f1e..de5b560a8bb3e 100644 # Initialize all local variables with a pattern. This flag will fill # uninitialized floating-point types (and 32-bit pointers) with 0xFF and the # rest with 0xAA. This makes behavior of uninitialized memory bugs consistent, -@@ -2180,11 +2183,13 @@ config("export_dynamic") { +@@ -2204,11 +2207,13 @@ config("export_dynamic") { config("thin_archive") { # The macOS and iOS default linker ld64 does not support reading thin # archives. diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index bbeb19a35..893e10364 100644 --- a/patch/patches/chrome_browser.patch +++ b/patch/patches/chrome_browser.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn -index 5d698b969a134..ffddbc4db780b 100644 +index 70c3930b4d357..f71d0ff5bd9a7 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,7 +10,7 @@ index 5d698b969a134..ffddbc4db780b 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -2050,6 +2051,7 @@ static_library("browser") { +@@ -2089,6 +2090,7 @@ static_library("browser") { "//build/config/chromebox_for_meetings:buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index 5d698b969a134..ffddbc4db780b 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2707,6 +2709,10 @@ static_library("browser") { +@@ -2759,6 +2761,10 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 9a2bc2e59..6dbc77a5f 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index 3e7de43022a41..21354d14d11c3 100644 +index 0a7910bc42894..7dc340fb9c29e 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h -@@ -207,9 +207,9 @@ class BrowserProcess { +@@ -210,9 +210,9 @@ class BrowserProcess { virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0; @@ -14,10 +14,10 @@ index 3e7de43022a41..21354d14d11c3 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 0290ba1dbcbba..d96217c2bb869 100644 +index 19949bdecce72..cf4ed48fff5ce 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -1093,18 +1093,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -1097,18 +1097,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -38,10 +38,10 @@ index 0290ba1dbcbba..d96217c2bb869 100644 std::unique_ptr manager) { background_mode_manager_ = std::move(manager); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index b303ad32bec66..e85dd8134147e 100644 +index e4cfec362d50c..2c17d0307601c 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -191,8 +191,8 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index 6a220bd54..6846e5d16 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,10 +13,10 @@ index 2480282a19d12..dbd1fbf8a15b5 100644 return false; } diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc -index c5eea1036e1eb..034b325c95f6b 100644 +index 8fbc9ab537c6d..e87d068678767 100644 --- chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc -@@ -35,6 +35,7 @@ +@@ -37,6 +37,7 @@ #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/browser/ui/browser.h" @@ -24,7 +24,7 @@ index c5eea1036e1eb..034b325c95f6b 100644 #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_window.h" -@@ -1223,6 +1224,13 @@ DevToolsWindow* DevToolsWindow::Create( +@@ -1235,6 +1236,13 @@ DevToolsWindow* DevToolsWindow::Create( !browser->is_type_normal()) { can_dock = false; } @@ -38,7 +38,7 @@ index c5eea1036e1eb..034b325c95f6b 100644 } // Create WebContents with devtools. -@@ -1845,12 +1853,28 @@ void DevToolsWindow::CreateDevToolsBrowser() { +@@ -1908,12 +1916,28 @@ void DevToolsWindow::CreateDevToolsBrowser() { Browser::CreationStatus::kOk) { return; } @@ -74,7 +74,7 @@ index c5eea1036e1eb..034b325c95f6b 100644 } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 3fe3d6eddbf01..b1549c86523be 100644 +index d6c14b3d70a75..577586f0dd8b4 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") @@ -85,7 +85,7 @@ index 3fe3d6eddbf01..b1549c86523be 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -@@ -393,6 +394,10 @@ static_library("ui") { +@@ -401,6 +402,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -96,7 +96,7 @@ index 3fe3d6eddbf01..b1549c86523be 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -418,6 +423,7 @@ static_library("ui") { +@@ -426,6 +431,7 @@ static_library("ui") { "//build:chromeos_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", @@ -104,7 +104,7 @@ index 3fe3d6eddbf01..b1549c86523be 100644 "//chrome:resources", "//chrome:strings", "//chrome/app:chrome_dll_resources", -@@ -2936,6 +2942,8 @@ static_library("ui") { +@@ -2979,6 +2985,8 @@ static_library("ui") { "views/apps/app_dialog/app_block_dialog_view.h", "views/apps/app_dialog/app_pause_dialog_view.cc", "views/apps/app_dialog/app_pause_dialog_view.h", @@ -113,7 +113,7 @@ index 3fe3d6eddbf01..b1549c86523be 100644 "views/apps/app_info_dialog/arc_app_info_links_panel.cc", "views/apps/app_info_dialog/arc_app_info_links_panel.h", "views/apps/chrome_app_window_client_views_chromeos.cc", -@@ -4996,8 +5004,6 @@ static_library("ui") { +@@ -5062,8 +5070,6 @@ static_library("ui") { "views/accessibility/theme_tracking_non_accessible_image_view.h", "views/apps/app_dialog/app_dialog_view.cc", "views/apps/app_dialog/app_dialog_view.h", @@ -122,7 +122,7 @@ index 3fe3d6eddbf01..b1549c86523be 100644 "views/apps/app_info_dialog/app_info_dialog_container.cc", "views/apps/app_info_dialog/app_info_dialog_container.h", "views/apps/app_info_dialog/app_info_dialog_views.cc", -@@ -6813,6 +6819,7 @@ static_library("ui") { +@@ -6895,6 +6901,7 @@ static_library("ui") { if (enable_printing) { deps += [ "//components/printing/browser", @@ -131,10 +131,10 @@ index 3fe3d6eddbf01..b1549c86523be 100644 ] } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 3d985470f60d1..762f0e827d53e 100644 +index cf9de7df6299d..3f93ff73ab038 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -264,6 +264,25 @@ +@@ -267,6 +267,25 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -160,7 +160,7 @@ index 3d985470f60d1..762f0e827d53e 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -466,6 +485,10 @@ Browser::Browser(const CreateParams& params) +@@ -476,6 +495,10 @@ Browser::Browser(const CreateParams& params) type_(params.type), profile_(params.profile), window_(nullptr), @@ -171,7 +171,7 @@ index 3d985470f60d1..762f0e827d53e 100644 tab_strip_model_delegate_( std::make_unique(this)), tab_strip_model_(std::make_unique( -@@ -679,6 +702,12 @@ Browser::~Browser() { +@@ -678,6 +701,12 @@ Browser::~Browser() { // away so they don't try and call back to us. if (select_file_dialog_.get()) select_file_dialog_->ListenerDestroyed(); @@ -184,7 +184,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } /////////////////////////////////////////////////////////////////////////////// -@@ -1110,6 +1139,8 @@ void Browser::WindowFullscreenStateChanged() { +@@ -1109,6 +1138,8 @@ void Browser::WindowFullscreenStateChanged() { ->WindowFullscreenStateChanged(); command_controller_->FullscreenStateChanged(); UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); @@ -193,7 +193,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } void Browser::FullscreenTopUIStateChanged() { -@@ -1451,6 +1482,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1450,6 +1481,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -208,7 +208,7 @@ index 3d985470f60d1..762f0e827d53e 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1458,8 +1497,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1457,8 +1496,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -229,13 +229,15 @@ index 3d985470f60d1..762f0e827d53e 100644 } bool Browser::TabsNeedBeforeUnloadFired() const { -@@ -1658,6 +1707,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1660,6 +1709,16 @@ WebContents* Browser::OpenURLFromTab( } #endif // BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(ENABLE_CEF) + if (cef_browser_delegate_) { -+ auto web_contents = cef_browser_delegate_->OpenURLFromTab(source, params); ++ auto web_contents = ++ cef_browser_delegate_->OpenURLFromTabEx(source, params, ++ navigation_handle_callback); + if (!web_contents) + return nullptr; + } @@ -244,7 +246,7 @@ index 3d985470f60d1..762f0e827d53e 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1815,6 +1872,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1822,6 +1881,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool should_show_loading_ui) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); @@ -253,7 +255,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1843,6 +1902,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1850,6 +1911,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -262,7 +264,7 @@ index 3d985470f60d1..762f0e827d53e 100644 if (!GetStatusBubble()) return; -@@ -1850,6 +1911,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1857,6 +1920,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -280,7 +282,7 @@ index 3d985470f60d1..762f0e827d53e 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1874,6 +1946,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { +@@ -1881,6 +1955,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { return false; } @@ -300,7 +302,7 @@ index 3d985470f60d1..762f0e827d53e 100644 void Browser::BeforeUnloadFired(WebContents* web_contents, bool proceed, bool* proceed_to_fire_unload) { -@@ -1973,12 +2058,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1980,12 +2067,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -325,7 +327,7 @@ index 3d985470f60d1..762f0e827d53e 100644 // Don't show the page hung dialog when a HTML popup hangs because // the dialog will take the focus and immediately close the popup. RenderWidgetHostView* view = render_widget_host->GetView(); -@@ -1991,6 +2088,13 @@ void Browser::RendererUnresponsive( +@@ -1998,6 +2097,13 @@ void Browser::RendererUnresponsive( void Browser::RendererResponsive( WebContents* source, content::RenderWidgetHost* render_widget_host) { @@ -339,7 +341,19 @@ index 3d985470f60d1..762f0e827d53e 100644 RenderWidgetHostView* view = render_widget_host->GetView(); if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { TabDialogs::FromWebContents(source)->HideHungRendererDialog( -@@ -2117,11 +2221,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -2051,6 +2157,11 @@ void Browser::DraggableRegionsChanged( + if (app_controller_) { + app_controller_->DraggableRegionsChanged(regions, contents); + } ++#if BUILDFLAG(ENABLE_CEF) ++ else if (cef_delegate()) { ++ cef_delegate()->DraggableRegionsChanged(regions, contents); ++ } ++#endif + } + + void Browser::DidFinishNavigation( +@@ -2132,11 +2243,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -355,7 +369,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2321,6 +2429,15 @@ void Browser::RequestMediaAccessPermission( +@@ -2336,6 +2451,15 @@ void Browser::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) { @@ -371,7 +385,7 @@ index 3d985470f60d1..762f0e827d53e 100644 const extensions::Extension* extension = GetExtensionForOrigin(profile_, request.security_origin); MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -2864,9 +2981,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { +@@ -2880,9 +3004,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { // Browser, Getters for UI (private): StatusBubble* Browser::GetStatusBubble() { @@ -384,7 +398,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } // We hide the status bar for web apps windows as this matches native -@@ -2874,6 +2993,12 @@ StatusBubble* Browser::GetStatusBubble() { +@@ -2890,6 +3016,12 @@ StatusBubble* Browser::GetStatusBubble() { // mode, as the minimal browser UI includes the status bar. if (web_app::AppBrowserController::IsWebApp(this) && !app_controller()->HasMinimalUiButtons()) { @@ -397,7 +411,7 @@ index 3d985470f60d1..762f0e827d53e 100644 return nullptr; } -@@ -3010,6 +3135,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -3026,6 +3158,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); web_contents_collection_.StopObserving(web_contents); } @@ -406,7 +420,7 @@ index 3d985470f60d1..762f0e827d53e 100644 } void Browser::TabDetachedAtImpl(content::WebContents* contents, -@@ -3164,6 +3291,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( +@@ -3180,6 +3314,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, bool check_can_support) const { @@ -422,7 +436,7 @@ index 3d985470f60d1..762f0e827d53e 100644 case TYPE_NORMAL: return NormalBrowserSupportsWindowFeature(feature, check_can_support); diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 4f393fa78e991..a486d6f7f1571 100644 +index 6a3a4af355be9..b04d27dab01ed 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -22,6 +22,7 @@ @@ -433,7 +447,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 #include "chrome/browser/tab_contents/web_contents_collection.h" #include "chrome/browser/themes/theme_service_observer.h" #include "chrome/browser/ui/bookmarks/bookmark_bar.h" -@@ -48,6 +49,10 @@ +@@ -49,6 +50,10 @@ #include "ui/gfx/geometry/rect.h" #include "ui/shell_dialogs/select_file_dialog.h" @@ -444,7 +458,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 #if BUILDFLAG(IS_ANDROID) #error This file should only be included on desktop. #endif -@@ -347,6 +352,15 @@ class Browser : public TabStripModelObserver, +@@ -365,6 +370,15 @@ class Browser : public TabStripModelObserver, // Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE. std::optional pip_options; @@ -460,7 +474,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -428,6 +442,13 @@ class Browser : public TabStripModelObserver, +@@ -446,6 +460,13 @@ class Browser : public TabStripModelObserver, update_ui_immediately_for_testing_ = true; } @@ -474,7 +488,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -502,6 +523,12 @@ class Browser : public TabStripModelObserver, +@@ -536,6 +557,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); base::WeakPtr AsWeakPtr() const; @@ -487,7 +501,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -908,11 +935,19 @@ class Browser : public TabStripModelObserver, +@@ -947,11 +974,19 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -507,7 +521,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; -@@ -1252,6 +1287,10 @@ class Browser : public TabStripModelObserver, +@@ -1289,6 +1324,10 @@ class Browser : public TabStripModelObserver, // This Browser's window. raw_ptr window_; @@ -518,7 +532,7 @@ index 4f393fa78e991..a486d6f7f1571 100644 std::unique_ptr const tab_strip_model_delegate_; std::unique_ptr const tab_strip_model_; -@@ -1318,6 +1357,8 @@ class Browser : public TabStripModelObserver, +@@ -1355,6 +1394,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -528,10 +542,10 @@ index 4f393fa78e991..a486d6f7f1571 100644 UnloadController unload_controller_; diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 151c73f9d7a18..e02316efd4011 100644 +index cefb9f62051fe..6e19377f78e4f 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -305,6 +305,10 @@ std::pair GetBrowserAndTabForDisposition( +@@ -313,6 +313,10 @@ std::pair GetBrowserAndTabForDisposition( : 1.0; browser_params.pip_options = pip_options; @@ -542,7 +556,7 @@ index 151c73f9d7a18..e02316efd4011 100644 const BrowserWindow* const browser_window = params.browser->window(); const gfx::NativeWindow native_window = browser_window ? browser_window->GetNativeWindow() -@@ -590,6 +594,13 @@ std::unique_ptr CreateTargetContents( +@@ -598,6 +602,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 39e98d382..072bc1bd6 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc -index 36335ba63ee83..e14005d6a4e86 100644 +index 9356bf044a318..2499576dea7f0 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -9,6 +9,7 @@ @@ -10,7 +10,7 @@ index 36335ba63ee83..e14005d6a4e86 100644 #include "chrome/browser/content_settings/one_time_permission_provider.h" #include "chrome/browser/permissions/one_time_permissions_tracker_factory.h" #include "chrome/browser/profiles/off_the_record_profile_impl.h" -@@ -24,6 +25,10 @@ +@@ -27,6 +28,10 @@ #include "extensions/buildflags/buildflags.h" #include "ui/webui/webui_allowlist_provider.h" @@ -21,7 +21,7 @@ index 36335ba63ee83..e14005d6a4e86 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/trace_event/trace_event.h" #include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h" -@@ -64,7 +69,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() +@@ -58,7 +63,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() #endif DependsOn(OneTimePermissionsTrackerFactory::GetInstance()); #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -35,7 +35,7 @@ index 36335ba63ee83..e14005d6a4e86 100644 #endif // Used by way of ShouldRestoreOldSessionCookies(). #if BUILDFLAG(ENABLE_SESSION_SERVICE) -@@ -118,6 +129,9 @@ scoped_refptr +@@ -112,6 +123,9 @@ scoped_refptr std::move(allowlist_provider)); #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -45,7 +45,7 @@ index 36335ba63ee83..e14005d6a4e86 100644 // These must be registered before before the HostSettings are passed over to // the IOThread. Simplest to do this on construction. settings_map->RegisterProvider( -@@ -130,6 +144,9 @@ scoped_refptr +@@ -124,6 +138,9 @@ scoped_refptr // the case where profile->IsOffTheRecord() is true? And what is the // interaction with profile->IsGuestSession()? false)); @@ -53,10 +53,10 @@ index 36335ba63ee83..e14005d6a4e86 100644 + } +#endif #endif // BUILDFLAG(ENABLE_EXTENSIONS) - #if BUILDFLAG(ENABLE_SUPERVISED_USERS) supervised_user::SupervisedUserSettingsService* supervised_service = + SupervisedUserSettingsServiceFactory::GetForKey(profile->GetProfileKey()); diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index 0ff900e700ba8..ca5b899bece6d 100644 +index f988c812b4ad9..3d5637f3cbdf3 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc @@ -148,7 +148,7 @@ ContentSetting GetContentSettingFromRules( diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index f6cf33dc3..89c725e74 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc -index d182bc1b7bff2..e7c0d5b03ede7 100644 +index 72a2b681d5b98..8f7368add83fb 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -361,6 +361,18 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -358,6 +358,18 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -21,7 +21,7 @@ index d182bc1b7bff2..e7c0d5b03ede7 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -618,6 +630,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -615,6 +627,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -32,7 +32,7 @@ index d182bc1b7bff2..e7c0d5b03ede7 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -867,6 +883,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -865,6 +881,14 @@ RenderViewContextMenu::RenderViewContextMenu( pdf_ocr_submenu_model_ = std::make_unique(this); #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) @@ -47,7 +47,7 @@ index d182bc1b7bff2..e7c0d5b03ede7 100644 observers_.AddObserver(&autofill_context_menu_manager_); } -@@ -1341,6 +1365,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1339,6 +1363,12 @@ void RenderViewContextMenu::InitMenu() { autofill::PopupHidingReason::kContextMenuOpened); } } @@ -60,7 +60,7 @@ index d182bc1b7bff2..e7c0d5b03ede7 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -3564,6 +3594,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( +@@ -3572,6 +3602,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( execute_plugin_action_callback_ = std::move(cb); } @@ -88,10 +88,10 @@ index d182bc1b7bff2..e7c0d5b03ede7 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index 9634f1d7f3442..96dc5f252280c 100644 +index 548004a597fa0..f63405fa8badc 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -158,7 +158,21 @@ class RenderViewContextMenu +@@ -155,7 +155,21 @@ class RenderViewContextMenu } #endif @@ -113,7 +113,7 @@ index 9634f1d7f3442..96dc5f252280c 100644 Profile* GetProfile() const; // This may return nullptr (e.g. for WebUI dialogs). Virtual to allow tests to -@@ -470,6 +484,9 @@ class RenderViewContextMenu +@@ -465,6 +479,9 @@ class RenderViewContextMenu // built. bool is_protocol_submenu_valid_ = false; @@ -164,7 +164,7 @@ index c88a77a0b49e2..d1af9a85c4ec6 100644 return; diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index c49b49d76d7cc..842a6fae5d8e4 100644 +index 8e45cecb17039..e40115e23ee82 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc @@ -374,6 +374,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { @@ -186,7 +186,7 @@ index c49b49d76d7cc..842a6fae5d8e4 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index e3e8617aa03b6..9bb486d691582 100644 +index 57b288bc885e6..112990e3a9ad3 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h @@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index 0a87e049a..6d0718062 100644 --- a/patch/patches/chrome_browser_dialogs_native.patch +++ b/patch/patches/chrome_browser_dialogs_native.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc -index 4d5299dc12b76..a74d0212d2eb1 100644 +index 447a91b9ac380..51593091b5fa6 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc @@ -20,6 +20,7 @@ @@ -10,7 +10,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/platform_util.h" -@@ -246,6 +247,13 @@ void FileSelectHelper::OnListFile( +@@ -245,6 +246,13 @@ void FileSelectHelper::OnListFile( void FileSelectHelper::LaunchConfirmationDialog( const base::FilePath& path, std::vector selected_files) { @@ -24,7 +24,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 ShowFolderUploadConfirmationDialog( path, base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this), -@@ -330,6 +338,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( +@@ -329,6 +337,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( if (AbortIfWebContentsDestroyed()) return; @@ -37,7 +37,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 #if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) enterprise_connectors::ContentAnalysisDelegate::Data data; if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled( -@@ -460,7 +474,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { +@@ -459,7 +473,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { std::unique_ptr FileSelectHelper::GetFileTypesFromAcceptType( @@ -47,7 +47,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 auto base_file_type = std::make_unique(); if (accept_types.empty()) return base_file_type; -@@ -473,17 +488,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -472,17 +487,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( std::vector* extensions = &file_type->extensions.back(); @@ -73,7 +73,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 } else { if (!base::IsStringASCII(accept_type)) continue; -@@ -494,10 +516,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -493,10 +515,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( description_id = IDS_AUDIO_FILES; else if (ascii_type == "video/*") description_id = IDS_VIDEO_FILES; @@ -94,7 +94,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 if (extensions->size() > old_extension_size) valid_type_count++; } -@@ -522,6 +552,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -521,6 +551,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( l10n_util::GetStringUTF16(description_id)); } @@ -110,7 +110,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 return file_type; } -@@ -529,7 +568,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -528,7 +567,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( void FileSelectHelper::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -120,7 +120,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 Profile* profile = Profile::FromBrowserContext( render_frame_host->GetProcess()->GetBrowserContext()); -@@ -548,6 +588,7 @@ void FileSelectHelper::RunFileChooser( +@@ -547,6 +587,7 @@ void FileSelectHelper::RunFileChooser( // message. scoped_refptr file_select_helper( new FileSelectHelper(profile)); @@ -128,7 +128,7 @@ index 4d5299dc12b76..a74d0212d2eb1 100644 file_select_helper->RunFileChooser(render_frame_host, std::move(listener), params.Clone()); } -@@ -599,7 +640,8 @@ void FileSelectHelper::RunFileChooser( +@@ -598,7 +639,8 @@ void FileSelectHelper::RunFileChooser( } void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) { diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index 14716584e..204a3ad57 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -12,7 +12,7 @@ index b169371e4d42f..509e4bda85b47 100644 // on the screen, we can't actually attach to it. parent_window = nullptr; diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc -index 7eda0c852bb51..744452bf6c00c 100644 +index 630ede12ce3f8..b7bc765e3eb99 100644 --- components/constrained_window/constrained_window_views.cc +++ components/constrained_window/constrained_window_views.cc @@ -105,15 +105,24 @@ void UpdateModalDialogPosition(views::Widget* widget, @@ -53,7 +53,7 @@ index 7eda0c852bb51..744452bf6c00c 100644 - host_widget->GetClientAreaBoundsInScreen().OffsetFromOrigin(); - const gfx::Rect host_screen_bounds = host_widget->GetWindowBoundsInScreen(); - -- // TODO(crbug.com/1341530): The requested dialog bounds should never fall +- // TODO(crbug.com/40851111): The requested dialog bounds should never fall - // outside the bounds of the transient parent. - DCHECK(dialog_screen_bounds.Intersects(host_screen_bounds)); - @@ -178,17 +178,17 @@ index 51ed6bcf6b540..c6e1161140655 100644 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; // Returns whether a dialog currently about to be shown should be activated. diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc -index 992dbc606ab78..2361727757696 100644 +index 1361ac9b3d57b..5a41f86862561 100644 --- ui/views/window/dialog_delegate.cc +++ ui/views/window/dialog_delegate.cc -@@ -60,10 +60,12 @@ DialogDelegate::DialogDelegate() { +@@ -84,10 +84,12 @@ DialogDelegate::DialogDelegate() { // static Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, gfx::NativeWindow context, - gfx::NativeView parent) { + gfx::NativeView parent, + gfx::AcceleratedWidget parent_widget) { - views::Widget* widget = new views::Widget; + views::Widget* widget = new DialogWidget; views::Widget::InitParams params = - GetDialogWidgetInitParams(delegate, context, parent, gfx::Rect()); + GetDialogWidgetInitParams(delegate, context, parent, gfx::Rect(), @@ -196,7 +196,7 @@ index 992dbc606ab78..2361727757696 100644 widget->Init(std::move(params)); return widget; } -@@ -72,17 +74,19 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, +@@ -96,17 +98,19 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, Widget* DialogDelegate::CreateDialogWidget( std::unique_ptr delegate, gfx::NativeWindow context, @@ -220,7 +220,7 @@ index 992dbc606ab78..2361727757696 100644 #else return true; #endif -@@ -93,14 +97,15 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( +@@ -117,14 +121,15 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( WidgetDelegate* delegate, gfx::NativeWindow context, gfx::NativeView parent, @@ -238,7 +238,7 @@ index 992dbc606ab78..2361727757696 100644 if (!dialog || dialog->use_custom_frame()) { params.opacity = Widget::InitParams::WindowOpacity::kTranslucent; -@@ -113,6 +118,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( +@@ -137,6 +142,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( } params.context = context; params.parent = parent; @@ -247,10 +247,10 @@ index 992dbc606ab78..2361727757696 100644 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child // widgets to prevent top-level window behavior (independent movement, etc). diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index bfeb88bc9b666..6dd74a72e20cc 100644 +index de642a3bc1101..bdd8664f481a9 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h -@@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { +@@ -97,13 +97,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { // your use case. static Widget* CreateDialogWidget(std::unique_ptr delegate, gfx::NativeWindow context, @@ -272,7 +272,7 @@ index bfeb88bc9b666..6dd74a72e20cc 100644 // Returns the dialog widget InitParams for a given |context| or |parent|. // If |bounds| is not empty, used to initially place the dialog, otherwise -@@ -110,7 +115,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { +@@ -111,7 +116,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { static Widget::InitParams GetDialogWidgetInitParams(WidgetDelegate* delegate, gfx::NativeWindow context, gfx::NativeView parent, diff --git a/patch/patches/chrome_browser_extensions.patch b/patch/patches/chrome_browser_extensions.patch index 756400e84..6ccd2fe16 100644 --- a/patch/patches/chrome_browser_extensions.patch +++ b/patch/patches/chrome_browser_extensions.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/chrome_extensions_api_client.cc chrome/browser/extensions/api/chrome_extensions_api_client.cc -index 2897ebd032da8..32b2e5d80f39a 100644 +index 4007e26f780c3..5f92d74018f9e 100644 --- chrome/browser/extensions/api/chrome_extensions_api_client.cc +++ chrome/browser/extensions/api/chrome_extensions_api_client.cc @@ -14,6 +14,7 @@ @@ -10,7 +10,7 @@ index 2897ebd032da8..32b2e5d80f39a 100644 #include "chrome/browser/extensions/api/automation_internal/chrome_automation_internal_api_delegate.h" #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" #include "chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h" -@@ -91,6 +92,10 @@ +@@ -92,6 +93,10 @@ #include "chrome/browser/extensions/clipboard_extension_helper_chromeos.h" #endif @@ -21,7 +21,7 @@ index 2897ebd032da8..32b2e5d80f39a 100644 #if BUILDFLAG(ENABLE_PRINTING) #include "chrome/browser/printing/printing_init.h" #endif -@@ -318,6 +323,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate() const { +@@ -314,6 +319,11 @@ ChromeExtensionsAPIClient::CreateGuestViewManagerDelegate() const { std::unique_ptr ChromeExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate( MimeHandlerViewGuest* guest) const { diff --git a/patch/patches/chrome_browser_frame_mac.patch b/patch/patches/chrome_browser_frame_mac.patch index b64b9cc29..08dd5536c 100644 --- a/patch/patches/chrome_browser_frame_mac.patch +++ b/patch/patches/chrome_browser_frame_mac.patch @@ -33,7 +33,7 @@ index a5ee05ae5f5e9..97fd2e8da450e 100644 ~BrowserFrameMac() override; diff --git chrome/browser/ui/views/frame/browser_frame_mac.mm chrome/browser/ui/views/frame/browser_frame_mac.mm -index 24b68406431ce..5d58296a7a7f4 100644 +index 13300a3ec7e25..b8f61c5845779 100644 --- chrome/browser/ui/views/frame/browser_frame_mac.mm +++ chrome/browser/ui/views/frame/browser_frame_mac.mm @@ -182,7 +182,14 @@ void BrowserFrameMac::OnWindowFullscreenTransitionComplete() { @@ -52,7 +52,7 @@ index 24b68406431ce..5d58296a7a7f4 100644 if (!chrome::SupportsCommand(browser, tag)) { result->enable = false; return; -@@ -310,8 +317,16 @@ bool BrowserFrameMac::WillExecuteCommand( +@@ -294,8 +301,16 @@ bool BrowserFrameMac::WillExecuteCommand( int32_t command, WindowOpenDisposition window_open_disposition, bool is_before_first_responder) { @@ -70,7 +70,7 @@ index 24b68406431ce..5d58296a7a7f4 100644 if (is_before_first_responder) { // The specification for this private extensions API is incredibly vague. // For now, we avoid triggering chrome commands prior to giving the -@@ -342,11 +357,20 @@ bool BrowserFrameMac::ExecuteCommand( +@@ -326,11 +341,20 @@ bool BrowserFrameMac::ExecuteCommand( int32_t command, WindowOpenDisposition window_open_disposition, bool is_before_first_responder) { diff --git a/patch/patches/chrome_browser_permission_prompt.patch b/patch/patches/chrome_browser_permission_prompt.patch index aaa214346..0ace30a5f 100644 --- a/patch/patches/chrome_browser_permission_prompt.patch +++ b/patch/patches/chrome_browser_permission_prompt.patch @@ -21,7 +21,7 @@ index 429739d7b8dfe..0f4bff365f62b 100644 g_browser_process->download_request_limiter(); DCHECK(limiter); diff --git chrome/browser/background_sync/periodic_background_sync_permission_context.cc chrome/browser/background_sync/periodic_background_sync_permission_context.cc -index ea1467d09700d..5537a99500e7f 100644 +index d63a055919747..8d13959217751 100644 --- chrome/browser/background_sync/periodic_background_sync_permission_context.cc +++ chrome/browser/background_sync/periodic_background_sync_permission_context.cc @@ -6,6 +6,7 @@ @@ -30,8 +30,8 @@ index ea1467d09700d..5537a99500e7f 100644 #include "build/build_config.h" +#include "cef/libcef/features/runtime.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" - #include "chrome/browser/installable/installable_utils.h" #include "chrome/browser/profiles/profile.h" + #include "chrome/browser/search_engines/template_url_service_factory.h" @@ -89,6 +90,10 @@ PeriodicBackgroundSyncPermissionContext::GetPermissionStatusInternal( return CONTENT_SETTING_ALLOW; #endif @@ -44,7 +44,7 @@ index ea1467d09700d..5537a99500e7f 100644 base::FeatureList::IsEnabled( features::kPeriodicSyncPermissionForDefaultSearchEngine) && diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc -index b6afdced9d0af..e189d08ecdd46 100644 +index 7f14b48feedf6..cfcf4554c1d4d 100644 --- chrome/browser/permissions/chrome_permissions_client.cc +++ chrome/browser/permissions/chrome_permissions_client.cc @@ -14,6 +14,7 @@ @@ -52,10 +52,10 @@ index b6afdced9d0af..e189d08ecdd46 100644 #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/runtime.h" + #include "chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.h" #include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h" #include "chrome/browser/browser_process.h" - #include "chrome/browser/content_settings/cookie_settings_factory.h" -@@ -189,6 +190,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker( +@@ -190,6 +191,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker( double ChromePermissionsClient::GetSiteEngagementScore( content::BrowserContext* browser_context, const GURL& origin) { @@ -65,7 +65,7 @@ index b6afdced9d0af..e189d08ecdd46 100644 return site_engagement::SiteEngagementService::Get( Profile::FromBrowserContext(browser_context)) ->GetScore(origin); -@@ -359,8 +363,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors( +@@ -360,8 +364,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors( std::make_unique()); selectors.emplace_back(std::make_unique( Profile::FromBrowserContext(browser_context))); @@ -77,7 +77,7 @@ index b6afdced9d0af..e189d08ecdd46 100644 } diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc -index c75f396997e17..b219e122ffb5c 100644 +index 1ad4009827a9d..ca054482954f9 100644 --- chrome/browser/permissions/permission_manager_factory.cc +++ chrome/browser/permissions/permission_manager_factory.cc @@ -6,6 +6,7 @@ @@ -88,7 +88,7 @@ index c75f396997e17..b219e122ffb5c 100644 #include "chrome/browser/background_fetch/background_fetch_permission_context.h" #include "chrome/browser/background_sync/periodic_background_sync_permission_context.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -62,9 +63,11 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( +@@ -64,9 +65,11 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( std::make_unique(profile); #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -143,10 +143,10 @@ index fbce13c16ad10..0512b2f09937e 100644 std::unique_ptr CreatePermissionPrompt( content::WebContents* web_contents, diff --git chrome/browser/ui/views/permissions/permission_prompt_factory.cc chrome/browser/ui/views/permissions/permission_prompt_factory.cc -index 07720bc3faccb..546325f2b5558 100644 +index 613500ba8c3d3..36c9aa0d2ea71 100644 --- chrome/browser/ui/views/permissions/permission_prompt_factory.cc +++ chrome/browser/ui/views/permissions/permission_prompt_factory.cc -@@ -186,11 +186,28 @@ std::unique_ptr CreateQuietPrompt( +@@ -202,11 +202,28 @@ std::unique_ptr CreateQuietPrompt( } } diff --git a/patch/patches/chrome_browser_policy.patch b/patch/patches/chrome_browser_policy.patch index 36cab1b59..ae9198841 100644 --- a/patch/patches/chrome_browser_policy.patch +++ b/patch/patches/chrome_browser_policy.patch @@ -44,7 +44,7 @@ index 27af6ec08f593..156689eec644d 100644 #include "chrome/common/chrome_paths.h" namespace policy { -@@ -47,11 +48,6 @@ +@@ -47,11 +48,6 @@ const char kEnrollmentOptionsFilePath[] = FILE_PATH_LITERAL( "/Library/Google/Chrome/CloudManagementEnrollmentOptions"); const char kEnrollmentMandatoryOption[] = "Mandatory"; @@ -306,7 +306,7 @@ index 1a2e78c3472ec..5d1bd95a15113 100644 #include "components/policy/policy_constants.h" namespace policy::path_parser { -@@ -97,16 +98,12 @@ +@@ -97,16 +98,12 @@ base::FilePath::StringType ExpandPathVariables( void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { // Since the configuration management infrastructure is not initialized when // this code runs, read the policy preference directly. @@ -357,10 +357,10 @@ index 8dbf958c189dd..6eaccc6688eca 100644 *dir = base::FilePath(policy::path_parser::ExpandPathVariables(value)); return true; diff --git chrome/common/chrome_paths.cc chrome/common/chrome_paths.cc -index 54aca1f19f909..f93197a133dc2 100644 +index c94a25e390864..b47996eaeb902 100644 --- chrome/common/chrome_paths.cc +++ chrome/common/chrome_paths.cc -@@ -544,7 +544,8 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -541,7 +541,8 @@ bool PathProvider(int key, base::FilePath* result) { return false; } break; @@ -392,7 +392,7 @@ index 4cde94111918e..aaf8245abd9a6 100644 // policy files that allow sys-admins // to set policies for chrome. This directory diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py -index e5efa52a8467f..37253ef517bfa 100755 +index aef54cfd633eb..a3760acb82ea5 100755 --- components/policy/tools/generate_policy_source.py +++ components/policy/tools/generate_policy_source.py @@ -449,6 +449,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, diff --git a/patch/patches/chrome_browser_printing_oop_osr.patch b/patch/patches/chrome_browser_printing_oop_osr.patch index 1527efaa2..79796c9df 100644 --- a/patch/patches/chrome_browser_printing_oop_osr.patch +++ b/patch/patches/chrome_browser_printing_oop_osr.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/printing/print_backend_service_manager.cc chrome/browser/printing/print_backend_service_manager.cc -index 84abad228292c..5b90c7921c2b5 100644 +index ea046f5f1dfe3..0a915b7e3a091 100644 --- chrome/browser/printing/print_backend_service_manager.cc +++ chrome/browser/printing/print_backend_service_manager.cc -@@ -73,7 +73,15 @@ PrintBackendServiceManager* g_print_backend_service_manager_singleton = nullptr; +@@ -74,7 +74,15 @@ PrintBackendServiceManager* g_print_backend_service_manager_singleton = nullptr; // to support modal dialogs from OOP. uint32_t NativeViewToUint(gfx::NativeView view) { #if BUILDFLAG(IS_WIN) diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 7bf4442df..43899890c 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -14,7 +14,7 @@ index 2e67f8c97fab8..a3367979977c9 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 2ec2a791c4943..8573cac4111d6 100644 +index a9762d47c397d..482c0e4c8550f 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc @@ -91,6 +91,7 @@ base::LazyInstance>::Leaky @@ -52,10 +52,10 @@ index 2ec2a791c4943..8573cac4111d6 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 3d5b457eeca11..c7d37503a0fef 100644 +index b06035ad4748f..5d51cd1038a66 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -94,6 +94,10 @@ class Profile : public content::BrowserContext { +@@ -93,6 +93,10 @@ class Profile : public content::BrowserContext { // be applicable to run. Please see crbug.com/1098697#c3 for more details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,7 +66,7 @@ index 3d5b457eeca11..c7d37503a0fef 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -511,6 +515,8 @@ class Profile : public content::BrowserContext { +@@ -504,6 +508,8 @@ class Profile : public content::BrowserContext { return instant_service_; } @@ -75,7 +75,7 @@ index 3d5b457eeca11..c7d37503a0fef 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -522,7 +528,6 @@ class Profile : public content::BrowserContext { +@@ -515,7 +521,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -84,10 +84,10 @@ index 3d5b457eeca11..c7d37503a0fef 100644 // Returns whether the user has signed in this profile to an account. diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 98bfbc0f96140..de7919947e356 100644 +index 47ada6bf53225..a0c4d18b93278 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -1043,7 +1043,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1040,7 +1040,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -99,7 +99,7 @@ index 98bfbc0f96140..de7919947e356 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 3db592470f262..75bfc32b6511b 100644 +index a8ae9d577d4fb..381d6ceeaccba 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc @@ -437,7 +437,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 1812e4d56..676baa910 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 3c300d1896019..5ee89b96ce05e 100644 +index 9bb9b155d3024..34f1bfcffd7d8 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -32,6 +32,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_startup.patch b/patch/patches/chrome_browser_startup.patch index 6a9b27c5a..7eb500da8 100644 --- a/patch/patches/chrome_browser_startup.patch +++ b/patch/patches/chrome_browser_startup.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc -index a68953bd7f04a..9e25d6a3aede2 100644 +index f5fdf2a05a7e7..4622df9f7b0cb 100644 --- chrome/browser/ui/startup/startup_browser_creator.cc +++ chrome/browser/ui/startup/startup_browser_creator.cc -@@ -602,6 +602,13 @@ std::optional GetAppId(const base::CommandLine& command_line, +@@ -603,6 +603,13 @@ std::optional GetAppId(const base::CommandLine& command_line, } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -16,7 +16,7 @@ index a68953bd7f04a..9e25d6a3aede2 100644 } // namespace StartupProfileMode StartupProfileModeFromReason( -@@ -1470,6 +1477,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( +@@ -1487,6 +1494,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( {profile, mode}, last_opened_profiles); } @@ -29,7 +29,7 @@ index a68953bd7f04a..9e25d6a3aede2 100644 // static void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( const base::CommandLine& command_line, -@@ -1479,6 +1492,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( +@@ -1496,6 +1509,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( return; } @@ -42,7 +42,7 @@ index a68953bd7f04a..9e25d6a3aede2 100644 StartupProfileMode mode = StartupProfileModeFromReason(profile_path_info.reason); diff --git chrome/browser/ui/startup/startup_browser_creator.h chrome/browser/ui/startup/startup_browser_creator.h -index 7ce113b2d3436..4d17c36beebd4 100644 +index fc41cf3c88d9b..e0e51cb9e2dec 100644 --- chrome/browser/ui/startup/startup_browser_creator.h +++ chrome/browser/ui/startup/startup_browser_creator.h @@ -9,6 +9,7 @@ diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 0812e452f..b726648db 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -42,10 +42,10 @@ index 438276b719c2f..69635e429be78 100644 const extensions::Extension* extension = registry->enabled_extensions().GetByID(extension_id); diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index bf59360fb366d..df9547d986cf1 100644 +index 620f0ebad27d3..f36f4a6c5d1ee 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -1011,6 +1011,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1007,6 +1007,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -53,7 +53,7 @@ index bf59360fb366d..df9547d986cf1 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1171,7 +1172,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1167,7 +1168,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -63,7 +63,7 @@ index bf59360fb366d..df9547d986cf1 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1180,7 +1182,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1176,7 +1178,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -73,7 +73,7 @@ index bf59360fb366d..df9547d986cf1 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1190,7 +1193,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1186,7 +1189,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 169ff55fe..2ef265d53 100644 --- a/patch/patches/chrome_renderer.patch +++ b/patch/patches/chrome_renderer.patch @@ -1,5 +1,5 @@ diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn -index fd99154d7744e..ef2ba8773d116 100644 +index b17c8a5f9f9c3..cfa44b65d066a 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index fd99154d7744e..ef2ba8773d116 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -139,6 +140,7 @@ static_library("renderer") { +@@ -136,6 +137,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index fd99154d7744e..ef2ba8773d116 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -247,6 +249,10 @@ static_library("renderer") { +@@ -246,6 +248,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_renderer_print_preview.patch b/patch/patches/chrome_renderer_print_preview.patch index 2513eb1ce..55c363c18 100644 --- a/patch/patches/chrome_renderer_print_preview.patch +++ b/patch/patches/chrome_renderer_print_preview.patch @@ -1,5 +1,5 @@ diff --git chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc -index 64e7654b68578..3cd2486d3fc68 100644 +index 631a01a21a562..33e318e251aa2 100644 --- chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc +++ chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc @@ -25,12 +25,31 @@ diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index 7e6c5c6e4..ba0cf0189 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,8 +1,8 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 73b6ab0934b14..26f9334cdb668 100644 +index c09a805c4ed7b..de89b16690593 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc -@@ -41,6 +41,7 @@ +@@ -37,6 +37,7 @@ #include "base/trace_event/trace_event_impl.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -10,7 +10,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #include "chrome/browser/buildflags.h" #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" -@@ -613,6 +614,9 @@ struct MainFunction { +@@ -608,6 +609,9 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -20,7 +20,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) // In debug builds of Lacros, we keep track of when the user data dir // is initialized, to ensure the cryptohome is not accessed before login -@@ -853,6 +857,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { +@@ -854,6 +858,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { ChromeMainDelegate::~ChromeMainDelegate() = default; #endif // !BUILDFLAG(IS_ANDROID) @@ -31,7 +31,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 std::optional ChromeMainDelegate::PostEarlyInitialization( InvokedIn invoked_in) { DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get()); -@@ -878,7 +886,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -879,7 +887,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( // future session's metrics. DeferBrowserMetrics(user_data_dir); @@ -40,7 +40,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 // In the case the process is not the singleton process, the uninstall tasks // need to be executed here. A window will be displayed asking to close all // running instances. -@@ -1049,7 +1057,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -1069,7 +1077,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( if (base::FeatureList::IsEnabled( features::kWriteBasicSystemProfileToPersistentHistogramsFile)) { @@ -50,7 +50,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #if BUILDFLAG(IS_ANDROID) record = base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions); -@@ -1520,6 +1529,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1505,6 +1514,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -58,7 +58,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 crash_reporter::InitializeCrashKeys(); #if BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -1538,6 +1548,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1523,6 +1533,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -66,7 +66,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #if BUILDFLAG(IS_WIN) child_process_logging::Init(); -@@ -1750,6 +1761,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1733,6 +1744,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } @@ -74,7 +74,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1785,6 +1797,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1768,6 +1780,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -82,7 +82,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 #if BUILDFLAG(ENABLE_PDF) MaybePatchGdiGetFontData(); -@@ -1910,6 +1923,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1893,6 +1906,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -90,7 +90,7 @@ index 73b6ab0934b14..26f9334cdb668 100644 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. const base::CommandLine* command_line = -@@ -1922,6 +1936,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1905,6 +1919,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -98,15 +98,15 @@ index 73b6ab0934b14..26f9334cdb668 100644 } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -2021,6 +2036,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { - channel == version_info::Channel::DEV); - const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process; +@@ -2001,6 +2016,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { + const bool is_browser_process = process_type.empty(); + const bool gwp_asan_boost_sampling = is_browser_process || IsCanaryDev(); + memory_system_ = std::make_unique(); memory_system::Initializer() .SetGwpAsanParameters(gwp_asan_boost_sampling, process_type) - .SetProfilingClientParameters(channel, -@@ -2030,5 +2046,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { + .SetProfilingClientParameters(chrome::GetChannel(), +@@ -2010,5 +2026,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { memory_system::DispatcherParameters:: AllocationTraceRecorderInclusion::kDynamic, process_type) @@ -136,7 +136,7 @@ index 3553377e96017..5207128b768f2 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) std::unique_ptr lacros_service_; diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 1d9bfb1c1d651..6a016c5d55b1e 100644 +index ed96ab7401650..625fd36e74d64 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -52,6 +52,7 @@ @@ -224,7 +224,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 #if BUILDFLAG(IS_MAC) #if defined(ARCH_CPU_X86_64) -@@ -1463,6 +1468,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1459,6 +1464,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->PreMainMessageLoopRun(); #if BUILDFLAG(IS_WIN) @@ -232,7 +232,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 // If the command line specifies 'uninstall' then we need to work here // unless we detect another chrome browser running. if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUninstall)) { -@@ -1474,6 +1480,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1470,6 +1476,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { return ChromeBrowserMainPartsWin::HandleIconsCommands( *base::CommandLine::ForCurrentProcess()); } @@ -240,7 +240,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 ui::SelectFileDialog::SetFactory( std::make_unique()); -@@ -1499,6 +1506,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1495,6 +1502,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // BUILDFLAG(CHROME_FOR_TESTING) @@ -248,7 +248,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMakeDefaultBrowser)) { bool is_managed = g_browser_process->local_state()->IsManagedPreference( -@@ -1512,18 +1520,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1508,18 +1516,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { ? static_cast(content::RESULT_CODE_NORMAL_EXIT) : static_cast(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); } @@ -271,7 +271,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 #if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING) // Begin relaunch processing immediately if User Data migration is required -@@ -1562,7 +1574,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1558,7 +1570,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) @@ -280,7 +280,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 // Check if there is any machine level Chrome installed on the current // machine. If yes and the current Chrome process is user level, we do not // allow the user level Chrome to run. So we notify the user and uninstall -@@ -1571,7 +1583,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1567,7 +1579,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // obtained but before potentially creating the first run sentinel). if (ChromeBrowserMainPartsWin::CheckMachineLevelInstall()) return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; @@ -289,7 +289,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 // Desktop construction occurs here, (required before profile creation). PreProfileInit(); -@@ -1614,12 +1626,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1610,12 +1622,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->local_state()); } @@ -304,7 +304,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 #if BUILDFLAG(IS_ANDROID) page_info::SetPageInfoClient(new ChromePageInfoClient()); -@@ -1646,6 +1660,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1642,6 +1656,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Call `PostProfileInit()`and set it up for profiles created later. profile_init_manager_ = std::make_unique(this, profile); @@ -312,7 +312,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) // Execute first run specific code after the PrefService has been initialized // and preferences have been registered since some of the import code depends -@@ -1685,6 +1700,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1681,6 +1696,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { *base::CommandLine::ForCurrentProcess()); } #endif // BUILDFLAG(IS_WIN) @@ -320,7 +320,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 // Configure modules that need access to resources. net::NetModule::SetResourceProvider(ChromeNetResourceProvider); -@@ -1770,6 +1786,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1766,6 +1782,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { g_browser_process->profile_manager()->GetLastOpenedProfiles(); } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -332,7 +332,7 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 // This step is costly. if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(), base::FilePath(), profile_info, -@@ -1802,11 +1823,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1798,11 +1819,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -348,10 +348,10 @@ index 1d9bfb1c1d651..6a016c5d55b1e 100644 #endif // !BUILDFLAG(IS_ANDROID) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index 2f0fe9d22667c..f50fe7bf75df3 100644 +index 6568351d73ae9..f4a4bd3194c02 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm -@@ -16,6 +16,7 @@ +@@ -18,6 +18,7 @@ #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" #include "build/branding_buildflags.h" @@ -359,7 +359,7 @@ index 2f0fe9d22667c..f50fe7bf75df3 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -105,6 +106,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -107,6 +108,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { } #endif // !BUILDFLAG(CHROME_FOR_TESTING) @@ -367,7 +367,7 @@ index 2f0fe9d22667c..f50fe7bf75df3 100644 // Create the app delegate by requesting the shared AppController. CHECK_EQ(nil, NSApp.delegate); AppController* app_controller = AppController.sharedController; -@@ -113,6 +115,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -115,6 +117,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -375,7 +375,7 @@ index 2f0fe9d22667c..f50fe7bf75df3 100644 ui::WarmScreenCapture(); -@@ -152,5 +155,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, +@@ -155,5 +158,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, } void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { @@ -384,7 +384,7 @@ index 2f0fe9d22667c..f50fe7bf75df3 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 66b50cf0fd99b..4b868cdf4c3ee 100644 +index b07f8f583dabb..94b2acd6ef46e 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -47,6 +47,7 @@ @@ -395,7 +395,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 #include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bluetooth/chrome_bluetooth_delegate_impl_client.h" -@@ -1423,6 +1424,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { +@@ -1462,6 +1463,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { } ChromeContentBrowserClient::ChromeContentBrowserClient() { @@ -404,7 +404,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 #if BUILDFLAG(ENABLE_PLUGINS) extra_parts_.push_back( std::make_unique()); -@@ -1460,6 +1463,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { +@@ -1499,6 +1502,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { } } @@ -416,8 +416,8 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 // static void ChromeContentBrowserClient::RegisterLocalStatePrefs( PrefRegistrySimple* registry) { -@@ -3627,9 +3635,24 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs, - : blink::mojom::PreferredColorScheme::kLight; +@@ -3697,9 +3705,24 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs, + web_prefs->preferred_color_scheme; } #else + auto preferred_color_scheme = native_theme->GetPreferredColorScheme(); @@ -439,10 +439,10 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 web_prefs->preferred_color_scheme = - ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme()); + ToBlinkPreferredColorScheme(preferred_color_scheme); - #endif // BUILDFLAG(IS_ANDROID) - // Reauth WebUI doesn't support dark mode yet because it shares the dialog -@@ -4375,9 +4398,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( + // Update based on the ColorProvider associated with `web_contents`. Depends + // on the browser color mode settings. +@@ -4454,9 +4477,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // BUILDFLAG(IS_ANDROID) @@ -454,7 +454,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -@@ -6484,7 +6509,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( +@@ -6565,7 +6590,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -463,7 +463,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -6502,6 +6527,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( +@@ -6583,6 +6608,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = GetApplicationLocale(); } @@ -472,7 +472,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 } std::vector -@@ -7627,10 +7654,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( +@@ -7698,10 +7725,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( const auto now = base::TimeTicks::Now(); const auto timeout = GetKeepaliveTimerTimeout(context); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); @@ -485,7 +485,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 FROM_HERE, keepalive_deadline_ - now, base::BindOnce( &ChromeContentBrowserClient::OnKeepaliveTimerFired, -@@ -7649,7 +7676,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { +@@ -7720,7 +7747,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { --num_keepalive_requests_; if (num_keepalive_requests_ == 0) { DVLOG(1) << "Stopping the keepalive timer"; @@ -495,7 +495,7 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 // This deletes the keep alive handle attached to the timer function and // unblock the shutdown sequence. } -@@ -7789,7 +7817,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( +@@ -7888,7 +7916,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( const auto now = base::TimeTicks::Now(); const auto then = keepalive_deadline_; if (now < then) { @@ -505,10 +505,10 @@ index 66b50cf0fd99b..4b868cdf4c3ee 100644 base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, weak_factory_.GetWeakPtr(), diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index d8f6e1ea5f843..27172c75e4c3a 100644 +index e21d5dbffda0b..113df89dcd68a 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -144,6 +144,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -145,6 +145,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { ~ChromeContentBrowserClient() override; @@ -517,7 +517,7 @@ index d8f6e1ea5f843..27172c75e4c3a 100644 // TODO(https://crbug.com/787567): This file is about calls from content/ out // to chrome/ to get values or notify about events, but both of these // functions are from chrome/ to chrome/ and don't involve content/ at all. -@@ -681,7 +683,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -682,7 +684,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; @@ -526,7 +526,7 @@ index d8f6e1ea5f843..27172c75e4c3a 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1184,7 +1186,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -1202,7 +1204,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if !BUILDFLAG(IS_ANDROID) uint64_t num_keepalive_requests_ = 0; @@ -536,7 +536,7 @@ index d8f6e1ea5f843..27172c75e4c3a 100644 #endif diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 5eef5cdedda4c..d0c16b6d70585 100644 +index 14c785c5686a8..ed24f5f045006 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -16,6 +16,7 @@ @@ -547,7 +547,7 @@ index 5eef5cdedda4c..d0c16b6d70585 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/invert_bubble_prefs.h" -@@ -195,6 +196,10 @@ +@@ -194,6 +195,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -558,7 +558,7 @@ index 5eef5cdedda4c..d0c16b6d70585 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1679,7 +1684,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1743,7 +1748,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_WIN) @@ -568,7 +568,7 @@ index 5eef5cdedda4c..d0c16b6d70585 100644 downgrade::RegisterPrefs(registry); #endif -@@ -1711,6 +1717,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1779,6 +1785,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); @@ -580,7 +580,7 @@ index 5eef5cdedda4c..d0c16b6d70585 100644 } // Register prefs applicable to all profiles. -@@ -2145,6 +2156,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -2213,6 +2224,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, const std::string& locale) { RegisterProfilePrefs(registry, locale); diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index cbcb75255..8b363f71d 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index 3bf48f1897c93..a9b219500beac 100644 +index 01d45469f3bae..d1bed9648e4a2 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc -@@ -400,6 +400,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( +@@ -401,6 +401,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( // choose to not implement CommandUpdaterDelegate inside this class and // therefore command_updater_ doesn't have the delegate set). if (!SupportsCommand(id) || !IsCommandEnabled(id)) { @@ -10,7 +10,7 @@ index 3bf48f1897c93..a9b219500beac 100644 return false; } -@@ -416,6 +417,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( +@@ -417,6 +418,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( DCHECK(command_updater_.IsCommandEnabled(id)) << "Invalid/disabled command " << id; @@ -24,7 +24,7 @@ index 3bf48f1897c93..a9b219500beac 100644 // The order of commands in this switch statement must match the function // declaration order in browser.h! switch (id) { -@@ -1169,11 +1177,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -1179,11 +1187,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( // BrowserCommandController, private: bool BrowserCommandController::IsShowingMainUI() { @@ -41,10 +41,10 @@ index 3bf48f1897c93..a9b219500beac 100644 bool BrowserCommandController::IsWebAppOrCustomTab() const { diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc -index 8cdbf6a389727..715078e9d0a2c 100644 +index fc51015c70183..52de604f96d9e 100644 --- chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc -@@ -709,6 +709,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( +@@ -728,6 +728,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( } } @@ -102,7 +102,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 } // namespace //////////////////////////////////////////////////////////////////////////////// -@@ -1571,7 +1622,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { +@@ -1572,7 +1623,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { return false; } @@ -111,7 +111,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 GlobalError* error = GlobalErrorServiceFactory::GetForProfile(browser_->profile()) ->GetGlobalErrorByMenuItemCommandID(command_id); -@@ -1586,6 +1637,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { +@@ -1587,6 +1638,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { } } @@ -142,7 +142,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 bool AppMenuModel::IsCommandIdAlerted(int command_id) const { if (command_id == IDC_VIEW_PASSWORDS || command_id == IDC_SHOW_PASSWORD_MANAGER) { -@@ -1753,11 +1828,15 @@ void AppMenuModel::Build() { +@@ -1755,11 +1830,15 @@ void AppMenuModel::Build() { kDefaultIconSize)); } @@ -163,7 +163,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 AddItemWithStringId(IDC_PRINT, IDS_PRINT); -@@ -1870,9 +1949,13 @@ void AppMenuModel::Build() { +@@ -1852,9 +1931,13 @@ void AppMenuModel::Build() { kMoreToolsMenuItem); if (!features::IsChromeRefresh2023()) { @@ -180,7 +180,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 } if (!features::IsChromeRefresh2023()) { -@@ -1961,6 +2044,11 @@ void AppMenuModel::Build() { +@@ -1943,6 +2026,11 @@ void AppMenuModel::Build() { SetCommandIcon(this, IDC_EXIT, kExitMenuIcon); } @@ -193,7 +193,7 @@ index 8cdbf6a389727..715078e9d0a2c 100644 } diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h -index e9d46ee3b2250..0b1b19140c42e 100644 +index c477fba63fd1a..3b9eaad8e1906 100644 --- chrome/browser/ui/toolbar/app_menu_model.h +++ chrome/browser/ui/toolbar/app_menu_model.h @@ -218,6 +218,7 @@ class AppMenuModel : public ui::SimpleMenuModel, @@ -233,7 +233,7 @@ index 0ccfe39eb5696..c9424316b6d14 100644 return gfx::Rect(); } diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index cce1835d35be3..75f8aae063ada 100644 +index 8dd3620ba2720..ab3a92fd7ebe4 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc @@ -114,15 +114,23 @@ ui::ColorProviderKey::SchemeVariant GetSchemeVariant( @@ -411,10 +411,10 @@ index 2e973c9e279b0..8662f9cf14b17 100644 // regenerated. bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type); diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index f764d5edc704c..b7d5ee188736e 100644 +index 110812d2874d7..89b28bdb32d90 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -351,11 +351,10 @@ using content::NativeWebKeyboardEvent; +@@ -346,11 +346,10 @@ using content::NativeWebKeyboardEvent; using content::WebContents; using web_modal::WebContentsModalDialogHost; @@ -429,7 +429,7 @@ index f764d5edc704c..b7d5ee188736e 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) // UMA histograms that record animation smoothness for tab loading animation. -@@ -688,6 +687,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { +@@ -683,6 +682,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { return browser_view_->frame()->GetTopInset() - browser_view_->y(); } @@ -444,7 +444,7 @@ index f764d5edc704c..b7d5ee188736e 100644 bool IsToolbarVisible() const override { return browser_view_->IsToolbarVisible(); } -@@ -839,11 +846,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -834,11 +841,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -467,7 +467,7 @@ index f764d5edc704c..b7d5ee188736e 100644 // Store the actions so that the access is available for other classes. if (features::IsSidePanelPinningEnabled()) { browser_->SetUserData(BrowserActions::UserDataKey(), -@@ -944,8 +961,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -939,8 +956,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_, watermark_view_)); @@ -485,7 +485,7 @@ index f764d5edc704c..b7d5ee188736e 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1022,7 +1046,9 @@ BrowserView::~BrowserView() { +@@ -1017,7 +1041,9 @@ BrowserView::~BrowserView() { // All the tabs should have been destroyed already. If we were closed by the // OS with some tabs than the NativeBrowserFrame should have destroyed them. @@ -495,7 +495,7 @@ index f764d5edc704c..b7d5ee188736e 100644 // Stop the animation timer explicitly here to avoid running it in a nested // message loop, which may run by Browser destructor. -@@ -1036,12 +1062,14 @@ BrowserView::~BrowserView() { +@@ -1031,12 +1057,14 @@ BrowserView::~BrowserView() { // child views and it is an observer for avatar toolbar button if any. autofill_bubble_handler_.reset(); @@ -510,7 +510,7 @@ index f764d5edc704c..b7d5ee188736e 100644 // The TabStrip attaches a listener to the model. Make sure we shut down the // TabStrip first so that it can cleanly remove the listener. -@@ -1065,7 +1093,9 @@ BrowserView::~BrowserView() { +@@ -1060,7 +1088,9 @@ BrowserView::~BrowserView() { // `SidePanelUI::RemoveSidePanelUIForBrowser()` deletes the // SidePanelCoordinator. @@ -520,7 +520,7 @@ index f764d5edc704c..b7d5ee188736e 100644 } // static -@@ -2039,9 +2069,14 @@ void BrowserView::OnExclusiveAccessUserInput() { +@@ -2032,9 +2062,14 @@ void BrowserView::OnExclusiveAccessUserInput() { bool BrowserView::ShouldHideUIForFullscreen() const { // Immersive mode needs UI for the slide-down top panel. @@ -536,7 +536,7 @@ index f764d5edc704c..b7d5ee188736e 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -3172,7 +3207,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { +@@ -3170,7 +3205,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { } DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() { @@ -546,7 +546,7 @@ index f764d5edc704c..b7d5ee188736e 100644 if (auto* download_button = toolbar_button_provider_->GetDownloadButton()) return download_button->bubble_controller(); return nullptr; -@@ -3727,7 +3763,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { +@@ -3725,7 +3761,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { if (top_container()->parent() == this) return; @@ -556,7 +556,7 @@ index f764d5edc704c..b7d5ee188736e 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -4209,11 +4246,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { +@@ -4207,11 +4244,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { bool BrowserView::ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) { @@ -597,7 +597,7 @@ index f764d5edc704c..b7d5ee188736e 100644 // Draggable regions are defined relative to the web contents. gfx::Point point_in_contents_web_view_coords(location); views::View::ConvertPointToTarget(GetWidget()->GetRootView(), -@@ -4222,7 +4286,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( +@@ -4220,7 +4284,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( // Draggable regions should be ignored for clicks into any browser view's // owned widgets, for example alerts, permission prompts or find bar. @@ -606,7 +606,7 @@ index f764d5edc704c..b7d5ee188736e 100644 point_in_contents_web_view_coords.x(), point_in_contents_web_view_coords.y()) || WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords); -@@ -4333,8 +4397,10 @@ void BrowserView::Layout(PassKey) { +@@ -4331,8 +4395,10 @@ void BrowserView::Layout(PassKey) { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -619,7 +619,7 @@ index f764d5edc704c..b7d5ee188736e 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -4400,6 +4466,11 @@ void BrowserView::AddedToWidget() { +@@ -4398,6 +4464,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -631,7 +631,7 @@ index f764d5edc704c..b7d5ee188736e 100644 toolbar_->Init(); // TODO(pbos): Investigate whether the side panels should be creatable when -@@ -4448,13 +4519,9 @@ void BrowserView::AddedToWidget() { +@@ -4445,13 +4516,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -647,7 +647,7 @@ index f764d5edc704c..b7d5ee188736e 100644 using_native_frame_ = frame_->ShouldUseNativeFrame(); MaybeInitializeWebUITabStrip(); -@@ -4885,7 +4952,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, +@@ -4882,7 +4949,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, // Undo our anti-jankiness hacks and force a re-layout. in_process_fullscreen_ = false; ToolbarSizeChanged(false); @@ -657,7 +657,7 @@ index f764d5edc704c..b7d5ee188736e 100644 } bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { -@@ -5307,6 +5375,8 @@ Profile* BrowserView::GetProfile() { +@@ -5304,6 +5372,8 @@ Profile* BrowserView::GetProfile() { } void BrowserView::UpdateUIForTabFullscreen() { @@ -666,7 +666,7 @@ index f764d5edc704c..b7d5ee188736e 100644 frame()->GetFrameView()->UpdateFullscreenTopUI(); } -@@ -5329,6 +5399,8 @@ void BrowserView::HideDownloadShelf() { +@@ -5326,6 +5396,8 @@ void BrowserView::HideDownloadShelf() { } bool BrowserView::CanUserExitFullscreen() const { @@ -676,10 +676,10 @@ index f764d5edc704c..b7d5ee188736e 100644 } diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 836b5aa549183..a336aca64101d 100644 +index 46cdfe23b1234..14cbb302de0a2 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -137,11 +137,16 @@ class BrowserView : public BrowserWindow, +@@ -138,11 +138,16 @@ class BrowserView : public BrowserWindow, METADATA_HEADER(BrowserView, views::ClientView) public: @@ -696,7 +696,7 @@ index 836b5aa549183..a336aca64101d 100644 void set_frame(BrowserFrame* frame) { frame_ = frame; paint_as_active_subscription_ = -@@ -863,6 +868,9 @@ class BrowserView : public BrowserWindow, +@@ -873,6 +878,9 @@ class BrowserView : public BrowserWindow, const gfx::Rect& contents_webview_bounds, const gfx::Rect& local_webview_container_bounds); @@ -707,7 +707,7 @@ index 836b5aa549183..a336aca64101d 100644 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc -index 0991a57cccfe8..3ed3d43497460 100644 +index 07bc84fe5ed23..9d05d8918fa3d 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc @@ -48,6 +48,10 @@ @@ -825,7 +825,7 @@ index 71445bfab1824..c77750ea2a820 100644 ContentsWebView::~ContentsWebView() { diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc -index ee9e4cf7d4d92..e6c53660a4407 100644 +index b1662191f0967..245895ab7bd37 100644 --- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc +++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc @@ -610,6 +610,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( @@ -926,10 +926,10 @@ index b862ceac7225d..9575440a77d67 100644 LocationBarView* location_bar_view = browser_view_->GetLocationBarView(); CHECK(location_bar_view); diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc -index 55d99c5f53e92..172ac465b6f21 100644 +index db003cd7f8329..9ba9064ef0563 100644 --- chrome/browser/ui/views/page_action/page_action_icon_controller.cc +++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc -@@ -97,6 +97,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, +@@ -95,6 +95,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, }; for (PageActionIconType type : params.types_enabled) { @@ -943,7 +943,7 @@ index 55d99c5f53e92..172ac465b6f21 100644 case PageActionIconType::kPaymentsOfferNotification: add_page_action_icon( diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index a8fc1df0e8fae..cc496ba91716e 100644 +index 880d83324cfa6..a6a80cd0b3def 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -554,29 +554,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -989,7 +989,7 @@ index a8fc1df0e8fae..cc496ba91716e 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index d65dc839c20e7..cf4caa7301108 100644 +index e97342ef97514..e373f6374fa4c 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc @@ -191,7 +191,7 @@ class TabstripLikeBackground : public views::Background { @@ -1083,7 +1083,7 @@ index d65dc839c20e7..cf4caa7301108 100644 if (companion::IsCompanionFeatureEnabled()) { side_panel_container_ = container_view_->AddChildView( std::make_unique(browser_view_)); -@@ -811,7 +828,7 @@ void ToolbarView::Layout(PassKey) { +@@ -818,7 +835,7 @@ void ToolbarView::Layout(PassKey) { if (display_mode_ == DisplayMode::NORMAL) { LayoutCommon(); @@ -1093,7 +1093,7 @@ index d65dc839c20e7..cf4caa7301108 100644 } } diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 325b73a399d3f..9242aed24ef35 100644 +index 1163e52e738ce..e70ebde66fb25 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h @@ -93,7 +93,8 @@ class ToolbarView : public views::AccessiblePaneView, @@ -1106,68 +1106,3 @@ index 325b73a399d3f..9242aed24ef35 100644 ToolbarView(const ToolbarView&) = delete; ToolbarView& operator=(const ToolbarView&) = delete; ~ToolbarView() override; -diff --git chrome/browser/ui/web_applications/draggable_region_host_impl.cc chrome/browser/ui/web_applications/draggable_region_host_impl.cc -index 8980b03f2c945..831f6dd681cb9 100644 ---- chrome/browser/ui/web_applications/draggable_region_host_impl.cc -+++ chrome/browser/ui/web_applications/draggable_region_host_impl.cc -@@ -11,6 +11,28 @@ - #include "chrome/common/chrome_features.h" - #include "mojo/public/cpp/bindings/self_owned_receiver.h" - -+namespace { -+ -+bool IsSupported(Browser* browser) { -+ // May be nullptr when running with Alloy style. -+ if (!browser) -+ return false; -+ -+ if (web_app::AppBrowserController::IsWebApp(browser)) -+ return true; -+ -+#if BUILDFLAG(ENABLE_CEF) -+ if (browser->cef_delegate() && -+ browser->cef_delegate()->SupportsDraggableRegion()) { -+ return true; -+ } -+#endif -+ -+ return false; -+} -+ -+} // namespace -+ - DraggableRegionsHostImpl::DraggableRegionsHostImpl( - content::RenderFrameHost& render_frame_host, - mojo::PendingReceiver receiver) -@@ -28,7 +50,7 @@ void DraggableRegionsHostImpl::CreateIfAllowed( - auto* browser = chrome::FindBrowserWithTab(web_contents); - - // We only want to bind the receiver for PWAs. -- if (!web_app::AppBrowserController::IsWebApp(browser)) -+ if (!IsSupported(browser)) - return; - - // The object is bound to the lifetime of |render_frame_host| and the mojo -@@ -43,7 +65,7 @@ void DraggableRegionsHostImpl::UpdateDraggableRegions( - auto* browser = chrome::FindBrowserWithTab(web_contents); - // When a WebApp browser's WebContents is reparented to a tabbed browser, a - // draggable regions update may race with the reparenting logic. -- if (!web_app::AppBrowserController::IsWebApp(browser)) -+ if (!IsSupported(browser)) - return; - - SkRegion sk_region; -@@ -56,5 +78,12 @@ void DraggableRegionsHostImpl::UpdateDraggableRegions( - } - - auto* app_browser_controller = browser->app_controller(); -- app_browser_controller->UpdateDraggableRegion(sk_region); -+ if (app_browser_controller) { -+ app_browser_controller->UpdateDraggableRegion(sk_region); -+ } -+#if BUILDFLAG(ENABLE_CEF) -+ else { -+ browser->cef_delegate()->UpdateDraggableRegion(sk_region); -+ } -+#endif - } diff --git a/patch/patches/chrome_sad_tab_error.patch b/patch/patches/chrome_sad_tab_error.patch index 3e9fef395..132199f2a 100644 --- a/patch/patches/chrome_sad_tab_error.patch +++ b/patch/patches/chrome_sad_tab_error.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/sad_tab_view.cc chrome/browser/ui/views/sad_tab_view.cc -index 5a3aa5c05907e..3630c7496fb70 100644 +index 0418f446e46ce..541b8389e7c88 100644 --- chrome/browser/ui/views/sad_tab_view.cc +++ chrome/browser/ui/views/sad_tab_view.cc -@@ -680,6 +680,11 @@ void SadTabView::OnBoundsChanged(const gfx::Rect& previous_bounds) { +@@ -684,6 +684,11 @@ void SadTabView::OnBoundsChanged(const gfx::Rect& previous_bounds) { title_->SizeToFit(max_width); } diff --git a/patch/patches/chrome_utility_client.patch b/patch/patches/chrome_utility_client.patch index 5b4916b58..94aaa2131 100644 --- a/patch/patches/chrome_utility_client.patch +++ b/patch/patches/chrome_utility_client.patch @@ -1,5 +1,5 @@ diff --git chrome/utility/chrome_content_utility_client.cc chrome/utility/chrome_content_utility_client.cc -index e070f862c3492..fdf448397fb3e 100644 +index c15d1fa6d6e25..b89a663d2664f 100644 --- chrome/utility/chrome_content_utility_client.cc +++ chrome/utility/chrome_content_utility_client.cc @@ -13,6 +13,7 @@ @@ -10,7 +10,7 @@ index e070f862c3492..fdf448397fb3e 100644 #include "chrome/common/chrome_paths.h" #include "chrome/common/profiler/thread_profiler.h" #include "chrome/common/profiler/thread_profiler_configuration.h" -@@ -61,7 +62,8 @@ void ChromeContentUtilityClient::UtilityThreadStarted() { +@@ -54,7 +55,8 @@ void ChromeContentUtilityClient::UtilityThreadStarted() { command_line->GetSwitchValueASCII(switches::kProcessType); // An in-process utility thread may run in other processes, only set up // collector in a utility process. diff --git a/patch/patches/chrome_watermark_5388128.patch b/patch/patches/chrome_watermark_5388128.patch deleted file mode 100644 index 4f804a31b..000000000 --- a/patch/patches/chrome_watermark_5388128.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git chrome/browser/enterprise/watermark/watermark_view.cc chrome/browser/enterprise/watermark/watermark_view.cc -index f48b59cd4fe50..3ed5a896a142c 100644 ---- chrome/browser/enterprise/watermark/watermark_view.cc -+++ chrome/browser/enterprise/watermark/watermark_view.cc -@@ -8,6 +8,7 @@ - #include - #include - -+#include "base/no_destructor.h" - #include "cc/paint/paint_canvas.h" - #include "ui/base/metadata/metadata_impl_macros.h" - #include "ui/compositor/layer.h" -@@ -27,8 +28,8 @@ constexpr double kRotationAngle = 45; - constexpr SkColor kFillColor = SkColorSetARGB(0x12, 0x00, 0x00, 0x00); - constexpr SkColor kOutlineColor = SkColorSetARGB(0x27, 0xff, 0xff, 0xff); - --const gfx::Font& WatermarkFont() { -- static gfx::Font font( -+gfx::Font WatermarkFont() { -+ return gfx::Font( - #if BUILDFLAG(IS_WIN) - "Segoe UI", - #elif BUILDFLAG(IS_MAC) -@@ -41,7 +42,6 @@ const gfx::Font& WatermarkFont() { - "sans-serif", - #endif - kTextSize); -- return font; - } - - gfx::Font::Weight WatermarkFontWeight() { -@@ -53,8 +53,8 @@ gfx::Font::Weight WatermarkFontWeight() { - } - - const gfx::FontList& WatermarkFontList() { -- static gfx::FontList font_list(WatermarkFont()); -- return font_list; -+ static base::NoDestructor font_list(WatermarkFont()); -+ return *font_list; - } - - std::unique_ptr CreateRenderText(const gfx::Rect& display_rect, diff --git a/patch/patches/clang_format_includes.patch b/patch/patches/clang_format_includes.patch new file mode 100644 index 000000000..eb6ebc479 --- /dev/null +++ b/patch/patches/clang_format_includes.patch @@ -0,0 +1,48 @@ +diff --git .clang-format .clang-format +index 87ff0884ee821..5a40766bbe63e 100644 +--- .clang-format ++++ .clang-format +@@ -12,43 +12,6 @@ Standard: Cpp11 + InsertBraces: true + InsertNewlineAtEOF: true + +-# Sort #includes by following +-# https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes +-# +-# ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#includeblocks +-IncludeBlocks: Regroup +-# ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#includecategories +-IncludeCategories: +- # The win32 api has all sorts of implicit include order dependencies :-/ +- # Give a few headers special priorities that make sure they appear before +- # all other headers. +- # Sync this with SerializeIncludes in tools/add_header.py. +- # TODO(crbug.com/329138753): remove include sorting from tools/add_header.py +- # after confirming clang-format sort works well. +- # LINT.IfChange(winheader) +- - Regex: '^' # This has to be before initguid.h. +- Priority: 1 +- - Regex: '^<(initguid|mmdeviceapi|windows|winsock2|ws2tcpip|shobjidl|atlbase|ole2|unknwn|tchar)\.h>' +- Priority: 2 +- # LINT.ThenChange(/tools/add_header.py:winheader) +- # UIAutomation*.h need to be after base/win/atl.h. +- # Note the low priority number. +- - Regex: '^' +- Priority: 6 +- # Other C system headers. +- - Regex: '^<.*\.h>' +- Priority: 3 +- # C++ standard library headers. +- - Regex: '^<.*' +- Priority: 4 +- # Other libraries. +- - Regex: '.*' +- Priority: 5 +-# ref: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#includeismainregex +-IncludeIsMainRegex: "\ +-(_(32|64|android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?\ +-(_(unit|browser|perf)?tests?)?$" +- + # Make sure code like: + # IPC_BEGIN_MESSAGE_MAP() + # IPC_MESSAGE_HANDLER(WidgetHostViewHost_Update, OnUpdate) diff --git a/patch/patches/color_provider_manager_3610.patch b/patch/patches/color_provider_manager_3610.patch index 1b00599af..a52142adf 100644 --- a/patch/patches/color_provider_manager_3610.patch +++ b/patch/patches/color_provider_manager_3610.patch @@ -102,4 +102,3 @@ index 67341dd5fc3d6..ee70de7f7fd44 100644 }; } // namespace ui - diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 2f9224c6c..890f31f63 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -33,7 +33,7 @@ index d69f9d4641613..e88aaf8617c52 100644 MouseWheelPhaseHandler(RenderWidgetHostViewBase* const host_view); diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h -index 1a1a07dad71dd..42048c360e797 100644 +index 09d80f2ba678d..5dbff44c280a1 100644 --- content/browser/renderer_host/input/synthetic_gesture_target_base.h +++ content/browser/renderer_host/input/synthetic_gesture_target_base.h @@ -8,6 +8,7 @@ @@ -68,7 +68,7 @@ index 6af484f35f576..2462700b6d1fb 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index fcd7f310c8b3b..eaa5f17a011d5 100644 +index 6af8af9ed5f95..4cf7b7a56f07a 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -38,6 +38,7 @@ component("controller") { @@ -79,7 +79,7 @@ index fcd7f310c8b3b..eaa5f17a011d5 100644 "//third_party/blink/renderer:config", "//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:non_test_config", -@@ -63,6 +64,8 @@ component("controller") { +@@ -65,6 +66,8 @@ component("controller") { "performance_manager/v8_detailed_memory_reporter_impl.h", "performance_manager/v8_worker_memory_reporter.cc", "performance_manager/v8_worker_memory_reporter.h", diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 79612f6b8..b86172e89 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index b7430b7d7027f..721144dde86d8 100644 +index 724be962f293c..88260e45c55ad 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -589,7 +589,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -591,7 +591,7 @@ void DevToolsHttpHandler::OnJsonRequest( base::Value::Dict version; version.Set("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.Set("WebKit-Version", GetWebKitVersion()); @@ -12,10 +12,10 @@ index b7430b7d7027f..721144dde86d8 100644 version.Set("V8-Version", V8_VERSION_STRING); std::string host = info.GetHeaderValue("host"); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index a6312cc67ff70..bcf78a6fbf59d 100644 +index 7bd47c28bab3e..38258cbd9641a 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -843,7 +843,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( +@@ -849,7 +849,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( mojo::PendingRemote terminal_external_protocol; bool handled = GetContentClient()->browser()->HandleExternalProtocol( @@ -24,7 +24,7 @@ index a6312cc67ff70..bcf78a6fbf59d 100644 frame_tree_node->frame_tree_node_id(), navigation_ui_data, request_info.is_primary_main_frame, frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags, -@@ -855,6 +855,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( +@@ -861,6 +861,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( *request_info.initiator_document_token) : nullptr, &terminal_external_protocol); @@ -47,10 +47,10 @@ index a6312cc67ff70..bcf78a6fbf59d 100644 return std::make_pair( /*is_cacheable=*/false, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index f697700af13bb..a4ff32f2357b6 100644 +index d2975a6c36e2c..70040d91977ca 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc -@@ -1087,7 +1087,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( +@@ -1090,7 +1090,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( void ContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) {} @@ -59,7 +59,7 @@ index f697700af13bb..a4ff32f2357b6 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1096,6 +1096,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( +@@ -1099,6 +1099,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = "en-us,en"; @@ -68,10 +68,10 @@ index f697700af13bb..a4ff32f2357b6 100644 std::vector diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 6135759cb7f39..6c1a6fc6c5f76 100644 +index 6aea068af5ab0..82f40ed3b70fb 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -2056,7 +2056,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2061,7 +2061,7 @@ class CONTENT_EXPORT ContentBrowserClient { // // If |relative_partition_path| is the empty string, it means this needs to // create the default NetworkContext for the BrowserContext. @@ -80,7 +80,7 @@ index 6135759cb7f39..6c1a6fc6c5f76 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -2277,6 +2277,21 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2282,6 +2282,21 @@ class CONTENT_EXPORT ContentBrowserClient { RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory); @@ -102,7 +102,7 @@ index 6135759cb7f39..6c1a6fc6c5f76 100644 // Creates an OverlayWindow to be used for video or Picture-in-Picture. // This window will house the content shown when in Picture-in-Picture mode. // This will return a new OverlayWindow. -@@ -2334,6 +2349,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2339,6 +2354,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -114,12 +114,12 @@ index 6135759cb7f39..6c1a6fc6c5f76 100644 // on blink::features::kUserAgentReduction. Content may cache this value. virtual std::string GetUserAgent(); diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 4399fe2564a03..27837055b2133 100644 +index a062418a22ec9..9b97b77a1f916 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -103,6 +103,9 @@ class CONTENT_EXPORT ContentRendererClient { - // binding requests from RenderProcessHost::BindReceiver(). - virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} +@@ -108,6 +108,9 @@ class CONTENT_EXPORT ContentRendererClient { + // a crash handler (such as crashpad) is already in use. + virtual void SetUpWebAssemblyTrapHandler(); + // Notifies that the RenderThread can now send sync IPC messages. + virtual void RenderThreadConnected() {} @@ -127,7 +127,7 @@ index 4399fe2564a03..27837055b2133 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -327,6 +330,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -337,6 +340,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -139,10 +139,10 @@ index 4399fe2564a03..27837055b2133 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 3594bc7a25c95..198eed029d65d 100644 +index d38d1cbd515be..7ac2dfe95fdd0 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -545,6 +545,8 @@ void RenderThreadImpl::Init() { +@@ -548,6 +548,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -152,10 +152,10 @@ index 3594bc7a25c95..198eed029d65d 100644 base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 033169bbdd94d..f8bd867f76eba 100644 +index 81b4ff933b5d9..859ad94d4c224 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1009,6 +1009,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -1001,6 +1001,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -172,10 +172,10 @@ index 033169bbdd94d..f8bd867f76eba 100644 RendererBlinkPlatformImpl::CreateWebV8ValueConverter() { return std::make_unique(); diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 89fd49fe34afa..98f9b71b7c259 100644 +index d5ab3967f21cc..b6494070f6840 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -237,6 +237,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -236,6 +236,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { InertAndMinimumIntervalOfUserLevelMemoryPressureSignal() override; #endif // BUILDFLAG(IS_ANDROID) @@ -186,10 +186,10 @@ index 89fd49fe34afa..98f9b71b7c259 100644 // plus eTLD+1, such as https://google.com), or to a more specific origin. void SetIsLockedToSite(); diff --git content/shell/browser/shell_content_browser_client.cc content/shell/browser/shell_content_browser_client.cc -index 74273b9ed981f..9baaec119d346 100644 +index 5f2cc5ce07558..8e3324ebefc12 100644 --- content/shell/browser/shell_content_browser_client.cc +++ content/shell/browser/shell_content_browser_client.cc -@@ -732,7 +732,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( +@@ -734,7 +734,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -198,7 +198,7 @@ index 74273b9ed981f..9baaec119d346 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -741,6 +741,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( +@@ -743,6 +743,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { ConfigureNetworkContextParamsForShell(context, network_context_params, cert_verifier_creation_params); @@ -220,10 +220,10 @@ index f73d9b1264238..145052c3cadd4 100644 bool in_memory, const base::FilePath& relative_partition_path, diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc -index fa3257b02184a..f770c7961f46d 100644 +index 9e6c52dab9abb..e5c3bc53e27d3 100644 --- headless/lib/browser/headless_content_browser_client.cc +++ headless/lib/browser/headless_content_browser_client.cc -@@ -299,7 +299,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed( +@@ -297,7 +297,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed( return true; } @@ -232,7 +232,7 @@ index fa3257b02184a..f770c7961f46d 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -309,6 +309,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams( +@@ -307,6 +307,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams( HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams( in_memory, relative_partition_path, network_context_params, cert_verifier_creation_params); diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 6380e30e2..ad489ba27 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -12,10 +12,10 @@ index 79ba3ac1913f8..46bcb4366d2f8 100644 if (main_argv) setproctitle_init(main_argv); diff --git content/app/content_main.cc content/app/content_main.cc -index ffbb5986ca997..9f77c4603bf55 100644 +index 91feb21f4249e..88643fdeb4c4c 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -175,11 +175,8 @@ ContentMainParams::~ContentMainParams() = default; +@@ -174,11 +174,8 @@ ContentMainParams::~ContentMainParams() = default; ContentMainParams::ContentMainParams(ContentMainParams&&) = default; ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default; @@ -29,7 +29,7 @@ index ffbb5986ca997..9f77c4603bf55 100644 base::FeatureList::FailOnFeatureAccessWithoutFeatureList(); #if BUILDFLAG(IS_CHROMEOS_LACROS) // Lacros is launched with inherited priority. Revert to normal priority -@@ -187,9 +184,6 @@ RunContentProcess(ContentMainParams params, +@@ -186,9 +183,6 @@ RunContentProcess(ContentMainParams params, base::PlatformThread::SetCurrentThreadType(base::ThreadType::kDefault); #endif int exit_code = -1; @@ -39,7 +39,7 @@ index ffbb5986ca997..9f77c4603bf55 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -275,21 +269,14 @@ RunContentProcess(ContentMainParams params, +@@ -274,20 +268,13 @@ RunContentProcess(ContentMainParams params, #endif #if BUILDFLAG(IS_MAC) @@ -57,21 +57,21 @@ index ffbb5986ca997..9f77c4603bf55 100644 + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + #if BUILDFLAG(IS_IOS) - // TODO(crbug.com/1412835): We support multiprocess launch of the content - // process, but for now networking and GPU are still in process. + base::ConditionVariable::InitializeFeatures(); - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - command_line->AppendSwitch(switches::kInProcessGPU); command_line->AppendSwitch(switches::kEnableViewport); command_line->AppendSwitch(switches::kUseMobileUserAgent); -@@ -308,19 +295,20 @@ RunContentProcess(ContentMainParams params, + #endif +@@ -304,19 +291,19 @@ RunContentProcess(ContentMainParams params, + } #if BUILDFLAG(IS_WIN) - // Route stdio to parent console (if any) or create one. -- if (base::CommandLine::ForCurrentProcess()->HasSwitch( -- switches::kEnableLogging)) { -- base::RouteStdioToConsole(/*create_console_if_not_found*/ true); -- } else if (base::CommandLine::ForCurrentProcess()->HasSwitch( -- switches::kHeadless)) { +- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); +- if (command_line->HasSwitch(switches::kHeadless)) { +- // When running in headless mode we want stdio routed however if +- // console does not exist we should not create one. +- base::RouteStdioToConsole(/*create_console_if_not_found*/ false); +- } else if (command_line->HasSwitch(switches::kEnableLogging)) { + if (command_line->HasSwitch(switches::kEnableLogging)) { + // Don't route to console for "handle" type in child processes. + if (command_line->GetSwitchValueASCII(switches::kEnableLogging) != @@ -79,9 +79,8 @@ index ffbb5986ca997..9f77c4603bf55 100644 + base::RouteStdioToConsole(/*create_console_if_not_found*/ true); + } + } else if (command_line->HasSwitch(switches::kHeadless)) { - // When running in headless mode we want stdio routed however if - // console does not exist we should not create one. - base::RouteStdioToConsole(/*create_console_if_not_found*/ false); + // Route stdio to parent console (if any) or create one. + base::RouteStdioToConsole(/*create_console_if_not_found*/ true); } #endif @@ -91,7 +90,7 @@ index ffbb5986ca997..9f77c4603bf55 100644 base::trace_event::TraceConfig trace_config = tracing::GetConfigForTraceToConsole(); base::trace_event::TraceLog::GetInstance()->SetEnabled( -@@ -330,12 +318,46 @@ RunContentProcess(ContentMainParams params, +@@ -326,12 +313,46 @@ RunContentProcess(ContentMainParams params, if (IsSubprocess()) CommonSubprocessInit(); @@ -140,10 +139,10 @@ index ffbb5986ca997..9f77c4603bf55 100644 } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 824026e6e2bd6..7de0c987dfd3d 100644 +index faa4e5ced67f3..946f26d2c5fe7 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -46,6 +46,7 @@ +@@ -47,6 +47,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/hang_watcher.h" #include "base/threading/platform_thread.h" @@ -151,7 +150,7 @@ index 824026e6e2bd6..7de0c987dfd3d 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1339,6 +1340,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1338,6 +1339,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } diff --git a/patch/patches/content_renderer_host_3617.patch b/patch/patches/content_renderer_host_3617.patch index e36d3e12e..434aef57d 100644 --- a/patch/patches/content_renderer_host_3617.patch +++ b/patch/patches/content_renderer_host_3617.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index ddeef4098ed42..efffb37ee704a 100644 +index 1dcae1e41f4dc..43951c1c55f1a 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc @@ -1624,7 +1624,8 @@ bool RenderProcessHostImpl::Init() { diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index e408c39d1..9b6051337 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -47,10 +47,10 @@ index 37e2d2a50aa2c..bb6ac82cd9cb7 100644 source_set("dll_hash") { diff --git chrome/chrome_elf/crash/crash_helper.cc chrome/chrome_elf/crash/crash_helper.cc -index 27a803784eb9e..a8b033f475cb4 100644 +index 30a2c1adc4509..b60a7afaf1e5e 100644 --- chrome/chrome_elf/crash/crash_helper.cc +++ chrome/chrome_elf/crash/crash_helper.cc -@@ -11,12 +11,17 @@ +@@ -12,12 +12,17 @@ #include #include @@ -68,7 +68,7 @@ index 27a803784eb9e..a8b033f475cb4 100644 namespace { // Crash handling from elf is only enabled for the chrome.exe process. -@@ -77,7 +82,11 @@ bool InitializeCrashReporting() { +@@ -78,7 +83,11 @@ bool InitializeCrashReporting() { g_crash_reports = new std::vector; g_set_unhandled_exception_filter = new elf_hook::IATHook(); @@ -81,7 +81,7 @@ index 27a803784eb9e..a8b033f475cb4 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index 2f69ae87fd93d..69a1bb6e008b4 100644 +index 81fb33468431c..9b0d500e37452 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -6,6 +6,8 @@ @@ -93,7 +93,7 @@ index 2f69ae87fd93d..69a1bb6e008b4 100644 #include "base/base_switches.h" #include "base/command_line.h" #include "base/format_macros.h" -@@ -100,8 +102,10 @@ void HandleEnableDisableFeatures(const base::CommandLine& command_line) { +@@ -99,8 +101,10 @@ void HandleEnableDisableFeatures(const base::CommandLine& command_line) { "commandline-disabled-feature"); } @@ -105,7 +105,7 @@ index 2f69ae87fd93d..69a1bb6e008b4 100644 static const char* const kIgnoreSwitches[] = { switches::kEnableLogging, switches::kFlagSwitchesBegin, -@@ -160,11 +164,9 @@ bool IsBoringSwitch(const std::string& flag) { +@@ -159,11 +163,9 @@ bool IsBoringSwitch(const std::string& flag) { return false; } @@ -117,12 +117,20 @@ index 2f69ae87fd93d..69a1bb6e008b4 100644 + SetSwitchesFromCommandLine(command_line, &IsBoringChromeSwitch); } - void SetActiveExtensions(const std::set& extensions) { + } // namespace crash_keys diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h -index d802db81c88ef..f78029680e366 100644 +index 710f553034881..dd1e61f9e194b 100644 --- chrome/common/crash_keys.h +++ chrome/common/crash_keys.h -@@ -16,6 +16,10 @@ class CommandLine; +@@ -5,12 +5,18 @@ + #ifndef CHROME_COMMON_CRASH_KEYS_H_ + #define CHROME_COMMON_CRASH_KEYS_H_ + ++#include ++ + namespace base { + class CommandLine; + } namespace crash_keys { @@ -262,10 +270,10 @@ index a604df7a5ea6a..618fbde10a65c 100644 } // namespace crash_reporter diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc -index a18afed5b55c1..fabb36a299cd9 100644 +index 4a25417a565fd..a7a1d451b56f9 100644 --- components/crash/core/app/crashpad.cc +++ components/crash/core/app/crashpad.cc -@@ -129,7 +129,8 @@ bool InitializeCrashpadImpl(bool initial_client, +@@ -137,7 +137,8 @@ bool InitializeCrashpadImpl(bool initial_client, // fallback. Forwarding is turned off for debug-mode builds even for the // browser process, because the system's crash reporter can take a very long // time to chew on symbols. diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index 0d00b6cad..28e777aa0 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,5 +1,5 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index 205d12a97caac..66044c559d0cc 100644 +index 1a388cf3b3c0b..f570a2e1f396b 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -18,6 +18,7 @@ diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 0f6fa9895..07213d0f5 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc -index 5ee79cf7fefb1..a84750a496095 100644 +index 96a290eef86ca..6513a365cddf0 100644 --- chrome/browser/extensions/api/streams_private/streams_private_api.cc +++ chrome/browser/extensions/api/streams_private/streams_private_api.cc @@ -6,6 +6,7 @@ @@ -39,8 +39,8 @@ index 5ee79cf7fefb1..a84750a496095 100644 @@ -80,9 +87,18 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( // forms of zooming won't work). - // TODO(1042323): Present a coherent representation of a tab id for portal - // contents. + // TODO(crbug.com/40114809): Present a coherent representation of a tab id for + // portal contents. - int tab_id = web_contents->GetOuterWebContents() - ? SessionID::InvalidValue().id() - : ExtensionTabUtil::GetTabId(web_contents); @@ -60,10 +60,10 @@ index 5ee79cf7fefb1..a84750a496095 100644 std::unique_ptr stream_container( new StreamContainer(tab_id, embedded, handler_url, extension_id, diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 0035aedce82f0..861288525b291 100644 +index 5a0ba568bf30c..8ef4be85e038a 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc -@@ -104,12 +104,13 @@ ExtensionHost::ExtensionHost(const Extension* extension, +@@ -142,12 +142,13 @@ ExtensionHost::ExtensionHost(const Extension* extension, host_type == mojom::ViewType::kOffscreenDocument || host_type == mojom::ViewType::kExtensionPopup || host_type == mojom::ViewType::kExtensionSidePanel); @@ -79,8 +79,8 @@ index 0035aedce82f0..861288525b291 100644 + SetViewType(host_contents_, host_type); main_frame_host_ = host_contents_->GetPrimaryMainFrame(); - // Listen for when an extension is unloaded from the same profile, as it may -@@ -125,11 +126,49 @@ ExtensionHost::ExtensionHost(const Extension* extension, + if (host_type == mojom::ViewType::kExtensionBackgroundPage) { +@@ -167,11 +168,49 @@ ExtensionHost::ExtensionHost(const Extension* extension, // Create password reuse detection manager when new extension web contents are // created. ExtensionsBrowserClient::Get()->CreatePasswordReuseDetectionManager( diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index b3efe1e4f..6c1cdf7d1 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index afe0b3e90fafb..daae3b0e0e8d3 100644 +index e6f5cbc9c49f9..f64ed7ae77ea1 100644 --- .gn +++ .gn -@@ -153,6 +153,8 @@ exec_script_whitelist = +@@ -155,6 +155,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", "//chrome/version.gni", @@ -12,10 +12,10 @@ index afe0b3e90fafb..daae3b0e0e8d3 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 4b37258f1bbba..5106ced723dba 100644 +index 357f7117f8737..724ddd9d61110 100644 --- BUILD.gn +++ BUILD.gn -@@ -19,6 +19,7 @@ import("//build/config/sanitizers/sanitizers.gni") +@@ -20,6 +20,7 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//build/gn_logs.gni") import("//build/util/generate_wrapper.gni") @@ -23,7 +23,7 @@ index 4b37258f1bbba..5106ced723dba 100644 import("//components/enterprise/buildflags/buildflags.gni") import("//components/nacl/features.gni") import("//device/vr/buildflags/buildflags.gni") -@@ -274,6 +275,10 @@ group("gn_all") { +@@ -275,6 +276,10 @@ group("gn_all") { deps += root_extra_deps @@ -76,7 +76,7 @@ index 1da479dd5eebc..ff9c7e467997c 100644 - visual_studio_runtime_dirs = [] } diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 74acbe3a64b73..b148042d9df1e 100644 +index 8acc61076fcf6..4887fe263669c 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -5,6 +5,7 @@ @@ -99,7 +99,7 @@ index 74acbe3a64b73..b148042d9df1e 100644 sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] deps += [ "//extensions:extensions_browser_resources" ] diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni -index c43aa5873d96a..68978caa5b96b 100644 +index 064c39ffe307e..c430ab71419cb 100644 --- chrome/chrome_repack_locales.gni +++ chrome/chrome_repack_locales.gni @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni") @@ -110,7 +110,7 @@ index c43aa5873d96a..68978caa5b96b 100644 import("//extensions/buildflags/buildflags.gni") import("//tools/grit/repack.gni") -@@ -97,6 +98,10 @@ template("chrome_repack_locales") { +@@ -107,6 +108,10 @@ template("chrome_repack_locales") { source_patterns += [ "${root_gen_dir}/components/strings/search_engine_descriptions_strings_" ] deps += [ "//components/strings:search_engine_descriptions_strings" ] } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index c11f964d7..118be5d7a 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec -index 3b6a1acc7deef..198419b310e1c 100644 +index 8ee4bb1061fe7..a4ed628208426 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -1286,6 +1286,15 @@ +@@ -1311,6 +1311,15 @@ # END "everything else" section. # Everything but chrome/, components/, content/, and ios/ diff --git a/patch/patches/light_mode_3534.patch b/patch/patches/light_mode_3534.patch index 0b444d1f9..24e0bfb8e 100644 --- a/patch/patches/light_mode_3534.patch +++ b/patch/patches/light_mode_3534.patch @@ -67,7 +67,7 @@ index d69b17b004120..5175ea3a785a3 100644 // GTK doesn't have a native high contrast setting. Rather, it's implied by diff --git ui/native_theme/native_theme.cc ui/native_theme/native_theme.cc -index d466e72df7e2c..d0a58289ca291 100644 +index f62df6eb7d12b..68f78b5e8bce0 100644 --- ui/native_theme/native_theme.cc +++ ui/native_theme/native_theme.cc @@ -143,6 +143,7 @@ void NativeTheme::NotifyOnNativeThemeUpdated() { @@ -93,10 +93,10 @@ index d466e72df7e2c..d0a58289ca291 100644 static bool kIsForcedHighContrast = base::CommandLine::ForCurrentProcess()->HasSwitch( diff --git ui/native_theme/native_theme.h ui/native_theme/native_theme.h -index 3385e9e9d5690..54b69691383bf 100644 +index 74b3f56ec91a8..78e548bbea4de 100644 --- ui/native_theme/native_theme.h +++ ui/native_theme/native_theme.h -@@ -603,6 +603,9 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -597,6 +597,9 @@ class NATIVE_THEME_EXPORT NativeTheme { // Whether dark mode is forced via command-line flag. static bool IsForcedDarkMode(); @@ -107,10 +107,10 @@ index 3385e9e9d5690..54b69691383bf 100644 explicit NativeTheme( bool should_only_use_dark_colors, diff --git ui/native_theme/native_theme_mac.mm ui/native_theme/native_theme_mac.mm -index d8ff86972911d..c6cc9c70741c9 100644 +index 9ca3120cfe3ac..c29c17330a7e5 100644 --- ui/native_theme/native_theme_mac.mm +++ ui/native_theme/native_theme_mac.mm -@@ -585,11 +585,15 @@ void NativeThemeMac::PaintSelectedMenuItem( +@@ -586,11 +586,15 @@ void NativeThemeMac::PaintSelectedMenuItem( void NativeThemeMac::InitializeDarkModeStateAndObserver() { __block auto theme = this; @@ -129,10 +129,10 @@ index d8ff86972911d..c6cc9c70741c9 100644 theme->NotifyOnNativeThemeUpdated(); }]; diff --git ui/native_theme/native_theme_win.cc ui/native_theme/native_theme_win.cc -index 566230f830ede..8767f6cf813e9 100644 +index 4c922cce6fe89..196fc0a6c07b2 100644 --- ui/native_theme/native_theme_win.cc +++ ui/native_theme/native_theme_win.cc -@@ -671,14 +671,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -673,14 +673,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // Windows high contrast modes are entirely different themes, // so let them take priority over dark mode. // ...unless --force-dark-mode was specified in which case caveat emptor. @@ -152,7 +152,7 @@ index 566230f830ede..8767f6cf813e9 100644 return NativeTheme::CalculatePreferredColorScheme(); // According to the spec, the preferred color scheme for web content is 'dark' -@@ -1669,8 +1672,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { +@@ -1671,8 +1674,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { } void NativeThemeWin::UpdateDarkModeStatus() { diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 759bd48fc..4719e5034 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc -index e21cd3f9c447d..3e366eab65155 100644 +index 8f4f33fd83ef6..be3c8f5ff50c1 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc -@@ -188,7 +188,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() { +@@ -191,7 +191,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() { base::File OpenFileToShare(const base::FilePath& path, base::MemoryMappedFile::Region* region) { base::FilePath exe_dir; diff --git a/patch/patches/linux_chrome_widevine_3149.patch b/patch/patches/linux_chrome_widevine_3149.patch index 3b4625142..84183ba6a 100644 --- a/patch/patches/linux_chrome_widevine_3149.patch +++ b/patch/patches/linux_chrome_widevine_3149.patch @@ -1,18 +1,18 @@ diff --git chrome/common/media/component_widevine_cdm_hint_file_linux.cc chrome/common/media/component_widevine_cdm_hint_file_linux.cc -index d529ecfb270c4..2e922ef345f04 100644 +index 60033bb10af50..afb0d23c07a34 100644 --- chrome/common/media/component_widevine_cdm_hint_file_linux.cc +++ chrome/common/media/component_widevine_cdm_hint_file_linux.cc -@@ -16,6 +16,7 @@ - #include "base/path_service.h" +@@ -18,6 +18,7 @@ #include "base/values.h" + #include "base/version.h" #include "chrome/common/chrome_paths.h" +#include "third_party/widevine/cdm/widevine_cdm_common.h" namespace { -@@ -35,14 +36,33 @@ base::FilePath GetPath(const base::Value::Dict& dict) { - return path; - } +@@ -25,12 +26,31 @@ namespace { + const char kPath[] = "Path"; + const char kLastBundledVersion[] = "LastBundledVersion"; +// On Linux the Widevine CDM is loaded into the zygote at startup. When the +// component updater runs sometime later and finds a newer version of the @@ -34,9 +34,17 @@ index d529ecfb270c4..2e922ef345f04 100644 + return true; +} + - } // namespace + // Returns the hint file contents as a Value::Dict. Returned result may be an + // empty dictionary if the hint file does not exist or is formatted incorrectly. + base::Value::Dict GetHintFileContents() { + base::FilePath hint_file_path; +- CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT, +- &hint_file_path)); ++ CHECK(GetHintFilePath(&hint_file_path)); + DVLOG(1) << __func__ << " checking " << hint_file_path; - bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path) { + if (!base::PathExists(hint_file_path)) { +@@ -65,8 +85,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path, DCHECK(!cdm_base_path.empty()); base::FilePath hint_file_path; @@ -46,13 +54,3 @@ index d529ecfb270c4..2e922ef345f04 100644 base::Value::Dict dict; dict.Set(kPath, cdm_base_path.value()); -@@ -60,8 +80,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path) { - - base::FilePath GetLatestComponentUpdatedWidevineCdmDirectory() { - base::FilePath hint_file_path; -- CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT, -- &hint_file_path)); -+ CHECK(GetHintFilePath(&hint_file_path)); - - if (!base::PathExists(hint_file_path)) { - DVLOG(2) << "CDM hint file at " << hint_file_path << " does not exist."; diff --git a/patch/patches/linux_gtk_theme_3610.patch b/patch/patches/linux_gtk_theme_3610.patch index 86e269942..76704dca7 100644 --- a/patch/patches/linux_gtk_theme_3610.patch +++ b/patch/patches/linux_gtk_theme_3610.patch @@ -27,7 +27,7 @@ index ab8f0d6b545b2..c4bd035f1cec4 100644 &GtkUi::OnCursorThemeNameChanged); connect(settings, "notify::gtk-cursor-theme-size", diff --git ui/ozone/platform/x11/ozone_platform_x11.cc ui/ozone/platform/x11/ozone_platform_x11.cc -index 94012aae5f38d..852d736136faf 100644 +index 417f9f92d4307..388510591d913 100644 --- ui/ozone/platform/x11/ozone_platform_x11.cc +++ ui/ozone/platform/x11/ozone_platform_x11.cc @@ -64,6 +64,8 @@ namespace ui { @@ -39,7 +39,7 @@ index 94012aae5f38d..852d736136faf 100644 // Singleton OzonePlatform implementation for X11 platform. class OzonePlatformX11 : public OzonePlatform, public OSExchangeDataProviderFactoryOzone { -@@ -260,7 +262,15 @@ class OzonePlatformX11 : public OzonePlatform, +@@ -261,7 +263,15 @@ class OzonePlatformX11 : public OzonePlatform, TouchFactory::SetTouchDeviceListFromCommandLine(); #if BUILDFLAG(USE_GTK) @@ -56,7 +56,7 @@ index 94012aae5f38d..852d736136faf 100644 #endif menu_utils_ = std::make_unique(); -@@ -355,4 +365,8 @@ OzonePlatform* CreateOzonePlatformX11() { +@@ -356,4 +366,8 @@ OzonePlatform* CreateOzonePlatformX11() { return new OzonePlatformX11; } diff --git a/patch/patches/mac_platform_style_bubble_893292.patch b/patch/patches/mac_platform_style_bubble_893292.patch index 91a34bf3c..89977aac4 100644 --- a/patch/patches/mac_platform_style_bubble_893292.patch +++ b/patch/patches/mac_platform_style_bubble_893292.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index 855e1289e3d76..14d8e6d821f8f 100644 +index 3efb90bd0027a..e9b5110fe739c 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -1173,8 +1173,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { +@@ -1170,8 +1170,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { ->GetDisplayNearestPoint(anchor_rect.CenterPoint()) .work_area(); int available_space = screen_space.bottom() - anchor_rect.bottom(); diff --git a/patch/patches/mac_render_widget_3680.patch b/patch/patches/mac_render_widget_3680.patch index 91fa4802d..e1e34f253 100644 --- a/patch/patches/mac_render_widget_3680.patch +++ b/patch/patches/mac_render_widget_3680.patch @@ -1,11 +1,11 @@ diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index 5649f120ccefa..c6c1a676a24cf 100644 +index 0c9e9a86a0242..dc80361d0c9a0 100644 --- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -164,6 +164,13 @@ void ExtractUnderlines(NSAttributedString* string, - +@@ -165,6 +165,13 @@ void ExtractUnderlines(NSAttributedString* string, + // RenderWidgetHostViewCocoa --------------------------------------------------- - + +@interface NSWindow (CefCustomMethods) +- (int)acceptsFirstMouse; +@end @@ -15,10 +15,10 @@ index 5649f120ccefa..c6c1a676a24cf 100644 + // Private methods: @interface RenderWidgetHostViewCocoa () - -@@ -744,6 +751,14 @@ void ExtractUnderlines(NSAttributedString* string, + +@@ -750,6 +757,14 @@ void ExtractUnderlines(NSAttributedString* string, } - + - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { + if ([self.window respondsToSelector:@selector(acceptsFirstMouse)]) { + const auto mode = [self.window acceptsFirstMouse]; @@ -30,4 +30,4 @@ index 5649f120ccefa..c6c1a676a24cf 100644 + } return [self acceptsMouseEventsWhenInactive]; } - + diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 13af2fea1..7b36bbdf8 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -1,5 +1,5 @@ diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 2f07a9603504c..c8d0aece94dc5 100644 +index b136708121867..ee2ba2b731291 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ @@ -9,8 +9,8 @@ index 2f07a9603504c..c8d0aece94dc5 100644 +#include "base/task/current_thread.h" #include "base/message_loop/message_pump_win.h" - #include -@@ -501,7 +502,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { + #include +@@ -577,7 +578,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { ctx.event()->set_chrome_message_pump(); msg_pump_data->set_sent_messages_in_queue(more_work_is_plausible); }); @@ -30,7 +30,7 @@ index 2f07a9603504c..c8d0aece94dc5 100644 } if (has_msg) diff --git base/task/current_thread.cc base/task/current_thread.cc -index 200d6692664e9..62dce72284b83 100644 +index a93ee7e4213cb..5550158d94de6 100644 --- base/task/current_thread.cc +++ base/task/current_thread.cc @@ -51,6 +51,8 @@ void CurrentThread::AddDestructionObserver( diff --git a/patch/patches/metrics_system_profile.patch b/patch/patches/metrics_system_profile.patch index 83b3b4828..2b1e63c8a 100644 --- a/patch/patches/metrics_system_profile.patch +++ b/patch/patches/metrics_system_profile.patch @@ -1,8 +1,8 @@ diff --git components/metrics/persistent_system_profile.cc components/metrics/persistent_system_profile.cc -index 2aab2aefb3987..7922807fac0a2 100644 +index f594c075834e3..2165b9196ce03 100644 --- components/metrics/persistent_system_profile.cc +++ components/metrics/persistent_system_profile.cc -@@ -393,6 +393,10 @@ bool PersistentSystemProfile::GetSystemProfile( +@@ -394,6 +394,10 @@ bool PersistentSystemProfile::GetSystemProfile( return true; } diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index e141d3954..42ed85959 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -12,7 +12,7 @@ index 285dc38950991..326646bb585da 100644 virtual ~WebContentsView() = default; diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index cb8f896ebe8a2..382394fb821a3 100644 +index bd8b5ddfd8659..0f1e6e2ed9ea2 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -205,6 +205,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -35,7 +35,7 @@ index cb8f896ebe8a2..382394fb821a3 100644 DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme)); GetController().LoadURL(stream_->handler_url(), content::Referrer(), ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); -@@ -483,6 +489,14 @@ void MimeHandlerViewGuest::DidFinishNavigation( +@@ -489,6 +495,14 @@ void MimeHandlerViewGuest::DidFinishNavigation( } } @@ -51,10 +51,10 @@ index cb8f896ebe8a2..382394fb821a3 100644 mojo::PendingReceiver receiver) { if (!pending_before_unload_control_) diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index 1cf22ee486d41..0d173bdb7af72 100644 +index f0b71aba6dfb4..a8b4b6dc27fa7 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -@@ -196,10 +196,12 @@ class MimeHandlerViewGuest +@@ -198,10 +198,12 @@ class MimeHandlerViewGuest void ReadyToCommitNavigation( content::NavigationHandle* navigation_handle) final; void DidFinishNavigation(content::NavigationHandle* navigation_handle) final; diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 5a8d7e79c..108ff7997 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,10 +10,10 @@ index 0e563dbb253ca..891b2bbc3785c 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 20) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index d007b8623e02c..258f077803edd 100644 +index b7bc620562e32..0d1f7a049dc3b 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -1884,7 +1884,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { +@@ -1907,7 +1907,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. @@ -24,10 +24,10 @@ index d007b8623e02c..258f077803edd 100644 bool URLRequestHttpJob::ShouldRecordPartitionedCookieUsage() const { diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index 5c9cb57298e29..8a526f8024913 100644 +index 4e698635af5ac..2f1ffdcd34f3b 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc -@@ -316,7 +316,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -325,7 +325,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { } bool ResourceRequest::SendsCookies() const { diff --git a/patch/patches/net_test_server_3798752.patch b/patch/patches/net_test_server_3798752.patch index f7f08413d..48f5f3915 100644 --- a/patch/patches/net_test_server_3798752.patch +++ b/patch/patches/net_test_server_3798752.patch @@ -1,8 +1,8 @@ diff --git net/test/embedded_test_server/embedded_test_server.cc net/test/embedded_test_server/embedded_test_server.cc -index 0f50e1fb328cf..5f610172279ac 100644 +index cb651df6d5c67..bf2f7ef2b9319 100644 --- net/test/embedded_test_server/embedded_test_server.cc +++ net/test/embedded_test_server/embedded_test_server.cc -@@ -1015,7 +1015,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) { +@@ -1020,7 +1020,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) { if (!base::CurrentThread::Get()) temporary_loop = std::make_unique(); @@ -11,7 +11,7 @@ index 0f50e1fb328cf..5f610172279ac 100644 if (!io_thread_->task_runner()->PostTaskAndReply( FROM_HERE, std::move(closure), run_loop.QuitClosure())) { return false; -@@ -1042,7 +1042,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult( +@@ -1047,7 +1047,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult( if (!base::CurrentThread::Get()) temporary_loop = std::make_unique(); diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 80051b43c..ba793c8b8 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -13,10 +13,10 @@ index 431df5d50debe..0fcc9ea8fbb1a 100644 return nullptr; } diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index 7f63e954dc68a..c916d68d3fbde 100644 +index 6902bb7ea90f7..c57b43fe0fce2 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3234,6 +3234,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3216,6 +3216,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -29,10 +29,10 @@ index 7f63e954dc68a..c916d68d3fbde 100644 const WebInputEvent& event) { if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index fb89c4500eeae..5e8f8d258dde2 100644 +index b3218a69a1d9e..a7b8e6c20659a 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -814,6 +814,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -806,6 +806,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); @@ -69,13 +69,13 @@ index e8ee63f3abc2e..2d1717082759d 100644 } // namespace content diff --git content/common/input/render_input_router.h content/common/input/render_input_router.h -index 9d664e43a3f94..584a4fa7d6d99 100644 +index 9e94dc720f9c9..c3ad0d7d2e6c2 100644 --- content/common/input/render_input_router.h +++ content/common/input/render_input_router.h -@@ -56,6 +56,7 @@ class CONTENT_EXPORT RenderInputRouter : public InputRouterImplClient { - void RendererWidgetCreated(bool for_frame_widget); +@@ -60,6 +60,7 @@ class CONTENT_EXPORT RenderInputRouter : public InputRouterImplClient { InputRouter* input_router() { return input_router_.get(); } + RenderInputRouterDelegate* delegate() { return delegate_; } + FlingSchedulerBase* fling_scheduler() { return fling_scheduler_.get(); } void SetForceEnableZoom(bool); diff --git a/patch/patches/osr_win_remove_keyed_mutex_2575.patch b/patch/patches/osr_win_remove_keyed_mutex_2575.patch index 5ba482546..c7242135e 100644 --- a/patch/patches/osr_win_remove_keyed_mutex_2575.patch +++ b/patch/patches/osr_win_remove_keyed_mutex_2575.patch @@ -24,10 +24,10 @@ index ecabd51db586d..a7ae5e101ca02 100644 Microsoft::WRL::ComPtr d3d11_texture; diff --git media/video/renderable_gpu_memory_buffer_video_frame_pool.cc media/video/renderable_gpu_memory_buffer_video_frame_pool.cc -index 15b1d849d27cd..4887e6482b0f6 100644 +index a7ac0f10f11e5..bb1d7dc6e9168 100644 --- media/video/renderable_gpu_memory_buffer_video_frame_pool.cc +++ media/video/renderable_gpu_memory_buffer_video_frame_pool.cc -@@ -205,7 +205,7 @@ gfx::Size GetBufferSizeInPixelsForVideoPixelFormat( +@@ -198,7 +198,7 @@ gfx::Size GetBufferSizeInPixelsForVideoPixelFormat( bool FrameResources::Initialize() { auto* context = pool_->GetContext(); @@ -36,7 +36,7 @@ index 15b1d849d27cd..4887e6482b0f6 100644 #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) gfx::BufferUsage::SCANOUT_VEA_CPU_READ #else -@@ -219,13 +219,30 @@ bool FrameResources::Initialize() { +@@ -212,13 +212,30 @@ bool FrameResources::Initialize() { const gfx::Size buffer_size_in_pixels = GetBufferSizeInPixelsForVideoPixelFormat(format_, coded_size_); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 0ab87b1f5..83120b2e4 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -84,7 +84,7 @@ index c85248ab0d0a0..05b3454c0356d 100644 } diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index e01439541b904..a369dcbb31c27 100644 +index 449f6f2db551e..677eecde93352 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -25,6 +25,7 @@ @@ -95,7 +95,7 @@ index e01439541b904..a369dcbb31c27 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" #include "chrome/browser/pdf/pdf_extension_util.h" -@@ -108,6 +109,13 @@ const char16_t kBasicPrintShortcut[] = u"(\u2325\u2318P)"; +@@ -109,6 +110,13 @@ const char16_t kBasicPrintShortcut[] = u"(\u2325\u2318P)"; const char16_t kBasicPrintShortcut[] = u"(Ctrl+Shift+P)"; #endif @@ -109,7 +109,7 @@ index e01439541b904..a369dcbb31c27 100644 constexpr char kInvalidArgsForDidStartPreview[] = "Invalid arguments for DidStartPreview"; constexpr char kInvalidPageIndexForDidPreviewPage[] = -@@ -309,7 +317,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { +@@ -310,7 +318,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { source->AddLocalizedStrings(kLocalizedStrings); #if !BUILDFLAG(IS_CHROMEOS) diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index b446b6ebd..82727fcc7 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/printer_query.cc chrome/browser/printing/printer_query.cc -index 418f53b0db3a2..4abcc0005eb1d 100644 +index 0e48a7582d86c..6ddeaa7c4e736 100644 --- chrome/browser/printing/printer_query.cc +++ chrome/browser/printing/printer_query.cc @@ -124,6 +124,7 @@ PrinterQuery::PrinterQuery(content::GlobalRenderFrameHostId rfh_id) diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 7ec234f88..95ae6e75b 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,8 +1,8 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 630463d838984..720685dc47b0f 100644 +index e023edac3fb0a..89ce58885c100 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -944,6 +944,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) +@@ -945,6 +945,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) : delegate_(delegate), locale_resources_data_lock_(new base::Lock), max_scale_factor_(k100Percent) { @@ -15,7 +15,7 @@ index 630463d838984..720685dc47b0f 100644 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -953,6 +959,11 @@ ResourceBundle::~ResourceBundle() { +@@ -954,6 +960,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } diff --git a/patch/patches/rfh_navigation_4829483.patch b/patch/patches/rfh_navigation_4829483.patch index a9523678e..fa0c917fd 100644 --- a/patch/patches/rfh_navigation_4829483.patch +++ b/patch/patches/rfh_navigation_4829483.patch @@ -1,12 +1,12 @@ diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index 6066f87e7d50d..410f3a20f19f4 100644 +index 9203a7ad0ef6c..b7ba771e6eea0 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10537,6 +10537,7 @@ void RenderFrameHostImpl::CommitNavigation( +@@ -10605,6 +10605,7 @@ void RenderFrameHostImpl::CommitNavigation( auto browser_calc_origin_to_commit = navigation_request->GetOriginToCommitWithDebugInfo(); if (!process_lock.is_error_page() && !is_mhtml_subframe && + common_params->url.IsStandard() && - !policy->CanAccessDataForOrigin( - GetProcess()->GetID(), browser_calc_origin_to_commit.first.value())) { - SCOPED_CRASH_KEY_STRING64("CommitNavigation", "lock_url", + !policy->CanAccessOrigin( + GetProcess()->GetID(), browser_calc_origin_to_commit.first.value(), + ChildProcessSecurityPolicyImpl::AccessType::kCanCommitNewOrigin)) { diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index c81b0320d..ff88a355e 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index e065ce0700764..9c68e224c050f 100644 +index a52e22d0d43e3..e8403dac2961a 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -6,6 +6,7 @@ @@ -8,9 +8,9 @@ index e065ce0700764..9c68e224c050f 100644 #include +#include #include + #include #include - -@@ -53,6 +54,7 @@ +@@ -54,6 +55,7 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/browser/device_service.h" #include "content/public/browser/render_view_host.h" @@ -35,7 +35,7 @@ index e065ce0700764..9c68e224c050f 100644 } #if BUILDFLAG(IS_WIN) -@@ -2352,6 +2356,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2357,6 +2361,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { window_->layer()->SetColor(GetBackgroundColor() ? *GetBackgroundColor() : SK_ColorWHITE); UpdateFrameSinkIdRegistration(); diff --git a/patch/patches/screen_1443650.patch b/patch/patches/screen_1443650.patch index 0a576cfc0..6719ef99e 100644 --- a/patch/patches/screen_1443650.patch +++ b/patch/patches/screen_1443650.patch @@ -19,10 +19,10 @@ index 22747ebcf31c0..8fba5da85a656 100644 bool Screen::GetDisplayWithDisplayId(int64_t display_id, diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc -index 5cf436d483b9d..598435db13435 100644 +index 3a9a310328aa3..d4c4a9947c1d9 100644 --- ui/display/win/screen_win.cc +++ ui/display/win/screen_win.cc -@@ -540,7 +540,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { +@@ -544,7 +544,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { gfx::PointF(pixel_bounds.origin()), screen_win_display)); const float scale_factor = 1.0f / screen_win_display.display().device_scale_factor(); @@ -31,7 +31,7 @@ index 5cf436d483b9d..598435db13435 100644 } // static -@@ -555,7 +555,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { +@@ -559,7 +559,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { const gfx::Point origin = display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display); const float scale_factor = screen_win_display.display().device_scale_factor(); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index d6a434c58..89421da75 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -21,7 +21,7 @@ index 3a8e63a3bcbdd..69954e151f04e 100644 // If the corresponding Connector policy isn't set, don't perform scans. if (!service || !service->IsConnectorEnabled(connector)) diff --git chrome/browser/first_party_sets/first_party_sets_policy_service.cc chrome/browser/first_party_sets/first_party_sets_policy_service.cc -index 0509dabf8f421..35a0046a03c6c 100644 +index e6d8a41c10f3a..18df8a6311d0a 100644 --- chrome/browser/first_party_sets/first_party_sets_policy_service.cc +++ chrome/browser/first_party_sets/first_party_sets_policy_service.cc @@ -275,6 +275,12 @@ void FirstPartySetsPolicyService::OnProfileConfigReady( @@ -38,10 +38,10 @@ index 0509dabf8f421..35a0046a03c6c 100644 base::RepeatingCallback browser_context_getter = base::BindRepeating( diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index e50641649a959..afa518ed24ada 100644 +index 77d18bd28eeaf..9eab054ea3416 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc -@@ -24,6 +24,7 @@ +@@ -25,6 +25,7 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -49,7 +49,23 @@ index e50641649a959..afa518ed24ada 100644 #include "chrome/browser/browser_features.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" -@@ -276,8 +277,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) +@@ -266,9 +267,12 @@ void UpdateCookieSettings(Profile* profile, ContentSettingsType type) { + // occurs in this class is unsynchronized, so it would be racy to rely on + // this update finishing before calling the context's callback.) This + // unfortunately triggers a double-update here. +- if (FederatedIdentityPermissionContext* fedcm_context = +- FederatedIdentityPermissionContextFactory::GetForProfile(profile); +- fedcm_context) { ++ FederatedIdentityPermissionContext* fedcm_context = nullptr; ++ if (!cef::IsAlloyRuntimeEnabled()) { ++ fedcm_context = ++ FederatedIdentityPermissionContextFactory::GetForProfile(profile); ++ } ++ if (fedcm_context) { + settings = fedcm_context->GetSharingPermissionGrantsAsContentSettings(); + } + } else { +@@ -323,8 +327,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) base::Unretained(this))); cookie_settings_ = CookieSettingsFactory::GetForProfile(profile); cookie_settings_observation_.Observe(cookie_settings_.get()); @@ -62,7 +78,23 @@ index e50641649a959..afa518ed24ada 100644 DisableQuicIfNotAllowed(); -@@ -1013,9 +1016,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -826,9 +832,12 @@ ProfileNetworkContextService::CreateCookieManagerParams( + continue; + } + if (type == ContentSettingsType::FEDERATED_IDENTITY_SHARING) { +- if (FederatedIdentityPermissionContext* fedcm_context = +- FederatedIdentityPermissionContextFactory::GetForProfile(profile); +- fedcm_context) { ++ FederatedIdentityPermissionContext* fedcm_context = nullptr; ++ if (!cef::IsAlloyRuntimeEnabled()) { ++ fedcm_context = ++ FederatedIdentityPermissionContextFactory::GetForProfile(profile); ++ } ++ if (fedcm_context) { + out->content_settings[type] = + fedcm_context->GetSharingPermissionGrantsAsContentSettings(); + } else { +@@ -1082,9 +1091,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->cookie_manager_params = CreateCookieManagerParams(profile_, *cookie_settings_); @@ -90,7 +122,7 @@ index e50641649a959..afa518ed24ada 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -1024,15 +1044,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1093,15 +1119,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( local_state->GetFilePath(prefs::kDiskCacheDir); if (!disk_cache_dir.empty()) base_cache_path = disk_cache_dir.Append(base_cache_path.BaseName()); @@ -110,7 +142,7 @@ index e50641649a959..afa518ed24ada 100644 network_context_params->file_paths->data_directory = path.Append(chrome::kNetworkDataDirname); network_context_params->file_paths->unsandboxed_data_path = path; -@@ -1207,6 +1226,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1276,6 +1301,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->first_party_sets_access_delegate_params = network::mojom::FirstPartySetsAccessDelegateParams::New(); network_context_params->first_party_sets_access_delegate_params->enabled = @@ -161,10 +193,10 @@ index a635c32482ce0..77a3503cea229 100644 GetInstance()->GetServiceForBrowserContext(profile, true)); } diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index df553538286e1..b3fd2845b1147 100644 +index f59e2c8fa8d92..f31ad539a8b36 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -599,6 +599,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -630,6 +630,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -191,7 +223,7 @@ index df553538286e1..b3fd2845b1147 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index 5e0aaf58d4bfe..f518abde87c8d 100644 +index e302feb355db4..98449151f2d52 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h @@ -209,6 +209,8 @@ class NET_EXPORT CookieMonster : public CookieStore { @@ -220,10 +252,10 @@ index 3f0be99e0e145..0462ebbe9bedc 100644 // reset to null. const CookieAccessDelegate* cookie_access_delegate() const { diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc -index d0f230b581c8f..77b3551cc3fb5 100644 +index c251939593cd2..d54817a03066c 100644 --- services/network/cookie_manager.cc +++ services/network/cookie_manager.cc -@@ -310,14 +310,9 @@ void CookieManager::AllowFileSchemeCookies( +@@ -313,14 +313,9 @@ void CookieManager::AllowFileSchemeCookies( AllowFileSchemeCookiesCallback callback) { OnSettingsWillChange(); @@ -242,10 +274,10 @@ index d0f230b581c8f..77b3551cc3fb5 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 16e8cf435e4b0..8a88f3d841088 100644 +index 5fb60171d3fa8..97e0446856491 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2406,16 +2406,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2424,16 +2424,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -274,7 +306,7 @@ index 16e8cf435e4b0..8a88f3d841088 100644 base::FeatureList::IsEnabled(features::kFledgePst)) { trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index c774dfca15ae1..9cb5fe6c5f20c 100644 +index 96943808c6290..c61de0ffd1c4d 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom @@ -359,6 +359,9 @@ struct NetworkContextParams { diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index bdc79552e..a819c8f86 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index 80d9b70bf76b3..d9b8d78f6aa01 100644 +index edada1997789f..ecc4c94482327 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -3282,8 +3282,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -3291,8 +3291,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -16,7 +16,7 @@ index 80d9b70bf76b3..d9b8d78f6aa01 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -3293,9 +3297,12 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -3302,9 +3306,12 @@ void StoragePartitionImpl::InitNetworkContext() { cert_verifier::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New(); diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 217d64a60..19a81a756 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -13,10 +13,10 @@ index 01d2a426e2c17..c239a2f6fc786 100644 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 9f955ab67a071..80f911e8157dd 100644 +index 5127b88e437f0..88ab737e6d2cb 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -130,7 +130,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -129,7 +129,7 @@ StoragePartition* BrowserContext::GetStoragePartition( StoragePartition* BrowserContext::GetStoragePartition( const StoragePartitionConfig& storage_partition_config, bool can_create) { @@ -25,7 +25,7 @@ index 9f955ab67a071..80f911e8157dd 100644 // An off the record profile MUST only use in memory storage partitions. CHECK(storage_partition_config.in_memory()); } -@@ -364,7 +364,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { +@@ -355,7 +355,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { const bool kUseInMemoryDBDefault = false; bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, @@ -58,10 +58,10 @@ index e82cdd66a2d5c..1816b2fe54ff5 100644 // static diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index ad1fa4396cd65..1c5027cc0c922 100644 +index 872bf7d1671bb..b87bb299316f2 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -569,7 +569,7 @@ bool DatabaseTracker::LazyInit() { +@@ -559,7 +559,7 @@ bool DatabaseTracker::LazyInit() { databases_table_ = std::make_unique(db_.get()); meta_table_ = std::make_unique(); diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index 0d17609d0..95e5c704b 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,5 +1,5 @@ diff --git ui/base/x/x11_os_exchange_data_provider.cc ui/base/x/x11_os_exchange_data_provider.cc -index fb847bc760cd0..3190300b7432a 100644 +index 8a78a6614feed..d703ec7165b6c 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc @@ -164,7 +164,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, diff --git a/patch/patches/ui_views_widget_type.patch b/patch/patches/ui_views_widget_type.patch index 1d3592341..ec9603b8d 100644 --- a/patch/patches/ui_views_widget_type.patch +++ b/patch/patches/ui_views_widget_type.patch @@ -1,9 +1,9 @@ diff --git chrome/browser/ui/views/chrome_views_delegate_linux.cc chrome/browser/ui/views/chrome_views_delegate_linux.cc -index ecc07a2a60505..82a379fa65e68 100644 +index 090cacaa913a3..da1ad444325ee 100644 --- chrome/browser/ui/views/chrome_views_delegate_linux.cc +++ chrome/browser/ui/views/chrome_views_delegate_linux.cc -@@ -52,6 +52,8 @@ NativeWidgetType GetNativeWidgetTypeForInitParams( - return NativeWidgetType::DESKTOP_NATIVE_WIDGET_AURA; +@@ -65,6 +65,8 @@ NativeWidgetType GetNativeWidgetTypeForInitParams( + } return (params.parent && + (params.child || diff --git a/patch/patches/views_1749_2102_3330.patch b/patch/patches/views_1749_2102_3330.patch index 72b360247..98b05d7ac 100644 --- a/patch/patches/views_1749_2102_3330.patch +++ b/patch/patches/views_1749_2102_3330.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/toolbar/app_menu.cc chrome/browser/ui/views/toolbar/app_menu.cc -index 13431b7ecbee5..f55bcc8538371 100644 +index 15ee19bb52b99..398164f428858 100644 --- chrome/browser/ui/views/toolbar/app_menu.cc +++ chrome/browser/ui/views/toolbar/app_menu.cc -@@ -1003,7 +1003,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { +@@ -1011,7 +1011,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { host->button()->GetWidget(), host, host->button()->GetAnchorBoundsInScreen(), views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE, @@ -58,7 +58,7 @@ index fb795f76d3616..6e36a4c1e29da 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 91fc5dc45e4be..a63f7daba9477 100644 +index c78845d4a5b3b..f387f67449a6e 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc @@ -696,6 +696,14 @@ void RenderText::SetWhitespaceElision(std::optional whitespace_elision) { @@ -97,7 +97,7 @@ index 91fc5dc45e4be..a63f7daba9477 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index fc7148fef2b34..3f19fbda8198b 100644 +index ae52c62126f2e..49e6fdefadcef 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h @@ -356,6 +356,10 @@ class GFX_EXPORT RenderText { @@ -134,10 +134,10 @@ index cbc1a0e7833fe..da451800b1a56 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 1769fd6c47586..a30229e71e818 100644 +index eb4dca274cb94..f82527daa1910 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -578,6 +578,12 @@ void LabelButton::OnThemeChanged() { +@@ -616,6 +616,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -151,10 +151,10 @@ index 1769fd6c47586..a30229e71e818 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 305fdcb678cf8..ce70df19c5eac 100644 +index efcec525b197e..5625074ec41c4 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -172,6 +172,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -187,6 +187,9 @@ class VIEWS_EXPORT LabelButton : public Button, // widget, and the parent of the containing widget. ButtonState GetVisualState() const; @@ -165,10 +165,10 @@ index 305fdcb678cf8..ce70df19c5eac 100644 LabelButtonImageContainer* image_container() { return image_container_.get(); diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 6ce8aff89247b..8203c09be5d20 100644 +index ae7ea4ef1557d..7db27169fcaab 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -51,12 +51,29 @@ enum LabelPropertyKey { +@@ -52,12 +52,29 @@ enum LabelPropertyKey { kLabelLineHeight, kLabelObscured, kLabelAllowCharacterBreak, @@ -198,7 +198,7 @@ index 6ce8aff89247b..8203c09be5d20 100644 } // namespace namespace views { -@@ -472,6 +489,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -473,6 +490,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged); } @@ -214,7 +214,7 @@ index 6ce8aff89247b..8203c09be5d20 100644 std::u16string Label::GetTooltipText() const { return tooltip_text_; } -@@ -780,6 +806,16 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -781,6 +807,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } @@ -232,7 +232,7 @@ index 6ce8aff89247b..8203c09be5d20 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index 273805cdee382..d3cfd2d5fe3a9 100644 +index 622e808ebffa5..cb6d594d6a8cb 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h @@ -241,6 +241,10 @@ class VIEWS_EXPORT Label : public View, @@ -246,7 +246,7 @@ index 273805cdee382..d3cfd2d5fe3a9 100644 // Gets/Sets the tooltip text. Default behavior for a label (single-line) is // to show the full text if it is wider than its bounds. Calling this // overrides the default behavior and lets you set a custom tooltip. To -@@ -521,6 +525,7 @@ class VIEWS_EXPORT Label : public View, +@@ -523,6 +527,7 @@ class VIEWS_EXPORT Label : public View, int max_width_ = 0; // This is used in single-line mode. int max_width_single_line_ = 0; @@ -255,7 +255,7 @@ index 273805cdee382..d3cfd2d5fe3a9 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 6afaa5b9aaa68..6d4f40f2f4786 100644 +index a85f17a892c97..6569abfdb7832 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc @@ -578,7 +578,8 @@ void MenuController::Run(Widget* parent, @@ -284,7 +284,7 @@ index 6afaa5b9aaa68..6d4f40f2f4786 100644 if (item->GetParentMenuItem()) { params.context = item->GetWidget(); // (crbug.com/1414232) The item to be open is a submenu. Make sure -@@ -2929,8 +2932,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( +@@ -2930,8 +2933,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -299,7 +299,7 @@ index 6afaa5b9aaa68..6d4f40f2f4786 100644 // Show the sub-menu. SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); -@@ -2950,8 +2958,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2951,8 +2959,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -375,10 +375,10 @@ index 0623d151ddd3e..243e8c573e474 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_host.cc ui/views/controls/menu/menu_host.cc -index fe055187219b1..9587b2321b502 100644 +index 05e2952ec637e..814ba2f4607b6 100644 --- ui/views/controls/menu/menu_host.cc +++ ui/views/controls/menu/menu_host.cc -@@ -146,6 +146,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { +@@ -147,6 +147,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { submenu_->GetScrollViewContainer()->outside_border_insets(); #endif @@ -387,7 +387,7 @@ index fe055187219b1..9587b2321b502 100644 #if defined(USE_AURA) params.init_properties_container.SetProperty(aura::client::kOwnedWindowAnchor, init_params.owned_window_anchor); -@@ -153,7 +155,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { +@@ -154,7 +156,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { // If MenuHost has no parent widget, it needs to be marked // Activatable, so that calling Show in ShowMenuHost will // get keyboard focus. @@ -411,10 +411,10 @@ index 7e92e72c01d62..e3e1fe357a635 100644 explicit MenuHost(SubmenuView* submenu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index 74dc139b2be23..7f42a723c64ab 100644 +index 7d80d762ed43f..9effcd90f6e46 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1076,6 +1076,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1077,6 +1077,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -430,7 +430,7 @@ index 74dc139b2be23..7f42a723c64ab 100644 } else if (paint_as_selected) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1140,6 +1149,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -1141,6 +1150,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const { @@ -751,7 +751,7 @@ index e171461e28836..e137275a22a12 100644 std::optional show_menu_host_duration_histogram) { RunMenu(parent, bounds.CenterPoint()); diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 49ef1918236ec..f274df414558a 100644 +index 0fcde1fc9f855..57af601276609 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc @@ -252,6 +252,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) @@ -791,7 +791,7 @@ index 9228af7f0b02e..a6957017fef5c 100644 #if !BUILDFLAG(IS_CHROMEOS_LACROS) if (root_location != root_current_location && diff --git ui/views/view.h ui/views/view.h -index 6cca6e9e7627d..fe0ad100d10f5 100644 +index e2896cbe245e5..6a8cf99b29a73 100644 --- ui/views/view.h +++ ui/views/view.h @@ -25,6 +25,7 @@ diff --git a/patch/patches/views_textfield_5399416.patch b/patch/patches/views_textfield_5399416.patch index ef36e55cf..837011b9c 100644 --- a/patch/patches/views_textfield_5399416.patch +++ b/patch/patches/views_textfield_5399416.patch @@ -1,5 +1,5 @@ diff --git ui/views/controls/textfield/textfield.cc ui/views/controls/textfield/textfield.cc -index 8d1968f8c3f0d..e8fdc37c0aeb0 100644 +index 60e154e91a9e6..0a3fa6255836f 100644 --- ui/views/controls/textfield/textfield.cc +++ ui/views/controls/textfield/textfield.cc @@ -2972,6 +2972,10 @@ void Textfield::OnCursorBlinkTimerFired() { diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 30b1f5b9f..9c7cae667 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -23,7 +23,7 @@ index cef40af382b1e..a2cf4691edc37 100644 case ui::SHOW_STATE_END: return ui::SHOW_STATE_NORMAL; diff --git components/sessions/core/session_service_commands.cc components/sessions/core/session_service_commands.cc -index 6d7ab01569f49..27db605bd571a 100644 +index da0cb1677c9be..707831bdeec2e 100644 --- components/sessions/core/session_service_commands.cc +++ components/sessions/core/session_service_commands.cc @@ -165,9 +165,10 @@ enum PersistedWindowShowState { @@ -49,7 +49,7 @@ index 6d7ab01569f49..27db605bd571a 100644 case ui::SHOW_STATE_MAXIMIZED: return PERSISTED_SHOW_STATE_MAXIMIZED; diff --git components/sessions/core/tab_restore_service_impl.cc components/sessions/core/tab_restore_service_impl.cc -index e9ad2d5751f2d..e51381e8f2dbf 100644 +index 1a49cf67e0b17..edf5896d3594e 100644 --- components/sessions/core/tab_restore_service_impl.cc +++ components/sessions/core/tab_restore_service_impl.cc @@ -192,6 +192,7 @@ int SerializeWindowShowState(ui::WindowShowState show_state) { @@ -61,10 +61,10 @@ index e9ad2d5751f2d..e51381e8f2dbf 100644 case ui::SHOW_STATE_MAXIMIZED: return kSerializedShowStateMaximized; diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 6b6902c0cb0ee..d724e1dfe7d49 100644 +index b1fd8fe22daa6..290912f76fb02 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -660,6 +660,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { +@@ -669,6 +669,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { return scale_override_for_capture_; } @@ -80,27 +80,28 @@ index 6b6902c0cb0ee..d724e1dfe7d49 100644 if (!GetMouseWheelPhaseHandler()) return; diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index 116046b24a3e0..6b6ee45499639 100644 +index 307dd3befb375..bf6bdd7ed4cbe 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -72,6 +72,7 @@ class DevicePosturePlatformProvider; +@@ -73,6 +73,7 @@ class DevicePosturePlatformProvider; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; +class RenderWidgetHostViewGuest; class ScopedViewTransitionResources; - class SyntheticGestureTarget; class TextInputManager; -@@ -153,6 +154,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, - const gfx::Size& max_size) override; - void DisableAutoResize(const gfx::Size& new_size) override; + class TouchSelectionControllerClientManager; +@@ -192,6 +193,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase float GetDeviceScaleFactor() const final; + bool IsPointerLocked() override; + + void SetHasExternalParent(bool val) override; + bool HasExternalParent() const override; - TouchSelectionControllerClientManager* - GetTouchSelectionControllerClientManager() override; - ui::mojom::VirtualKeyboardMode GetVirtualKeyboardMode() override; -@@ -192,6 +195,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, ++ + // Identical to `CopyFromSurface()`, except that this method issues the + // `viz::CopyOutputRequest` against the exact `viz::Surface` currently + // embedded by this View, while `CopyFromSurface()` may return a copy of any +@@ -253,6 +257,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // Called when screen information or native widget bounds change. virtual void UpdateScreenInfo(); @@ -111,7 +112,7 @@ index 116046b24a3e0..6b6ee45499639 100644 // Called by the TextInputManager to notify the view about being removed from // the list of registered views, i.e., TextInputManager is no longer tracking // TextInputState from this view. The RWHV should reset |text_input_manager_| -@@ -453,6 +460,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -374,6 +382,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase const gfx::Rect& bounds, const gfx::Rect& anchor_rect) = 0; @@ -121,10 +122,10 @@ index 116046b24a3e0..6b6ee45499639 100644 + virtual void InitAsGuest(RenderWidgetHostView* parent_host_view, + RenderWidgetHostViewGuest* guest_view) {} + - // Sets the cursor for this view to the one specified. - virtual void UpdateCursor(const ui::Cursor& cursor) = 0; + // Indicates whether the page has finished loading. + virtual void SetIsLoading(bool is_loading) = 0; -@@ -746,6 +759,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -638,6 +652,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // to all displays. gfx::Size system_cursor_size_; @@ -135,7 +136,7 @@ index 116046b24a3e0..6b6ee45499639 100644 private: FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, -@@ -767,10 +784,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -659,10 +677,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase void SynchronizeVisualProperties(); @@ -195,10 +196,10 @@ index 82bf8b2dba80d..7ac79b46da2b4 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 8effe5b2244a3..c36a5d3a6f7b3 100644 +index b4ff7c11d8e3c..b21417f89e6e1 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -259,6 +259,14 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -254,6 +254,14 @@ class CONTENT_EXPORT RenderWidgetHostView { // This must always return the same device scale factor as GetScreenInfo. virtual float GetDeviceScaleFactor() const = 0; @@ -258,10 +259,10 @@ index 6076597470af9..871147e3e3a84 100644 // Specifies which edges of the window are tiled. diff --git ui/ozone/platform/x11/x11_window.cc ui/ozone/platform/x11/x11_window.cc -index a5656cefbfc57..aeb062df96e39 100644 +index 55c1e9f0ccc1b..8b5fbb29fcd68 100644 --- ui/ozone/platform/x11/x11_window.cc +++ ui/ozone/platform/x11/x11_window.cc -@@ -1863,7 +1863,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1864,7 +1864,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(bounds); @@ -349,10 +350,10 @@ index 3151a2c872f4e..e14caeb1e6645 100644 base::WeakPtrFactory weak_factory_{this}; }; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -index c5379f421f5be..f49896ef092cf 100644 +index b305f5c2238c2..e2bd0c430cea0 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -@@ -293,8 +293,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { +@@ -285,8 +285,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { if (properties.parent_widget) { window_parent_ = DesktopWindowTreeHostPlatform::GetHostForWidget( properties.parent_widget); @@ -364,7 +365,7 @@ index c5379f421f5be..f49896ef092cf 100644 // Calculate initial bounds. diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index f63948de2c5bf..c445451bf3d98 100644 +index 99e20655e847e..6c3b3028e67fd 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -20,6 +20,7 @@ @@ -375,7 +376,7 @@ index f63948de2c5bf..c445451bf3d98 100644 #include "ui/aura/window_event_dispatcher.h" #include "ui/base/class_property.h" #include "ui/base/cursor/cursor.h" -@@ -178,22 +179,42 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -183,22 +184,42 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_.get()); HWND parent_hwnd = nullptr; @@ -422,7 +423,7 @@ index f63948de2c5bf..c445451bf3d98 100644 // Stack immediately above its parent so that it does not cover other // root-level windows, with the exception of menus, to allow them to be // displayed on top of other windows. -@@ -1016,10 +1037,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { +@@ -1020,10 +1041,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { if (!native_widget_delegate_->IsNativeWidgetInitialized()) return; @@ -448,7 +449,7 @@ index f63948de2c5bf..c445451bf3d98 100644 } void DesktopWindowTreeHostWin::HandleClientSizeChanged( -@@ -1036,11 +1070,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -1040,11 +1074,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -466,7 +467,7 @@ index f63948de2c5bf..c445451bf3d98 100644 } bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { -@@ -1048,6 +1086,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { +@@ -1052,6 +1090,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { if (ui::PlatformEventSource::ShouldIgnoreNativePlatformEvents()) return true; @@ -479,7 +480,7 @@ index f63948de2c5bf..c445451bf3d98 100644 SendEventToSink(event); return event->handled(); } -@@ -1226,8 +1270,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { +@@ -1230,8 +1274,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { // positions in variable-DPI situations. See https://crbug.com/1224715 for // details. aura::Window* root = nullptr; @@ -517,7 +518,7 @@ index 8d5b01098915d..ae5b6a2193031 100644 // the implementation of ::ShowCursor() is based on a counter, so making this // member static ensures that ::ShowCursor() is always called exactly once diff --git ui/views/widget/native_widget_mac.mm ui/views/widget/native_widget_mac.mm -index cbe655d5879d6..a72c3450d1fa7 100644 +index 6383110804d44..e5bc85f63fab9 100644 --- ui/views/widget/native_widget_mac.mm +++ ui/views/widget/native_widget_mac.mm @@ -640,6 +640,7 @@ void NativeWidgetMac::Show(ui::WindowShowState show_state, @@ -529,10 +530,10 @@ index cbe655d5879d6..a72c3450d1fa7 100644 break; case ui::SHOW_STATE_END: diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 53c18070fb9e2..4e101a792ec6b 100644 +index d958581dc14d0..c06a5b18b4835 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -399,7 +399,8 @@ void Widget::Init(InitParams params) { +@@ -405,7 +405,8 @@ void Widget::Init(InitParams params) { } params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -540,9 +541,9 @@ index 53c18070fb9e2..4e101a792ec6b 100644 + is_top_level_ = !params.child || + params.parent_widget != gfx::kNullAcceleratedWidget; is_headless_ = params.ShouldInitAsHeadless(); + is_autosized_ = params.autosize; - if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && -@@ -494,9 +495,14 @@ void Widget::Init(InitParams params) { +@@ -497,9 +498,14 @@ void Widget::Init(InitParams params) { if (show_state == ui::SHOW_STATE_MAXIMIZED) { Maximize(); @@ -557,7 +558,7 @@ index 53c18070fb9e2..4e101a792ec6b 100644 } #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -510,7 +516,12 @@ void Widget::Init(InitParams params) { +@@ -513,7 +519,12 @@ void Widget::Init(InitParams params) { } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); if (should_set_initial_bounds) { @@ -571,7 +572,7 @@ index 53c18070fb9e2..4e101a792ec6b 100644 } } -@@ -1655,10 +1666,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { +@@ -1692,10 +1703,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { } gfx::Size Widget::GetMinimumSize() const { @@ -588,7 +589,7 @@ index 53c18070fb9e2..4e101a792ec6b 100644 return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); } -@@ -1909,7 +1926,8 @@ bool Widget::SetInitialFocus(ui::WindowShowState show_state) { +@@ -1946,7 +1963,8 @@ bool Widget::SetInitialFocus(ui::WindowShowState show_state) { return false; View* v = widget_delegate_->GetInitiallyFocusedView(); if (!focus_on_creation_ || show_state == ui::SHOW_STATE_INACTIVE || @@ -599,10 +600,10 @@ index 53c18070fb9e2..4e101a792ec6b 100644 // focus when the window is restored. if (v) diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 5042a382cacfc..2582b75986ca5 100644 +index 0d373af86c18a..33bdd6caa9f35 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -363,6 +363,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -358,6 +358,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = gfx::NativeView(); @@ -611,7 +612,7 @@ index 5042a382cacfc..2582b75986ca5 100644 // Specifies the initial bounds of the Widget. Default is empty, which means // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not -@@ -762,7 +764,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -764,7 +766,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, void ShowInactive(); // Activates the widget, assuming it already exists and is visible. @@ -621,10 +622,10 @@ index 5042a382cacfc..2582b75986ca5 100644 // Deactivates the widget, making the next window in the Z order the active // window. diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index dc81dccf6e446..c18ec44755a6a 100644 +index 6a8bb8ad5969a..32b7e90152be6 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -375,6 +375,10 @@ class VIEWS_EXPORT WidgetDelegate +@@ -380,6 +380,10 @@ class VIEWS_EXPORT WidgetDelegate // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -650,10 +651,10 @@ index 3b9b00b7d79ae..e759e3c1a9f34 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index b1f7412f7a8e7..5f7187e98c3fa 100644 +index 6d4dd467fa533..fdb970e627d81 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -771,7 +771,11 @@ bool HWNDMessageHandler::IsVisible() const { +@@ -772,7 +772,11 @@ bool HWNDMessageHandler::IsVisible() const { } bool HWNDMessageHandler::IsActive() const { @@ -666,7 +667,7 @@ index b1f7412f7a8e7..5f7187e98c3fa 100644 } bool HWNDMessageHandler::IsMinimized() const { -@@ -3221,10 +3225,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3215,10 +3219,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 3268bc14c..dbce67bf3 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -1,8 +1,8 @@ diff --git components/viz/host/host_display_client.cc components/viz/host/host_display_client.cc -index 7af928a9a030c..a702033cb2d47 100644 +index 0ef41b4efc339..a1c1ea6a00fc1 100644 --- components/viz/host/host_display_client.cc +++ components/viz/host/host_display_client.cc -@@ -47,9 +47,14 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams( +@@ -48,9 +48,14 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams( } #endif @@ -18,7 +18,7 @@ index 7af928a9a030c..a702033cb2d47 100644 if (!NeedsToUseLayerWindow(widget_)) { DLOG(ERROR) << "HWND shouldn't be using a layered window"; return; -@@ -57,7 +62,10 @@ void HostDisplayClient::CreateLayeredWindowUpdater( +@@ -58,7 +63,10 @@ void HostDisplayClient::CreateLayeredWindowUpdater( layered_window_updater_ = std::make_unique(widget_, std::move(receiver)); @@ -80,10 +80,10 @@ index 8af69cac78b74..9f74e511c263d 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 578b712f95474..1b7a392ae5736 100644 +index 0131eaf19d3e1..a8669acd03fa7 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -249,6 +249,8 @@ viz_component("service") { +@@ -251,6 +251,8 @@ viz_component("service") { "transitions/surface_animation_manager.h", "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", @@ -150,10 +150,10 @@ index 796ae2688436e..37a3406790210 100644 TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceWinProxy::Draw", this); diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index 65401cc364494..7a1c98588ac5c 100644 +index 3634618a687b3..3a568135f6a0f 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc -@@ -383,8 +383,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( +@@ -385,8 +385,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( mojo::AssociatedRemote display_private; root_params->display_private = display_private.BindNewEndpointAndPassReceiver(); @@ -223,7 +223,7 @@ index 2f462f0deb5fc..695869b83cefa 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 5d3dbdb5016a2..e587af93929fc 100644 +index 9019859a51edf..ed88b61c6dd69 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -33,7 +33,9 @@ @@ -236,7 +236,7 @@ index 5d3dbdb5016a2..e587af93929fc 100644 #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/display_private.mojom.h" -@@ -140,6 +142,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -141,6 +143,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -251,7 +251,7 @@ index 5d3dbdb5016a2..e587af93929fc 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -183,6 +193,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -184,6 +194,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -261,9 +261,9 @@ index 5d3dbdb5016a2..e587af93929fc 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -533,6 +546,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, - - std::unique_ptr pending_begin_frame_args_; +@@ -549,6 +562,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, + simple_begin_frame_observers_; + std::unique_ptr host_begin_frame_observer_; + CompositorDelegate* delegate_ = nullptr; + diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index b3e8b4bb5..60ed09f69 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index bfb696d17099c..e1213ba481460 100644 +index c455f395b3d89..f39ffa5e1a7a4 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -3521,6 +3521,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3551,6 +3551,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -15,7 +15,7 @@ index bfb696d17099c..e1213ba481460 100644 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3531,6 +3537,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3561,6 +3567,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -23,7 +23,7 @@ index bfb696d17099c..e1213ba481460 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3726,6 +3733,9 @@ void WebContentsImpl::RenderWidgetCreated( +@@ -3756,6 +3763,9 @@ void WebContentsImpl::RenderWidgetCreated( OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated", "render_widget_host", render_widget_host); created_widgets_.insert(render_widget_host); @@ -33,7 +33,7 @@ index bfb696d17099c..e1213ba481460 100644 } void WebContentsImpl::RenderWidgetDeleted( -@@ -4549,6 +4559,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4583,6 +4593,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( create_params.picture_in_picture_options = *(params.pip_options); } @@ -49,7 +49,7 @@ index bfb696d17099c..e1213ba481460 100644 // Check whether there is an available prerendered page for this navigation if // this is not for guest. If it exists, take WebContents pre-created for // hosting the prerendered page instead of creating new WebContents. -@@ -8820,6 +8839,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -8894,6 +8913,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, } CloseListenerManager::DidChangeFocusedFrame(this); @@ -60,7 +60,7 @@ index bfb696d17099c..e1213ba481460 100644 void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 663230421212b..0e5e7ee9951b7 100644 +index 811fde7ff7d9e..bbd63bf21db3e 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h @@ -104,10 +104,12 @@ class BrowserContext; @@ -88,10 +88,10 @@ index 663230421212b..0e5e7ee9951b7 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index c44ef9991cbb0..316fe9f68a9d2 100644 +index 55aa807264c1e..ebfd5bc73fa3e 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -62,9 +62,11 @@ class EyeDropperListener; +@@ -63,9 +63,11 @@ class EyeDropperListener; class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; @@ -103,7 +103,7 @@ index c44ef9991cbb0..316fe9f68a9d2 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -347,6 +349,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -354,6 +356,14 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionConfig& partition_config, SessionStorageNamespace* session_storage_namespace); @@ -119,12 +119,12 @@ index c44ef9991cbb0..316fe9f68a9d2 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index ede7dc0581064..d434670d4cb4c 100644 +index 0983d7fa4d180..a0ca59ba1428f 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -227,6 +227,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { - virtual void OnCaptureHandleConfigUpdate( - const blink::mojom::CaptureHandleConfig& config) {} +@@ -237,6 +237,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { + // controlled by the capturing tab. + virtual void OnCapturedSurfaceControl() {} + // This method is invoked when a RenderWidget is created. + virtual void RenderWidgetCreated(RenderWidgetHost* render_widget_host) {} @@ -132,7 +132,7 @@ index ede7dc0581064..d434670d4cb4c 100644 // This method is invoked when the `blink::WebView` of the current // RenderViewHost is ready, e.g. because we recreated it after a crash. virtual void RenderViewReady() {} -@@ -852,6 +855,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -862,6 +865,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index bbadc3977..002ddad92 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index 165bd4eae9e1b..dd4d7af0a561d 100644 +index 38c079e1f9c37..6a029e131a870 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -784,6 +784,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -780,6 +780,11 @@ class BLINK_PLATFORM_EXPORT Platform { } #endif diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 3a09b724d..1ec763ff7 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index c4348be90db20..bf426c876b77a 100644 +index 6dfc5bef7ed41..493781d809a35 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h @@ -349,6 +349,7 @@ class BLINK_EXPORT WebView { @@ -11,7 +11,7 @@ index c4348be90db20..bf426c876b77a 100644 // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index fb042e637c831..e3cf96c7f9215 100644 +index d0d5030c68f39..f9a86eb99f39e 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -251,8 +251,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { @@ -39,7 +39,7 @@ index fb042e637c831..e3cf96c7f9215 100644 fullscreen_controller_(std::make_unique(this)), page_base_background_color_( diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index db7f1cb1b0f68..4c70aa22d0a34 100644 +index d6bfd9b670d03..fa01890543ceb 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h @@ -139,7 +139,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, @@ -52,7 +52,7 @@ index db7f1cb1b0f68..4c70aa22d0a34 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -869,6 +870,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -871,6 +872,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -62,10 +62,10 @@ index db7f1cb1b0f68..4c70aa22d0a34 100644 gfx::Transform device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index 59f54f7f98dd6..481e1991a77ac 100644 +index 9793e13c77631..b8453096117e8 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -981,7 +981,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, +@@ -985,7 +985,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index fd6810fb1..1c022dfef 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index 95b2dd4972892..72e1b984ba689 100644 +index 16c370e6d9759..1460a9c0d1f49 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -@@ -19,10 +19,12 @@ +@@ -20,10 +20,12 @@ #include "base/strings/string_util.h" #include "base/system/sys_info.h" #include "base/task/thread_pool.h" @@ -15,7 +15,7 @@ index 95b2dd4972892..72e1b984ba689 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h" #include "chrome/browser/google/google_brand.h" -@@ -421,7 +423,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -422,7 +424,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -28,7 +28,7 @@ index 95b2dd4972892..72e1b984ba689 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); #if BUILDFLAG(IS_WIN) -@@ -509,8 +515,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -510,8 +516,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -41,7 +41,7 @@ index 95b2dd4972892..72e1b984ba689 100644 std::string extensions_list; for (const scoped_refptr& extension : extension_registry->enabled_extensions()) { -@@ -611,6 +621,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -612,6 +622,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if BUILDFLAG(IS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/win_sandbox_3210.patch b/patch/patches/win_sandbox_3210.patch index 97bcabe76..e893d31d6 100644 --- a/patch/patches/win_sandbox_3210.patch +++ b/patch/patches/win_sandbox_3210.patch @@ -1,8 +1,8 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index d7eed71feab0b..eea5f293c2ca0 100644 +index 8b41e05f29fdb..34cc1063f540e 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc -@@ -1019,6 +1019,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -1041,6 +1041,13 @@ ResultCode SandboxWin::StartSandboxedProcess( const base::HandlesToInheritVector& handles_to_inherit, SandboxDelegate* delegate, base::Process* process) { diff --git a/patch/patches/win_taskbar_decorator_3645.patch b/patch/patches/win_taskbar_decorator_3645.patch index b8ba64c60..a59bd8b6c 100644 --- a/patch/patches/win_taskbar_decorator_3645.patch +++ b/patch/patches/win_taskbar_decorator_3645.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/taskbar/taskbar_decorator_win.cc chrome/browser/taskbar/taskbar_decorator_win.cc -index 20f37cf8b31ee..85569f9a9694c 100644 +index 2612e0be45203..0e9f3105db1d6 100644 --- chrome/browser/taskbar/taskbar_decorator_win.cc +++ chrome/browser/taskbar/taskbar_decorator_win.cc -@@ -18,12 +18,14 @@ +@@ -20,12 +20,14 @@ #include "base/strings/utf_string_conversions.h" #include "base/task/thread_pool.h" #include "base/win/scoped_gdi_object.h" @@ -17,7 +17,7 @@ index 20f37cf8b31ee..85569f9a9694c 100644 #include "skia/ext/font_utils.h" #include "skia/ext/image_operations.h" #include "skia/ext/legacy_display_globals.h" -@@ -201,6 +203,21 @@ void UpdateTaskbarDecoration(Profile* profile, gfx::NativeWindow window) { +@@ -203,6 +205,21 @@ void UpdateTaskbarDecoration(Profile* profile, gfx::NativeWindow window) { return; }