diff --git a/BUILD.gn b/BUILD.gn index 3e7b547f5..2beb552a7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -357,7 +357,6 @@ if (is_win) { # Otherwise we need to copy this array into CEF, which would be difficult # to maintain. "//chrome/common/crash_keys.cc", - "//chrome/common/chrome_switches.cc", "//components/webui/flags/flags_ui_switches.cc", "//content/public/common/content_switches.cc", ] @@ -1049,7 +1048,7 @@ source_set("libcef_static") { ] deps += [ - "//chrome/browser/win:isolated_browser_support", + "//chrome/browser/win/isolated_browser:isolated_browser_support", "//chrome/install_static:secondary_module", "//chrome/chrome_elf", ] @@ -1800,11 +1799,11 @@ if (is_mac) { if (v8_use_external_startup_data) { public_deps += [ "//v8" ] if (use_v8_context_snapshot) { - sources += [ "$root_build_dir/$v8_context_snapshot_filename" ] + sources += [ "$root_out_dir/$v8_context_snapshot_filename" ] public_deps += [ "//tools/v8_context_snapshot" ] } if (!use_v8_context_snapshot || include_both_v8_snapshots) { - sources += [ "$root_build_dir/snapshot_blob.bin" ] + sources += [ "$root_out_dir/snapshot_blob.bin" ] } } diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index fb47c0fa7..b8b179a3d 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://chromiumembedded.github.io/cef/branches_and_building { - 'chromium_checkout': 'refs/tags/152.0.7977.0' + 'chromium_checkout': 'refs/tags/154.0.8037.0' } diff --git a/docs/branches_and_building.md b/docs/branches_and_building.md index 36f950015..6ed975a15 100644 --- a/docs/branches_and_building.md +++ b/docs/branches_and_building.md @@ -29,7 +29,7 @@ Current CEF master branch build requirements are as follows. See the [Master Bui Windows Build Requirements | macOS Build Requirements | Linux Build Requirements | |:---------------------------|:----------------------------|:-------------------------| -Win 10+ deployment, Win 10+ build system w/ VS2022 17.13.4, Win 10.0.26100.7705 SDK, Ninja | macOS 12.0+ deployment, 15.6+ build system w/ 26.0 base SDK (Xcode 26.0), Ninja, 64-bit only | Ubuntu 20.04+, Debian 10+, Ninja | +Win 10+ deployment, Win 10+ build system w/ VS2022 17.13.4, Win 10.0.28000.2270 SDK, Ninja | macOS 12.0+ deployment, 15.6+ build system w/ 26.0 base SDK (Xcode 26.0), Ninja, 64-bit only | Ubuntu 20.04+, Debian 10+, Ninja | The following URLs should be used for downloading development versions of CEF. diff --git a/docs/javascript_integration.md b/docs/javascript_integration.md index 087a66505..d4a46b964 100644 --- a/docs/javascript_integration.md +++ b/docs/javascript_integration.md @@ -77,6 +77,8 @@ Window bindings are reloaded each time a frame is reloaded giving the client app # Extensions +**Extension support is deprecated in M154.** + Extensions are like window bindings except they are loaded into the context for every frame and cannot be modified once loaded. The DOM does not exist when an extension is loaded and attempts to access the DOM during extension loading will result in a crash. Extensions are registered using the CefRegisterExtension() function which should be called from the CefRenderProcessHandler::OnWebKitInitialized() method. ```cpp diff --git a/include/cef_v8.h b/include/cef_v8.h index 1aa97b0d6..56ef3412b 100644 --- a/include/cef_v8.h +++ b/include/cef_v8.h @@ -40,6 +40,7 @@ #include +#include "include/cef_api_hash.h" #include "include/cef_base.h" #include "include/cef_browser.h" #include "include/cef_frame.h" @@ -51,6 +52,7 @@ class CefV8Handler; class CefV8StackFrame; class CefV8Value; +#if CEF_API_REMOVED(CEF_NEXT) /// /// Register a new V8 extension with the specified JavaScript extension code and /// handler. Functions implemented by the handler are prototyped using the @@ -111,10 +113,11 @@ class CefV8Value; /// example.test.increment(); /// /// -/*--cef(optional_param=handler)--*/ +/*--cef(optional_param=handler,removed=next)--*/ bool CefRegisterExtension(const CefString& extension_name, const CefString& javascript_code, CefRefPtr handler); +#endif // CEF_API_REMOVED(CEF_NEXT) /// /// Class representing a V8 context handle. V8 handles can only be accessed from diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index a22cedeb8..072d2d971 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -3736,6 +3736,9 @@ typedef enum { #if CEF_API_ADDED(15200) CEF_CPAIT_PAYMENTS_CHURNED_USERS, CEF_CPAIT_FAKE_PAGE_ACTION_FOR_DEBUG, +#endif +#if CEF_API_ADDED(CEF_NEXT) + CEF_CPAIT_WALLET_REMINDER_NOTICE, #endif CEF_CPAIT_NUM_VALUES, } cef_chrome_page_action_icon_type_t; diff --git a/libcef/browser/chrome/browser_delegate.h b/libcef/browser/chrome/browser_delegate.h index 269eddb4c..f19e2b911 100644 --- a/libcef/browser/chrome/browser_delegate.h +++ b/libcef/browser/chrome/browser_delegate.h @@ -50,7 +50,7 @@ class BrowserDelegate : public content::WebContentsDelegate { // take ownership of |devtools_contents|. static Browser* CreateDevToolsBrowser( Profile* profile, - Browser* opener, + BrowserWindowInterface* opener, content::WebContents* inspected_web_contents, std::unique_ptr& devtools_contents); diff --git a/libcef/browser/chrome/browser_util.h b/libcef/browser/chrome/browser_util.h new file mode 100644 index 000000000..6ac43f640 --- /dev/null +++ b/libcef/browser/chrome/browser_util.h @@ -0,0 +1,30 @@ +// Copyright 2024 The Chromium Embedded Framework Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CEF_LIBCEF_BROWSER_CHROME_BROWSER_UTIL_H_ +#define CEF_LIBCEF_BROWSER_CHROME_BROWSER_UTIL_H_ +#pragma once + +#include "base/check.h" +#include "chrome/browser/ui/browser.h" + +namespace cef { + +// BrowserWindowInterface is always implemented by Browser on desktop +// platforms. These helpers provide a safe checked downcast. +inline Browser* BrowserForBWI(BrowserWindowInterface* bwi) { + auto* browser = static_cast(bwi); + DCHECK(!bwi || browser); + return browser; +} + +inline const Browser* BrowserForBWI(const BrowserWindowInterface* bwi) { + auto* browser = static_cast(bwi); + DCHECK(!bwi || browser); + return browser; +} + +} // namespace cef + +#endif // CEF_LIBCEF_BROWSER_CHROME_BROWSER_UTIL_H_ diff --git a/libcef/browser/chrome/chrome_browser_delegate.cc b/libcef/browser/chrome/chrome_browser_delegate.cc index 668ced6aa..87d532659 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.cc +++ b/libcef/browser/chrome/chrome_browser_delegate.cc @@ -10,6 +10,7 @@ #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/browser_info_manager.h" #include "cef/libcef/browser/browser_platform_delegate.h" +#include "cef/libcef/browser/chrome/browser_util.h" #include "cef/libcef/browser/chrome/chrome_browser_context.h" #include "cef/libcef/browser/chrome/chrome_browser_host_impl.h" #include "cef/libcef/browser/chrome/views/chrome_browser_view.h" @@ -25,6 +26,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_tabstrip.h" +#include "chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.h" +#include "chrome/browser/ui/window_feature_controller/window_feature_controller.h" #include "components/input/native_web_keyboard_event.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/keyboard_event_processing_result.h" @@ -43,8 +46,9 @@ ChromeBrowserDelegate::ChromeBrowserDelegate( DCHECK(browser_); if (opener) { - DCHECK(browser->is_type_picture_in_picture() || - browser->is_type_devtools()); + DCHECK(browser->GetType() == + BrowserWindowInterface::TYPE_PICTURE_IN_PICTURE || + browser->GetType() == BrowserWindowInterface::TYPE_DEVTOOLS); auto opener_host = ChromeBrowserHostImpl::GetBrowserForBrowser(opener); DCHECK(opener_host); if (opener_host) { @@ -58,7 +62,7 @@ ChromeBrowserDelegate::~ChromeBrowserDelegate() = default; // static Browser* ChromeBrowserDelegate::CreateDevToolsBrowser( Profile* profile, - Browser* opener, + BrowserWindowInterface* opener, content::WebContents* inspected_web_contents, std::unique_ptr& devtools_contents) { // |opener| is the same value that will be passed to the ChromeBrowserDelegate @@ -183,7 +187,7 @@ Browser* ChromeBrowserDelegate::CreateDevToolsBrowser( // // Use Browser creation params specific to DevTools popups. - auto chrome_params = Browser::CreateParams::CreateForDevTools(profile); + auto chrome_params = BrowserWindowCreateParams::CreateForDevTools(profile); // Pass |opener| to the ChromeBrowserDelegate constructor for the new popup // Browser. @@ -232,7 +236,7 @@ void ChromeBrowserDelegate::OnWebContentsCreated( // Necessary to receive LoadingStateChanged calls during initial navigation. // This will be called again in Browser::SetAsDelegate, which should be // fine. - new_contents->SetDelegate(browser_); + new_contents->SetDelegate(BrowserWebContentsDelegate::From(browser_.get())); SetAsDelegate(new_contents, /*set_delegate=*/true); } @@ -252,7 +256,8 @@ void ChromeBrowserDelegate::SetAsDelegate(content::WebContents* web_contents, return; } - const bool is_devtools_popup = browser_->is_type_devtools(); + const bool is_devtools_popup = + browser_->GetType() == BrowserWindowInterface::TYPE_DEVTOOLS; // We should never reach here for DevTools popups that have an opener, as // CreateDevToolsBrowser should have already created the browser host. @@ -418,7 +423,7 @@ bool ChromeBrowserDelegate::RendererResponsiveEx( } bool ChromeBrowserDelegate::SupportsFramelessPictureInPicture() const { - if (!browser_->is_type_picture_in_picture()) { + if (browser_->GetType() != BrowserWindowInterface::TYPE_PICTURE_IN_PICTURE) { return false; } @@ -444,9 +449,9 @@ std::optional ChromeBrowserDelegate::SupportsWindowFeature( int feature) const { // Override the default value from // Browser::PictureInPictureBrowserSupportsWindowFeature. - if (static_cast(feature) == - Browser::WindowFeature::kFeatureTitleBar && - browser_->is_type_picture_in_picture()) { + if (static_cast(feature) == + WindowFeatureController::WindowFeature::kFeatureTitleBar && + browser_->GetType() == BrowserWindowInterface::TYPE_PICTURE_IN_PICTURE) { // Return false to hide titlebar and enable draggable regions. return !SupportsFramelessPictureInPicture(); } @@ -531,8 +536,9 @@ void ChromeBrowserDelegate::WindowFullscreenStateChanged() { } bool ChromeBrowserDelegate::HasViewsHostedOpener() const { - DCHECK(browser_->is_type_picture_in_picture() || - browser_->is_type_devtools()); + DCHECK(browser_->GetType() == + BrowserWindowInterface::TYPE_PICTURE_IN_PICTURE || + browser_->GetType() == BrowserWindowInterface::TYPE_DEVTOOLS); return opener_host_ && opener_host_->is_views_hosted(); } @@ -827,8 +833,8 @@ bool ChromeBrowserDelegate::IsViewsHosted() const { CefWindowImpl* ChromeBrowserDelegate::GetCefWindowImpl() const { if (IsViewsHosted()) { - if (auto chrome_browser_view = - static_cast(&browser_->GetBrowserView())) { + if (auto* chrome_browser_view = static_cast( + BrowserView::GetBrowserViewForBrowser(browser_))) { return chrome_browser_view->cef_browser_view()->cef_window_impl(); } } @@ -863,13 +869,9 @@ std::unique_ptr BrowserDelegate::Create( params->create_params_.browser_view = nullptr; } - // We could just `static_cast(opener)`, but we follow the - // recommended approach instead. - Browser* opener_browser = nullptr; + const Browser* opener_browser = nullptr; if (opener) { - auto* browser_view = BrowserView::GetBrowserViewForBrowser(opener); - CHECK(browser_view); - opener_browser = browser_view->browser(); + opener_browser = cef::BrowserForBWI(opener); } return std::make_unique(browser, create_params, @@ -879,7 +881,7 @@ std::unique_ptr BrowserDelegate::Create( // static Browser* BrowserDelegate::CreateDevToolsBrowser( Profile* profile, - Browser* opener, + BrowserWindowInterface* opener, content::WebContents* inspected_web_contents, std::unique_ptr& devtools_contents) { return ChromeBrowserDelegate::CreateDevToolsBrowser( diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 128ee17cf..33f72e201 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -55,7 +55,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { static Browser* CreateDevToolsBrowser( Profile* profile, - Browser* opener, + BrowserWindowInterface* opener, content::WebContents* inspected_web_contents, std::unique_ptr& devtools_contents); diff --git a/libcef/browser/chrome/chrome_browser_host_impl.cc b/libcef/browser/chrome/chrome_browser_host_impl.cc index 6086c7a0f..b363de851 100644 --- a/libcef/browser/chrome/chrome_browser_host_impl.cc +++ b/libcef/browser/chrome/chrome_browser_host_impl.cc @@ -8,6 +8,7 @@ #include "base/notimplemented.h" #include "cef/libcef/browser/browser_platform_delegate.h" #include "cef/libcef/browser/chrome/browser_platform_delegate_chrome.h" +#include "cef/libcef/browser/chrome/browser_util.h" #include "cef/libcef/browser/chrome/views/chrome_browser_view.h" #include "cef/libcef/browser/chrome/views/chrome_browser_widget.h" #include "cef/libcef/browser/thread_util.h" @@ -95,12 +96,12 @@ CefRefPtr ChromeBrowserHostImpl::GetBrowserForGlobalId( // static CefRefPtr ChromeBrowserHostImpl::GetBrowserForBrowser( - const Browser* browser) { + const BrowserWindowInterface* browser) { // Return the ChromeBrowserHostImpl that is currently active. // Views-hosted Browsers will contain a single ChromeBrowserHostImpl. // Otherwise, there will be a ChromeBrowserHostImpl per Tab/WebContents. // |contents| may be nullptr during Browser initialization or destruction. - auto contents = browser->tab_strip_model()->GetActiveWebContents(); + auto contents = browser->GetTabStripModel()->GetActiveWebContents(); if (!contents) { return nullptr; } @@ -111,7 +112,7 @@ ChromeBrowserHostImpl::~ChromeBrowserHostImpl() = default; void ChromeBrowserHostImpl::AddNewContents( std::unique_ptr contents, - std::optional browser_create_params) { + std::optional browser_create_params) { DCHECK(contents); DCHECK(!browser_); @@ -344,7 +345,8 @@ void ChromeBrowserHostImpl::ExecuteChromeCommand( ChromeBrowserView* ChromeBrowserHostImpl::chrome_browser_view() const { if (browser_ && is_views_hosted_) { - return static_cast(&browser_->GetBrowserView()); + return static_cast( + BrowserView::GetBrowserViewForBrowser(browser_)); } return nullptr; } @@ -400,11 +402,12 @@ ChromeBrowserHostImpl::ChromeBrowserHostImpl( // static Browser* ChromeBrowserHostImpl::CreateBrowser( const CefBrowserCreateParams& params, - std::optional browser_create_params) { - Browser::CreateParams chrome_params = [¶ms, &browser_create_params]() { + std::optional browser_create_params) { + BrowserWindowCreateParams chrome_params = [¶ms, + &browser_create_params]() { if (!browser_create_params.has_value()) { auto* profile = CefRequestContextImpl::GetProfile(params.request_context); - return Browser::CreateParams(profile, /*user_gesture=*/false); + return BrowserWindowCreateParams(profile, /*from_user_gesture=*/false); } else { return std::move(*browser_create_params); } @@ -419,11 +422,11 @@ Browser* ChromeBrowserHostImpl::CreateBrowser( // documentation. ChromeBrowserView* chrome_browser_view = nullptr; if (params.browser_view) { - if (chrome_params.type == Browser::TYPE_NORMAL) { + if (chrome_params.type == BrowserWindowInterface::TYPE_NORMAL) { // Don't show most controls. - chrome_params.type = Browser::TYPE_POPUP; + chrome_params.type = BrowserWindowInterface::TYPE_POPUP; // Don't show title bar or address. - chrome_params.trusted_source = true; + chrome_params.is_trusted_source = true; } auto view_impl = @@ -445,7 +448,8 @@ Browser* ChromeBrowserHostImpl::CreateBrowser( // The same params will be used to create a new Browser if the tab is dragged // out of the existing Browser. The returned Browser is owned by the // BrowserManagerService. - auto* browser = Browser::Create(chrome_params); + auto* browser = + cef::BrowserForBWI(CreateBrowserWindow(std::move(chrome_params))); bool show_browser = true; diff --git a/libcef/browser/chrome/chrome_browser_host_impl.h b/libcef/browser/chrome/chrome_browser_host_impl.h index 98e7dde38..d65742e17 100644 --- a/libcef/browser/chrome/chrome_browser_host_impl.h +++ b/libcef/browser/chrome/chrome_browser_host_impl.h @@ -13,6 +13,7 @@ #include "cef/libcef/browser/browser_host_base.h" #include "cef/libcef/browser/chrome/browser_delegate.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_window/public/create_browser_window.h" class ChromeBrowserDelegate; class ChromeBrowserView; @@ -55,9 +56,10 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase { // Returns the browser associated with the specified global ID. static CefRefPtr GetBrowserForGlobalId( const content::GlobalRenderFrameHostId& global_id); - // Returns the browser associated with the specified Browser. + // Returns the browser associated with the specified Browser or + // BrowserWindowInterface. static CefRefPtr GetBrowserForBrowser( - const Browser* browser); + const BrowserWindowInterface* browser); ~ChromeBrowserHostImpl() override; @@ -133,7 +135,7 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase { // |browser_create_params| may be empty for default Browser creation behavior. static Browser* CreateBrowser( const CefBrowserCreateParams& params, - std::optional browser_create_params); + std::optional browser_create_params); // Called from ChromeBrowserDelegate::CreateBrowser when this object is first // created. Must be called on the UI thread. @@ -146,7 +148,7 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase { // creation behavior. void AddNewContents( std::unique_ptr contents, - std::optional browser_create_params); + std::optional browser_create_params); // Called when this object changes Browser ownership (e.g. initially created, // dragging between windows, etc). The old Browser, if any, will be cleared diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index 06b6f8954..3febdad9f 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -459,7 +459,8 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( bool* bypass_redirect_checks, bool* disable_secure_dns, network::mojom::URLLoaderFactoryOverridePtr* factory_override, - scoped_refptr navigation_response_task_runner) { + scoped_refptr navigation_response_task_runner, + bool is_for_network_service) { // Don't intercept requests for Profiles that were not created by CEF. // For example, the User Manager profile created via // profiles::CreateSystemProfileForUserManager. @@ -469,7 +470,8 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( browser_context, frame, render_process_id, type, request_initiator, isolation_info, navigation_id, ukm_source_id, factory_builder, header_client, bypass_redirect_checks, disable_secure_dns, - factory_override, navigation_response_task_runner); + factory_override, navigation_response_task_runner, + is_for_network_service); return; } @@ -500,7 +502,8 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( browser_context, frame, render_process_id, type, request_initiator, isolation_info, navigation_id, ukm_source_id, factory_builder, /*header_client=*/nullptr, bypass_redirect_checks, disable_secure_dns, - handler_override, navigation_response_task_runner); + handler_override, navigation_response_task_runner, + is_for_network_service); DCHECK(intercepting_factory->overriding_factory); DCHECK(intercepting_factory->overridden_factory_receiver); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index c5d61ad97..5fdb4d8d4 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -83,8 +83,8 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { bool* bypass_redirect_checks, bool* disable_secure_dns, network::mojom::URLLoaderFactoryOverridePtr* factory_override, - scoped_refptr navigation_response_task_runner) - override; + scoped_refptr navigation_response_task_runner, + bool is_for_network_service) override; bool HandleExternalProtocol( const GURL& url, content::WebContents::Getter web_contents_getter, diff --git a/libcef/browser/chrome/views/chrome_browser_widget.cc b/libcef/browser/chrome/views/chrome_browser_widget.cc index 4623d89ff..cbefc6330 100644 --- a/libcef/browser/chrome/views/chrome_browser_widget.cc +++ b/libcef/browser/chrome/views/chrome_browser_widget.cc @@ -5,6 +5,7 @@ #include "cef/libcef/browser/chrome/views/chrome_browser_widget.h" #include "base/functional/bind.h" +#include "cef/libcef/browser/chrome/browser_util.h" #include "cef/libcef/browser/chrome/chrome_browser_host_impl.h" #include "cef/libcef/browser/chrome/views/chrome_browser_frame_view.h" #include "cef/libcef/browser/thread_util.h" @@ -181,7 +182,8 @@ std::unique_ptr ChromeBrowserWidget::CreateFrameView() { void ChromeBrowserWidget::Activate() { if (browser_view() && browser_view()->browser() && - browser_view()->browser()->is_type_devtools()) { + browser_view()->browser()->GetType() == + BrowserWindowInterface::TYPE_DEVTOOLS) { if (auto browser_host = ChromeBrowserHostImpl::GetBrowserForBrowser( browser_view()->browser())) { if (browser_host->platform_delegate()->HasExternalParent()) { @@ -206,8 +208,7 @@ void ChromeBrowserWidget::OnNativeWidgetDestroying() { BrowserWidget::OnNativeWidgetDestroying(); } -void ChromeBrowserWidget::OnBrowserDidClose( - BrowserWindowInterface* browser) { +void ChromeBrowserWidget::OnBrowserDidClose(BrowserWindowInterface* browser) { DCHECK(browser_view()); DCHECK_EQ(browser_view()->browser(), browser); CloseOwnedWidgets(); @@ -241,7 +242,7 @@ void ChromeBrowserWidget::OnNativeWidgetDestroyed() { browser_view()->DeleteBrowserWindow(); // Destruction logic from BrowserWidget::OnNativeWidgetDestroyed. - Browser* const browser = browser_view()->browser(); + Browser* const browser = cef::BrowserForBWI(browser_view()->browser()); auto* unload_controller = UnloadController::From(browser); unload_controller->set_force_skip_warning_user_on_close(true); unload_controller->OnWindowClosing(); diff --git a/libcef/browser/chrome/views/toolbar_view_impl.cc b/libcef/browser/chrome/views/toolbar_view_impl.cc index a9869c422..638475e21 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.cc +++ b/libcef/browser/chrome/views/toolbar_view_impl.cc @@ -7,7 +7,7 @@ // static CefRefPtr CefToolbarViewImpl::Create( CefRefPtr delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode) { CEF_REQUIRE_UIT_RETURN(nullptr); @@ -22,7 +22,7 @@ const char* const CefToolbarViewImpl::kTypeString = "ToolbarView"; CefToolbarViewImpl::CefToolbarViewImpl( CefRefPtr delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode) : ParentClass(delegate), diff --git a/libcef/browser/chrome/views/toolbar_view_impl.h b/libcef/browser/chrome/views/toolbar_view_impl.h index 437b648f5..82cbf1f87 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.h +++ b/libcef/browser/chrome/views/toolbar_view_impl.h @@ -11,8 +11,8 @@ #include "cef/libcef/browser/chrome/views/toolbar_view_view.h" #include "cef/libcef/browser/views/view_impl.h" -class Browser; class BrowserView; +class BrowserWindowInterface; class CefToolbarViewImpl : public CefViewImpl { @@ -27,7 +27,7 @@ class CefToolbarViewImpl // Create a new CefToolbarViewImpl instance. |delegate| may be nullptr. static CefRefPtr Create( CefRefPtr delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode); @@ -41,7 +41,7 @@ class CefToolbarViewImpl // Always call Initialize() after creation. // |delegate| may be nullptr. CefToolbarViewImpl(CefRefPtr delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode); @@ -49,7 +49,7 @@ class CefToolbarViewImpl CefToolbarViewView* CreateRootView() override; void InitializeRootView() override; - raw_ptr browser_; + raw_ptr browser_; raw_ptr browser_view_; std::optional const display_mode_; diff --git a/libcef/browser/chrome/views/toolbar_view_view.cc b/libcef/browser/chrome/views/toolbar_view_view.cc index 73ce221cc..431cfabb0 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.cc +++ b/libcef/browser/chrome/views/toolbar_view_view.cc @@ -7,7 +7,7 @@ #include "ui/base/metadata/metadata_impl_macros.h" CefToolbarViewView::CefToolbarViewView(CefViewDelegate* cef_delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode) : ParentClass(cef_delegate, browser, browser_view, display_mode) {} diff --git a/libcef/browser/chrome/views/toolbar_view_view.h b/libcef/browser/chrome/views/toolbar_view_view.h index c82533404..dda6b5acf 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.h +++ b/libcef/browser/chrome/views/toolbar_view_view.h @@ -17,7 +17,7 @@ class CefToolbarViewView : public CefViewView { // |cef_delegate| may be nullptr. explicit CefToolbarViewView(CefViewDelegate* cef_delegate, - Browser* browser, + BrowserWindowInterface* browser, BrowserView* browser_view, std::optional display_mode); diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index 73d0bfef7..1fc7a4921 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -61,7 +61,8 @@ scoped_refptr URLLoaderFactoryGetter::Create( ukm::SourceIdObj(), factory_builder, /*header_client=*/nullptr, /*bypass_redirect_checks=*/nullptr, /*disable_secure_dns=*/nullptr, /*factory_override=*/nullptr, - /*navigation_response_task_runner=*/nullptr); + /*navigation_response_task_runner=*/nullptr, + /*is_for_network_service=*/false); return base::WrapRefCounted(new URLLoaderFactoryGetter( loader_factory->Clone(), std::move(factory_builder))); diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 65af6895a..38faa430b 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -89,7 +89,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { CefDelegatedFrameHostClient& operator=(const CefDelegatedFrameHostClient&) = delete; - ui::Layer* DelegatedFrameHostGetLayer() const override { + ui::LayerSurface* GetDelegatedFrameHostLayer() const override { return view_->GetRootLayer(); } @@ -240,10 +240,10 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( AllocateFrameSinkId(), delegated_frame_host_client_.get(), false /* should_register_frame_sink_id */); - root_layer_ = std::make_unique(); + root_layer_ = std::make_unique(); - // Opacity of SOLID_COLOR layer is determined by the color's alpha channel. - root_layer_->SetColor(SkColor4f::FromColor(background_color_)); + root_layer_->SetFallbackBackgroundColor( + SkColor4f::FromColor(background_color_)); external_begin_frame_enabled_ = use_external_begin_frame; @@ -1680,7 +1680,7 @@ void CefRenderWidgetHostViewOSR::OnAcceleratedPaint( } } -ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const { +ui::LayerSurface* CefRenderWidgetHostViewOSR::GetRootLayer() const { return root_layer_.get(); } @@ -1933,5 +1933,5 @@ void CefRenderWidgetHostViewOSR::UpdateBackgroundColorFromRenderer( bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; GetRootLayer()->SetFillsBoundsOpaquely(opaque); - root_layer_->SetColor(SkColor4f::FromColor(color)); + root_layer_->SetFallbackBackgroundColor(SkColor4f::FromColor(color)); } diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index ad9e95b1d..c67209337 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -33,6 +33,7 @@ #include "ui/base/ime/text_input_client.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" +#include "ui/compositor/layer_surface.h" #include "ui/events/base_event_utils.h" #include "ui/events/gesture_detection/filtered_gesture_provider.h" #include "ui/events/gesture_detection/gesture_configuration.h" @@ -299,7 +300,7 @@ class CefRenderWidgetHostViewOSR content::RenderWidgetHostImpl* render_widget_host() const { return render_widget_host_; } - ui::Layer* GetRootLayer() const; + ui::LayerSurface* GetRootLayer() const; void OnPresentCompositorFrame(); @@ -397,7 +398,7 @@ class CefRenderWidgetHostViewOSR std::unique_ptr delegated_frame_host_; std::unique_ptr delegated_frame_host_client_; - std::unique_ptr root_layer_; + std::unique_ptr root_layer_; // Used to allocate LocalSurfaceIds when this is embedding external content. std::unique_ptr diff --git a/libcef/browser/permission_prompt.cc b/libcef/browser/permission_prompt.cc index e39602a4b..4b2f77595 100644 --- a/libcef/browser/permission_prompt.cc +++ b/libcef/browser/permission_prompt.cc @@ -128,7 +128,6 @@ class CefPermissionPrompt : public permissions::PermissionPrompt { std::optional GetViewBoundsInScreen() const override { return std::nullopt; } - bool ShouldFinalizeRequestAfterDecided() const override { return true; } std::vector GetPromptVariants() const override { return {}; diff --git a/libcef/browser/task_manager_impl.cc b/libcef/browser/task_manager_impl.cc index 7d94e8f97..efe27c20d 100644 --- a/libcef/browser/task_manager_impl.cc +++ b/libcef/browser/task_manager_impl.cc @@ -26,7 +26,6 @@ CefTaskManager::TaskType toCefTaskType(task_manager::Task::Type type) { case task_manager::Task::UNKNOWN: case task_manager::Task::ARC: case task_manager::Task::CROSTINI: - case task_manager::Task::PLUGIN_VM: return CEF_TASK_TYPE_UNKNOWN; case task_manager::Task::BROWSER: return CEF_TASK_TYPE_BROWSER; diff --git a/libcef/browser/views/native_widget_mac.mm b/libcef/browser/views/native_widget_mac.mm index 5a52ade77..a40812866 100644 --- a/libcef/browser/views/native_widget_mac.mm +++ b/libcef/browser/views/native_widget_mac.mm @@ -19,7 +19,7 @@ namespace { -AppShimHost* GetHostForBrowser(Browser* browser) { +AppShimHost* GetHostForBrowser(BrowserWindowInterface* browser) { auto* const shim_manager = apps::AppShimManager::Get(); if (!shim_manager) { return nullptr; diff --git a/libcef/common/chrome/chrome_main_delegate_cef.cc b/libcef/common/chrome/chrome_main_delegate_cef.cc index d2cda1d5b..82bf3dd81 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.cc +++ b/libcef/common/chrome/chrome_main_delegate_cef.cc @@ -12,6 +12,7 @@ #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/path_service.h" +#include "base/strings/string_split.h" #include "base/threading/threading_features.h" #include "cef/libcef/browser/chrome/chrome_browser_context.h" #include "cef/libcef/browser/chrome/chrome_content_browser_client_cef.h" diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index 3d44e5996..cb28da58e 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -23,7 +23,8 @@ bool CefResourceBundleDelegate::HasDataResource(int resource_id) const { return false; } -base::RefCountedMemory* CefResourceBundleDelegate::LoadDataResourceBytes( +scoped_refptr +CefResourceBundleDelegate::LoadDataResourceBytes( int resource_id, ui::ResourceScaleFactor scale_factor) { return nullptr; diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index 6bd0b6ed3..a8d1518ba 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -25,7 +25,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { gfx::Image GetImageNamed(int resource_id) override; gfx::Image GetNativeImageNamed(int resource_id) override; bool HasDataResource(int resource_id) const override; - base::RefCountedMemory* LoadDataResourceBytes( + scoped_refptr LoadDataResourceBytes( int resource_id, ui::ResourceScaleFactor scale_factor) override; std::optional LoadDataResourceString(int resource_id) override; diff --git a/libcef/common/resource_bundle_impl.cc b/libcef/common/resource_bundle_impl.cc index 7be4e2b90..a528e2b7f 100644 --- a/libcef/common/resource_bundle_impl.cc +++ b/libcef/common/resource_bundle_impl.cc @@ -29,7 +29,7 @@ CefRefPtr CefResourceBundleImpl::GetDataResourceForScale( return nullptr; } - base::RefCountedMemory* result = + scoped_refptr result = ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( resource_id, static_cast(scale_factor)); if (!result) { diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 19f641887..10252544e 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -28,7 +28,10 @@ #include "base/auto_reset.h" #include "base/functional/bind.h" #include "base/lazy_instance.h" +#include "base/notimplemented.h" #include "base/strings/string_number_conversions.h" +#include "cef/include/cef_api_hash.h" +#include "cef/libcef/common/api_version_util.h" #include "cef/libcef/common/app_manager.h" #include "cef/libcef/common/cef_switches.h" #include "cef/libcef/common/task_runner_impl.h" @@ -42,7 +45,6 @@ #include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/web_frame.h" #include "third_party/blink/public/web/web_local_frame.h" -#include "third_party/blink/public/web/web_script_controller.h" #include "url/gurl.h" namespace { @@ -584,10 +586,10 @@ void AccessorNameGetterCallbackImpl( } // See explanation in https://crbug.com/336325111. -void EmptySetterCallbackImpl(v8::Local property, - v8::Local value, - const v8::PropertyCallbackInfo& info) { -} +void EmptySetterCallbackImpl( + v8::Local property, + v8::Local value, + const v8::PropertyCallbackInfo& info) {} void AccessorNameSetterCallbackImpl( v8::Local property, @@ -704,36 +706,6 @@ v8::Intercepted InterceptorSetterCallbackImpl( return v8::Intercepted::kNo; } -// V8 extension registration. - -class ExtensionWrapper : public v8::Extension { - public: - ExtensionWrapper(const char* extension_name, - const char* javascript_code, - CefV8Handler* handler) - : v8::Extension(extension_name, javascript_code), handler_(handler) {} - - v8::Handle GetNativeFunctionTemplate( - v8::Isolate* isolate, - v8::Handle name) override { - if (!handler_) { - return v8::Local(); - } - - CefString func_name; - GetCefString(isolate, name, func_name); - - v8::Local function_data = - V8FunctionData::Create(isolate, func_name, handler_); - - return v8::FunctionTemplate::New(isolate, FunctionCallbackImpl, - function_data); - } - - private: - CefV8Handler* handler_; -}; - class CefV8ExceptionImpl : public CefV8Exception { public: CefV8ExceptionImpl(v8::Local context, @@ -851,31 +823,12 @@ void CefV8SetWorkerAttributes(int worker_id, const GURL& worker_url) { CefV8IsolateManager::Get()->SetWorkerAttributes(worker_id, worker_url); } -bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, - CefRefPtr handler) { - // Verify that this method was called on the correct thread. - CEF_REQUIRE_RT_RETURN(false); - - auto* isolate_manager = CefV8IsolateManager::Get(); - - V8TrackString* name = new V8TrackString(extension_name); - isolate_manager->AddGlobalTrackObject(name); - V8TrackString* code = new V8TrackString(javascript_code); - isolate_manager->AddGlobalTrackObject(code); - - if (handler.get()) { - // The reference will be released when the process exits. - V8TrackObject* object = new V8TrackObject(isolate_manager->isolate()); - object->SetHandler(handler); - isolate_manager->AddGlobalTrackObject(object); - } - - auto wrapper = std::make_unique( - name->GetString(), code->GetString(), handler.get()); - - blink::WebScriptController::RegisterExtension(std::move(wrapper)); - return true; +bool CefRegisterExtension(const CefString& /*extension_name*/, + const CefString& /*javascript_code*/, + CefRefPtr /*handler*/) { + CEF_API_REQUIRE_REMOVED(CEF_NEXT); + NOTIMPLEMENTED(); + return false; } // Helper macros diff --git a/patch/patch.cfg b/patch/patch.cfg index 2bc83e3e4..4ddc53ae8 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -381,12 +381,6 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/3681 'name': 'chrome_browser_printing_oop_osr', }, - { - # alloy: Fix crash in - # ReadAnythingSoftNavigationObserver::OnSoftNavigation - # https://github.com/chromiumembedded/cef/issues/4234 - 'name': 'chrome_browser_read_anything', - }, { # Support override of Chrome process singleton behavior. # https://github.com/chromiumembedded/cef/issues/3609 @@ -505,11 +499,6 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/2398 'name': 'resource_bundle_2512', }, - { - # macOS: Fix crash when showing a select popup with CefDoMessageLoopWork. - # https://github.com/chromiumembedded/cef/issues/2495 - 'name': 'message_pump_mac_2495', - }, { # Linux: Load binaries from DIR_ASSETS. # https://github.com/chromiumembedded/cef/issues/1936 diff --git a/patch/patches/angle_commit_config.patch b/patch/patches/angle_commit_config.patch index 8fca06bcb..595d0e9d2 100644 --- a/patch/patches/angle_commit_config.patch +++ b/patch/patches/angle_commit_config.patch @@ -1,5 +1,5 @@ diff --git BUILD.gn BUILD.gn -index 81d5cb41c184aff10699899a38b520337e7fe704..3a34b904841846203b780b870ac721bd3db6e997 100644 +index 0b6b06dcbb00694726a03816207bc2b26dd3dd15..73cc06d6125d8b71c8ce9697a3527eb1dc0208ac 100644 --- BUILD.gn +++ BUILD.gn @@ -97,6 +97,9 @@ declare_args() { @@ -12,7 +12,7 @@ index 81d5cb41c184aff10699899a38b520337e7fe704..3a34b904841846203b780b870ac721bd } declare_args() { -@@ -939,6 +942,8 @@ action("angle_commit_id") { +@@ -942,6 +945,8 @@ action("angle_commit_id") { "gen", rebase_path(_commit_id_header, root_build_dir), rebase_path(depfile, root_build_dir), diff --git a/patch/patches/base_command_line_1872.patch b/patch/patches/base_command_line_1872.patch index ad9f09a0c..27f1d3198 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 8325518cc9785297d47446123a001001e1412f5f..333c88f392ba15a58153091df6ff1b75832d2205 100644 +index 3a95f227d419ebe02319c065f3cdedf2a65c69a4..6fe016791119ee1e4a05d0b84462a16ae85de130 100644 --- base/command_line.cc +++ base/command_line.cc -@@ -435,11 +435,10 @@ void CommandLine::AppendSwitchNative(std::string_view switch_string, +@@ -438,11 +438,10 @@ void CommandLine::AppendSwitchNative(std::string_view switch_string, #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) sequence_checker_.Check(); #endif diff --git a/patch/patches/base_rand_util_lazy_seed.patch b/patch/patches/base_rand_util_lazy_seed.patch index f9174db23..db54f019f 100644 --- a/patch/patches/base_rand_util_lazy_seed.patch +++ b/patch/patches/base_rand_util_lazy_seed.patch @@ -1,8 +1,8 @@ diff --git base/rand_util.cc base/rand_util.cc -index ee86984a222c44d29c83da0134a93b0e7ddaa1e4..5580637cc84be708c8fe65b535fae219555515c3 100644 +index 0387c25e436c1e7d6b379fcbfcd0cb62970792c8..57c434330ac31cb661ec15c6e9581c5dc3ddee3e 100644 --- base/rand_util.cc +++ base/rand_util.cc -@@ -135,17 +135,28 @@ std::vector RandBytesAsVector(size_t length) { +@@ -130,17 +130,28 @@ std::vector RandBytesAsVector(size_t length) { return result; } @@ -36,7 +36,7 @@ index ee86984a222c44d29c83da0134a93b0e7ddaa1e4..5580637cc84be708c8fe65b535fae219 // https://en.wikipedia.org/wiki/Xorshift#xorshift+ for details. uint64_t t = a_; diff --git base/rand_util.h base/rand_util.h -index a9ca1f92958e792db46c3e11182b6313a63ae1bc..d14daa58e41ccbfc6638a43b10d0c9858ef8f0cf 100644 +index ae5425cf171e811447a5a0a82f67429b2914188f..6b1b98440fb1babc32cc7b506c207eb7dc991b36 100644 --- base/rand_util.h +++ base/rand_util.h @@ -246,8 +246,12 @@ class MetricsSubSampler; diff --git a/patch/patches/base_test_4396276.patch b/patch/patches/base_test_4396276.patch index da6908f70..672b713a1 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 dc1a5996fc73b01b2e6b82b60bb51ee67e23e897..59cb75b93642d87797e4550c956d2ca7ae792906 100644 +index bd2e9da070de2e65e15629f1c7349cbdfb4d77d5..4478a654ad57dd67fda4030a96aa8b0a6edd6d30 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn -@@ -271,11 +271,6 @@ static_library("test_support") { +@@ -272,11 +272,6 @@ static_library("test_support") { # that would require special support in gn2bp (AOSP Cronet). if (!is_cronet_build) { public_deps += [ "//third_party/perfetto:perfetto_test_support" ] @@ -14,7 +14,7 @@ index dc1a5996fc73b01b2e6b82b60bb51ee67e23e897..59cb75b93642d87797e4550c956d2ca7 deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", -@@ -695,7 +690,7 @@ action("amalgamated_perfetto_sql_stdlib") { +@@ -696,7 +691,7 @@ action("amalgamated_perfetto_sql_stdlib") { # 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 dc1a5996fc73b01b2e6b82b60bb51ee67e23e897..59cb75b93642d87797e4550c956d2ca7 if (is_ios) { _target_type = "ios_framework_bundle" } -@@ -704,6 +699,8 @@ target(_target_type, "test_trace_processor") { +@@ -705,6 +700,8 @@ target(_target_type, "test_trace_processor") { defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] testonly = true sources = [ @@ -32,7 +32,7 @@ index dc1a5996fc73b01b2e6b82b60bb51ee67e23e897..59cb75b93642d87797e4550c956d2ca7 "tracing/test_trace_processor_export.h", "tracing/test_trace_processor_impl.cc", "tracing/test_trace_processor_impl.h", -@@ -721,33 +718,6 @@ target(_target_type, "test_trace_processor") { +@@ -722,33 +719,6 @@ target(_target_type, "test_trace_processor") { output_name = "TestTraceProcessor" bundle_deps_filter = [ "//third_party/icu:icudata" ] } @@ -88,10 +88,10 @@ index dc5c18bd66d1cc6fe55edc1a0709795cb2b3b3ec..15f25c0e92f87b2dc73be30b5366c084 + #endif // BASE_TEST_TRACING_TEST_TRACE_PROCESSOR_EXPORT_H_ diff --git content/shell/BUILD.gn content/shell/BUILD.gn -index 88c35bb7c16830bd2a50bbd6abad82dd908bf89c..6f849037262d2325cf59ff99a0e085f4f052645c 100644 +index ea8664f6ba1b01d5d2a90c589633a40da630ff3b..47d63fab8413e3f3574bcbd99d16a81d9fc6ac3d 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn -@@ -936,7 +936,6 @@ if (is_mac) { +@@ -941,7 +941,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" ] @@ -100,10 +100,10 @@ index 88c35bb7c16830bd2a50bbd6abad82dd908bf89c..6f849037262d2325cf59ff99a0e085f4 # Both the main :content_shell and :content_shell_helper_app executables # need to link the framework. Because they are at different directory diff --git ui/views/examples/BUILD.gn ui/views/examples/BUILD.gn -index 1b7175d3dfe505878938e61012de8bdd04d73022..a114871682b16ed4a2c1d98248fead6722e9a3ee 100644 +index 7ecb90086e29fce23aba5cd8b6a69651584f21c3..d911f999330ab9cd9c2c88e242b29067dd7f8226 100644 --- ui/views/examples/BUILD.gn +++ ui/views/examples/BUILD.gn -@@ -367,7 +367,6 @@ if (is_mac) { +@@ -373,7 +373,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.framework" ] diff --git a/patch/patches/base_thread_pool_5548577.patch b/patch/patches/base_thread_pool_5548577.patch index df3d6bd84..03758788e 100644 --- a/patch/patches/base_thread_pool_5548577.patch +++ b/patch/patches/base_thread_pool_5548577.patch @@ -1,8 +1,8 @@ diff --git base/task/thread_pool/thread_pool_impl.cc base/task/thread_pool/thread_pool_impl.cc -index cc1579306df670f66fbdf8336d796e73d203d3b8..16758431c299bfe49dece53c8b0b66b64a11d13a 100644 +index 5595dc92ec6d0420feb0a5c9161531e3eccd1f6e..6beffec7d0e0e4169daf247765c42c57c2b1ef29 100644 --- base/task/thread_pool/thread_pool_impl.cc +++ base/task/thread_pool/thread_pool_impl.cc -@@ -127,6 +127,10 @@ ThreadPoolImpl::ThreadPoolImpl( +@@ -115,6 +115,10 @@ ThreadPoolImpl::ThreadPoolImpl( tracked_ref_factory_.GetTrackedRef(), monitor_worker_thread_priorities, record_lock_contention); } diff --git a/patch/patches/blink_ax_viewport_collapse.patch b/patch/patches/blink_ax_viewport_collapse.patch index 67b838919..235603f62 100644 --- a/patch/patches/blink_ax_viewport_collapse.patch +++ b/patch/patches/blink_ax_viewport_collapse.patch @@ -25,7 +25,7 @@ index b042d68a4d06b59942775e04ef81a32b347e58a3..329323e63c5fc4230d9935931f4cdbb5 // default value depends on the platform. bool touch_drag_drop_enabled = false; diff --git third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -index 735a8ca35575d6be95749c16e7e63d3f59f65bd2..fbf44f6e363c5fee92135bcd672dc57b236bd7ed 100644 +index 91593851bc33781ca0a986f0100a5f334847fec0..a4afbbae1b61a09a5eff388df333414c409e58a4 100644 --- third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h @@ -796,6 +796,11 @@ struct BLINK_COMMON_EXPORT StructTraitsSetAccessibilityPasswordValuesEnabled(enabled); } diff --git third_party/blink/renderer/core/exported/web_settings_impl.h third_party/blink/renderer/core/exported/web_settings_impl.h -index 2bb646bc6aa6fcd8eb60481bb4bb205aa46e57ac..bd021082c26743212a6e9495fe6dc09f1095c5fb 100644 +index c2fa942417b9bc24519078b8faf8c384c24ffb9b..c02dd3b7e559fd63e7f3f72bac025e8ec076fcf2 100644 --- third_party/blink/renderer/core/exported/web_settings_impl.h +++ third_party/blink/renderer/core/exported/web_settings_impl.h -@@ -175,6 +175,7 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings { +@@ -176,6 +176,7 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings { void SetAccessibilityFontScaleFactor(float) override; void SetAccessibilityTextSizeContrastFactor(int) override; void SetAccessibilityAlwaysShowFocus(bool) override; @@ -94,10 +94,10 @@ index 2bb646bc6aa6fcd8eb60481bb4bb205aa46e57ac..bd021082c26743212a6e9495fe6dc09f void SetTextTrackKindUserPreference(TextTrackKindUserPreference) override; void SetTextTrackBackgroundColor(const WebString&) override; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index 09171e03df2d7d6547db98107f5ad52880915d63..2b6b7a4b26055184eeef7bde186a18f274e0eeab 100644 +index b24669cc62b9c4b1a9d9ee84609832ae52ceffed..3c5bbc24998dc5d18a52e0f84f4ee2c261e740ea 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -1863,6 +1863,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1866,6 +1866,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, settings->SetForceDarkModeEnabled(prefs.force_dark_mode_enabled); settings->SetAccessibilityAlwaysShowFocus(prefs.always_show_focus); @@ -218,7 +218,7 @@ index de1558867828e47bad90c2c2986675245eb2f30a..822ea1ae4933e47a5af3af03f13e7c45 if (!last_sync_times_.Contains(&document)) diff --git third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc -index 946d65e9a7b98eb3e4dfbc35c590298c8b61ace1..a7e4fa594ff92c659416c76de1cb5293cf161453 100644 +index 1119773ff9b3e7e882aae0e1e83a81071bd6c591..2538d6b7f5c61c1f666cbf665d8261263042dcdf 100644 --- third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc +++ third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc @@ -4,6 +4,7 @@ diff --git a/patch/patches/blink_web_element_4200240.patch b/patch/patches/blink_web_element_4200240.patch index 4d7ffd013..9d53d4ea8 100644 --- a/patch/patches/blink_web_element_4200240.patch +++ b/patch/patches/blink_web_element_4200240.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h -index 4ee1b5209e467c1dbe8c63c1516c842f687fb238..c54dac72a9e100502e55a44dc3c6529ad858e655 100644 +index b56dc499e4c31eb7cb10bd1b79e56dafa63d9fa9..c39757bccdded4b7544522137cb88bd3271c6557 100644 --- third_party/blink/public/web/web_element.h +++ third_party/blink/public/web/web_element.h @@ -101,6 +101,9 @@ class BLINK_EXPORT WebElement : public WebNode { @@ -13,10 +13,10 @@ index 4ee1b5209e467c1dbe8c63c1516c842f687fb238..c54dac72a9e100502e55a44dc3c6529a void Focus(); diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc -index 3747e861d87aa5d9ab48097fd9d40022009c845d..24a2f89c634827c1b10c439d7622359946f1b99e 100644 +index 4f626dc0b938033e875f7b996e3751cd977e66bc..07770d1d1da9bb23d9c7037b760318332c266a28 100644 --- third_party/blink/renderer/core/exported/web_element.cc +++ third_party/blink/renderer/core/exported/web_element.cc -@@ -201,6 +201,24 @@ void WebElement::SetAttribute(const WebString& attr_name, +@@ -210,6 +210,24 @@ void WebElement::SetAttribute(const WebString& attr_name, IGNORE_EXCEPTION_FOR_TESTING); } diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 62c3d20d1..19e1e2e06 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,5 +1,5 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index 996e402006f10e1790a617f7093a6a6eac7a0017..3b54cf83f692b920ab5b6ace3eb05e1a6095343a 100644 +index 5a1f4d5d5f650824aee1d09973bf0e43c3e9e2b4..155d8506315755f5db45cfe1dc752e49e121b07b 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc @@ -216,11 +216,9 @@ void BrowserTaskExecutor::ResetForTesting() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 52a68f10e..7c2f60024 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/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2c3b6e4c1 100644 +index 3d46f9e7d35332f594f46cb50c93a072bc5b8208..159bfadb6e51231b2533de3e20d467a242fbb885 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -388,8 +388,13 @@ void AddAdditionalRequestHeaders( +@@ -393,8 +393,13 @@ void AddAdditionalRequestHeaders( blink::mojom::Referrer* referrer, FrameTreeNode* frame_tree_node, bool is_browser_initiated) { @@ -18,7 +18,7 @@ index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2 bool is_reload = NavigationTypeUtils::IsReload(navigation_type); bool is_history = NavigationTypeUtils::IsHistory(navigation_type); -@@ -9586,7 +9591,8 @@ std::optional NavigationRequest::GetOriginToCommit() { +@@ -9853,7 +9858,8 @@ std::optional NavigationRequest::GetOriginToCommit() { } url::Origin NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponse( @@ -28,7 +28,7 @@ index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2 // Calculate an approximation of the origin. The sandbox/csp are ignored. url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(); -@@ -9603,6 +9609,17 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponse( +@@ -9870,6 +9876,17 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponse( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -46,7 +46,7 @@ index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2 if (use_opaque_origin) { origin = origin.DeriveNewOpaqueOrigin(); } -@@ -9663,8 +9680,9 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() { +@@ -9930,8 +9947,9 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() { return GetRenderFrameHost()->GetLastCommittedOrigin(); } @@ -58,7 +58,7 @@ index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2 SCOPED_CRASH_KEY_BOOL("Bug1454273", "is_in_main_frame", IsInMainFrame()); SCOPED_CRASH_KEY_STRING256( -@@ -9699,10 +9717,17 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() { +@@ -9966,10 +9984,17 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponse() { DetermineInitiatorRelationship(initiator_rfh, frame_tree_node_->current_frame_host())); @@ -78,10 +78,10 @@ index 6a407b0e63070930781ddd8d4b1fe74d9c18690b..35b882270a228a39e34459157f42dbc2 // If the target of this navigation will be rendered in a RenderFrameHost, // then verify that the chosen origin is allowed to be accessed from that diff --git content/browser/renderer_host/navigation_request.h content/browser/renderer_host/navigation_request.h -index b38e79311caaaa0850bb008c0d83981a64d0301d..ffc811168f584a47b388850b05dc842039e2cc88 100644 +index 63ae86f505f4f2dbd3f48f252087f317c7d799ee..7face03534fe8522bcdea4e59549ee3b931bbaa4 100644 --- content/browser/renderer_host/navigation_request.h +++ content/browser/renderer_host/navigation_request.h -@@ -2541,7 +2541,8 @@ class CONTENT_EXPORT NavigationRequest +@@ -2624,7 +2624,8 @@ class CONTENT_EXPORT NavigationRequest // situations where the final frame host hasn't been determined but the origin // is needed to create URLLoaderFactory. url::Origin GetOriginForURLLoaderFactoryBeforeResponse( @@ -92,10 +92,10 @@ index b38e79311caaaa0850bb008c0d83981a64d0301d..ffc811168f584a47b388850b05dc8420 // Superset of GetOriginForURLLoaderFactoryBeforeResponse(). Calculates // the origin with information from the final frame host. Can be called only diff --git content/browser/security/cpsp/child_process_security_policy_impl.cc content/browser/security/cpsp/child_process_security_policy_impl.cc -index 170cf4a3bdd51307186f611487f95e594196e84c..2310be5260a6656c926833558f897792be093ef6 100644 +index 62e399f851aadddfc704f6f7c3d45883c467d95a..79cae8cc32f06d1596c2f596202643b68af93e4b 100644 --- content/browser/security/cpsp/child_process_security_policy_impl.cc +++ content/browser/security/cpsp/child_process_security_policy_impl.cc -@@ -2570,6 +2570,17 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks( +@@ -2732,6 +2732,17 @@ bool ChildProcessSecurityPolicyImpl::PerformJailAndCitadelChecks( if (actual_process_lock.MatchesScheme(url::kDataScheme)) { return true; } diff --git a/patch/patches/chrome_autofill_bubble_3796.patch b/patch/patches/chrome_autofill_bubble_3796.patch index 78ffd36c5..456def3c7 100644 --- a/patch/patches/chrome_autofill_bubble_3796.patch +++ b/patch/patches/chrome_autofill_bubble_3796.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/autofill/address_bubbles_controller.cc chrome/browser/ui/autofill/address_bubbles_controller.cc -index 8468ac8cf0b14a01629724ce3915f3797c1c2a77..5e04b04bd9faec6d8cd997cbc45d70f36cb3b09a 100644 +index af32d3bd996d221e5653ac97deb494bd757bbe6b..c29ec520432e1520445cb100be03fc35cdb2fe4b 100644 --- chrome/browser/ui/autofill/address_bubbles_controller.cc +++ chrome/browser/ui/autofill/address_bubbles_controller.cc @@ -55,11 +55,15 @@ AutofillBubbleBase* ShowSaveBubble( @@ -65,28 +65,28 @@ index 8468ac8cf0b14a01629724ce3915f3797c1c2a77..5e04b04bd9faec6d8cd997cbc45d70f3 } BubbleType AddressBubblesController::GetBubbleType() const { -@@ -311,10 +321,12 @@ void AddressBubblesController::SetUpBubble( +@@ -311,10 +321,13 @@ void AddressBubblesController::SetUpBubble( } void AddressBubblesController::MaybeShowIOSDektopAddressPromo() { -- Browser* browser = -- BrowserWindow::FindBrowserWindowWithWebContents(web_contents()) -- ->AsBrowserView() -- ->browser(); + auto browser_window = + BrowserWindow::FindBrowserWindowWithWebContents(web_contents()); + if (!browser_window) { + return; + } -+ Browser* browser = browser_window->AsBrowserView()->browser(); + BrowserWindowInterface* browser = +- BrowserWindow::FindBrowserWindowWithWebContents(web_contents()) +- ->AsBrowserView() +- ->browser(); ++ browser_window->AsBrowserView()->browser(); // Verify if user is eligible for iOS promo, and attempt showing if they are. ios_promos_utils::VerifyIOSPromoEligibility( diff --git chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc -index 0c0feb910fe45f460da71042a4ace40f6734f251..2773aa4486c985ccd85dd6566792a56889f1c0b1 100644 +index 111e05ccf46482e54c0a458f20a5ba137def91ed..85486c29a938ff46c835d3dafbfb675fecc6de5b 100644 --- chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc +++ chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc -@@ -824,7 +824,9 @@ SaveCardBubbleControllerImpl::GetAutofillBubbleHandler() { +@@ -823,7 +823,9 @@ SaveCardBubbleControllerImpl::GetAutofillBubbleHandler() { tabs::TabInterface* tab = tabs::TabInterface::GetFromContents(web_contents()); CHECK(tab); BrowserWindowInterface* browser = tab->GetBrowserWindowInterface(); @@ -97,7 +97,7 @@ index 0c0feb910fe45f460da71042a4ace40f6734f251..2773aa4486c985ccd85dd6566792a568 return AutofillBubbleHandler::Get(browser->GetUnownedUserDataHost()); } -@@ -834,6 +836,9 @@ void SaveCardBubbleControllerImpl::DoShowBubble() { +@@ -833,6 +835,9 @@ void SaveCardBubbleControllerImpl::DoShowBubble() { } AutofillBubbleHandler* autofill_bubble_handler = GetAutofillBubbleHandler(); diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index c8e8823cd..1054528e7 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 147de9967aee1ecc53987d7a038c42f609351801..5f09325ef6adb042fc0da87172a92b8efbb46395 100644 +index f261c72029a989e0fc0cdf0f7042b1bc12b84e07..3904325f1dca1944185aeb1c3abcd84c492c690a 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,15 +10,15 @@ index 147de9967aee1ecc53987d7a038c42f609351801..5f09325ef6adb042fc0da87172a92b8e import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -2054,6 +2055,7 @@ source_set("browser") { - "//build/config/compiler:compiler_buildflags", - "//build/config/linux/dbus:buildflags", +@@ -2045,6 +2046,7 @@ source_set("browser") { + ":unexpire_flags", + "//base", "//cc", + "//cef/libcef/features:buildflags", "//chrome:extra_resources", - "//chrome:resources", - "//chrome:strings", -@@ -3065,6 +3067,10 @@ source_set("browser") { + "//chrome/browser/accessibility:impl", + "//chrome/browser/account_settings", +@@ -2499,6 +2501,10 @@ source_set("browser") { ] } diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index b5ea7b474..5c0c3e299 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -34,10 +34,10 @@ index 08949a69415dfa9f836e00929a34330a34546ce2..e417f50fa68e274b80c0d45bdaa45c7b NOTREACHED(); } diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc -index 9d28b02fa09bf331ed9b381ba25b56f0a30ec365..5ffa364977080aaab9819d789e73544334410271 100644 +index 8aabdbd1826161706e85f0b8a95759abf6198ce2..bd31551cf396b2747a275afbfc67c8db3cc184d4 100644 --- chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc -@@ -854,6 +854,12 @@ Profile* DevToolsWindow::GetProfileForDevToolsWindow( +@@ -857,6 +857,12 @@ Profile* DevToolsWindow::GetProfileForDevToolsWindow( if (profile->IsPrimaryOTRProfile() || profile->IsDevToolsOTRProfile()) { return profile; } @@ -50,14 +50,13 @@ index 9d28b02fa09bf331ed9b381ba25b56f0a30ec365..5ffa364977080aaab9819d789e735443 return profile->GetOriginalProfile(); } -@@ -1380,6 +1386,14 @@ DevToolsWindow* DevToolsWindow::Create( +@@ -1402,6 +1408,13 @@ DevToolsWindow* DevToolsWindow::Create( if (!devtools_ui_controller || !devtools_ui_controller->CanDockDevtools()) { can_dock = false; } + +#if BUILDFLAG(ENABLE_CEF) -+ if (can_dock && browser && -+ browser->GetBrowserForMigrationOnly()->cef_delegate()) { ++ if (can_dock && browser && browser->cef_delegate()) { + // Don't dock DevTools for CEF-managed browsers. + can_dock = false; + } @@ -65,7 +64,7 @@ index 9d28b02fa09bf331ed9b381ba25b56f0a30ec365..5ffa364977080aaab9819d789e735443 } #endif // !BUILDFLAG(IS_ANDROID) -@@ -1844,7 +1858,9 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) { +@@ -1881,7 +1894,9 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) { /*navigation_handle_callback=*/{})) { #if BUILDFLAG(IS_ANDROID) NOTIMPLEMENTED(); @@ -76,21 +75,21 @@ index 9d28b02fa09bf331ed9b381ba25b56f0a30ec365..5ffa364977080aaab9819d789e735443 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); chrome::AddSelectedTabWithURL(displayer.browser_window_interface(), fixed_url, ui::PAGE_TRANSITION_LINK); -@@ -2050,12 +2066,31 @@ void DevToolsWindow::CreateDevToolsBrowser() { - Browser::CreationStatus::kOk) { +@@ -2087,12 +2102,30 @@ void DevToolsWindow::CreateDevToolsBrowser() { + BrowserWindowInterface::CreationStatus::kOk) { return; } -- browser_ = -- Browser::Create(Browser::CreateParams::CreateForDevTools(profile_)); +- browser_ = CreateBrowserWindow( +- BrowserWindowCreateParams::CreateForDevTools(profile_)); - browser_->GetTabStripModel()->AddWebContents( - OwnedMainWebContents::TakeWebContents( - std::move(owned_main_web_contents_)), - -1, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, AddTabTypes::ADD_ACTIVE); -+ + auto* inspected_web_contents = GetInspectedWebContents(); + BrowserWindowInterface* opener = nullptr; + if (inspected_web_contents) { -+ opener = GlobalBrowserCollection::GetInstance()->FindBrowserWithTab(inspected_web_contents); ++ opener = GlobalBrowserCollection::GetInstance()->FindBrowserWithTab( ++ inspected_web_contents); + } + auto devtools_contents = OwnedMainWebContents::TakeWebContents( + std::move(owned_main_web_contents_)); @@ -98,27 +97,26 @@ index 9d28b02fa09bf331ed9b381ba25b56f0a30ec365..5ffa364977080aaab9819d789e735443 +#if BUILDFLAG(ENABLE_CEF) + // If a Browser is created, it will take ownership of |devtools_contents|. + browser_ = cef::BrowserDelegate::CreateDevToolsBrowser( -+ profile_, opener ? opener->GetBrowserForMigrationOnly() : nullptr, -+ inspected_web_contents, devtools_contents); ++ profile_, opener, inspected_web_contents, devtools_contents); +#endif + + if (!browser_) { -+ auto create_params = Browser::CreateParams::CreateForDevTools(profile_); ++ auto create_params = BrowserWindowCreateParams::CreateForDevTools(profile_); + create_params.opener = opener; + -+ browser_ = Browser::Create(std::move(create_params)); ++ browser_ = CreateBrowserWindow(std::move(create_params)); + browser_->GetTabStripModel()->AddWebContents( -+ std::move(devtools_contents), -+ -1, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, AddTabTypes::ADD_ACTIVE); ++ std::move(devtools_contents), -1, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, ++ AddTabTypes::ADD_ACTIVE); + } #endif OverrideAndSyncDevToolsRendererPrefs(); } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 8c8fc32b01b6c50bd67ea0efb7efddf135845e1b..9a57dd37072c0de8fd8042d0b040a06ffae735aa 100644 +index 0ab25c63c9f39dc0e96f154eedd3b03ad14fa638..583a82ccda94585157e6f2a26f1651df3071415e 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -7,6 +7,7 @@ import("//build/config/compiler/compiler.gni") +@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") import("//build/config/features.gni") import("//build/config/ozone.gni") import("//build/config/ui.gni") @@ -126,7 +124,7 @@ index 8c8fc32b01b6c50bd67ea0efb7efddf135845e1b..9a57dd37072c0de8fd8042d0b040a06f import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//components/captive_portal/core/features.gni") -@@ -424,6 +425,10 @@ static_library("ui") { +@@ -616,6 +617,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -137,15 +135,15 @@ index 8c8fc32b01b6c50bd67ea0efb7efddf135845e1b..9a57dd37072c0de8fd8042d0b040a06f public_deps = [ # WARNING WARNING WARNING # New dependencies outside of //chrome/browser should be added to -@@ -481,6 +486,7 @@ static_library("ui") { - "//build/config/linux/dbus:buildflags", - "//build/util:chromium_git_revision", - "//cc/paint", +@@ -666,6 +671,7 @@ static_library("ui") { + ":ui_features", + ":url_identity", + "//base", + "//cef/libcef/features:buildflags", - "//chrome:resources", - "//chrome:strings", "//chrome/app:chrome_dll_resources", -@@ -1057,6 +1063,13 @@ static_library("ui") { + "//chrome/app/resources:platform_locale_settings", + "//chrome/app/theme:chrome_unscaled_resources", +@@ -963,6 +969,13 @@ static_library("ui") { ] } @@ -158,22 +156,22 @@ index 8c8fc32b01b6c50bd67ea0efb7efddf135845e1b..9a57dd37072c0de8fd8042d0b040a06f + if (!is_android) { deps += [ - "//chrome/browser/ui/infobars", -@@ -5154,6 +5167,7 @@ static_library("ui") { + ":ui_controller_factory", +@@ -3489,6 +3502,7 @@ static_library("ui") { + deps += [ "//chrome/browser/printing", "//chrome/browser/printing:impl", - "//components/printing/browser", + "//components/printing/common:mojo_interfaces", - "//printing", ] allow_circular_includes_from += [ "//chrome/browser/printing:impl" ] + } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 47c68b1f47caa9ff748bfe2f17374699a9ec410d..4f96a895c7e480162dd73356e20b8bd9df255f14 100644 +index 5fc408984834cd0feb0aee5fcda1e78eb209fb10..83586039d52e05479de1ef566b213a47edf86a88 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -306,6 +306,25 @@ - #include "chrome/browser/ui/overscroll_pref_manager.h" - #endif // defined(USE_AURA) +@@ -189,6 +189,25 @@ + #include "components/captive_portal/content/captive_portal_tab_helper.h" + #endif +#if BUILDFLAG(ENABLE_CEF) +#define CALL_CEF_DELEGATE(name, ...) \ @@ -197,9 +195,9 @@ index 47c68b1f47caa9ff748bfe2f17374699a9ec410d..4f96a895c7e480162dd73356e20b8bd9 using base::UserMetricsAction; using content::GlobalRenderFrameHostId; using content::NavigationController; -@@ -493,6 +512,10 @@ Browser::Browser(const CreateParams& params) +@@ -261,6 +280,10 @@ Browser::Browser(BrowserWindowCreateParams params) : type_(params.type), - profile_(params.profile), + profile_(&*params.profile), window_(nullptr), +#if BUILDFLAG(ENABLE_CEF) + cef_browser_delegate_( @@ -208,17 +206,17 @@ index 47c68b1f47caa9ff748bfe2f17374699a9ec410d..4f96a895c7e480162dd73356e20b8bd9 tab_strip_model_delegate_( std::make_unique(this)), tab_strip_model_(std::make_unique( -@@ -549,9 +572,6 @@ Browser::Browser(const CreateParams& params) - } - #endif // BUILDFLAG(IS_OZONE) +@@ -299,9 +322,6 @@ Browser::Browser(BrowserWindowCreateParams params) + features_ = std::make_unique(); + features_->Init(this); -- if (params.window) { -- CHECK_IS_TEST() << "Browser::CreateParams::window is a test-only param"; +- if (custom_window) { +- CHECK_IS_TEST() << "BrowserWindowCreateParams::window is a test-only param"; - } window_ = - params.window - ? std::unique_ptr(params.window) -@@ -567,9 +587,19 @@ Browser::Browser(const CreateParams& params) + custom_window + ? std::unique_ptr(custom_window) +@@ -319,9 +339,19 @@ Browser::Browser(BrowserWindowCreateParams params) session_service->WindowOpened(this); } @@ -241,7 +239,7 @@ index 47c68b1f47caa9ff748bfe2f17374699a9ec410d..4f96a895c7e480162dd73356e20b8bd9 // All initialization is complete; after this point, the browser should be on // the browser list until it is marked for destruction. -@@ -822,6 +852,10 @@ BrowserWindowInterface::Type Browser::GetType() const { +@@ -493,6 +523,10 @@ BrowserWindowInterface::Type Browser::GetType() const { return type_; } @@ -252,310 +250,17 @@ index 47c68b1f47caa9ff748bfe2f17374699a9ec410d..4f96a895c7e480162dd73356e20b8bd9 std::vector Browser::GetAllTabInterfaces() { std::vector results; results.reserve(tab_strip_model_->count()); -@@ -936,6 +970,8 @@ void Browser::WindowFullscreenStateChanged() { - GetCommandController()->FullscreenStateChanged(); - BookmarkBarController::From(this)->UpdateBookmarkBarState( - BookmarkBarController::StateChangeReason::kToggleFullscreen); -+ -+ CALL_CEF_DELEGATE(WindowFullscreenStateChanged); - } +@@ -864,6 +898,8 @@ void Browser::OnTabReplacedAt(WebContents* old_contents, + // Browser, Assorted utility functions (private): - void Browser::FullscreenTopUIStateChanged() { -@@ -954,6 +990,14 @@ void Browser::OnFindBarVisibilityChanged() { - // Browser, Assorted browser commands: - - bool Browser::SupportsWindowFeature(WindowFeature feature) const { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_delegate()) { -+ if (auto value = -+ cef_delegate()->SupportsWindowFeature(static_cast(feature))) { -+ return *value; -+ } -+ } -+#endif - return WindowFeatureController::From(this)->SupportsWindowFeature(feature); - } - -@@ -1139,12 +1183,28 @@ void Browser::HandleDragEnded() { - content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( - content::WebContents* source, - const NativeWebKeyboardEvent& event) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_) { -+ auto result = cef_browser_delegate_->PreHandleKeyboardEvent(source, event); -+ if (result != content::KeyboardEventProcessingResult::NOT_HANDLED) { -+ return result; -+ } -+ } -+#endif -+ - return BrowserWebContentsDelegate::From(this)->PreHandleKeyboardEvent(source, - event); - } - - bool Browser::HandleKeyboardEvent(content::WebContents* source, - const NativeWebKeyboardEvent& event) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_ && -+ cef_browser_delegate_->HandleKeyboardEvent(source, event)) { -+ return true; -+ } -+#endif -+ - return BrowserWebContentsDelegate::From(this)->HandleKeyboardEvent(source, - event); - } -@@ -1204,9 +1264,14 @@ bool Browser::IsBackForwardCacheSupported(content::WebContents& web_contents) { - content::PreloadingEligibility Browser::IsPrerender2Supported( - content::WebContents& web_contents, - content::PreloadingTriggerType trigger_type) { -+#if BUILDFLAG(ENABLE_CEF) -+ // Prerender is not supported in CEF. See issue #3664. -+ return content::PreloadingEligibility::kPreloadingDisabled; -+#else - Profile* profile = - Profile::FromBrowserContext(web_contents.GetBrowserContext()); - return prefetch::IsSomePreloadingEnabled(*profile->GetPrefs()); -+#endif - } - - bool Browser::ShouldShowStaleContentOnEviction(content::WebContents* source) { -@@ -1280,6 +1345,14 @@ WebContents* Browser::OpenURLFromTab( - } - } - -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_ && -+ !cef_browser_delegate_->OpenURLFromTabEx(source, params, -+ navigation_handle_callback)) { -+ return nullptr; -+ } -+#endif -+ - NavigateParams nav_params(this, params.url, params.transition); - nav_params.FillNavigateParamsFromOpenURLParams(params); - nav_params.source_contents = source; -@@ -1475,6 +1548,8 @@ void Browser::LoadingStateChanged(WebContents* source, - bool should_show_loading_ui) { - ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); - UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); -+ -+ CALL_CEF_DELEGATE(LoadingStateChanged, source, should_show_loading_ui); - } - - void Browser::CloseContents(WebContents* source) { -@@ -1484,6 +1559,13 @@ void Browser::CloseContents(WebContents* source) { - } - - void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_ && -+ cef_browser_delegate_->SetContentsBoundsEx(source, bounds)) { -+ return; -+ } -+#endif -+ - if (is_type_normal()) { - return; - } -@@ -1504,6 +1586,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { - } - - void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { -+ CALL_CEF_DELEGATE(UpdateTargetURL, source, url); -+ - std::vector status_bubbles = GetStatusBubbles(); - for (StatusBubble* status_bubble : status_bubbles) { - StatusBubbleViews* status_bubble_views = -@@ -1550,15 +1634,31 @@ void Browser::ContentsZoomChange(bool zoom_in) { - } - - bool Browser::TakeFocus(content::WebContents* source, bool reverse) { -+ CALL_CEF_DELEGATE_RETURN(TakeFocus, source, reverse); - return false; - } - -+void Browser::CanDownload(const GURL& url, -+ const std::string& request_method, -+ base::OnceCallback callback) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_) { -+ cef_browser_delegate_->CanDownload(url, request_method, -+ std::move(callback)); -+ return; -+ } -+#endif -+ std::move(callback).Run(true); -+} -+ - bool Browser::DidAddMessageToConsole( - content::WebContents* source, - blink::mojom::ConsoleMessageLevel log_level, - const std::u16string& message, - int32_t line_no, - const std::u16string& source_id) { -+ CALL_CEF_DELEGATE_RETURN(DidAddMessageToConsole, source, log_level, message, -+ line_no, source_id); - static bool is_headless_mode = headless::IsHeadlessMode(); - if (is_headless_mode) { - const bool is_builtin_component = !!source->GetWebUI(); -@@ -1716,12 +1816,23 @@ void Browser::WebContentsCreated(WebContents* source_contents, - // to track `new_contents` after it is added to its TabModel this override can - // be removed. - CreateSessionServiceTabHelper(new_contents); -+ -+ CALL_CEF_DELEGATE(WebContentsCreated, source_contents, opener_id, frame_name, -+ target_url, new_contents); - } - - void Browser::RendererUnresponsive( - WebContents* source, - content::RenderWidgetHost* render_widget_host, - base::RepeatingClosure hang_monitor_restarter) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_ && -+ cef_browser_delegate_->RendererUnresponsiveEx(source, render_widget_host, -+ hang_monitor_restarter)) { -+ return; -+ } -+#endif -+ - // 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(); -@@ -1734,6 +1845,13 @@ void Browser::RendererUnresponsive( - void Browser::RendererResponsive( - WebContents* source, - content::RenderWidgetHost* render_widget_host) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_ && -+ cef_browser_delegate_->RendererResponsiveEx(source, render_widget_host)) { -+ return; -+ } -+#endif -+ - RenderWidgetHostView* view = render_widget_host->GetView(); - if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { - TabDialogs::FromWebContents(source)->HideHungRendererDialog( -@@ -1743,6 +1861,15 @@ void Browser::RendererResponsive( - - content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( - WebContents* source) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_) { -+ auto* cef_js_dialog_manager = -+ cef_browser_delegate_->GetJavaScriptDialogManager(source); -+ if (cef_js_dialog_manager) { -+ return cef_js_dialog_manager; -+ } -+ } -+#endif - return javascript_dialogs::TabModalDialogManager::FromWebContents(source); - } - -@@ -1769,6 +1896,11 @@ void Browser::DraggableRegionsChanged( - web_app::AppBrowserController::From(this)) { - app_browser_controller->DraggableRegionsChanged(regions, contents); - } -+#if BUILDFLAG(ENABLE_CEF) -+ else if (cef_delegate()) { -+ cef_delegate()->DraggableRegionsChanged(regions, contents); -+ } -+#endif - } - - std::vector -@@ -1894,6 +2026,8 @@ void Browser::EnterFullscreenModeForTab( - ->fullscreen_controller() - ->EnterFullscreenModeForTab(requesting_frame, - FullscreenTabParams{options.display_id}); -+ -+ CALL_CEF_DELEGATE(EnterFullscreenModeForTab, requesting_frame, options); - } - - void Browser::ExitFullscreenModeForTab(WebContents* web_contents) { -@@ -1901,6 +2035,8 @@ void Browser::ExitFullscreenModeForTab(WebContents* web_contents) { - ->exclusive_access_manager() - ->fullscreen_controller() - ->ExitFullscreenModeForTab(web_contents); -+ -+ CALL_CEF_DELEGATE(ExitFullscreenModeForTab, web_contents); - } - - bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2084,6 +2220,18 @@ void Browser::FindReply(WebContents* web_contents, - find_tab_helper->HandleFindReply(request_id, number_of_matches, - selection_rect, active_match_ordinal, - final_update); -+ CALL_CEF_DELEGATE(FindReply, web_contents, request_id, number_of_matches, -+ selection_rect, active_match_ordinal, final_update); -+} -+ -+void Browser::UpdatePreferredSize(WebContents* source, -+ const gfx::Size& pref_size) { -+ CALL_CEF_DELEGATE(UpdatePreferredSize, source, pref_size); -+} -+ -+void Browser::ResizeDueToAutoResize(WebContents* source, -+ const gfx::Size& new_size) { -+ CALL_CEF_DELEGATE(ResizeDueToAutoResize, source, new_size); - } - - void Browser::RequestPointerLock(WebContents* web_contents, -@@ -2122,6 +2270,16 @@ void Browser::RequestMediaAccessPermission( - content::WebContents* web_contents, - const content::MediaStreamRequest& request, - content::MediaResponseCallback callback) { -+#if BUILDFLAG(ENABLE_CEF) -+ if (cef_browser_delegate_) { -+ callback = cef_browser_delegate_->RequestMediaAccessPermissionEx( -+ web_contents, request, std::move(callback)); -+ if (callback.is_null()) { -+ return; -+ } -+ } -+#endif -+ - const extensions::Extension* extension = - GetExtensionForOrigin(profile_, request.security_origin); - MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -2613,9 +2771,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { - // Browser, Getters for UI (private): - - std::vector Browser::GetStatusBubbles() { -+ bool show_by_default = true; -+ - // For kiosk and exclusive app mode we want to always hide the status bubble. - if (IsRunningInAppMode()) { -- return {}; -+ show_by_default = false; - } - - // We hide the status bar for web apps windows as this matches native -@@ -2625,6 +2785,12 @@ std::vector Browser::GetStatusBubbles() { - web_app::AppBrowserController::From(this); - if (app_browser_controller && - !app_browser_controller->HasMinimalUiButtons()) { -+ show_by_default = false; -+ } -+ -+ bool show = show_by_default; -+ CALL_CEF_DELEGATE_RESULT(ShowStatusBubble, show, show_by_default); -+ if (!show) { - return {}; - } - -@@ -2660,6 +2826,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { - } else { - web_contents_collection_.StopObserving(web_contents); - } -+ + void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { + CALL_CEF_DELEGATE(SetAsDelegate, web_contents, set_delegate); - } ++ + content::WebContentsDelegate* delegate = + set_delegate ? BrowserWebContentsDelegate::From(this) : nullptr; - void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 324951ceb77a20ed5eb85a736cd087166218b077..1695077bab63cd098c29cc468860fe5aaebca890 100644 +index a80862e7642648370b91c2c0962fd3538f5fa366..dd7af5f77f9f2051b68ad7899af1ce02bd49e23b 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -24,6 +24,7 @@ @@ -566,36 +271,28 @@ index 324951ceb77a20ed5eb85a736cd087166218b077..1695077bab63cd098c29cc468860fe5a #include "chrome/browser/tab_contents/web_contents_collection.h" #include "chrome/browser/ui/bookmarks/bookmark_bar.h" #include "chrome/browser/ui/bookmarks/bookmark_bar_controller.h" -@@ -53,6 +54,10 @@ - #include "ui/gfx/geometry/rect.h" - #include "url/origin.h" +@@ -79,6 +80,10 @@ namespace content { + class NavigationHandle; + } // namespace content +#if BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/browser/chrome/browser_delegate.h" +#endif + - #if BUILDFLAG(IS_ANDROID) - #error This file should only be included on desktop. - #endif -@@ -269,6 +274,15 @@ class Browser : public TabStripModelObserver, - // Specifies the width for the uncollapsed Vertical Tab Strip. - std::optional vertical_tab_strip_uncollapsed_width; - -+#if BUILDFLAG(ENABLE_CEF) -+ // Opaque CEF-specific configuration. Will be propagated to new Browsers. -+ scoped_refptr cef_params; -+ -+ // Specify the Browser that is opening this popup. -+ // Currently only used with TYPE_PICTURE_IN_PICTURE and TYPE_DEVTOOLS. -+ raw_ptr opener = nullptr; -+#endif -+ - private: - friend class Browser; - friend class WindowSizerChromeOSTest; -@@ -327,6 +341,16 @@ class Browser : public TabStripModelObserver, - update_ui_immediately_for_testing_ = true; - } + namespace web_app { + class AppBrowserController; + } +@@ -160,6 +165,7 @@ class Browser : public TabStripModelObserver, + DidBecomeInactiveCallback callback) override; + Type GetType() const override; + std::vector GetAllTabInterfaces() override; ++ bool IsNormalBrowser() const override; + bool IsTabModalPopup() const override; + void SetIsTabModalPopup( + bool is_tab_modal_popup, +@@ -170,6 +176,22 @@ class Browser : public TabStripModelObserver, + DesktopBrowserWindowCapabilities* capabilities() override; + const DesktopBrowserWindowCapabilities* capabilities() const override; + // Return true if CEF will expose the toolbar to the client. This value is + // used to selectively enable toolbar behaviors such as command processing @@ -607,69 +304,40 @@ index 324951ceb77a20ed5eb85a736cd087166218b077..1695077bab63cd098c29cc468860fe5a + // Used when the BrowserWindow will outlive this Browser. + void ReleaseBrowserWindow() { window_.release(); } + - // Accessors //////////////////////////////////////////////////////////////// - - Type type() const { return type_; } -@@ -349,6 +373,12 @@ class Browser : public TabStripModelObserver, - return features_.get(); - } - +#if BUILDFLAG(ENABLE_CEF) -+ cef::BrowserDelegate* cef_delegate() const { ++ cef::BrowserDelegate* cef_delegate() const override { + return cef_browser_delegate_.get(); + } +#endif + - base::WeakPtr AsWeakPtr(); - base::WeakPtr AsWeakPtr() const; - -@@ -527,6 +557,7 @@ class Browser : public TabStripModelObserver, - DidBecomeInactiveCallback callback) override; - BrowserActions* GetActions() override; - Type GetType() const override; -+ bool IsNormalBrowser() const override; - std::vector GetAllTabInterfaces() override; - Browser* GetBrowserForMigrationOnly() override; - const Browser* GetBrowserForMigrationOnly() const override; -@@ -615,6 +646,9 @@ class Browser : public TabStripModelObserver, - const ui::Event& event) override; - void ContentsZoomChange(bool zoom_in) override; - bool TakeFocus(content::WebContents* source, bool reverse) override; -+ void CanDownload(const GURL& url, -+ const std::string& request_method, -+ base::OnceCallback callback) override; - bool DidAddMessageToConsole(content::WebContents* source, - blink::mojom::ConsoleMessageLevel log_level, - const std::u16string& message, -@@ -705,6 +739,10 @@ class Browser : public TabStripModelObserver, - const gfx::Rect& selection_rect, - int active_match_ordinal, - bool final_update) override; -+ void UpdatePreferredSize(content::WebContents* source, -+ const gfx::Size& pref_size) override; -+ void ResizeDueToAutoResize(content::WebContents* source, -+ const gfx::Size& new_size) override; - void RequestPointerLock(content::WebContents* web_contents, - bool user_gesture, - bool last_unlocked_by_target) override; -@@ -889,6 +927,12 @@ class Browser : public TabStripModelObserver, - // The active state of this browser. - bool is_active_ = false; + private: + friend BrowserWindowInterface* CreateBrowserWindow( + BrowserWindowCreateParams create_params); +@@ -274,6 +296,10 @@ class Browser : public TabStripModelObserver, + // This Browser's window. + std::unique_ptr window_; +#if BUILDFLAG(ENABLE_CEF) + std::unique_ptr cef_browser_delegate_; +#endif -+ -+ bool toolbar_overridden_ = false; + std::unique_ptr const tab_strip_model_delegate_; std::unique_ptr const tab_strip_model_; +@@ -286,6 +312,8 @@ class Browser : public TabStripModelObserver, + + WebContentsCollection web_contents_collection_{this}; + ++ bool toolbar_overridden_ = false; ++ + // If true, the browser window was created as a tab modal pop-up. + bool is_tab_modal_popup_ = false; + diff --git chrome/browser/ui/browser_manager_service.cc chrome/browser/ui/browser_manager_service.cc -index 3a9c66792158d0a7baba089287029a5eae346544..edda939d9799fef16b1c828829e7f23ee727e9f1 100644 +index ad710a51122632d8efd5135cb1ffbed168f807bb..91cd94f67561df9e21ecbc97a4b8822e069270cc 100644 --- chrome/browser/ui/browser_manager_service.cc +++ chrome/browser/ui/browser_manager_service.cc -@@ -128,20 +128,28 @@ void BrowserManagerService::DeleteBrowser(Browser* removed_browser) { +@@ -141,20 +141,28 @@ void BrowserManagerService::DeleteBrowser( // // TODO(crbug.com/40159237): Use ScopedProfileKeepAlive for Incognito too, // instead of separate logic for Incognito and regular profiles. @@ -704,37 +372,31 @@ index 3a9c66792158d0a7baba089287029a5eae346544..edda939d9799fef16b1c828829e7f23e // If we're exiting, send out the APP_TERMINATING notification to allow other diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc -index 0b4f8241e9d4e114d90f3c1747da5cea4ad8c186..e1f9c1ef1e74307cfc4899cccdf27b6de61b09bb 100644 +index bccf4c6a0c037ad620eaf30340c0b6688fa81afd..23c97d79c4be50b7372f7c5e367c47992c420950 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc -@@ -35,11 +35,16 @@ content::WebContents* AddAndReturnTabAt( - // Time new tab page creation time. We keep track of the timing data in - // WebContents, but we want to include the time it takes to create the - // WebContents object too. +@@ -48,7 +48,12 @@ content::WebContents* AddAndReturnTabAt( + bool pinned, + std::optional window_action) { + const GURL resolved_url = url.is_empty() ? GetNewTabURL(browser) : url; +- NavigateParams params(browser, resolved_url, ui::PAGE_TRANSITION_TYPED); + // For CEF use a PageTransition that matches + // CefFrameHostImpl::kPageTransitionExplicit. - base::TimeTicks new_tab_start_time = base::TimeTicks::Now(); - const GURL resolved_url = - url.is_empty() ? browser->GetBrowserForMigrationOnly()->GetNewTabURL() - : url; -- NavigateParams params(browser, resolved_url, ui::PAGE_TRANSITION_TYPED); + NavigateParams params( + browser, resolved_url, + static_cast(ui::PAGE_TRANSITION_TYPED | + ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)); params.disposition = foreground ? WindowOpenDisposition::NEW_FOREGROUND_TAB : WindowOpenDisposition::NEW_BACKGROUND_TAB; - params.tabstrip_index = idx; -@@ -98,6 +103,19 @@ content::WebContents* AddWebContents( + if (window_action) { +@@ -107,6 +112,17 @@ content::WebContents* AddWebContents( // Can't create a new contents for the current tab - invalid case. DCHECK(disposition != WindowOpenDisposition::CURRENT_TAB); +#if BUILDFLAG(ENABLE_CEF) + if (browser && new_contents) { -+ if (auto* cef_delegate = -+ browser->GetBrowserForMigrationOnly()->cef_delegate()) { -+ new_contents = -+ cef_delegate->AddWebContents(std::move(new_contents)); ++ if (auto* cef_delegate = browser->cef_delegate()) { ++ new_contents = cef_delegate->AddWebContents(std::move(new_contents)); + if (!new_contents) { + return nullptr; + } @@ -745,36 +407,503 @@ index 0b4f8241e9d4e114d90f3c1747da5cea4ad8c186..e1f9c1ef1e74307cfc4899cccdf27b6d NavigateParams params(browser, std::move(new_contents)); params.source_contents = source_contents; params.url = target_url; -@@ -121,8 +139,6 @@ void CloseWebContents(Browser* browser, +@@ -130,8 +146,6 @@ void CloseWebContents(BrowserWindowInterface* browser, bool add_to_history) { - int index = browser->tab_strip_model()->GetIndexOfWebContents(contents); + int index = browser->GetTabStripModel()->GetIndexOfWebContents(contents); if (index == TabStripModel::kNoTab) { - DUMP_WILL_BE_NOTREACHED() - << "CloseWebContents called for tab not in our strip"; return; } +diff --git chrome/browser/ui/browser_ui_controller/browser_ui_controller.cc chrome/browser/ui/browser_ui_controller/browser_ui_controller.cc +index 60a3a7ebaa07d600ec4143736b5ceaaca01f74a9..8bd9a7eede20d81dab9bcf3fcef40c2e09a1902e 100644 +--- chrome/browser/ui/browser_ui_controller/browser_ui_controller.cc ++++ chrome/browser/ui/browser_ui_controller/browser_ui_controller.cc +@@ -11,8 +11,10 @@ + #include "base/check_op.h" + #include "base/task/single_thread_task_runner.h" + #include "base/trace_event/trace_event.h" ++#include "cef/libcef/features/features.h" + #include "chrome/browser/app_mode/app_mode_utils.h" + #include "chrome/browser/ui/bookmarks/bookmark_bar_controller.h" ++#include "chrome/browser/ui/browser.h" + #include "chrome/browser/ui/browser_command_controller.h" + #include "chrome/browser/ui/browser_window.h" + #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" +@@ -141,7 +143,11 @@ void BrowserUiController::ScheduleUIUpdate(content::WebContents* source, + // Update the loading state synchronously. This is so the throbber will + // immediately start/stop, which gives a more snappy feel. We want to do + // this for any tab so they start & stop quickly. +- NotifyTabUIChanged(tab, TabChangeType::kLoadingOnly); ++ // Guard against notifications during tab insertion when the tab strip model ++ // state is not yet fully consistent. ++ if (tab_strip_model_->GetActiveWebContents()) { ++ NotifyTabUIChanged(tab, TabChangeType::kLoadingOnly); ++ } + // The status bubble needs to be updated during INVALIDATE_TYPE_LOAD too, + // but we do that asynchronously by not stripping INVALIDATE_TYPE_LOAD from + // changed_flags. +@@ -257,9 +263,11 @@ void BrowserUiController::NotifyTabUIChanged(tabs::TabInterface* tab, + } + + std::vector BrowserUiController::GetStatusBubbles() { ++ bool show_by_default = true; ++ + // For kiosk and exclusive app mode we want to always hide the status bubble. + if (IsRunningInAppMode()) { +- return {}; ++ show_by_default = false; + } + + // We hide the status bar for web apps windows as this matches native +@@ -269,6 +277,16 @@ std::vector BrowserUiController::GetStatusBubbles() { + web_app::AppBrowserController::From(&*browser_); + if (app_browser_controller && + !app_browser_controller->HasMinimalUiButtons()) { ++ show_by_default = false; ++ } ++ ++ bool show = show_by_default; ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ show = browser_->cef_delegate()->ShowStatusBubble(show_by_default); ++ } ++#endif ++ if (!show) { + return {}; + } + +diff --git chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.cc chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.cc +index 9e27bdcb53a5030b4226560272138debce274d56..b63c4fe81ad7080156949c7f6bdbfb39cc3d86f5 100644 +--- chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.cc ++++ chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.cc +@@ -8,6 +8,7 @@ + #include "base/metrics/histogram_macros.h" + #include "base/notimplemented.h" + #include "base/trace_event/trace_event.h" ++#include "cef/libcef/features/features.h" + #include "chrome/app/chrome_command_ids.h" + #include "chrome/browser/actor/actor_util.h" + #include "chrome/browser/background/background_contents.h" +@@ -28,6 +29,7 @@ + #include "chrome/browser/sessions/session_tab_helper_factory.h" + #include "chrome/browser/ui/blocked_content/chrome_popup_navigation_delegate.h" + #include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h" ++#include "chrome/browser/ui/browser.h" + #include "chrome/browser/ui/browser_command_controller.h" + #include "chrome/browser/ui/browser_commands.h" + #include "chrome/browser/ui/browser_tabstrip.h" +@@ -309,6 +311,16 @@ content::KeyboardEventProcessingResult + BrowserWebContentsDelegate::PreHandleKeyboardEvent( + content::WebContents* source, + const input::NativeWebKeyboardEvent& event) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ auto result = ++ browser_->cef_delegate()->PreHandleKeyboardEvent(source, event); ++ if (result != content::KeyboardEventProcessingResult::NOT_HANDLED) { ++ return result; ++ } ++ } ++#endif ++ + // Forward keyboard events to the manager for fullscreen / mouse lock. This + // may consume the event (e.g., Esc exits fullscreen mode). + // TODO(koz): Write a test for this http://crbug.com/40647724. +@@ -322,6 +334,13 @@ BrowserWebContentsDelegate::PreHandleKeyboardEvent( + bool BrowserWebContentsDelegate::HandleKeyboardEvent( + content::WebContents* source, + const input::NativeWebKeyboardEvent& event) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate() && ++ browser_->cef_delegate()->HandleKeyboardEvent(source, event)) { ++ return true; ++ } ++#endif ++ + DevToolsWindow* devtools_window = + DevToolsWindow::GetInstanceForInspectedWebContents(source); + return (devtools_window && devtools_window->ForwardKeyboardEvent(event)) || +@@ -511,9 +530,14 @@ content::PreloadingEligibility + BrowserWebContentsDelegate::IsPrerender2Supported( + content::WebContents& web_contents, + content::PreloadingTriggerType trigger_type) { ++#if BUILDFLAG(ENABLE_CEF) ++ // Prerender is not supported in CEF. See issue #3664. ++ return content::PreloadingEligibility::kPreloadingDisabled; ++#else + Profile* profile = + Profile::FromBrowserContext(web_contents.GetBrowserContext()); + return prefetch::IsSomePreloadingEnabled(*profile->GetPrefs()); ++#endif + } + + bool BrowserWebContentsDelegate::ShouldShowStaleContentOnEviction( +@@ -563,7 +587,15 @@ content::WebContents* BrowserWebContentsDelegate::OpenURLFromTab( + } + } + +- NavigateParams nav_params(&*browser_, params.url, params.transition); ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate() && ++ !browser_->cef_delegate()->OpenURLFromTabEx(source, params, ++ navigation_handle_callback)) { ++ return nullptr; ++ } ++#endif ++ ++ NavigateParams nav_params(&browser_.get(), params.url, params.transition); + nav_params.FillNavigateParamsFromOpenURLParams(params); + nav_params.source_contents = source; + nav_params.tabstrip_add_types = AddTabTypes::ADD_NONE; +@@ -713,9 +745,10 @@ content::WebContents* BrowserWebContentsDelegate::AddNewContents( + // progress. This works around a defect on Mac where separate displays + // cannot switch their independent spaces simultaneously + // (crbug.com/40221919) +- auto web_contents_creation_callback = base::BindOnce( +- &chrome::AddWebContents, &*browser_, source, std::move(new_contents), +- target_url, disposition, window_features, window_action, user_gesture); ++ auto web_contents_creation_callback = ++ base::BindOnce(&chrome::AddWebContents, &browser_.get(), source, ++ std::move(new_contents), target_url, disposition, ++ window_features, window_action, user_gesture); + fullscreen_controller->RunOrDeferUntilTransitionIsComplete(base::BindOnce( + base::IgnoreResult(std::move(web_contents_creation_callback)))); + return nullptr; +@@ -733,9 +766,9 @@ content::WebContents* BrowserWebContentsDelegate::AddNewContents( + } + } + +- return chrome::AddWebContents(&*browser_, source, std::move(new_contents), +- target_url, disposition, window_features, +- window_action, user_gesture); ++ return chrome::AddWebContents( ++ &browser_.get(), source, std::move(new_contents), target_url, disposition, ++ window_features, window_action, user_gesture); + } + + void BrowserWebContentsDelegate::ActivateContents( +@@ -762,6 +795,13 @@ void BrowserWebContentsDelegate::LoadingStateChanged( + content::INVALIDATE_TYPE_LOAD); + browser_ui_controller_->UpdateWindowForLoadingStateChanged( + source, should_show_loading_ui); ++ ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->LoadingStateChanged(source, ++ should_show_loading_ui); ++ } ++#endif + } + + void BrowserWebContentsDelegate::CloseContents(content::WebContents* source) { +@@ -772,6 +812,13 @@ void BrowserWebContentsDelegate::CloseContents(content::WebContents* source) { + + void BrowserWebContentsDelegate::SetContentsBounds(content::WebContents* source, + const gfx::Rect& bounds) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate() && ++ browser_->cef_delegate()->SetContentsBoundsEx(source, bounds)) { ++ return; ++ } ++#endif ++ + if ((browser_->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL)) { + return; + } +@@ -793,6 +840,12 @@ void BrowserWebContentsDelegate::SetContentsBounds(content::WebContents* source, + + void BrowserWebContentsDelegate::UpdateTargetURL(content::WebContents* source, + const GURL& url) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->UpdateTargetURL(source, url); ++ } ++#endif ++ + std::vector status_bubbles = + browser_ui_controller_->GetStatusBubbles(); + for (StatusBubble* status_bubble : status_bubbles) { +@@ -839,11 +892,17 @@ void BrowserWebContentsDelegate::ContentsMouseEvent( + } + + void BrowserWebContentsDelegate::ContentsZoomChange(bool zoom_in) { +- chrome::ExecuteCommand(&*browser_, zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); ++ chrome::ExecuteCommand(&browser_.get(), ++ zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); + } + + bool BrowserWebContentsDelegate::TakeFocus(content::WebContents* source, + bool reverse) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ return browser_->cef_delegate()->TakeFocus(source, reverse); ++ } ++#endif + return false; + } + +@@ -853,6 +912,12 @@ bool BrowserWebContentsDelegate::DidAddMessageToConsole( + const std::u16string& message, + int32_t line_no, + const std::u16string& source_id) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ return browser_->cef_delegate()->DidAddMessageToConsole( ++ source, log_level, message, line_no, source_id); ++ } ++#endif + static bool is_headless_mode = headless::IsHeadlessMode(); + if (is_headless_mode) { + const bool is_builtin_component = !!source->GetWebUI(); +@@ -941,6 +1006,11 @@ void BrowserWebContentsDelegate::DraggableRegionsChanged( + if (app_browser_controller_) { + app_browser_controller_->DraggableRegionsChanged(regions, contents); + } ++#if BUILDFLAG(ENABLE_CEF) ++ else if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->DraggableRegionsChanged(regions, contents); ++ } ++#endif + } + + std::vector +@@ -1082,12 +1152,27 @@ void BrowserWebContentsDelegate::WebContentsCreated( + // to track `new_contents` after it is added to its TabModel this override can + // be removed. + CreateSessionServiceTabHelper(new_contents); ++ ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->WebContentsCreated( ++ source_contents, opener_id, frame_name, target_url, new_contents); ++ } ++#endif + } + + void BrowserWebContentsDelegate::RendererUnresponsive( + content::WebContents* source, + content::RenderWidgetHost* render_widget_host, + base::RepeatingClosure hang_monitor_restarter) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate() && ++ browser_->cef_delegate()->RendererUnresponsiveEx( ++ source, render_widget_host, hang_monitor_restarter)) { ++ return; ++ } ++#endif ++ + // Don't show the page hung dialog when a HTML popup hangs because + // the dialog will take the focus and immediately close the popup. + content::RenderWidgetHostView* view = render_widget_host->GetView(); +@@ -1100,6 +1185,14 @@ void BrowserWebContentsDelegate::RendererUnresponsive( + void BrowserWebContentsDelegate::RendererResponsive( + content::WebContents* source, + content::RenderWidgetHost* render_widget_host) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate() && ++ browser_->cef_delegate()->RendererResponsiveEx(source, ++ render_widget_host)) { ++ return; ++ } ++#endif ++ + content::RenderWidgetHostView* view = render_widget_host->GetView(); + if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { + TabDialogs::FromWebContents(source)->HideHungRendererDialog( +@@ -1110,6 +1203,15 @@ void BrowserWebContentsDelegate::RendererResponsive( + content::JavaScriptDialogManager* + BrowserWebContentsDelegate::GetJavaScriptDialogManager( + content::WebContents* source) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ auto* cef_js_dialog_manager = ++ browser_->cef_delegate()->GetJavaScriptDialogManager(source); ++ if (cef_js_dialog_manager) { ++ return cef_js_dialog_manager; ++ } ++ } ++#endif + return javascript_dialogs::TabModalDialogManager::FromWebContents(source); + } + +@@ -1170,7 +1272,8 @@ void BrowserWebContentsDelegate::RestoreFromWebAPI() { + + void BrowserWebContentsDelegate::SetResizableFromWebAPI(bool resizable) { + // TODO(crbug.com/355026937): Eliminate this BrowserView reference. +- if (auto* browser_view = BrowserView::GetBrowserViewForBrowser(&*browser_)) { ++ if (auto* browser_view = ++ BrowserView::GetBrowserViewForBrowser(&browser_.get())) { + browser_view->SetResizableFromWebApi(resizable); + } + } +@@ -1197,12 +1300,25 @@ void BrowserWebContentsDelegate::EnterFullscreenModeForTab( + const blink::mojom::FullscreenOptions& options) { + exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( + requesting_frame, FullscreenTabParams{options.display_id}); ++ ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->EnterFullscreenModeForTab(requesting_frame, ++ options); ++ } ++#endif + } + + void BrowserWebContentsDelegate::ExitFullscreenModeForTab( + content::WebContents* web_contents) { + exclusive_access_manager_->fullscreen_controller()->ExitFullscreenModeForTab( + web_contents); ++ ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->ExitFullscreenModeForTab(web_contents); ++ } ++#endif + } + + bool BrowserWebContentsDelegate::IsFullscreenForTabOrPending( +@@ -1413,12 +1529,63 @@ void BrowserWebContentsDelegate::FindReply(content::WebContents* web_contents, + find_tab_helper->HandleFindReply(request_id, number_of_matches, + selection_rect, active_match_ordinal, + final_update); ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->FindReply(web_contents, request_id, ++ number_of_matches, selection_rect, ++ active_match_ordinal, final_update); ++ } ++#endif ++} ++ ++void BrowserWebContentsDelegate::UpdatePreferredSize( ++ content::WebContents* source, ++ const gfx::Size& pref_size) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->UpdatePreferredSize(source, pref_size); ++ } ++#endif ++} ++ ++void BrowserWebContentsDelegate::ResizeDueToAutoResize( ++ content::WebContents* source, ++ const gfx::Size& new_size) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->ResizeDueToAutoResize(source, new_size); ++ } ++#endif ++} ++ ++void BrowserWebContentsDelegate::CanDownload( ++ const GURL& url, ++ const std::string& request_method, ++ base::OnceCallback callback) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->CanDownload(url, request_method, ++ std::move(callback)); ++ return; ++ } ++#endif ++ std::move(callback).Run(true); + } + + void BrowserWebContentsDelegate::RequestMediaAccessPermission( + content::WebContents* web_contents, + const content::MediaStreamRequest& request, + content::MediaResponseCallback callback) { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ callback = browser_->cef_delegate()->RequestMediaAccessPermissionEx( ++ web_contents, request, std::move(callback)); ++ if (callback.is_null()) { ++ return; ++ } ++ } ++#endif ++ + const extensions::Extension* extension = + GetExtensionForOrigin(browser_->GetProfile(), request.security_origin); + MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( +@@ -1430,7 +1597,7 @@ void BrowserWebContentsDelegate::ProcessSelectAudioOutput( + content::SelectAudioOutputCallback callback) { + #if defined(TOOLKIT_VIEWS) + MediaCaptureDevicesDispatcher::GetInstance()->ProcessSelectAudioOutputRequest( +- &*browser_, request, std::move(callback)); ++ &browser_.get(), request, std::move(callback)); + #else + std::move(callback).Run( + base::unexpected(content::SelectAudioOutputError::kUnknown)); +diff --git chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.h chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.h +index 05a9d7f7f21841412e0b2435e8d95a9c7598d8eb..a0258b90686f039c1dde83ccede3d2ec9b6dc772 100644 +--- chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.h ++++ chrome/browser/ui/browser_web_contents_delegate/browser_web_contents_delegate.h +@@ -136,6 +136,9 @@ class BrowserWebContentsDelegate : public content::WebContentsDelegate { + const ui::Event& event) override; + void ContentsZoomChange(bool zoom_in) override; + bool TakeFocus(content::WebContents* source, bool reverse) override; ++ void CanDownload(const GURL& url, ++ const std::string& request_method, ++ base::OnceCallback callback) override; + bool DidAddMessageToConsole(content::WebContents* source, + blink::mojom::ConsoleMessageLevel log_level, + const std::u16string& message, +@@ -235,6 +238,10 @@ class BrowserWebContentsDelegate : public content::WebContentsDelegate { + const gfx::Rect& selection_rect, + int active_match_ordinal, + bool final_update) override; ++ void UpdatePreferredSize(content::WebContents* source, ++ const gfx::Size& pref_size) override; ++ void ResizeDueToAutoResize(content::WebContents* source, ++ const gfx::Size& new_size) override; + void RequestMediaAccessPermission( + content::WebContents* web_contents, + const content::MediaStreamRequest& request, diff --git chrome/browser/ui/browser_window/internal/browser_window_features.cc chrome/browser/ui/browser_window/internal/browser_window_features.cc -index 8efb317f70aded0e916ba991e9958238307d5f7f..b855aebe41e2a4d2e6a91c95455a80129ded33eb 100644 +index 89cd12a061a3136bf035f509403d453d018b0d78..034a41cf285b16d03b9544d5b5f7822dace35f48 100644 --- chrome/browser/ui/browser_window/internal/browser_window_features.cc +++ chrome/browser/ui/browser_window/internal/browser_window_features.cc -@@ -237,6 +237,15 @@ +@@ -12,6 +12,7 @@ + #include "base/memory/ptr_util.h" + #include "base/metrics/histogram_functions.h" + #include "base/no_destructor.h" ++#include "cef/libcef/features/features.h" + #include "chrome/browser/actor/ui/actor_border_view_controller.h" + #include "chrome/browser/actor/ui/actor_ui_window_controller.h" + #include "chrome/browser/autocomplete/aim_eligibility_service_factory.h" +@@ -245,6 +246,17 @@ BrowserWindowFeatures::BrowserWindowFeatures() = default; BrowserWindowFeatures::~BrowserWindowFeatures() = default; +// static -+bool BrowserWindowFeatures::IsNormalBrowser(const Browser* browser) { ++bool BrowserWindowFeatures::IsNormalBrowser( ++ const BrowserWindowInterface* browser) { + // CEF normal browsers have TYPE_POPUP. -+ if (browser->is_type_popup() && browser->cef_delegate()) { ++ if (browser->GetType() == BrowserWindowInterface::Type::TYPE_POPUP && ++ browser->cef_delegate()) { + return true; + } -+ return browser->is_type_normal(); ++ return browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL; +} + void BrowserWindowFeatures::Init(BrowserWindowInterface* browser) { // This is used only for the controllers which will be created on demand // later. -@@ -636,6 +645,9 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { +@@ -317,8 +329,8 @@ void BrowserWindowFeatures::Init(BrowserWindowInterface* browser) { + *browser, *browser, *browser->GetTabStripModel()); + window_feature_controller_ = + GetUserDataFactory().CreateInstance( +- *browser, fullscreen_controller_.get(), app_browser_controller_.get(), +- browser->GetType(), ++ *browser, browser, fullscreen_controller_.get(), ++ app_browser_controller_.get(), browser->GetType(), + BrowserInitState::From(browser) + ->browser_window_create_params() + .is_trusted_source, +@@ -682,6 +694,9 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { // Foundational state used throughout this function. Computed/assigned early // so the alphabetical sections below can rely on them. Profile* const profile = browser_->GetProfile(); @@ -784,7 +913,7 @@ index 8efb317f70aded0e916ba991e9958238307d5f7f..b855aebe41e2a4d2e6a91c95455a8012 BrowserView* const browser_view = BrowserView::GetBrowserViewForBrowser(browser); WebUIBrowserWindow* const webui_browser_window = -@@ -700,18 +712,6 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { +@@ -752,18 +767,6 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { std::make_unique(browser_view); } @@ -802,26 +931,26 @@ index 8efb317f70aded0e916ba991e9958238307d5f7f..b855aebe41e2a4d2e6a91c95455a8012 - #if BUILDFLAG(ENABLE_EXTENSIONS) && (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)) if (browser_view) { - if (base::FeatureList::IsEnabled( -@@ -849,7 +849,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { + if (!browser_->GetProfile()->IsOffTheRecord()) { +@@ -926,7 +929,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { browser, browser->GetTabStripModel(), browser->GetSessionID(), browser->GetType()); -- if (browser->is_type_normal() || browser->is_type_app()) { -+ if (supports_toolbar || browser->is_type_app()) { - toast_service_ = std::make_unique(browser); - } - -@@ -887,7 +887,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { +- if (browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL || ++ if (supports_toolbar || + browser->GetType() == BrowserWindowInterface::Type::TYPE_APP) { + toast_service_ = + GetUserDataFactory().CreateInstance(*browser, browser); +@@ -970,7 +973,7 @@ void BrowserWindowFeatures::InitPostWindowConstruction(Browser* browser) { // omnibox and a tab strip). By default most new features should be // instantiated in this block (please keep this list ordered without taking // into consideration buildflags, repeating buildflags is ok): -- if (browser->is_type_normal()) { +- if (browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL) { + if (supports_toolbar) { if (browser_view) { if (base::FeatureList::IsEnabled(features::kGlicActorUi)) { std::vector> -@@ -1041,6 +1041,38 @@ void BrowserWindowFeatures::InitPostBrowserViewConstruction( +@@ -1135,6 +1138,38 @@ void BrowserWindowFeatures::InitPostBrowserViewConstruction( browser_view); } @@ -861,29 +990,29 @@ index 8efb317f70aded0e916ba991e9958238307d5f7f..b855aebe41e2a4d2e6a91c95455a8012 // Tear down in reverse order of construction: embedder first, then // InitPostWindowConstruction, then Init. Within each section, members are diff --git chrome/browser/ui/browser_window/public/browser_window_features.h chrome/browser/ui/browser_window/public/browser_window_features.h -index 97e293aa77130a343cfdf46ad567a1a3da54718e..d2845af6e8f7fc249b6769cebfdfb6fdf36bfaf0 100644 +index 562496763d418d8e0d897a269ff3e3c7285030dc..0dff344929fd9acf68578338175cb75e682cdaa3 100644 --- chrome/browser/ui/browser_window/public/browser_window_features.h +++ chrome/browser/ui/browser_window/public/browser_window_features.h -@@ -137,6 +137,9 @@ class CookieControlsController; +@@ -173,6 +173,9 @@ namespace content_settings { + class CookieControlsController; } // namespace content_settings - +namespace content { +class WebContents; +} namespace contextual_tasks { class ContextualTasksBrowserController; } // namespace contextual_tasks -@@ -262,6 +265,8 @@ class BrowserWindowFeatures { +@@ -298,6 +301,8 @@ class BrowserWindowFeatures { BrowserWindowFeatures(); ~BrowserWindowFeatures(); -+ static bool IsNormalBrowser(const Browser* browser); ++ static bool IsNormalBrowser(const BrowserWindowInterface* browser); + BrowserWindowFeatures(const BrowserWindowFeatures&) = delete; BrowserWindowFeatures& operator=(const BrowserWindowFeatures&) = delete; -@@ -278,6 +283,16 @@ class BrowserWindowFeatures { +@@ -314,6 +319,16 @@ class BrowserWindowFeatures { // hierarchy in BrowserView. void InitPostBrowserViewConstruction(BrowserView* browser_view); @@ -901,33 +1030,94 @@ index 97e293aa77130a343cfdf46ad567a1a3da54718e..d2845af6e8f7fc249b6769cebfdfb6fd void TearDownPreBrowserWindowDestruction(); diff --git chrome/browser/ui/browser_window/public/browser_window_interface.h chrome/browser/ui/browser_window/public/browser_window_interface.h -index 5374510d7c3f360748ec598f676ded178981dba4..bf8c6ec25aa48bde0032d6b2aa5695d650a6f7ae 100644 +index 5d1a05d3c55e84d7a8fc6bb23fda2cb6600fad29..25e60d663a4f59a45fcfe33564fa76686f5e3c76 100644 --- chrome/browser/ui/browser_window/public/browser_window_interface.h +++ chrome/browser/ui/browser_window/public/browser_window_interface.h -@@ -324,6 +324,10 @@ class BrowserWindowInterface : public content::PageNavigator { - // browser window (e.g. most of the 3-dot menu actions). - virtual BrowserActions* GetActions() = 0; +@@ -9,6 +9,7 @@ + + #include "base/memory/raw_ptr.h" + #include "build/build_config.h" ++#include "cef/libcef/features/features.h" + #include "content/public/browser/page_navigator.h" + + #if !BUILDFLAG(IS_ANDROID) +@@ -57,6 +58,12 @@ class UnownedUserDataHost; + class Profile; + class SessionID; + ++#if BUILDFLAG(ENABLE_CEF) ++namespace cef { ++class BrowserDelegate; ++} ++#endif ++ + namespace internal { + class ScopedBrowserShower; + } +@@ -318,6 +325,14 @@ class BrowserWindowInterface : public content::PageNavigator { + virtual base::CallbackListSubscription RegisterDidBecomeInactive( + DidBecomeInactiveCallback callback) = 0; + // Returns true if this is a normal browser as determined by + // BrowserWindowFeatures::IsNormalBrowser. + virtual bool IsNormalBrowser() const = 0; ++ ++#if BUILDFLAG(ENABLE_CEF) ++ virtual cef::BrowserDelegate* cef_delegate() const { return nullptr; } ++#endif + // This is used by features that need to operate on most or all tabs in the // browser window. Do not use this method to find a specific tab. virtual std::vector GetAllTabInterfaces() = 0; +diff --git chrome/browser/ui/browser_window/public/create_browser_window.h chrome/browser/ui/browser_window/public/create_browser_window.h +index c6e44f9a4bc2653d58eff131d9692b98b88d43f1..01cc9425dc8eb10e27384e0e1f11e894926be423 100644 +--- chrome/browser/ui/browser_window/public/create_browser_window.h ++++ chrome/browser/ui/browser_window/public/create_browser_window.h +@@ -13,10 +13,15 @@ + #include "base/memory/raw_ptr.h" + #include "base/memory/raw_ref.h" + #include "build/build_config.h" ++#include "cef/libcef/features/features.h" + #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" + #include "ui/base/mojom/window_show_state.mojom.h" + #include "ui/gfx/geometry/rect.h" + ++#if BUILDFLAG(ENABLE_CEF) ++#include "cef/libcef/browser/chrome/browser_delegate.h" ++#endif ++ + #if !BUILDFLAG(IS_ANDROID) + #include "components/tab_groups/tab_group_id.h" + #include "third_party/blink/public/mojom/picture_in_picture_window_options/picture_in_picture_window_options.mojom.h" +@@ -171,6 +176,15 @@ struct BrowserWindowCreateParams { + // Specifies the width for the uncollapsed Vertical Tab Strip. + std::optional vertical_tab_strip_uncollapsed_width; + ++#if BUILDFLAG(ENABLE_CEF) ++ // Opaque CEF-specific configuration. Will be propagated to new Browsers. ++ scoped_refptr cef_params; ++ ++ // Specify the Browser that is opening this popup. ++ // Currently only used with TYPE_PICTURE_IN_PICTURE and TYPE_DEVTOOLS. ++ raw_ptr opener = nullptr; ++#endif ++ + // Specifies the focused tab group ID, if the window should be created in a + // focused state. + std::optional focused_tab_group_id; diff --git chrome/browser/ui/navigator/browser_navigator.cc chrome/browser/ui/navigator/browser_navigator.cc -index a3a2000fe57f7095a85dbbcbbff473d41fdb83b5..f8f4400defe93ddbbb17d05fcb3c11bda755e111 100644 +index e762162e5f104f7dfbe514063adcff90131f6800..520aeaa19a3bc29a406aff989402e8a0d41ae8b5 100644 --- chrome/browser/ui/navigator/browser_navigator.cc +++ chrome/browser/ui/navigator/browser_navigator.cc @@ -31,6 +31,7 @@ - #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_init_state.h" + #include "chrome/browser/ui/browser_ui_controller/browser_ui_controller.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/browser_window/public/browser_window_features.h" #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" + #include "chrome/browser/ui/browser_window/public/create_browser_window.h" #include "chrome/browser/ui/browser_window/public/profile_browser_collection.h" - #include "chrome/browser/ui/incognito_allowed_url.h" -@@ -312,6 +313,12 @@ std::tuple GetBrowserAndTabForDisposition( +@@ -319,6 +320,12 @@ std::tuple GetBrowserAndTabForDisposition( browser_params.pip_options = pip_options; @@ -940,7 +1130,7 @@ index a3a2000fe57f7095a85dbbcbbff473d41fdb83b5..f8f4400defe93ddbbb17d05fcb3c11bd const ui::BaseWindow* const browser_window = params.browser->GetWindow(); const gfx::NativeWindow native_window = browser_window ? browser_window->GetNativeWindow() -@@ -501,7 +508,13 @@ std::unique_ptr CreateTargetContents( +@@ -507,7 +514,13 @@ std::unique_ptr CreateTargetContents( } #endif @@ -955,7 +1145,7 @@ index a3a2000fe57f7095a85dbbcbbff473d41fdb83b5..f8f4400defe93ddbbb17d05fcb3c11bd } } // namespace -@@ -921,6 +934,11 @@ base::WeakPtr NavigateImpl( +@@ -938,6 +951,11 @@ base::WeakPtr NavigateImpl( // navigation happens in a different tab to the link click. apps::SetLinkCapturingSourceDisposition(tab_to_insert->GetContents(), params->disposition); @@ -967,11 +1157,37 @@ index a3a2000fe57f7095a85dbbcbbff473d41fdb83b5..f8f4400defe93ddbbb17d05fcb3c11bd } if (params->source_contents == contents_to_navigate_or_insert) { +diff --git chrome/browser/ui/tabs/tab_strip_api/tab_strip_model_impl/tab_strip_model_adapter_impl.cc chrome/browser/ui/tabs/tab_strip_api/tab_strip_model_impl/tab_strip_model_adapter_impl.cc +index 4f84323baa4e70a6a1545783209aaee18a6ebbc2..2c3ae956de76665b9f9bc5dd3a8f68a66b7b7b3b 100644 +--- chrome/browser/ui/tabs/tab_strip_api/tab_strip_model_impl/tab_strip_model_adapter_impl.cc ++++ chrome/browser/ui/tabs/tab_strip_api/tab_strip_model_impl/tab_strip_model_adapter_impl.cc +@@ -13,6 +13,8 @@ + #include "components/tab_groups/tab_group_visual_data.h" + #include "components/tabs/public/split_tab_collection.h" + #include "components/tabs/public/tab_collection.h" ++#include "ui/color/color_provider_manager.h" ++#include "ui/native_theme/native_theme.h" + #include "components/tabs/public/tab_group.h" + #include "components/tabs/public/tab_group_tab_collection.h" + #include "components/tabs/public/tab_interface.h" +@@ -68,7 +70,11 @@ types::TabStates TabStripModelAdapterImpl::GetTabStates( + const ui::ColorProvider& TabStripModelAdapterImpl::GetColorProvider() const { + content::WebContents* active_contents = + tab_strip_model_->GetActiveWebContents(); +- CHECK(active_contents); ++ if (!active_contents) { ++ return *ui::ColorProviderManager::Get().GetColorProviderFor( ++ ui::NativeTheme::GetInstanceForNativeUi()->GetColorProviderKey( ++ /*custom_theme=*/nullptr)); ++ } + return active_contents->GetColorProvider(); + } + diff --git chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc -index f994a992e8eaa8124d8633239ec3f13cd43c4b62..988b5b9b15781a42ac0c4c9e335a96dc8613eeb6 100644 +index 76e408d4225449b8b9cbde50579d3396f5a03844..c346a4b483ca95e4938ec531d9ebb5161cbe1aba 100644 --- chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc +++ chrome/browser/ui/views/frame/horizontal_tab_strip_region_view.cc -@@ -205,8 +205,7 @@ HorizontalTabStripRegionViewOld::HorizontalTabStripRegionViewOld( +@@ -201,8 +201,7 @@ HorizontalTabStripRegionViewOld::HorizontalTabStripRegionViewOld( // Add and configure the TabStripComboButton. std::unique_ptr tab_strip_action_container; @@ -981,11 +1197,77 @@ index f994a992e8eaa8124d8633239ec3f13cd43c4b62..988b5b9b15781a42ac0c4c9e335a96dc // The Glic button visibility is dynamic and depends on profile state // (e.g., sign-in status, enterprise policies, recoverable errors). // We instantiate the action container if the profile is eligible (even if +diff --git chrome/browser/ui/window_feature_controller/window_feature_controller.cc chrome/browser/ui/window_feature_controller/window_feature_controller.cc +index ec7bd3ea6cd00a5093b9bac2cfca9fe1a0bc4bfb..ec531f37cd4a3fa404f85dd98ca56451339226b7 100644 +--- chrome/browser/ui/window_feature_controller/window_feature_controller.cc ++++ chrome/browser/ui/window_feature_controller/window_feature_controller.cc +@@ -7,18 +7,25 @@ + #include "base/check.h" + #include "base/check_deref.h" + #include "build/build_config.h" ++#include "cef/libcef/features/features.h" + #include "chrome/browser/ui/fullscreen/browser_window_fullscreen_controller.h" + #include "chrome/browser/ui/web_applications/app_browser_controller.h" + ++#if BUILDFLAG(ENABLE_CEF) ++#include "cef/libcef/browser/chrome/browser_delegate.h" ++#endif ++ + DEFINE_USER_DATA(WindowFeatureController); + + WindowFeatureController::WindowFeatureController( ++ BrowserWindowInterface* browser, + BrowserWindowFullscreenController* fullscreen_controller, + web_app::AppBrowserController* app_controller, + BrowserWindowInterface::Type browser_type, + bool is_trusted_source, + ui::UnownedUserDataHost& host) +- : fullscreen_controller_(CHECK_DEREF(fullscreen_controller)), ++ : browser_(browser), ++ fullscreen_controller_(CHECK_DEREF(fullscreen_controller)), + app_controller_(app_controller), + browser_type_(browser_type), + is_trusted_source_(is_trusted_source), +@@ -42,6 +49,14 @@ const WindowFeatureController* WindowFeatureController::From( + + bool WindowFeatureController::SupportsWindowFeature( + WindowFeature feature) const { ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ if (auto value = browser_->cef_delegate()->SupportsWindowFeature( ++ static_cast(feature))) { ++ return *value; ++ } ++ } ++#endif + bool supports = + SupportsWindowFeatureImpl(feature, /*check_can_support=*/false); + // Supported features imply CanSupportWindowFeature. +diff --git chrome/browser/ui/window_feature_controller/window_feature_controller.h chrome/browser/ui/window_feature_controller/window_feature_controller.h +index 7c203d12c129f2a7b949c5ccb5144d04b175d58b..efcc0206789d58cda43579cd6177039834dec323 100644 +--- chrome/browser/ui/window_feature_controller/window_feature_controller.h ++++ chrome/browser/ui/window_feature_controller/window_feature_controller.h +@@ -34,6 +34,7 @@ class WindowFeatureController { + }; + + WindowFeatureController( ++ BrowserWindowInterface* browser, + BrowserWindowFullscreenController* fullscreen_controller, + web_app::AppBrowserController* app_controller, + BrowserWindowInterface::Type browser_type, +@@ -85,6 +86,7 @@ class WindowFeatureController { + bool check_can_support) const; + bool IsFullscreen() const; + ++ const raw_ptr browser_; + const raw_ref fullscreen_controller_; + + // Can be null. diff --git chrome/browser/ui/window_metadata/window_metadata_controller.cc chrome/browser/ui/window_metadata/window_metadata_controller.cc -index efdeb4080a66c06cb020529f63d246732f51249b..4ffaab731491243a6cc9d93bc2a4e95ff9f3b9a8 100644 +index 7b132613b32a3443a3ced92470447f2de0414fdd..360b01ea84c742a205ec35a566c6a6cdf46357e6 100644 --- chrome/browser/ui/window_metadata/window_metadata_controller.cc +++ chrome/browser/ui/window_metadata/window_metadata_controller.cc -@@ -63,8 +63,12 @@ WindowMetadataController::WindowMetadataController( +@@ -63,8 +63,13 @@ WindowMetadataController::WindowMetadataController( WindowMetadataController::~WindowMetadataController() = default; gfx::Image WindowMetadataController::GetCurrentPageIcon() const { @@ -993,7 +1275,8 @@ index efdeb4080a66c06cb020529f63d246732f51249b..4ffaab731491243a6cc9d93bc2a4e95f + // WebContents instead of the picture-in-picture WebContents itself. content::WebContents* web_contents = - browser_->tab_strip_model()->GetActiveWebContents(); -+ browser_->is_type_picture_in_picture() ++ (browser_->GetType() == ++ BrowserWindowInterface::Type::TYPE_PICTURE_IN_PICTURE) + ? PictureInPictureWindowManager::GetInstance()->GetWebContents() + : browser_->tab_strip_model()->GetActiveWebContents(); // |web_contents| can be NULL since GetCurrentPageIcon() is called by the diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 151f0b158..4f6868d65 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index e13faa0b945c9e655a059da24658aa0ea31315dc..20709a9b714ad161c49371b8e5436418141fd49e 100644 +index 81645b3bb44e1ffd1e3bc14ec0546d7d8bf48079..d976f6a77f623f976275c7d3667f5a5c00a82768 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc @@ -143,7 +143,7 @@ ContentSetting GetContentSettingFromRules( diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index 9d20d9f33..004e582e4 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 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b5c93bac1 100644 +index e83482272770b878b860e27c7caf5c7eef334673..c90dee7676ece6d39ba671402a14f180125afa51 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -466,6 +466,18 @@ ui::ImageModel GetLensContextMenuIcon() { +@@ -477,6 +477,18 @@ ui::ImageModel GetLensContextMenuIcon() { ); } @@ -21,7 +21,7 @@ index 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -742,6 +754,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -766,6 +778,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { return 1; } @@ -30,9 +30,9 @@ index 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b + return 1; + id = CollapseCommandsForUMA(id); - const auto& map = GetIdcToUmaMap(type); - auto it = map.find(id); -@@ -1068,6 +1084,14 @@ RenderViewContextMenu::RenderViewContextMenu( + return UmaEnumForCommand(id, type); + } +@@ -1107,6 +1123,14 @@ RenderViewContextMenu::RenderViewContextMenu( system_app_ = app_controller ? app_controller->system_app() : nullptr; #endif // BUILDFLAG(IS_CHROMEOS) @@ -47,7 +47,7 @@ index 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b observers_.AddObserver(&autofill_context_menu_manager_); } -@@ -1518,6 +1542,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1572,6 +1596,12 @@ void RenderViewContextMenu::InitMenu() { AppendReadAnythingItem(); } } @@ -60,7 +60,7 @@ index 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b } Profile* RenderViewContextMenu::GetProfile() const { -@@ -4180,6 +4210,26 @@ void RenderViewContextMenu::RemoveObserverForTesting( +@@ -4312,6 +4342,26 @@ void RenderViewContextMenu::RemoveObserverForTesting( observers_.RemoveObserver(observer); } @@ -88,7 +88,7 @@ index 53f3f5527dcf9a7bc63ea98f24eb745fa21d65e3..e015eac17fa2765414fbb3c954d8600b 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 0daa02b83276fa571777ffe54ae9432961718fe3..f78678034a01e4c2864c39a10d825df91b5d78fe 100644 +index 79bdba7b9065d738e1f25e865fe6bdec6c0bc937..2ede30d06d5e30af7f16d9a5d264069b55b79895 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h @@ -177,7 +177,21 @@ class RenderViewContextMenu @@ -113,7 +113,7 @@ index 0daa02b83276fa571777ffe54ae9432961718fe3..f78678034a01e4c2864c39a10d825df9 Profile* GetProfile() const; // This may return nullptr (e.g. for WebUI dialogs). Virtual to allow tests to -@@ -546,6 +560,9 @@ class RenderViewContextMenu +@@ -550,6 +564,9 @@ class RenderViewContextMenu // Video frame sub-menu handling. ui::SimpleMenuModel video_frame_submenu_model_; @@ -189,10 +189,10 @@ index ec7a5fdef0fdf08dedb1c3932c78d485730a7a1a..ba772758fe13ebcff3935bfb53a9e97a runner_->Cancel(); } diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -index 0eb9f318daf821d437287ab5103f06b01dad64c7..31475919bb0be04e78e810ed86560bfcb7a0eef7 100644 +index 2a5168eae3a9fdcffba00096d9ae8acc68af32f9..dfc75cf0fc1c1b6408e9e2d783499bb8e782c590 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -@@ -153,6 +153,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, +@@ -158,6 +158,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, bool RenderViewContextMenuViews::GetAcceleratorForCommandId( int command_id, ui::Accelerator* accel) const { @@ -202,7 +202,7 @@ index 0eb9f318daf821d437287ab5103f06b01dad64c7..31475919bb0be04e78e810ed86560bfc // There are no formally defined accelerators we can query so we assume // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { -@@ -370,6 +373,10 @@ void RenderViewContextMenuViews::AppendPlatformEditableItems() { +@@ -403,6 +406,10 @@ void RenderViewContextMenuViews::AppendPlatformEditableItems() { } void RenderViewContextMenuViews::Show() { @@ -213,7 +213,7 @@ index 0eb9f318daf821d437287ab5103f06b01dad64c7..31475919bb0be04e78e810ed86560bfc if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) { return; } -@@ -416,6 +423,11 @@ void RenderViewContextMenuViews::Show() { +@@ -449,6 +456,11 @@ void RenderViewContextMenuViews::Show() { } } @@ -226,10 +226,10 @@ index 0eb9f318daf821d437287ab5103f06b01dad64c7..31475919bb0be04e78e810ed86560bfc return views::Widget::GetTopLevelWidgetForNativeView(GetActiveNativeView()); } diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h -index b0619927b062c86c3014741d120d36da56920742..abb1a674b81a38d8654c8df9af2b6e885686a853 100644 +index 8a9a76560aa243e253b4412153789465f41419c4..09779da2ada9b5f2afa0dacf29293a5d3ed07757 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h -@@ -47,6 +47,7 @@ class RenderViewContextMenuViews : public RenderViewContextMenu { +@@ -49,6 +49,7 @@ class RenderViewContextMenuViews : public RenderViewContextMenu { // RenderViewContextMenuBase implementation. void Show() override; @@ -238,7 +238,7 @@ index b0619927b062c86c3014741d120d36da56920742..abb1a674b81a38d8654c8df9af2b6e88 protected: RenderViewContextMenuViews(content::RenderFrameHost& render_frame_host, diff --git chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc -index 67b30245daaf437975713d4cc3056c27b74edecd..e9328d21210f953a6ca90deeaf9f744453d6611e 100644 +index fdefbf534e83be046fd2e2a0ac24f7f718ebcd1a..aef9b5c145bd76363a0bb8f2d7d7424b0d650cae 100644 --- chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc +++ chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc @@ -101,6 +101,10 @@ void ChromeWebContentsViewDelegateViews::ShowMenu( diff --git a/patch/patches/chrome_browser_devtools_osr.patch b/patch/patches/chrome_browser_devtools_osr.patch index bb38f6115..775912ae6 100644 --- a/patch/patches/chrome_browser_devtools_osr.patch +++ b/patch/patches/chrome_browser_devtools_osr.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/devtools/chrome_devtools_manager_delegate.cc chrome/browser/devtools/chrome_devtools_manager_delegate.cc -index c9f49cd198cd29a4f4ad3c2321c9b7a874b5e899..e36ba2fd74b2f4ae12265a9ba32d62005eec760b 100644 +index d1b45e8064923d3bcb78b52f3bdee858fbd9e671..bef86af90663a36a76c3487ce295484f211e676a 100644 --- chrome/browser/devtools/chrome_devtools_manager_delegate.cc +++ chrome/browser/devtools/chrome_devtools_manager_delegate.cc @@ -14,6 +14,7 @@ diff --git a/patch/patches/chrome_browser_dialogs_jsmodal.patch b/patch/patches/chrome_browser_dialogs_jsmodal.patch index a8c9ecee5..cbb800975 100644 --- a/patch/patches/chrome_browser_dialogs_jsmodal.patch +++ b/patch/patches/chrome_browser_dialogs_jsmodal.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc -index 224d2d57fdd1491d7949d2ccd9e0995bf4ead00d..501adae850a2a50f988d46a591cb7009c9f4c458 100644 +index f6fca938adc0bc8c03894eba30f8cd0a0b7068cd..77cbd84c63cbe1fdc4e353957c7055be0d4fe5c9 100644 --- chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc +++ chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc @@ -7,6 +7,7 @@ @@ -33,7 +33,7 @@ index 224d2d57fdd1491d7949d2ccd9e0995bf4ead00d..501adae850a2a50f988d46a591cb7009 JavaScriptTabModalDialogManagerDelegateDesktop:: JavaScriptTabModalDialogManagerDelegateDesktop( content::WebContents* web_contents) -@@ -87,6 +104,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsWebContentsForemost() { +@@ -85,6 +102,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsWebContentsForemost() { BrowserWindowInterface* browser = GetLastActiveBrowserWindowInterfaceWithAnyProfile(); if (!browser) { @@ -43,7 +43,7 @@ index 224d2d57fdd1491d7949d2ccd9e0995bf4ead00d..501adae850a2a50f988d46a591cb7009 // It's rare, but there are crashes from where sites are trying to show // dialogs in the split second of time between when their Browser is gone // and they're gone. In that case, bail. https://crbug.com/40727952 -@@ -104,6 +124,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsWebContentsForemost() { +@@ -102,6 +122,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsWebContentsForemost() { } bool JavaScriptTabModalDialogManagerDelegateDesktop::IsApp() { @@ -53,7 +53,7 @@ index 224d2d57fdd1491d7949d2ccd9e0995bf4ead00d..501adae850a2a50f988d46a591cb7009 tabs::TabInterface* tab = tabs::TabInterface::MaybeGetFromContents(web_contents_); if (!tab) { -@@ -119,6 +142,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsApp() { +@@ -117,6 +140,9 @@ bool JavaScriptTabModalDialogManagerDelegateDesktop::IsApp() { bool JavaScriptTabModalDialogManagerDelegateDesktop::CanShowModalUI() { tabs::TabInterface* tab = tabs::TabInterface::MaybeGetFromContents(web_contents_); @@ -64,10 +64,10 @@ index 224d2d57fdd1491d7949d2ccd9e0995bf4ead00d..501adae850a2a50f988d46a591cb7009 } diff --git chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc -index e0c7c6df6f4159e600d470a13b592c473808d26b..106cf8d8b998a9310179dd51c409f45c28d5edd9 100644 +index 7c39cff1a24b7eb55ba5611dd06205e12b295a55..1751b0698e5e5f4c57c3fc66ff88e9398298d886 100644 --- chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc +++ chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc -@@ -49,9 +49,13 @@ views::View* JavaScriptTabModalDialogViewViews::GetInitiallyFocusedView() { +@@ -51,9 +51,13 @@ views::View* JavaScriptTabModalDialogViewViews::GetInitiallyFocusedView() { } void JavaScriptTabModalDialogViewViews::AddedToWidget() { @@ -84,7 +84,7 @@ index e0c7c6df6f4159e600d470a13b592c473808d26b..106cf8d8b998a9310179dd51c409f45c if (!message_text_.empty()) { GetWidget()->GetRootView()->GetViewAccessibility().SetDescription( message_text_); -@@ -79,10 +83,13 @@ JavaScriptTabModalDialogViewViews::JavaScriptTabModalDialogViewViews( +@@ -81,10 +85,13 @@ JavaScriptTabModalDialogViewViews::JavaScriptTabModalDialogViewViews( default_prompt_text_(default_prompt_text), dialog_callback_(std::move(dialog_callback)), dialog_force_closed_callback_(std::move(dialog_force_closed_callback)) { diff --git a/patch/patches/chrome_browser_dialogs_misc.patch b/patch/patches/chrome_browser_dialogs_misc.patch index 5d021a102..3669f3e01 100644 --- a/patch/patches/chrome_browser_dialogs_misc.patch +++ b/patch/patches/chrome_browser_dialogs_misc.patch @@ -17,7 +17,7 @@ index c05fd2bb229be320371d535f5b73465b491e89ec..71d955ae83474d4f2c7937c5e92c011b std::move(dialog_model), std::move(anchor), views::BubbleBorder::TOP_RIGHT); diff --git chrome/browser/ui/views/certificate_selector.cc chrome/browser/ui/views/certificate_selector.cc -index e752e22e93dd44c3714887ae247b8b14b72ac998..b59518208116335c817697c4d6ccb47fad9fbc7a 100644 +index c5fc8916e18e6d971b4da89c40b2229bac38424e..6df337d67175433dc4104db92503fa3416426916 100644 --- chrome/browser/ui/views/certificate_selector.cc +++ chrome/browser/ui/views/certificate_selector.cc @@ -334,8 +334,13 @@ void CertificateSelector::ViewCertButtonPressed() { diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index e943073cc..716d8872c 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 e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45aeb485876 100644 +index 9b7c30c3b2f7c3489d32a0e82a3ce0288d249f98..127b3250c766d173eeea24ee9c9f20c7a901e420 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc @@ -262,6 +262,12 @@ void FileSelectHelper::OnListDone(int error) { @@ -15,7 +15,7 @@ index e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45a auto model = CreateConfirmationDialog( entry->display_name_, std::move(chooser_files), base::BindOnce(&FileSelectHelper::PerformContentAnalysisIfNeeded, -@@ -521,31 +527,51 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -524,31 +530,51 @@ FileSelectHelper::GetFileTypesFromAcceptType( std::vector* extensions = &file_type->extensions.back(); @@ -71,7 +71,7 @@ index e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45a if (extensions->size() > old_extension_size) valid_type_count++; } -@@ -561,13 +587,28 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -564,13 +590,28 @@ FileSelectHelper::GetFileTypesFromAcceptType( // "ehtml,shtml,htm,html" for "text/html". On Windows, the select file // dialog uses the first extension in the list to form the description, // like "EHTML Files". This is not what we want. @@ -105,7 +105,7 @@ index e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45a } return file_type; -@@ -577,7 +618,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -580,7 +621,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( void FileSelectHelper::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -115,7 +115,7 @@ index e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45a Profile* profile = Profile::FromBrowserContext( render_frame_host->GetProcess()->GetBrowserContext()); -@@ -585,6 +627,7 @@ void FileSelectHelper::RunFileChooser( +@@ -588,6 +630,7 @@ void FileSelectHelper::RunFileChooser( // message. scoped_refptr file_select_helper( new FileSelectHelper(profile)); @@ -123,7 +123,7 @@ index e80e2a89ea241321193a9ea13fb26394344c89e0..85b96da434850548e9985a246f62a45a file_select_helper->RunFileChooser(render_frame_host, std::move(listener), params.Clone()); } -@@ -700,8 +743,11 @@ void FileSelectHelper::RunFileChooserOnUIThread( +@@ -703,8 +746,11 @@ void FileSelectHelper::RunFileChooserOnUIThread( NOTREACHED(); } diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index 593923552..235fbc81f 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc -index 39077439744412b5812c380d788c1a3449d1772b..0bfcaad0722cc9cb5838e842df6729d005fbcb60 100644 +index acd15177f6b03dc4bb914e54cb86ae88cb254bfe..6902dae7961846c9026c549f23c1a785f0f4aaba 100644 --- chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc +++ chrome/browser/ui/views/chrome_javascript_app_modal_view_factory_views.cc -@@ -100,7 +100,7 @@ javascript_dialogs::AppModalDialogView* CreateViewsJavaScriptDialog( +@@ -99,7 +99,7 @@ javascript_dialogs::AppModalDialogView* CreateViewsJavaScriptDialog( web_contents->GetDelegate()->ActivateContents(web_contents); gfx::NativeWindow parent_window = web_contents->GetTopLevelNativeWindow(); #if defined(USE_AURA) @@ -216,10 +216,10 @@ index a1410173b87559db21104cc5012f2a28ad760d3c..866e555f39427dc5eca20a072272157e virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc -index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab3416740f80c794 100644 +index b1149cc27193740404e31508b63b91c782038504..2193cc413038565fb1b4b0dad86c94b53a175953 100644 --- ui/views/window/dialog_delegate.cc +++ ui/views/window/dialog_delegate.cc -@@ -107,10 +107,12 @@ DialogDelegate::DialogDelegate() { +@@ -108,10 +108,12 @@ DialogDelegate::DialogDelegate() { // static Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, gfx::NativeWindow context, @@ -234,7 +234,7 @@ index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab341674 widget->Init(std::move(params)); return widget; } -@@ -119,15 +121,17 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, +@@ -120,15 +122,17 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, Widget* DialogDelegate::CreateDialogWidget( std::unique_ptr delegate, gfx::NativeWindow context, @@ -256,7 +256,7 @@ index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab341674 #else return true; #endif -@@ -138,7 +142,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( +@@ -139,7 +143,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( WidgetDelegate* delegate, gfx::NativeWindow context, gfx::NativeView parent, @@ -266,7 +266,7 @@ index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab341674 DialogDelegate* dialog = delegate->AsDialogDelegate(); views::Widget::InitParams params( -@@ -148,7 +153,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( +@@ -149,7 +154,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( params.bounds = bounds; if (dialog) { @@ -275,7 +275,7 @@ index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab341674 } if (!dialog || dialog->use_custom_frame()) { -@@ -162,6 +167,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( +@@ -163,6 +168,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams( } params.context = context; params.parent = parent; @@ -284,10 +284,10 @@ index 24a97c5ca84423bf4fd94ae0f5f7b84dc806d121..2bf370b9210bb235d132612dab341674 // Web-modal (ui::mojom::ModalType::kChild) dialogs with parents are marked as // child widgets to prevent top-level window behavior (independent movement, diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index 09239da8ac7ade15a28a60166c1e0f356141ffef..006a31a703480840035f12d920b7eb6ec6720dce 100644 +index 54331d0064b9275c74b7971c11eac66390f74474..35a9be1f1564e0b9c299ae3e2d67cc6164dbcc6e 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h -@@ -304,13 +304,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { +@@ -303,13 +303,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { // WidgetDelegate::SetOwnedByWidget(). static Widget* CreateDialogWidget(std::unique_ptr delegate, gfx::NativeWindow context, @@ -309,7 +309,7 @@ index 09239da8ac7ade15a28a60166c1e0f356141ffef..006a31a703480840035f12d920b7eb6e // Returns the dialog widget InitParams for a given |context| or |parent|. // If |bounds| is not empty, used to initially place the dialog, otherwise -@@ -318,7 +323,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { +@@ -317,7 +322,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_download.patch b/patch/patches/chrome_browser_download.patch index 4f72ffdfe..6de9c45c8 100644 --- a/patch/patches/chrome_browser_download.patch +++ b/patch/patches/chrome_browser_download.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc -index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951cbf62011 100644 +index d0b653e5eaaf2f62f67039c9fd72e8297a1710c0..f5a090d9d558a34a25241b5da31c6885fde19794 100644 --- chrome/browser/download/chrome_download_manager_delegate.cc +++ chrome/browser/download/chrome_download_manager_delegate.cc @@ -31,6 +31,7 @@ @@ -10,7 +10,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_core_service.h" #include "chrome/browser/download/download_core_service_factory.h" -@@ -178,6 +179,10 @@ +@@ -182,6 +183,10 @@ #endif // BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) #endif // BUILDFLAG(SAFE_BROWSING_DOWNLOAD_PROTECTION) @@ -21,7 +21,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 using content::BrowserThread; using content::DownloadManager; using download::DownloadItem; -@@ -639,6 +644,10 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) +@@ -687,6 +692,10 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) download_message_bridge_(std::make_unique()), #endif download_prefs_(std::make_unique(profile)) { @@ -32,7 +32,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 } ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { -@@ -707,6 +716,9 @@ void ChromeDownloadManagerDelegate::Shutdown() { +@@ -755,6 +764,9 @@ void ChromeDownloadManagerDelegate::Shutdown() { download_manager_->RemoveObserver(this); download_manager_ = nullptr; } @@ -42,7 +42,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 } void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown( -@@ -787,6 +799,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget( +@@ -835,6 +847,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget( ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload); } @@ -55,7 +55,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 DownloadTargetDeterminer::CompletionCallback target_determined_callback = base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined, weak_ptr_factory_.GetWeakPtr(), download->GetId(), -@@ -1345,9 +1363,12 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { +@@ -1399,9 +1417,12 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { BrowserWindowInterface* browser = chrome::ScopedTabbedBrowserDisplayer(profile_).browser_window_interface(); @@ -72,7 +72,7 @@ index 27be7a3c72f69fe3167799ce0bbc3394989a1cec..b1d78cf7f20328d9fc61831da939e951 net::FilePathToFileURL(download->GetTargetFilePath()), content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h -index dea3016425321ce6dbe77b7af17939995e43f926..6b4e96ec1a1eb8d3cf606a5705cfdb16c0b43e02 100644 +index e3cbfecee6776d76b97fa1acb1a66b5bedddb333..68c47ab3d5608fdbf546534191e91e37e5531b4b 100644 --- chrome/browser/download/chrome_download_manager_delegate.h +++ chrome/browser/download/chrome_download_manager_delegate.h @@ -20,6 +20,7 @@ @@ -96,7 +96,7 @@ index dea3016425321ce6dbe77b7af17939995e43f926..6b4e96ec1a1eb8d3cf606a5705cfdb16 // This is the Chrome side helper for the download system. class ChromeDownloadManagerDelegate : public content::DownloadManagerDelegate, -@@ -435,6 +442,10 @@ class ChromeDownloadManagerDelegate +@@ -450,6 +457,10 @@ class ChromeDownloadManagerDelegate // Whether a file picker dialog is showing. bool is_file_picker_showing_ = false; diff --git a/patch/patches/chrome_browser_extensions.patch b/patch/patches/chrome_browser_extensions.patch index 686efacba..06725ed64 100644 --- a/patch/patches/chrome_browser_extensions.patch +++ b/patch/patches/chrome_browser_extensions.patch @@ -34,10 +34,10 @@ index 2d73f4cf7e49380c9793751b24ceab848d753e6c..2e95396a5fd514d2953234ca6f57a3f4 #endif diff --git chrome/browser/extensions/api/tabs/tabs_api.cc chrome/browser/extensions/api/tabs/tabs_api.cc -index 0041a0cf811199a356ac09d7da02965b21d2fc05..03aedf0241ac85f09864fb65a494ce36da137d21 100644 +index d225b3926e66808ba3f78ed9b654517d9fec4b1d..6ccbe28a4765747c5bdf42a294a4b58b2f763705 100644 --- chrome/browser/extensions/api/tabs/tabs_api.cc +++ chrome/browser/extensions/api/tabs/tabs_api.cc -@@ -2537,31 +2537,31 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -2593,31 +2593,31 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { } // tabs_internal::GetTabById may return a null window for prerender tabs. @@ -90,7 +90,7 @@ index 0041a0cf811199a356ac09d7da02965b21d2fc05..03aedf0241ac85f09864fb65a494ce36 if (params->update_properties.muted && !SetTabAudioMuted(contents, *params->update_properties.muted, -@@ -2602,7 +2602,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -2658,7 +2658,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { } #endif @@ -99,7 +99,7 @@ index 0041a0cf811199a356ac09d7da02965b21d2fc05..03aedf0241ac85f09864fb65a494ce36 bool pinned = *params->update_properties.pinned; if (target_tab->IsPinned() != pinned) { -@@ -2632,7 +2632,8 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { +@@ -2688,7 +2688,8 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { // Navigate the tab to a new location if the url is different. if (params->update_properties.url) { std::string updated_url = *params->update_properties.url; @@ -110,7 +110,7 @@ index 0041a0cf811199a356ac09d7da02965b21d2fc05..03aedf0241ac85f09864fb65a494ce36 return RespondNow(Error(ErrorUtils::FormatErrorMessage( tabs_constants::kURLsNotAllowedInIncognitoError, updated_url))); diff --git chrome/browser/extensions/extension_tab_util.cc chrome/browser/extensions/extension_tab_util.cc -index 6238051f9a21504d35957c0208da8e60f5dbb43f..312e80e4165bcd0d69b961cfd3aec14c08b23f1a 100644 +index 285481f45a49b82ba50e9b5b0df33519add40a7d..da312fc7869222d7e88963a02b51d0185cf6c9ad 100644 --- chrome/browser/extensions/extension_tab_util.cc +++ chrome/browser/extensions/extension_tab_util.cc @@ -70,6 +70,7 @@ @@ -119,7 +119,7 @@ index 6238051f9a21504d35957c0208da8e60f5dbb43f..312e80e4165bcd0d69b961cfd3aec14c #else +#include "cef/libcef/features/features.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" - #include "chrome/browser/ui/browser.h" // nogncheck + // nogncheck #include "chrome/browser/ui/navigator/browser_navigator_params.h" // nogncheck @@ -86,6 +87,10 @@ @@ -132,7 +132,7 @@ index 6238051f9a21504d35957c0208da8e60f5dbb43f..312e80e4165bcd0d69b961cfd3aec14c using content::NavigationEntry; using content::WebContents; using extensions::mojom::APIPermissionID; -@@ -665,6 +670,14 @@ bool ExtensionTabUtil::GetTabById(int tab_id, +@@ -671,6 +676,14 @@ bool ExtensionTabUtil::GetTabById(int tab_id, } } @@ -148,7 +148,7 @@ index 6238051f9a21504d35957c0208da8e60f5dbb43f..312e80e4165bcd0d69b961cfd3aec14c // tab id exists as a prerendering tab, and the API will returns // `api::tabs::TAB_INDEX_NONE` for `out_tab_index` and a valid `WebContents`. diff --git chrome/browser/ui/tab_helpers.h chrome/browser/ui/tab_helpers.h -index de20a63945249dc004184359f91caf3a65feb945..e931443a1d6b39447de743ff82a21d2795b5a93d 100644 +index d80eafa666b384cf1ec16ebc638456b570ca4e79..bff4d77829ad5875518b8c9434e00fba69833cf8 100644 --- chrome/browser/ui/tab_helpers.h +++ chrome/browser/ui/tab_helpers.h @@ -6,6 +6,7 @@ diff --git a/patch/patches/chrome_browser_extensions_background.patch b/patch/patches/chrome_browser_extensions_background.patch index 1f0d059be..ffce1f8b5 100644 --- a/patch/patches/chrome_browser_extensions_background.patch +++ b/patch/patches/chrome_browser_extensions_background.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/extensions/BUILD.gn chrome/browser/extensions/BUILD.gn -index d3f740db99e1df7bd660fe666922a27b668dfa03..cdba8cadb194c1f2d8615b50f9a94a9efacfcb19 100644 +index 2945c8b8b6bd529c0f9e49dd5c7cbba996fe8014..d5ea1a30a537a05db87e15fd5fba4f730e46bff9 100644 --- chrome/browser/extensions/BUILD.gn +++ chrome/browser/extensions/BUILD.gn -@@ -3145,10 +3145,10 @@ source_set("browser_tests") { +@@ -3164,10 +3164,10 @@ source_set("browser_tests") { if (!is_chromeos) { # Chrome OS doesn't use background mode or download bubbles. @@ -16,4 +16,4 @@ index d3f740db99e1df7bd660fe666922a27b668dfa03..cdba8cadb194c1f2d8615b50f9a94a9e + deps += [ "//chrome/browser/download/bubble" ] } - if (use_aura) { + if (enable_background_mode) { diff --git a/patch/patches/chrome_browser_frame_mac.patch b/patch/patches/chrome_browser_frame_mac.patch index b811c8fa8..7f807f583 100644 --- a/patch/patches/chrome_browser_frame_mac.patch +++ b/patch/patches/chrome_browser_frame_mac.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/views/frame/browser_native_widget_mac.h chrome/browser/ui/views/frame/browser_native_widget_mac.h -index 79bfe09293c526168b815808db4f8cae9b5418ed..8aa86ae78e82370cb59c0cb96403780a8f24b120 100644 +index 927117fb0565681bd25261211e48188cd011ebc9..07b253059d7a43f6f6c619a649b6b734de9d9de8 100644 --- chrome/browser/ui/views/frame/browser_native_widget_mac.h +++ chrome/browser/ui/views/frame/browser_native_widget_mac.h @@ -18,6 +18,7 @@ @@ -10,50 +10,49 @@ index 79bfe09293c526168b815808db4f8cae9b5418ed..8aa86ae78e82370cb59c0cb96403780a class BrowserWidget; class BrowserView; @class BrowserWindowTouchBarController; -@@ -67,6 +68,21 @@ class BrowserNativeWidgetMac : public views::NativeWidgetMac, +@@ -70,6 +71,19 @@ class BrowserNativeWidgetMac : public views::NativeWidgetMac, bool ShouldUseInitialVisibleOnAllWorkspaces() const override; void AnnounceTextInInProcessWindow(const std::u16string& text) override; + static void ValidateUserInterfaceItem( -+ Browser* browser, ++ BrowserWindowInterface* browser, + int32_t command, + remote_cocoa::mojom::ValidateUserInterfaceItemResult* result); -+ static bool WillExecuteCommand( -+ Browser* browser, -+ int32_t command, -+ WindowOpenDisposition window_open_disposition, -+ bool is_before_first_responder); -+ static bool ExecuteCommand( -+ Browser* browser, -+ int32_t command, -+ WindowOpenDisposition window_open_disposition, -+ bool is_before_first_responder); ++ static bool WillExecuteCommand(BrowserWindowInterface* browser, ++ int32_t command, ++ WindowOpenDisposition window_open_disposition, ++ bool is_before_first_responder); ++ static bool ExecuteCommand(BrowserWindowInterface* browser, ++ int32_t command, ++ WindowOpenDisposition window_open_disposition, ++ bool is_before_first_responder); + protected: ~BrowserNativeWidgetMac() override; diff --git chrome/browser/ui/views/frame/browser_native_widget_mac.mm chrome/browser/ui/views/frame/browser_native_widget_mac.mm -index 93eeda2daf44d3da4591852d1a82a0aeb9a969b4..e08731042847f3790fe2a36b9b5396d35e73c878 100644 +index fb1e87f83493475668792b1f4b59b4c4e777162f..0ab9ba2e66efd6ec30e3577d1cdfb005ac25dd50 100644 --- chrome/browser/ui/views/frame/browser_native_widget_mac.mm +++ chrome/browser/ui/views/frame/browser_native_widget_mac.mm -@@ -270,7 +270,15 @@ void BrowserNativeWidgetMac::OnWidgetDestroyed(views::Widget* widget) { +@@ -397,8 +397,15 @@ void BrowserNativeWidgetMac::OnWidgetDestroyed(views::Widget* widget) { void BrowserNativeWidgetMac::ValidateUserInterfaceItem( int32_t tag, remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) { -- Browser* const browser = browser_view_ ? browser_view_->browser() : nullptr; +- BrowserWindowInterface* const browser = +- browser_view_ ? browser_view_->browser() : nullptr; + return ValidateUserInterfaceItem( + browser_view_ ? browser_view_->browser() : nullptr, tag, result); +} + +// static +void BrowserNativeWidgetMac::ValidateUserInterfaceItem( -+ Browser* browser, ++ BrowserWindowInterface* browser, + int32_t tag, + remote_cocoa::mojom::ValidateUserInterfaceItemResult* result) { if (!browser || !chrome::SupportsCommand(browser, tag)) { result->enable = false; return; -@@ -480,9 +488,16 @@ bool BrowserNativeWidgetMac::WillExecuteCommand( +@@ -609,9 +616,16 @@ bool BrowserNativeWidgetMac::WillExecuteCommand( if (!browser_view_) { return false; } @@ -61,18 +60,18 @@ index 93eeda2daf44d3da4591852d1a82a0aeb9a969b4..e08731042847f3790fe2a36b9b5396d3 + window_open_disposition, is_before_first_responder); +} -- Browser* const browser = browser_view_->browser(); +- BrowserWindowInterface* const browser = browser_view_->browser(); - +// static +bool BrowserNativeWidgetMac::WillExecuteCommand( -+ Browser* browser, ++ BrowserWindowInterface* browser, + int32_t command, + WindowOpenDisposition window_open_disposition, + bool is_before_first_responder) { 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 -@@ -514,12 +529,23 @@ bool BrowserNativeWidgetMac::ExecuteCommand( +@@ -643,12 +657,23 @@ bool BrowserNativeWidgetMac::ExecuteCommand( int32_t command, WindowOpenDisposition window_open_disposition, bool is_before_first_responder) { @@ -85,10 +84,10 @@ index 93eeda2daf44d3da4591852d1a82a0aeb9a969b4..e08731042847f3790fe2a36b9b5396d3 + window_open_disposition, is_before_first_responder); +} -- Browser* browser = browser_view_->browser(); +- BrowserWindowInterface* browser = browser_view_->browser(); +// static +bool BrowserNativeWidgetMac::ExecuteCommand( -+ Browser* browser, ++ BrowserWindowInterface* browser, + int32_t command, + WindowOpenDisposition window_open_disposition, + bool is_before_first_responder) { @@ -99,8 +98,8 @@ index 93eeda2daf44d3da4591852d1a82a0aeb9a969b4..e08731042847f3790fe2a36b9b5396d3 if (command == IDC_TOGGLE_VERTICAL_TABS) { if (auto* controller = -@@ -564,10 +590,13 @@ bool BrowserNativeWidgetMac::ExecuteCommand( - } +@@ -695,10 +720,13 @@ bool BrowserNativeWidgetMac::ExecuteCommand( + return true; } } else if (command == IDC_CLEAR_BROWSING_DATA) { - views::ElementTrackerViews::GetInstance()->NotifyCustomEvent( diff --git a/patch/patches/chrome_browser_metrics_tpm_476896967.patch b/patch/patches/chrome_browser_metrics_tpm_476896967.patch index 3e23ccaa7..df86d3947 100644 --- a/patch/patches/chrome_browser_metrics_tpm_476896967.patch +++ b/patch/patches/chrome_browser_metrics_tpm_476896967.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc -index 9282dc6f6234e347354eca867f9e3fe2c5fc0388..3181588bde8ad9354aab4e5c1cf39b5d76468d02 100644 +index 0a39123d3afe04dfec0e4c7cd62a30e5e5bd3d06..26573df939299a8d607caf9601282fa6eafe0e3c 100644 --- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc @@ -35,6 +35,7 @@ @@ -10,7 +10,7 @@ index 9282dc6f6234e347354eca867f9e3fe2c5fc0388..3181588bde8ad9354aab4e5c1cf39b5d #include "chrome/browser/about_flags.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/buildflags.h" -@@ -933,9 +934,11 @@ void RecordStartupMetrics() { +@@ -928,9 +929,11 @@ void RecordStartupMetrics() { key_credential_manager_support::ReportKeyCredentialManagerSupport(); #endif // BUILDFLAG(IS_WIN) diff --git a/patch/patches/chrome_browser_permission_prompt.patch b/patch/patches/chrome_browser_permission_prompt.patch index 831f9ea25..ce6b25869 100644 --- a/patch/patches/chrome_browser_permission_prompt.patch +++ b/patch/patches/chrome_browser_permission_prompt.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/permission_bubble/permission_prompt.h chrome/browser/ui/permission_bubble/permission_prompt.h -index fbce13c16ad10420f3f8e0df521e3be6979271d1..0512b2f09937ed0410f23d321b57f77d200cde74 100644 +index 6e9bba3c993b0c3c3ce71851b45e4316c5673d77..26f4c4771f9b7817fdd92e42b410c7abc6a0b4ea 100644 --- chrome/browser/ui/permission_bubble/permission_prompt.h +++ chrome/browser/ui/permission_bubble/permission_prompt.h -@@ -11,6 +11,13 @@ namespace content { +@@ -12,6 +12,13 @@ namespace content { class WebContents; } @@ -17,10 +17,10 @@ index fbce13c16ad10420f3f8e0df521e3be6979271d1..0512b2f09937ed0410f23d321b57f77d 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 22b5079ce6aff0a111741d97398d723f173c8688..39bebf1f8826686afb2bc52a4819db25e41ef9be 100644 +index 0c03be841cac2008e2ec8d0610337ca3e39e8d37..f13e680a2828eb9de558df65ee122045c808703e 100644 --- chrome/browser/ui/views/permissions/permission_prompt_factory.cc +++ chrome/browser/ui/views/permissions/permission_prompt_factory.cc -@@ -266,11 +266,29 @@ std::unique_ptr CreateQuietPrompt( +@@ -250,6 +250,8 @@ std::unique_ptr CreateQuietPrompt( } } @@ -28,6 +28,11 @@ index 22b5079ce6aff0a111741d97398d723f173c8688..39bebf1f8826686afb2bc52a4819db25 + } // namespace + bool ShouldShowPermissionPromptEvenIfOmniboxEditedOrEmpty( +@@ -281,9 +283,25 @@ bool ShouldShowPermissionPromptEvenIfOmniboxEditedOrEmpty( + return false; + } + +void SetCreatePermissionPromptFunction(CreatePermissionPromptFunctionPtr ptr) { + g_create_permission_prompt_ptr = ptr; +} diff --git a/patch/patches/chrome_browser_policy.patch b/patch/patches/chrome_browser_policy.patch index 6fc95bd29..94e29d190 100644 --- a/patch/patches/chrome_browser_policy.patch +++ b/patch/patches/chrome_browser_policy.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/policy/BUILD.gn chrome/browser/policy/BUILD.gn -index d6bafa4aa26b306b09a2a43138b39721d48e1e52..51f6d08e3aaa245c3201f87d8e3d727e9841f993 100644 +index 14a3dd2b3bafcb7bc932b39b48202fefd7d752f5..08485bfe16f49f4615c50982f6a6ec98009bbbad 100644 --- chrome/browser/policy/BUILD.gn +++ chrome/browser/policy/BUILD.gn -@@ -27,6 +27,7 @@ source_set("path_parser") { +@@ -28,6 +28,7 @@ source_set("path_parser") { "//base", "//chrome/common:constants", "//components/policy:generated", @@ -114,7 +114,7 @@ index 41bb311b3399af2014bf416eb65e99cae9b8df6b..df1b1e2514990a5d5c091cae2bd9ab30 } diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc -index c475e2858878bd22323098ea6612123968e505e7..618aae9eb3b0928a64370085ef0e26bf0cb359e9 100644 +index 1761f93bfefa85685fe87f6ee2c8dcb3e54b9bf0..361b640b4b05b7c77cd73a60de007f1b0d7c09fd 100644 --- chrome/browser/policy/chrome_browser_policy_connector.cc +++ chrome/browser/policy/chrome_browser_policy_connector.cc @@ -12,10 +12,13 @@ @@ -131,7 +131,7 @@ index c475e2858878bd22323098ea6612123968e505e7..618aae9eb3b0928a64370085ef0e26bf #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/browser_management/management_service_factory.h" #include "chrome/browser/policy/configuration_policy_handler_list_factory.h" -@@ -71,6 +74,11 @@ +@@ -70,6 +73,11 @@ namespace policy { namespace { bool g_command_line_enabled_for_testing = false; @@ -143,7 +143,7 @@ index c475e2858878bd22323098ea6612123968e505e7..618aae9eb3b0928a64370085ef0e26bf } // namespace ChromeBrowserPolicyConnector::ChromeBrowserPolicyConnector() -@@ -253,6 +261,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { +@@ -251,6 +259,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { g_command_line_enabled_for_testing = true; } @@ -217,7 +217,7 @@ index c475e2858878bd22323098ea6612123968e505e7..618aae9eb3b0928a64370085ef0e26bf base::flat_set ChromeBrowserPolicyConnector::device_affiliation_ids() const { if (!device_affiliation_ids_for_testing_.empty()) { -@@ -316,25 +391,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { +@@ -314,25 +389,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { std::unique_ptr ChromeBrowserPolicyConnector::CreatePlatformProvider() { #if BUILDFLAG(IS_WIN) @@ -252,7 +252,7 @@ index c475e2858878bd22323098ea6612123968e505e7..618aae9eb3b0928a64370085ef0e26bf auto loader = std::make_unique( base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}), -@@ -345,7 +417,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { +@@ -343,7 +415,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { std::move(loader)); #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) base::FilePath config_dir_path; @@ -400,10 +400,10 @@ index e36249713bfd5c254a322c3c55fd31d129937fab..8e60ff056d2bf996e6fb84b924379f2f // policy files that allow sys-admins // to set policies for chrome. This directory diff --git components/policy/BUILD.gn components/policy/BUILD.gn -index 640d16727dbbab2c518545b1d9c78916de4a8df8..691ef9968d8a3702935f2ca3f9f21e9397b7e7b0 100644 +index 5f345583e6c6f2bfdc486ebcc0a0112c2b953a3f..55f024e969a2c8828eb98a6521c8bf0af8b85b6f 100644 --- components/policy/BUILD.gn +++ components/policy/BUILD.gn -@@ -267,6 +267,7 @@ static_library("generated") { +@@ -305,6 +305,7 @@ static_library("generated") { ":cloud_policy_proto_generated_compile", ":policy_code_generate", "//base", diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 4a88cdd3f..68d58f8e9 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/bookmarks/bookmark_stats.cc chrome/browser/ui/bookmarks/bookmark_stats.cc -index fbaea519da90c9162a93517bb2f8d575302e51f8..33a675c522d809c5e24a69ec2f055888d54de198 100644 +index c4f17d2d26f4deabc14caa1c25d0d1651ee6524a..d6b3ee825b779ef60c9fcd0512370a2ff3dfc7fd 100644 --- chrome/browser/ui/bookmarks/bookmark_stats.cc +++ chrome/browser/ui/bookmarks/bookmark_stats.cc -@@ -21,7 +21,9 @@ bool IsBookmarkBarLocation(BookmarkLaunchLocation location) { +@@ -28,7 +28,9 @@ bool IsBookmarkBarLocation(BookmarkLaunchLocation location) { auto GetMetricProfile(const Profile* profile) { DCHECK(profile); @@ -14,10 +14,10 @@ index fbaea519da90c9162a93517bb2f8d575302e51f8..33a675c522d809c5e24a69ec2f055888 ? profile_metrics::BrowserProfileType::kRegular : profile_metrics::BrowserProfileType::kIncognito; diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc -index 2db7232304f2c79920707fa46a931298545d9790..636ce6127ea522630373330c3c826e9fabbe70e9 100644 +index 708badf944b48df40e13ce6c150246089c64f289..181ce408a7210a7d442595eea42aacb226f6b8a9 100644 --- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc +++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc -@@ -31,7 +31,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog( +@@ -30,7 +30,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog( dialog_type_(type), incognito_profile_(incognito_profile) { DCHECK(incognito_profile_); @@ -29,10 +29,10 @@ index 2db7232304f2c79920707fa46a931298545d9790..636ce6127ea522630373330c3c826e9f SetShowCloseButton(true); diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc -index 3b00411a070a7e741f46338e91442c1f0449205b..552b2d450c65ec1ee1587258d2ffb179208d8e12 100644 +index e87fb564bcd043a0010788eedbc61825d005160d..7dbd5ef335945c06ab25a1400ab021080fce564e 100644 --- chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc +++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc -@@ -22,6 +22,10 @@ IncognitoClearBrowsingDataDialogCoordinator:: +@@ -23,6 +23,10 @@ IncognitoClearBrowsingDataDialogCoordinator:: void IncognitoClearBrowsingDataDialogCoordinator::Show( IncognitoClearBrowsingDataDialogInterface::Type type, views::BubbleAnchor anchor) { @@ -44,12 +44,12 @@ index 3b00411a070a7e741f46338e91442c1f0449205b..552b2d450c65ec1ee1587258d2ffb179 // Ensure the previous bubble is closed before creating and showing the new // one. diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index 2593cf1e829ce5b98fcfbdcc94886f4602cd5761..c23dd0c4a53ce137aa7b5f35b06a7748f7f92fda 100644 +index 5e34acec16e1f581d7842e4210f00fd9b107ad70..bbe3cd63f1a921d0e62ad91a60af4ee009837fb9 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -26,7 +26,9 @@ IncognitoMenuView::IncognitoMenuView(views::BubbleAnchor anchor_element, - Browser* browser) + BrowserWindowInterface* browser) : ProfileMenuViewBase(anchor_element, browser) { - CHECK(profile().IsIncognitoProfile()); + CHECK(profile().IsIncognitoProfile() || @@ -59,7 +59,7 @@ index 2593cf1e829ce5b98fcfbdcc94886f4602cd5761..c23dd0c4a53ce137aa7b5f35b06a7748 ax::mojom::NameFrom::kAttribute); diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc -index 9d1d5d5c120eab3e399d3eae4778394089df8cb3..78c0006df4a30452060a455134dfaf9444c3874d 100644 +index 8cfb7cb05b9eec7ff9d6484d3cf11069d67d9495..9011404bac62e5b3be3a4ebbfe8e93f6dac974b4 100644 --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc +++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc @@ -91,7 +91,9 @@ void ProfileMenuCoordinator::ShowWithPromoResults( @@ -70,6 +70,6 @@ index 9d1d5d5c120eab3e399d3eae4778394089df8cb3..78c0006df4a30452060a455134dfaf94 + if (is_incognito || + (GetProfile()->IsOffTheRecord() && + GetProfile()->GetOTRProfileID().IsUniqueForCEF())) { - bubble = - std::make_unique(avatar_toolbar_button, browser); + bubble = std::make_unique(avatar_toolbar_button, + &browser_.get()); } else { diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 232768e4e..52d89b802 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc -index 1de7ece73d67b577b0ce8502edef23c3916d145d..635e2de7e7e872ee13dfd6aa4b4a59cbefdca950 100644 +index daebfe4ff9025c3f128a3bc56a93912a3fb2549f..92babde09c0d401713938643d04c3254778c26bc 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc -@@ -635,7 +635,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( +@@ -641,7 +641,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( #endif if (!profile) profile = std::make_unique(parent, otr_profile_id); @@ -14,10 +14,10 @@ index 1de7ece73d67b577b0ce8502edef23c3916d145d..635e2de7e7e872ee13dfd6aa4b4a59cb } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 3704d410b78db1eaa8e5aea339960f2fa1f24270..2c28ca74f3d0bb28db64d30be75c8da79972ba18 100644 +index d36fe0574b147e1a260401de5f1434ad75c63902..04033880e0f4f2c35c1d31eb61c32b173582aa89 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -103,6 +103,7 @@ constexpr char kPrimaryOTRProfileID[] = "profile::primary_otr"; +@@ -104,6 +104,7 @@ constexpr char kPrimaryOTRProfileID[] = "profile::primary_otr"; // differentiated by such prefixes. Consult with the profile owners before // proceeding if you believe a new prefix is strictly necessary. // See `chrome/browser/PRESUBMIT.py` which enforces this via a warning. @@ -25,7 +25,7 @@ index 3704d410b78db1eaa8e5aea339960f2fa1f24270..2c28ca74f3d0bb28db64d30be75c8da7 constexpr char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; constexpr char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; constexpr char kTestOTRProfileIDPrefix[] = "Test::OTR"; -@@ -123,6 +124,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { +@@ -124,6 +125,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext, MediaRouter::Presentation, and // CaptivePortal::Signin are exceptions to this ban. if (*this == PrimaryID() || IsDevTools() || @@ -34,7 +34,7 @@ index 3704d410b78db1eaa8e5aea339960f2fa1f24270..2c28ca74f3d0bb28db64d30be75c8da7 base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, base::CompareCase::SENSITIVE)) { return true; -@@ -163,6 +166,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( +@@ -164,6 +167,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( base::Uuid::GenerateRandomV4().AsLowercaseString().c_str())); } @@ -52,10 +52,10 @@ index 3704d410b78db1eaa8e5aea339960f2fa1f24270..2c28ca74f3d0bb28db64d30be75c8da7 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 955b07af5cd0030c3d31d3cbe7e3276600bc5a6d..22b8db1505f25124baa28f350738e3ac3995daa1 100644 +index 2390e4e112237527a8136fd969ec392d7e19e001..f699f84a893e79069346dd697edc5d6da5de1276 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -88,6 +88,10 @@ class Profile : public content::BrowserContext { +@@ -94,6 +94,10 @@ class Profile : public content::BrowserContext { // details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,17 +66,16 @@ index 955b07af5cd0030c3d31d3cbe7e3276600bc5a6d..22b8db1505f25124baa28f350738e3ac // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -498,6 +502,9 @@ class Profile : public content::BrowserContext { - // the definition of `ProfileLoadTracker`. +@@ -518,6 +522,8 @@ class Profile : public content::BrowserContext { virtual void AckCrashForTracking() = 0; #endif -+ + + void NotifyOffTheRecordProfileCreated(Profile* off_the_record); + - protected: - // Creates an OffTheRecordProfile which points to this Profile. - static std::unique_ptr CreateOffTheRecordProfile( -@@ -510,7 +517,6 @@ class Profile : public content::BrowserContext { + LifecycleState lifecycle_state() const { return lifecycle_state_; } + void set_lifecycle_state(LifecycleState lifecycle_state) { + lifecycle_state_ = lifecycle_state; +@@ -535,7 +541,6 @@ class Profile : public content::BrowserContext { Profile*, bool incognito_pref_store); @@ -85,7 +84,7 @@ index 955b07af5cd0030c3d31d3cbe7e3276600bc5a6d..22b8db1505f25124baa28f350738e3ac // 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 f3ca43e49dfcb80fb18d587afd3ace768c79c86a..98e1f91470c506ac8c2447d896c0dbc034feeffe 100644 +index 5a70cea01adcd71e8d29c5ba5c4190dfbf48db2b..555ff8ad5cb14bddcfa299916a279ce5f278dc65 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc @@ -39,6 +39,7 @@ @@ -96,7 +95,7 @@ index f3ca43e49dfcb80fb18d587afd3ace768c79c86a..98e1f91470c506ac8c2447d896c0dbc0 #include "chrome/browser/background/background_contents_service_factory.h" #include "chrome/browser/background_fetch/background_fetch_delegate_factory.h" #include "chrome/browser/background_fetch/background_fetch_delegate_impl.h" -@@ -237,6 +238,10 @@ +@@ -236,6 +237,10 @@ #include "chrome/browser/background/extensions/background_mode_manager.h" // nogncheck crbug.com/40147906 #endif @@ -107,7 +106,7 @@ index f3ca43e49dfcb80fb18d587afd3ace768c79c86a..98e1f91470c506ac8c2447d896c0dbc0 #if BUILDFLAG(ENABLE_EXTENSIONS_CORE) #include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h" // nogncheck crbug.com/40147906 #include "chrome/browser/extensions/extension_special_storage_policy.h" // nogncheck crbug.com/40147906 -@@ -285,6 +290,12 @@ class ScopedAllowBlockingForProfile : public base::ScopedAllowBlocking {}; +@@ -288,6 +293,12 @@ class ScopedAllowBlockingForProfile : public base::ScopedAllowBlocking {}; namespace { @@ -120,7 +119,7 @@ index f3ca43e49dfcb80fb18d587afd3ace768c79c86a..98e1f91470c506ac8c2447d896c0dbc0 #if BUILDFLAG(ENABLE_SESSION_SERVICE) // Delay before we explicitly create the SessionService. static constexpr base::TimeDelta kCreateSessionServiceDelay = -@@ -1075,7 +1086,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1080,7 +1091,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -131,7 +130,7 @@ index f3ca43e49dfcb80fb18d587afd3ace768c79c86a..98e1f91470c506ac8c2447d896c0dbc0 return raw_otr_profile; } -@@ -1421,6 +1434,12 @@ ProfileImpl::GetStorageNotificationService() { +@@ -1426,6 +1439,12 @@ ProfileImpl::GetStorageNotificationService() { #if BUILDFLAG(IS_ANDROID) return nullptr; #else diff --git a/patch/patches/chrome_browser_read_anything.patch b/patch/patches/chrome_browser_read_anything.patch deleted file mode 100644 index 0e2d0209c..000000000 --- a/patch/patches/chrome_browser_read_anything.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git chrome/browser/ui/read_anything/read_anything_soft_navigation_observer.cc chrome/browser/ui/read_anything/read_anything_soft_navigation_observer.cc -index 3a57f6d13db4bc3c8a028f79ebd61fb8913f5458..55dacaf0eec94528738dcbf3a8b55a30b3033b7d 100644 ---- chrome/browser/ui/read_anything/read_anything_soft_navigation_observer.cc -+++ chrome/browser/ui/read_anything/read_anything_soft_navigation_observer.cc -@@ -44,7 +44,8 @@ void ReadAnythingSoftNavigationObserver::OnSoftNavigation() { - if (!web_contents) { - return; - } -- tabs::TabInterface* tab = tabs::TabInterface::GetFromContents(web_contents); -+ tabs::TabInterface* tab = -+ tabs::TabInterface::MaybeGetFromContents(web_contents); - if (!tab) { - return; - } diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 6e6a5fb0d..683d187b1 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 89e8561a753381526dea29af37ce4d892baf8fea..46a14bab2d4354983eb6069ff5e7bb83a0447aa3 100644 +index 1ca01e1f5e567d131aca96735c9fdc938c5ed5fe..b4ab4af4b44015bb64af5b8d6d37176d3715a2f0 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -48,6 +48,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_startup.patch b/patch/patches/chrome_browser_startup.patch index e15be305e..b74b6c97b 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 b080481bfdd738e7b036ac1363036a17894cda85..c01262dca194c4323438cf30fa4dab7e99a94392 100644 +index 0b8d0aabf04ed3998c145c7ec18585d7b9033dcc..edc4fea063bb4185691fdf8a162fcfdc14b69c66 100644 --- chrome/browser/ui/startup/startup_browser_creator.cc +++ chrome/browser/ui/startup/startup_browser_creator.cc -@@ -650,6 +650,13 @@ std::optional MaybeHandleValidateCrx( +@@ -659,6 +659,13 @@ std::optional MaybeHandleValidateCrx( return false; } @@ -16,7 +16,7 @@ index b080481bfdd738e7b036ac1363036a17894cda85..c01262dca194c4323438cf30fa4dab7e } // namespace StartupBrowserCreator::StartupBrowserCreator() = default; -@@ -1495,6 +1502,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( +@@ -1546,6 +1553,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( {profile, mode}, last_opened_profiles); } @@ -29,7 +29,7 @@ index b080481bfdd738e7b036ac1363036a17894cda85..c01262dca194c4323438cf30fa4dab7e // static void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( const base::CommandLine& command_line, -@@ -1504,6 +1517,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( +@@ -1555,6 +1568,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( return; } @@ -42,7 +42,7 @@ index b080481bfdd738e7b036ac1363036a17894cda85..c01262dca194c4323438cf30fa4dab7e if (profile_path_info.mode == StartupProfileMode::kBrowserWindow) { ProfileManager* profile_manager = g_browser_process->profile_manager(); diff --git chrome/browser/ui/startup/startup_browser_creator.h chrome/browser/ui/startup/startup_browser_creator.h -index 940d755077475aa364de6d337ac78ccd063148d0..726f6b00d38096bc03cf0b53076cae84edb442a0 100644 +index e48593c685e5216c784c355f2eed61586affd531..d44a3f22816484117b3e29581ecf2d677f7f9089 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_browser_task_manager.patch b/patch/patches/chrome_browser_task_manager.patch index af6ca4ad0..0a9111485 100644 --- a/patch/patches/chrome_browser_task_manager.patch +++ b/patch/patches/chrome_browser_task_manager.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/task_manager/sampling/task_manager_impl.cc chrome/browser/task_manager/sampling/task_manager_impl.cc -index 2b753b1e18bdf0ed6cdc9c746638e51d9559e881..3ac2c2a7f3689d0aa7b98b89559e3936a8f4a18b 100644 +index 77d9f5de0702edb72901d78ffc47e0aa08695658..ae08c755f364871ce1a055df56f4030ec3bb8049 100644 --- chrome/browser/task_manager/sampling/task_manager_impl.cc +++ chrome/browser/task_manager/sampling/task_manager_impl.cc @@ -683,6 +683,11 @@ void TaskManagerImpl::StopUpdating() { diff --git a/patch/patches/chrome_browser_views_dangling_rawptr.patch b/patch/patches/chrome_browser_views_dangling_rawptr.patch index c5fa62072..d13809fd8 100644 --- a/patch/patches/chrome_browser_views_dangling_rawptr.patch +++ b/patch/patches/chrome_browser_views_dangling_rawptr.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/tab_search_bubble_host.cc chrome/browser/ui/views/tab_search_bubble_host.cc -index 085c215dbe853dc060890f19ecb4e3d02fa36561..8cb7cb2c02921284a4edf65b8b7a87f946cd6b29 100644 +index f1fde0675150def37c232d8c5588c84b29c5d3b6..d4aebd2e39d0aa449ba7226491a1cea0104d1add 100644 --- chrome/browser/ui/views/tab_search_bubble_host.cc +++ chrome/browser/ui/views/tab_search_bubble_host.cc -@@ -63,7 +63,7 @@ TabSearchOpenAction GetActionForEvent(const ui::Event& event) { +@@ -65,7 +65,7 @@ TabSearchOpenAction GetActionForEvent(const ui::Event& event) { TabSearchBubbleHost::TabSearchBubbleHost( views::Button* button, BrowserWindowInterface* browser_window_interface) @@ -11,7 +11,7 @@ index 085c215dbe853dc060890f19ecb4e3d02fa36561..8cb7cb2c02921284a4edf65b8b7a87f9 profile_(browser_window_interface->GetProfile()), browser_window_interface_(browser_window_interface), webui_bubble_manager_(WebUIBubbleManager::Create( -@@ -201,7 +201,7 @@ bool TabSearchBubbleHost::ShowTabSearchBubble( +@@ -203,7 +203,7 @@ bool TabSearchBubbleHost::ShowTabSearchBubble( const tabs::TabSearchPosition position = tabs::GetTabSearchPosition(browser_window_interface_); webui_bubble_manager_->ShowBubble( @@ -20,7 +20,7 @@ index 085c215dbe853dc060890f19ecb4e3d02fa36561..8cb7cb2c02921284a4edf65b8b7a87f9 (position == tabs::TabSearchPosition::kLeadingHorizontalTabstrip || position == tabs::TabSearchPosition::kVerticalTabstrip) ? views::BubbleBorder::TOP_LEFT -@@ -221,9 +221,11 @@ bool TabSearchBubbleHost::ShowTabSearchBubble( +@@ -223,9 +223,11 @@ bool TabSearchBubbleHost::ShowTabSearchBubble( // Hold the pressed lock while the |bubble_| is active. // LINT.IfChange(pressed_lock_) diff --git a/patch/patches/chrome_browser_webui_license.patch b/patch/patches/chrome_browser_webui_license.patch index 1b8b39b9d..387b1b156 100644 --- a/patch/patches/chrome_browser_webui_license.patch +++ b/patch/patches/chrome_browser_webui_license.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/webui/about/about_ui.cc chrome/browser/ui/webui/about/about_ui.cc -index 64c2a2bbefcc0362fdb4c97f61c4a9001d427588..6e69af6332d736ef17e193c920e1f7dfedbb947a 100644 +index d9b2b09c16bf47a8fca8b29b0d3b1ae462467894..0d3f2227a1c30ff67168340706e746e29202545b 100644 --- chrome/browser/ui/webui/about/about_ui.cc +++ chrome/browser/ui/webui/about/about_ui.cc -@@ -85,6 +85,10 @@ +@@ -84,6 +84,10 @@ #include "third_party/zlib/google/compression_utils.h" #endif @@ -13,7 +13,7 @@ index 64c2a2bbefcc0362fdb4c97f61c4a9001d427588..6e69af6332d736ef17e193c920e1f7df using content::BrowserThread; namespace { -@@ -432,6 +436,11 @@ AboutUIConfigBase::AboutUIConfigBase(std::string_view host) +@@ -431,6 +435,11 @@ AboutUIConfigBase::AboutUIConfigBase(std::string_view host) CreditsUIConfig::CreditsUIConfig() : AboutUIConfigBase(chrome::kChromeUICreditsHost) {} @@ -25,7 +25,7 @@ index 64c2a2bbefcc0362fdb4c97f61c4a9001d427588..6e69af6332d736ef17e193c920e1f7df #if !BUILDFLAG(IS_ANDROID) TermsUIConfig::TermsUIConfig() : AboutUIConfigBase(chrome::kChromeUITermsHost) {} -@@ -524,6 +533,16 @@ void AboutUIHTMLSource::StartDataRequest( +@@ -523,6 +532,16 @@ void AboutUIHTMLSource::StartDataRequest( IDS_TERMS_HTML); #endif } @@ -69,7 +69,7 @@ index cc7393a05800d80a7dc6a6bc571e77cf5ddda50d..bf5e8e1547f87f72cb18221ab2184fd0 // chrome://terms class TermsUIConfig : public AboutUIConfigBase { diff --git chrome/browser/ui/webui/chrome_web_ui_configs.cc chrome/browser/ui/webui/chrome_web_ui_configs.cc -index a5745248169918e39fa9b33b24e5c227d1d72f65..a6cf02dd5a9632f36310bba72be72689dbca67b8 100644 +index f949b9ea7c142ac6c823333776d7ae0909d2a04f..b4c41c1629892cf818af6d110b0cc8f28168c45d 100644 --- chrome/browser/ui/webui/chrome_web_ui_configs.cc +++ chrome/browser/ui/webui/chrome_web_ui_configs.cc @@ -7,6 +7,7 @@ @@ -78,9 +78,9 @@ index a5745248169918e39fa9b33b24e5c227d1d72f65..a6cf02dd5a9632f36310bba72be72689 #include "build/build_config.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/contextual_tasks/contextual_tasks_ui.h" + #include "chrome/browser/glic/experimental_opt_in/glic_experimental_opt_in_ui.h" #include "chrome/browser/glic/host/glic_ui.h" - #include "chrome/browser/optimization_guide/optimization_guide_internals_ui.h" -@@ -256,6 +257,9 @@ void RegisterChromeWebUIConfigs() { +@@ -255,6 +256,9 @@ void RegisterChromeWebUIConfigs() { map.AddWebUIConfig(std::make_unique()); map.AddWebUIConfig( std::make_unique()); @@ -91,7 +91,7 @@ index a5745248169918e39fa9b33b24e5c227d1d72f65..a6cf02dd5a9632f36310bba72be72689 map.AddWebUIConfig(std::make_unique()); map.AddWebUIConfig(std::make_unique()); diff --git chrome/common/webui_url_constants.cc chrome/common/webui_url_constants.cc -index 3aaa4aaa4b1def46ca009531bb9efb4add8478f3..9b9bb8f6eb4b25115fdf34e369b55754ea19f8ce 100644 +index 9c32ebdbbd83fa0fd545762158e0871750ee661e..eb7c30a73bb7f9911270f611ebbff19418f3e77d 100644 --- chrome/common/webui_url_constants.cc +++ chrome/common/webui_url_constants.cc @@ -147,6 +147,9 @@ base::span ChromeURLHosts() { @@ -105,7 +105,7 @@ index 3aaa4aaa4b1def46ca009531bb9efb4add8478f3..9b9bb8f6eb4b25115fdf34e369b55754 kChromeUIIwaDevHost, #endif diff --git chrome/common/webui_url_constants.h chrome/common/webui_url_constants.h -index bc26ce3751cbcd3aa18897353dd1bd58120f0e0c..5c219271de77ad8fd7457ea74f62f0863d9be401 100644 +index 23b1c1220e2f30f15ffa4a819e6abd2cc4fc1342..676b785b9bb53bd688610a608d89c8901d567f09 100644 --- chrome/common/webui_url_constants.h +++ chrome/common/webui_url_constants.h @@ -18,6 +18,7 @@ @@ -116,7 +116,7 @@ index bc26ce3751cbcd3aa18897353dd1bd58120f0e0c..5c219271de77ad8fd7457ea74f62f086 #include "chrome/common/buildflags.h" #include "components/enterprise/buildflags/buildflags.h" #include "components/signin/public/base/signin_buildflags.h" -@@ -196,6 +197,10 @@ inline constexpr char kChromeUIInternalsHost[] = "internals"; +@@ -199,6 +200,10 @@ inline constexpr char kChromeUIInternalsHost[] = "internals"; inline constexpr char kChromeUIInterstitialHost[] = "interstitials"; inline constexpr char kChromeUIInterstitialURL[] = "chrome://interstitials/"; inline constexpr char kChromeUIIwaDevHost[] = "iwa-dev"; @@ -124,6 +124,6 @@ index bc26ce3751cbcd3aa18897353dd1bd58120f0e0c..5c219271de77ad8fd7457ea74f62f086 +inline constexpr char kChromeUILicenseHost[] = "license"; +inline constexpr char kChromeUILicenseURL[] = "chrome://license/"; +#endif - inline constexpr char kChromeUILocalStateHost[] = "local-state"; - inline constexpr char kChromeUILocalStateURL[] = "chrome://local-state"; - inline constexpr char kChromeUILocationInternalsHost[] = "location-internals"; + inline constexpr char kChromeUILensOverlayHost[] = "lens-overlay"; + inline constexpr char kChromeUILensOverlayUntrustedURL[] = + "chrome-untrusted://lens-overlay/"; diff --git a/patch/patches/chrome_browser_webui_version.patch b/patch/patches/chrome_browser_webui_version.patch index dd8292eae..9a71a3f4d 100644 --- a/patch/patches/chrome_browser_webui_version.patch +++ b/patch/patches/chrome_browser_webui_version.patch @@ -124,7 +124,7 @@ index 7d1beedfffbfdd34323cfb749bec83187b54778e..d4c79e26e51deb9a32fb9649a1c21a18 // Factory for the creating refs in callbacks. base::WeakPtrFactory weak_ptr_factory_{this}; diff --git chrome/browser/ui/webui/version/version_ui.cc chrome/browser/ui/webui/version/version_ui.cc -index 6f1f293bacaefada3d5be117f67cac69fe1f973b..e5d5a777ebe681d17f69feffeebe798a12ba2e0c 100644 +index 4c523d48d8f8537042a9483e4fd0c6d163c8de52..35a8e8de47893687e3a11a762c7101a358b252e0 100644 --- chrome/browser/ui/webui/version/version_ui.cc +++ chrome/browser/ui/webui/version/version_ui.cc @@ -19,6 +19,7 @@ @@ -221,10 +221,10 @@ index 2193019afd18eac09e7812737dc2de3533c2f404..42ec99b0a4673f9ba7c8bbd568a18fa8 + } } diff --git components/webui/version/resources/about_version.css components/webui/version/resources/about_version.css -index 33e926a18ce3c9356a3af5c96e406f720fba31f5..618242cefacb98fa2f00e337c1927f051794a6af 100644 +index 5b7c6b03bf496988401e0b0d961f5beed5067563..b0f9216b789590395edeeba396c552e884cb7812 100644 --- components/webui/version/resources/about_version.css +++ components/webui/version/resources/about_version.css -@@ -131,3 +131,7 @@ body { +@@ -135,3 +135,7 @@ html[webui-rounded-icons] #copy-to-clipboard-icon { position: fixed; width: 1px; } @@ -233,7 +233,7 @@ index 33e926a18ce3c9356a3af5c96e406f720fba31f5..618242cefacb98fa2f00e337c1927f05 + font-size: 0.8em; +} diff --git components/webui/version/resources/about_version.html components/webui/version/resources/about_version.html -index 664cb15bf7ee51115457b8bac2f3dc257b78e304..a4babdffd71b66162abc7a7f2ce972387e54babf 100644 +index 950b0a5c4895e81eb5c7b3e5736a5d5610b32bd9..840c4baf591a40f7b4845a63ae72e5f1bb811ea1 100644 --- components/webui/version/resources/about_version.html +++ components/webui/version/resources/about_version.html @@ -49,9 +49,21 @@ about:version template page diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 4cfbbe300..a17981aa5 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 918ed2c840dbcc494ef859391085033daa9afe56..d72341003508c94fddee4d0ad44d9d3cce7811e1 100644 +index 94d46c0511dfc2c7b6256b3a61d478d1f97063ce..f8e3ed3aae3f4966fe059d8ef01de7162e7405b1 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -3,6 +3,7 @@ @@ -10,7 +10,7 @@ index 918ed2c840dbcc494ef859391085033daa9afe56..d72341003508c94fddee4d0ad44d9d3c import("//chrome/common/features.gni") import("//chrome/common/request_header_integrity/buildflags.gni") import("//components/guest_view/buildflags/buildflags.gni") -@@ -115,6 +116,7 @@ static_library("renderer") { +@@ -127,6 +128,7 @@ static_library("renderer") { ":process_state", "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index 918ed2c840dbcc494ef859391085033daa9afe56..d72341003508c94fddee4d0ad44d9d3c "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -239,6 +241,10 @@ static_library("renderer") { +@@ -250,6 +252,10 @@ static_library("renderer") { ] } diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index b6ee79407..214ee610d 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,5 +1,5 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1acfdd8e8a 100644 +index b8eeec779ce30b20cc550f12cfda599c4604ced3..41df3a233d09e83884c6935b7b16bb51f59cf395 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -38,6 +38,7 @@ @@ -7,26 +7,26 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a #include "base/timer/timer.h" #include "build/build_config.h" +#include "cef/libcef/features/features.h" - #include "chrome/browser/buildflags.h" - #include "chrome/browser/chrome_content_browser_client.h" - #include "chrome/browser/chrome_resource_bundle_helper.h" -@@ -541,6 +542,7 @@ struct MainFunction { - int (*function)(content::MainFunctionParams); + #include "chrome/common/buildflags.h" + #include "chrome/common/channel_info.h" + #include "chrome/common/chrome_constants.h" +@@ -578,6 +579,7 @@ struct MainFunction { }; + #if !defined(BUILDING_CHROME_RENDERER) +#if !BUILDFLAG(ENABLE_CEF) // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { #if BUILDFLAG(IS_WIN) -@@ -631,6 +633,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) { +@@ -723,6 +725,7 @@ void RecordMainStartupMetrics(const StartupTimestamps& timestamps) { - #endif // BUILDFLAG(IS_WIN) + startup_metric_utils::GetCommon().RecordChromeMainEntryTime(now); } +#endif // !BUILDFLAG(ENABLE_CEF) - #if !BUILDFLAG(IS_ANDROID) - void InitLogging(const std::string& process_type) { -@@ -759,6 +762,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { + #if BUILDFLAG(IS_WIN) && !defined(BUILDING_CHROME_RENDERER) + constexpr wchar_t kOnResourceExhaustedMessage[] = +@@ -799,6 +802,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { ChromeMainDelegate::~ChromeMainDelegate() = default; #endif // !BUILDFLAG(IS_ANDROID) @@ -37,7 +37,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a std::optional ChromeMainDelegate::PostEarlyInitialization( InvokedIn invoked_in) { DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get()); -@@ -784,7 +791,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -825,7 +832,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( // future session's metrics. DeferBrowserMetrics(user_data_dir); @@ -46,17 +46,19 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a // 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. -@@ -863,7 +870,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -903,8 +910,9 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( + CommonEarlyInitialization(); // Initializes the resource bundle and determines the locale. - std::string actual_locale = LoadLocalState( +- std::string actual_locale = LoadLocalState( - chrome_feature_list_creator, invoked_in_browser->is_running_test); -+ chrome_feature_list_creator, GetResourceBundleDelegate(), -+ invoked_in_browser->is_running_test); ++ std::string actual_locale = ++ LoadLocalState(chrome_feature_list_creator, GetResourceBundleDelegate(), ++ invoked_in_browser->is_running_test); chrome_feature_list_creator->SetApplicationLocale(actual_locale); #if BUILDFLAG(CHROME_FOR_TESTING) -@@ -886,6 +894,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -927,6 +935,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( new net::NetworkChangeNotifierFactoryAndroid()); #endif @@ -65,7 +67,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a bool record = true; #if BUILDFLAG(IS_ANDROID) record = -@@ -894,6 +904,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -935,6 +945,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( if (record) { chrome_content_browser_client_->startup_data()->RecordCoreSystemProfile(); } @@ -73,7 +75,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a #if BUILDFLAG(IS_ANDROID) UmaSessionStats::OnStartup(); -@@ -959,8 +970,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) { +@@ -1005,8 +1016,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) { std::make_unique()); // `ChromeMainDelegateAndroid::PreSandboxStartup` creates the profiler a little @@ -84,7 +86,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a // Start the sampling profiler as early as possible - namely, once the thread // pool has been created. sampling_profiler_ = std::make_unique(); -@@ -1360,6 +1371,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1425,6 +1436,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -92,15 +94,15 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a crash_reporter::InitializeCrashKeys(); #if BUILDFLAG(IS_POSIX) -@@ -1375,6 +1387,7 @@ void ChromeMainDelegate::PreSandboxStartup() { - if (chrome::ProcessNeedsProfileDir(process_type)) { - InitializeUserDataDir(base::CommandLine::ForCurrentProcess()); - } +@@ -1450,6 +1462,7 @@ void ChromeMainDelegate::PreSandboxStartup() { + // Renderers on Windows never require a profile directory. + CHECK(!chrome::ProcessNeedsProfileDir(process_type)); + #endif // !defined(BUILDING_CHROME_RENDERER) +#endif // !BUILDFLAG(ENABLE_CEF) - // Register component_updater PathProvider after DIR_USER_DATA overridden by - // command line flags. Maybe move the chrome PathProvider down here also? -@@ -1473,7 +1486,8 @@ void ChromeMainDelegate::PreSandboxStartup() { + #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_WIN) + // Android does InitLogging when library is loaded. Skip here. +@@ -1543,7 +1556,8 @@ void ChromeMainDelegate::PreSandboxStartup() { #else const std::string loaded_locale = ui::ResourceBundle::InitSharedInstanceWithLocale( @@ -110,7 +112,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a base::FilePath resources_pack_path; base::PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); -@@ -1483,6 +1497,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1553,6 +1567,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } @@ -118,23 +120,23 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess && -@@ -1519,6 +1534,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1589,6 +1604,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); +#endif // !BUILDFLAG(ENABLE_CEF) - #if BUILDFLAG(ENABLE_PDF) + #if BUILDFLAG(ENABLE_PDF) && !defined(BUILDING_CHROME_RENDERER) MaybePatchGdiGetFontData(); -@@ -1639,6 +1655,7 @@ void ChromeMainDelegate::ZygoteForked() { - SetUpProfilingShutdownHandler(); +@@ -1721,6 +1737,7 @@ void ChromeMainDelegate::ZygoteForked() { } + #endif // !defined(BUILDING_CHROME_RENDERER) +#if !BUILDFLAG(ENABLE_CEF) // 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 = -@@ -1651,6 +1668,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1733,6 +1750,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -142,7 +144,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -1757,6 +1775,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -1859,6 +1877,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { : memory_system::DispatcherParameters:: AllocationTraceRecorderInclusion::kIgnore; @@ -150,7 +152,7 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a memory_system::Initializer() .SetGwpAsanParameters(gwp_asan_boost_sampling, process_type) .SetProfilingClientParameters(chrome::GetChannel(), -@@ -1764,7 +1783,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -1866,7 +1885,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { .SetDispatcherParameters(memory_system::DispatcherParameters:: PoissonAllocationSamplerInclusion::kEnforce, allocation_recorder_inclusion, process_type) @@ -160,10 +162,10 @@ index 45f00944bf1e64c5415c08d83d2f01a6f08c4366..949053154b23b7baa3637632e4557a1a bool ChromeMainDelegate::IsInitFeatureListEarly() { diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h -index 56e0b1ab170977139462869cf7fde3e673532926..51f64425b0514cd357000bde5a3bef77ec86234c 100644 +index 6ea55af3da1c521eae17d32456da7d103d770757..499988f0ef59742c317bade65e00ee8b5d995c2b 100644 --- chrome/app/chrome_main_delegate.h +++ chrome/app/chrome_main_delegate.h -@@ -18,6 +18,7 @@ +@@ -17,6 +17,7 @@ #include "chrome/common/chrome_content_client.h" #include "components/memory_system/memory_system.h" #include "content/public/app/content_main_delegate.h" @@ -171,7 +173,7 @@ index 56e0b1ab170977139462869cf7fde3e673532926..51f64425b0514cd357000bde5a3bef77 namespace base { class CommandLine; -@@ -51,6 +52,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate { +@@ -54,6 +55,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate { ~ChromeMainDelegate() override; @@ -180,7 +182,7 @@ index 56e0b1ab170977139462869cf7fde3e673532926..51f64425b0514cd357000bde5a3bef77 protected: // content::ContentMainDelegate: std::optional BasicStartupComplete() override; -@@ -98,13 +101,17 @@ class ChromeMainDelegate : public content::ContentMainDelegate { +@@ -101,6 +104,10 @@ class ChromeMainDelegate : public content::ContentMainDelegate { bool IsInitFeatureListEarly() override; @@ -188,9 +190,10 @@ index 56e0b1ab170977139462869cf7fde3e673532926..51f64425b0514cd357000bde5a3bef77 + return nullptr; + } + + #if !defined(BUILDING_CHROME_RENDERER) std::unique_ptr chrome_content_browser_client_; std::unique_ptr chrome_content_utility_client_; - std::unique_ptr tracing_sampler_profiler_; +@@ -109,7 +116,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { ChromeContentClient chrome_content_client_; @@ -234,10 +237,10 @@ index 2b3ed5cf2e01569c71e7dd6872b630983956f419..059ffb20f277f8d18b7706f0a71e9fb5 // Initialize features and field trials, either from command line or from diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c4a405fd3 100644 +index 00fe10f55ffb3e0e983812df4c6c99742e2d84bc..4b83420c1bccfafc493cf29f0f924c35611e8be0 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc -@@ -31,6 +31,7 @@ +@@ -30,6 +30,7 @@ #include "base/values.h" #include "build/branding_buildflags.h" #include "build/build_config.h" @@ -245,7 +248,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/browser_features.h" -@@ -529,7 +530,7 @@ void ProcessSingletonNotificationCallbackImpl( +@@ -542,7 +543,7 @@ void ProcessSingletonNotificationCallbackImpl( return; } @@ -254,7 +257,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // The uninstall command-line switch is handled by the origin process; see // ChromeMainDelegate::PostEarlyInitialization(...). The other process won't // be able to become the singleton process and will display a window asking -@@ -1150,7 +1151,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( +@@ -1151,7 +1152,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( browser_process_->local_state()); platform_management_service->RefreshCache(base::NullCallback()); @@ -263,7 +266,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c if (first_run::IsChromeFirstRun()) { bool stats_default; if (GoogleUpdateSettings::GetCollectStatsConsentDefault(&stats_default)) { -@@ -1194,6 +1195,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -1195,6 +1196,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) master_prefs_ = std::make_unique(); @@ -271,7 +274,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c std::unique_ptr installer_initial_prefs = startup_data_->chrome_feature_list_creator()->TakeInitialPrefs(); if (!installer_initial_prefs) { -@@ -1229,6 +1231,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -1230,6 +1232,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { master_prefs_->confirm_to_quit); } #endif @@ -279,7 +282,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) return content::RESULT_CODE_NORMAL_EXIT; } -@@ -1298,6 +1301,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1299,6 +1302,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { browser_process_->browser_policy_connector()->OnResourceBundleCreated(); @@ -287,7 +290,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // Android does first run in Java instead of native. // Chrome OS has its own out-of-box-experience code. #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) -@@ -1308,6 +1312,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1309,6 +1313,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { } } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) @@ -295,7 +298,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c #if BUILDFLAG(ENABLE_EXTENSIONS_CORE) && \ (BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ -@@ -1765,6 +1770,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1775,6 +1780,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->PreMainMessageLoopRun(); #if BUILDFLAG(IS_WIN) @@ -303,7 +306,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // 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)) { -@@ -1776,6 +1782,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1786,6 +1792,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { return ChromeBrowserMainPartsWin::HandleIconsCommands( *base::CommandLine::ForCurrentProcess()); } @@ -311,7 +314,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c ui::SelectFileDialog::SetFactory( std::make_unique()); -@@ -1798,6 +1805,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1808,6 +1815,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif @@ -319,7 +322,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMakeDefaultBrowser)) { bool is_managed = g_browser_process->local_state()->IsManagedPreference( -@@ -1811,13 +1819,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1821,13 +1829,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { ? static_cast(content::RESULT_CODE_NORMAL_EXIT) : static_cast(CHROME_RESULT_CODE_SHELL_INTEGRATION_FAILED); } @@ -335,7 +338,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // We must call DoUpgradeTasks now that we own the browser singleton to // finish upgrade tasks (swap) and relaunch if necessary. if (upgrade_util::DoUpgradeTasks(*base::CommandLine::ForCurrentProcess())) { -@@ -1865,7 +1874,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1875,7 +1884,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif @@ -344,7 +347,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // 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 -@@ -1942,7 +1951,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1952,7 +1961,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Call `PostProfileInit()`and set it up for profiles created later. profile_init_manager_ = std::make_unique(this, profile); @@ -353,7 +356,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // Execute first run specific code after the PrefService has been initialized // and preferences have been registered since some of the import code depends // on preferences. -@@ -1983,7 +1992,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1993,7 +2002,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif @@ -362,7 +365,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // Registers Chrome with the Windows Restart Manager, which will restore the // Chrome session when the computer is restarted after a system update. // This could be run as late as WM_QUERYENDSESSION for system update reboots, -@@ -2093,6 +2102,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -2108,6 +2117,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif @@ -373,7 +376,7 @@ index 21d499a926280890ed38f7a169afa69d7a3263be..5dc387beafd92a2707909aa44f685a7c // This step is costly. if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(), base::FilePath(), profile_info, -@@ -2120,11 +2133,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -2135,11 +2148,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -425,7 +428,7 @@ index b269f1610a55d31aa58beab694fa7cbb214b58d1..d313c11d63e73b061cd4d66949fc8e81 +#endif } diff --git chrome/browser/chrome_browser_main_win.cc chrome/browser/chrome_browser_main_win.cc -index d0083fd565d66e150bb3dd06fc9a2a6360eca9e3..a5792d682a96cd31a9998fd78e6385713bc7b5b7 100644 +index 37b7ad5300599a4de008175c3c535d1ff63c5398..37bb81ae4af81898b7ebadf24ce09c54d47bf8ac 100644 --- chrome/browser/chrome_browser_main_win.cc +++ chrome/browser/chrome_browser_main_win.cc @@ -54,6 +54,7 @@ @@ -436,7 +439,7 @@ index d0083fd565d66e150bb3dd06fc9a2a6360eca9e3..a5792d682a96cd31a9998fd78e638571 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/browser_features.h" -@@ -375,6 +376,7 @@ void UpdatePwaLaunchersForProfile(const base::FilePath& profile_dir) { +@@ -374,6 +375,7 @@ void UpdatePwaLaunchersForProfile(const base::FilePath& profile_dir) { } void MigratePinnedTaskBarShortcutsIfNeeded() { @@ -444,7 +447,7 @@ index d0083fd565d66e150bb3dd06fc9a2a6360eca9e3..a5792d682a96cd31a9998fd78e638571 // Update this number when users should go through a taskbar shortcut // migration again. The last reason to do this was crrev.com/798174. @ // 86.0.4231.0. -@@ -395,6 +397,7 @@ void MigratePinnedTaskBarShortcutsIfNeeded() { +@@ -394,6 +396,7 @@ void MigratePinnedTaskBarShortcutsIfNeeded() { prefs::kShortcutMigrationVersion, version_info::GetVersionNumber())); } } @@ -453,7 +456,7 @@ index d0083fd565d66e150bb3dd06fc9a2a6360eca9e3..a5792d682a96cd31a9998fd78e638571 void MaybeBlockDynamicCodeForBrowserProcess() { diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706475670dd 100644 +index 92e1a5aa484bad30fb93a3ec82ac4b8a599daf4f..4991214e91fe84c38052ac9c986dd5d14b1499c9 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -55,6 +55,7 @@ @@ -461,10 +464,10 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 #include "build/build_config.h" #include "build/config/chromebox_for_meetings/buildflags.h" // PLATFORM_CFM +#include "cef/libcef/features/features.h" + #include "chrome/browser/accessibility/caption_settings_dialog.h" + #include "chrome/browser/actor/actor_commit_deferring_condition.h" #include "chrome/browser/after_startup_task_utils.h" - #include "chrome/browser/ai/ai_manager.h" - #include "chrome/browser/app_mode/app_mode_utils.h" -@@ -1519,6 +1520,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { +@@ -1523,6 +1524,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { } ChromeContentBrowserClient::ChromeContentBrowserClient() { @@ -473,7 +476,7 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 #if BUILDFLAG(ENABLE_PLUGINS) extra_parts_.push_back( std::make_unique()); -@@ -1559,6 +1562,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { +@@ -1563,6 +1566,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { } } @@ -485,7 +488,7 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 // static void ChromeContentBrowserClient::RegisterLocalStatePrefs( PrefRegistrySimple* registry) { -@@ -5107,9 +5115,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -5014,9 +5022,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // BUILDFLAG(IS_ANDROID) @@ -497,8 +500,8 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -@@ -6928,7 +6938,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( - } +@@ -6889,7 +6899,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( + local_state); } -void ChromeContentBrowserClient::ConfigureNetworkContextParams( @@ -506,7 +509,7 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -6946,6 +6956,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( +@@ -6907,6 +6917,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( network_context_params->user_agent = GetUserAgent(); network_context_params->accept_language = GetApplicationLocale(); } @@ -515,7 +518,7 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 } std::vector -@@ -8286,11 +8298,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( +@@ -8241,11 +8253,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( const auto now = base::TimeTicks::Now(); const auto timeout = GetKeepaliveTimerTimeout(context); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); @@ -529,17 +532,18 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 FROM_HERE, keepalive_deadline_ - now, base::BindOnce( &ChromeContentBrowserClient::OnKeepaliveTimerFired, -@@ -8312,7 +8324,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { +@@ -8267,7 +8279,9 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { --num_keepalive_requests_; if (num_keepalive_requests_ == 0) { DVLOG(1) << "Stopping the keepalive timer"; - keepalive_timer_.Stop(); -+ if (keepalive_timer_) ++ if (keepalive_timer_) { + keepalive_timer_->Stop(); ++ } // This deletes the keep alive handle attached to the timer function and // unblock the shutdown sequence. } -@@ -8485,7 +8498,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( +@@ -8475,7 +8489,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( const auto now = base::TimeTicks::Now(); const auto then = keepalive_deadline_; if (now < then) { @@ -549,10 +553,10 @@ index a5579e31041d57b61b40a3ddc67049c494dad0dd..a5cdd324b39ffcf0c8ce30229ed6a706 base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, weak_factory_.GetWeakPtr(), diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index d01f3f13b3d9ea8bd0df517c7e3d66c31cb9029c..0d1a643d0d5d430d77aa621dae780976cd8e635e 100644 +index 2ea677f146e3d286fb040b9984f0a4cb6a9e575f..211eeab755d93ab35c70cdc9d5e0199c978174c8 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -159,6 +159,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -166,6 +166,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { ~ChromeContentBrowserClient() override; @@ -570,17 +574,17 @@ index d01f3f13b3d9ea8bd0df517c7e3d66c31cb9029c..0d1a643d0d5d430d77aa621dae780976 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1402,7 +1404,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -1395,7 +1397,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if !BUILDFLAG(IS_ANDROID) uint64_t num_keepalive_requests_ = 0; - base::OneShotTimer keepalive_timer_; + std::unique_ptr keepalive_timer_; base::TimeTicks keepalive_deadline_; - #endif + // Keeps the browser process and relevant profiles alive while browser-side diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 4d699136360fea94fdbea644120b86e32300f26b..8aa9251b1efd49e72c9e993e5e70b2a18d257e21 100644 +index 1b5fcc030f2fd98404a4a6f56efbf82abc3153b8..819dec7e3ec8e1c9f563da597591705360078692 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -18,6 +18,7 @@ @@ -591,7 +595,7 @@ index 4d699136360fea94fdbea644120b86e32300f26b..8aa9251b1efd49e72c9e993e5e70b2a1 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/invert_bubble_prefs.h" -@@ -257,6 +258,10 @@ +@@ -262,6 +263,10 @@ #include "extensions/browser/pref_names.h" #endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE) @@ -601,8 +605,8 @@ index 4d699136360fea94fdbea644120b86e32300f26b..8aa9251b1efd49e72c9e993e5e70b2a1 + #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" - #include "chrome/browser/ui/extensions/extension_settings_overridden_dialog.h" -@@ -1731,6 +1736,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { + #include "extensions/browser/api/audio/audio_api.h" +@@ -1787,6 +1792,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); @@ -614,7 +618,7 @@ index 4d699136360fea94fdbea644120b86e32300f26b..8aa9251b1efd49e72c9e993e5e70b2a1 } // Register prefs applicable to all profiles. -@@ -2267,6 +2277,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -2332,6 +2342,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 f93ee910d..b1ee3be6f 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,16 +1,40 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index 2d86241e3519e52c3fc82ed0d8429b3a20651033..3f195b663ec7efbe6e12846ba564e01d26d54a9d 100644 +index e366925102783c4ec00f5ef2366b694b30b9eee9..64d398146853a6d0337a872b7dc0684165d1f85d 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc -@@ -620,6 +620,7 @@ bool BrowserCommandController::ExecuteCommandWithDispositionImpl( - base::TimeTicks time_stamp, - std::optional context) { +@@ -188,6 +188,10 @@ + #include "chrome/browser/ui/shortcuts/desktop_shortcuts_utils.h" + #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) + ++#if BUILDFLAG(ENABLE_CEF) ++#include "cef/libcef/browser/chrome/browser_util.h" ++#endif ++ + static_assert(BUILDFLAG(ENABLE_EXTENSIONS)); + + using Extension = extensions::Extension; +@@ -543,6 +547,12 @@ void BrowserCommandController::ContentRestrictionsChanged() { + + void BrowserCommandController::FullscreenStateChanged() { + UpdateCommandsForFullscreenMode(); ++ ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_->cef_delegate()) { ++ browser_->cef_delegate()->WindowFullscreenStateChanged(); ++ } ++#endif + } + + #if BUILDFLAG(IS_CHROMEOS) +@@ -634,6 +644,7 @@ bool BrowserCommandController::ExecuteCommandWithDispositionAndContext( + std::optional context, + base::TimeTicks time_stamp) { if (!SupportsCommand(id) || !IsCommandEnabled(id)) { + LOG(WARNING) << "Invalid/disabled command " << id; return false; } -@@ -650,6 +651,13 @@ void BrowserCommandController::HandleCommandWithDisposition( +@@ -660,6 +671,13 @@ void BrowserCommandController::HandleCommandWithDisposition( base::TimeTicks time_stamp) { DCHECK(IsCommandEnabled(id)) << "Invalid/disabled command " << id; @@ -24,28 +48,28 @@ index 2d86241e3519e52c3fc82ed0d8429b3a20651033..3f195b663ec7efbe6e12846ba564e01d // The order of commands in this switch statement must match the function // declaration order in browser.h! switch (id) { -@@ -1684,12 +1692,14 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -1702,12 +1720,14 @@ void BrowserCommandController::TabRestoreServiceLoaded( bool BrowserCommandController::IsShowingMainUI() { - return browser_->SupportsWindowFeature( -- Browser::WindowFeature::kFeatureTabStrip); -+ Browser::WindowFeature::kFeatureTabStrip) || -+ browser_->toolbar_overridden(); + return WindowFeatureController::From(browser_)->SupportsWindowFeature( +- WindowFeatureController::WindowFeature::kFeatureTabStrip); ++ WindowFeatureController::WindowFeature::kFeatureTabStrip) || ++ cef::BrowserForBWI(browser_)->toolbar_overridden(); } bool BrowserCommandController::IsShowingLocationBar() { - return browser_->SupportsWindowFeature( -- Browser::WindowFeature::kFeatureLocationBar); -+ Browser::WindowFeature::kFeatureLocationBar) || -+ browser_->toolbar_overridden(); + return WindowFeatureController::From(browser_)->SupportsWindowFeature( +- WindowFeatureController::WindowFeature::kFeatureLocationBar); ++ WindowFeatureController::WindowFeature::kFeatureLocationBar) || ++ cef::BrowserForBWI(browser_)->toolbar_overridden(); } void BrowserCommandController::InitCommandState() { diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc -index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f4ea0d432 100644 +index 45cd05f34337285d387d617a160c84bc32904fd1..2a5b8dfd7036a568503b588e27801d8d21ded256 100644 --- chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc -@@ -912,18 +912,20 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel( +@@ -934,18 +934,20 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel( AddItemWithStringIdAndVectorIcon( this, IDC_FIND, IDS_FIND, features::IsRoundedIconsEnabled() ? kFindInPageIcon : kSearchMenuOldIcon); @@ -78,7 +102,7 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f } class SaveAndShareSubMenuModel : public ui::SimpleMenuModel { -@@ -1065,6 +1067,57 @@ bool ArePromotionsEnabled() { +@@ -1087,6 +1089,57 @@ bool ArePromotionsEnabled() { return local_state && local_state->GetBoolean(prefs::kPromotionsEnabled); } @@ -136,7 +160,7 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f } // namespace //////////////////////////////////////////////////////////////////////////////// -@@ -2100,7 +2153,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { +@@ -2132,7 +2185,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { return false; } @@ -145,7 +169,7 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f GlobalError* error = GlobalErrorServiceFactory::GetForProfile(browser_->GetProfile()) ->GetGlobalErrorByMenuItemCommandID(command_id); -@@ -2116,6 +2169,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { +@@ -2148,6 +2201,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { } } @@ -176,7 +200,7 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f bool AppMenuModel::IsCommandIdAlerted(int command_id) const { if (command_id == IDC_VIEW_PASSWORDS || command_id == IDC_SHOW_PASSWORD_MANAGER) { -@@ -2302,8 +2379,10 @@ void AppMenuModel::Build() { +@@ -2373,8 +2450,10 @@ void AppMenuModel::Build() { SetElementIdentifierAt(GetIndexOfCommandId(IDC_CLEAR_BROWSING_DATA).value(), kClearBrowsingDataMenuItem); @@ -189,7 +213,7 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f AddSeparator(ui::NORMAL_SEPARATOR); AddItemWithStringIdAndVectorIcon( -@@ -2441,6 +2520,11 @@ void AppMenuModel::Build() { +@@ -2512,6 +2591,11 @@ void AppMenuModel::Build() { } #endif // !BUILDFLAG(IS_CHROMEOS) @@ -202,10 +226,10 @@ index 4aef7d5a7cf207d1f42848b7070a11c4f63773a0..134a4c0571c5c29201102471a43ae61f } diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h -index 4e81edc2c67425cbab6ed0b00a80157287d64e7d..8e92d6c750426d3946188e6d9b9bf7e1169dbf81 100644 +index ed3f1fa50b5887ae407c928715bf3ff68d1a156c..30a9d221bfe22b71b239da72ee576e55c1707b76 100644 --- chrome/browser/ui/toolbar/app_menu_model.h +++ chrome/browser/ui/toolbar/app_menu_model.h -@@ -280,6 +280,7 @@ class AppMenuModel : public ui::SimpleMenuModel, +@@ -283,6 +283,7 @@ class AppMenuModel : public ui::SimpleMenuModel, void ExecuteCommand(int command_id, int event_flags) override; bool IsCommandIdChecked(int command_id) const override; bool IsCommandIdEnabled(int command_id) const override; @@ -213,7 +237,7 @@ index 4e81edc2c67425cbab6ed0b00a80157287d64e7d..8e92d6c750426d3946188e6d9b9bf7e1 bool IsCommandIdAlerted(int command_id) const override; bool GetAcceleratorForCommandId(int command_id, ui::Accelerator* accelerator) const override; -@@ -319,6 +320,8 @@ class AppMenuModel : public ui::SimpleMenuModel, +@@ -322,6 +323,8 @@ class AppMenuModel : public ui::SimpleMenuModel, void LogSafetyHubInteractionMetrics(safety_hub::SafetyHubModuleType sh_module, int event_flags); @@ -223,16 +247,27 @@ index 4e81edc2c67425cbab6ed0b00a80157287d64e7d..8e92d6c750426d3946188e6d9b9bf7e1 // Adds actionable global error menu items to the menu. // Examples: Extension permissions and sign in errors. diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f5a9c687c 100644 +index 24eca1ab9a2ab4b2cbf533e59bf290d8309ba898..4f405cfa2f2fd33ac6797801c6f81af311e19523 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -879,11 +879,21 @@ class BrowserView::PipExclusionObserverImpl +@@ -411,6 +411,10 @@ + #undef LoadAccelerators + #endif + ++#if BUILDFLAG(ENABLE_CEF) ++#include "cef/libcef/browser/chrome/browser_util.h" ++#endif ++ + using base::UserMetricsAction; + using content::WebContents; + using input::NativeWebKeyboardEvent; +@@ -882,11 +886,21 @@ class BrowserView::PipExclusionObserverImpl /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: +BrowserView::BrowserView() : BrowserView(nullptr) {} + - BrowserView::BrowserView(Browser* browser) + BrowserView::BrowserView(BrowserWindowInterface* browser) : views::ClientView(nullptr, nullptr), exclusive_access_context_( - std::make_unique(*this)), @@ -243,14 +278,14 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f + } +} + -+void BrowserView::InitBrowser(Browser* browser) { ++void BrowserView::InitBrowser(BrowserWindowInterface* browser) { + DCHECK(!browser_); + browser_ = browser; + if (auto* manager = InitialWebUIWindowMetricsManager::From(browser_.get())) { manager->OnBrowserWindowCreated(); } -@@ -902,7 +912,8 @@ BrowserView::BrowserView(Browser* browser) +@@ -905,7 +919,8 @@ BrowserView::BrowserView(BrowserWindowInterface* browser) SetCanMinimize(false); SetCanMaximize(false); SetCanFullscreen(false); @@ -260,7 +295,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f } else { SetCanResize( BrowserInitState::From(&*browser_)->create_params().can_resize); -@@ -926,8 +937,15 @@ BrowserView::BrowserView(Browser* browser) +@@ -929,8 +944,16 @@ BrowserView::BrowserView(BrowserWindowInterface* browser) top_container_ = AddChildView(std::make_unique(this)); top_container_insertion_index_ = GetIndexOf(top_container_.get()); @@ -270,15 +305,16 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f + if (!toolbar_) { + toolbar_ = new ToolbarView(browser_.get(), this, std::nullopt); + } else { -+ browser_->set_toolbar_overridden(true); ++ cef::BrowserForBWI(browser_.get())->set_toolbar_overridden(true); + // Update state that depends on the above flag. -+ browser_->command_controller()->FullscreenStateChanged(); ++ chrome::BrowserCommandController::From(browser_.get()) ++ ->FullscreenStateChanged(); + } + top_container_->AddChildView(base::WrapUnique(toolbar_.get())); top_container_separator_ = top_container_->AddChildView( ContentsSeparator::CreateContentsSeparator()); -@@ -1092,6 +1110,10 @@ BrowserView::BrowserView(Browser* browser) +@@ -1093,6 +1116,10 @@ BrowserView::BrowserView(BrowserWindowInterface* browser) } BrowserView::~BrowserView() { @@ -289,28 +325,28 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f // Remove the layout manager to avoid dangling. This needs to be earlier than // other cleanups that destroy views referenced in the layout manager. SetLayoutManager(nullptr); -@@ -1104,7 +1126,9 @@ BrowserView::~BrowserView() { +@@ -1105,7 +1132,9 @@ BrowserView::~BrowserView() { // All the tabs should have been destroyed already. If we were closed by the // OS with some tabs than the BrowserNativeWidget should have destroyed them. -- DCHECK_EQ(0, browser_->tab_strip_model()->count()); +- DCHECK_EQ(0, browser_->GetTabStripModel()->count()); + if (browser_) { -+ DCHECK_EQ(0, browser_->tab_strip_model()->count()); ++ DCHECK_EQ(0, browser_->GetTabStripModel()->count()); + } // Stop the animation timer explicitly here to avoid running it in a nested // message loop, which may run by Browser destructor. -@@ -1196,7 +1220,7 @@ void BrowserView::SetDisableRevealerDelayForTesting(bool disable) { +@@ -1204,7 +1233,7 @@ void BrowserView::SetDisableRevealerDelayForTesting(bool disable) { g_disable_revealer_delay_for_testing = disable; } -gfx::Rect BrowserView::GetFindBarBoundingBox() const { +gfx::Rect BrowserView::GetFindBarBoundingBoxImpl() const { - gfx::Rect contents_bounds = contents_container_->ConvertRectToWidget( - contents_container_->GetLocalBounds()); + gfx::Rect contents_bounds = multi_contents_view_->ConvertRectToWidget( + multi_contents_view_->GetLocalBounds()); -@@ -1218,6 +1242,16 @@ gfx::Rect BrowserView::GetFindBarBoundingBox() const { - return contents_container_->GetMirroredRect(contents_bounds); +@@ -1226,6 +1255,16 @@ gfx::Rect BrowserView::GetFindBarBoundingBox() const { + return multi_contents_view_->GetMirroredRect(contents_bounds); } +gfx::Rect BrowserView::GetFindBarBoundingBox() const { @@ -326,7 +362,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f ClientFrameElementInfo BrowserView::GetFrameElementInfo() const { // We want to return tabstrip_->height(), but we might be called in the midst // of layout, when that hasn't yet been updated to reflect the current state. -@@ -1918,6 +1952,27 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const { +@@ -1955,6 +1994,27 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const { ThemeProperties::kFrameHeightAboveTabs - browser_view_origin.y()); } @@ -354,7 +390,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f bool BrowserView::IsLoadingAnimationRunning() const { return !loading_animation_start_.is_null(); } -@@ -3090,6 +3145,9 @@ ShowTranslateBubbleResult BrowserView::ShowTranslateBubble( +@@ -3154,6 +3214,9 @@ ShowTranslateBubbleResult BrowserView::ShowTranslateBubble( DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() { #if !BUILDFLAG(IS_CHROMEOS) @@ -364,7 +400,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f if (auto* download_controller = DownloadToolbarUIController::From(browser_.get())) { return download_controller->bubble_controller(); -@@ -4006,7 +4064,10 @@ bool BrowserView::GetSavedWindowPlacement( +@@ -4072,7 +4135,10 @@ bool BrowserView::GetSavedWindowPlacement( } views::View* BrowserView::GetContentsView() { @@ -376,7 +412,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f } views::ClientView* BrowserView::CreateClientView(views::Widget* widget) { -@@ -4173,9 +4234,22 @@ void BrowserView::DeleteBrowserWindow() { +@@ -4238,9 +4304,22 @@ void BrowserView::DeleteBrowserWindow() { // before the frame is destroyed to mitigate UAF risk. browser_widget_->SaveWindowPlacementIfNeeded(); @@ -402,14 +438,16 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f } void BrowserView::SetForceShowBookmarkBarFlag( -@@ -4436,12 +4510,37 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { +@@ -4501,12 +4580,39 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { bool BrowserView::ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) { +#if BUILDFLAG(ENABLE_CEF) -+ const bool frameless_pip = GetIsPictureInPictureType() && -+ !browser_->SupportsWindowFeature( -+ Browser::WindowFeature::kFeatureTitleBar); ++ const bool frameless_pip = ++ GetIsPictureInPictureType() && ++ !WindowFeatureController::From(browser_.get()) ++ ->SupportsWindowFeature( ++ WindowFeatureController::WindowFeature::kFeatureTitleBar); + if (frameless_pip) { + int result = GetFrameView()->NonClientHitTest(location); + if (result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT) { @@ -442,7 +480,7 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f // Draggable regions are defined relative to the web contents. gfx::Point point_in_contents_web_view_coords(location); views::View::ConvertPointToTarget(GetWidget()->GetRootView(), -@@ -4450,9 +4549,8 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( +@@ -4515,9 +4621,8 @@ 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. @@ -454,45 +492,49 @@ index bdb55a359f67379628153c2e0fbc0239137f4d31..da7e22031b84100b27486812b8ba9b4f WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords); } -@@ -4750,7 +4848,8 @@ void BrowserView::Layout(PassKey) { +@@ -4838,7 +4943,9 @@ void BrowserView::Layout(PassKey) { LayoutSuperclass(this); // TODO(jamescook): Why was this in the middle of layout code? - toolbar_->location_bar()->UpdateFocusBehavior(IsToolbarVisible()); -+ toolbar_->location_bar()->UpdateFocusBehavior(IsToolbarVisible() || -+ browser_->toolbar_overridden()); ++ toolbar_->location_bar()->UpdateFocusBehavior( ++ IsToolbarVisible() || ++ cef::BrowserForBWI(browser_.get())->toolbar_overridden()); GetFrameView()->UpdateMinimumSize(); if (omnibox::IsWebUIOmniboxInBrowserViewEnabled()) { -@@ -5022,6 +5121,13 @@ void BrowserView::AddedToWidget() { - dialog_anchor_ = std::make_unique( - kBrowserDialogAnchorElementId, *this); +@@ -5127,6 +5234,16 @@ void BrowserView::AddedToWidget() { + fallback_popup_anchor_ = std::make_unique( + kFallbackPopupAnchorElementId, *this); + if (browser_->GetWindow()) { + // Initialize the browser features that rely on the browser window now that + // it is initialized. This will instead be called from the Browser + // constructor for default Chrome UI windows. -+ browser_->GetFeatures().InitPostWindowConstruction(browser_.get()); ++ // TODO(cef): Remove BrowserForBWI cast once InitPostWindowConstruction ++ // takes BrowserWindowInterface* (upstream change pending). ++ browser_->GetFeatures().InitPostWindowConstruction( ++ cef::BrowserForBWI(browser_.get())); + } + initialized_ = true; } diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 70e811360e59bda4a97eb353cc4310764728b3d2..2df91594ac1c237d2ab27a0c78916d39c7606cb7 100644 +index 38dae976bf310759751a0a42880317717acdcfcf..919aa21dc0e68a7cfcb7b16be4cc76e7b1002c4e 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -152,7 +152,9 @@ class BrowserView : public BrowserWindow, +@@ -145,7 +145,9 @@ class BrowserView : public BrowserWindow, // locate this object using just the handle. static constexpr char kBrowserViewKey[] = "__BROWSER_VIEW__"; + BrowserView(); - explicit BrowserView(Browser* browser); -+ void InitBrowser(Browser* browser); + explicit BrowserView(BrowserWindowInterface* browser); ++ void InitBrowser(BrowserWindowInterface* browser); BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; -@@ -816,10 +818,16 @@ class BrowserView : public BrowserWindow, +@@ -802,10 +804,16 @@ class BrowserView : public BrowserWindow, bool IsLockedFullscreen() const; #endif @@ -510,7 +552,7 @@ index 70e811360e59bda4a97eb353cc4310764728b3d2..2df91594ac1c237d2ab27a0c78916d39 private: // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. -@@ -1088,11 +1096,13 @@ class BrowserView : public BrowserWindow, +@@ -1074,11 +1082,13 @@ class BrowserView : public BrowserWindow, class ExclusiveAccessContextImpl; std::unique_ptr exclusive_access_context_; @@ -519,17 +561,17 @@ index 70e811360e59bda4a97eb353cc4310764728b3d2..2df91594ac1c237d2ab27a0c78916d39 // The BrowserWidget that owns this view. std::unique_ptr browser_widget_; - // The owning Browser object. `browser_` will outlive this. -- const raw_ptr browser_; -+ raw_ptr browser_; + // The owning BrowserWindowInterface object. `browser_` will outlive this. +- const raw_ptr browser_; ++ raw_ptr browser_; base::CallbackListSubscription chip_visibility_subscription_; diff --git chrome/browser/ui/views/frame/browser_widget.cc chrome/browser/ui/views/frame/browser_widget.cc -index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffecce226b5 100644 +index 7482e34aa43f98206b44355957b32e76104ffa51..86f8a09a68bcbcfc1584c1b46b3fb10d2b367f3a 100644 --- chrome/browser/ui/views/frame/browser_widget.cc +++ chrome/browser/ui/views/frame/browser_widget.cc -@@ -98,13 +98,26 @@ bool IsUsingLinuxSystemTheme(Profile* profile) { +@@ -99,13 +99,26 @@ bool IsUsingLinuxSystemTheme(Profile* profile) { //////////////////////////////////////////////////////////////////////////////// // BrowserWidget, public: @@ -557,7 +599,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe } BrowserWidget::~BrowserWidget() { -@@ -125,7 +138,11 @@ BrowserWidget::~BrowserWidget() { +@@ -126,7 +139,11 @@ BrowserWidget::~BrowserWidget() { // Do this here and not in ~BrowserView() as BrowserWindowFeatures may attempt // to read state on the BrowserWidget as they undergo destruction, and // BrowserWidget state is destroyed at the end of this scope. @@ -570,7 +612,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe } void BrowserWidget::InitBrowserWidget() { -@@ -235,6 +252,8 @@ void BrowserWidget::GetWindowPlacement( +@@ -251,6 +268,8 @@ void BrowserWidget::GetWindowPlacement( ui::mojom::WindowShowState* show_state) const { if (browser_native_widget_) { browser_native_widget_->GetWindowPlacement(bounds, show_state); @@ -579,7 +621,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe } } -@@ -346,6 +365,9 @@ ui::ColorProviderKey::ThemeInitializerSupplier* BrowserWidget::GetCustomTheme() +@@ -383,6 +402,9 @@ ui::ColorProviderKey::ThemeInitializerSupplier* BrowserWidget::GetCustomTheme() } void BrowserWidget::OnNativeWidgetWorkspaceChanged() { @@ -589,7 +631,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(), IsVisibleOnAllWorkspaces()); -@@ -502,6 +524,13 @@ void BrowserWidget::SelectNativeTheme() { +@@ -548,6 +570,13 @@ void BrowserWidget::SelectNativeTheme() { return; } @@ -603,7 +645,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe // Ignore the system theme for web apps with window-controls-overlay as the // display_override so the web contents can blend with the overlay by using // the developer-provided theme color for a better experience. Context: -@@ -516,17 +545,23 @@ void BrowserWidget::SelectNativeTheme() { +@@ -562,17 +591,23 @@ void BrowserWidget::SelectNativeTheme() { } void BrowserWidget::OnTouchUiChanged() { @@ -638,7 +680,7 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe } GetRootView()->InvalidateLayout(); } -@@ -567,5 +602,8 @@ bool BrowserWidget::RegenerateFrameOnThemeChange( +@@ -611,6 +646,9 @@ bool BrowserWidget::RegenerateFrameOnThemeChange( } bool BrowserWidget::IsIncognitoBrowser() const { @@ -647,8 +689,9 @@ index 22318133c1b29915317701775e207f1e672b0052..c3a3429188161f364d67fb7861849ffe + } return browser_view_->browser()->GetProfile()->IsIncognitoProfile(); } + diff --git chrome/browser/ui/views/frame/browser_widget.h chrome/browser/ui/views/frame/browser_widget.h -index 470e63b9352a1641cab22f416810eec7cbc03ad9..9c22ace412038b437160bd691c395decba9b94e0 100644 +index d384a2c99a1c1d8f160de20ea8518a6a4cc5ab71..39937dca7434763b3baa82600c7c9e73a6c01573 100644 --- chrome/browser/ui/views/frame/browser_widget.h +++ chrome/browser/ui/views/frame/browser_widget.h @@ -58,6 +58,7 @@ enum class TabDragKind { @@ -668,7 +711,7 @@ index 470e63b9352a1641cab22f416810eec7cbc03ad9..9c22ace412038b437160bd691c395dec // views::Widget: views::internal::RootView* CreateRootView() override; -@@ -132,22 +133,27 @@ class BrowserWidget : public views::Widget, +@@ -132,11 +133,21 @@ class BrowserWidget : public views::Widget, void SetTabDragKind(TabDragKind tab_drag_kind); TabDragKind tab_drag_kind() const { return tab_drag_kind_; } @@ -688,8 +731,9 @@ index 470e63b9352a1641cab22f416810eec7cbc03ad9..9c22ace412038b437160bd691c395dec + void SelectNativeTheme(); + private: - void OnTouchUiChanged(); + const ui::ThemeProvider* GetBaseThemeProvider() const; +@@ -146,11 +157,6 @@ class BrowserWidget : public views::Widget, // Callback for MenuRunner. void OnMenuClosed(); @@ -702,10 +746,10 @@ index 470e63b9352a1641cab22f416810eec7cbc03ad9..9c22ace412038b437160bd691c395dec // regenerated. bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type); diff --git chrome/browser/ui/views/frame/layout/browser_view_layout.cc chrome/browser/ui/views/frame/layout/browser_view_layout.cc -index e4f5e871f4e6bd09e1dbb55d0cfdf97bf28a3da8..0667179fa0e0da485f5011cce03eaf764b3b7c68 100644 +index 778997a0f1aec1982a2421bb18faf5918347af51..9f7f99605e186c11220b9f6d6787e1818b173379 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout.cc +++ chrome/browser/ui/views/frame/layout/browser_view_layout.cc -@@ -23,6 +23,10 @@ +@@ -24,6 +24,10 @@ #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h" @@ -716,7 +760,7 @@ index e4f5e871f4e6bd09e1dbb55d0cfdf97bf28a3da8..0667179fa0e0da485f5011cce03eaf76 using web_modal::ModalDialogHostObserver; using web_modal::WebContentsModalDialogHost; -@@ -65,6 +69,8 @@ class BrowserViewLayout::BrowserModalDialogHostViews +@@ -66,6 +70,8 @@ class BrowserViewLayout::BrowserModalDialogHostViews observer_list_.Notify(&ModalDialogHostObserver::OnHostDestroying); } @@ -725,7 +769,7 @@ index e4f5e871f4e6bd09e1dbb55d0cfdf97bf28a3da8..0667179fa0e0da485f5011cce03eaf76 void NotifyPositionRequiresUpdate() override { observer_list_.Notify(&ModalDialogHostObserver::OnPositionRequiresUpdate); } -@@ -213,18 +219,21 @@ void BrowserViewLayout::UpdateBubbles() { +@@ -221,18 +227,21 @@ void BrowserViewLayout::UpdateBubbles() { exclusive_access_bubble->RepositionIfVisible(); } @@ -760,10 +804,10 @@ index e4f5e871f4e6bd09e1dbb55d0cfdf97bf28a3da8..0667179fa0e0da485f5011cce03eaf76 } diff --git chrome/browser/ui/views/frame/layout/browser_view_layout.h chrome/browser/ui/views/frame/layout/browser_view_layout.h -index 8145f86c2a17f0017ab4715a7dbb6eab84a893d0..53ee853d02285764bd154a4e85071a260239aafc 100644 +index 04ce33b996df2279123d26d474a371c6de735ca3..8d6b958120ca7a6391901d4002356fd7ed8b1341 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout.h +++ chrome/browser/ui/views/frame/layout/browser_view_layout.h -@@ -134,6 +134,8 @@ class BrowserViewLayout : public views::LayoutManager { +@@ -136,6 +136,8 @@ class BrowserViewLayout : public views::LayoutManager { return views_.side_panel_animation_content; } @@ -773,10 +817,10 @@ index 8145f86c2a17f0017ab4715a7dbb6eab84a893d0..53ee853d02285764bd154a4e85071a26 gfx::Size GetPreferredSize( const views::View* host, diff --git chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h -index 98c865a4c62234475fd15346e5677901193efcd8..d87cedf33b33be08ddb9f1ed18e4bb9ec4bee718 100644 +index 1ee5f63dd6806e2701002c550e423f90a071f422..68969c512a8b4be6e14fb0f6c7d3ce9929132618 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h +++ chrome/browser/ui/views/frame/layout/browser_view_layout_delegate.h -@@ -40,6 +40,7 @@ class BrowserViewLayoutDelegate { +@@ -43,6 +43,7 @@ class BrowserViewLayoutDelegate { bool use_browser_bounds) const = 0; virtual WindowState GetBrowserWindowState() const = 0; virtual views::LayoutAlignment GetWindowTitleAlignment() const = 0; @@ -785,10 +829,10 @@ index 98c865a4c62234475fd15346e5677901193efcd8..d87cedf33b33be08ddb9f1ed18e4bb9e virtual bool IsBookmarkBarVisible() const = 0; virtual bool IsInfobarVisible() const = 0; diff --git chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.cc chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.cc -index 6a49065d92c89f7ba7795e65e107ce37501b2298..ea06e81ad9ae507695d6bf001cc5c5bdf5738594 100644 +index e51647c429151fd07b32102fa5e9423967cdec16..6eb5bfa261907cec3077ac18e87fde69bf817981 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.cc +++ chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.cc -@@ -117,6 +117,15 @@ views::LayoutAlignment BrowserViewLayoutDelegateImpl::GetWindowTitleAlignment() +@@ -131,6 +131,15 @@ views::LayoutAlignment BrowserViewLayoutDelegateImpl::GetWindowTitleAlignment() return GetFrameView()->GetWindowTitleAlignment(); } @@ -805,7 +849,7 @@ index 6a49065d92c89f7ba7795e65e107ce37501b2298..ea06e81ad9ae507695d6bf001cc5c5bd return browser_view_->IsToolbarVisible(); } diff --git chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.h chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.h -index 3939d20258349cdb9fa076965c8c04902ce4f7de..791f8c1788300ac5c35a615b922bede0202cd431 100644 +index 0340813d5e0834af5b1ae1af4f02ab04dea77d64..a1a9fb235433e553bffbd4ac31cef271149bd2ee 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.h +++ chrome/browser/ui/views/frame/layout/browser_view_layout_delegate_impl.h @@ -31,6 +31,7 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { @@ -817,10 +861,10 @@ index 3939d20258349cdb9fa076965c8c04902ce4f7de..791f8c1788300ac5c35a615b922bede0 bool IsBookmarkBarVisible() const override; bool IsInfobarVisible() const override; diff --git chrome/browser/ui/views/frame/layout/browser_view_layout_impl.cc chrome/browser/ui/views/frame/layout/browser_view_layout_impl.cc -index f789176b17af199b65e2e650f130de0bba41bcd2..f57fe7b1a434e68329869bc8b308dfbcd7b19f2c 100644 +index 32dc2739b9e326625d5dbcb7d18623c147e8209e..b0a5644023cf8d2cf2d9ccba1130417ea49d2d29 100644 --- chrome/browser/ui/views/frame/layout/browser_view_layout_impl.cc +++ chrome/browser/ui/views/frame/layout/browser_view_layout_impl.cc -@@ -227,7 +227,16 @@ void BrowserViewLayoutImpl::Layout(views::View* host) { +@@ -221,7 +221,16 @@ void BrowserViewLayoutImpl::Layout(views::View* host) { auto params = delegate().GetBrowserLayoutParams(/*use_browser_bounds=*/true); if (params.IsEmpty()) { @@ -838,7 +882,7 @@ index f789176b17af199b65e2e650f130de0bba41bcd2..f57fe7b1a434e68329869bc8b308dfbc } DoPreLayoutComputations(params); -@@ -359,11 +368,13 @@ void BrowserViewLayoutImpl::OnGlassModeChanged() {} +@@ -353,11 +362,13 @@ void BrowserViewLayoutImpl::OnGlassModeChanged() {} int BrowserViewLayoutImpl::GetDialogTop(const ProposedLayout& layout) const { const int kConstrainedWindowOverlap = 3; const auto* const browser_view = views().browser_view.get(); @@ -855,22 +899,31 @@ index f789176b17af199b65e2e650f130de0bba41bcd2..f57fe7b1a434e68329869bc8b308dfbc int BrowserViewLayoutImpl::GetDialogBottom(const ProposedLayout& layout) const { 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 4f8841ddea805814eb62e521069b100c93fba460..444f7bd7c10522dce8d6839e309ed292612ea716 100644 +index 2ed2551ecd268e624bd7b32769b46b8f90342662..89355560f1b21440adb9b6c5e0c0e9bcdd67a48a 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 -@@ -345,6 +345,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( +@@ -29,6 +29,7 @@ + #include "chrome/browser/ui/views/picture_in_picture/picture_in_picture_bounds_change_animation.h" + #include "chrome/browser/ui/views/picture_in_picture/picture_in_picture_tucker.h" + #include "chrome/browser/ui/views/picture_in_picture/pip_top_bar_animation_controller.h" ++#include "chrome/browser/ui/window_feature_controller/window_feature_controller.h" + #include "chrome/grit/generated_resources.h" + #include "components/omnibox/browser/location_bar_model_impl.h" + #include "components/vector_icons/vector_icons.h" +@@ -345,6 +346,12 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( IsOverlayViewVisible()) { PictureInPictureWindowManager::GetInstance()->ClearCachedBounds(); } + -+ if (!browser_view->browser()->SupportsWindowFeature( -+ Browser::WindowFeature::kFeatureTitleBar)) { ++ if (!WindowFeatureController::From(browser_view->browser()) ++ ->SupportsWindowFeature( ++ WindowFeatureController::WindowFeature::kFeatureTitleBar)) { + top_bar_container_view_->SetVisible(false); + } } PictureInPictureBrowserFrameView::~PictureInPictureBrowserFrameView() { -@@ -451,18 +456,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( +@@ -451,18 +458,41 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( int PictureInPictureBrowserFrameView::NonClientHitTest( const gfx::Point& point) { @@ -910,9 +963,8 @@ index 4f8841ddea805814eb62e521069b100c93fba460..444f7bd7c10522dce8d6839e309ed292 + GetBrowserView()->contents_web_view(), + &point_in_contents_web_view_coords); + -+ if (draggable_region->contains( -+ point_in_contents_web_view_coords.x(), -+ point_in_contents_web_view_coords.y())) { ++ if (draggable_region->contains(point_in_contents_web_view_coords.x(), ++ point_in_contents_web_view_coords.y())) { + return HTCAPTION; + } } @@ -921,17 +973,17 @@ index 4f8841ddea805814eb62e521069b100c93fba460..444f7bd7c10522dce8d6839e309ed292 // Allow dragging and resizing the window. int window_component = GetHTComponentForFrame( -@@ -527,7 +556,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) { +@@ -527,7 +557,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) { gfx::Rect content_area = GetLocalBounds(); content_area.Inset(FrameBorderInsets()); gfx::Rect top_bar = content_area; - top_bar.set_height(kTopControlsHeight); -+ top_bar.set_height( -+ top_bar_container_view_->GetVisible() ? kTopControlsHeight : 0); ++ top_bar.set_height(top_bar_container_view_->GetVisible() ? kTopControlsHeight ++ : 0); top_bar_container_view_->SetBoundsRect(top_bar); #if !BUILDFLAG(IS_ANDROID) if (auto_pip_setting_overlay_) { -@@ -996,7 +1026,8 @@ gfx::Insets PictureInPictureBrowserFrameView::FrameBorderInsets() const { +@@ -1003,7 +1034,8 @@ gfx::Insets PictureInPictureBrowserFrameView::FrameBorderInsets() const { } int PictureInPictureBrowserFrameView::GetTopAreaHeight() const { @@ -941,11 +993,34 @@ index 4f8841ddea805814eb62e521069b100c93fba460..444f7bd7c10522dce8d6839e309ed292 } gfx::Size PictureInPictureBrowserFrameView::GetNonClientViewAreaSize() const { +diff --git chrome/browser/ui/views/location_bar/location_bar_view.cc chrome/browser/ui/views/location_bar/location_bar_view.cc +index f97b92504ba812fd6e5dc25f1974fc86b3bc1d52..c01b995d733b825bdb19e4cb1ac38a029e141065 100644 +--- chrome/browser/ui/views/location_bar/location_bar_view.cc ++++ chrome/browser/ui/views/location_bar/location_bar_view.cc +@@ -449,6 +449,18 @@ void LocationBarView::Init() { + page_action_items = page_actions::GetActivePageActionItems(*browser_); + } + ++#if BUILDFLAG(ENABLE_CEF) ++ if (browser_ && browser_->cef_delegate()) { ++ const auto& properties_provider = ++ page_actions::PageActionPropertiesProvider(); ++ std::erase_if(page_action_items, [&](actions::ActionItem* item) { ++ const auto& props = ++ properties_provider.GetProperties(item->GetActionId().value()); ++ return !browser_->cef_delegate()->IsPageActionIconVisible(props.type); ++ }); ++ } ++#endif ++ + static constexpr int kBetweenIconSpacing = 8; + const page_actions::PageActionViewParams page_action_params{ + .icon_size = diff --git chrome/browser/ui/views/omnibox/omnibox_popup_closer.cc chrome/browser/ui/views/omnibox/omnibox_popup_closer.cc -index ac3845d976f92a4880bf967ee71b7d7219b803c1..4f5354fef304c1991705ac882468c4fe96079f9d 100644 +index 57d2e49e599ffb409d566a27a29ef9431557fea0..c8aaf3fd1d78d803de138e8c7936e5d01bc18ad5 100644 --- chrome/browser/ui/views/omnibox/omnibox_popup_closer.cc +++ chrome/browser/ui/views/omnibox/omnibox_popup_closer.cc -@@ -50,7 +50,8 @@ OmniboxPopupCloser::~OmniboxPopupCloser() = default; +@@ -60,7 +60,8 @@ OmniboxPopupCloser::~OmniboxPopupCloser() = default; void OmniboxPopupCloser::OnMouseEvent(ui::MouseEvent* event) { // Close the omnibox popup if the click is outside the omnibox view. @@ -955,35 +1030,34 @@ index ac3845d976f92a4880bf967ee71b7d7219b803c1..4f5354fef304c1991705ac882468c4fe LocationBar* location_bar = browser_view_->GetLocationBar(); CHECK(location_bar); if (location_bar->ShouldCloseOmniboxPopup(event)) { -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 a9fa015f80544352f24d72369c537f58bb0d3f40..17c4502e630f6a234db201d5e40fa9e5bc583e35 100644 ---- chrome/browser/ui/views/page_action/page_action_icon_controller.cc -+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc -@@ -60,6 +60,14 @@ void PageActionIconController::Init(const PageActionIconParams& params, - if (IsPageActionMigrated(type)) { - continue; - } -+ -+#if BUILDFLAG(ENABLE_CEF) -+ if (params.browser && params.browser->cef_delegate() && -+ !params.browser->cef_delegate()->IsPageActionIconVisible(type)) { -+ continue; -+ } -+#endif -+ - switch (type) { - case PageActionIconType::kOptimizationGuide: - case PageActionIconType::kFind: diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 03aedd9edd72435185dca70e8b89574cd387cd3e..c8f21b92858cf262c018fdfaa5ed19ced8e87722 100644 +index 58334f610569244b55dcfee3db5bc337b7e3c357..ad0528de81dd7a936faa9acdc1a8d649270ed66c 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -258,12 +258,14 @@ void SetRefreshMargins(views::View* button, bool expanded) { +@@ -43,6 +43,7 @@ + #include "chrome/browser/themes/theme_properties.h" + #include "chrome/browser/ui/actions/chrome_action_id.h" + #include "chrome/browser/ui/ai_overlay_dialog/ai_overlay_dialog_controller.h" ++#include "chrome/browser/ui/browser.h" + #include "chrome/browser/ui/browser_actions.h" + #include "chrome/browser/ui/browser_command_controller.h" + #include "chrome/browser/ui/browser_commands.h" +@@ -174,6 +175,10 @@ + #include "ui/aura/window_occlusion_tracker.h" + #endif ++#if BUILDFLAG(ENABLE_CEF) ++#include "cef/libcef/browser/chrome/browser_util.h" ++#endif ++ + using base::UserMetricsAction; + using content::WebContents; + +@@ -261,12 +266,13 @@ void SetRefreshMargins(views::View* button, bool expanded) { DEFINE_CLASS_ELEMENT_IDENTIFIER_VALUE(ToolbarView, kToolbarElementId); --ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view) -+ToolbarView::ToolbarView(Browser* browser, + ToolbarView::ToolbarView(BrowserWindowInterface* browser, +- BrowserView* browser_view) + BrowserView* browser_view, + std::optional display_mode) : AnimationDelegateViews(this), @@ -995,7 +1069,7 @@ index 03aedd9edd72435185dca70e8b89574cd387cd3e..c8f21b92858cf262c018fdfaa5ed19ce // WebApp type-browsers set their own ToolbarButtonProvider. if (!web_app::AppBrowserController::IsWebApp(browser)) { scoped_unowned_user_data_.emplace(browser_->GetUnownedUserDataHost(), -@@ -301,9 +303,24 @@ ToolbarView::~ToolbarView() { +@@ -306,9 +312,24 @@ ToolbarView::~ToolbarView() { for (const auto& view_and_command : GetViewCommandMap()) { chrome::RemoveCommandObserver(browser_, view_and_command.second, this); } @@ -1020,26 +1094,26 @@ index 03aedd9edd72435185dca70e8b89574cd387cd3e..c8f21b92858cf262c018fdfaa5ed19ce #if defined(USE_AURA) // Avoid generating too many occlusion tracking calculation events before this // function returns. The occlusion status will be computed only once once this -@@ -323,7 +340,8 @@ void ToolbarView::Init() { - } else { +@@ -329,7 +350,8 @@ void ToolbarView::Init() { location_bar_view = std::make_unique( - browser_, browser_->GetProfile(), browser_->command_controller(), this, + browser_, browser_->GetProfile(), + chrome::BrowserCommandController::From(browser_), this, - display_mode_ != DisplayMode::kNormal); + display_mode_ != DisplayMode::kNormal && -+ !browser_->toolbar_overridden()); ++ !cef::BrowserForBWI(browser_)->toolbar_overridden()); } // Make sure the toolbar shows by default. -@@ -396,7 +414,7 @@ void ToolbarView::Init() { +@@ -402,7 +424,7 @@ void ToolbarView::Init() { std::unique_ptr media_button; #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) - if (!features::IsWebUIMediaButtonEnabled()) { + if (!features::IsWebUIMediaButtonEnabled() && BUTTON_VISIBLE(kMedia)) { media_button = std::make_unique( - browser_view_, - std::make_unique(browser_)); -@@ -522,7 +540,8 @@ void ToolbarView::Init() { + browser_view_, std::make_unique( + browser_->GetProfile())); +@@ -529,7 +551,8 @@ void ToolbarView::Init() { // Only show the Battery Saver button when it is not controlled by the OS. On // ChromeOS the battery icon in the shelf shows the same information. if (!performance_manager::user_tuning::IsBatterySaverModeManagedByOS() && @@ -1049,25 +1123,26 @@ index 03aedd9edd72435185dca70e8b89574cd387cd3e..c8f21b92858cf262c018fdfaa5ed19ce battery_saver_button_ = AddChildView(std::make_unique(browser_)); } -@@ -576,7 +595,7 @@ void ToolbarView::Init() { - AddChildView(std::make_unique(browser_view_)); +@@ -581,7 +604,7 @@ void ToolbarView::Init() { + avatar_ = AddChildView(std::make_unique(browser_)); bool show_avatar_toolbar_button = AvatarToolbarButtonInterface::CanShowForProfile(browser_->GetProfile()); - avatar_->SetVisible(show_avatar_toolbar_button); + avatar_->SetVisible(show_avatar_toolbar_button && BUTTON_VISIBLE(kAvatar)); } - overflow_button_ = AddChildView(std::make_unique()); + // Only manage the overflow button when there are at least some views diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 432d78f72316017535ece3f1e4b032a4c15fcf3d..d68738ab52fa85f8727fc01f044f1dc6b6089029 100644 +index daed2c76ac524c4d7caf8764d432a0d07e5047c8..a6fba0c6ebd35e6c6a1e23fd71186a25e231786e 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -111,7 +111,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -111,7 +111,9 @@ class ToolbarView : public views::AccessiblePaneView, DECLARE_CLASS_ELEMENT_IDENTIFIER_VALUE(kToolbarElementId); -- ToolbarView(Browser* browser, BrowserView* browser_view); -+ ToolbarView(Browser* browser, BrowserView* browser_view, +- ToolbarView(BrowserWindowInterface* browser, BrowserView* browser_view); ++ ToolbarView(BrowserWindowInterface* browser, ++ BrowserView* browser_view, + std::optional display_mode); ToolbarView(const ToolbarView&) = delete; ToolbarView& operator=(const ToolbarView&) = delete; diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index caa65727d..de0cc02e3 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 1abaf9cf709d90db086cba29d52d31dfc87ef9d7..886894000afde8b65d408045eba58c9d295ecf5e 100644 +index 774a3b6839b155a4140ea3224d89201702e68142..95b73b7a0f4c0394299229177c6d9a0da33e4e11 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h -@@ -154,7 +154,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -152,7 +152,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, std::optional* override_out); @@ -46,7 +46,7 @@ index 09d80f2ba678df9ab1b9b2b74ad66d4546036fb2..5dbff44c280a145c65146279a971620f explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index 06bc38e673dcb84424bfa8fd3b1b4fcdffa9d367..e7ac995b24e4c858f5b184b492171d0622b99c82 100644 +index eb9f60860200150b291648a2cc5f96a4ceb26ff5..f7a8b2f7574527a4ef46990babe82a65a44eeef4 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -3,6 +3,7 @@ @@ -57,7 +57,7 @@ index 06bc38e673dcb84424bfa8fd3b1b4fcdffa9d367..e7ac995b24e4c858f5b184b492171d06 import("//testing/test.gni") import("//third_party/blink/renderer/bindings/bindings.gni") import("//third_party/blink/renderer/config.gni") -@@ -73,6 +74,15 @@ component("controller") { +@@ -70,6 +71,15 @@ component("controller") { "performance_manager/v8_worker_memory_reporter.h", ] diff --git a/patch/patches/component_updater_4087.patch b/patch/patches/component_updater_4087.patch index cfc9d85c8..755478628 100644 --- a/patch/patches/component_updater_4087.patch +++ b/patch/patches/component_updater_4087.patch @@ -1,5 +1,5 @@ diff --git components/component_updater/component_updater_service.h components/component_updater/component_updater_service.h -index 39acb4430d9c5cd00c17a83ad82e74adf25dfc01..70f34b1cc6435240fb9285e7239ea3080bb9158c 100644 +index 18308f02a6273fe752f8cc41b3b8bdd1293f1972..98301dca212ebf3b658350a844f640aa7c35272e 100644 --- components/component_updater/component_updater_service.h +++ components/component_updater/component_updater_service.h @@ -21,6 +21,7 @@ diff --git a/patch/patches/config_3892.patch b/patch/patches/config_3892.patch index 40b42302a..799fae2f0 100644 --- a/patch/patches/config_3892.patch +++ b/patch/patches/config_3892.patch @@ -1,9 +1,9 @@ diff --git components/prefs/pref_service.h components/prefs/pref_service.h -index 77f00e7274ca57ae28e96d6e7293e5d7204b64d9..c1ec10f24ad508b9c4faea91f86348a47baa0f11 100644 +index 7ac0cd7952128af52f896ac9013e2030b2b7bfd9..903749dac5fa1b5331226be9a6ca99cb947713d2 100644 --- components/prefs/pref_service.h +++ components/prefs/pref_service.h -@@ -51,6 +51,10 @@ namespace base { - class FilePath; +@@ -55,6 +55,10 @@ namespace base::i18n { + class LanguageTag; } +namespace pref_helper { @@ -13,7 +13,7 @@ index 77f00e7274ca57ae28e96d6e7293e5d7204b64d9..c1ec10f24ad508b9c4faea91f86348a4 namespace prefs { class ScopedDictionaryPrefUpdate; } -@@ -435,6 +439,8 @@ class COMPONENTS_PREFS_EXPORT PrefService { +@@ -442,6 +446,8 @@ class COMPONENTS_PREFS_EXPORT PrefService { // declared as a friend, too. friend class PrefChangeRegistrar; friend class subtle::PrefMemberBase; @@ -23,10 +23,10 @@ index 77f00e7274ca57ae28e96d6e7293e5d7204b64d9..c1ec10f24ad508b9c4faea91f86348a4 // These are protected so they can only be accessed by the friend // classes listed above. diff --git components/variations/BUILD.gn components/variations/BUILD.gn -index db25e6aa8fd5e4d512c9997deaef50d95f18f94b..96ab3f87b7a410c40294d3d7b7435a1f4e01454f 100644 +index 2c1195458c218b4d2f741bd0a6dcee5967f2981a..ec2656702da4f2a6c02530ad075e3fb3f80288b3 100644 --- components/variations/BUILD.gn +++ components/variations/BUILD.gn -@@ -134,6 +134,7 @@ component("variations") { +@@ -135,6 +135,7 @@ component("variations") { ":buildflags", ":variations_mojom", "proto", @@ -35,7 +35,7 @@ index db25e6aa8fd5e4d512c9997deaef50d95f18f94b..96ab3f87b7a410c40294d3d7b7435a1f "//components/crash/core/common:crash_key", "//components/prefs", diff --git components/variations/synthetic_trials_active_group_id_provider.cc components/variations/synthetic_trials_active_group_id_provider.cc -index bd51697297471c721b207fcf570b3b3c95527983..3e669cd080457915c8c1d1786fd780ea250cc2e9 100644 +index 6d94012d58446be8e3513ec4a03df9f0b1983bbd..806460a88956e53d73abe73c7e6777b71b675786 100644 --- components/variations/synthetic_trials_active_group_id_provider.cc +++ components/variations/synthetic_trials_active_group_id_provider.cc @@ -27,7 +27,7 @@ SyntheticTrialsActiveGroupIdProvider::GetActiveGroupIds() { @@ -56,7 +56,7 @@ index bd51697297471c721b207fcf570b3b3c95527983..3e669cd080457915c8c1d1786fd780ea groups_.clear(); #endif // !defined(NDEBUG) } -@@ -53,7 +53,7 @@ void SyntheticTrialsActiveGroupIdProvider::OnSyntheticTrialsChanged( +@@ -54,7 +54,7 @@ void SyntheticTrialsActiveGroupIdProvider::OnSyntheticTrialsChanged( for (const auto& group : groups) { group_ids_.push_back(group.id()); } diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 0337ae4a0..15648962a 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 fbfe1abebb19119387d55a1296aba5fd1ca7d99b..ea7f1ed74250198d4be2a16474e167b74763c089 100644 +index d14be48bac7febf0f2214ada695d5e25b7b75e9c..39147d94863f31b052cd4e84d379eeeb7daf27c6 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -618,7 +618,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -616,7 +616,7 @@ void DevToolsHttpHandler::OnJsonRequest( base::DictValue version; version.Set("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.Set("WebKit-Version", GetWebKitVersion()); @@ -12,10 +12,10 @@ index fbfe1abebb19119387d55a1296aba5fd1ca7d99b..ea7f1ed74250198d4be2a16474e167b7 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 259a8e6d187ab6856877ef7bdcce880b9a7f1f84..13a0b24a36338e48e9d2f15ecb6bc0e2b13a8b86 100644 +index bf56800508aa5b6f66282e74e396b98379f0ffe6..a74841132f9eed5616f3e74fff627bfd78b712da 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -1304,7 +1304,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( +@@ -1299,7 +1299,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( mojo::PendingRemote terminal_external_protocol; bool handled = GetContentClient()->browser()->HandleExternalProtocol( @@ -24,7 +24,7 @@ index 259a8e6d187ab6856877ef7bdcce880b9a7f1f84..13a0b24a36338e48e9d2f15ecb6bc0e2 frame_tree_node->frame_tree_node_id(), navigation_ui_data, request_info.is_primary_main_frame, frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags, -@@ -1316,6 +1316,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( +@@ -1311,6 +1311,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( *request_info.initiator_document_token) : nullptr, request_info.isolation_info, &terminal_external_protocol); @@ -47,10 +47,10 @@ index 259a8e6d187ab6856877ef7bdcce880b9a7f1f84..13a0b24a36338e48e9d2f15ecb6bc0e2 return std::make_pair( /*is_cacheable=*/false, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 2c79dbb65564871e8cca71a34a7f8f0347d37d24..be0511ec4f3becbb72079f5b1a5ababfdc41806e 100644 +index 6499e2f1fedb93031d97e3142404b4c3759e237e..33a162b72217f78243bf86880564cacf3b869040 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc -@@ -1174,7 +1174,7 @@ ContentBrowserClient::URLLoaderRequestHandler ContentBrowserClient:: +@@ -1171,7 +1171,7 @@ ContentBrowserClient::URLLoaderRequestHandler ContentBrowserClient:: void ContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) {} @@ -59,7 +59,7 @@ index 2c79dbb65564871e8cca71a34a7f8f0347d37d24..be0511ec4f3becbb72079f5b1a5ababf BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1183,6 +1183,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( +@@ -1180,6 +1180,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { network_context_params->user_agent = GetUserAgent(); network_context_params->accept_language = "en-us,en"; @@ -68,10 +68,10 @@ index 2c79dbb65564871e8cca71a34a7f8f0347d37d24..be0511ec4f3becbb72079f5b1a5ababf std::vector diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 0b57cc869d78d870e86fd6d41660799dd4e160c6..23410b34013c2e3b5da1bdeeec4311c9875ead09 100644 +index 933ff42f840d51de2ffa0b65a75405b957b06204..de6587086c14233b144325009972a5ff13a72d7b 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -1302,6 +1302,12 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1275,6 +1275,12 @@ class CONTENT_EXPORT ContentBrowserClient { bool opener_suppressed, bool* no_javascript_access); @@ -84,7 +84,7 @@ index 0b57cc869d78d870e86fd6d41660799dd4e160c6..23410b34013c2e3b5da1bdeeec4311c9 // Allows the embedder to return a delegate for the SpeechRecognitionManager. // The delegate will be owned by the manager. It's valid to return nullptr. virtual SpeechRecognitionManagerDelegate* -@@ -2155,7 +2161,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2148,7 +2154,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. @@ -93,7 +93,7 @@ index 0b57cc869d78d870e86fd6d41660799dd4e160c6..23410b34013c2e3b5da1bdeeec4311c9 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -2411,6 +2417,22 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2404,6 +2410,22 @@ class CONTENT_EXPORT ContentBrowserClient { const net::IsolationInfo& isolation_info, mojo::PendingRemote* out_factory); @@ -116,7 +116,7 @@ index 0b57cc869d78d870e86fd6d41660799dd4e160c6..23410b34013c2e3b5da1bdeeec4311c9 // 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. -@@ -2485,6 +2507,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2478,6 +2500,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -128,7 +128,7 @@ index 0b57cc869d78d870e86fd6d41660799dd4e160c6..23410b34013c2e3b5da1bdeeec4311c9 virtual std::string GetUserAgent(); diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 47dec1364f17eee55756f40f63ee2cdc3b33ed8b..cd8f0b3d64494a2da43b2a287f7c1ca023415b02 100644 +index 826f7108aa884dcd4d6f24d33e321756121e0f81..c959ea1a7520194f8594090bba4be5d4f23da807 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h @@ -110,6 +110,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -141,7 +141,7 @@ index 47dec1364f17eee55756f40f63ee2cdc3b33ed8b..cd8f0b3d64494a2da43b2a287f7c1ca0 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -352,6 +355,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -351,6 +354,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -153,7 +153,7 @@ index 47dec1364f17eee55756f40f63ee2cdc3b33ed8b..cd8f0b3d64494a2da43b2a287f7c1ca0 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 718f7d9a72dea2a0b2dd747a2c5f67cb986ec61e..98523d3fb15f523c685540905f03b5fc922a6997 100644 +index c71dfd3567adc5cdd2635f14fecd74288e3d418b..a884b8994f290a989c140fa007f95a47510b7805 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc @@ -568,6 +568,8 @@ void RenderThreadImpl::Init() { @@ -166,10 +166,10 @@ index 718f7d9a72dea2a0b2dd747a2c5f67cb986ec61e..98523d3fb15f523c685540905f03b5fc base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 6ed461b903e2f719c94d6aa965c97e342970a93c..eab06980954ab0c434d93ba839a5bfb52cd53160 100644 +index 4341f407c4fb27afd20162eee63157cb92ca6515..be8c62bfded40b11189230af947a68cfa77ac8c6 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1123,6 +1123,15 @@ RendererBlinkPlatformImpl::GetCpuPerformanceTier() { +@@ -1113,6 +1113,15 @@ RendererBlinkPlatformImpl::GetCpuPerformanceTier() { //------------------------------------------------------------------------------ @@ -186,10 +186,10 @@ index 6ed461b903e2f719c94d6aa965c97e342970a93c..eab06980954ab0c434d93ba839a5bfb5 RendererBlinkPlatformImpl::CreateWebV8ValueConverter() { return std::make_unique(); diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 33ae2a6eb2cf405c946f29838e62240cb2b9f1c1..2b078edfbc14383eb77e834a0772203bb55ae131 100644 +index 2266ee880b69ca9c41bd72029b55852b476772e5..237ef903db8a2298105433ab9c8f775cb856b8e3 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -273,6 +273,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -271,6 +271,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { #endif // BUILDFLAG(IS_ANDROID) void OnV8HeapLastResortGC() override; @@ -200,10 +200,10 @@ index 33ae2a6eb2cf405c946f29838e62240cb2b9f1c1..2b078edfbc14383eb77e834a0772203b // 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 e7bb591f4ba8fd00484b33157eb1adcfb3e32e00..2bc5dd98b9f84cb4bedc8506e7ec62ebad7e0d5f 100644 +index 1f730d3e774a311bdab058e4989dc6287c9089b9..0c42cde4fcfe6fba740fd54d380e859d8b7b596b 100644 --- content/shell/browser/shell_content_browser_client.cc +++ content/shell/browser/shell_content_browser_client.cc -@@ -822,7 +822,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( +@@ -802,7 +802,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -212,7 +212,7 @@ index e7bb591f4ba8fd00484b33157eb1adcfb3e32e00..2bc5dd98b9f84cb4bedc8506e7ec62eb BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -831,6 +831,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( +@@ -811,6 +811,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { ConfigureNetworkContextParamsForShell(context, network_context_params, cert_verifier_creation_params); @@ -221,10 +221,10 @@ index e7bb591f4ba8fd00484b33157eb1adcfb3e32e00..2bc5dd98b9f84cb4bedc8506e7ec62eb std::vector diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h -index a837999cb66f64cfbad62ac5afeee5a8ea7cb1ce..5c0a02f9fb973e690644899023f942221bdf7f0c 100644 +index ace08e41a53419f04c44c22614df41eec6a3d817..0cfd0321349dd8a5b1e1faab4a7c3deaee3c1f1e 100644 --- content/shell/browser/shell_content_browser_client.h +++ content/shell/browser/shell_content_browser_client.h -@@ -151,7 +151,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { +@@ -138,7 +138,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { GetGeolocationSystemPermissionManager() override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; @@ -234,11 +234,11 @@ index a837999cb66f64cfbad62ac5afeee5a8ea7cb1ce..5c0a02f9fb973e690644899023f94222 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 6eeee3fc022f3b52ac6b27444a1efead2beea4c3..85c4272d1c523a87588c318b0320f729b1d993ba 100644 +index d1a6b4dff1a8bfc2e87d999742cd157a204c03a1..b4c8738ce654b60d7395db5ecb3ba73a26a90fbc 100644 --- headless/lib/browser/headless_content_browser_client.cc +++ headless/lib/browser/headless_content_browser_client.cc -@@ -432,7 +432,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed( - return true; +@@ -419,7 +419,7 @@ bool HeadlessContentBrowserClient::IsPrivacySandboxReportingDestinationAttested( + return command_line->HasSwitch(switches::kForceReportingDestinationAttested); } -void HeadlessContentBrowserClient::ConfigureNetworkContextParams( @@ -246,7 +246,7 @@ index 6eeee3fc022f3b52ac6b27444a1efead2beea4c3..85c4272d1c523a87588c318b0320f729 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -442,6 +442,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams( +@@ -429,6 +429,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams( HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams( in_memory, relative_partition_path, network_context_params, cert_verifier_creation_params); @@ -255,13 +255,13 @@ index 6eeee3fc022f3b52ac6b27444a1efead2beea4c3..85c4272d1c523a87588c318b0320f729 std::string HeadlessContentBrowserClient::GetProduct() { diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h -index 962281aca412c7419b9f5a95fe28caffdf6df67c..e4a7f15bfe2ce6a4dbae3a3ed8fffb7043f8c5aa 100644 +index e317e94d208e93cf823e77f4d1b1dab18dc4cd6c..1a66c7bbff726e5bf5f759495c172ed48fd98e04 100644 --- headless/lib/browser/headless_content_browser_client.h +++ headless/lib/browser/headless_content_browser_client.h -@@ -98,7 +98,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient { - const url::Origin& accessing_origin, - std::string* out_debug_message, - bool* out_block_is_site_setting_specific) override; +@@ -86,7 +86,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient { + const url::Origin& destination_origin, + content::PrivacySandboxInvokingAPI invoking_api) override; + - void ConfigureNetworkContextParams( + bool ConfigureNetworkContextParams( content::BrowserContext* context, diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 032ea6ec5..76c8ebafb 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -13,10 +13,10 @@ index aacd4a841f3940c27c5c73c03fa9bcc6e56448cc..f4488f8259836a8f3bb5c465df28ca40 setproctitle_init(main_argv); } diff --git content/app/content_main.cc content/app/content_main.cc -index 7f463aa326087943994bba0fe1e1f3fd745f3e23..6731bed713581b5aad61239bb57b373bb087aadf 100644 +index 0fd60fa820805069ff01a2442f14de2b5e984e5a..c5f0025875ec42eb93008f280c93a01c7359ce07 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -177,16 +177,10 @@ ContentMainParams::~ContentMainParams() = default; +@@ -184,16 +184,10 @@ ContentMainParams::~ContentMainParams() = default; ContentMainParams::ContentMainParams(ContentMainParams&&) = default; ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default; @@ -35,7 +35,7 @@ index 7f463aa326087943994bba0fe1e1f3fd745f3e23..6731bed713581b5aad61239bb57b373b // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -262,7 +256,9 @@ NO_STACK_PROTECTOR int RunContentProcess( +@@ -269,7 +263,9 @@ NO_STACK_PROTECTOR int RunContentProcess( // default, "C", locale. setlocale(LC_NUMERIC, "C"); @@ -46,7 +46,7 @@ index 7f463aa326087943994bba0fe1e1f3fd745f3e23..6731bed713581b5aad61239bb57b373b #endif #if BUILDFLAG(IS_WIN) -@@ -270,14 +266,6 @@ NO_STACK_PROTECTOR int RunContentProcess( +@@ -277,14 +273,6 @@ NO_STACK_PROTECTOR int RunContentProcess( #endif #if BUILDFLAG(IS_MAC) @@ -61,7 +61,7 @@ index 7f463aa326087943994bba0fe1e1f3fd745f3e23..6731bed713581b5aad61239bb57b373b InitializeMac(); #endif -@@ -327,12 +315,44 @@ NO_STACK_PROTECTOR int RunContentProcess( +@@ -334,12 +322,44 @@ NO_STACK_PROTECTOR int RunContentProcess( if (IsSubprocess()) CommonSubprocessInit(); @@ -108,10 +108,10 @@ index 7f463aa326087943994bba0fe1e1f3fd745f3e23..6731bed713581b5aad61239bb57b373b } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index c72faa10fd722e485f953bce3a18078b23ff6616..7fe66c360ec9a71c00f921fe4292a2df845c8496 100644 +index 641912283e3c8f1c6e27c10e3d133442a656a5e1..cc930ce2f1d4143744004c56e6fa0c31aeb34570 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -51,6 +51,7 @@ +@@ -54,6 +54,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/hang_watcher.h" #include "base/threading/platform_thread.h" @@ -119,7 +119,7 @@ index c72faa10fd722e485f953bce3a18078b23ff6616..7fe66c360ec9a71c00f921fe4292a2df #include "base/time/default_clock.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" -@@ -980,18 +981,12 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) { +@@ -1045,18 +1046,12 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) { })); #if !defined(OFFICIAL_BUILD) || BUILDFLAG(CHROME_FOR_TESTING) @@ -139,7 +139,7 @@ index c72faa10fd722e485f953bce3a18078b23ff6616..7fe66c360ec9a71c00f921fe4292a2df base::debug::EnableInProcessStackDumping(); } -@@ -1379,6 +1374,13 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1468,6 +1463,13 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -154,7 +154,7 @@ index c72faa10fd722e485f953bce3a18078b23ff6616..7fe66c360ec9a71c00f921fe4292a2df std::unique_ptr ContentMainRunner::Create() { return ContentMainRunnerImpl::Create(); diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index e3d6621ec75a1b02c75fb0f4ad764339aea622f6..4ca2cc3de1fc428cfc0ff58865c81ed4a44597e0 100644 +index 522cbe3ed008202b3fe9169c61964c2fb692bd17..55683a6db13b822ea213b30f453324f189567b4d 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h @@ -31,7 +31,7 @@ namespace content { diff --git a/patch/patches/content_throttle_registry.patch b/patch/patches/content_throttle_registry.patch index c52627bf3..528e6ab49 100644 --- a/patch/patches/content_throttle_registry.patch +++ b/patch/patches/content_throttle_registry.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/navigation_throttle_registry_impl.cc content/browser/renderer_host/navigation_throttle_registry_impl.cc -index cc91d46713d9a04a75213ba07bacfebabb468767..2c4430aafbcafae9a0dfb7de71b860fb42f001c2 100644 +index 0ab996be624ce2b8487cfa2fb26a042ea83c0fef..d6451e7867b33d413ac349582f842375098b2520 100644 --- content/browser/renderer_host/navigation_throttle_registry_impl.cc +++ content/browser/renderer_host/navigation_throttle_registry_impl.cc -@@ -277,13 +277,18 @@ NavigationHandle& NavigationThrottleRegistryImpl::GetNavigationHandle() { +@@ -279,13 +279,18 @@ NavigationHandle& NavigationThrottleRegistryImpl::GetNavigationHandle() { } void NavigationThrottleRegistryImpl::AddThrottle( diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 2a7288ffa..81128bd11 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -1,5 +1,5 @@ diff --git chrome/chrome_elf/BUILD.gn chrome/chrome_elf/BUILD.gn -index d200a6aa34abac781a72fdf7d4f6dc92a81ad845..001472f90f1fe0454a622edae4067805670b2eef 100644 +index 0f2c819248a6e3e2895d17a44fd9929e8fdf9cd1..c8ab414ed114b9c65934dd62dd606bc5896f9718 100644 --- chrome/chrome_elf/BUILD.gn +++ chrome/chrome_elf/BUILD.gn @@ -7,6 +7,7 @@ @@ -26,7 +26,7 @@ index d200a6aa34abac781a72fdf7d4f6dc92a81ad845..001472f90f1fe0454a622edae4067805 "//chrome/install_static:install_static_util", "//components/crash/core/app", "//components/crash/core/common", # crash_keys -@@ -111,6 +111,17 @@ static_library("crash") { +@@ -112,6 +112,17 @@ static_library("crash") { "//sandbox/policy:win_hook_util", "//third_party/crashpad/crashpad/client", # DumpWithoutCrash ] @@ -144,10 +144,10 @@ index a274b3e364084c90d2f4783bab576ac85af285ea..3d995cf6433991f6f8abe7cd2d4eac17 // on the given `command_line`. For non-browser processes, allocates crash keys // from the switch value set by AppendStringAnnotationsCommandLineSwitch(). diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc -index b6a2910848c66489e70acdce6e09237bf6188f94..b58c359697cfe2d3390ca6cbd6c21ca977d90b91 100644 +index 7552a9b98da5e897c04f4ea7279ab87bf4ab9ef5..ee2bdc6f30f51494cf9ca1f018c9244d2c5d8ad0 100644 --- components/crash/core/app/crash_reporter_client.cc +++ components/crash/core/app/crash_reporter_client.cc -@@ -119,6 +119,23 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { +@@ -117,6 +117,23 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { return false; } @@ -172,24 +172,21 @@ index b6a2910848c66489e70acdce6e09237bf6188f94..b58c359697cfe2d3390ca6cbd6c21ca9 unsigned int CrashReporterClient::GetCrashDumpPercentage() { return 100; diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h -index 7c890b331be4aaaf20c7efe8a4bcc2f6e9012b7a..75d22156605d31bcd04a293168661067553552dc 100644 +index ceda11ed43d222ae46ec9c6a82351fd79d0c0aff..65b677ca74d99b0215816438f86a715e2dcad28f 100644 --- components/crash/core/app/crash_reporter_client.h +++ components/crash/core/app/crash_reporter_client.h -@@ -7,7 +7,9 @@ +@@ -7,6 +7,7 @@ #include +#include #include -+#include - - #include "build/build_config.h" - -@@ -190,6 +192,20 @@ class CrashReporterClient { + #include +@@ -193,6 +194,20 @@ class CrashReporterClient { // Returns true if breakpad should run in the given process type. virtual bool EnableBreakpadForProcess(const std::string& process_type); -+ + + // Populate |arguments| with additional optional arguments. + virtual void GetCrashOptionalArguments(std::vector* arguments); + @@ -203,9 +200,10 @@ index 7c890b331be4aaaf20c7efe8a4bcc2f6e9012b7a..75d22156605d31bcd04a293168661067 + // enabled for the browser process. + virtual bool EnableBrowserCrashForwarding(); +#endif - }; - - } // namespace crash_reporter ++ + // Returns a list of read-only shared memory regions containing user streams. + // These streams are extracted upon crash and attached to the minidump. + // diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc index db68eaa22030aca74f31a9d8612b4952a3b25642..e02625e502b73f10569ab54714ad4826ccff87b0 100644 --- components/crash/core/app/crashpad.cc diff --git a/patch/patches/dawn_dxil_redist.patch b/patch/patches/dawn_dxil_redist.patch index f4a941754..ab75365d2 100644 --- a/patch/patches/dawn_dxil_redist.patch +++ b/patch/patches/dawn_dxil_redist.patch @@ -1,5 +1,5 @@ diff --git src/dawn/tests/BUILD.gn src/dawn/tests/BUILD.gn -index 53ab2657fed94484df14891e0b833191b65f83dc..a6e24a331e50f167b87121bacf306131d134401e 100644 +index 5162a2f4cccdaee7d24f13d6c3cca7a942cf3436..7ff3544a9507387373ca06f27ee06a8797caf098 100644 --- src/dawn/tests/BUILD.gn +++ src/dawn/tests/BUILD.gn @@ -102,8 +102,8 @@ if (!dawn_use_built_dxc && build_with_chromium && is_win) { diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index e59e06380..fb0482237 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,5 +1,5 @@ diff --git .gn .gn -index 66bd4aa035340330e8238bcb5dd946f538b6a973..2d5ecf3f904d44168f470c92d780c45e0fba68e4 100644 +index 488189e60c708880693387b6db385611c44f5fd5..4a1b6e9e450fcf0e1e48013e2ae33a7cd135c2ab 100644 --- .gn +++ .gn @@ -157,6 +157,8 @@ exec_script_allowlist = @@ -12,7 +12,7 @@ index 66bd4aa035340330e8238bcb5dd946f538b6a973..2d5ecf3f904d44168f470c92d780c45e "//google_apis/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 0bd5d40ff7086c14f4e74a573d7b9d4ab89f2c8e..f9d7276b62483dc85b5b5ffcd9baabf8ed2b365f 100644 +index d55402aaad0d7abdb4f9cddfd775ae348e621f0c..1dab4ca47ad76c2141b01290f619bfe9802a825d 100644 --- BUILD.gn +++ BUILD.gn @@ -22,6 +22,7 @@ import("//build/config/ui.gni") @@ -21,9 +21,9 @@ index 0bd5d40ff7086c14f4e74a573d7b9d4ab89f2c8e..f9d7276b62483dc85b5b5ffcd9baabf8 import("//build/util/generate_wrapper.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") - import("//chrome/enterprise_companion/buildflags.gni") + import("//chrome/enterprise_companion/config.gni") import("//components/enterprise/buildflags/buildflags.gni") -@@ -283,6 +284,10 @@ group("gn_all") { +@@ -288,6 +289,10 @@ group("gn_all") { deps += root_extra_deps @@ -78,7 +78,7 @@ index bd411669389525e8f03eb329a4cf700ad89b62f3..fba7843d79796b903b592b69e2e1f2c7 visual_studio_version_logs = [ "windows_sdk_version=${windows_sdk_version}" ] diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index e18c99499d08fd9984e1885aa7c2cbb39b583dc4..45adfcf3292590ef39089272b8a8a5f7dbc40179 100644 +index 6008e03a8997c9d9bde410bb82b12dca89313e13..0b5cea8b7a296ba4565078f3f24c621d5699e447 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -5,6 +5,7 @@ @@ -89,8 +89,8 @@ index e18c99499d08fd9984e1885aa7c2cbb39b583dc4..45adfcf3292590ef39089272b8a8a5f7 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//components/compose/features.gni") -@@ -530,6 +531,11 @@ template("chrome_extra_paks") { - ] +@@ -516,6 +517,11 @@ template("chrome_extra_paks") { + deps += [ "//chrome/browser/resources/skills:resources" ] } + if (enable_cef) { @@ -102,7 +102,7 @@ index e18c99499d08fd9984e1885aa7c2cbb39b583dc4..45adfcf3292590ef39089272b8a8a5f7 sources += [ "$root_gen_dir/chrome/aim_eligibility_extension_resources.pak", diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni -index 19be5865dc73b3410378b4650a28930cd95b9ccb..00cfdbf71ea2de29e1af26b30ff07c6b4b79c87b 100644 +index 226c91dd847f533d800407fb95cf2d7b56917e6e..ad2d86dfd8a04e4a67eee7533a7289d5210c45eb 100644 --- chrome/chrome_repack_locales.gni +++ chrome/chrome_repack_locales.gni @@ -4,6 +4,7 @@ @@ -113,7 +113,7 @@ index 19be5865dc73b3410378b4650a28930cd95b9ccb..00cfdbf71ea2de29e1af26b30ff07c6b import("//extensions/buildflags/buildflags.gni") import("//tools/grit/repack.gni") -@@ -114,6 +115,10 @@ template("chrome_repack_locales") { +@@ -112,6 +113,10 @@ template("chrome_repack_locales") { "//third_party/search_engines_data:search_engine_descriptions_strings", ] } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 23dc28d7f..2208d847d 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 24ed276c40a30a015cd97cfb9f40f3bc485e2fd7..8217cb0d5dea9d84642a76822c184df6c1d86c46 100644 +index d55db4f82a97a1161d436c5c77ffbeac0f5ec708..ca2f29fb3812585aa2083bcf91fd48f5b3448ecf 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -1806,6 +1806,13 @@ +@@ -1803,6 +1803,13 @@ # 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 e3414b812..04db3d3ba 100644 --- a/patch/patches/light_mode_3534.patch +++ b/patch/patches/light_mode_3534.patch @@ -32,7 +32,7 @@ index daecebb5070705c1eb5281a3a7df4ace6b89c119..aed51c2e6b06e3527bd6c2003e4b6a82 return (dark_mode_support.allow_dark_mode_for_app || dark_mode_support.set_preferred_app_mode) && diff --git chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc -index 094551c9feac29138113464a50be115126ed05d9..0f47eaacd2947cbbb78bd710b736c9c9f4efcbc3 100644 +index 83d1f694eaf78e97c32054d4a71744d7f0f2b6b3..98de79083632c364309ae00e58ac4207a2d15589 100644 --- chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc +++ chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc @@ -66,7 +66,10 @@ void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() { @@ -48,10 +48,10 @@ index 094551c9feac29138113464a50be115126ed05d9..0f47eaacd2947cbbb78bd710b736c9c9 } diff --git ui/native_theme/native_theme.cc ui/native_theme/native_theme.cc -index 478080b426c752739e8a3ca2d04839ed71dfc498..48ff749580aa4c02979eeea19c809192cc2c625c 100644 +index 049cbdd2000458534dca9b08c02264661b75f4ca..1248babf31411463c5539abf056952ae01e6acc7 100644 --- ui/native_theme/native_theme.cc +++ ui/native_theme/native_theme.cc -@@ -284,6 +284,8 @@ void NativeTheme::NotifyOnNativeThemeUpdated() { +@@ -297,6 +297,8 @@ void NativeTheme::NotifyOnNativeThemeUpdated() { NotifyOnNativeThemeUpdatedImpl(); @@ -60,7 +60,7 @@ index 478080b426c752739e8a3ca2d04839ed71dfc498..48ff749580aa4c02979eeea19c809192 RecordNumColorProvidersInitializedDuringOnNativeThemeUpdated( color_provider_manager.num_providers_initialized() - initial_providers_initialized); -@@ -364,6 +366,13 @@ bool NativeTheme::IsForcedDarkMode() { +@@ -378,6 +380,13 @@ bool NativeTheme::IsForcedDarkMode() { return kIsForcedDarkMode; } @@ -74,7 +74,7 @@ index 478080b426c752739e8a3ca2d04839ed71dfc498..48ff749580aa4c02979eeea19c809192 bool NativeTheme::IsForcedHighContrast() { static bool kIsForcedHighContrast = base::CommandLine::ForCurrentProcess()->HasSwitch( -@@ -588,8 +597,13 @@ ColorProviderKey::ForcedColors NativeTheme::CalculateForcedColors() const { +@@ -594,8 +603,13 @@ ColorProviderKey::ForcedColors NativeTheme::CalculateForcedColors() const { NativeTheme::PreferredColorScheme NativeTheme::CalculatePreferredColorScheme() const { @@ -91,12 +91,12 @@ index 478080b426c752739e8a3ca2d04839ed71dfc498..48ff749580aa4c02979eeea19c809192 NativeTheme::PreferredContrast NativeTheme::CalculatePreferredContrast() const { diff --git ui/native_theme/native_theme.h ui/native_theme/native_theme.h -index f3c3f48681854900e8de6af4f344fe35fa1a64c8..9fd5e31fd1009148e5d32174b8ba4e1d3642964e 100644 +index e131113a7d5eeea02929ff037d898f1c2f281a43..0327964801b17658f08f1ac8c4f74032bb951c85 100644 --- ui/native_theme/native_theme.h +++ ui/native_theme/native_theme.h -@@ -536,13 +536,16 @@ class COMPONENT_EXPORT(NATIVE_THEME) NativeTheme { - caret_blink_interval_ = caret_blink_interval; - } +@@ -539,13 +539,16 @@ class COMPONENT_EXPORT(NATIVE_THEME) NativeTheme { + size_t system_color_version() const { return system_color_version_; } + void IncrementSystemColorVersion() { ++system_color_version_; } - protected: - explicit NativeTheme(SystemTheme system_theme = SystemTheme::kDefault); diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 68658ed29..d4c66ab01 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -1,5 +1,5 @@ diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc -index b6f5667c86c3e74807728aa2dbb61fee87e6156a..d45312e41e35edaed670e112cc2e7a5d53c00149 100644 +index d6eb32b48c165050637d815846075bc86be4a963..104fc50352e746a9bde689b59323e678be3d0c89 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -191,7 +191,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() { @@ -12,10 +12,10 @@ index b6f5667c86c3e74807728aa2dbb61fee87e6156a..d45312e41e35edaed670e112cc2e7a5d base::File file(exe_dir.Append(path), base::File::FLAG_OPEN | base::File::FLAG_READ); diff --git sandbox/linux/suid/client/setuid_sandbox_host.cc sandbox/linux/suid/client/setuid_sandbox_host.cc -index 5303cafbb3f67cc3e154de363110121019dcb54e..762bba9340dfd0fced22e760097f1e404f55552a 100644 +index baec9e404905d1ff058443689bf2b1e8fa308abf..752ca96c48b502d207d6ac40d4e823aa39c7cfb7 100644 --- sandbox/linux/suid/client/setuid_sandbox_host.cc +++ sandbox/linux/suid/client/setuid_sandbox_host.cc -@@ -128,7 +128,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { +@@ -134,7 +134,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { base::FilePath SetuidSandboxHost::GetSandboxBinaryPath() { base::FilePath sandbox_binary; base::FilePath exe_dir; diff --git a/patch/patches/linux_glib_deprecated_volatile.patch b/patch/patches/linux_glib_deprecated_volatile.patch index a3b0204bd..71592ee9a 100644 --- a/patch/patches/linux_glib_deprecated_volatile.patch +++ b/patch/patches/linux_glib_deprecated_volatile.patch @@ -1,8 +1,8 @@ diff --git ui/accessibility/platform/BUILD.gn ui/accessibility/platform/BUILD.gn -index 040207453f9f95974e8199c31f2d3cf31bb0e29f..f7a6828321241f29392e8e24625b6c7bc3c6679e 100644 +index eadb44ecc00a1ac4f5c442eafe9ceb53279a36b1..41df3858aaa4416bcffdc74adab274c7a806d78a 100644 --- ui/accessibility/platform/BUILD.gn +++ ui/accessibility/platform/BUILD.gn -@@ -362,6 +362,10 @@ component("platform") { +@@ -363,6 +363,10 @@ component("platform") { if (use_gio) { configs += [ "//build/linux:gio_config" ] } diff --git a/patch/patches/linux_gtk_theme_3610.patch b/patch/patches/linux_gtk_theme_3610.patch index d4cf6d2a7..4ffc7a68c 100644 --- a/patch/patches/linux_gtk_theme_3610.patch +++ b/patch/patches/linux_gtk_theme_3610.patch @@ -1,16 +1,16 @@ diff --git ui/gtk/gtk_ui.cc ui/gtk/gtk_ui.cc -index 441a77db1f20138fff05c877382a00b9f36af56d..458035c5df8aa58953f17daa5aa2a7840f384ac9 100644 +index 7c1861c59c7c03c31087de8580c4b3eed0d0cd6c..d752c814348fab48a41e5389ef1fb0a50af45c92 100644 --- ui/gtk/gtk_ui.cc +++ ui/gtk/gtk_ui.cc -@@ -31,6 +31,7 @@ - #include "base/observer_list.h" +@@ -32,6 +32,7 @@ + #include "base/scoped_environment_variable_override.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/themes/theme_properties.h" // nogncheck #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" -@@ -374,10 +375,15 @@ bool GtkUi::Initialize() { +@@ -405,10 +406,15 @@ bool GtkUi::Initialize() { connect(settings, "notify::gtk-key-theme-name", &GtkUi::OnKeyThemeNameChanged); } diff --git a/patch/patches/linux_printing_context.patch b/patch/patches/linux_printing_context.patch index 8578b073e..6c337e268 100644 --- a/patch/patches/linux_printing_context.patch +++ b/patch/patches/linux_printing_context.patch @@ -14,18 +14,18 @@ index 5c555d8768e2a1d9e6ac86fc9392420a42f5193d..9d343a47c7896569b3ba4de67fbed50e return gfx::Size(); diff --git ui/linux/BUILD.gn ui/linux/BUILD.gn -index 267de0acbaf5a01f0b9aa5c456e90e32721a31cd..ce4f0836692a292fb9c768124a63ff468ced225b 100644 +index eaee77fb50333c7b18a6bfdca8f4cae378fd65f5..df25b3d338d340c5f6254a00f1b4302012fad64b 100644 --- ui/linux/BUILD.gn +++ ui/linux/BUILD.gn -@@ -3,6 +3,7 @@ - # found in the LICENSE file. +@@ -4,6 +4,7 @@ + import("//build/config/features.gni") import("//build/config/linux/gtk/gtk.gni") +import("//printing/buildflags/buildflags.gni") import("//ui/qt/qt.gni") assert(is_linux) -@@ -35,6 +36,11 @@ component("linux_ui") { +@@ -36,6 +37,11 @@ component("linux_ui") { "//ui/display/types", "//ui/gfx/geometry", ] @@ -38,15 +38,19 @@ index 267de0acbaf5a01f0b9aa5c456e90e32721a31cd..ce4f0836692a292fb9c768124a63ff46 } diff --git ui/linux/linux_ui.cc ui/linux/linux_ui.cc -index 4c86d688230bdca3611fd1a1454390b30cb57dbe..88b706bffb1605835710fb54375aa752839ff7d6 100644 +index c94906d0711fd86bc36c5e58ba5f02ec4f337e4c..10a7caaf03d69f78987e0cdd07f7e09db259b8ae 100644 --- ui/linux/linux_ui.cc +++ ui/linux/linux_ui.cc -@@ -21,11 +21,29 @@ namespace ui { +@@ -20,6 +20,7 @@ namespace ui { namespace { LinuxUi* g_linux_ui = nullptr; +static PrintingContextLinuxDelegate* g_delegate = nullptr; + base::RepeatingClosureList& GetAnimationsEnabledCallbackList() { + static base::NoDestructor s_callbacks; +@@ -28,8 +29,25 @@ base::RepeatingClosureList& GetAnimationsEnabledCallbackList() { + } // namespace +// static @@ -68,14 +72,14 @@ index 4c86d688230bdca3611fd1a1454390b30cb57dbe..88b706bffb1605835710fb54375aa752 + PrintingContextLinuxDelegate::SetInstance(instance); +#endif + - return std::exchange(g_linux_ui, instance); - } - + LinuxUi* old_instance = std::exchange(g_linux_ui, instance); + if (old_instance != instance) { + GetAnimationsEnabledCallbackList().Notify(); diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h -index 28e5c0ef6d3830d1f9d76aa3a47e4640f487ee4a..0be98d42d5f8cb2488ee7f3de4ce0b1ee14b2a1e 100644 +index 6c150f23c3260ce2dfc84e8d35dab2efbcf1b702..416bcf7fd6b8e1ec2be542742943bc81db16f41e 100644 --- ui/linux/linux_ui.h +++ ui/linux/linux_ui.h -@@ -21,6 +21,10 @@ +@@ -23,6 +23,10 @@ #include "printing/buildflags/buildflags.h" #include "ui/display/types/display_config.h" @@ -86,7 +90,7 @@ index 28e5c0ef6d3830d1f9d76aa3a47e4640f487ee4a..0be98d42d5f8cb2488ee7f3de4ce0b1e // The main entrypoint into Linux toolkit specific code. GTK/QT code should only // be executed behind this interface. -@@ -61,9 +65,27 @@ class WindowFrameProvider; +@@ -63,9 +67,27 @@ class WindowFrameProvider; enum class FrameType; enum class TextEditCommand; @@ -115,7 +119,7 @@ index 28e5c0ef6d3830d1f9d76aa3a47e4640f487ee4a..0be98d42d5f8cb2488ee7f3de4ce0b1e public: // 8px is the default value in GTK for how far the mouse needs to move before // a drag begins. -@@ -156,14 +178,6 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUi { +@@ -166,14 +188,6 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUi { // Returns a map of KeyboardEvent code to KeyboardEvent key values. virtual base::flat_map GetKeyboardLayoutMap() = 0; diff --git a/patch/patches/mac_chrome_locale_3623.patch b/patch/patches/mac_chrome_locale_3623.patch index 95b49e078..710449c55 100644 --- a/patch/patches/mac_chrome_locale_3623.patch +++ b/patch/patches/mac_chrome_locale_3623.patch @@ -97,11 +97,11 @@ index aa43742055b04c70bcb60bd21f61897b3c6b79a6..e84f21ab963ccf6e54afcb659f5ceccd // it will get the locale that should be used potentially from other sources, // depending on the platform (e.g. the OS locale on Mac). diff --git ui/base/l10n/l10n_util.cc ui/base/l10n/l10n_util.cc -index 735ca6d41c6f64e8c30980f1c480f6a5bb91192c..d36199ba58b3922fc25e0032615d9454cb15ca2e 100644 +index 466e9001064cb5354672f7a35b8f4dd8e0d992cd..284fc32ec379fe6d7c08df6dc27dc362d26f5525 100644 --- ui/base/l10n/l10n_util.cc +++ ui/base/l10n/l10n_util.cc -@@ -293,25 +293,7 @@ std::optional CheckAndResolveLocale(std::string_view locale, - return std::nullopt; +@@ -159,25 +159,7 @@ std::optional CheckAndResolveLocale(std::string_view locale, + }); } -#if BUILDFLAG(IS_APPLE) @@ -113,7 +113,7 @@ index 735ca6d41c6f64e8c30980f1c480f6a5bb91192c..d36199ba58b3922fc25e0032615d9454 - app_locale = pref_locale; - - // The above should handle all of the cases Chrome normally hits, but for some -- // unit tests, we need something to fall back too. +- // unit tests, fallback is needed too. - if (app_locale.empty()) - app_locale = "en-US"; - @@ -124,12 +124,12 @@ index 735ca6d41c6f64e8c30980f1c480f6a5bb91192c..d36199ba58b3922fc25e0032615d9454 -#if !BUILDFLAG(IS_APPLE) -std::string GetApplicationLocaleInternalNonMac(std::string_view pref_locale) { +std::string GetApplicationLocaleInternal(std::string_view pref_locale) { - std::vector candidates; - - // We only use --lang and the app pref on Windows. On Linux, we only -@@ -379,15 +361,6 @@ std::string GetApplicationLocaleInternalNonMac(std::string_view pref_locale) { - - return std::string(); + std::vector> candidates; + // The `prefered_tag` is separated from the other candidates. + std::optional prefered_tag = std::nullopt; +@@ -280,15 +262,6 @@ std::string GetApplicationLocaleInternalNonMac(std::string_view pref_locale) { + // Fallback to "en-US" + return IsResourceBundleLocale(GetKnownLanguageTag("en-US")) ? "en-US" : ""; } -#endif // !BUILDFLAG(IS_APPLE) - diff --git a/patch/patches/mac_platform_style_bubble_893292.patch b/patch/patches/mac_platform_style_bubble_893292.patch index 9d715d30c..c691d6be5 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 231f51314f4af3c6a72d02f8056e127d742a8906..47c2b5f1900ab283edd2050cd41fbdb13ff036f3 100644 +index a84721e68ab5953b62fbfc335165cb8c5245947d..85051fbd798dd730c9aee0954b84f6e588ca79d5 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -800,8 +800,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { +@@ -840,8 +840,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 061c26277..ad7517b0b 100644 --- a/patch/patches/mac_render_widget_3680.patch +++ b/patch/patches/mac_render_widget_3680.patch @@ -1,8 +1,8 @@ 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 2fe53e0208efd41f4b9d10c02c5290daa8a75b99..f4734d244dadf7e08906556da30843ace02caee1 100644 +index 6a2880e6e561d340b4bafacd7d70fe3493fbba40..10bf1484d6fd019f93438d7bf69c9762fa31fd28 100644 --- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -191,6 +191,13 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -193,6 +193,13 @@ void ExtractUnderlines(NSAttributedString* string, // RenderWidgetHostViewCocoa --------------------------------------------------- @@ -16,7 +16,7 @@ index 2fe53e0208efd41f4b9d10c02c5290daa8a75b99..f4734d244dadf7e08906556da30843ac // Private methods: @interface RenderWidgetHostViewCocoa () -@@ -840,6 +847,15 @@ static NSWindow* __weak _deferredResignKeyWindow; +@@ -852,6 +859,15 @@ static NSWindow* __weak _deferredResignKeyWindow; } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { diff --git a/patch/patches/message_pump_mac_2495.patch b/patch/patches/message_pump_mac_2495.patch deleted file mode 100644 index 752a506da..000000000 --- a/patch/patches/message_pump_mac_2495.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git base/message_loop/message_pump_apple.mm base/message_loop/message_pump_apple.mm -index a682d58e28ce946c82b6b9fbdcf799f2cf3ca322..649c55e78678c896036ca163c59af6220b0c2f2c 100644 ---- base/message_loop/message_pump_apple.mm -+++ base/message_loop/message_pump_apple.mm -@@ -862,7 +862,8 @@ void MessagePumpUIApplication::Detach() { - #else - - ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { -- DCHECK(g_app_pump); -+ if (!g_app_pump) -+ return; - DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask()); - // Pumping events in private runloop modes is known to interact badly with - // app modal windows like NSAlert. -@@ -873,7 +874,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { - } - - ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() { -- DCHECK(g_app_pump); -+ if (!g_app_pump) -+ return; - g_app_pump->SetModeMask(kNSApplicationModalSafeModeMask); - } - diff --git a/patch/patches/mojo_connect_result_3664.patch b/patch/patches/mojo_connect_result_3664.patch index e05c8f0dc..d456b7e29 100644 --- a/patch/patches/mojo_connect_result_3664.patch +++ b/patch/patches/mojo_connect_result_3664.patch @@ -184,7 +184,7 @@ index 7efe47038b51b9922a817be9876bfd4830031ebb..22a636f9ac3ad7d6a6e66fc8da6e0229 MessagePipeHandle handle() const { diff --git mojo/public/cpp/bindings/lib/connector.cc mojo/public/cpp/bindings/lib/connector.cc -index 3151a96fc24ac02dadb1830a2c6851eff44bff79..188460bd3ad5b9fbeb1755f67153a75586621b08 100644 +index 9a927711bddb7e3baca78375424e497bdb57fec0..3d5497888e37eb3df7cc22e6f8490f7906662c72 100644 --- mojo/public/cpp/bindings/lib/connector.cc +++ mojo/public/cpp/bindings/lib/connector.cc @@ -438,6 +438,8 @@ void Connector::OnSyncHandleWatcherHandleReady(const char* interface_name, @@ -197,7 +197,7 @@ index 3151a96fc24ac02dadb1830a2c6851eff44bff79..188460bd3ad5b9fbeb1755f67153a755 // No more messages on the pipe and the peer is closed. HandleError(false /* force_pipe_reset */, false /* force_async_handler */); diff --git mojo/public/cpp/bindings/lib/interface_endpoint_client.cc mojo/public/cpp/bindings/lib/interface_endpoint_client.cc -index e6a9a30c47cd4db0f942536a42a3619222b6abda..31f46883503fbd9159dc08d1ba03184c705bb29a 100644 +index 6f691959d02ce002574fcf309fdb4b73238a7eeb..e0665b387be9fd884cb4b22e2accc52d66db12b4 100644 --- mojo/public/cpp/bindings/lib/interface_endpoint_client.cc +++ mojo/public/cpp/bindings/lib/interface_endpoint_client.cc @@ -754,7 +754,8 @@ bool InterfaceEndpointClient::HandleIncomingMessage(Message* message) { diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index a6765776c..c9abd9001 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -11,10 +11,10 @@ index c10df92f30b1292a8243f376025e81afcefba78d..17abc3e15b985a13308014488728fcb0 + // See note at top of file about why adding LoadFlags is often a bad idea. diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index 545d45b2028f949c80794179de77cdea950c3de7..5dc9dbcce1b19e8ee0683e2e6dccd6bc7b402528 100644 +index 30923eb35ebfb7c7a27370b920519228e7b880e5..1991c66f497af1a2b22d8ac91d332ca0def5518a 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -2149,7 +2149,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { +@@ -2144,7 +2144,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. @@ -25,7 +25,7 @@ index 545d45b2028f949c80794179de77cdea950c3de7..5dc9dbcce1b19e8ee0683e2e6dccd6bc bool URLRequestHttpJob::ShouldRecordPartitionedCookieUsage() const { diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index 2a92c36229d622cefe7f56a704fc1782e11a1f72..134400ba26b8e44bd192c105827e8e59b4a4c968 100644 +index 8a8e9165fa604bca66ddbf48d569d277c4b6aa96..42d8c636ab7f0442d6f57ad512e83cb27e0197a7 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc @@ -394,7 +394,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 87835fc76..73b7638dd 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -58,10 +58,10 @@ index 2ce358d68a36b0913536bfe296bbccbb33bc82d1..92469f2f88e0e7b8ad5a4139688ca8cf return nullptr; } diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index e8fc22dcb838cf0a15737184f402746d308bbd0b..fbda97a3a95efe490950444f6ffea5bd177f734d 100644 +index 953f94195d7755ac08725315791883961172df8a..eab52466767a1453c44cbe96c98da679a63fcec6 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -4143,6 +4143,11 @@ void RenderWidgetHostImpl::StopFling() { +@@ -4157,6 +4157,11 @@ void RenderWidgetHostImpl::StopFling() { GetRenderInputRouter()->StopFling(); } @@ -74,10 +74,10 @@ index e8fc22dcb838cf0a15737184f402746d308bbd0b..fbda97a3a95efe490950444f6ffea5bd uint16_t angle, display::mojom::ScreenOrientation type) { diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index 89f9661540581f7a510bb1c891bfccb955a83fd9..8e55c6dbad8f84179f64d42ddb6784f4baaff2f6 100644 +index 0016174ffc095bf077e1ad3455bea5e28973eb63..9e4caaa4b322732b39261f26b832a733d04202aa 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -891,6 +891,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -895,6 +895,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/osr_win_remove_keyed_mutex_2575.patch b/patch/patches/osr_win_remove_keyed_mutex_2575.patch index d7429f4ea..aac7e2f61 100644 --- a/patch/patches/osr_win_remove_keyed_mutex_2575.patch +++ b/patch/patches/osr_win_remove_keyed_mutex_2575.patch @@ -1,8 +1,8 @@ diff --git gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc -index 33e9d5979a97a9fa64fb5438bfd763223a7f3f96..861e4aba9ed73b019561f780af8fcbe03a9665ed 100644 +index 78bae674bb15266927ac54740de534156b3bf2a0..c75a562a8d1914950d337937dd0368953db4e54d 100644 --- gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc +++ gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc -@@ -379,7 +379,8 @@ gfx::GpuMemoryBufferHandle D3DImageBackingFactory::CreateGpuMemoryBufferHandle( +@@ -372,7 +372,8 @@ gfx::GpuMemoryBufferHandle D3DImageBackingFactory::CreateGpuMemoryBufferHandle( // so make sure that the usage is one that we support. DCHECK(usage == gfx::BufferUsage::GPU_READ || usage == gfx::BufferUsage::SCANOUT || @@ -12,7 +12,7 @@ index 33e9d5979a97a9fa64fb5438bfd763223a7f3f96..861e4aba9ed73b019561f780af8fcbe0 << "Incorrect usage, usage=" << gfx::BufferUsageToString(usage); D3D11_TEXTURE2D_DESC desc = { -@@ -393,7 +394,9 @@ gfx::GpuMemoryBufferHandle D3DImageBackingFactory::CreateGpuMemoryBufferHandle( +@@ -386,7 +387,9 @@ gfx::GpuMemoryBufferHandle D3DImageBackingFactory::CreateGpuMemoryBufferHandle( D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, 0, D3D11_RESOURCE_MISC_SHARED_NTHANDLE | @@ -24,7 +24,7 @@ index 33e9d5979a97a9fa64fb5438bfd763223a7f3f96..861e4aba9ed73b019561f780af8fcbe0 Microsoft::WRL::ComPtr d3d11_texture; diff --git media/video/renderable_mappable_shared_image_video_frame_pool.cc media/video/renderable_mappable_shared_image_video_frame_pool.cc -index 435c26ebdecc86623e779023a0ba192cec9dcdd4..348e83091f21afce36722894ebbee6c9aad02714 100644 +index 831725ed249a80ea6033702ff91a37a23e8a24d4..5e236270e302a54c31d700f04c3fe4331499cd2e 100644 --- media/video/renderable_mappable_shared_image_video_frame_pool.cc +++ media/video/renderable_mappable_shared_image_video_frame_pool.cc @@ -197,6 +197,23 @@ bool FrameResources::Initialize(VideoPixelFormat format, diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index f43984de3..84d98e949 100644 --- a/patch/patches/renderer_host_1070713.patch +++ b/patch/patches/renderer_host_1070713.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_view_host_impl.cc content/browser/renderer_host/render_view_host_impl.cc -index 42d305e5d1d346292f43e83bebc37b60a620d353..29c19a365de84efddf024b0e4c5569e61192f259 100644 +index 02444a76180dde087332685ce8481df6811d9913..d4df66b50bb316054ab36966777a207fa0af9fcc 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -750,6 +750,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { +@@ -755,6 +755,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_host_aura.patch b/patch/patches/renderer_host_aura.patch index b08f05cfc..063ddd389 100644 --- a/patch/patches/renderer_host_aura.patch +++ b/patch/patches/renderer_host_aura.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 9aff51cf64b7decdd822cb582e160a69a04c6f3b..94912c146d178fc5fb8b52c7be683d0bab307ca6 100644 +index 98013c7c0835ee6f163d4c233abacdb223da02c3..be7928977ab7eec3f7196cb60974d33b61bf72a1 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -8,6 +8,7 @@ @@ -18,17 +18,17 @@ index 9aff51cf64b7decdd822cb582e160a69a04c6f3b..94912c146d178fc5fb8b52c7be683d0b #include "content/public/common/page_visibility_state.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/blink/public/common/input/web_input_event.h" -@@ -859,6 +861,9 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBoundsWithoutTransform() { +@@ -862,6 +864,9 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBoundsWithoutTransform() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { CHECK(GetBackgroundColor()); + if (!window_) { + return; + } - SkColor color = *GetBackgroundColor(); - window_->layer()->AsSolidColor()->SetColor(SkColor4f::FromColor(color)); - } -@@ -1242,6 +1247,12 @@ void RenderWidgetHostViewAura::TransformPointToRootSurface(gfx::PointF* point) { + SkColor4f background_color = + SkColor4f::FromColor(GetBackgroundColor().value()); + window_->layer()->SetFillsBoundsOpaquely(background_color.isOpaque()); +@@ -1247,6 +1252,12 @@ void RenderWidgetHostViewAura::TransformPointToRootSurface(gfx::PointF* point) { } gfx::Rect RenderWidgetHostViewAura::GetBoundsInScreen() { @@ -41,9 +41,9 @@ index 9aff51cf64b7decdd822cb582e160a69a04c6f3b..94912c146d178fc5fb8b52c7be683d0b aura::Window* top_level = window_->GetToplevelWindow(); gfx::Rect bounds(top_level->GetBoundsInScreen()); -@@ -2951,6 +2962,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { - window_->layer()->AsSolidColor()->SetColor(SkColor4f::FromColor( - GetBackgroundColor() ? *GetBackgroundColor() : SK_ColorWHITE)); +@@ -2980,6 +2991,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { + window_->layer()->SetFillsBoundsOpaquely(background_color.isOpaque()); + window_->layer()->AsSurface()->SetFallbackBackgroundColor(background_color); UpdateFrameSinkIdRegistration(); + + // Do this after |window_| is created to avoid crashes on Win10. @@ -59,10 +59,10 @@ index 9aff51cf64b7decdd822cb582e160a69a04c6f3b..94912c146d178fc5fb8b52c7be683d0b void RenderWidgetHostViewAura::UpdateFrameSinkIdRegistration() { diff --git content/browser/renderer_host/render_widget_host_view_aura.h content/browser/renderer_host/render_widget_host_view_aura.h -index 345d1c40972ddecfd5668004ce4f12da36a7b4a6..41067acf0e3a6dff8763f393d97706a47d69fdc0 100644 +index 21422e7e2d44aa4766d081da2e42e7ba5ebd82f4..ffea7823346063f5307927377987df84c18e95ed 100644 --- content/browser/renderer_host/render_widget_host_view_aura.h +++ content/browser/renderer_host/render_widget_host_view_aura.h -@@ -480,6 +480,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura +@@ -482,6 +482,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura bool ShouldUseDefaultDeadlineOnResize() const; @@ -75,7 +75,7 @@ index 345d1c40972ddecfd5668004ce4f12da36a7b4a6..41067acf0e3a6dff8763f393d97706a4 protected: ~RenderWidgetHostViewAura() override; -@@ -906,6 +912,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura +@@ -909,6 +915,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura bool use_default_deadline_on_resize_ = false; diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 756c2e11a..b86873c67 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,10 +1,10 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 2543039f653321522773c9f51e2aaa7566757194..35988e7b2652334986d8710a6bb392a1efb74759 100644 +index d1ee6814618c7cdcdb7fda0faa57a94a75dd7c98..e047d2c3bc63b8503eb448f0c2e194d71e7147e7 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -1015,6 +1015,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) - : delegate_(delegate), - locale_resources_data_lock_(new base::Lock), +@@ -1022,6 +1022,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) + locale_resources_data_lock_(std::make_unique()), + resource_handles_lock_(std::make_unique()), max_scale_factor_(k100Percent) { + // With CEF's multi-threaded mode the ResourceBundle may be created on the + // main thread and then accessed on the UI thread. Allow the SequenceChecker @@ -15,7 +15,7 @@ index 2543039f653321522773c9f51e2aaa7566757194..35988e7b2652334986d8710a6bb392a1 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -1024,6 +1030,11 @@ ResourceBundle::~ResourceBundle() { +@@ -1031,6 +1037,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } @@ -28,7 +28,7 @@ index 2543039f653321522773c9f51e2aaa7566757194..35988e7b2652334986d8710a6bb392a1 void ResourceBundle::InitSharedInstance(Delegate* delegate) { DCHECK(g_shared_instance_ == nullptr) << "ResourceBundle initialized twice"; diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h -index 2ca1317c5f67b9bb34a47d2f981acb87eb34b58c..327b9c69b308f1d902a6ab4ac2b1fd749e7fa1c1 100644 +index 5b0e6cea9c6206526c11af155a26c8c2477690c4..63da981b5350d6b36afd84cd4c85e1cb6eb7efd3 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h @@ -266,6 +266,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { diff --git a/patch/patches/rfh_navigation_4829483.patch b/patch/patches/rfh_navigation_4829483.patch index 6434ed5ed..edb6bbac6 100644 --- a/patch/patches/rfh_navigation_4829483.patch +++ b/patch/patches/rfh_navigation_4829483.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index e1107cb51f36676e812b95c05e2112dd9d94996c..eec1f6bbc1806b8d95c057b843dce259b27b123a 100644 +index 843974a29bab71b1efb1e2d9e2f83d0735f61351..9016104dd8ad4c27b20f32450eed4e9eb9b25e2d 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10481,6 +10481,16 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -10652,6 +10652,16 @@ void RenderFrameHostImpl::CreateNewWindow( return; } @@ -19,7 +19,7 @@ index e1107cb51f36676e812b95c05e2112dd9d94996c..eec1f6bbc1806b8d95c057b843dce259 // Otherwise, consume user activation before we proceed. In particular, it is // important to do this before we return from the |opener_suppressed| case // below. -@@ -12902,6 +12912,7 @@ void RenderFrameHostImpl::CommitNavigation( +@@ -13122,6 +13132,7 @@ void RenderFrameHostImpl::CommitNavigation( ProcessLock::FromSiteInfo(GetSiteInstance()->GetSiteInfo()); auto browser_calc_origin_to_commit = navigation_request->GetOriginToCommit(); if (!process_lock.is_error_page() && !is_mhtml_subframe && diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index 62dae5b30..74f5d64df 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,59 +1,64 @@ diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index e0b7c03a522040d58afdf82cbe20acc38f96b43e..f1583a4f4dcd04bbf4c12c1a567a245a76a0f908 100644 +index e7651ec9f8b538d0eca24b74fef7cd40771da72e..ae80221a4aa3e4e7bd20d28a34a3e3f008f7e2e0 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -168,13 +168,17 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store): - del os.environ['LIB'] - if 'LIBPATH' in os.environ: - del os.environ['LIBPATH'] -- other_path = os.path.normpath( -+ script_path = os.path.normpath( - os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'], - 'VC/Auxiliary/Build/vcvarsall.bat')) -- if not os.path.exists(other_path): -- raise Exception('%s is missing - make sure VC++ tools are installed.' % -- script_path) -- script_path = other_path -+ if not os.path.exists(script_path): -+ # Compiler environment variables must already be specified. -+ variables = [] -+ for k in sorted(os.environ.keys()): -+ variables.append('%s=%s' % (str(k), str(os.environ[k]))) -+ variables = '\n'.join(variables) -+ return _ExtractImportantEnvironment(variables) +@@ -181,18 +181,20 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store): + del os.environ['LIB'] + if 'LIBPATH' in os.environ: + del os.environ['LIBPATH'] +- other_path = os.path.normpath( ++ script_path = os.path.normpath( + os.path.join( + os.environ['GYP_MSVS_OVERRIDE_PATH'], + 'VC/Auxiliary/Build/vcvarsall.bat', + ) + ) +- if not os.path.exists(other_path): +- raise Exception( +- '%s is missing - make sure VC++ tools are installed.' +- % script_path +- ) +- script_path = other_path ++ if not os.path.exists(script_path): ++ # Compiler environment variables must already be specified. ++ variables = [] ++ for k in sorted(os.environ.keys()): ++ variables.append('%s=%s' % (str(k), str(os.environ[k]))) ++ variables = '\n'.join(variables) ++ return _ExtractImportantEnvironment(variables) + - cpu_arg = "amd64" - if (cpu != 'x64'): - # x64 is default target CPU thus any other CPU requires a target set + cpu_arg = "amd64" + if cpu != 'x64': + # x64 is default target CPU thus any other CPU requires a target set diff --git build/vs_toolchain.py build/vs_toolchain.py -index 7c62254219ca578f25f89823f7cca494a5781230..66303f6d822829e85bb8b6207b6c26602d544a3c 100755 +index 8bcba3e3f871dfe90e4e98c8141349cea9bb3720..5bb3d746e005e2e674cf2655930a024bafd0f8d6 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py -@@ -138,9 +138,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): - runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs) - os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH'] - elif sys.platform == 'win32' and not depot_tools_win_toolchain: -+ has_override_path = True - if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ: -+ has_override_path = False - os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath() +@@ -145,9 +145,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): + runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs) + os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH'] + elif sys.platform == 'win32' and not depot_tools_win_toolchain: ++ has_override_path = True + if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ: ++ has_override_path = False + os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath() -+ if has_override_path: -+ # Don't attempt to copy DLLs when using a custom toolchain. -+ # The DLLs should already be discoverable via the PATH env variable. -+ return None ++ if has_override_path: ++ # Don't attempt to copy DLLs when using a custom toolchain. ++ # The DLLs should already be discoverable via the PATH env variable. ++ return None + - # When using an installed toolchain these files aren't needed in the output - # directory in order to run binaries locally, but they are needed in order - # to create isolates or the mini_installer. Copying them to the output -@@ -227,6 +234,10 @@ def _CheckIfVersionInstalled(version): + # When using an installed toolchain these files aren't needed in the output + # directory in order to run binaries locally, but they are needed in order + # to create isolates or the mini_installer. Copying them to the output +@@ -240,6 +247,10 @@ def _CheckIfVersionInstalled(version): + def GetVisualStudioVersion(): - """Return best available version of Visual Studio. - """ -+ # Return the explicitly requested version, if any. -+ if 'GYP_MSVS_VERSION' in os.environ: -+ return os.environ['GYP_MSVS_VERSION'] + """Return best available version of Visual Studio.""" ++ # Return the explicitly requested version, if any. ++ if 'GYP_MSVS_VERSION' in os.environ: ++ return os.environ['GYP_MSVS_VERSION'] + - supported_versions = list(MSVS_VERSIONS.keys()) + supported_versions = list(MSVS_VERSIONS.keys()) - # VS installed in depot_tools for Googlers + # VS installed in depot_tools for Googlers diff --git a/patch/patches/screen_1443650.patch b/patch/patches/screen_1443650.patch index 0f4dec1ab..119920338 100644 --- a/patch/patches/screen_1443650.patch +++ b/patch/patches/screen_1443650.patch @@ -19,10 +19,10 @@ index b918c494ed0c664f456718c635efdcb173c7baec..8cbcd615b585032ff0a7a08dd4907348 bool Screen::GetDisplayWithDisplayId(int64_t display_id, diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc -index b6ccb488d7774a06c10b7af0de67f9e4c8a39c7b..8f0e3252cfc27d7513c97047c7584b081348447f 100644 +index af5c760492b9d69de04b4029c8235b7521e8d185..814fd8af5cbd4437a0bc16d81db25b1cfa1c99d9 100644 --- ui/display/win/screen_win.cc +++ ui/display/win/screen_win.cc -@@ -753,7 +753,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, +@@ -747,7 +747,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, gfx::PointF(pixel_bounds.origin()), screen_win_display)) : ToFlooredPoint(display::win::ScreenToDIPPoint( gfx::PointF(pixel_bounds.origin()), screen_win_display)); @@ -31,7 +31,7 @@ index b6ccb488d7774a06c10b7af0de67f9e4c8a39c7b..8f0e3252cfc27d7513c97047c7584b08 } gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, -@@ -768,7 +768,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, +@@ -762,7 +762,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, 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 36c3b62bc..eb3a76e4e 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -122,10 +122,10 @@ index 24740b2adea6bd54b65fe8bfcd376539b4cd7c45..36328a81d8e8c5b09e1cd09f0a406a43 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 9f3e51d1beeb13c648b085c109740755da6515dc..e1c23361dc21c1cfd27549be1099bb92c3752f61 100644 +index 053a25db4b88e1a4e94a55c96d03babdbc011660..071bd30f8822c0f2dd042d742d681c1180d5b442 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -3111,22 +3111,26 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -3136,22 +3136,26 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( pref_service.get(), network_service_->network_quality_estimator()); } @@ -169,7 +169,7 @@ index 9f3e51d1beeb13c648b085c109740755da6515dc..e1c23361dc21c1cfd27549be1099bb92 base::FilePath transport_security_persister_file_name; if (GetFullDataFilePath(params_->file_paths, diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index abddef1d201fccb59e4049eed5304bf073838f1b..2b5b7306268a33fa79bcf0ade1fa1f686b7f209e 100644 +index b085fd3a05f74bfbf062d78b845b3fbe9322cc8f..73efd06c4843d9b2eb1b6f2053285be822c1703e 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom @@ -400,6 +400,9 @@ struct NetworkContextParams { diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index 11e8cc5ca..c8767cbc5 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 9abbbe287f7e0fbe864a54da542f9c51b147517a..b6d0d25861e0aa3ec88ab201f6e940010e70bf4b 100644 +index 8465fb9272061262157e88c96f0cfadaad98f2ad..fe6164c67d50e79a5cff22db028f0610e240c5ec 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -3484,9 +3484,12 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -3483,9 +3483,12 @@ void StoragePartitionImpl::InitNetworkContext() { cert_verifier::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New(); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index a593fe74c..b0b2fa8b6 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -1,8 +1,8 @@ diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 823fabedf1f065a11a8c6d4c1e8a975663955418..f30cc1adb2e9185793d8bf44624220071ced778d 100644 +index 0d8af7d65e0c322191b923be3042eccecdd91a40..9fb421146a5f02dcc8e878802c2951bb9ab53b5c 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -211,6 +211,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, +@@ -215,6 +215,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, } } @@ -14,7 +14,7 @@ index 823fabedf1f065a11a8c6d4c1e8a975663955418..f30cc1adb2e9185793d8bf4462422007 std::unique_ptr crashed_overlay_view, ReturnCrashOverlayToOwnerCallback return_to_owner) { diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 867f5f4cd43c47bc078d0e40d5363c84032250f2..a16a23743b6c5858fd66dbaad4973290d6d39f46 100644 +index 3c0f097e6084b9bbc9361ec65baf0f724e0c0f15..a5756ae40a349dd7e02d0292d296f11188bb4c9c 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h @@ -135,6 +135,10 @@ class WEBVIEW_EXPORT WebView : public View, diff --git a/patch/patches/tarball_deps.patch b/patch/patches/tarball_deps.patch index 226fd430f..dfd5dfe18 100644 --- a/patch/patches/tarball_deps.patch +++ b/patch/patches/tarball_deps.patch @@ -1,8 +1,8 @@ diff --git DEPS DEPS -index b04b32e1ef0ea7ac3f325f90bbeacaf858b04113..115d14a11919f8f5cb395ef452998ffeff92afe6 100644 +index c2a3d0d1a6a07ffbfe668867cdc210806c4d81e3..8a022c04f90b90bb2b1860be2a46f2629e6696e8 100644 --- DEPS +++ DEPS -@@ -4468,6 +4468,7 @@ hooks = [ +@@ -4554,6 +4554,7 @@ hooks = [ # Update LASTCHANGE. 'name': 'lastchange', 'pattern': '.', @@ -10,7 +10,7 @@ index b04b32e1ef0ea7ac3f325f90bbeacaf858b04113..115d14a11919f8f5cb395ef452998ffe 'action': ['python3', 'src/build/util/lastchange.py', '-o', 'src/build/util/LASTCHANGE'], }, -@@ -4475,7 +4476,7 @@ hooks = [ +@@ -4561,7 +4562,7 @@ hooks = [ # Update lastchange_commit_position.h (only for CrOS). 'name': 'lastchange_commit_position_cros', 'pattern': '.', @@ -19,7 +19,7 @@ index b04b32e1ef0ea7ac3f325f90bbeacaf858b04113..115d14a11919f8f5cb395ef452998ffe 'action': ['python3', 'src/build/util/lastchange.py', '-m', 'CHROMIUM', '--commit-position-header', -@@ -4485,6 +4486,7 @@ hooks = [ +@@ -4571,6 +4572,7 @@ hooks = [ # Update GPU lists version string (for gpu/config). 'name': 'gpu_lists_version', 'pattern': '.', @@ -27,7 +27,7 @@ index b04b32e1ef0ea7ac3f325f90bbeacaf858b04113..115d14a11919f8f5cb395ef452998ffe 'action': ['python3', 'src/build/util/lastchange.py', '-m', 'GPU_LISTS_VERSION', '--revision-id-only', -@@ -4494,6 +4496,7 @@ hooks = [ +@@ -4580,6 +4582,7 @@ hooks = [ # Update skia_commit_hash.h. 'name': 'lastchange_skia', 'pattern': '.', @@ -35,7 +35,7 @@ index b04b32e1ef0ea7ac3f325f90bbeacaf858b04113..115d14a11919f8f5cb395ef452998ffe 'action': ['python3', 'src/build/util/lastchange.py', '-m', 'SKIA_COMMIT_HASH', '-s', 'src/third_party/skia', -@@ -4503,6 +4506,7 @@ hooks = [ +@@ -4589,6 +4592,7 @@ hooks = [ # Update dawn_version.h. 'name': 'lastchange_dawn', 'pattern': '.', diff --git a/patch/patches/tarball_gclient.patch b/patch/patches/tarball_gclient.patch index 847edf8e0..3496e99ea 100644 --- a/patch/patches/tarball_gclient.patch +++ b/patch/patches/tarball_gclient.patch @@ -1,8 +1,8 @@ diff --git gclient.py gclient.py -index 9f19223375a6e7beff929bafdf10c72dc6c434fb..07cc34a73a67481d6485d06e337a2fb1ac63bd12 100755 +index c9bf69dac6b34a3c1e7e6ff49817832905c0bede..738503efef69316023ec466d645e4784388b5ad1 100755 --- gclient.py +++ gclient.py -@@ -1123,7 +1123,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): +@@ -1116,7 +1116,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): if self.git_dependencies_state == gclient_eval.SUBMODULES: deps.update(self.ParseGitSubmodules()) @@ -12,7 +12,7 @@ index 9f19223375a6e7beff929bafdf10c72dc6c434fb..07cc34a73a67481d6485d06e337a2fb1 # Git submodules are used - get their state. self._known_dependency_diff = self.CreateSCM().GetSubmoduleDiff() self._dependency_index_state = ( -@@ -1363,7 +1364,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): +@@ -1355,7 +1356,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ) if not revision_override and not self.managed: revision_override = "unmanaged" @@ -21,7 +21,7 @@ index 9f19223375a6e7beff929bafdf10c72dc6c434fb..07cc34a73a67481d6485d06e337a2fb1 # Create a shallow copy to mutate revision. options = copy.copy(options) options.revision = revision_override -@@ -3330,7 +3331,12 @@ class CipdDependency(Dependency): +@@ -3337,7 +3338,12 @@ class CipdDependency(Dependency): fp = os.path.join( parent.root.root_dir, parent.name, dep_value["version_file"] ) diff --git a/patch/patches/ui_base_x11_util.patch b/patch/patches/ui_base_x11_util.patch index 05a209cd0..70132d256 100644 --- a/patch/patches/ui_base_x11_util.patch +++ b/patch/patches/ui_base_x11_util.patch @@ -1,8 +1,8 @@ diff --git ui/base/x/x11_util.h ui/base/x/x11_util.h -index d45396238fc802444b5db1bb3d56c9aab6309f05..327f1d2c7da171479afab4643b570384a9e69b08 100644 +index 508a3461d03309b8fac6d3bcf9df5d83335b2cc9..309a731ea5b720000b05772de26aa0080a794d15 100644 --- ui/base/x/x11_util.h +++ ui/base/x/x11_util.h -@@ -246,8 +246,9 @@ x11::Future SendClientMessage( +@@ -245,8 +245,9 @@ x11::Future SendClientMessage( x11::Window target, x11::Atom type, const std::array data, diff --git a/patch/patches/ui_views_widget_type.patch b/patch/patches/ui_views_widget_type.patch index 67613dc04..1a6896026 100644 --- a/patch/patches/ui_views_widget_type.patch +++ b/patch/patches/ui_views_widget_type.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/chrome_views_delegate_linux.cc chrome/browser/ui/views/chrome_views_delegate_linux.cc -index e0f5a80dda90a9df2d309acdb7952e891dbc189a..a6e4d853749fca8ea4c50384c358a7dbbc35b013 100644 +index c5808a079716b9b21039c0d30d7625a1ed6f26d4..2c9f04a07c16dba3d9af635ebd41679837becfa3 100644 --- chrome/browser/ui/views/chrome_views_delegate_linux.cc +++ chrome/browser/ui/views/chrome_views_delegate_linux.cc -@@ -70,6 +70,8 @@ NativeWidgetType GetNativeWidgetTypeForInitParams( +@@ -87,6 +87,8 @@ NativeWidgetType GetNativeWidgetTypeForInitParams( } return (params.parent && @@ -12,10 +12,10 @@ index e0f5a80dda90a9df2d309acdb7952e891dbc189a..a6e4d853749fca8ea4c50384c358a7db params.type != views::Widget::InitParams::TYPE_TOOLTIP) ? NativeWidgetType::kNativeWidgetAura diff --git ui/views/test/desktop_test_views_delegate_aura.cc ui/views/test/desktop_test_views_delegate_aura.cc -index 18281d9a3002647786ca99b2b2bd7bef104154a0..5e86ab38b9e35044a879475846ed8d600352a1e5 100644 +index 78aa8726deedc16639d10892717a69d85e038eb4..f4d20b39b844abe9afc9cb6557db6fbc217a5b9d 100644 --- ui/views/test/desktop_test_views_delegate_aura.cc +++ ui/views/test/desktop_test_views_delegate_aura.cc -@@ -27,7 +27,8 @@ void DesktopTestViewsDelegate::OnBeforeWidgetInit( +@@ -29,7 +29,8 @@ void DesktopTestViewsDelegate::OnBeforeWidgetInit( return; } diff --git a/patch/patches/v8_build.patch b/patch/patches/v8_build.patch index c5152f99a..fb70be916 100644 --- a/patch/patches/v8_build.patch +++ b/patch/patches/v8_build.patch @@ -1,5 +1,5 @@ diff --git BUILD.gn BUILD.gn -index 39f578a9c8e3d2053164307095e2860191e05443..2b6ba065a03df9c21d822a922f8f820a3907d642 100644 +index 76391be1666b0b2e57c91bdac59070224e57ce24..875a51541b36aa6f9ace78b4464642d53b8f8bff 100644 --- BUILD.gn +++ BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/mips.gni") @@ -10,7 +10,7 @@ index 39f578a9c8e3d2053164307095e2860191e05443..2b6ba065a03df9c21d822a922f8f820a import("//third_party/icu/config.gni") import("gni/cluster_build.gni") -@@ -497,6 +498,9 @@ declare_args() { +@@ -507,6 +508,9 @@ declare_args() { # Experimental testing mode where various limits are artificially set lower. v8_lower_limits_mode = false @@ -20,7 +20,7 @@ index 39f578a9c8e3d2053164307095e2860191e05443..2b6ba065a03df9c21d822a922f8f820a # Enables the use of PartitionAlloc as the default allocator for standalone # d8. This should be used for benchmarking and testing purposes to more # closely mimic in-browser behavior. -@@ -948,6 +952,10 @@ config("internal_config") { +@@ -959,6 +963,10 @@ config("internal_config") { defines += [ "BUILDING_V8_SHARED" ] } diff --git a/patch/patches/views_1749_2102_3330.patch b/patch/patches/views_1749_2102_3330.patch index 0d1d40c46..b8e1dc9d9 100644 --- a/patch/patches/views_1749_2102_3330.patch +++ b/patch/patches/views_1749_2102_3330.patch @@ -1,43 +1,28 @@ diff --git chrome/browser/ui/views/toolbar/app_menu.cc chrome/browser/ui/views/toolbar/app_menu.cc -index 31083766a081e411a7089e2088c427cca9209f63..0e75104e16462e2f04f4a096ba09d992c2eeb936 100644 +index 70fb4d8ce343c782d51557edee87c94e55ce58aa..fd4c32ca14d05b7a31c2d671a394b57ef7d892e3 100644 --- chrome/browser/ui/views/toolbar/app_menu.cc +++ chrome/browser/ui/views/toolbar/app_menu.cc -@@ -1134,12 +1134,14 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { - UMA_HISTOGRAM_ENUMERATION("WrenchMenu.MenuAction", MENU_ACTION_MENU_OPENED, - LIMIT_MENU_ACTION); - -- menu_runner_->RunMenuAt( -- host->button()->GetWidget(), host, -- host->button()->GetAnchorBoundsInScreen(), -- views::MenuAnchorPosition::kTopRight, ui::mojom::MenuSourceType::kNone, -- /*native_view_for_gestures=*/gfx::NativeView(), /*corners=*/std::nullopt, -- "Chrome.AppMenu.MenuHostInitToNextFramePresented"); -+ menu_runner_->RunMenuAt(host->button()->GetWidget(), host, -+ host->button()->GetAnchorBoundsInScreen(), -+ views::MenuAnchorPosition::kTopRight, -+ ui::mojom::MenuSourceType::kNone, -+ /*native_view_for_gestures=*/gfx::NativeView(), +@@ -1141,6 +1141,7 @@ void AppMenu::RunMenu(views::MenuButtonController* host, + host->button()->GetAnchorBoundsInScreen(), + views::MenuAnchorPosition::kTopRight, source_type, + /*native_view_for_gestures=*/gfx::NativeView(), + /*parent_widget=*/gfx::kNullAcceleratedWidget, -+ /*corners=*/std::nullopt, -+ "Chrome.AppMenu.MenuHostInitToNextFramePresented"); + /*corners=*/std::nullopt, + "Chrome.AppMenu.MenuHostInitToNextFramePresented"); } - - void AppMenu::RunMenu(views::Widget* parent, -@@ -1151,7 +1153,8 @@ void AppMenu::RunMenu(views::Widget* parent, - menu_runner_->RunMenuAt( - parent, nullptr, anchor_screen_bounds, - views::MenuAnchorPosition::kTopRight, ui::mojom::MenuSourceType::kNone, -- /*native_view_for_gestures=*/gfx::NativeView(), /*corners=*/std::nullopt, -+ /*native_view_for_gestures=*/gfx::NativeView(), -+ /*parent_widget=*/gfx::kNullAcceleratedWidget, /*corners=*/std::nullopt, - "Chrome.AppMenu.MenuHostInitToNextFramePresented"); +@@ -1155,6 +1156,7 @@ void AppMenu::RunMenu(views::Widget* parent, + menu_runner_->RunMenuAt(parent, nullptr, anchor_screen_bounds, + views::MenuAnchorPosition::kTopRight, source_type, + /*native_view_for_gestures=*/gfx::NativeView(), ++ /*parent_widget=*/gfx::kNullAcceleratedWidget, + /*corners=*/std::nullopt, + "Chrome.AppMenu.MenuHostInitToNextFramePresented"); } - diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h -index 9352ead32c1240176dfcbb7d03ccd646e4e1a326..8a117ee814217be9bbe91e852904e5e65395acf0 100644 +index e54d2ac3d95d932ab6ee3473e5a06d80fb5f14fb..631a7bec940fab3b8d4c9f322bbbf468695a15a2 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h -@@ -21,8 +21,11 @@ +@@ -22,8 +22,11 @@ // For the friend class below only. class OmniboxContextMenuController; @@ -49,7 +34,7 @@ index 9352ead32c1240176dfcbb7d03ccd646e4e1a326..8a117ee814217be9bbe91e852904e5e6 } namespace views { -@@ -206,6 +209,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel { +@@ -218,6 +221,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel { // |event_flags| is a bit mask of ui::EventFlags. virtual void ActivatedAt(size_t index, int event_flags); @@ -274,10 +259,10 @@ index b1ccc704de42f1acb2ad3cdcf8102f44a5fcc547..1d0dc681104c339a48da896b580b94b3 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 6eb1568079e66dcdb127fee0e30679c86afc26c3..905dca23513b1453ef7b0e7f5874d59a9514c923 100644 +index 6a8ca3233d40714d183c67baf12bcbff16f18bdc..e964d0a5c70b46a65be5d86a6e87591b5bf75e19 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -652,7 +652,8 @@ void MenuController::Run(Widget* parent, +@@ -684,7 +684,8 @@ void MenuController::Run(Widget* parent, ui::mojom::MenuSourceType source_type, MenuType menu_type, bool is_nested_drag, @@ -287,15 +272,15 @@ index 6eb1568079e66dcdb127fee0e30679c86afc26c3..905dca23513b1453ef7b0e7f5874d59a exit_type_ = ExitType::kNone; possible_drag_ = false; drag_in_progress_ = false; -@@ -721,6 +722,7 @@ void MenuController::Run(Widget* parent, - } +@@ -753,6 +754,7 @@ void MenuController::Run(Widget* parent, + SetShowing(true); native_view_for_gestures_ = native_view_for_gestures; + parent_widget_ = parent_widget; // Only create a MenuPreTargetHandler for non-nested menus. Nested menus // will use the existing one. -@@ -2557,6 +2559,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { +@@ -2641,6 +2643,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { params.do_capture = do_capture; params.native_view_for_gestures = native_view_for_gestures_; params.owned_window_anchor = anchor; @@ -303,7 +288,7 @@ index 6eb1568079e66dcdb127fee0e30679c86afc26c3..905dca23513b1453ef7b0e7f5874d59a if (item->GetParentMenuItem()) { params.context = item->GetWidget(); // (crbug.com/1414232) The item to be open is a submenu. Make sure -@@ -3299,7 +3302,11 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( +@@ -3383,7 +3386,11 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -316,7 +301,7 @@ index 6eb1568079e66dcdb127fee0e30679c86afc26c3..905dca23513b1453ef7b0e7f5874d59a return; } -@@ -3324,6 +3331,7 @@ void MenuController::CloseSubmenu() { +@@ -3415,6 +3422,7 @@ void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); if (!item->GetParentMenuItem()) { @@ -325,10 +310,10 @@ index 6eb1568079e66dcdb127fee0e30679c86afc26c3..905dca23513b1453ef7b0e7f5874d59a } if (item->SubmenuIsShowing()) { diff --git ui/views/controls/menu/menu_controller.h ui/views/controls/menu/menu_controller.h -index 1e7dd4cc0d23bede368884fad833928188109370..0e883c6dad50a8b33232b69d39785911d0c42b6d 100644 +index 263f2fa8c226f801c7b76ba943298df26b3a93db..56c3d556bd4a12be089799e8ec9d9c3ff12f4f0c 100644 --- ui/views/controls/menu/menu_controller.h +++ ui/views/controls/menu/menu_controller.h -@@ -147,7 +147,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, +@@ -162,7 +162,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, ui::mojom::MenuSourceType source_type = ui::mojom::MenuSourceType::kNone, MenuType menu_type = MenuType::kNormal, bool is_nested_drag = false, @@ -338,7 +323,7 @@ index 1e7dd4cc0d23bede368884fad833928188109370..0e883c6dad50a8b33232b69d39785911 bool for_drop() const { return for_drop_; } -@@ -751,6 +752,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, +@@ -774,6 +775,8 @@ class VIEWS_EXPORT MenuController final : public gfx::AnimationDelegate, // RunType::SEND_GESTURE_EVENTS_TO_OWNER is set. gfx::NativeView native_view_for_gestures_ = gfx::NativeView(); @@ -423,10 +408,10 @@ index 0fcc13c805a643c96f682d10bfeb8ffdf6a64db1..3e5711779ba1d8226adc6440eb4010f3 explicit MenuHost(SubmenuView* submenu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index b181edb034da3e9bee31f942c18a72fabad9de16..ba0cb30bb69fbde4d10b140e79442bc6ccfd20bc 100644 +index 6fe4dfeca36a5213738a6f5420bb1fac90d8acf6..189ab7e0070dda9ca9e8ac638360daae8a8c9403 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1265,6 +1265,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1282,6 +1282,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, SkRRect rounded_rect; rounded_rect.setRectRadii(gfx::RectFToSkRect(highlight_bounds), radii); canvas->sk_canvas()->drawRRect(rounded_rect, flags); @@ -442,7 +427,7 @@ index b181edb034da3e9bee31f942c18a72fabad9de16..ba0cb30bb69fbde4d10b140e79442bc6 } else if (paint_as_selected) { gfx::Rect item_bounds = GetLocalBounds(); if (menu_item_background_.has_value()) { -@@ -1357,6 +1366,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -1372,6 +1381,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const { @@ -600,7 +585,7 @@ index 95efc9eb0c5226c433957834abc32ce19517c702..5d643290ba9287a00e90fa3f2ccb8916 std::optional show_menu_host_duration_histogram = std::nullopt); diff --git ui/views/controls/menu/menu_runner_impl.cc ui/views/controls/menu/menu_runner_impl.cc -index 4550aba6ee0ebbdfa508119846a8dc3a5815e7d4..0f4e54de553961d448afae5c3d4b828d9b07ce06 100644 +index 4bc381a5c5a35716c8753ec50833ab6e0ee82fc5..5adbdc14bb0e761c12d5065a4fa7ccab72d3be2f 100644 --- ui/views/controls/menu/menu_runner_impl.cc +++ ui/views/controls/menu/menu_runner_impl.cc @@ -119,6 +119,7 @@ void MenuRunnerImpl::RunMenuAt( @@ -611,7 +596,7 @@ index 4550aba6ee0ebbdfa508119846a8dc3a5815e7d4..0f4e54de553961d448afae5c3d4b828d std::optional corners, std::optional show_menu_host_duration_histogram) { closing_event_time_ = base::TimeTicks(); -@@ -205,7 +206,7 @@ void MenuRunnerImpl::RunMenuAt( +@@ -204,7 +205,7 @@ void MenuRunnerImpl::RunMenuAt( controller->Run(parent, button_controller, menu_.get(), bounds, anchor, source_type, menu_type, (run_types & MenuRunner::NESTED_DRAG) != 0, @@ -745,10 +730,10 @@ index 1b5d97c3f6b49dbd4daa6dff81e44b1e3d56e283..3da7b69d6f7d073d6a9a3812f829ee66 void MenuRunnerImplMac::Cancel() { diff --git ui/views/controls/menu/menu_runner_impl_remote_cocoa.h ui/views/controls/menu/menu_runner_impl_remote_cocoa.h -index 3f3f6c44bc323354008a118b023507e14f39f4df..2c7224db5584d13cb472b2c42b69ed4d12163ed1 100644 +index d2adffd4b5f9faacd09760f384ef46b752173698..e4550cc8dcbdaedd569fb85d39b0743d0dbc9db5 100644 --- ui/views/controls/menu/menu_runner_impl_remote_cocoa.h +++ ui/views/controls/menu/menu_runner_impl_remote_cocoa.h -@@ -58,6 +58,7 @@ class VIEWS_EXPORT MenuRunnerImplRemoteCocoa +@@ -62,6 +62,7 @@ class VIEWS_EXPORT MenuRunnerImplRemoteCocoa ui::mojom::MenuSourceType source_type, int32_t run_types, gfx::NativeView native_view_for_gestures, @@ -757,10 +742,10 @@ index 3f3f6c44bc323354008a118b023507e14f39f4df..2c7224db5584d13cb472b2c42b69ed4d std::optional show_menu_host_duration_histogram) override; void Cancel() override; diff --git ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm -index da772edd48c0029b2672e3af0a07e1e695d383e6..43c930e932287a4ee597c5c8b6a35a3e5bd30a22 100644 +index fa04c9c73bba6aa9d142856d9177ad91e3f05a05..49482a32c751e2c6ac4a28bd4b162cd27283e3f6 100644 --- ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm +++ ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm -@@ -71,6 +71,7 @@ void MenuRunnerImplRemoteCocoa::RunMenuAt( +@@ -75,6 +75,7 @@ void MenuRunnerImplRemoteCocoa::RunMenuAt( ui::mojom::MenuSourceType source_type, int32_t run_types, gfx::NativeView native_view_for_gestures, diff --git a/patch/patches/views_textfield_5399416.patch b/patch/patches/views_textfield_5399416.patch index 4f433465f..b3ca1906c 100644 --- a/patch/patches/views_textfield_5399416.patch +++ b/patch/patches/views_textfield_5399416.patch @@ -1,8 +1,8 @@ diff --git ui/views/controls/textfield/textfield.cc ui/views/controls/textfield/textfield.cc -index a1a4190147875b6849136ec81dfd5b14e5a8d2ee..779b810f3a7204f9390ce83ea46e7cad5f574651 100644 +index 67061f8ed25119c92df7ad20d4284d1e1163cbe2..ead99d7842f1f51c1384a1d3ee31be4346d587ea 100644 --- ui/views/controls/textfield/textfield.cc +++ ui/views/controls/textfield/textfield.cc -@@ -3321,6 +3321,10 @@ void Textfield::OnEnabledChanged() { +@@ -3329,6 +3329,10 @@ void Textfield::OnEnabledChanged() { if (GetInputMethod()) { GetInputMethod()->OnTextInputTypeChanged(this); } @@ -12,4 +12,4 @@ index a1a4190147875b6849136ec81dfd5b14e5a8d2ee..779b810f3a7204f9390ce83ea46e7cad + } UpdateDefaultBorder(); - // Only expose readonly if enabled. Don't overwrite the disabled restriction. + if (GetWidget()) { diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 0059990d0..40637b865 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -61,10 +61,10 @@ index 23f1d02112a64e13b150bc38d07848fde1a6b4e2..dbdf6ebff4901a54808f55971dd37848 case ui::mojom::WindowShowState::kMaximized: 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 90bcd2280566727fde58edc93c370f2af20ca0ef..796221b15d6ae553858c7bc7208e747b57128a34 100644 +index e636ae0c6205c03414d562775194deabb7760ad8..481f7a1826104ae9626a6a62d5e733c4b57491aa 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -725,6 +725,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { +@@ -711,6 +711,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { return scale_override_for_capture_; } @@ -80,7 +80,7 @@ index 90bcd2280566727fde58edc93c370f2af20ca0ef..796221b15d6ae553858c7bc7208e747b 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 39aa17737a96018776a97f831415f6b7ca10c395..43069e8190704f51286e8dd4472e5a58aed7c67a 100644 +index fbaad741af816c489092915a2fd856dcc5eee91e..1c6a52f4201060e58e319bd4633cd2cd30709aef 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -90,6 +90,7 @@ namespace content { @@ -98,10 +98,10 @@ index 39aa17737a96018776a97f831415f6b7ca10c395..43069e8190704f51286e8dd4472e5a58 + void SetHasExternalParent(bool val) override; + bool HasExternalParent() const override; + - // 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 -@@ -281,6 +285,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase + // For testing only. + virtual ui::FilteredGestureProvider* GetFilteredGestureProviderForTesting(); + +@@ -266,6 +270,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // Called when screen information or native widget bounds change. virtual void UpdateScreenInfo(); @@ -112,7 +112,7 @@ index 39aa17737a96018776a97f831415f6b7ca10c395..43069e8190704f51286e8dd4472e5a58 // 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_| -@@ -407,6 +415,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -393,6 +401,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase const gfx::Rect& bounds, const gfx::Rect& anchor_rect) = 0; @@ -125,7 +125,7 @@ index 39aa17737a96018776a97f831415f6b7ca10c395..43069e8190704f51286e8dd4472e5a58 // Indicates whether the page has finished loading. virtual void SetIsLoading(bool is_loading) = 0; -@@ -734,6 +748,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -722,6 +736,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // to all displays. gfx::Size system_cursor_size_; @@ -136,7 +136,7 @@ index 39aa17737a96018776a97f831415f6b7ca10c395..43069e8190704f51286e8dd4472e5a58 private: FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, -@@ -755,10 +773,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -743,10 +761,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase void SynchronizeVisualProperties(); @@ -196,7 +196,7 @@ index 36dcb04e400fa7bac58d5b8aa89151707a9666a1..89a152a8047b73945ce922789248642b 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 673cb3358be84b0fe16b3c134cc19b77842ed366..0de25164e11ea9307e46d521e12c4528ae279e37 100644 +index 6b7a3301cb50e43d9d0ad983603750bd86886f72..ef51e6fe076d32ea23121ac5b38f82c8b68e1568 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h @@ -273,6 +273,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -215,10 +215,10 @@ index 673cb3358be84b0fe16b3c134cc19b77842ed366..0de25164e11ea9307e46d521e12c4528 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git third_party/blink/renderer/core/frame/web_frame_widget_impl.cc third_party/blink/renderer/core/frame/web_frame_widget_impl.cc -index 7d315476ca504a95bfb0bd0b5be95c6fe72483dc..6488e45ca9ef3975f2f4d3dc939bed94a9adf03e 100644 +index bcb63b49c8be96af7ec2f4b19cbfbb341f44e48b..8c792293cf79ce7f1296622135d44be4c2e64a12 100644 --- third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ third_party/blink/renderer/core/frame/web_frame_widget_impl.cc -@@ -6015,6 +6015,7 @@ void WebFrameWidgetImpl::OnWindowShowStateChanged( +@@ -6100,6 +6100,7 @@ void WebFrameWidgetImpl::OnWindowShowStateChanged( break; case WindowShowState::kInactive: case WindowShowState::kFullscreen: @@ -258,10 +258,10 @@ index aeaf8e35f7eda89598149117fe8508d197bf2610..4b7cc3f03d3cf9c91ac8efe11ae820cf + [MinVersion=1] kEnd = 7, }; diff --git ui/ozone/platform/x11/x11_window.cc ui/ozone/platform/x11/x11_window.cc -index 3605885b576cadf63b5db90cf46bb335c886d57a..92020fff92de1a1755475026fbbe8bec2bf03ed1 100644 +index 523ddb31b87ded9e4cea39ff2f15f0845dfb9d34..70a4ae4e713e2eb7f7c3b255675dc74d4834a031 100644 --- ui/ozone/platform/x11/x11_window.cc +++ ui/ozone/platform/x11/x11_window.cc -@@ -1935,7 +1935,17 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1936,7 +1936,17 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; last_set_bounds_px_ = SanitizeBounds(bounds); @@ -294,10 +294,10 @@ index 077855979045d4862abd099ec16befa0fcecff65..69f369b06c29e65dead98a52cc8b743e return host ? host->GetAcceleratedWidget() : nullptr; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -index 1bd2dcc9302e09676d46c80e0706f3cc3ade47b3..262a2aab9fe7bd82eb8d8df305c80d3a8e7bc80c 100644 +index 3b6e7c0b55b8cfdbad42237dfd7082e520976bb3..2b750b7991131e12c1100b17a3fba2be946ff122 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -@@ -30,6 +30,7 @@ +@@ -31,6 +31,7 @@ #include "ui/linux/linux_ui.h" #include "ui/linux/window_frame_provider.h" #include "ui/native_theme/native_theme.h" @@ -305,7 +305,7 @@ index 1bd2dcc9302e09676d46c80e0706f3cc3ade47b3..262a2aab9fe7bd82eb8d8df305c80d3a #include "ui/platform_window/extensions/wayland_extension.h" #include "ui/platform_window/extensions/x11_extension.h" #include "ui/platform_window/platform_window.h" -@@ -350,6 +351,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( +@@ -373,6 +374,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( return result; } @@ -324,7 +324,7 @@ index 1bd2dcc9302e09676d46c80e0706f3cc3ade47b3..262a2aab9fe7bd82eb8d8df305c80d3a void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { // In Windows, the native events sent to chrome are separated into client // and non-client versions of events, which we record on our LocatedEvent -@@ -491,6 +504,15 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( +@@ -514,6 +527,15 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( properties->wayland_app_id = params.wayland_app_id; properties->startup_id = params.startup_id; @@ -341,7 +341,7 @@ index 1bd2dcc9302e09676d46c80e0706f3cc3ade47b3..262a2aab9fe7bd82eb8d8df305c80d3a properties->x11_extension_delegate = this; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -index d440180f99339d3d9da1468ad0e5bf07a141c220..f4f7b69b2d843b8caf6edaef5312fe461f99e64f 100644 +index 73e98a4aa21bfe514287e5138909de11a98ffe15..2ae913e294c579a20d97780523f24a981d49e890 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h @@ -70,6 +70,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux @@ -353,7 +353,7 @@ index d440180f99339d3d9da1468ad0e5bf07a141c220..f4f7b69b2d843b8caf6edaef5312fe46 protected: // Overridden from DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override; -@@ -79,6 +81,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -81,6 +83,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux const gfx::Vector2d& drag_offset, Widget::MoveLoopSource source, Widget::MoveLoopEscapeBehavior escape_behavior) override; @@ -362,7 +362,7 @@ index d440180f99339d3d9da1468ad0e5bf07a141c220..f4f7b69b2d843b8caf6edaef5312fe46 // PlatformWindowDelegate: gfx::Insets CalculateInsetsInDIP( -@@ -146,6 +150,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -148,6 +152,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux base::ScopedObservation theme_observation_{this}; @@ -388,10 +388,10 @@ index 8c01e0ab6b68b07a2bfe331c03b7e536edb1db18..6c75cfc0a4ddb0890c55eda4e542fbe0 // 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 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99f2efdcd9 100644 +index 634640338e2951d852d9f5df5f7f0e48d97d00e8..2da5feee19ae8fc5ad2bd3798c0fbdd58500708c 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -28,6 +28,7 @@ +@@ -30,6 +30,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/focus_client.h" @@ -399,7 +399,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 #include "ui/aura/window_event_dispatcher.h" #include "ui/base/class_property.h" #include "ui/base/cursor/cursor.h" -@@ -203,17 +204,30 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -261,7 +262,10 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_.get()); HWND parent_hwnd = nullptr; @@ -409,8 +409,9 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 + has_external_parent_ = true; + } else if (params.parent && params.parent->GetHost()) { parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget(); - } - + } else if (params.context && params.context->GetHost() && + params.type != Widget::InitParams::TYPE_WINDOW && +@@ -274,10 +278,20 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); z_order_ = params.EffectiveZOrderLevel(); @@ -434,7 +435,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 message_handler_->Init(parent_hwnd, pixel_bounds); if (ShouldAddDWMBackdrop()) { -@@ -238,6 +252,13 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -302,6 +316,13 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { InitHost(); window()->Show(); @@ -448,7 +449,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 // 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. -@@ -1121,6 +1142,16 @@ void DesktopWindowTreeHostWin::HandleCreate() { +@@ -1189,6 +1210,16 @@ void DesktopWindowTreeHostWin::HandleCreate() { } void DesktopWindowTreeHostWin::HandleDestroying() { @@ -465,7 +466,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); if (native_widget_delegate_) { native_widget_delegate_->OnNativeWidgetDestroying(); -@@ -1226,6 +1257,18 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { +@@ -1294,6 +1325,18 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { if (restored) { window()->Show(); @@ -484,7 +485,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 } else { window()->Hide(); } -@@ -1247,11 +1290,17 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -1315,11 +1358,17 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -504,7 +505,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 } bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { -@@ -1260,6 +1309,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { +@@ -1328,6 +1377,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { return true; } @@ -517,7 +518,7 @@ index 26a7efd6b9a2feabf3229a8dde05066345b90e1e..cce646097c052bba31e92f56860f7c99 SendEventToSink(event); return event->handled(); } -@@ -1455,9 +1510,18 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { +@@ -1534,9 +1589,18 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { // positions in variable-DPI situations. See https://crbug.com/1224715 for // details. aura::Window* root = nullptr; @@ -565,10 +566,10 @@ index 15a86085de29b9f70d78e85825a592a4bdffd9e3..09d07d84a0f418faf757721e7ca45639 // 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 2f99bb508f1761405bb5dba004878c4db25965bf..be0b9a0ae4a9f0a79477c28a8f5f5feb37d699b1 100644 +index 4b50e1882176b4e5e0a077c0f96a6a405ddf1826..dc257ff2955d820918cb4d9df2753afb488768b1 100644 --- ui/views/widget/native_widget_mac.mm +++ ui/views/widget/native_widget_mac.mm -@@ -768,6 +768,7 @@ void NativeWidgetMac::Show(ui::mojom::WindowShowState show_state, +@@ -769,6 +769,7 @@ void NativeWidgetMac::Show(ui::mojom::WindowShowState show_state, break; case ui::mojom::WindowShowState::kMaximized: case ui::mojom::WindowShowState::kFullscreen: @@ -577,10 +578,10 @@ index 2f99bb508f1761405bb5dba004878c4db25965bf..be0b9a0ae4a9f0a79477c28a8f5f5feb break; case ui::mojom::WindowShowState::kEnd: diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b0dcc6f86 100644 +index 2574bc2da3a76201a17c59110e58d135623abe7b..c15ee197c4219d66e1f68bbfdbd95ec1104b85c6 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -244,8 +244,8 @@ ui::ZOrderLevel Widget::InitParams::EffectiveZOrderLevel() const { +@@ -268,8 +268,8 @@ ui::ZOrderLevel Widget::InitParams::EffectiveZOrderLevel() const { } } @@ -591,7 +592,7 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b } void Widget::InitParams::SetParent(gfx::NativeView parent_view) { -@@ -506,7 +506,8 @@ void Widget::Init(InitParams params) { +@@ -534,7 +534,8 @@ void Widget::Init(InitParams params) { } params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -601,7 +602,7 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b is_autosized_ = params.autosize; if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && -@@ -607,9 +608,14 @@ void Widget::Init(InitParams params) { +@@ -635,9 +636,14 @@ void Widget::Init(InitParams params) { if (show_state == ui::mojom::WindowShowState::kMaximized) { Maximize(); @@ -616,7 +617,7 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b } #if BUILDFLAG(IS_CHROMEOS) -@@ -622,7 +628,12 @@ void Widget::Init(InitParams params) { +@@ -650,7 +656,12 @@ void Widget::Init(InitParams params) { } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); if (should_set_initial_bounds) { @@ -630,7 +631,7 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b } } -@@ -2101,10 +2112,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { +@@ -2170,10 +2181,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { } gfx::Size Widget::GetMinimumSize() const { @@ -647,7 +648,7 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); } -@@ -2410,7 +2427,8 @@ bool Widget::SetInitialFocus(ui::mojom::WindowShowState show_state) { +@@ -2479,7 +2496,8 @@ bool Widget::SetInitialFocus(ui::mojom::WindowShowState show_state) { View* v = widget_delegate_->GetInitiallyFocusedView(); if (!focus_on_creation_ || show_state == ui::mojom::WindowShowState::kInactive || @@ -658,10 +659,10 @@ index edb9eb307d53fae9cb8853de2a9deee06ecb4545..8873603850fea9acb990949f56bb489b // focus when the window is restored. if (v) { diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 27656ce25c55291eb2c7e173b19bc1e06a9d41b1..eef1c81cda31a84943d8515f1f8e344684380907 100644 +index 4b71f0122b45668b0e3c0be11c1b0ef909273e4d..156b5371ab7c8c59946b068ec0fd196349ab3e7a 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -442,6 +442,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -445,6 +445,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // setters above. gfx::NativeView parent = gfx::NativeView(); @@ -670,7 +671,7 @@ index 27656ce25c55291eb2c7e173b19bc1e06a9d41b1..eef1c81cda31a84943d8515f1f8e3446 // Specifies the initial bounds of the Widget. Default is empty, which means // the NativeWidget may specify a default size. If the parent is specified // and the widget type is not WINDOW_TYPE_POPUP, `bounds` is in the parent's -@@ -958,7 +960,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -971,7 +973,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, void SetVisible(bool visible); // Activates the widget, assuming it already exists and is visible. @@ -680,10 +681,10 @@ index 27656ce25c55291eb2c7e173b19bc1e06a9d41b1..eef1c81cda31a84943d8515f1f8e3446 // 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 0581c9653c1f0d2c704e2d7e71f57c1149008912..09edcc73d6ef583676ad79a107e5b408e199357e 100644 +index fa5a0e60bcafc43f46b191f05080a2bbc51722ba..1fc281e20b324a8236b02771876cc5026b3ebc6c 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -777,6 +777,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -773,6 +773,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -709,10 +710,10 @@ index 56ed7cad8652cf57e597bb7f369e9e659ea6ed4d..e5f68885fa41fc9da62e746ca790816b if (native_widget_delegate->IsDialogBox()) { diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 019f0d2a3e7241fb7131ce9a62b0b3c1e08e3a4e..bee5fd529d736a6cfa278d68d46a8c091b1b8cee 100644 +index 42fd0087319f0ce9a15b327b52403607e08d092a..fed80bd5d23de0a1fdb707ed236bc7b839718bf2 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -907,7 +907,11 @@ bool HWNDMessageHandler::IsVisible() const { +@@ -916,7 +916,11 @@ bool HWNDMessageHandler::IsVisible() const { } bool HWNDMessageHandler::IsActive() const { @@ -725,7 +726,7 @@ index 019f0d2a3e7241fb7131ce9a62b0b3c1e08e3a4e..bee5fd529d736a6cfa278d68d46a8c09 } bool HWNDMessageHandler::IsMinimized() const { -@@ -3522,10 +3526,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3483,10 +3487,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::EventType::kMousewheel) { 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 5b51dfc02..6e8c00097 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -66,7 +66,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index ae70acf5713bc7a0506e3ffbc02ed4b039e980af..88d42a04b6f6923f9d50e18052aacddd7a684e7f 100644 +index 2003602cb1be887ebfea1233e67b1fff0bb455bd..98881caf3deca2cea67f93c09fd5026796f5ee02 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn @@ -284,6 +284,8 @@ viz_component("service") { @@ -187,7 +187,7 @@ index 4f9e8946fa02d859e92a6896beba82721914f868..cf20c96a84c5551eba592fecfce21350 TRACE_EVENT_BEGIN("viz", "SoftwareOutputDeviceWinProxy::Draw", diff --git components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc -index dd725f8cf0819e1216afa638f3f819071adff851..b3b0910e1de12886da6f5be93c7f60f9ef16b3fe 100644 +index be30bdc58bbd50fc735772106a9dda78fb5ddf1f..18aa76c5f7268c221bc345a8f648a812c291e451 100644 --- components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc @@ -131,7 +131,8 @@ RootCompositorFrameSinkImpl::Create( @@ -229,7 +229,7 @@ index 399fba1a3d4e601dc2cdd5f1f4def8b7fd7a3011..e784943296025be191918397b3f4164e gpu::SyncPointManager* GetSyncPointManager() override; gpu::Scheduler* GetGpuScheduler() override; diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index 236c555933a572f8d3d2165db8f3b0425f187321..36bfe176caa0feb7ed01ac930b3b3edcfddff781 100644 +index 7ca2539e761b40c55671b815e8403ffe59c18d0f..480d5f2665fed34a3d7a2fde209efb2db941ae2e 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc @@ -394,8 +394,15 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( @@ -272,7 +272,7 @@ index e9773085029937d9192392c9ace0a85c0fcde1cb..7c7f14f6c396ef803731dcd83a51ba6d // For destroying the GL context/surface that draw to a platform window before // the platform window is destroyed. diff --git services/viz/privileged/mojom/compositing/display_private.mojom services/viz/privileged/mojom/compositing/display_private.mojom -index 8b274ed5c6ad8f18d8796da2581b51ca32e9317c..95ce03d0d02274b8cc937918e26acb4d8164f3e6 100644 +index f0899f2c823dd77bdff63e1f9ae1d89ce1d85caa..fb1b88b359d4caa1b1162b9e4c4200e82f0c764a 100644 --- services/viz/privileged/mojom/compositing/display_private.mojom +++ services/viz/privileged/mojom/compositing/display_private.mojom @@ -124,7 +124,6 @@ interface DisplayClient { @@ -308,7 +308,7 @@ index 2f462f0deb5fc8a637457243fb5d5849fc214d14..695869b83cefaa24af93a2e11b39de05 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 2275ebd9d6d44886bcc76f713b6594a28b7548fe..16922ed51d5ed95af1f1151805db36da4847b687 100644 +index 8a8a9d14d52d821205d7dd76e7e1df78c534e7b0..01e5d3c63e02385f0b78b9b3aeace5eb9b07d4fa 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -35,7 +35,9 @@ @@ -347,7 +347,7 @@ index 2275ebd9d6d44886bcc76f713b6594a28b7548fe..16922ed51d5ed95af1f1151805db36da // 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 -@@ -624,6 +638,8 @@ class COMPOSITOR_EXPORT Compositor +@@ -626,6 +640,8 @@ class COMPOSITOR_EXPORT Compositor simple_begin_frame_observers_; std::unique_ptr host_begin_frame_observer_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 0be64f956..fdb56af52 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 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666594135fb 100644 +index 0d07dd8bf2dd38614b8f54aa0377211308625ca4..cbc30abe4879c87174e15f6070cafdc49e816315 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -4332,6 +4332,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -4440,6 +4440,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 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -4342,6 +4348,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -4450,6 +4456,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -23,7 +23,7 @@ index 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -4563,6 +4570,9 @@ void WebContentsImpl::RenderWidgetCreated( +@@ -4671,6 +4678,9 @@ void WebContentsImpl::RenderWidgetCreated( OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated", "render_widget_host", render_widget_host); created_widgets_[render_widget_host->GetFrameSinkId()] = render_widget_host; @@ -33,7 +33,7 @@ index 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666 } void WebContentsImpl::RenderWidgetDeleted( -@@ -5595,6 +5605,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -5718,6 +5728,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( create_params.picture_in_picture_options = *(params.pip_options); } @@ -49,7 +49,7 @@ index 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666 // 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. -@@ -10738,6 +10757,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -10966,6 +10985,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, } CloseListenerManager::DidChangeFocusedFrame(this); @@ -60,10 +60,10 @@ index 8ece528e778386ace3bbd60a97c368863d89b144..ea54ca32cb0cc7f644c0abfbdbfc3666 FrameTree* WebContentsImpl::GetOwnedDocumentPictureInPictureFrameTree() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 26a0c7363eafb7907c08198abda5ed094a546690..a72301683480ecb6cde74eeb5e626343f94a5dea 100644 +index 5bb53e8ecfffa77ef7a101d7058f1ed2876cb052..e57fc4d980e8bbe5d60bb3466273bd6c3230bd3c 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -135,6 +135,7 @@ class PreloadPipelineInfo; +@@ -137,6 +137,7 @@ class PreloadPipelineInfo; class PrerenderHandle; class RenderFrameHost; class RenderViewHost; @@ -71,7 +71,7 @@ index 26a0c7363eafb7907c08198abda5ed094a546690..a72301683480ecb6cde74eeb5e626343 class RenderWidgetHost; class RenderWidgetHostView; class ScreenOrientationDelegate; -@@ -142,6 +143,7 @@ class SiteInstance; +@@ -144,6 +145,7 @@ class SiteInstance; class SurfaceEmbedConnector; class UnownedInnerWebContentsClient; class WebContentsDelegate; @@ -79,7 +79,7 @@ index 26a0c7363eafb7907c08198abda5ed094a546690..a72301683480ecb6cde74eeb5e626343 class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -298,6 +300,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData { +@@ -328,6 +330,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData { network::mojom::WebSandboxFlags starting_sandbox_flags = network::mojom::WebSandboxFlags::kNone; @@ -91,7 +91,7 @@ index 26a0c7363eafb7907c08198abda5ed094a546690..a72301683480ecb6cde74eeb5e626343 // the value that'll be returned by GetLastActiveTimeTicks(). If this is // left default initialized then the value is not passed on to the diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index e7ab9bb9e35277de4fb2b13cb3427446274c3394..4d59747fad776c4d74e279cd585c212037a42789 100644 +index c3d8d88a3e436515e6f44e0725123ecd56bb76f1..e7a8e80cd292d1359842e728e5448432b5dfa836 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -113,10 +113,12 @@ class EyeDropperListener; @@ -123,10 +123,10 @@ index e7ab9bb9e35277de4fb2b13cb3427446274c3394..4d59747fad776c4d74e279cd585c2120 // 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 2775a6fd1b7131fb8b1ff109a7b3fcfd63ffc982..3c15c306c996bdb2f10674d6bf51225f46cd4137 100644 +index 9c60c3e494ba6145ad99987fc458b91ded2fc828..ea4fb82e622b2f2662b5f4a723574c203dbdb5e6 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -251,6 +251,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -257,6 +257,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // controlled by the capturing tab. virtual void OnCapturedSurfaceControl() {} @@ -136,7 +136,7 @@ index 2775a6fd1b7131fb8b1ff109a7b3fcfd63ffc982..3c15c306c996bdb2f10674d6bf51225f // 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() {} -@@ -964,6 +967,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -970,6 +973,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // the RenderWidgetHost for the WebContents has gained/lost focus. virtual void OnFocusChangedInPage(const FocusedNodeDetails& details) {} diff --git a/patch/patches/webkit_move_pip.patch b/patch/patches/webkit_move_pip.patch index a752af523..ba52c1724 100644 --- a/patch/patches/webkit_move_pip.patch +++ b/patch/patches/webkit_move_pip.patch @@ -25,10 +25,10 @@ index 10d227e113dd1f4d6b347c8f38419384154fd8d0..4e914c782ecfd1d2a88ef7505f289ff9 int window_diff_height = work_area.bottom() - window_bounds.height(); diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 425fb0e410ff144e322b0dfef17d71fe56344eee..8968ff589adc4de52f9ea4cd98b0680b8610b2f7 100644 +index 822048a25cdf5ee519fda0ab09a48c3ee71d5651..c41ce495d737dc2c50a4574eff2eb337b8990025 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -6990,6 +6990,8 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -7139,6 +7139,8 @@ WebView* RenderFrameImpl::CreateNewWindow( pip_options->disallow_return_to_opener; pip_mojom_opts->prefer_initial_window_placement = pip_options->prefer_initial_window_placement; @@ -105,7 +105,7 @@ index 0d1d81ec7d6b27891a5135961f4c630df82819df..71c67f3c0a28e9182326900b5b090257 ~WebView() = default; }; diff --git third_party/blink/renderer/bindings/generated_in_modules.gni third_party/blink/renderer/bindings/generated_in_modules.gni -index 065779e15ad81c7616c0a6a852ac87c802f66afe..8dc418cce5389765e79283621d2e28d0dd025152 100644 +index 1e3e8468080c44a9f2426f3cc6d43a00c3e2eec2..10f4a61be8cd32be8249bbcc87225193a1501467 100644 --- third_party/blink/renderer/bindings/generated_in_modules.gni +++ third_party/blink/renderer/bindings/generated_in_modules.gni @@ -392,6 +392,10 @@ generated_dictionary_sources_in_modules = [ @@ -120,10 +120,10 @@ index 065779e15ad81c7616c0a6a852ac87c802f66afe..8dc418cce5389765e79283621d2e28d0 "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_document_picture_in_picture_event_init.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_document_picture_in_picture_options.cc", diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 85fbdf2bbb9f4a75e7d4416e2aff16d9ab636808..c6623ca29cc85769260ea64948a927ccdf451575 100644 +index 4b5370c5bdf5a660eac33a1c5758a25b17344750..522768641ee23022876a8646e1e8a44ac1234607 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -321,6 +321,20 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -323,6 +323,20 @@ class CORE_EXPORT WebViewImpl final : public WebView, const ColorProviderColorMaps& color_provider_colors) override; void SetSupportsDraggableRegions(bool supports_draggable_regions) override; @@ -144,7 +144,7 @@ index 85fbdf2bbb9f4a75e7d4416e2aff16d9ab636808..c6623ca29cc85769260ea64948a927cc void DispatchPersistedPageshow(base::TimeTicks navigation_start); void DispatchPagehide(mojom::blink::PagehideDispatch pagehide_dispatch); void HookBackForwardCacheEviction(bool hook); -@@ -1016,6 +1030,9 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -1021,6 +1035,9 @@ class CORE_EXPORT WebViewImpl final : public WebView, // native restoration. Reset on each lifecycle update. bool last_page_lifecycle_state_update_restored_from_bfcache_ = false; @@ -155,7 +155,7 @@ index 85fbdf2bbb9f4a75e7d4416e2aff16d9ab636808..c6623ca29cc85769260ea64948a927cc base::ObserverList observers_; }; diff --git third_party/blink/renderer/core/frame/local_dom_window.cc third_party/blink/renderer/core/frame/local_dom_window.cc -index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d48119d2d 100644 +index cc0f3a60d763c72820c344ac927a636a29536728..150c6565572e25baec498eafe81c98c9c93952d4 100644 --- third_party/blink/renderer/core/frame/local_dom_window.cc +++ third_party/blink/renderer/core/frame/local_dom_window.cc @@ -50,6 +50,7 @@ @@ -174,7 +174,7 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d #include "third_party/blink/renderer/core/html/custom/custom_element_registry.h" #include "third_party/blink/renderer/core/html/custom/custom_element_registry_assignment.h" #include "third_party/blink/renderer/core/html/fenced_frame/fence.h" -@@ -2099,7 +2101,7 @@ void LocalDOMWindow::moveBy(int x, int y) const { +@@ -2104,7 +2106,7 @@ void LocalDOMWindow::moveBy(int x, int y) const { return; } @@ -183,7 +183,7 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d return; } -@@ -2124,7 +2126,7 @@ void LocalDOMWindow::moveTo(int x, int y) const { +@@ -2129,7 +2131,7 @@ void LocalDOMWindow::moveTo(int x, int y) const { return; } @@ -192,7 +192,7 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d return; } -@@ -2152,7 +2154,8 @@ void LocalDOMWindow::resizeBy(int x, +@@ -2157,7 +2159,8 @@ void LocalDOMWindow::resizeBy(int x, } if (IsPictureInPictureWindow()) { @@ -202,7 +202,7 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d exception_state.ThrowDOMException( DOMExceptionCode::kNotAllowedError, "resizeBy() requires user activation in document picture-in-picture"); -@@ -2184,7 +2187,8 @@ void LocalDOMWindow::resizeTo(int width, +@@ -2189,7 +2192,8 @@ void LocalDOMWindow::resizeTo(int width, } if (IsPictureInPictureWindow()) { @@ -212,7 +212,7 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d exception_state.ThrowDOMException( DOMExceptionCode::kNotAllowedError, "resizeTo() requires user activation in document picture-in-picture"); -@@ -2637,6 +2641,12 @@ DOMWindow* LocalDOMWindow::openPictureInPictureWindow( +@@ -2639,6 +2643,12 @@ DOMWindow* LocalDOMWindow::openPictureInPictureWindow( To(result.frame->DomWindow()); pip_dom_window->SetIsPictureInPictureWindow(); @@ -226,10 +226,10 @@ index a4cc2495012a04ad3abba1fe9db32d868014ea11..c4b9a29592ca25867ce04c4e739cfe4d pip_dom_window->document()->SetCompatibilityMode( entered_window->document()->GetCompatibilityMode()); diff --git third_party/blink/renderer/core/frame/local_dom_window.h third_party/blink/renderer/core/frame/local_dom_window.h -index 22c8ee979e0e6e204842afa365377ac276dfd218..99433f5d4dc8606a3ecae728f5fa9817dc4405a0 100644 +index d5063b989abffc03962136ca5c6b2e251f1a91c4..01c1e233fde7c5d84fd99336a9d5102507d9fbc9 100644 --- third_party/blink/renderer/core/frame/local_dom_window.h +++ third_party/blink/renderer/core/frame/local_dom_window.h -@@ -632,6 +632,11 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow, +@@ -644,6 +644,11 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow, void SetIsPictureInPictureWindow(); @@ -241,7 +241,7 @@ index 22c8ee979e0e6e204842afa365377ac276dfd218..99433f5d4dc8606a3ecae728f5fa9817 // Return the viewport size including scrollbars. gfx::Size GetViewportSize() const; -@@ -740,6 +745,8 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow, +@@ -758,6 +763,8 @@ class CORE_EXPORT LocalDOMWindow final : public DOMWindow, // https://wicg.github.io/document-picture-in-picture/ bool is_picture_in_picture_window_ = false; @@ -276,7 +276,7 @@ index de4f0294a2f7ea20517c71cad3d17fb0f1975211..8fa3befaf1d90d20ffe819ed09667511 + [RuntimeEnabled=DocumentPictureInPictureCefOptions] DocumentPictureInPictureCefOptions cefOptions; }; diff --git third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc -index 750e34e58a709f91e2a1a2d8bc7f503b6c8997c7..7409a795021259776b02fddd70f1aa85aaaea0ce 100644 +index 5df3e4101e1224c8ecfef9c18eed12fb3dcd03e0..228bc0e8e96816da679500b47cace21d38a615d6 100644 --- third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc +++ third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc @@ -15,16 +15,20 @@ diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index c1865cc93..0cb0c3d4f 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 a9d0eafacc0b782faecea504ab9bde345f8c4598..a74c85ddf6b5f80ace34c18637cef8dcac4eefb9 100644 +index 9ef66ec39e8cb8ef9a8753baf7bbddc227768d77..5aadd8c8cc82b96b07554fa3de5d5563a3fc34c0 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -887,6 +887,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -884,6 +884,11 @@ class BLINK_PLATFORM_EXPORT Platform { // calling an OOM. virtual void OnV8HeapLastResortGC() {} diff --git a/patch/patches/win_app_icon_3606.patch b/patch/patches/win_app_icon_3606.patch index 6ea68d655..752b6fbb6 100644 --- a/patch/patches/win_app_icon_3606.patch +++ b/patch/patches/win_app_icon_3606.patch @@ -88,29 +88,27 @@ index db8209bbcc2142734d2870ac8174a9b78c60f784..b50bce7fae5b58a8e9f06d7499ec4b80 HICON GetAppIcon(); HICON GetSmallAppIcon(); -diff --git chrome/common/chrome_constants.cc chrome/common/chrome_constants.cc -index 6e30ef11474c457acf1bca690c6a310afb11d751..69121ac0ebfc800d505665da95cc63e703b8f247 100644 ---- chrome/common/chrome_constants.cc -+++ chrome/common/chrome_constants.cc -@@ -5,6 +5,7 @@ - #include "chrome/common/chrome_constants.h" +diff --git chrome/common/chrome_constants.h chrome/common/chrome_constants.h +index 464a435a50d51f6a3d100c74645d8b48e010c1cc..f9cea6ee23ccbe10a1c1a26dc149102ec523d492 100644 +--- chrome/common/chrome_constants.h ++++ chrome/common/chrome_constants.h +@@ -9,6 +9,7 @@ + #include "base/files/file_path.h" #include "build/build_config.h" +#include "cef/libcef/features/features.h" - #include "chrome/common/chrome_version.h" - #define FPL FILE_PATH_LITERAL -@@ -88,7 +89,12 @@ const char kMacHelperSuffixAlerts[] = " (Alerts)"; - #endif // BUILDFLAG(IS_MAC) + namespace chrome { + +@@ -36,7 +37,11 @@ extern const char kMacHelperSuffixAlerts[]; #if BUILDFLAG(IS_WIN) --const base::FilePath::CharType kBrowserResourcesDll[] = FPL("chrome.dll"); -+const base::FilePath::CharType kBrowserResourcesDll[] = + inline constexpr base::FilePath::CharType kBrowserResourcesDll[] = +#if BUILDFLAG(ENABLE_CEF) -+ FPL("libcef.dll"); ++ FILE_PATH_LITERAL("libcef.dll"); +#else -+ FPL("chrome.dll"); + FILE_PATH_LITERAL("chrome.dll"); +#endif - const base::FilePath::CharType kElfDll[] = FPL("chrome_elf.dll"); - const base::FilePath::CharType kStatusTrayWindowClass[] = - FPL("Chrome_StatusTrayWindow"); + inline constexpr base::FilePath::CharType kElfDll[] = + FILE_PATH_LITERAL("chrome_elf.dll"); + inline constexpr base::FilePath::CharType kRendererDll[] = diff --git a/patch/patches/win_ax_platform_node.patch b/patch/patches/win_ax_platform_node.patch index e9f0cd116..51b1f67cb 100644 --- a/patch/patches/win_ax_platform_node.patch +++ b/patch/patches/win_ax_platform_node.patch @@ -1,8 +1,8 @@ diff --git ui/accessibility/platform/ax_platform_node_win.cc ui/accessibility/platform/ax_platform_node_win.cc -index 05ed613f572b96c52774b51142646f71331ca2eb..12f86816c40328e5ecd80e0a04f1da495f6af9d4 100644 +index d658a9e50058de85828f258fe9442180dbfad4c4..808b10de4de03e436db20471c4b1eb6d1c931194 100644 --- ui/accessibility/platform/ax_platform_node_win.cc +++ ui/accessibility/platform/ax_platform_node_win.cc -@@ -1683,6 +1683,10 @@ IFACEMETHODIMP AXPlatformNodeWin::accLocation(LONG* physical_pixel_left, +@@ -1685,6 +1685,10 @@ IFACEMETHODIMP AXPlatformNodeWin::accLocation(LONG* physical_pixel_left, AXPlatform::GetInstance().SetMsaaActive(); AXPlatform::GetInstance().OnMinimalPropertiesUsed(); diff --git a/patch/patches/win_sandbox_3210.patch b/patch/patches/win_sandbox_3210.patch index ac7323731..6accd3667 100644 --- a/patch/patches/win_sandbox_3210.patch +++ b/patch/patches/win_sandbox_3210.patch @@ -1,5 +1,5 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index f2a826791ff321a68c02cef923fefb1283e246fc..dfae067778cd4eca811731b97bb4fff64c454d91 100644 +index 0bcb43d58cfc3ae867824264766ecdd1b0f99360..da45619885e855386e054b21fbb3249ff9731869 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc @@ -962,6 +962,17 @@ ResultCode SandboxWin::StartSandboxedProcess( diff --git a/patch/patches/win_taskbar_decorator_3645.patch b/patch/patches/win_taskbar_decorator_3645.patch index fcdfd4c50..9f3d65002 100644 --- a/patch/patches/win_taskbar_decorator_3645.patch +++ b/patch/patches/win_taskbar_decorator_3645.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/taskbar/taskbar_decorator_win.cc chrome/browser/taskbar/taskbar_decorator_win.cc -index 90969f7bb07a642d37a348d33d7220ec035d7a3f..a4fa62b02748a2648f535e265f1b136d3489358d 100644 +index 90969f7bb07a642d37a348d33d7220ec035d7a3f..bed8ea65e00a2886c71ecff256699674b774ea4c 100644 --- chrome/browser/taskbar/taskbar_decorator_win.cc +++ chrome/browser/taskbar/taskbar_decorator_win.cc @@ -20,12 +20,14 @@ @@ -17,7 +17,7 @@ index 90969f7bb07a642d37a348d33d7220ec035d7a3f..a4fa62b02748a2648f535e265f1b136d #include "skia/ext/font_utils.h" #include "skia/ext/image_operations.h" #include "skia/ext/legacy_display_globals.h" -@@ -203,6 +205,22 @@ void UpdateTaskbarDecoration(Profile* profile, gfx::NativeWindow window) { +@@ -203,6 +205,24 @@ void UpdateTaskbarDecoration(Profile* profile, gfx::NativeWindow window) { return; } @@ -26,8 +26,10 @@ index 90969f7bb07a642d37a348d33d7220ec035d7a3f..a4fa62b02748a2648f535e265f1b136d + if (auto browser = browser_view->browser()) { + if (browser->cef_delegate() && + (browser->cef_delegate()->IsViewsHosted() || -+ ((browser->is_type_picture_in_picture() || -+ browser->is_type_devtools()) && ++ ((browser->GetType() == ++ BrowserWindowInterface::Type::TYPE_PICTURE_IN_PICTURE || ++ browser->GetType() == ++ BrowserWindowInterface::Type::TYPE_DEVTOOLS) && + browser->cef_delegate()->HasViewsHostedOpener()))) { + // Don't add taskbar decoration. + taskbar::DrawTaskbarDecoration(window, nullptr); diff --git a/patch/patches/win_taskbar_group_3641.patch b/patch/patches/win_taskbar_group_3641.patch index 395f0dc7a..cf95cfff7 100644 --- a/patch/patches/win_taskbar_group_3641.patch +++ b/patch/patches/win_taskbar_group_3641.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/views/frame/browser_window_property_manager_win.cc chrome/browser/ui/views/frame/browser_window_property_manager_win.cc -index a2b4f28e7ec965c95c7e52972bdeb22330f4e0a1..f1fac633b4dcd2e43aaca30b9043e228d9087453 100644 +index 00445dbee1a207264eb601d25ed8852171fb197e..ee3dda17123579f5abfe6a1f840a8247018c046d 100644 --- chrome/browser/ui/views/frame/browser_window_property_manager_win.cc +++ chrome/browser/ui/views/frame/browser_window_property_manager_win.cc @@ -8,6 +8,7 @@ @@ -10,15 +10,16 @@ index a2b4f28e7ec965c95c7e52972bdeb22330f4e0a1..f1fac633b4dcd2e43aaca30b9043e228 #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -@@ -50,6 +51,16 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() { - const Browser* browser = view_->browser(); +@@ -52,6 +53,17 @@ void BrowserWindowPropertyManager::UpdateWindowProperties() { + const BrowserWindowInterface* browser = view_->browser(); Profile* profile = const_cast(browser->GetProfile()); +#if BUILDFLAG(ENABLE_CEF) + if (browser->cef_delegate() && -+ (browser->is_type_picture_in_picture() || -+ browser->is_type_devtools()) && -+ browser->cef_delegate()->HasViewsHostedOpener()) { ++ (browser->GetType() == ++ BrowserWindowInterface::Type::TYPE_PICTURE_IN_PICTURE || ++ browser->GetType() == BrowserWindowInterface::Type::TYPE_DEVTOOLS) && ++ browser->cef_delegate()->HasViewsHostedOpener()) { + // Don't create a separate taskbar group. + return; + } diff --git a/tests/ceftests/v8_unittest.cc b/tests/ceftests/v8_unittest.cc index 58ffc19d6..736f37749 100644 --- a/tests/ceftests/v8_unittest.cc +++ b/tests/ceftests/v8_unittest.cc @@ -5,6 +5,7 @@ #include #include "include/base/cef_callback.h" +#include "include/cef_api_hash.h" #include "include/cef_task.h" #include "include/cef_v8.h" #include "include/wrapper/cef_closure_task.h" @@ -104,7 +105,9 @@ enum V8TestMode { V8TEST_STACK_TRACE, V8TEST_ON_UNCAUGHT_EXCEPTION, V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS, +#if CEF_API_REMOVED(CEF_NEXT) V8TEST_EXTENSION, +#endif V8TEST_HANDLER_CALL_ON_RELEASED_CONTEXT, }; @@ -297,9 +300,11 @@ class V8RendererTest : public ClientAppRenderer::Delegate, // Run a test on render process startup. void RunStartupTest() { switch (test_mode_) { +#if CEF_API_REMOVED(CEF_NEXT) case V8TEST_EXTENSION: RunExtensionTest(); break; +#endif default: break; } @@ -2923,6 +2928,7 @@ class V8RendererTest : public ClientAppRenderer::Delegate, "window.setTimeout(test, 0)", browser_->GetMainFrame()->GetURL(), 0); } +#if CEF_API_REMOVED(CEF_NEXT) // Test execution of a native function when the extension is loaded. void RunExtensionTest() { std::string code = @@ -2951,6 +2957,7 @@ class V8RendererTest : public ClientAppRenderer::Delegate, CefRegisterExtension("v8/test-extension", code, new Handler(&startup_test_success_)); } +#endif // CEF_API_REMOVED(CEF_NEXT) void OnBrowserCreated(CefRefPtr app, CefRefPtr browser, @@ -3578,7 +3585,9 @@ V8_TEST_EX(Binding, V8TEST_BINDING, kV8BindingTestUrl) V8_TEST(StackTrace, V8TEST_STACK_TRACE) V8_TEST(OnUncaughtException, V8TEST_ON_UNCAUGHT_EXCEPTION) V8_TEST(OnUncaughtExceptionDevTools, V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS) +#if CEF_API_REMOVED(CEF_NEXT) V8_TEST(Extension, V8TEST_EXTENSION) +#endif V8_TEST_EX(HandlerCallOnReleasedContext, V8TEST_HANDLER_CALL_ON_RELEASED_CONTEXT, kV8HandlerCallOnReleasedContextUrl)