diff --git a/BUILD.gn b/BUILD.gn index 96632285d..0c170cd7f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -408,6 +408,12 @@ static_library("libcef_static") { "libcef/browser/alloy/alloy_browser_host_impl.h", "libcef/browser/alloy/alloy_browser_main.cc", "libcef/browser/alloy/alloy_browser_main.h", + "libcef/browser/alloy/alloy_content_browser_client.cc", + "libcef/browser/alloy/alloy_content_browser_client.h", + "libcef/browser/alloy/alloy_dialog_util.cc", + "libcef/browser/alloy/alloy_dialog_util.h", + "libcef/browser/alloy/alloy_download_util.cc", + "libcef/browser/alloy/alloy_download_util.h", "libcef/browser/alloy/browser_platform_delegate_alloy.cc", "libcef/browser/alloy/browser_platform_delegate_alloy.h", "libcef/browser/alloy/chrome_browser_process_alloy.cc", @@ -416,8 +422,6 @@ static_library("libcef_static") { "libcef/browser/alloy/chrome_profile_manager_alloy.h", "libcef/browser/alloy/chrome_profile_alloy.cc", "libcef/browser/alloy/chrome_profile_alloy.h", - "libcef/browser/alloy/alloy_content_browser_client.cc", - "libcef/browser/alloy/alloy_content_browser_client.h", "libcef/browser/audio_capturer.cc", "libcef/browser/audio_capturer.h", "libcef/browser/audio_loopback_stream_creator.cc", @@ -795,10 +799,6 @@ static_library("libcef_static") { # For Chrome runtime support. "//chrome/app/chrome_main_delegate.cc", "//chrome/app/chrome_main_delegate.h", - - # Part of //content//test::test_support which is testingonly. - "//content/public/test/scoped_web_ui_controller_factory_registration.cc", - "//content/public/test/scoped_web_ui_controller_factory_registration.h", ] configs += [ @@ -868,7 +868,6 @@ static_library("libcef_static") { "//components/printing/common", "//components/printing/renderer", "//components/proxy_config", - "//components/safe_browsing/core/db:test_database_manager", "//components/services/print_compositor/public/cpp", "//components/services/print_compositor/public/mojom", "//components/update_client", @@ -898,7 +897,6 @@ static_library("libcef_static") { "//gpu", "//ipc", "//media", - "//media/blink", "//net", "//pdf", "//ppapi/buildflags", @@ -2004,6 +2002,7 @@ if (is_mac) { gypi_paths2.shared_sources_mac_helper + gypi_paths2.ceftests_sources_mac_helper helper_deps = [ + ":gtest_teamcity", "//testing/gtest", ] helper_defines = [ diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 287593fb6..649e5b5be 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/92.0.4515.0' + 'chromium_checkout': 'refs/tags/93.0.4577.0' } diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 332c910e1..f04837312 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "7fb6a7510f39c359767b3a893c9ebfb5fb5973d7" +#define CEF_API_HASH_UNIVERSAL "6498b029e847331e85f7fa7a8fe82434e016e316" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "0a848e5b676ddc931dbb5b174a64eb7be7f7dfbf" +#define CEF_API_HASH_PLATFORM "5beb166d25cb4aa70e15ff565a0268c60cab3e0c" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "4c666fab20ab43dddf2f7ac6543197a1fecee389" +#define CEF_API_HASH_PLATFORM "5fa684079bfafa70cc920a1ad4e694e38c46d737" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "5f756efd08c6e10629fe1f81e9266c7af71aa5ce" +#define CEF_API_HASH_PLATFORM "1e0cc77dabf9058f0fc118b4605fbcccda14466f" #endif #ifdef __cplusplus diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 574486a76..4abb13342 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -1114,9 +1114,10 @@ content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab( return nullptr; } -bool AlloyBrowserHostImpl::ShouldTransferNavigation( +bool AlloyBrowserHostImpl::ShouldAllowRendererInitiatedCrossProcessNavigation( bool is_main_frame_navigation) { - return platform_delegate_->ShouldTransferNavigation(is_main_frame_navigation); + return platform_delegate_->ShouldAllowRendererInitiatedCrossProcessNavigation( + is_main_frame_navigation); } void AlloyBrowserHostImpl::AddNewContents( diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index faee30792..db9674d04 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -207,7 +207,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, content::WebContents* OpenURLFromTab( content::WebContents* source, const content::OpenURLParams& params) override; - bool ShouldTransferNavigation(bool is_main_frame_navigation) override; + bool ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) override; void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, const GURL& target_url, diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index b5bdf7523..103f4bfeb 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -121,7 +121,6 @@ #include "services/service_manager/public/mojom/connector.mojom.h" #include "storage/browser/quota/quota_settings.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h" -#include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" #include "third_party/blink/public/mojom/prerender/prerender.mojom.h" #include "third_party/blink/public/web/web_window_features.h" #include "third_party/widevine/cdm/buildflags.h" @@ -465,23 +464,6 @@ base::FilePath GetRootCachePath() { CefString(&CefContext::Get()->settings().root_cache_path)); } -// Register BrowserInterfaceBroker's GetInterface() handler callbacks for -// chrome-specific document-scoped interfaces. -// Stub implementations to silence "Empty binder for interface -// blink.mojom.[Name] for the frame/document scope" errors. -// Based on chrome/browser/chrome_browser_interface_binders.cc. -void PopulateChromeFrameBinders( - mojo::BinderMapWithContext* map) { - map->Add(base::BindRepeating( - [](content::RenderFrameHost* frame_host, - mojo::PendingReceiver receiver) { - })); - - map->Add(base::BindRepeating( - [](content::RenderFrameHost* frame_host, - mojo::PendingReceiver receiver) {})); -} - } // namespace AlloyContentBrowserClient::AlloyContentBrowserClient() { @@ -957,11 +939,13 @@ void AlloyContentBrowserClient::OverrideWebkitPrefs( // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // when this method is called. - renderer_prefs::PopulateWebPreferences(rvh, *prefs); + SkColor base_background_color; + renderer_prefs::PopulateWebPreferences(rvh, *prefs, base_background_color); + + web_contents->SetPageBaseBackgroundColor(base_background_color); if (rvh->GetWidget()->GetView()) { - rvh->GetWidget()->GetView()->SetBackgroundColor( - prefs->base_background_color); + rvh->GetWidget()->GetView()->SetBackgroundColor(base_background_color); } } @@ -1250,7 +1234,7 @@ AlloyContentBrowserClient::GetNetworkContextsParentDirectory() { bool AlloyContentBrowserClient::HandleExternalProtocol( const GURL& url, - content::WebContents::OnceGetter web_contents_getter, + content::WebContents::Getter web_contents_getter, int child_id, int frame_tree_node_id, content::NavigationUIData* navigation_data, @@ -1299,7 +1283,6 @@ AlloyContentBrowserClient::CreateWindowForPictureInPicture( void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame( content::RenderFrameHost* render_frame_host, mojo::BinderMapWithContext* map) { - PopulateChromeFrameBinders(map); CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame(render_frame_host, map); @@ -1377,7 +1360,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed( // Persistent MediaDevice IDs are allowed if cookies are allowed. return CookieSettingsFactory::GetForProfile( Profile::FromBrowserContext(browser_context)) - ->IsCookieAccessAllowed(url, site_for_cookies, top_frame_origin); + ->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin); } bool AlloyContentBrowserClient::ShouldAllowPluginCreation( diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 95ac3e038..4f71a89c4 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -178,7 +178,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { std::vector GetNetworkContextsParentDirectory() override; bool HandleExternalProtocol( const GURL& url, - content::WebContents::OnceGetter web_contents_getter, + content::WebContents::Getter web_contents_getter, int child_id, int frame_tree_node_id, content::NavigationUIData* navigation_data, diff --git a/libcef/browser/alloy/alloy_dialog_util.cc b/libcef/browser/alloy/alloy_dialog_util.cc new file mode 100644 index 000000000..5d7d82eb6 --- /dev/null +++ b/libcef/browser/alloy/alloy_dialog_util.cc @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +#include "libcef/browser/alloy/alloy_dialog_util.h" + +#include "libcef/browser/alloy/alloy_browser_host_impl.h" + +#include "base/strings/utf_string_conversions.h" + +namespace alloy { + +void RunFileChooser(content::WebContents* web_contents, + const blink::mojom::FileChooserParams& params, + RunFileChooserCallback callback) { + CefRefPtr browser = + AlloyBrowserHostImpl::GetBrowserForContents(web_contents); + if (!browser) { + std::move(callback).Run(-1, {}); + return; + } + + CefFileDialogRunner::FileChooserParams cef_params; + cef_params.mode = params.mode; + cef_params.default_file_name = params.default_file_name; + cef_params.accept_types = params.accept_types; + + browser->RunFileChooser(cef_params, std::move(callback)); +} + +// Based on net/base/filename_util_internal.cc FilePathToString16(). +std::u16string FilePathTypeToString16(const base::FilePath::StringType& str) { + std::u16string result; +#if defined(OS_WIN) + result.assign(str.begin(), str.end()); +#elif defined(OS_POSIX) || defined(OS_FUCHSIA) + if (!str.empty()) { + base::UTF8ToUTF16(str.c_str(), str.size(), &result); + } +#endif + return result; +} + +} // namespace alloy diff --git a/libcef/browser/alloy/alloy_dialog_util.h b/libcef/browser/alloy/alloy_dialog_util.h new file mode 100644 index 000000000..956cc58df --- /dev/null +++ b/libcef/browser/alloy/alloy_dialog_util.h @@ -0,0 +1,37 @@ +// Copyright 2021 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_ALLOY_ALLOY_DIALOG_UTIL_H_ +#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DIALOG_UTIL_H_ +#pragma once + +#include +#include + +#include "base/callback.h" +#include "base/files/file_path.h" +#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" + +namespace content { +class WebContents; +} + +namespace alloy { + +// The argument vector will be empty if the dialog was canceled. +using RunFileChooserCallback = + base::OnceCallback& /*file_paths*/)>; + +// Display the file chooser dialog. Execute |callback| on completion. +// Called from patched chrome/ files. +void RunFileChooser(content::WebContents* web_contents, + const blink::mojom::FileChooserParams& params, + RunFileChooserCallback callback); + +std::u16string FilePathTypeToString16(const base::FilePath::StringType& str); + +} // namespace alloy + +#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DIALOG_UTIL_H_ diff --git a/libcef/browser/alloy/alloy_download_util.cc b/libcef/browser/alloy/alloy_download_util.cc new file mode 100644 index 000000000..92e52b6a5 --- /dev/null +++ b/libcef/browser/alloy/alloy_download_util.cc @@ -0,0 +1,16 @@ +// Copyright 2021 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. + +#include "libcef/browser/alloy/alloy_download_util.h" + +#include "libcef/browser/alloy/alloy_browser_context.h" + +namespace alloy { + +DownloadPrefs* GetDownloadPrefsFromBrowserContext( + content::BrowserContext* context) { + return static_cast(context)->GetDownloadPrefs(); +} + +} // namespace alloy diff --git a/libcef/browser/alloy/alloy_download_util.h b/libcef/browser/alloy/alloy_download_util.h new file mode 100644 index 000000000..51c2e285e --- /dev/null +++ b/libcef/browser/alloy/alloy_download_util.h @@ -0,0 +1,23 @@ +// Copyright 2021 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_ALLOY_ALLOY_DOWNLOAD_UTIL_H_ +#define CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_ +#pragma once + +class DownloadPrefs; + +namespace content { +class BrowserContext; +} // namespace content + +namespace alloy { + +// Called from DownloadPrefs::FromBrowserContext. +DownloadPrefs* GetDownloadPrefsFromBrowserContext( + content::BrowserContext* context); + +} // namespace alloy + +#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_DOWNLOAD_UTIL_H_ diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 08fe7dc2e..b254c0e07 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -24,6 +24,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" #include "extensions/browser/process_manager.h" +#include "printing/mojom/print.mojom.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h" namespace { @@ -141,10 +142,12 @@ void CefBrowserPlatformDelegateAlloy::AddNewContents( } } -bool CefBrowserPlatformDelegateAlloy::ShouldTransferNavigation( - bool is_main_frame_navigation) { +bool CefBrowserPlatformDelegateAlloy:: + ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) { if (extension_host_) { - return extension_host_->ShouldTransferNavigation(is_main_frame_navigation); + return extension_host_->ShouldAllowRendererInitiatedCrossProcessNavigation( + is_main_frame_navigation); } return true; } diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.h b/libcef/browser/alloy/browser_platform_delegate_alloy.h index dcd8879cc..a5eef6b5c 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.h +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.h @@ -27,7 +27,8 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { const gfx::Rect& initial_rect, bool user_gesture, bool* was_blocked) override; - bool ShouldTransferNavigation(bool is_main_frame_navigation) override; + bool ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) override; void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderViewReady() override; void BrowserCreated(CefBrowserHostBase* browser) override; diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index d0630ee15..17ac99e50 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -372,3 +372,9 @@ BuildState* ChromeBrowserProcessAlloy::GetBuildState() { NOTREACHED(); return nullptr; } + +SerialPolicyAllowedPorts* +ChromeBrowserProcessAlloy::serial_policy_allowed_ports() { + NOTREACHED(); + return nullptr; +} diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index 01460594b..412d2189c 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -98,6 +98,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts() override; BuildState* GetBuildState() override; + SerialPolicyAllowedPorts* serial_policy_allowed_ports() override; private: bool initialized_; diff --git a/libcef/browser/audio_capturer.cc b/libcef/browser/audio_capturer.cc index c3eec900e..4cd10be3c 100644 --- a/libcef/browser/audio_capturer.cc +++ b/libcef/browser/audio_capturer.cc @@ -110,7 +110,9 @@ void CefAudioCapturer::Capture(const media::AudioBus* source, pts.InMilliseconds()); } -void CefAudioCapturer::OnCaptureError(const std::string& message) { +void CefAudioCapturer::OnCaptureError( + media::AudioCapturerSource::ErrorCode code, + const std::string& message) { audio_handler_->OnAudioStreamError(browser_, message); StopStream(); } diff --git a/libcef/browser/audio_capturer.h b/libcef/browser/audio_capturer.h index 34c9d47ca..c38e01ddd 100644 --- a/libcef/browser/audio_capturer.h +++ b/libcef/browser/audio_capturer.h @@ -33,7 +33,8 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback { base::TimeTicks audio_capture_time, double volume, bool key_pressed) override; - void OnCaptureError(const std::string& message) override; + void OnCaptureError(media::AudioCapturerSource::ErrorCode code, + const std::string& message) override; void OnCaptureMuted(bool is_muted) override {} void StopStream(); diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index cc579d3ee..47ca50e3c 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -473,9 +473,7 @@ void CefBrowserContentsDelegate::Observe( DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP); if (type == content::NOTIFICATION_LOAD_STOP) { - content::NavigationController* controller = - content::Source(source).ptr(); - OnTitleChange(controller->GetWebContents()->GetTitle()); + OnTitleChange(web_contents()->GetTitle()); } } diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index a95745ab1..4523bf8fa 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -164,7 +164,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes( all_schemes.push_back("wss"); } - return base::make_optional(all_schemes); + return absl::make_optional(all_schemes); } } // namespace diff --git a/libcef/browser/browser_frame.cc b/libcef/browser/browser_frame.cc index 96c7a9dd2..d722440c6 100644 --- a/libcef/browser/browser_frame.cc +++ b/libcef/browser/browser_frame.cc @@ -16,7 +16,7 @@ CefBrowserFrame::CefBrowserFrame( content::RenderFrameHost* render_frame_host, mojo::PendingReceiver receiver) - : FrameServiceBase(render_frame_host, std::move(receiver)) {} + : DocumentServiceBase(render_frame_host, std::move(receiver)) {} CefBrowserFrame::~CefBrowserFrame() = default; @@ -28,7 +28,7 @@ void CefBrowserFrame::RegisterBrowserInterfaceBindersForFrame( [](content::RenderFrameHost* frame_host, mojo::PendingReceiver receiver) { // This object is bound to the lifetime of |frame_host| and the mojo - // connection. See FrameServiceBase for details. + // connection. See DocumentServiceBase for details. new CefBrowserFrame(frame_host, std::move(receiver)); })); } diff --git a/libcef/browser/browser_frame.h b/libcef/browser/browser_frame.h index ec0bb6010..e98277d4d 100644 --- a/libcef/browser/browser_frame.h +++ b/libcef/browser/browser_frame.h @@ -9,16 +9,16 @@ #include "libcef/browser/frame_host_impl.h" #include "cef/libcef/common/mojom/cef.mojom.h" -#include "content/public/browser/frame_service_base.h" +#include "content/public/browser/document_service_base.h" #include "mojo/public/cpp/bindings/binder_map.h" // Implementation of the BrowserFrame mojo interface. // This is implemented separately from CefFrameHostImpl to better manage the // association with the RenderFrameHost (which may be speculative, etc.), and so // that messages are always routed to the most appropriate CefFrameHostImpl -// instance. Lifespan is tied to the RFH via FrameServiceBase. +// instance. Lifespan is tied to the RFH via DocumentServiceBase. class CefBrowserFrame - : public content::FrameServiceBase { + : public content::DocumentServiceBase { public: CefBrowserFrame(content::RenderFrameHost* render_frame_host, mojo::PendingReceiver receiver); @@ -39,7 +39,7 @@ class CefBrowserFrame absl::optional> regions) override; - // FrameServiceBase methods: + // DocumentServiceBase methods: bool ShouldCloseOnFinishNavigation() const override { return false; } CefRefPtr GetFrameHost( diff --git a/libcef/browser/browser_platform_delegate.cc b/libcef/browser/browser_platform_delegate.cc index e26e1a031..ad0df5b11 100644 --- a/libcef/browser/browser_platform_delegate.cc +++ b/libcef/browser/browser_platform_delegate.cc @@ -54,8 +54,9 @@ void CefBrowserPlatformDelegate::WebContentsDestroyed( web_contents_ = nullptr; } -bool CefBrowserPlatformDelegate::ShouldTransferNavigation( - bool is_main_frame_navigation) { +bool CefBrowserPlatformDelegate:: + ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) { return true; } @@ -398,7 +399,7 @@ int CefBrowserPlatformDelegate::TranslateWebEventModifiers( int result = 0; // Set modifiers based on key state. if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON) - result |= blink::WebInputEvent::kCapsLockOn; + result |= blink::WebInputEvent::kCapsLockOn; if (cef_modifiers & EVENTFLAG_SHIFT_DOWN) result |= blink::WebInputEvent::kShiftKey; if (cef_modifiers & EVENTFLAG_CONTROL_DOWN) @@ -412,7 +413,7 @@ int CefBrowserPlatformDelegate::TranslateWebEventModifiers( if (cef_modifiers & EVENTFLAG_RIGHT_MOUSE_BUTTON) result |= blink::WebInputEvent::kRightButtonDown; if (cef_modifiers & EVENTFLAG_COMMAND_DOWN) - result |= blink::WebInputEvent::kMetaKey; + result |= blink::WebInputEvent::kMetaKey; if (cef_modifiers & EVENTFLAG_NUM_LOCK_ON) result |= blink::WebInputEvent::kNumLockOn; if (cef_modifiers & EVENTFLAG_IS_KEY_PAD) diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index 7336ff836..82d85db78 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -118,7 +118,8 @@ class CefBrowserPlatformDelegate { virtual void WebContentsDestroyed(content::WebContents* web_contents); // See WebContentsDelegate documentation. - virtual bool ShouldTransferNavigation(bool is_main_frame_navigation); + virtual bool ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation); // Called after the RenderViewHost is created. virtual void RenderViewCreated(content::RenderViewHost* render_view_host); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index f8f92fd6a..4ab6494ed 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -41,14 +41,14 @@ namespace { void HandleExternalProtocolHelper( ChromeContentBrowserClientCef* self, - content::WebContents::OnceGetter web_contents_getter, + content::WebContents::Getter web_contents_getter, int frame_tree_node_id, content::NavigationUIData* navigation_data, const network::ResourceRequest& resource_request) { // Match the logic of the original call in // NavigationURLLoaderImpl::PrepareForNonInterceptedRequest. self->HandleExternalProtocol( - resource_request.url, std::move(web_contents_getter), + resource_request.url, web_contents_getter, content::ChildProcessHost::kInvalidUniqueID, frame_tree_node_id, navigation_data, resource_request.resource_type == @@ -173,23 +173,25 @@ void ChromeContentBrowserClientCef::OverrideWebkitPrefs( ChromeContentBrowserClient::OverrideWebkitPrefs(web_contents, prefs); + SkColor base_background_color; auto browser = ChromeBrowserHostImpl::GetBrowserForContents(web_contents); if (browser) { renderer_prefs::SetCefPrefs(browser->settings(), *prefs); // Set the background color for the WebView. - prefs->base_background_color = browser->GetBackgroundColor(); + base_background_color = browser->GetBackgroundColor(); } else { // We don't know for sure that the browser will be windowless but assume // that the global windowless state is likely to be accurate. - prefs->base_background_color = + base_background_color = CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT); } + web_contents->SetPageBaseBackgroundColor(base_background_color); + auto rvh = web_contents->GetRenderViewHost(); if (rvh->GetWidget()->GetView()) { - rvh->GetWidget()->GetView()->SetBackgroundColor( - prefs->base_background_color); + rvh->GetWidget()->GetView()->SetBackgroundColor(base_background_color); } } @@ -236,7 +238,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( bool ChromeContentBrowserClientCef::HandleExternalProtocol( const GURL& url, - content::WebContents::OnceGetter web_contents_getter, + content::WebContents::Getter web_contents_getter, int child_id, int frame_tree_node_id, content::NavigationUIData* navigation_data, @@ -256,9 +258,9 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( // HandleExternalProtocolHelper. Forward to the chrome layer for default // handling. return ChromeContentBrowserClient::HandleExternalProtocol( - url, std::move(web_contents_getter), child_id, frame_tree_node_id, - navigation_data, is_main_frame, page_transition, has_user_gesture, - initiating_origin, nullptr); + url, web_contents_getter, child_id, frame_tree_node_id, navigation_data, + is_main_frame, page_transition, has_user_gesture, initiating_origin, + nullptr); } bool ChromeContentBrowserClientCef::HandleExternalProtocol( diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 60bf7e021..129016dc0 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -58,7 +58,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { network::mojom::URLLoaderFactoryOverridePtr* factory_override) override; bool HandleExternalProtocol( const GURL& url, - content::WebContents::OnceGetter web_contents_getter, + content::WebContents::Getter web_contents_getter, int child_id, int frame_tree_node_id, content::NavigationUIData* navigation_data, diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index 5197c3b85..5543ef282 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -8,6 +8,7 @@ #include "base/notreached.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/stringprintf.h" #include "chrome/browser/extensions/api/tabs/tabs_constants.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "components/zoom/zoom_controller.h" @@ -381,8 +382,16 @@ bool ExecuteCodeInTabFunction::LoadFile(const std::string& file, void ExecuteCodeInTabFunction::LoadFileComplete( const std::string& file, std::unique_ptr data) { + std::vector> data_list; + absl::optional error; const bool success = !!data.get(); - DidLoadAndLocalizeFile(file, success, std::move(data)); + if (success) { + DCHECK(data); + data_list.push_back(std::move(data)); + } else { + error = base::StringPrintf("Failed to load file '%s'.", file.c_str()); + } + DidLoadAndLocalizeFile(file, std::move(data_list), std::move(error)); } bool TabsInsertCSSFunction::ShouldInsertCSS() const { diff --git a/libcef/browser/extensions/component_extension_resource_manager.cc b/libcef/browser/extensions/component_extension_resource_manager.cc index 78e79d088..4c8f5666f 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.cc +++ b/libcef/browser/extensions/component_extension_resource_manager.cc @@ -4,6 +4,7 @@ #include "libcef/browser/extensions/component_extension_resource_manager.h" +#include "base/containers/contains.h" #include "base/logging.h" #include "base/path_service.h" #include "base/values.h" diff --git a/libcef/browser/extensions/extension_background_host.cc b/libcef/browser/extensions/extension_background_host.cc index eefd1c163..461cbeed0 100644 --- a/libcef/browser/extensions/extension_background_host.cc +++ b/libcef/browser/extensions/extension_background_host.cc @@ -35,8 +35,9 @@ CefExtensionBackgroundHost::~CefExtensionBackgroundHost() { std::move(deleted_callback_).Run(); } -bool CefExtensionBackgroundHost::ShouldTransferNavigation( - bool is_main_frame_navigation) { +bool CefExtensionBackgroundHost:: + ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) { // Block navigations that cause the main frame to navigate to non-extension // content (i.e. to web content). return !is_main_frame_navigation; diff --git a/libcef/browser/extensions/extension_background_host.h b/libcef/browser/extensions/extension_background_host.h index e010f84e8..36e8cfad6 100644 --- a/libcef/browser/extensions/extension_background_host.h +++ b/libcef/browser/extensions/extension_background_host.h @@ -33,7 +33,8 @@ class CefExtensionBackgroundHost : public ExtensionHost { ~CefExtensionBackgroundHost() override; // content::WebContentsDelegate methods: - bool ShouldTransferNavigation(bool is_main_frame_navigation) override; + bool ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) override; private: // Callback that will be executed on host deletion. diff --git a/libcef/browser/extensions/extension_view_host.cc b/libcef/browser/extensions/extension_view_host.cc index 3b1c08d5d..c7423f9ed 100644 --- a/libcef/browser/extensions/extension_view_host.cc +++ b/libcef/browser/extensions/extension_view_host.cc @@ -61,7 +61,7 @@ bool CefExtensionViewHost::IsBackgroundPage() const { return false; } -bool CefExtensionViewHost::ShouldTransferNavigation( +bool CefExtensionViewHost::ShouldAllowRendererInitiatedCrossProcessNavigation( bool is_main_frame_navigation) { // Block navigations that cause the main frame to navigate to non-extension // content (i.e. to web content). diff --git a/libcef/browser/extensions/extension_view_host.h b/libcef/browser/extensions/extension_view_host.h index 4c360fb70..6dfde9353 100644 --- a/libcef/browser/extensions/extension_view_host.h +++ b/libcef/browser/extensions/extension_view_host.h @@ -40,7 +40,8 @@ class CefExtensionViewHost : public ExtensionHost, bool IsBackgroundPage() const override; // content::WebContentsDelegate methods: - bool ShouldTransferNavigation(bool is_main_frame_navigation) override; + bool ShouldAllowRendererInitiatedCrossProcessNavigation( + bool is_main_frame_navigation) override; bool PreHandleGestureEvent(content::WebContents* source, const blink::WebGestureEvent& event) override; diff --git a/libcef/browser/extensions/extensions_api_client.cc b/libcef/browser/extensions/extensions_api_client.cc index 3abc7d98c..ad1cd1a65 100644 --- a/libcef/browser/extensions/extensions_api_client.cc +++ b/libcef/browser/extensions/extensions_api_client.cc @@ -18,6 +18,7 @@ #include "components/pdf/browser/pdf_web_contents_helper.h" #include "components/zoom/zoom_controller.h" #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h" +#include "printing/mojom/print.mojom.h" namespace extensions { diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index af8dbbdbe..c6f060146 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -173,12 +173,11 @@ void CefExtensionsBrowserClient::LoadResourceFromResourceBundle( mojo::PendingReceiver loader, const base::FilePath& resource_relative_path, const int resource_id, - const std::string& content_security_policy, - mojo::PendingRemote client, - bool send_cors_header) { + scoped_refptr headers, + mojo::PendingRemote client) { chrome_url_request_util::LoadResourceFromResourceBundle( request, std::move(loader), resource_relative_path, resource_id, - content_security_policy, std::move(client), send_cors_header); + std::move(headers), std::move(client)); } bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad( diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index ecd7763e3..858f3fcbb 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -51,9 +51,8 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { mojo::PendingReceiver loader, const base::FilePath& resource_relative_path, const int resource_id, - const std::string& content_security_policy, - mojo::PendingRemote client, - bool send_cors_header) override; + scoped_refptr headers, + mojo::PendingRemote client) override; bool AllowCrossRendererResourceLoad( const network::ResourceRequest& request, network::mojom::RequestDestination destination, diff --git a/libcef/browser/extensions/value_store/cef_value_store.cc b/libcef/browser/extensions/value_store/cef_value_store.cc index 1d23b6520..56bb92392 100644 --- a/libcef/browser/extensions/value_store/cef_value_store.cc +++ b/libcef/browser/extensions/value_store/cef_value_store.cc @@ -60,11 +60,10 @@ ValueStore::ReadResult CefValueStore::Get( return ReadResult(CreateStatusCopy(status_)); auto settings = std::make_unique(); - for (std::vector::const_iterator it = keys.begin(); - it != keys.end(); ++it) { - base::Value* value = nullptr; - if (storage_.GetWithoutPathExpansion(*it, &value)) { - settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy()); + for (const auto& key : keys) { + base::Value* value = storage_.FindKey(key); + if (value) { + settings->SetKey(key, value->Clone()); } } return ReadResult(std::move(settings), CreateStatusCopy(status_)); @@ -95,15 +94,14 @@ ValueStore::WriteResult CefValueStore::Set( ValueStoreChangeList changes; for (base::DictionaryValue::Iterator it(settings); !it.IsAtEnd(); it.Advance()) { - base::Value* old_value = NULL; - if (!storage_.GetWithoutPathExpansion(it.key(), &old_value) || - !old_value->Equals(&it.value())) { + base::Value* old_value = storage_.FindKey(it.key()); + if (!old_value || *old_value != it.value()) { changes.emplace_back(it.key(), old_value ? absl::optional(old_value->Clone()) : absl::nullopt, it.value().Clone()); - storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); + storage_.SetKey(it.key(), it.value().Clone()); } } return WriteResult(std::move(changes), CreateStatusCopy(status_)); @@ -120,10 +118,10 @@ ValueStore::WriteResult CefValueStore::Remove( return WriteResult(CreateStatusCopy(status_)); ValueStoreChangeList changes; - for (auto it = keys.cbegin(); it != keys.cend(); ++it) { - std::unique_ptr old_value; - if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) { - changes.emplace_back(*it, std::move(*old_value), absl::nullopt); + for (auto const& key : keys) { + absl::optional old_value = storage_.ExtractKey(key); + if (old_value.has_value()) { + changes.emplace_back(key, std::move(*old_value), absl::nullopt); } } return WriteResult(std::move(changes), CreateStatusCopy(status_)); diff --git a/libcef/browser/media_router/media_route_impl.cc b/libcef/browser/media_router/media_route_impl.cc index 928381d54..a4f2c356a 100644 --- a/libcef/browser/media_router/media_route_impl.cc +++ b/libcef/browser/media_router/media_route_impl.cc @@ -38,7 +38,11 @@ CefRefPtr CefMediaRouteImpl::GetSource() { } CefRefPtr CefMediaRouteImpl::GetSink() { - return new CefMediaSinkImpl(route_.media_sink_id(), route_.media_sink_name()); + return new CefMediaSinkImpl( + route_.media_sink_id(), route_.media_sink_name(), + route_.media_source().IsDialSource() + ? media_router::mojom::MediaRouteProviderId::DIAL + : media_router::mojom::MediaRouteProviderId::CAST); } void CefMediaRouteImpl::SendRouteMessage(const void* message, diff --git a/libcef/browser/media_router/media_sink_impl.cc b/libcef/browser/media_router/media_sink_impl.cc index 385d192d7..30ab84c9f 100644 --- a/libcef/browser/media_router/media_sink_impl.cc +++ b/libcef/browser/media_router/media_sink_impl.cc @@ -85,9 +85,14 @@ void GetDeviceInfo(const media_router::MediaSink::Id& sink_id, CefMediaSinkImpl::CefMediaSinkImpl(const media_router::MediaSink& sink) : sink_(sink) {} -CefMediaSinkImpl::CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id, - const std::string& sink_name) - : sink_(sink_id, sink_name, media_router::SinkIconType::GENERIC) {} +CefMediaSinkImpl::CefMediaSinkImpl( + const media_router::MediaSink::Id& sink_id, + const std::string& sink_name, + media_router::mojom::MediaRouteProviderId provider_id) + : sink_(sink_id, + sink_name, + media_router::SinkIconType::GENERIC, + provider_id) {} CefString CefMediaSinkImpl::GetId() { return sink_.id(); @@ -116,11 +121,11 @@ void CefMediaSinkImpl::GetDeviceInfo( } bool CefMediaSinkImpl::IsCastSink() { - return sink_.provider_id() == media_router::CAST; + return sink_.provider_id() == media_router::mojom::MediaRouteProviderId::CAST; } bool CefMediaSinkImpl::IsDialSink() { - return sink_.provider_id() == media_router::DIAL; + return sink_.provider_id() == media_router::mojom::MediaRouteProviderId::DIAL; } bool CefMediaSinkImpl::IsCompatibleWith(CefRefPtr source) { diff --git a/libcef/browser/media_router/media_sink_impl.h b/libcef/browser/media_router/media_sink_impl.h index 70ce68cf3..eef0b4c69 100644 --- a/libcef/browser/media_router/media_sink_impl.h +++ b/libcef/browser/media_router/media_sink_impl.h @@ -15,7 +15,8 @@ class CefMediaSinkImpl : public CefMediaSink { public: explicit CefMediaSinkImpl(const media_router::MediaSink& sink); CefMediaSinkImpl(const media_router::MediaSink::Id& sink_id, - const std::string& sink_name); + const std::string& sink_name, + media_router::mojom::MediaRouteProviderId provider_id); // CefMediaSink methods. CefString GetId() override; diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 940d6778e..e8e5ae79f 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -101,14 +101,14 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50); // Set font-related attributes. - static const base::NoDestructor params( + static const gfx::FontRenderParams params( gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); - prefs->should_antialias_text = params->antialiasing; - prefs->use_subpixel_positioning = params->subpixel_positioning; - prefs->hinting = params->hinting; - prefs->use_autohinter = params->autohinter; - prefs->use_bitmaps = params->use_bitmaps; - prefs->subpixel_rendering = params->subpixel_rendering; + prefs->should_antialias_text = params.antialiasing; + prefs->use_subpixel_positioning = params.subpixel_positioning; + prefs->hinting = params.hinting; + prefs->use_autohinter = params.autohinter; + prefs->use_bitmaps = params.use_bitmaps; + prefs->subpixel_rendering = params.subpixel_rendering; web_contents_->SyncRendererPrefs(); diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index 814b5fd67..5c34726d1 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -166,14 +166,18 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() { NSView* parentView = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view); - NSRect contentRect = {{window_info_.x, window_info_.y}, - {window_info_.width, window_info_.height}}; + NSRect contentRect = {{static_cast(window_info_.x), + static_cast(window_info_.y)}, + {static_cast(window_info_.width), + static_cast(window_info_.height)}}; if (parentView == nil) { // Create a new window. NSRect screen_rect = [[NSScreen mainScreen] visibleFrame]; NSRect window_rect = { - {window_info_.x, screen_rect.size.height - window_info_.y}, - {window_info_.width, window_info_.height}}; + {static_cast(window_info_.x), + screen_rect.size.height - static_cast(window_info_.y)}, + {static_cast(window_info_.width), + static_cast(window_info_.height)}}; if (window_rect.size.width == 0) window_rect.size.width = 750; if (window_rect.size.height == 0) @@ -328,7 +332,8 @@ gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint( NSView* nsview = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_info_.parent_view); if (nsview) { NSRect bounds = [nsview bounds]; - NSPoint view_pt = {view.x(), bounds.size.height - view.y()}; + NSPoint view_pt = {static_cast(view.x()), + bounds.size.height - static_cast(view.y())}; NSPoint window_pt = [nsview convertPoint:view_pt toView:nil]; NSPoint screen_pt = ui::ConvertPointFromWindowToScreen([nsview window], window_pt); diff --git a/libcef/browser/native/window_delegate_view.cc b/libcef/browser/native/window_delegate_view.cc index 90c57a105..5670cf473 100644 --- a/libcef/browser/native/window_delegate_view.cc +++ b/libcef/browser/native/window_delegate_view.cc @@ -29,6 +29,8 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget, web_view_->SetWebContents(web_contents); web_view_->SetPreferredSize(bounds.size()); + SetCanResize(true); + views::Widget* widget = new views::Widget; // See CalculateWindowStylesFromInitParams in diff --git a/libcef/browser/native/window_delegate_view.h b/libcef/browser/native/window_delegate_view.h index 3fb25a63d..4515c3856 100644 --- a/libcef/browser/native/window_delegate_view.h +++ b/libcef/browser/native/window_delegate_view.h @@ -34,7 +34,6 @@ class CefWindowDelegateView : public views::WidgetDelegateView { void InitContent(); // WidgetDelegateView methods: - bool CanResize() const override { return true; } bool CanMaximize() const override { return true; } View* GetContentsView() override { return this; } diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index 615f44a75..afeadb708 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -91,10 +91,10 @@ CefWindowX11::CefWindowX11(CefRefPtr browser, .depth = depth, .wid = xwindow_, .parent = parent_xwindow_, - .x = bounds.x(), - .y = bounds.y(), - .width = bounds.width(), - .height = bounds.height(), + .x = static_cast(bounds.x()), + .y = static_cast(bounds.y()), + .width = static_cast(bounds.width()), + .height = static_cast(bounds.height()), .c_class = x11::WindowClass::InputOutput, .visual = visual, .background_pixel = 0, diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 7507aa4a2..7f5be78e3 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -44,7 +44,6 @@ #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" #include "content/public/common/user_agent.h" -#include "content/public/test/scoped_web_ui_controller_factory_registration.h" #include "ipc/ipc_channel.h" #include "third_party/blink/public/common/chrome_debug_urls.h" #include "ui/base/resource/resource_bundle.h" @@ -641,9 +640,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { static CefWebUIControllerFactory* GetInstance(); protected: - CefWebUIControllerFactory() - : remove_content_registration_( - content::ContentWebUIControllerFactory::GetInstance()) {} + CefWebUIControllerFactory() {} ~CefWebUIControllerFactory() override {} private: @@ -666,9 +663,6 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { return false; } - content::ScopedWebUIControllerFactoryRegistration - remove_content_registration_; - DISALLOW_COPY_AND_ASSIGN(CefWebUIControllerFactory); }; @@ -684,6 +678,9 @@ CefWebUIControllerFactory* CefWebUIControllerFactory::GetInstance() { void RegisterWebUIControllerFactory() { // Channel all WebUI handling through CefWebUIControllerFactory. + content::WebUIControllerFactory::UnregisterFactoryForTesting( + content::ContentWebUIControllerFactory::GetInstance()); + content::WebUIControllerFactory::RegisterFactory( CefWebUIControllerFactory::GetInstance()); } diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index f342ea491..6a873ead2 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -237,7 +237,7 @@ void SaveCookies(content::BrowserContext* browser_context, net::CookieInclusionStatus returned_status; std::unique_ptr cookie = net::CanonicalCookie::Create( request.url, cookie_string, base::Time::Now(), - base::make_optional(response_date), &returned_status); + absl::make_optional(response_date), &returned_status); if (!returned_status.IsInclude()) { continue; } diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 77a8d73ab..ab5b493d0 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -27,6 +27,7 @@ #include "net/url_request/url_request.h" #include "services/network/public/cpp/cors/cors.h" #include "services/network/public/cpp/features.h" +#include "services/network/public/mojom/early_hints.mojom.h" namespace net_service { @@ -963,7 +964,7 @@ void InterceptedRequest::ContinueToBeforeRedirect( bool should_clear_upload; net::RedirectUtil::UpdateHttpRequest(original_url, original_method, new_redirect_info, - base::make_optional(remove_headers), + absl::make_optional(remove_headers), /*modified_headers=*/absl::nullopt, &request_.headers, &should_clear_upload); diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index f7b6ec82c..0f1405ffc 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -45,6 +45,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/common/content_switches.h" #include "media/base/video_frame.h" +#include "media/capture/mojom/video_capture_buffer.mojom.h" #include "ui/compositor/compositor.h" #include "ui/events/blink/blink_event_util.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" @@ -60,8 +61,8 @@ const size_t kMaxDamageRects = 10; const float kDefaultScaleFactor = 1.0; -blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { - blink::ScreenInfo screenInfo; +display::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { + display::ScreenInfo screenInfo; screenInfo.device_scale_factor = src.device_scale_factor; screenInfo.depth = src.depth; screenInfo.depth_per_component = src.depth_per_component; @@ -684,7 +685,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface( } } -void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) { +void CefRenderWidgetHostViewOSR::GetScreenInfo(display::ScreenInfo* results) { if (!browser_impl_.get()) return; diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 8f9470a67..6a028cfc3 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -157,7 +157,7 @@ class CefRenderWidgetHostViewOSR const gfx::Rect& src_rect, const gfx::Size& output_size, base::OnceCallback callback) override; - void GetScreenInfo(blink::ScreenInfo* results) override; + void GetScreenInfo(display::ScreenInfo* results) override; void TransformPointToRootSurface(gfx::PointF* point) override; gfx::Rect GetBoundsInRootWindow() override; diff --git a/libcef/browser/osr/video_consumer_osr.cc b/libcef/browser/osr/video_consumer_osr.cc index 87e4cee9c..3ab1c71cf 100644 --- a/libcef/browser/osr/video_consumer_osr.cc +++ b/libcef/browser/osr/video_consumer_osr.cc @@ -7,6 +7,7 @@ #include "libcef/browser/osr/render_widget_host_view_osr.h" #include "media/base/video_frame_metadata.h" +#include "media/capture/mojom/video_capture_buffer.mojom.h" #include "media/capture/mojom/video_capture_types.mojom.h" #include "ui/gfx/skbitmap_operations.h" diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index bf7058930..ad38b18aa 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -298,6 +298,9 @@ std::unique_ptr CreatePrefService(Profile* profile, registry->RegisterFilePathPref(prefs::kDiskCacheDir, cache_path); registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0); + // Based on Profile::RegisterProfilePrefs. + registry->RegisterBooleanPref(prefs::kSearchSuggestEnabled, false); + // Spell checking preferences. // Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs. std::string spellcheck_lang = diff --git a/libcef/browser/prefs/pref_store.cc b/libcef/browser/prefs/pref_store.cc index 451e34c7c..56514e19f 100644 --- a/libcef/browser/prefs/pref_store.cc +++ b/libcef/browser/prefs/pref_store.cc @@ -107,6 +107,12 @@ void CefPrefStore::CommitPendingWrite( std::move(synchronous_done_callback)); } +void CefPrefStore::CommitPendingWriteSynchronously() { + // This method was added for one very specific use case and is intentionally + // not implemented for other pref stores. + NOTREACHED(); +} + void CefPrefStore::SchedulePendingLossyWrites() {} void CefPrefStore::ClearMutableValues() { @@ -155,7 +161,11 @@ bool CefPrefStore::GetString(const std::string& key, std::string* value) const { if (!prefs_.GetValue(key, &stored_value) || !stored_value) return false; - return stored_value->GetAsString(value); + if (value && stored_value->is_string()) { + *value = stored_value->GetString(); + return true; + } + return stored_value->is_string(); } bool CefPrefStore::GetInteger(const std::string& key, int* value) const { @@ -163,7 +173,11 @@ bool CefPrefStore::GetInteger(const std::string& key, int* value) const { if (!prefs_.GetValue(key, &stored_value) || !stored_value) return false; - return stored_value->GetAsInteger(value); + if (value && stored_value->is_int()) { + *value = stored_value->GetInt(); + return true; + } + return stored_value->is_int(); } bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const { @@ -171,7 +185,11 @@ bool CefPrefStore::GetBoolean(const std::string& key, bool* value) const { if (!prefs_.GetValue(key, &stored_value) || !stored_value) return false; - return stored_value->GetAsBoolean(value); + if (value && stored_value->is_bool()) { + *value = stored_value->GetBool(); + return true; + } + return stored_value->is_bool(); } void CefPrefStore::SetBlockAsyncRead(bool block_async_read) { diff --git a/libcef/browser/prefs/pref_store.h b/libcef/browser/prefs/pref_store.h index 600677088..cc116d23d 100644 --- a/libcef/browser/prefs/pref_store.h +++ b/libcef/browser/prefs/pref_store.h @@ -49,6 +49,7 @@ class CefPrefStore : public PersistentPrefStore { virtual void CommitPendingWrite( base::OnceClosure done_callback, base::OnceClosure synchronous_done_callback) override; + void CommitPendingWriteSynchronously() override; void SchedulePendingLossyWrites() override; void ClearMutableValues() override; void OnStoreDeletionFromDisk() override; diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index d6521e2c1..fc92e1fca 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -371,7 +371,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, } void PopulateWebPreferences(content::RenderViewHost* rvh, - blink::web_pref::WebPreferences& web) { + blink::web_pref::WebPreferences& web, + SkColor& base_background_color) { REQUIRE_ALLOY_RUNTIME(); CefRefPtr browser = static_cast( extensions::GetOwnerBrowserForHost(rvh, nullptr).get()); @@ -421,11 +422,11 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, web.picture_in_picture_enabled = browser->IsPictureInPictureSupported(); // Set the background color for the WebView. - web.base_background_color = browser->GetBackgroundColor(); + base_background_color = browser->GetBackgroundColor(); } else { // We don't know for sure that the browser will be windowless but assume // that the global windowless state is likely to be accurate. - web.base_background_color = + base_background_color = CefContext::Get()->GetBackgroundColor(nullptr, STATE_DEFAULT); } } diff --git a/libcef/browser/prefs/renderer_prefs.h b/libcef/browser/prefs/renderer_prefs.h index 00ab48d22..7222d6ec7 100644 --- a/libcef/browser/prefs/renderer_prefs.h +++ b/libcef/browser/prefs/renderer_prefs.h @@ -8,6 +8,8 @@ #include "include/internal/cef_types_wrappers.h" +#include "third_party/skia/include/core/SkColor.h" + class CommandLinePrefStore; namespace blink { @@ -48,7 +50,8 @@ void SetCefPrefs(const CefBrowserSettings& cef, // Populate WebPreferences based on a combination of command-line values, // PrefService and CefBrowserSettings. void PopulateWebPreferences(content::RenderViewHost* rvh, - blink::web_pref::WebPreferences& web); + blink::web_pref::WebPreferences& web, + SkColor& base_background_color); bool PopulateWebPreferencesAfterNavigation( content::WebContents* web_contents, blink::web_pref::WebPreferences& web); diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index ceca19795..d76bb44a7 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -59,7 +59,7 @@ void FillInDictionaryFromPdfPrintSettings( base::DictionaryValue& print_settings) { // Fixed settings. print_settings.SetIntKey(kSettingPrinterType, - static_cast(PrinterType::kPdf)); + static_cast(mojom::PrinterType::kPdf)); print_settings.SetInteger(kSettingColor, static_cast(mojom::ColorModel::kGray)); print_settings.SetInteger(kSettingDuplexMode, diff --git a/libcef/browser/server_impl.cc b/libcef/browser/server_impl.cc index 486020506..a8b78ba73 100644 --- a/libcef/browser/server_impl.cc +++ b/libcef/browser/server_impl.cc @@ -522,7 +522,7 @@ void CefServerImpl::StartOnUIThread(const std::string& address, new base::Thread(base::StringPrintf("%s:%d", address.c_str(), port))); base::Thread::Options options; options.message_pump_type = base::MessagePumpType::IO; - if (thread->StartWithOptions(options)) { + if (thread->StartWithOptions(std::move(options))) { // Add a reference that will be released in ShutdownOnUIThread(). AddRef(); diff --git a/libcef/browser/ssl_host_state_delegate.cc b/libcef/browser/ssl_host_state_delegate.cc index a7f037a2a..d53dfc351 100644 --- a/libcef/browser/ssl_host_state_delegate.cc +++ b/libcef/browser/ssl_host_state_delegate.cc @@ -55,6 +55,16 @@ bool CefSSLHostStateDelegate::DidHostRunInsecureContent( return false; } +void CefSSLHostStateDelegate::AllowHttpForHost(const std::string& host) { + // Intentional no-op. +} + +bool CefSSLHostStateDelegate::IsHttpAllowedForHost(const std::string& host) { + // Intentional no-op. Return value does not matter as HTTPS-Only Mode is not + // enabled. + return false; +} + void CefSSLHostStateDelegate::AllowCert(const std::string& host, const net::X509Certificate& cert, int error, diff --git a/libcef/browser/ssl_host_state_delegate.h b/libcef/browser/ssl_host_state_delegate.h index 3085c6eec..0de3355a3 100644 --- a/libcef/browser/ssl_host_state_delegate.h +++ b/libcef/browser/ssl_host_state_delegate.h @@ -64,6 +64,8 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { bool DidHostRunInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override; + void AllowHttpForHost(const std::string& host) override; + bool IsHttpAllowedForHost(const std::string& host) override; void RevokeUserAllowExceptions(const std::string& host) override; bool HasAllowException(const std::string& host, content::WebContents* web_contents) override; diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 601ace142..4ff9b0ec4 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -13,6 +13,7 @@ #include "base/logging.h" #include "ui/gfx/color_utils.h" +#include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/button.h" // Helpers for template boiler-plate. @@ -53,7 +54,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { views::Button::ButtonState new_state = static_cast(state); - if (ParentClass::root_view()->ink_drop()->ink_drop_mode() != + if (views::InkDrop::Get(ParentClass::root_view())->ink_drop_mode() != views::InkDropHost::InkDropMode::OFF && !ParentClass::root_view()->IsFocusable()) { // Ink drop state does not get set properly on state change when the button @@ -64,7 +65,8 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { } else if (old_state == views::Button::STATE_PRESSED) { ink_state = views::InkDropState::DEACTIVATED; } - ParentClass::root_view()->ink_drop()->AnimateToState(ink_state, nullptr); + views::InkDrop::Get(ParentClass::root_view()) + ->AnimateToState(ink_state, nullptr); } ParentClass::root_view()->SetState(new_state); @@ -77,12 +79,12 @@ CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() { CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { CEF_REQUIRE_VALID_RETURN_VOID(); - ParentClass::root_view()->ink_drop()->SetMode( - enabled ? views::InkDropHost::InkDropMode::ON - : views::InkDropHost::InkDropMode::OFF); + views::InkDrop::Get(ParentClass::root_view()) + ->SetMode(enabled ? views::InkDropHost::InkDropMode::ON + : views::InkDropHost::InkDropMode::OFF); if (enabled) { - ParentClass::root_view()->ink_drop()->SetBaseColor( - color_utils::BlendTowardMaxContrast( + views::InkDrop::Get(ParentClass::root_view()) + ->SetBaseColor(color_utils::BlendTowardMaxContrast( ParentClass::root_view()->background()->get_color(), 0x61)); } } diff --git a/libcef/browser/views/button_view.h b/libcef/browser/views/button_view.h index 7296430a6..1d4f76c2d 100644 --- a/libcef/browser/views/button_view.h +++ b/libcef/browser/views/button_view.h @@ -12,6 +12,7 @@ #include "libcef/browser/views/view_view.h" #include "base/logging.h" +#include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/button.h" // Helpers for template boiler-plate. @@ -59,7 +60,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed( // Callback may trigger new animation state. if (ParentClass::cef_delegate()) ParentClass::cef_delegate()->OnButtonPressed(GetCefButton()); - if (ParentClass::ink_drop()->ink_drop_mode() != + if (views::InkDrop::Get(this)->ink_drop_mode() != views::InkDropHost::InkDropMode::OFF && !ParentClass::IsFocusable() && ParentClass::GetState() != views::Button::STATE_PRESSED) { @@ -67,7 +68,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed( // non-focusable. Reset the ink drop state here if the state has not been // explicitly set to pressed by the OnButtonPressed callback calling // SetState (which also sets the ink drop state). - ParentClass::ink_drop()->AnimateToState( + views::InkDrop::Get(this)->AnimateToState( views::InkDropState::HIDDEN, ui::LocatedEvent::FromIfValid(&event)); } } diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 1d172e198..ae19e72cf 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -138,7 +138,7 @@ class CaptionlessFrameView : public views::NonClientFrameView { // fullscreen, as it can't be resized in those states. int resize_border_thickness = ResizeBorderThickness(); int frame_component = GetHTComponentForFrame( - point, resize_border_thickness, resize_border_thickness, + point, gfx::Insets(resize_border_thickness, resize_border_thickness), kResizeAreaCornerSize, kResizeAreaCornerSize, can_ever_resize); if (frame_component != HTNOWHERE) return frame_component; @@ -260,6 +260,12 @@ void CefWindowView::CreateWidget() { params.type = views::Widget::InitParams::TYPE_WINDOW; bool can_activate = true; + // WidgetDelegate::DeleteDelegate() will delete |this| after executing the + // registered callback. + SetOwnedByWidget(true); + RegisterDeleteDelegateCallback( + base::BindOnce(&CefWindowView::DeleteDelegate, base::Unretained(this))); + if (cef_delegate()) { CefRefPtr cef_window = GetCefWindow(); is_frameless_ = cef_delegate()->IsFrameless(cef_window); @@ -267,6 +273,8 @@ void CefWindowView::CreateWidget() { auto bounds = cef_delegate()->GetInitialBounds(cef_window); params.bounds = gfx::Rect(bounds.x, bounds.y, bounds.width, bounds.height); + SetCanResize(cef_delegate()->CanResize(cef_window)); + bool is_menu = false; bool can_activate_menu = true; CefRefPtr parent_window = cef_delegate()->GetParentWindow( @@ -335,15 +343,6 @@ void CefWindowView::DeleteDelegate() { RemoveAllChildViews(true); window_delegate_->OnWindowViewDeleted(); - - // Deletes |this|. - views::WidgetDelegateView::DeleteDelegate(); -} - -bool CefWindowView::CanResize() const { - if (!cef_delegate()) - return true; - return cef_delegate()->CanResize(GetCefWindow()); } bool CefWindowView::CanMinimize() const { @@ -362,18 +361,22 @@ std::u16string CefWindowView::GetWindowTitle() const { return title_; } -gfx::ImageSkia CefWindowView::GetWindowIcon() { +ui::ImageModel CefWindowView::GetWindowIcon() { if (!window_icon_) return ParentClass::GetWindowIcon(); - return static_cast(window_icon_.get()) - ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + auto image_skia = + static_cast(window_icon_.get()) + ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + return ui::ImageModel::FromImageSkia(image_skia); } -gfx::ImageSkia CefWindowView::GetWindowAppIcon() { +ui::ImageModel CefWindowView::GetWindowAppIcon() { if (!window_app_icon_) return ParentClass::GetWindowAppIcon(); - return static_cast(window_app_icon_.get()) - ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + auto image_skia = + static_cast(window_app_icon_.get()) + ->GetForced1xScaleRepresentation(GetDisplay().device_scale_factor()); + return ui::ImageModel::FromImageSkia(image_skia); } void CefWindowView::WindowClosing() { diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index cf9e7cef1..c012dc5a0 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -49,16 +49,12 @@ class CefWindowView // CefViewView::GetCefView. CefRefPtr GetCefWindow() const; - // views::WidgetDelegateView methods: - void DeleteDelegate() override; - // views::WidgetDelegate methods: - bool CanResize() const override; bool CanMinimize() const override; bool CanMaximize() const override; std::u16string GetWindowTitle() const override; - gfx::ImageSkia GetWindowIcon() override; - gfx::ImageSkia GetWindowAppIcon() override; + ui::ImageModel GetWindowIcon() override; + ui::ImageModel GetWindowAppIcon() override; void WindowClosing() override; views::View* GetContentsView() override; views::ClientView* CreateClientView(views::Widget* widget) override; @@ -101,6 +97,9 @@ class CefWindowView views::NonClientFrameView* GetNonClientFrameView() const; private: + // Called when removed from the Widget and before |this| is deleted. + void DeleteDelegate(); + // Not owned by this object. Delegate* window_delegate_; diff --git a/libcef/common/net/scheme_registration.cc b/libcef/common/net/scheme_registration.cc index b34eb9704..4b23dcacc 100644 --- a/libcef/common/net/scheme_registration.cc +++ b/libcef/common/net/scheme_registration.cc @@ -8,7 +8,7 @@ #include "libcef/common/net/scheme_info.h" #include "libcef/features/runtime.h" -#include "base/stl_util.h" +#include "base/containers/contains.h" #include "content/public/common/url_constants.h" #include "extensions/common/constants.h" #include "net/net_buildflags.h" diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 19642a1f3..fcb40950f 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -102,9 +102,9 @@ int GetCacheControlHeaderPolicy(CefRequest::HeaderMap headerMap) { // Convert cef_urlrequest_flags_t to blink::WebCachePolicy. blink::mojom::FetchCacheMode GetFetchCacheMode(int ur_flags) { - const bool skip_cache{ur_flags & UR_FLAG_SKIP_CACHE}; - const bool only_from_cache{ur_flags & UR_FLAG_ONLY_FROM_CACHE}; - const bool disable_cache{ur_flags & UR_FLAG_DISABLE_CACHE}; + const bool skip_cache{!!(ur_flags & UR_FLAG_SKIP_CACHE)}; + const bool only_from_cache{!!(ur_flags & UR_FLAG_ONLY_FROM_CACHE)}; + const bool disable_cache{!!(ur_flags & UR_FLAG_DISABLE_CACHE)}; if (only_from_cache && (skip_cache || disable_cache)) { // The request will always fail because only_from_cache and // skip_cache/disable_cache are mutually exclusive. diff --git a/libcef/common/thread_impl.cc b/libcef/common/thread_impl.cc index ca4cff69c..89850ed1e 100644 --- a/libcef/common/thread_impl.cc +++ b/libcef/common/thread_impl.cc @@ -105,7 +105,7 @@ bool CefThreadImpl::Create(const CefString& display_name, } #endif - if (!thread_->StartWithOptions(options)) { + if (!thread_->StartWithOptions(std::move(options))) { thread_.reset(); return false; } diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index d3ce3db38..4f11201f8 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -243,8 +243,8 @@ bool CefValueImpl::GetBool() { base::AutoLock lock_scope(lock_); bool ret_value = false; - if (value_) - value_->GetAsBoolean(&ret_value); + if (value_ && value_->is_bool()) + ret_value = value_->GetBool(); return ret_value; } @@ -252,8 +252,8 @@ int CefValueImpl::GetInt() { base::AutoLock lock_scope(lock_); int ret_value = 0; - if (value_) - value_->GetAsInteger(&ret_value); + if (value_ && value_->is_int()) + ret_value = value_->GetInt(); return ret_value; } @@ -261,8 +261,8 @@ double CefValueImpl::GetDouble() { base::AutoLock lock_scope(lock_); double ret_value = 0; - if (value_) - value_->GetAsDouble(&ret_value); + if (value_ && value_->is_double()) + ret_value = value_->GetDouble(); return ret_value; } @@ -270,8 +270,8 @@ CefString CefValueImpl::GetString() { base::AutoLock lock_scope(lock_); std::string ret_value; - if (value_) - value_->GetAsString(&ret_value); + if (value_ && value_->is_string()) + ret_value = value_->GetString(); return ret_value; } @@ -691,7 +691,7 @@ CefRefPtr CefDictionaryValueImpl::Copy( size_t CefDictionaryValueImpl::GetSize() { CEF_VALUE_VERIFY_RETURN(false, 0); - return const_value().size(); + return const_value().DictSize(); } bool CefDictionaryValueImpl::Clear() { @@ -700,7 +700,7 @@ bool CefDictionaryValueImpl::Clear() { // Detach any dependent values. controller()->RemoveDependencies(mutable_value()); - mutable_value()->Clear(); + mutable_value()->DictClear(); return true; } @@ -728,10 +728,9 @@ bool CefDictionaryValueImpl::Remove(const CefString& key) { CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID); - const base::Value* out_value = nullptr; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), - &out_value)) { - switch (out_value->type()) { + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value) { + switch (value->type()) { case base::Value::Type::NONE: return VTYPE_NULL; case base::Value::Type::BOOLEAN: @@ -757,11 +756,10 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { CefRefPtr CefDictionaryValueImpl::GetValue(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); - const base::Value* out_value = nullptr; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), - &out_value)) { + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value) { return CefValueImpl::GetOrCreateRefOrCopy( - const_cast(out_value), + const_cast(value), const_cast(&const_value()), read_only(), controller()); } @@ -772,11 +770,12 @@ CefRefPtr CefDictionaryValueImpl::GetValue(const CefString& key) { bool CefDictionaryValueImpl::GetBool(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, false); - const base::Value* out_value = nullptr; bool ret_value = false; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) - out_value->GetAsBoolean(&ret_value); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_bool()) { + ret_value = value->GetBool(); + } return ret_value; } @@ -784,11 +783,12 @@ bool CefDictionaryValueImpl::GetBool(const CefString& key) { int CefDictionaryValueImpl::GetInt(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, 0); - const base::Value* out_value = nullptr; int ret_value = 0; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) - out_value->GetAsInteger(&ret_value); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_int()) { + ret_value = value->GetInt(); + } return ret_value; } @@ -796,11 +796,12 @@ int CefDictionaryValueImpl::GetInt(const CefString& key) { double CefDictionaryValueImpl::GetDouble(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, 0); - const base::Value* out_value = nullptr; double ret_value = 0; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) - out_value->GetAsDouble(&ret_value); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_double()) { + ret_value = value->GetDouble(); + } return ret_value; } @@ -808,11 +809,12 @@ double CefDictionaryValueImpl::GetDouble(const CefString& key) { CefString CefDictionaryValueImpl::GetString(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, CefString()); - const base::Value* out_value = nullptr; std::string ret_value; - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), &out_value)) - out_value->GetAsString(&ret_value); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_string()) { + ret_value = value->GetString(); + } return ret_value; } @@ -821,12 +823,9 @@ CefRefPtr CefDictionaryValueImpl::GetBinary( const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); - const base::Value* out_value = nullptr; - - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), - &out_value) && - out_value->is_blob()) { - base::Value* binary_value = const_cast(out_value); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_blob()) { + base::Value* binary_value = const_cast(value); return CefBinaryValueImpl::GetOrCreateRef( binary_value, const_cast(&const_value()), controller()); @@ -839,13 +838,10 @@ CefRefPtr CefDictionaryValueImpl::GetDictionary( const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); - const base::Value* out_value = nullptr; - - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), - &out_value) && - out_value->is_dict()) { - base::DictionaryValue* dict_value = static_cast( - const_cast(out_value)); + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_dict()) { + base::DictionaryValue* dict_value = + static_cast(const_cast(value)); return CefDictionaryValueImpl::GetOrCreateRef( dict_value, const_cast(&const_value()), read_only(), controller()); @@ -857,13 +853,10 @@ CefRefPtr CefDictionaryValueImpl::GetDictionary( CefRefPtr CefDictionaryValueImpl::GetList(const CefString& key) { CEF_VALUE_VERIFY_RETURN(false, nullptr); - const base::Value* out_value = nullptr; - - if (const_value().GetWithoutPathExpansion(base::StringPiece(key), - &out_value) && - out_value->is_list()) { + const base::Value* value = const_value().FindKey(base::StringPiece(key)); + if (value && value->is_list()) { base::ListValue* list_value = - static_cast(const_cast(out_value)); + static_cast(const_cast(value)); return CefListValueImpl::GetOrCreateRef( list_value, const_cast(&const_value()), read_only(), controller()); @@ -952,18 +945,29 @@ bool CefDictionaryValueImpl::SetList(const CefString& key, } bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) { - std::unique_ptr out_value; - if (!mutable_value()->RemoveWithoutPathExpansion(base::StringPiece(key), - &out_value)) { + // The ExtractKey() call below which removes the Value from the dictionary + // will return a new Value object with the moved contents of the Value that + // exists in the implementation std::map. Consequently we use FindKey() to + // retrieve the actual Value pointer as it current exists first, for later + // comparison purposes. + const base::Value* actual_value = + const_value().FindKey(base::StringPiece(key)); + if (!actual_value) + return false; + + // |actual_value| is no longer valid after this call. + absl::optional out_value = + mutable_value()->ExtractKey(base::StringPiece(key)); + if (!out_value.has_value()) { return false; } // Remove the value. - controller()->Remove(out_value.get(), true); + controller()->Remove(const_cast(actual_value), true); // Only list and dictionary types may have dependencies. if (out_value->is_list() || out_value->is_dict()) { - controller()->RemoveDependencies(out_value.get()); + controller()->RemoveDependencies(const_cast(actual_value)); } return true; @@ -1126,7 +1130,7 @@ bool CefListValueImpl::Clear() { // Detach any dependent values. controller()->RemoveDependencies(mutable_value()); - mutable_value()->Clear(); + mutable_value()->ClearList(); return true; } @@ -1183,8 +1187,9 @@ bool CefListValueImpl::GetBool(size_t index) { const base::Value* out_value = nullptr; bool ret_value = false; - if (const_value().Get(index, &out_value)) - out_value->GetAsBoolean(&ret_value); + if (const_value().Get(index, &out_value) && out_value->is_bool()) { + ret_value = out_value->GetBool(); + } return ret_value; } @@ -1195,8 +1200,9 @@ int CefListValueImpl::GetInt(size_t index) { const base::Value* out_value = nullptr; int ret_value = 0; - if (const_value().Get(index, &out_value)) - out_value->GetAsInteger(&ret_value); + if (const_value().Get(index, &out_value) && out_value->is_int()) { + ret_value = out_value->GetInt(); + } return ret_value; } @@ -1207,8 +1213,9 @@ double CefListValueImpl::GetDouble(size_t index) { const base::Value* out_value = nullptr; double ret_value = 0; - if (const_value().Get(index, &out_value)) - out_value->GetAsDouble(&ret_value); + if (const_value().Get(index, &out_value) && out_value->is_double()) { + ret_value = out_value->GetDouble(); + } return ret_value; } @@ -1219,8 +1226,9 @@ CefString CefListValueImpl::GetString(size_t index) { const base::Value* out_value = nullptr; std::string ret_value; - if (const_value().Get(index, &out_value)) - out_value->GetAsString(&ret_value); + if (const_value().Get(index, &out_value) && out_value->is_string()) { + ret_value = out_value->GetString(); + } return ret_value; } @@ -1348,24 +1356,28 @@ bool CefListValueImpl::SetList(size_t index, CefRefPtr value) { } bool CefListValueImpl::RemoveInternal(size_t index) { - // base::Value now uses move semantics which means that Remove() will return - // a new base::Value object with the moved contents of the base::Value that - // exists in the implementation std::vector. Consequently we use Get() to - // retrieve the actual base::Value pointer as it exists in the std::vector. - const base::Value* actual_value = nullptr; - if (!const_value().Get(index, &actual_value)) + auto list = mutable_value()->GetList(); + if (index >= list.size()) return false; - DCHECK(actual_value); - std::unique_ptr out_value; - if (!mutable_value()->Remove(index, &out_value)) + // The std::move() call below which removes the Value from the list will + // return a new Value object with the moved contents of the Value that exists + // in the implementation std::vector. Consequently we use Get() to retrieve + // the actual Value pointer as it current exists first, for later comparison + // purposes. + const base::Value* actual_value = nullptr; + if (!const_value().Get(index, &actual_value) || !actual_value) return false; + // |actual_value| is no longer valid after this call. + auto out_value = std::move(list[index]); + mutable_value()->EraseListIter(list.begin() + index); + // Remove the value. controller()->Remove(const_cast(actual_value), true); // Only list and dictionary types may have dependencies. - if (out_value->is_list() || out_value->is_dict()) { + if (out_value.is_list() || out_value.is_dict()) { controller()->RemoveDependencies(const_cast(actual_value)); } @@ -1375,10 +1387,13 @@ bool CefListValueImpl::RemoveInternal(size_t index) { base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) { DCHECK(value); - if (RemoveInternal(index)) - mutable_value()->Insert(index, base::WrapUnique(value)); - else + if (RemoveInternal(index)) { + auto list = mutable_value()->GetList(); + CHECK_LE(index, list.size()); + mutable_value()->Insert(list.begin() + index, std::move(*value)); + } else { mutable_value()->Set(index, base::WrapUnique(value)); + } // base::Value now uses move semantics which means that Insert()/Set() will // move the contents of the passed-in base::Value instead of keeping the same diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index 426b99e25..ac9312388 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -53,7 +53,7 @@ const char kWidevineCdmArch[] = "x64"; #elif defined(ARCH_CPU_ARM64) "arm64"; -#else +#else "???"; #endif @@ -93,6 +93,7 @@ const char kCdmSupportedEncryptionSchemesName[] = // parameter |kCdmCodecsListName|. const char kCdmSupportedCodecVp8[] = "vp8"; const char kCdmSupportedCodecVp9[] = "vp09"; +const char kCdmSupportedCodecAv1[] = "av01"; #if BUILDFLAG(USE_PROPRIETARY_CODECS) const char kCdmSupportedCodecAvc1[] = "avc1"; #endif @@ -197,7 +198,7 @@ bool IsCompatibleWithChrome(const base::DictionaryValue& manifest, // valid. Returns false and does not modify |video_codecs| if the manifest entry // is incorrectly formatted. bool GetCodecs(const base::DictionaryValue& manifest, - std::vector* video_codecs, + media::CdmCapability::VideoCodecMap* video_codecs, std::string* error_message) { DCHECK(video_codecs); @@ -224,19 +225,22 @@ bool GetCodecs(const base::DictionaryValue& manifest, return true; } - std::vector result; + media::CdmCapability::VideoCodecMap result; + const std::vector kAllProfiles = {}; const std::vector supported_codecs = base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); for (const auto& codec : supported_codecs) { if (codec == kCdmSupportedCodecVp8) - result.push_back(media::VideoCodec::kCodecVP8); + result.emplace(media::VideoCodec::kCodecVP8, kAllProfiles); else if (codec == kCdmSupportedCodecVp9) - result.push_back(media::VideoCodec::kCodecVP9); + result.emplace(media::VideoCodec::kCodecVP9, kAllProfiles); + else if (codec == kCdmSupportedCodecAv1) + result.emplace(media::VideoCodec::kCodecAV1, kAllProfiles); #if BUILDFLAG(USE_PROPRIETARY_CODECS) else if (codec == kCdmSupportedCodecAvc1) - result.push_back(media::VideoCodec::kCodecH264); + result.emplace(media::VideoCodec::kCodecH264, kAllProfiles); #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) } diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 315aa35a3..caa0e97da 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -64,7 +64,6 @@ #include "components/spellcheck/renderer/spellcheck_provider.h" #include "components/visitedlink/renderer/visitedlink_reader.h" #include "components/web_cache/renderer/web_cache_impl.h" -#include "content/common/frame_messages.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -309,13 +308,13 @@ void AlloyContentRendererClient::RenderFrameCreated( } } -void AlloyContentRendererClient::RenderViewCreated( - content::RenderView* render_view) { +void AlloyContentRendererClient::WebViewCreated(blink::WebView* web_view) { bool browser_created; absl::optional is_windowless; - render_manager_->RenderViewCreated(render_view, browser_created, - is_windowless); + render_manager_->WebViewCreated(web_view, browser_created, is_windowless); if (browser_created) { + auto render_view = content::RenderView::FromWebView(web_view); + CHECK(render_view); OnBrowserCreated(render_view, is_windowless); } } diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index 13d7d68b4..7f713c383 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -79,7 +79,7 @@ class AlloyContentRendererClient void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override; void RenderThreadConnected() override; void RenderFrameCreated(content::RenderFrame* render_frame) override; - void RenderViewCreated(content::RenderView* render_view) override; + void WebViewCreated(blink::WebView* web_view) override; bool IsPluginHandledExternally(content::RenderFrame* render_frame, const blink::WebElement& plugin_element, const GURL& original_url, diff --git a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc index 99ad48340..940c8ce7e 100644 --- a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc +++ b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc @@ -53,14 +53,12 @@ void ChromeContentRendererClientCef::RenderFrameCreated( } } -void ChromeContentRendererClientCef::RenderViewCreated( - content::RenderView* render_view) { - ChromeContentRendererClient::RenderViewCreated(render_view); +void ChromeContentRendererClientCef::WebViewCreated(blink::WebView* web_view) { + ChromeContentRendererClient::WebViewCreated(web_view); bool browser_created; absl::optional is_windowless; - render_manager_->RenderViewCreated(render_view, browser_created, - is_windowless); + render_manager_->WebViewCreated(web_view, browser_created, is_windowless); if (is_windowless.has_value() && *is_windowless) { LOG(ERROR) << "The chrome runtime does not support windowless browsers"; } diff --git a/libcef/renderer/chrome/chrome_content_renderer_client_cef.h b/libcef/renderer/chrome/chrome_content_renderer_client_cef.h index 3cfc40457..f09782ec7 100644 --- a/libcef/renderer/chrome/chrome_content_renderer_client_cef.h +++ b/libcef/renderer/chrome/chrome_content_renderer_client_cef.h @@ -34,7 +34,7 @@ class ChromeContentRendererClientCef : public ChromeContentRendererClient { void RenderThreadStarted() override; void RenderThreadConnected() override; void RenderFrameCreated(content::RenderFrame* render_frame) override; - void RenderViewCreated(content::RenderView* render_view) override; + void WebViewCreated(blink::WebView* web_view) override; void DevToolsAgentAttached() override; void DevToolsAgentDetached() override; void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override; diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index f5d56a248..47a664631 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -8,6 +8,7 @@ #include "libcef/renderer/extensions/extensions_dispatcher_delegate.h" #include "base/command_line.h" +#include "base/stl_util.h" #include "chrome/common/url_constants.h" #include "chrome/renderer/extensions/extension_process_policy.h" #include "chrome/renderer/extensions/resource_request_policy.h" diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 5efe62dab..576937107 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -279,15 +279,12 @@ std::unique_ptr CefFrameImpl::CreateURLLoader() { if (!url_loader_factory_) return nullptr; - // KeepAlive is not supported. - mojo::PendingRemote keep_alive_handle = - mojo::NullRemote(); - return url_loader_factory_->CreateURLLoader( blink::WebURLRequest(), blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_), blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_), - std::move(keep_alive_handle), blink::WebBackForwardCacheLoaderHelper()); + /*keep_alive_handle=*/mojo::NullRemote(), + blink::WebBackForwardCacheLoaderHelper()); } std::unique_ptr @@ -357,7 +354,7 @@ void CefFrameImpl::OnDraggableRegionsChanged() { if (browser_frame) { browser_frame->UpdateDraggableRegions( regions.empty() ? absl::nullopt - : base::make_optional(std::move(regions))); + : absl::make_optional(std::move(regions))); } } diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index 3dc2e3dea..a06f8b72b 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -110,11 +110,19 @@ void CefRenderManager::RenderFrameCreated( } } -void CefRenderManager::RenderViewCreated(content::RenderView* render_view, - bool& browser_created, - absl::optional& is_windowless) { - MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame(), - &browser_created, &is_windowless); +void CefRenderManager::WebViewCreated(blink::WebView* web_view, + bool& browser_created, + absl::optional& is_windowless) { + auto render_view = content::RenderView::FromWebView(web_view); + CHECK(render_view); + content::RenderFrame* render_frame = nullptr; + if (web_view->MainFrame()->IsWebLocalFrame()) { + render_frame = content::RenderFrame::FromWebFrame( + web_view->MainFrame()->ToWebLocalFrame()); + } + + MaybeCreateBrowser(render_view, render_frame, &browser_created, + &is_windowless); } void CefRenderManager::DevToolsAgentAttached() { diff --git a/libcef/renderer/render_manager.h b/libcef/renderer/render_manager.h index b2a3d1496..5d42c0ed7 100644 --- a/libcef/renderer/render_manager.h +++ b/libcef/renderer/render_manager.h @@ -19,7 +19,8 @@ namespace blink { class WebFrame; -} +class WebView; +} // namespace blink namespace content { class RenderFrame; @@ -50,9 +51,9 @@ class CefRenderManager : public cef::mojom::RenderManager { CefRenderFrameObserver* render_frame_observer, bool& browser_created, absl::optional& is_windowless); - void RenderViewCreated(content::RenderView* render_view, - bool& browser_created, - absl::optional& is_windowless); + void WebViewCreated(blink::WebView* web_view, + bool& browser_created, + absl::optional& is_windowless); void DevToolsAgentAttached(); void DevToolsAgentDetached(); void ExposeInterfacesToBrowser(mojo::BinderMap* binders); diff --git a/patch/patch.cfg b/patch/patch.cfg index 9938c3a03..b8f3568c9 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -64,11 +64,8 @@ patches = [ 'name': 'trace_event', }, { - # Enable popups in offscreen rendering on OS X. - # - # Allow customization of the WebView background color. - # https://bitbucket.org/chromiumembedded/cef/issues/2345 - 'name': 'webkit_popups_and_background', + # Enable popups in offscreen rendering on MacOS. + 'name': 'webkit_popups', }, { # Give AlloyContentRendererClient access to protected @@ -76,7 +73,7 @@ patches = [ 'name': 'webkit_runtime_enabled_features', }, { - # Fix export of UnderlayOpenGLHostingWindow for 64-bit OS X builds. + # Fix export of UnderlayOpenGLHostingWindow for 64-bit MacOS builds. # https://bitbucket.org/chromiumembedded/cef/issues/1051 'name': 'underlay_1051', }, @@ -449,6 +446,13 @@ patches = [ # This crash was introduced by https://crrev.com/5f6212babf. 'name': 'browser_scheduler', }, + { + # Restore access to WebUIControllerFactory::UnregisterFactoryForTesting + # which was removed in https://crrev.com/5f183d6636. We can't use + # ScopedWebUIControllerFactoryRegistration because it pulls in GTest + # dependencies. + 'name': 'browser_web_ui_controller_factory', + }, { # Avoid a shutdown crash caused by PrefWatcher holding a reference to # |g_browser_process->local_state()|, and the local_state being deleted @@ -533,20 +537,14 @@ patches = [ # https://bugs.chromium.org/p/chromium/issues/detail?id=1049498#c14 'name': 'base_string_piece_1049498', }, - { - # Linux: Fix Sharesheet undefined symbol error. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 - 'name': 'chrome_browser_sharesheet_1123388', - }, { # Linux: Fix ATK assertion error when generating ARM build config. # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 'name': 'linux_atk_1123214', }, { - # Linux: Fix unknown type name 'uffdio_writeprotect' when building with - # use_sysroot=false on Ubuntu 18.04 (kernel version < 5.8). - # https://bugs.chromium.org/p/chromium/issues/detail?id=1206047#c8 - 'name': 'linux_allocator_uffd_1206047', + # Linux: Fix undefined symbol from ChromeSettingsProto. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1119417#c24 + 'name': 'chrome_browser_privacy_1119417', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index c6578bdba..debf47a7c 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index 6f993be10f692..bce42da34941f 100644 +index 576bd49a6198f..d5872f293f7cc 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index 6f993be10f692..bce42da34941f 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1769,7 +1770,11 @@ component("base") { +@@ -1731,7 +1732,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 6f993be10f692..bce42da34941f 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -2010,6 +2015,12 @@ component("base") { +@@ -1978,6 +1983,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch index 142241ec4..613fd47b2 100644 --- a/patch/patches/base_string_piece_1049498.patch +++ b/patch/patches/base_string_piece_1049498.patch @@ -1,5 +1,5 @@ diff --git base/strings/string_piece.h base/strings/string_piece.h -index 85a63d103a7f7..c17412d9c191a 100644 +index 5ceb3a40eb01b..89476bfa41e9b 100644 --- base/strings/string_piece.h +++ base/strings/string_piece.h @@ -23,6 +23,7 @@ @@ -9,4 +9,4 @@ index 85a63d103a7f7..c17412d9c191a 100644 +#include #include #include - #include + #include diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 884b32a0d..0efe9776c 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,8 +1,8 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index cf85dd542a27a..d663df4fa92af 100644 +index c04efa1296318..8c8515cb74a2b 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc -@@ -240,7 +240,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { +@@ -269,7 +269,7 @@ BrowserTaskExecutor::OnUserInputStart() { // static void BrowserTaskExecutor::Shutdown() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 05376d058..10fd31258 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index d548b3d7e0a0a..cb93301271cda 100644 +index eefad1a677606..7318d223a63d0 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1719,6 +1719,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1721,6 +1721,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,11 +20,11 @@ index d548b3d7e0a0a..cb93301271cda 100644 // TODO(wjmaclean): We should update the ProcessLock comparison API diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 751ee13227ae6..d4676b47955f8 100644 +index 5b830ecbb4a47..39b32f681233e 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -5314,6 +5314,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { - +@@ -5606,6 +5606,12 @@ url::Origin + NavigationRequest::GetOriginForURLLoaderFactoryWithoutFinalFrameHost() { // Calculate an approximation of the origin. The sandbox/csp are ignored. url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); + if (!origin.GetURL().IsStandard()) { @@ -36,3 +36,19 @@ index 751ee13227ae6..d4676b47955f8 100644 // Apply sandbox flags. // See https://html.spec.whatwg.org/#sandboxed-origin-browsing-context-flag +@@ -5639,6 +5645,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryWithFinalFrameHost() { + if (IsSameDocument() || IsPageActivation()) + return GetRenderFrameHost()->GetLastCommittedOrigin(); + ++ // Calculate an approximation of the origin. The sandbox/csp are ignored. ++ url::Origin unchecked_origin = GetOriginForURLLoaderFactoryUnchecked(this); ++ if (!unchecked_origin.GetURL().IsStandard()) { ++ // Always return an opaque origin for non-standard URLs. Otherwise, the ++ // below CanAccessDataForOrigin() check may fail for unregistered custom ++ // scheme requests in CEF. ++ return unchecked_origin.DeriveNewOpaqueOrigin(); ++ } ++ + url::Origin origin = GetOriginForURLLoaderFactoryWithoutFinalFrameHost(); + + // MHTML documents should commit as an opaque origin. They should not be able diff --git a/patch/patches/browser_web_ui_controller_factory.patch b/patch/patches/browser_web_ui_controller_factory.patch new file mode 100644 index 000000000..be22e0e1d --- /dev/null +++ b/patch/patches/browser_web_ui_controller_factory.patch @@ -0,0 +1,14 @@ +diff --git content/public/browser/web_ui_controller_factory.h content/public/browser/web_ui_controller_factory.h +index eb068fb9bb42c..4e8e6a1a7abf4 100644 +--- content/public/browser/web_ui_controller_factory.h ++++ content/public/browser/web_ui_controller_factory.h +@@ -47,9 +47,6 @@ class CONTENT_EXPORT WebUIControllerFactory { + virtual bool UseWebUIForURL(BrowserContext* browser_context, + const GURL& url) = 0; + +- private: +- friend class ScopedWebUIControllerFactoryRegistration; +- + static void UnregisterFactoryForTesting(WebUIControllerFactory* factory); + }; + diff --git a/patch/patches/build.patch b/patch/patches/build.patch index c0940a0c8..b9c2c4d45 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,10 +1,10 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 96545ed8a9e5b..6987659bff52b 100644 +index 13ed917c81281..5f7bf7cbf5ae9 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1849,8 +1849,6 @@ config("thin_archive") { - # archives. - if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { +@@ -1855,8 +1855,6 @@ config("thin_archive") { + # confuses lldb. + if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { arflags = [ "-T" ] - } else if (is_win && use_lld) { - arflags = [ "/llvmlibthin" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 45bceb15c..777377055 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 e0409fb795f27..8a3023ae62e82 100644 +index 0d81f08e66b1e..eba77d4116945 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -13,6 +13,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index e0409fb795f27..8a3023ae62e82 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1923,6 +1924,7 @@ static_library("browser") { +@@ -1904,6 +1905,7 @@ static_library("browser") { "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index e0409fb795f27..8a3023ae62e82 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2480,6 +2482,10 @@ static_library("browser") { +@@ -2471,6 +2473,10 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index cb0778659..8346dd6f8 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index c7780ede01c83..6b856949d3c0a 100644 +index dd4c916b7581a..c27d72bf53c9b 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm @@ -31,6 +31,7 @@ @@ -10,7 +10,7 @@ index c7780ede01c83..6b856949d3c0a 100644 #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/apps/app_shim/app_shim_manager_mac.h" #include "chrome/browser/apps/app_shim/app_shim_termination_manager.h" -@@ -1290,6 +1291,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1339,6 +1340,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // Run a (background) application in a new tab. - (void)executeApplication:(id)sender { @@ -18,7 +18,7 @@ index c7780ede01c83..6b856949d3c0a 100644 NSInteger tag = [sender tag]; Profile* profile = [self lastProfile]; DCHECK(profile); -@@ -1298,6 +1300,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1347,6 +1349,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; tag < static_cast(applications.size())); const extensions::Extension* extension = applications.GetExtension(tag); BackgroundModeManager::LaunchBackgroundApplication(profile, extension); @@ -26,23 +26,23 @@ index c7780ede01c83..6b856949d3c0a 100644 } // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1693,6 +1696,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit - // tests which use the mock in place of the profile-initialized model. +@@ -1702,6 +1705,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; + [dockMenu addItem:item]; + } +#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - // Avoid breaking unit tests which have no profile. - if (profile) { - BackgroundApplicationListModel applications(profile); -@@ -1719,6 +1723,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - } + // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit tests + // which use the mock in place of the profile-initialized model. + BackgroundApplicationListModel applications(profile); +@@ -1726,6 +1730,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; + [appMenu addItem:appItem]; } } +#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE) return dockMenu; } -@@ -1948,11 +1953,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1963,11 +1968,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; namespace { void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { @@ -55,12 +55,12 @@ index c7780ede01c83..6b856949d3c0a 100644 +#endif // !BUILDFLAG(ENABLE_CEF) } - } // namespace + void OpenUrlsInBrowserWithProfile(const std::vector& urls, diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index 3d634db18900a..96e44ad48e5e5 100644 +index a7657cb6e5d5e..d6c6f3225fcb6 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h -@@ -197,9 +197,9 @@ class BrowserProcess { +@@ -198,9 +198,9 @@ class BrowserProcess { virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0; @@ -72,10 +72,10 @@ index 3d634db18900a..96e44ad48e5e5 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index cce917cdc65db..5da3a16aef1c7 100644 +index 1149818336011..0e454299e2622 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -952,18 +952,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -970,18 +970,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -96,10 +96,10 @@ index cce917cdc65db..5da3a16aef1c7 100644 std::unique_ptr manager) { background_mode_manager_ = std::move(manager); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index b4ceefbccd083..7d60206c83b13 100644 +index 2bb0b1ec912b0..2235c7b56a456 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -169,8 +169,8 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -174,8 +174,8 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; @@ -110,10 +110,10 @@ index b4ceefbccd083..7d60206c83b13 100644 std::unique_ptr manager) override; #endif diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index e0cafee5eedd6..06ded156be3cc 100644 +index fb05f448cb250..e94c28d492e7a 100644 --- chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc -@@ -148,12 +148,14 @@ void BrowserCloseManager::CloseBrowsers() { +@@ -151,12 +151,14 @@ void BrowserCloseManager::CloseBrowsers() { // exit can restore all browsers open before exiting. ProfileManager::ShutdownSessionServices(); #endif diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index 849f8df76..d227098a2 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,10 +13,10 @@ index ba0c5c3fc0446..b4df9af95ecd1 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 268f6547ff84b..29e1b4b1b4dba 100644 +index 8fdddbadf5e9a..4c5ea3c875db2 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -263,6 +263,20 @@ +@@ -262,6 +262,20 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -37,7 +37,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -492,6 +506,13 @@ Browser::Browser(const CreateParams& params) +@@ -491,6 +505,13 @@ Browser::Browser(const CreateParams& params) tab_strip_model_->AddObserver(this); @@ -51,7 +51,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -1336,6 +1357,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1325,6 +1346,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1343,8 +1372,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1332,8 +1361,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1569,6 +1608,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1558,6 +1597,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1668,6 +1715,15 @@ void Browser::AddNewContents(WebContents* source, +@@ -1657,6 +1704,15 @@ void Browser::AddNewContents(WebContents* source, source, disposition); } @@ -118,7 +118,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 chrome::AddWebContents(this, source, std::move(new_contents), target_url, disposition, initial_rect); } -@@ -1686,6 +1742,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1675,6 +1731,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -127,7 +127,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1713,6 +1771,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1702,6 +1760,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -136,7 +136,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 if (!GetStatusBubble()) return; -@@ -1720,6 +1780,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1709,6 +1769,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -154,7 +154,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1836,6 +1907,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1825,6 +1896,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -165,7 +165,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1872,6 +1947,8 @@ void Browser::RendererResponsive( +@@ -1861,6 +1936,8 @@ void Browser::RendererResponsive( void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); @@ -174,7 +174,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1918,11 +1995,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1907,11 +1984,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -190,7 +190,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2767,6 +2848,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2756,6 +2837,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveTranslationObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -200,7 +200,7 @@ index 268f6547ff84b..29e1b4b1b4dba 100644 void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 946c447afbde1..cce4aaade2ea3 100644 +index 2908b4b70815d..9eb3be7b231ad 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -21,6 +21,7 @@ @@ -222,7 +222,7 @@ index 946c447afbde1..cce4aaade2ea3 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -274,6 +279,11 @@ class Browser : public TabStripModelObserver, +@@ -283,6 +288,11 @@ class Browser : public TabStripModelObserver, // maximizable. bool can_maximize = true; @@ -234,9 +234,9 @@ index 946c447afbde1..cce4aaade2ea3 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -338,6 +348,13 @@ class Browser : public TabStripModelObserver, - - bool is_focus_mode() const { return is_focus_mode_; } +@@ -347,6 +357,13 @@ class Browser : public TabStripModelObserver, + return creation_source_ == CreationSource::kSessionRestore; + } + // Return true if CEF will expose the toolbar to the client. This value is + // used to selectively enable toolbar behaviors such as command processing @@ -248,7 +248,7 @@ index 946c447afbde1..cce4aaade2ea3 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -396,6 +413,12 @@ class Browser : public TabStripModelObserver, +@@ -407,6 +424,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); @@ -261,7 +261,7 @@ index 946c447afbde1..cce4aaade2ea3 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -777,6 +800,11 @@ class Browser : public TabStripModelObserver, +@@ -789,6 +812,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -273,16 +273,16 @@ index 946c447afbde1..cce4aaade2ea3 100644 void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1167,6 +1195,8 @@ class Browser : public TabStripModelObserver, +@@ -1180,6 +1208,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; + bool toolbar_overridden_ = false; + - // Tracks when this browser is being created by session restore. - bool is_session_restore_; + CreationSource creation_source_ = CreationSource::kUnknown; -@@ -1227,6 +1257,10 @@ class Browser : public TabStripModelObserver, + UnloadController unload_controller_; +@@ -1237,6 +1267,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -294,7 +294,7 @@ index 946c447afbde1..cce4aaade2ea3 100644 // The following factory is used for chrome update coalescing. diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 29890d8b342a4..514affa254df4 100644 +index a4af0836da1aa..bdf26e401d563 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc @@ -456,6 +456,13 @@ std::unique_ptr CreateTargetContents( diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index f874560e5..a2b15a6ed 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -54,10 +54,10 @@ index 173582c7c4904..bbf57904b6de9 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index ab24e00ee02aa..818fb4e7d1841 100644 +index 610f6d942998c..f822df04ff07d 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc -@@ -172,7 +172,7 @@ ContentSetting GetContentSettingFromRulesImpl( +@@ -170,7 +170,7 @@ ContentSetting GetContentSettingFromRulesImpl( return rule.GetContentSetting(); } } diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index 71d913f4e..c96b4d027 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 41b804eef6426..b1e54d8e95008 100644 +index 408566907e832..1266687ccd665 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -264,6 +264,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -273,6 +273,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 41b804eef6426..b1e54d8e95008 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -473,6 +480,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -484,6 +491,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,10 +27,10 @@ index 41b804eef6426..b1e54d8e95008 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -628,6 +639,14 @@ RenderViewContextMenu::RenderViewContextMenu( - } - set_content_type( - ContextMenuContentTypeFactory::Create(source_web_contents_, params)); +@@ -656,6 +667,14 @@ RenderViewContextMenu::RenderViewContextMenu( + system_app_type_ = GetBrowser() && GetBrowser()->app_controller() + ? GetBrowser()->app_controller()->system_app_type() + : absl::nullopt; + + auto* cb = GetMenuCreatedCallback(); + if (!cb->is_null()) { @@ -42,7 +42,7 @@ index 41b804eef6426..b1e54d8e95008 100644 } RenderViewContextMenu::~RenderViewContextMenu() = default; -@@ -983,6 +1002,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1022,6 +1041,12 @@ void RenderViewContextMenu::InitMenu() { // menu, meaning that each menu item added/removed in this function will cause // it to visibly jump on the screen (see b/173569669). AppendQuickAnswersItems(); @@ -55,7 +55,7 @@ index 41b804eef6426..b1e54d8e95008 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -2636,6 +2661,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( +@@ -2742,6 +2767,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( *GetMenuShownCallback() = std::move(cb); } @@ -69,10 +69,10 @@ index 41b804eef6426..b1e54d8e95008 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { 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 b6d55e7322c45..014d89c4c7bfe 100644 +index 34b6152a222ec..b03c81bd076b8 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -92,6 +92,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -101,6 +101,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, static void RegisterMenuShownCallbackForTesting( base::OnceCallback cb); @@ -85,9 +85,9 @@ index b6d55e7322c45..014d89c4c7bfe 100644 protected: Profile* GetProfile() const; -@@ -266,6 +272,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { - ui::SimpleMenuModel protocol_handler_submenu_model_; - ProtocolHandlerRegistry* protocol_handler_registry_; +@@ -296,6 +302,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, + // built. + bool is_protocol_submenu_valid_ = false; + // An observer returned via MenuCreatedCallback that will be called first. + std::unique_ptr first_observer_; @@ -96,7 +96,7 @@ index b6d55e7322c45..014d89c4c7bfe 100644 // "Use enhanced spell check" items. std::unique_ptr spelling_suggestions_menu_observer_; 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 0271d19c5c33b..40d2063e4ed98 100644 +index 13a65de79e185..0901c4cade4f1 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 @@ -136,6 +136,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, @@ -110,7 +110,7 @@ index 0271d19c5c33b..40d2063e4ed98 100644 // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index 6585ac1d01907..d2e939fce0df6 100644 +index b2513d5ca3ead..f1894f4e05385 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc @@ -376,6 +376,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index 8848541d6..3e167269b 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index adadb4264e6b7..b7c910f035fe6 100644 +index ac4bc7b9021ee..fefdb822c5b71 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -12,6 +12,7 @@ import("//build/config/features.gni") +@@ -11,6 +11,7 @@ import("//build/config/features.gni") import("//build/config/linux/gtk/gtk.gni") import("//build/config/ozone.gni") import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index adadb4264e6b7..b7c910f035fe6 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -329,6 +330,10 @@ static_library("ui") { +@@ -344,6 +345,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index adadb4264e6b7..b7c910f035fe6 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -351,6 +356,7 @@ static_library("ui") { +@@ -366,6 +371,7 @@ static_library("ui") { "//build:branding_buildflags", "//build:chromeos_buildflags", "//cc/paint", @@ -29,7 +29,7 @@ index adadb4264e6b7..b7c910f035fe6 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -4774,6 +4780,7 @@ static_library("ui") { +@@ -4878,6 +4884,7 @@ static_library("ui") { if (enable_basic_printing) { deps += [ "//components/printing/browser", @@ -38,7 +38,7 @@ index adadb4264e6b7..b7c910f035fe6 100644 ] if (use_cups) { diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc -index fcd1f66b3a7a4..4f135460de918 100644 +index fcd1f66b3a7a4..70ded321f5498 100644 --- chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc @@ -21,6 +21,7 @@ @@ -54,7 +54,7 @@ index fcd1f66b3a7a4..4f135460de918 100644 #include "ui/shell_dialogs/select_file_dialog.h" +#if BUILDFLAG(ENABLE_CEF) -+#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" ++#include "cef/libcef/browser/alloy/alloy_dialog_util.h" +#endif + #if defined(OS_ANDROID) @@ -104,7 +104,7 @@ index fcd1f66b3a7a4..4f135460de918 100644 file_writer_->StopNetLog(std::move(ui_thread_polled_data)); } -@@ -373,6 +394,42 @@ void NetExportMessageHandler::ShowSelectFileDialog( +@@ -373,6 +394,38 @@ void NetExportMessageHandler::ShowSelectFileDialog( &file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr); } @@ -112,25 +112,21 @@ index fcd1f66b3a7a4..4f135460de918 100644 + +void NetExportMessageHandler::ShowCefSaveAsDialog( + content::WebContents* web_contents) { -+ CefRefPtr cef_browser = -+ AlloyBrowserHostImpl::GetBrowserForContents(web_contents); -+ if (!cef_browser) -+ return; -+ + base::FilePath initial_dir; + if (!last_save_dir.Pointer()->empty()) + initial_dir = *last_save_dir.Pointer(); + base::FilePath initial_path = + initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json")); + -+ CefFileDialogRunner::FileChooserParams params; ++ blink::mojom::FileChooserParams params; + params.mode = blink::mojom::FileChooserParams::Mode::kSave; + params.default_file_name = initial_path; -+ params.accept_types.push_back(CefString(initial_path.Extension())); ++ params.accept_types.push_back( ++ alloy::FilePathTypeToString16(initial_path.Extension())); + -+ cef_browser->RunFileChooser( -+ params, base::BindOnce(&NetExportMessageHandler::SaveAsDialogDismissed, -+ weak_ptr_factory_.GetWeakPtr())); ++ alloy::RunFileChooser(web_contents, params, ++ base::BindOnce(&NetExportMessageHandler::SaveAsDialogDismissed, ++ weak_ptr_factory_.GetWeakPtr())); +} + +void NetExportMessageHandler::SaveAsDialogDismissed( diff --git a/patch/patches/chrome_browser_privacy_1119417.patch b/patch/patches/chrome_browser_privacy_1119417.patch new file mode 100644 index 000000000..48aea7d36 --- /dev/null +++ b/patch/patches/chrome_browser_privacy_1119417.patch @@ -0,0 +1,59 @@ +diff --git chrome/browser/privacy/BUILD.gn chrome/browser/privacy/BUILD.gn +index cd1f57e009f50..f93721e39e559 100644 +--- chrome/browser/privacy/BUILD.gn ++++ chrome/browser/privacy/BUILD.gn +@@ -93,11 +93,15 @@ if (is_win || is_linux) { + ] + proto_deps = [ "//components/policy:full_runtime_code_generate" ] + proto_out_dir = "/chrome/browser/privacy" ++ generate_cc = false ++ generate_library = false + } + + proto_library("traffic_annotation_proto") { + sources = [ "traffic_annotation.proto" ] + proto_deps = [ ":chrome_settings_full_runtime" ] + import_dirs = [ "$root_gen_dir" + "/components/policy/proto" ] ++ generate_cc = false ++ generate_library = false + } + } +diff --git third_party/protobuf/proto_library.gni third_party/protobuf/proto_library.gni +index a6943f5896cba..1561a868ccef9 100644 +--- third_party/protobuf/proto_library.gni ++++ third_party/protobuf/proto_library.gni +@@ -28,6 +28,9 @@ + # generate_javascript (optional, default false) + # Generate Javascript protobuf stubs. + # ++# generate_library (optional, default true) ++# Generate a "static_library" target for linking with the generated code. ++# + # cc_generator_options (optional) + # List of extra flags passed to the protocol compiler. If you need to + # add an EXPORT macro to a protobuf's C++ header, set the +@@ -266,14 +269,21 @@ template("proto_library") { + protogens_cc = [] + protogens_js = [] + ++ # Whether source code bindings should be generated. ++ generate_sources = generate_cc || generate_python || generate_with_plugin || ++ generate_javascript ++ + # Whether library should be generated. + # Library is not needed when proto_library is used to generate binary descriptor, in which case + # corresponding library target should be omitted entirely. +- generate_library = generate_cc || generate_python || generate_with_plugin || +- generate_javascript ++ if (defined(invoker.generate_library)) { ++ generate_library = invoker.generate_library ++ } else { ++ generate_library = generate_sources ++ } + + # List output files. +- if (generate_library) { ++ if (generate_sources) { + foreach(proto, protos) { + proto_dir = get_path_info(proto, "dir") + proto_name = get_path_info(proto, "name") diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 851848db5..fa50e4dc3 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/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc -index e0010fdd55000..f89c622c6fd96 100644 +index c00884e06f960..858fdb75529f8 100644 --- chrome/browser/profiles/profile_window.cc +++ chrome/browser/profiles/profile_window.cc -@@ -273,7 +273,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, +@@ -272,7 +272,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; return; case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: @@ -14,7 +14,7 @@ index e0010fdd55000..f89c622c6fd96 100644 : profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; } diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index ae41e1031c95e..16ee4f7766a78 100644 +index 8a93e597977b0..4d0faa950a2af 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -37,7 +37,9 @@ @@ -29,10 +29,10 @@ index ae41e1031c95e..16ee4f7766a78 100644 chrome::RecordDialogCreation( diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index 905c775ba0471..b1cf9288f4975 100644 +index e8273f40a6d09..b5b21c30ba780 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble( +@@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble(profiles::BubbleViewMode view_mode, ProfileMenuViewBase* bubble = nullptr; if (view_mode == profiles::BUBBLE_VIEW_MODE_INCOGNITO) { diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 2f664a5f9..ece5154e5 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 0fbe58dcd4d28..57fab623ec276 100644 +index d4654752a2132..5829ddeaa91a7 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc -@@ -633,7 +633,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( +@@ -628,7 +628,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( #endif if (!profile) profile = std::make_unique(parent, otr_profile_id); @@ -14,10 +14,10 @@ index 0fbe58dcd4d28..57fab623ec276 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 7ee045c66e37b..65cb34a7a7e1c 100644 +index 01f72891d3035..050f4aa94c6d0 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -85,6 +85,7 @@ base::LazyInstance>::Leaky +@@ -86,6 +86,7 @@ base::LazyInstance>::Leaky namespace { @@ -25,7 +25,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644 const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; const char kTestOTRProfileIDPrefix[] = "Test::OTR"; -@@ -99,6 +100,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { +@@ -100,6 +101,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext and MediaRouter::Presentation are an // exception to this ban. return *this == PrimaryID() || @@ -34,7 +34,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644 base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::CompareCase::SENSITIVE) || base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, -@@ -120,6 +123,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( +@@ -121,6 +124,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( base::GUID::GenerateRandomV4().AsLowercaseString().c_str())); } @@ -52,7 +52,7 @@ index 7ee045c66e37b..65cb34a7a7e1c 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 92baa51c80944..9726edaea9c4d 100644 +index e3e819d9ecd87..ef8c6ebd1cf2e 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h @@ -119,6 +119,10 @@ class Profile : public content::BrowserContext { @@ -66,7 +66,7 @@ index 92baa51c80944..9726edaea9c4d 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -528,6 +532,8 @@ class Profile : public content::BrowserContext { +@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext { virtual void RecordMainFrameNavigation() = 0; @@ -75,7 +75,7 @@ index 92baa51c80944..9726edaea9c4d 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -539,8 +545,6 @@ class Profile : public content::BrowserContext { +@@ -533,8 +539,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -85,10 +85,10 @@ index 92baa51c80944..9726edaea9c4d 100644 virtual bool IsSignedIn() = 0; diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 0f051ffa90eb2..7def9e1f948e3 100644 +index 5d87d4fff37ab..61d00177e036e 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -982,7 +982,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -929,7 +929,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -100,10 +100,10 @@ index 0f051ffa90eb2..7def9e1f948e3 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index e5227bb58f532..e9620f11a256a 100644 +index aef8964db423d..e15bc0dc20285 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -511,7 +511,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -495,7 +495,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) base::Unretained(this))); #endif @@ -113,10 +113,10 @@ index e5227bb58f532..e9620f11a256a 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index cd6fdbba9b435..0fbc56702d7a3 100644 +index 915a95e287c58..0424e8bdd7d84 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -118,7 +118,7 @@ class ProfileManager : public Profile::Delegate { +@@ -119,7 +119,7 @@ class ProfileManager : public Profile::Delegate { // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -125,7 +125,7 @@ index cd6fdbba9b435..0fbc56702d7a3 100644 // Returns regular or off-the-record profile given its profile key. static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); -@@ -150,7 +150,7 @@ class ProfileManager : public Profile::Delegate { +@@ -151,7 +151,7 @@ class ProfileManager : public Profile::Delegate { // Returns true if the profile pointer is known to point to an existing // profile. diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index d82cf7f38..48b27111c 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 4d46dbb1c0a44..022b7021fd245 100644 +index 102a18a81e424..c530945922b1d 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -27,6 +27,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_sharesheet_1123388.patch b/patch/patches/chrome_browser_sharesheet_1123388.patch deleted file mode 100644 index d95392fb0..000000000 --- a/patch/patches/chrome_browser_sharesheet_1123388.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc -index f250b1b444de0..d0b7efeadbe18 100644 ---- chrome/browser/sharesheet/sharesheet_service_delegate.cc -+++ chrome/browser/sharesheet/sharesheet_service_delegate.cc -@@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate( - gfx::NativeWindow native_window, - SharesheetService* sharesheet_service) - : native_window_(native_window), -+#if BUILDFLAG(IS_CHROMEOS_ASH) - sharesheet_bubble_view_( - new ash::sharesheet::SharesheetBubbleView(native_window, this)), -+#endif - sharesheet_service_(sharesheet_service) {} - - SharesheetServiceDelegate::~SharesheetServiceDelegate() = default; -@@ -36,8 +38,10 @@ void SharesheetServiceDelegate::ShowBubble( - } - return; - } -+#if BUILDFLAG(IS_CHROMEOS_ASH) - sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent), - std::move(delivered_callback)); -+#endif - is_bubble_open_ = true; - } - -@@ -81,7 +85,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed( - } - - void SharesheetServiceDelegate::OnActionLaunched() { -+#if BUILDFLAG(IS_CHROMEOS_ASH) - sharesheet_bubble_view_->ShowActionView(); -+#endif - } - - const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon( -@@ -101,11 +107,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, - const int& height) { - DCHECK_GT(width, 0); - DCHECK_GT(height, 0); -+#if BUILDFLAG(IS_CHROMEOS_ASH) - sharesheet_bubble_view_->ResizeBubble(width, height); -+#endif - } - - void SharesheetServiceDelegate::CloseSharesheet() { -+#if BUILDFLAG(IS_CHROMEOS_ASH) - sharesheet_bubble_view_->CloseBubble(); -+#endif - } - - } // namespace sharesheet -diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h -index 24dc55adca062..236eb65db6a45 100644 ---- chrome/browser/sharesheet/sharesheet_service_delegate.h -+++ chrome/browser/sharesheet/sharesheet_service_delegate.h -@@ -77,7 +77,9 @@ class SharesheetServiceDelegate : public SharesheetController { - - std::u16string active_action_; - // Owned by views. -+#if BUILDFLAG(IS_CHROMEOS_ASH) - ash::sharesheet::SharesheetBubbleView* sharesheet_bubble_view_; -+#endif - SharesheetService* sharesheet_service_; - }; - diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 83fa9f047..21c1efc4e 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index 168f980572c10..ffdc06beb2b77 100644 +index 4cb831441aed4..ed0092720b63f 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -151,7 +151,7 @@ index a0b3175223f3e..a1117001ad1fc 100644 Profile* profile = Profile::FromBrowserContext(browser_context); const std::vector& allowlist = diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc -index e42b4e7dbdec2..a2bebe0128a04 100644 +index 88a87fd4d74bb..2815c9897d636 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc @@ -7,6 +7,7 @@ @@ -186,10 +186,10 @@ index e42b4e7dbdec2..a2bebe0128a04 100644 // that the X-Frame-Options protection mechanism is set to either DENY or // SAMEORIGIN. diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index 21bc479c64b31..ce00212ed4f86 100644 +index a6e34d86aa11c..1141f02719e9b 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -895,6 +895,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -919,6 +919,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -197,7 +197,7 @@ index 21bc479c64b31..ce00212ed4f86 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1100,7 +1101,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1122,7 +1123,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -207,7 +207,7 @@ index 21bc479c64b31..ce00212ed4f86 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1109,7 +1111,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1131,7 +1133,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -217,7 +217,7 @@ index 21bc479c64b31..ce00212ed4f86 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1119,7 +1122,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1141,7 +1144,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -227,7 +227,7 @@ index 21bc479c64b31..ce00212ed4f86 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1127,7 +1131,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1149,7 +1153,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 4fc417eb9..d74124def 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 5f60593886e37..34d8abbc0acbd 100644 +index 02cdf42567745..74fff92e5b6e1 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index 5f60593886e37..34d8abbc0acbd 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -148,6 +149,7 @@ static_library("renderer") { +@@ -149,6 +150,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index 5f60593886e37..34d8abbc0acbd 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -238,6 +240,10 @@ static_library("renderer") { +@@ -239,6 +241,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index 51611a8fd..1f24df72a 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 c64f406ba5b8f..75453789a6052 100644 +index 495893eec9704..e967494683f19 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -29,6 +29,7 @@ @@ -10,7 +10,7 @@ index c64f406ba5b8f..75453789a6052 100644 #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/defaults.h" -@@ -380,6 +381,8 @@ struct MainFunction { +@@ -384,6 +385,8 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -19,7 +19,7 @@ index c64f406ba5b8f..75453789a6052 100644 #if defined(OS_WIN) // Reach out to chrome_elf for the truth on the user data directory. // Note that in tests, this links to chrome_elf_test_stubs. -@@ -666,7 +669,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -675,7 +678,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index c64f406ba5b8f..75453789a6052 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -959,6 +964,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -970,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index c64f406ba5b8f..75453789a6052 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -969,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -980,6 +986,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,7 +45,7 @@ index c64f406ba5b8f..75453789a6052 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1092,6 +1099,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1103,6 +1110,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } @@ -53,7 +53,7 @@ index c64f406ba5b8f..75453789a6052 100644 #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1124,6 +1132,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1135,6 +1143,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -61,7 +61,7 @@ index c64f406ba5b8f..75453789a6052 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1222,6 +1231,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1233,6 +1242,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index c64f406ba5b8f..75453789a6052 100644 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. const base::CommandLine* command_line = -@@ -1238,6 +1248,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1249,6 +1259,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,7 +78,7 @@ index c64f406ba5b8f..75453789a6052 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index cf7f295bf92f6..1a7859d698a8c 100644 +index dff0a32062f0e..9378b2a0be47f 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -49,6 +49,7 @@ @@ -89,7 +89,7 @@ index cf7f295bf92f6..1a7859d698a8c 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -906,8 +907,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -915,8 +916,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #if !defined(OS_ANDROID) // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // its QuitClosure to the BrowserProcessImpl to call when it is time to exit. @@ -101,7 +101,7 @@ index cf7f295bf92f6..1a7859d698a8c 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1665,11 +1668,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1689,11 +1692,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. @@ -156,10 +156,10 @@ index 95d1ebc190910..13cdfa52db108 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index af089ae5fa35a..b7498d1a2ee79 100644 +index 8650dd04f9c44..45ab4913bbe04 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -37,6 +37,7 @@ +@@ -38,6 +38,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -167,7 +167,7 @@ index af089ae5fa35a..b7498d1a2ee79 100644 #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -3590,9 +3591,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -3562,9 +3563,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // defined(OS_ANDROID) @@ -205,7 +205,7 @@ index ab4c2b03755d3..8e813496f9df6 100644 base::mac::ScopedMachSendRight exceptionPort( crash_reporter::GetCrashpadClient().GetHandlerMachPort()); diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index b18cc56bb82b0..4760db368c6e0 100644 +index 3de6df64935e3..78a2bf3896e72 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -10,6 +10,7 @@ @@ -216,7 +216,7 @@ index b18cc56bb82b0..4760db368c6e0 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_ui.h" -@@ -161,6 +162,10 @@ +@@ -164,6 +165,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -227,7 +227,7 @@ index b18cc56bb82b0..4760db368c6e0 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1019,6 +1024,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1134,6 +1139,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, SessionDataService::RegisterProfilePrefs(registry); #endif diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index 73eb6f9ee..f07b4e2e2 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index cfefe1f227283..402d848368269 100644 +index 57ef822f46944..06cef42aab9ed 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -351,8 +351,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -14,7 +14,7 @@ index cfefe1f227283..402d848368269 100644 // No commands are enabled if there is not yet any selected tab. // TODO(pkasting): It seems like we should not need this, because either -@@ -942,11 +944,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -959,11 +961,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( // BrowserCommandController, private: bool BrowserCommandController::IsShowingMainUI() { @@ -120,10 +120,10 @@ index 0ce7abdeb7d9f..8197a6bb7da98 100644 // Initialize the frame (creates the underlying native window). diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index e852eb7d20ed6..bb73d3055936d 100644 +index f3239963d569a..2bee32af5a8dd 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -586,11 +586,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -589,11 +589,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -147,7 +147,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 SetShowIcon(::ShouldShowWindowIcon(browser_.get())); // In forced app mode, all size controls are always disabled. Otherwise, use -@@ -604,7 +615,6 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -607,7 +618,6 @@ BrowserView::BrowserView(std::unique_ptr browser) } browser_->tab_strip_model()->AddObserver(this); @@ -155,7 +155,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -648,8 +658,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -651,8 +661,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -163,7 +163,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 - std::make_unique(browser_.get(), this)); + toolbar_ = OverrideCreateToolbar(browser_.get(), this); + if (!toolbar_) { -+ toolbar_ = new ToolbarView(browser_.get(), this, base::nullopt); ++ toolbar_ = new ToolbarView(browser_.get(), this, absl::nullopt); + } else { + browser_->set_toolbar_overridden(true); + // Update state that depends on the above flag. @@ -173,7 +173,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1430,6 +1447,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1436,6 +1453,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -182,7 +182,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2423,7 +2442,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { +@@ -2462,7 +2481,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { } void BrowserView::ReparentTopContainerForEndOfImmersive() { @@ -192,7 +192,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -2878,8 +2898,10 @@ void BrowserView::Layout() { +@@ -2914,8 +2934,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -205,7 +205,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -2942,6 +2964,11 @@ void BrowserView::AddedToWidget() { +@@ -2978,6 +3000,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -217,7 +217,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 toolbar_->Init(); #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -2977,13 +3004,9 @@ void BrowserView::AddedToWidget() { +@@ -3013,13 +3040,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -234,7 +234,7 @@ index e852eb7d20ed6..bb73d3055936d 100644 MaybeInitializeWebUITabStrip(); diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index f6db8a6928831..a5302d7f73ba6 100644 +index 02f0019d7d324..2bcf69c2098ae 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h @@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, @@ -247,7 +247,7 @@ index f6db8a6928831..a5302d7f73ba6 100644 BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; -@@ -642,6 +644,12 @@ class BrowserView : public BrowserWindow, +@@ -661,6 +663,12 @@ class BrowserView : public BrowserWindow, return accessibility_focus_highlight_.get(); } @@ -261,10 +261,10 @@ index f6db8a6928831..a5302d7f73ba6 100644 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc -index 0e810789a99d7..14d69bd755fa2 100644 +index 18a85f436bd97..0d6e4c9f916e7 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc -@@ -420,6 +420,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { +@@ -441,6 +441,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { int BrowserViewLayout::LayoutToolbar(int top) { TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar"); @@ -278,10 +278,10 @@ index 0e810789a99d7..14d69bd755fa2 100644 bool toolbar_visible = delegate_->IsToolbarVisible(); int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index 50c10d73b9102..46f375b11d82c 100644 +index bb4f5ff05c72e..2cd5634bc96b6 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -@@ -582,37 +582,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( +@@ -586,37 +586,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( } bool BrowserTabStripController::IsFrameCondensed() const { @@ -336,16 +336,16 @@ index 50c10d73b9102..46f375b11d82c 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 650fb98f63b0b..fd3d28bd70aac 100644 +index 9fe383741657c..39b7adae6cfaf 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -160,12 +160,13 @@ auto& GetViewCommandMap() { +@@ -161,12 +161,13 @@ auto& GetViewCommandMap() { //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: -ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view) +ToolbarView::ToolbarView(Browser* browser, BrowserView* browser_view, -+ base::Optional display_mode) ++ absl::optional display_mode) : AnimationDelegateViews(this), browser_(browser), browser_view_(browser_view), @@ -355,7 +355,7 @@ index 650fb98f63b0b..fd3d28bd70aac 100644 SetID(VIEW_ID_TOOLBAR); UpgradeDetector::GetInstance()->AddObserver(this); -@@ -198,7 +199,7 @@ void ToolbarView::Init() { +@@ -201,7 +202,7 @@ void ToolbarView::Init() { #endif auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, @@ -365,16 +365,16 @@ index 650fb98f63b0b..fd3d28bd70aac 100644 size_animation_.Reset(1); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index c232c1c703500..d3b1593be5496 100644 +index 8346b612cfbe6..d7fc5440af829 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -91,7 +91,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -90,7 +90,8 @@ class ToolbarView : public views::AccessiblePaneView, // needs to be displayed. }; - ToolbarView(Browser* browser, BrowserView* browser_view); + ToolbarView(Browser* browser, BrowserView* browser_view, -+ base::Optional display_mode); ++ absl::optional display_mode); ToolbarView(const ToolbarView&) = delete; ToolbarView& operator=(const ToolbarView&) = delete; ~ToolbarView() override; diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 87c05797c..fc84f9371 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,11 +1,11 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index 24668a4acf22d..ac1f02c0779e4 100644 +index 91bcefa2f0698..9a5759239e590 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn -@@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni") - import("//build/config/chromeos/ui_mode.gni") +@@ -8,6 +8,7 @@ import("//build/config/chromeos/ui_mode.gni") import("//build/config/chromeos/ui_mode.gni") import("//build/config/features.gni") + import("//build/toolchain/toolchain.gni") +import("//cef/libcef/features/features.gni") import("//media/cdm/library_cdm/cdm_paths.gni") import("//media/media_options.gni") diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 1109eb01c..7b5e44824 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,16 +1,8 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 7edfd5dd9c140..f018b8f085e65 100644 +index eec7a23a657a4..982efc615ab06 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h -@@ -11,6 +11,7 @@ - - #include - -+#include "content/common/content_export.h" - #include "content/common/navigation_params.mojom.h" - #include "content/public/browser/certificate_request_result_type.h" - #include "mojo/public/cpp/bindings/pending_receiver.h" -@@ -81,7 +82,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -87,7 +87,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, absl::optional* override_out); diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 739335864..484bafd79 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index 181732fa49c2d..29eeb60091ce6 100644 +index 1891a950448c9..cf6cdb676edc9 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc @@ -677,7 +677,7 @@ void IsHandledBySafePlugin(int render_process_id, @@ -49,10 +49,10 @@ index d0a5a12620bd3..a02e13bbd8154 100644 false /* allow_wildcard */, is_stale, &plugin_info, nullptr /* actual_mime_type */); diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index 92dced6c08aa4..73cdaf388123b 100644 +index 6e2d09885b457..da23a0211754b 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc -@@ -82,7 +82,7 @@ void OnFindURLMimeType(const GURL& url, +@@ -85,7 +85,7 @@ void OnFindURLMimeType(const GURL& url, #if BUILDFLAG(ENABLE_PLUGINS) content::WebPluginInfo plugin; result = result || content::PluginService::GetInstance()->GetPluginInfo( @@ -62,10 +62,10 @@ index 92dced6c08aa4..73cdaf388123b 100644 #endif diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 30267bc6d214e..c01f4ff040c05 100644 +index 38f24359a5a25..3c724e29facbd 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -574,7 +574,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -575,7 +575,7 @@ void DevToolsHttpHandler::OnJsonRequest( version.SetString("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.SetString("WebKit-Version", GetWebKitVersion()); @@ -75,10 +75,10 @@ index 30267bc6d214e..c01f4ff040c05 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 178a234311337..51555a02e2409 100644 +index 4d0c1a27449d5..34bb0372c7f8f 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -633,6 +633,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -631,6 +631,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -92,7 +92,7 @@ index 178a234311337..51555a02e2409 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -853,7 +860,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -863,7 +870,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -188,10 +188,10 @@ index 632ae86c6fd69..55b749ec12421 100644 const std::vector& all_plugins); diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index b4c2b23799188..3bdc6327c2c18 100644 +index d3401f43eadaf..582486dad6500 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -11216,6 +11216,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( +@@ -11827,6 +11827,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( } void RenderFrameHostImpl::GetPluginInfo(const GURL& url, @@ -199,7 +199,7 @@ index b4c2b23799188..3bdc6327c2c18 100644 const url::Origin& main_frame_origin, const std::string& mime_type, GetPluginInfoCallback callback) { -@@ -11223,7 +11224,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, +@@ -11834,7 +11835,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, WebPluginInfo info; std::string actual_mime_type; bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( @@ -210,10 +210,10 @@ index b4c2b23799188..3bdc6327c2c18 100644 std::move(callback).Run(found, info, actual_mime_type); } diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h -index a2eb6268b937d..625518ccf5971 100644 +index 275239e659e11..514bfa186c70b 100644 --- content/browser/renderer_host/render_frame_host_impl.h +++ content/browser/renderer_host/render_frame_host_impl.h -@@ -2383,6 +2383,7 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2530,6 +2530,7 @@ class CONTENT_EXPORT RenderFrameHostImpl int32_t plugin_child_id, const base::FilePath& path) override; void GetPluginInfo(const GURL& url, @@ -234,7 +234,7 @@ index a544bfed7ed85..60aad01350c2f 100644 string mime_type) => (bool found, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 0a22650086512..847cea49a484d 100644 +index b5022114e4e19..7d8f17f9e39ac 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ @@ -247,7 +247,7 @@ index 0a22650086512..847cea49a484d 100644 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 71d40028ce3ea..440305180e643 100644 +index 799490ac3f7c0..fe921248a0818 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -32,6 +32,7 @@ @@ -258,7 +258,7 @@ index 71d40028ce3ea..440305180e643 100644 #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" #include "device/vr/buildflags/buildflags.h" -@@ -1763,6 +1764,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1762,6 +1763,14 @@ class CONTENT_EXPORT ContentBrowserClient { const absl::optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -273,7 +273,7 @@ index 71d40028ce3ea..440305180e643 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1836,6 +1845,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1835,6 +1844,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -285,10 +285,10 @@ index 71d40028ce3ea..440305180e643 100644 virtual std::string GetUserAgent(); diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h -index 90fb0fcfa822b..d48e64b1573ca 100644 +index edcc4c1747123..29eea000a9100 100644 --- content/public/browser/plugin_service.h +++ content/public/browser/plugin_service.h -@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService { +@@ -78,6 +78,7 @@ class CONTENT_EXPORT PluginService { virtual bool GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -309,10 +309,10 @@ index 570b5a4738b94..923a5f7195c53 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 601633452b5f9..03bc3f8e5f70a 100644 +index 7ec0901cf6ba2..db5b5529a4cda 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -81,6 +81,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -82,6 +82,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -322,7 +322,7 @@ index 601633452b5f9..03bc3f8e5f70a 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -292,6 +295,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -293,6 +296,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -334,10 +334,10 @@ index 601633452b5f9..03bc3f8e5f70a 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index aa5503a16409a..b1da8198722e2 100644 +index 21a03f22e32f6..e550d97161ee4 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3177,7 +3177,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3304,7 +3304,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( WebPluginInfo info; std::string mime_type; bool found = false; @@ -348,10 +348,10 @@ index aa5503a16409a..b1da8198722e2 100644 &mime_type); if (!found) diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 5bb7fec55d93e..634ccfc09889a 100644 +index d372704f462dc..29fc97bd3e48b 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -599,6 +599,8 @@ void RenderThreadImpl::Init() { +@@ -607,6 +607,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -361,10 +361,10 @@ index 5bb7fec55d93e..634ccfc09889a 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 1ee1fdf477745..74e3ddf4d19dc 100644 +index 2ca27e17e9e10..e4b443d28af38 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1110,6 +1110,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -1107,6 +1107,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -381,12 +381,12 @@ index 1ee1fdf477745..74e3ddf4d19dc 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index faa1d91bf74a9..81e367bfb9b10 100644 +index cb8770a47a808..34df834f31b83 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -255,6 +255,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - std::unique_ptr CreateWebV8ValueConverter() - override; +@@ -258,6 +258,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { + const blink::WebURL& url, + blink::WebVector* csp) override; + void DevToolsAgentAttached() override; + void DevToolsAgentDetached() override; @@ -418,27 +418,3 @@ index 337b4b0653fe2..107ab4c9d8a85 100644 const url::Origin& main_frame_origin, WebPluginInfo* plugin) override; -diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc -index f816fe5382c7e..7846e2b908675 100644 ---- content/test/fake_plugin_service.cc -+++ content/test/fake_plugin_service.cc -@@ -28,6 +28,7 @@ bool FakePluginService::GetPluginInfoArray( - bool FakePluginService::GetPluginInfo(int render_process_id, - int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool allow_wildcard, -diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h -index e5f53ee41161e..b9d73ebee4ec8 100644 ---- content/test/fake_plugin_service.h -+++ content/test/fake_plugin_service.h -@@ -29,6 +29,7 @@ class FakePluginService : public PluginService { - bool GetPluginInfo(int render_process_id, - int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool allow_wildcard, diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 4d599f876..d0db3e164 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,8 +1,8 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index e953579110eb9..1caa761f4297c 100644 +index df88067d61a6d..cf0c735c8d3d9 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -209,15 +209,10 @@ void InitializeMojo(mojo::core::Configuration* config) { +@@ -215,15 +215,10 @@ void InitializeMojo(mojo::core::Configuration* config) { } // namespace @@ -20,7 +20,7 @@ index e953579110eb9..1caa761f4297c 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -299,12 +294,6 @@ int RunContentProcess(const ContentMainParams& params, +@@ -305,12 +300,6 @@ int RunContentProcess(const ContentMainParams& params, #endif #if defined(OS_MAC) @@ -33,7 +33,7 @@ index e953579110eb9..1caa761f4297c 100644 InitializeMac(); #endif -@@ -318,7 +307,7 @@ int RunContentProcess(const ContentMainParams& params, +@@ -324,7 +313,7 @@ int RunContentProcess(const ContentMainParams& params, ui::RegisterPathProvider(); tracker = base::debug::GlobalActivityTracker::Get(); @@ -42,7 +42,7 @@ index e953579110eb9..1caa761f4297c 100644 if (exit_code >= 0) { if (tracker) { -@@ -377,8 +366,16 @@ int RunContentProcess(const ContentMainParams& params, +@@ -383,8 +372,16 @@ int RunContentProcess(const ContentMainParams& params, if (IsSubprocess()) CommonSubprocessInit(); @@ -60,7 +60,7 @@ index e953579110eb9..1caa761f4297c 100644 if (tracker) { if (exit_code == 0) { tracker->SetProcessPhaseIfEnabled( -@@ -389,19 +386,45 @@ int RunContentProcess(const ContentMainParams& params, +@@ -395,19 +392,45 @@ int RunContentProcess(const ContentMainParams& params, tracker->process_data().SetInt("exit-code", exit_code); } } @@ -111,7 +111,7 @@ index e953579110eb9..1caa761f4297c 100644 return RunContentProcess(params, runner.get()); } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 8b557bdeb4b8f..49580985176ea 100644 +index 81638b94331aa..3a36c1629b158 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -43,6 +43,7 @@ @@ -122,7 +122,7 @@ index 8b557bdeb4b8f..49580985176ea 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1110,6 +1111,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1114,6 +1115,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } diff --git a/patch/patches/content_mojo_3123.patch b/patch/patches/content_mojo_3123.patch index f1e42d11e..32994dc26 100644 --- a/patch/patches/content_mojo_3123.patch +++ b/patch/patches/content_mojo_3123.patch @@ -1,8 +1,8 @@ -diff --git content/public/browser/frame_service_base.h content/public/browser/frame_service_base.h -index af3218d8f6462..da6880cc57e90 100644 ---- content/public/browser/frame_service_base.h -+++ content/public/browser/frame_service_base.h -@@ -83,6 +83,8 @@ class FrameServiceBase : public Interface, public WebContentsObserver { +diff --git content/public/browser/document_service_base.h content/public/browser/document_service_base.h +index a7d9457f7561a..3296e65dcb0f5 100644 +--- content/public/browser/document_service_base.h ++++ content/public/browser/document_service_base.h +@@ -83,6 +83,8 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { void DidFinishNavigation(NavigationHandle* navigation_handle) final { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); @@ -11,7 +11,7 @@ index af3218d8f6462..da6880cc57e90 100644 if (!navigation_handle->HasCommitted() || navigation_handle->IsSameDocument() || -@@ -96,6 +98,9 @@ class FrameServiceBase : public Interface, public WebContentsObserver { +@@ -96,6 +98,9 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { } } diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 1df8a49f4..82d86612d 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -81,7 +81,7 @@ index 886372e114899..ad3bc2242883b 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index b84f727c9dc64..817df167e5a6b 100644 +index 41cb4fdea7320..7bca01cf303c8 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -92,7 +92,7 @@ index b84f727c9dc64..817df167e5a6b 100644 + #include "base/base_switches.h" #include "base/command_line.h" - #include "base/stl_util.h" + #include "base/cxx17_backports.h" @@ -28,7 +30,7 @@ namespace crash_keys { @@ -357,7 +357,7 @@ index 39557cce47443..236806090021a 100644 } // namespace crash_reporter diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc -index 27f5504d544a3..fd901ccd5b759 100644 +index 42938c3994679..3e8eaeebd7b2b 100644 --- components/crash/core/app/crashpad.cc +++ components/crash/core/app/crashpad.cc @@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -474,7 +474,7 @@ index e3fc1fb2bcab3..56395d7100f94 100644 handler_path, database_path, metrics_path, url, GetProcessSimpleAnnotations(), arguments, true, false); diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc -index 686be7964d77d..6059aab2b69a7 100644 +index 7dd251b2fdda8..3d358889ea6f2 100644 --- components/crash/core/app/crashpad_win.cc +++ components/crash/core/app/crashpad_win.cc @@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations( diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index e97d1c180..4bb5caae1 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,16 +1,16 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index 1f8de242c42d0..4ba07378b94a3 100644 +index 46f67d07365ca..069b96b9b4b8b 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc -@@ -8,6 +8,7 @@ - #include "base/no_destructor.h" - #include "base/strings/strcat.h" +@@ -10,6 +10,7 @@ + #include "base/strings/stringprintf.h" + #include "base/system/sys_info.h" #include "build/branding_buildflags.h" +#include "cef/libcef/common/cef_switches.h" #include "components/embedder_support/switches.h" #include "components/version_info/version_info.h" #include "content/public/browser/web_contents.h" -@@ -21,6 +22,12 @@ +@@ -23,6 +24,12 @@ namespace embedder_support { std::string GetProduct() { diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index b8dd90e66..1930b4447 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -160,7 +160,7 @@ index 305726557f2ea..caa4b798a013e 100644 // A pointer to the current or speculative main frame in `host_contents_`. We // can't access this frame through the `host_contents_` directly as it does diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 216e445c0488b..cd6502cc3f059 100644 +index 530de7eea3649..3af4fb0179aa1 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h @@ -27,6 +27,7 @@ @@ -171,7 +171,7 @@ index 216e445c0488b..cd6502cc3f059 100644 class PrefService; namespace base { -@@ -62,6 +63,7 @@ class ComponentExtensionResourceManager; +@@ -66,6 +67,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -179,7 +179,7 @@ index 216e445c0488b..cd6502cc3f059 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -204,6 +206,14 @@ class ExtensionsBrowserClient { +@@ -207,6 +209,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index 40ce61ebb..f8eea4598 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index a7c8ed4b4d7ed..26629eaefc234 100644 +index 1c7897a648315..39324a6c6c6f2 100644 --- .gn +++ .gn -@@ -176,6 +176,8 @@ exec_script_whitelist = +@@ -150,6 +150,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,7 +12,7 @@ index a7c8ed4b4d7ed..26629eaefc234 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 19aee8c70e7a6..94be39e1137fe 100644 +index aa2cb7b4583a3..260067ac3c871 100644 --- BUILD.gn +++ BUILD.gn @@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,10 +23,10 @@ index 19aee8c70e7a6..94be39e1137fe 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/media/router/features.gni") import("//components/nacl/features.gni") -@@ -257,6 +258,9 @@ group("gn_all") { - "//media/cast:cast_unittests", - "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", - ] +@@ -264,6 +265,9 @@ group("gn_all") { + deps += [ "//chrome/test:telemetry_perf_unittests${_target_suffix}" ] + } + } + if (enable_cef) { + deps += [ "//cef" ] + } @@ -66,10 +66,10 @@ index 982fbe8d3f0d0..e757be4688f10 100644 + "studio path") } diff --git chrome/app/framework.order chrome/app/framework.order -index 839144aa1e9bd..29c8ab32398a7 100644 +index d2266b28b33f8..a7ff6d9b68f38 100644 --- chrome/app/framework.order +++ chrome/app/framework.order -@@ -28,3 +28,8 @@ _ChromeMain +@@ -72,3 +72,8 @@ _ChromeMain _lprofDirMode ___llvm_profile_filename ___llvm_profile_raw_version @@ -79,7 +79,7 @@ index 839144aa1e9bd..29c8ab32398a7 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 95378c12ca6d9..f8fed0d6c3418 100644 +index 66084f63cd04a..a4997689c68cd 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -4,6 +4,7 @@ @@ -90,8 +90,8 @@ index 95378c12ca6d9..f8fed0d6c3418 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//extensions/buildflags/buildflags.gni") -@@ -287,6 +288,10 @@ template("chrome_extra_paks") { - "//chrome/browser/resources/welcome:resources", +@@ -71,6 +72,10 @@ template("chrome_repack_percent") { + "//ui/chromeos/resources", ] } + if (enable_cef) { @@ -99,10 +99,10 @@ index 95378c12ca6d9..f8fed0d6c3418 100644 + deps += [ "//cef:cef_resources" ] + } if (enable_extensions) { - sources += [ - "$root_gen_dir/chrome/extensions_resources.pak", + sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] + deps += [ "//extensions:extensions_browser_resources" ] diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni -index a64a23560460a..b08eee1f789a7 100644 +index 203d54004d324..39ec05bffcf5c 100644 --- chrome/chrome_repack_locales.gni +++ chrome/chrome_repack_locales.gni @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni") @@ -113,7 +113,7 @@ index a64a23560460a..b08eee1f789a7 100644 import("//extensions/buildflags/buildflags.gni") import("//tools/grit/repack.gni") -@@ -83,6 +84,10 @@ template("chrome_repack_locales") { +@@ -88,6 +89,10 @@ template("chrome_repack_locales") { ] compress = true } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 19b1437b2..ca0231dc2 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 b5b86bb00d59e..2cbb930d9e791 100644 +index 2340bedbe4a56..7353775d6fc43 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -784,4 +784,13 @@ +@@ -820,4 +820,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/ime_1610.patch b/patch/patches/ime_1610.patch index 3ed0a134b..492f30e59 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,5 +1,5 @@ diff --git ui/base/ime/win/input_method_win_base.cc ui/base/ime/win/input_method_win_base.cc -index bc80f95a6892a..43a87836ebd3e 100644 +index de4e2f8fa1761..3a60044e871fb 100644 --- ui/base/ime/win/input_method_win_base.cc +++ ui/base/ime/win/input_method_win_base.cc @@ -262,8 +262,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { diff --git a/patch/patches/linux_allocator_uffd_1206047.patch b/patch/patches/linux_allocator_uffd_1206047.patch deleted file mode 100644 index 49f4a6e40..000000000 --- a/patch/patches/linux_allocator_uffd_1206047.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git base/allocator/partition_allocator/partition_alloc_config.h base/allocator/partition_allocator/partition_alloc_config.h -index c5ccd81..6d15bfd 100644 ---- base/allocator/partition_allocator/partition_alloc_config.h -+++ base/allocator/partition_allocator/partition_alloc_config.h -@@ -33,9 +33,12 @@ - - #if defined(PA_HAS_64_BITS_POINTERS) && \ - (defined(OS_LINUX) || defined(OS_ANDROID)) -+#include - // TODO(bikineev): Enable for ChromeOS. -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) - #define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED - #endif -+#endif - - // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific - // features such as futex(2). diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index e22f6f401..826d104c8 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -12,7 +12,7 @@ index bbc1d4d057291..a7c7d75f61df6 100644 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 f88c5077c6d63..8a010b882f2b7 100644 +index 7022a65e03578..c9aaf5d76e4a1 100644 --- sandbox/linux/suid/client/setuid_sandbox_host.cc +++ sandbox/linux/suid/client/setuid_sandbox_host.cc @@ -120,7 +120,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { diff --git a/patch/patches/linux_atk_1123214.patch b/patch/patches/linux_atk_1123214.patch index a628038c4..77411627c 100644 --- a/patch/patches/linux_atk_1123214.patch +++ b/patch/patches/linux_atk_1123214.patch @@ -1,9 +1,9 @@ diff --git build/config/linux/atk/BUILD.gn build/config/linux/atk/BUILD.gn -index bc8e27894732a..5d06ce988f25f 100644 +index 92baff2a9b6ee..fdf40cd38ad3a 100644 --- build/config/linux/atk/BUILD.gn +++ build/config/linux/atk/BUILD.gn -@@ -12,7 +12,7 @@ import("//build/config/ui.gni") - assert(!is_chromeos_ash) +@@ -11,7 +11,7 @@ import("//build/config/ui.gni") + assert(!is_chromeos) # These packages should _only_ be expected when building for a target. -assert(current_toolchain == default_toolchain) diff --git a/patch/patches/linux_poll_2466.patch b/patch/patches/linux_poll_2466.patch index 6764b1eb9..68004b23c 100644 --- a/patch/patches/linux_poll_2466.patch +++ b/patch/patches/linux_poll_2466.patch @@ -1,5 +1,5 @@ diff --git base/files/file_path_watcher_linux.cc base/files/file_path_watcher_linux.cc -index 713444ccb2d3e..6759f454d1563 100644 +index 0c37e08d78825..80a8d27d9733b 100644 --- base/files/file_path_watcher_linux.cc +++ base/files/file_path_watcher_linux.cc @@ -5,6 +5,7 @@ diff --git a/patch/patches/message_pump_mac_2495.patch b/patch/patches/message_pump_mac_2495.patch index a65c25bcd..94ed5d01b 100644 --- a/patch/patches/message_pump_mac_2495.patch +++ b/patch/patches/message_pump_mac_2495.patch @@ -1,8 +1,8 @@ diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm -index d085795608eca..b1efb62818635 100644 +index ebc9aa83a1a0e..a64b1f9d90c0c 100644 --- base/message_loop/message_pump_mac.mm +++ base/message_loop/message_pump_mac.mm -@@ -682,7 +682,8 @@ void MessagePumpUIApplication::Detach() { +@@ -692,7 +692,8 @@ void MessagePumpUIApplication::Detach() { #else ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { @@ -12,7 +12,7 @@ index d085795608eca..b1efb62818635 100644 DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask()); // Pumping events in private runloop modes is known to interact badly with // app modal windows like NSAlert. -@@ -692,7 +693,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { +@@ -702,7 +703,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { } ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() { diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index e508416c7..5126d173d 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -12,10 +12,10 @@ index cdbc0273838e5..ee2809a0bb98a 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index a28112a99dfdc..bcd58be410e10 100644 +index 2dc016e4be765..fb052a3a0bf21 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -@@ -205,6 +205,8 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -211,6 +211,8 @@ void MimeHandlerViewGuest::CreateWebContents( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; @@ -24,7 +24,7 @@ index a28112a99dfdc..bcd58be410e10 100644 // TODO(erikchen): Fix ownership semantics for guest views. // https://crbug.com/832879. std::move(callback).Run( -@@ -215,6 +217,10 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -221,6 +223,10 @@ void MimeHandlerViewGuest::CreateWebContents( } void MimeHandlerViewGuest::DidAttachToEmbedder() { @@ -35,7 +35,7 @@ index a28112a99dfdc..bcd58be410e10 100644 DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme)); web_contents()->GetController().LoadURL( stream_->handler_url(), content::Referrer(), -@@ -245,6 +251,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { +@@ -251,6 +257,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { return true; } @@ -48,7 +48,7 @@ index a28112a99dfdc..bcd58be410e10 100644 WebContents* source, const content::OpenURLParams& params) { diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index 7d27e12c4e9a7..fc234840104ea 100644 +index bb90319f768ed..b0ba7bfa08c03 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h @@ -130,6 +130,7 @@ class MimeHandlerViewGuest diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 53b6145de..f86965cae 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,10 +10,10 @@ index 96d1a51ec1078..e8120a818b1f2 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 17) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index b2405754498bf..1619937c56eb8 100644 +index 3f7b5bb32fa27..2c092b62f3ce4 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -559,7 +559,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { +@@ -566,7 +566,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. @@ -24,10 +24,10 @@ index b2405754498bf..1619937c56eb8 100644 request_->force_ignore_site_for_cookies(); if (cookie_store->cookie_access_delegate() && diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index ccb92aa863713..51986649b4174 100644 +index 13c90fe5f838c..ac3a0bc7a2db5 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc -@@ -233,7 +233,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -253,7 +253,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { } bool ResourceRequest::SendsCookies() const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 2f3b1331a..b0ee7b8fb 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c67..84f3b9ed7cf49 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index b38b11e555791..5d8da2cef9b2d 100644 +index c2356a3d97bfe..0d9f359886e20 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3037,6 +3037,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3088,6 +3088,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index b38b11e555791..5d8da2cef9b2d 100644 const WebInputEvent& event) { if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index ce8aa5ba1f4f5..460dc054a0bcf 100644 +index d082d920c4124..b588cb681c4e8 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -758,6 +758,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -762,6 +762,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 8c9359f26..daade36f8 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc -index f5ce4b6b6649f..32a176a7cc8fe 100644 +index d282ff9e1e7be..f698a1b235cca 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -24,6 +24,7 @@ @@ -10,34 +10,34 @@ index f5ce4b6b6649f..32a176a7cc8fe 100644 #include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/download_core_service_factory.h" #include "chrome/browser/download/download_core_service_impl.h" -@@ -58,6 +59,10 @@ +@@ -60,6 +61,10 @@ #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" #endif +#if BUILDFLAG(ENABLE_CEF) -+#include "cef/libcef/browser/alloy/alloy_browser_context.h" ++#include "cef/libcef/browser/alloy/alloy_download_util.h" +#endif + using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; -@@ -358,6 +363,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( +@@ -348,6 +353,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( // static DownloadPrefs* DownloadPrefs::FromBrowserContext( content::BrowserContext* context) { +#if BUILDFLAG(ENABLE_CEF) + if (cef::IsAlloyRuntimeEnabled()) { -+ return static_cast(context)->GetDownloadPrefs(); ++ return alloy::GetDownloadPrefsFromBrowserContext(context); + } +#endif return FromDownloadManager(context->GetDownloadManager()); } diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc -index 74536431f6649..3fc69b6560298 100644 +index 4ff73fd2d9ec3..d56686d8284ba 100644 --- chrome/browser/printing/print_preview_dialog_controller.cc +++ chrome/browser/printing/print_preview_dialog_controller.cc -@@ -17,6 +17,7 @@ +@@ -15,6 +15,7 @@ #include "build/branding_buildflags.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -45,7 +45,7 @@ index 74536431f6649..3fc69b6560298 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -410,8 +411,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( +@@ -402,8 +403,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( content::HostZoomMap::Get(preview_dialog->GetSiteInstance()) ->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0); PrintViewManager::CreateForWebContents(preview_dialog); @@ -58,7 +58,7 @@ index 74536431f6649..3fc69b6560298 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc -index 376f426b7bab4..c6039e0481712 100644 +index 867227684ddba..98986fdad1e7f 100644 --- chrome/browser/printing/print_view_manager_base.cc +++ chrome/browser/printing/print_view_manager_base.cc @@ -21,6 +21,7 @@ @@ -80,7 +80,7 @@ index 376f426b7bab4..c6039e0481712 100644 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) #include "chrome/browser/printing/print_error_dialog.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -237,8 +242,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, +@@ -215,8 +220,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = GetWebContentsForRenderFrame(render_process_id, render_frame_id); @@ -97,7 +97,7 @@ index 376f426b7bab4..c6039e0481712 100644 void NotifySystemDialogCancelled(int render_process_id, int routing_id) { diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h -index 62f4dc6083a13..1371b43f6208a 100644 +index 48e2baa05cdf6..b4da112845d86 100644 --- chrome/browser/printing/print_view_manager_base.h +++ chrome/browser/printing/print_view_manager_base.h @@ -124,9 +124,6 @@ class PrintViewManagerBase : public content::NotificationObserver, @@ -127,7 +127,7 @@ index 920f646f06484..76c0b5e5ee04b 100644 $i18n{cancel} diff --git chrome/browser/ui/webui/constrained_web_dialog_ui.cc chrome/browser/ui/webui/constrained_web_dialog_ui.cc -index 3d415a60d4361..807ab41ee6ef1 100644 +index dd3512b303c40..0627aa331492c 100644 --- chrome/browser/ui/webui/constrained_web_dialog_ui.cc +++ chrome/browser/ui/webui/constrained_web_dialog_ui.cc @@ -26,6 +26,8 @@ @@ -139,7 +139,7 @@ index 3d415a60d4361..807ab41ee6ef1 100644 using content::RenderFrameHost; using content::WebContents; using content::WebUIMessageHandler; -@@ -55,8 +57,10 @@ class ConstrainedWebDialogDelegateUserData +@@ -57,8 +59,10 @@ class ConstrainedWebDialogDelegateUserData ConstrainedWebDialogUI::ConstrainedWebDialogUI(content::WebUI* web_ui) : WebUIController(web_ui) { #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -149,9 +149,9 @@ index 3d415a60d4361..807ab41ee6ef1 100644 +#endif } - ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { + ConstrainedWebDialogUI::~ConstrainedWebDialogUI() = default; diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index bb1a2238af55c..b825289863d57 100644 +index 32c3e9c3cb267..011b333602bfb 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc @@ -21,6 +21,7 @@ @@ -162,18 +162,39 @@ index bb1a2238af55c..b825289863d57 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_prefs.h" -@@ -61,6 +62,10 @@ +@@ -62,6 +63,10 @@ #include "chromeos/lacros/lacros_service.h" #endif +#if BUILDFLAG(ENABLE_CEF) -+#include "cef/libcef/browser/alloy/alloy_browser_host_impl.h" ++#include "cef/libcef/browser/alloy/alloy_dialog_util.h" +#endif + namespace printing { namespace { -@@ -421,10 +426,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -414,16 +419,18 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, + service->GetRemote() + ->GetMountPointPath( + base::BindOnce(&PdfPrinterHandler::OnSaveLocationReady, +- weak_ptr_factory_.GetWeakPtr(), ++ weak_ptr_factory_.GetWeakPtr(), initiator, + std::move(default_filename), prompt_user)); + return; + } + #endif + +- OnSaveLocationReady(default_filename, prompt_user, GetSaveLocation()); ++ OnSaveLocationReady(initiator, default_filename, prompt_user, ++ GetSaveLocation()); + } + + void PdfPrinterHandler::OnSaveLocationReady( ++ content::WebContents* initiator, + const base::FilePath& default_filename, + bool prompt_user, + const base::FilePath& path) { +@@ -441,10 +448,27 @@ void PdfPrinterHandler::OnSaveLocationReady( // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -201,7 +222,7 @@ index bb1a2238af55c..b825289863d57 100644 // Get default download directory. This will be used as a fallback if the // save directory does not exist. DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext(profile_); -@@ -432,8 +454,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -452,8 +476,7 @@ void PdfPrinterHandler::OnSaveLocationReady( base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -211,7 +232,7 @@ index bb1a2238af55c..b825289863d57 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -479,6 +500,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -499,6 +522,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -220,21 +241,17 @@ index bb1a2238af55c..b825289863d57 100644 +void PdfPrinterHandler::ShowCefSaveAsDialog(content::WebContents* initiator, + const base::FilePath& filename, + const base::FilePath& directory) { -+ CefRefPtr cef_browser = -+ AlloyBrowserHostImpl::GetBrowserForContents(initiator); -+ if (!cef_browser) -+ return; -+ + base::FilePath path = directory.Append(filename); + -+ CefFileDialogRunner::FileChooserParams params; ++ blink::mojom::FileChooserParams params; + params.mode = blink::mojom::FileChooserParams::Mode::kSave; + params.default_file_name = path; -+ params.accept_types.push_back(CefString(path.Extension())); ++ params.accept_types.push_back( ++ alloy::FilePathTypeToString16(path.Extension())); + -+ cef_browser->RunFileChooser( -+ params, base::BindOnce(&PdfPrinterHandler::SaveAsDialogDismissed, -+ weak_ptr_factory_.GetWeakPtr())); ++ alloy::RunFileChooser(initiator, params, ++ base::BindOnce(&PdfPrinterHandler::SaveAsDialogDismissed, ++ weak_ptr_factory_.GetWeakPtr())); +} + +void PdfPrinterHandler::SaveAsDialogDismissed( @@ -253,7 +270,7 @@ index bb1a2238af55c..b825289863d57 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) drive::DriveIntegrationService* drive_service = diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h -index 143c97225fac7..90b6e9549589e 100644 +index e326047aef5e9..4fc8898e95b6f 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h @@ -11,6 +11,7 @@ @@ -264,10 +281,16 @@ index 143c97225fac7..90b6e9549589e 100644 #include "chrome/browser/ui/webui/print_preview/printer_handler.h" #include "ui/shell_dialogs/select_file_dialog.h" -@@ -91,6 +92,15 @@ class PdfPrinterHandler : public PrinterHandler, +@@ -91,10 +92,20 @@ class PdfPrinterHandler : public PrinterHandler, void OnDirectorySelected(const base::FilePath& filename, const base::FilePath& directory); +- void OnSaveLocationReady(const base::FilePath& default_filename, ++ void OnSaveLocationReady(content::WebContents* initiator, ++ const base::FilePath& default_filename, + bool prompt_user, + const base::FilePath& path); + +#if BUILDFLAG(ENABLE_CEF) + void ShowCefSaveAsDialog(content::WebContents* initiator, + const base::FilePath& filename, @@ -281,27 +304,26 @@ index 143c97225fac7..90b6e9549589e 100644 base::FilePath GetSaveLocation() const; diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index 058c76f2a3f8c..3eda3a8f46d9a 100644 +index 5cebaa1d75b74..3c2fae113c678 100644 --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -25,6 +25,7 @@ #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" -+#include "cef/libcef/features/features.h" ++#include "cef/libcef/features/runtime.h" #include "chrome/browser/account_manager_facade_factory.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" -@@ -1107,7 +1108,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( - } - return extension_printer_handler_.get(); +@@ -1151,6 +1152,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } --#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) -+#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) && !BUILDFLAG(ENABLE_CEF) - if (printer_type == PrinterType::kPrivet && + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) + if (printer_type == mojom::PrinterType::kPrivet && ++ !cef::IsAlloyRuntimeEnabled() && GetPrefs()->GetBoolean(prefs::kForceEnablePrivetPrinting)) { if (!privet_printer_handler_) { -@@ -1116,6 +1117,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( + privet_printer_handler_ = +@@ -1158,6 +1160,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -309,10 +331,10 @@ index 058c76f2a3f8c..3eda3a8f46d9a 100644 + if (printer_type == PrinterType::kPrivet) + return nullptr; #endif - if (printer_type == PrinterType::kPdf) { + if (printer_type == mojom::PrinterType::kPdf) { if (!pdf_printer_handler_) { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index f98201bb37881..7e4d2f2ee19ff 100644 +index 7d68582201d35..899df572ef835 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -29,6 +29,7 @@ @@ -323,7 +345,7 @@ index f98201bb37881..7e4d2f2ee19ff 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/pdf/pdf_extension_util.h" #include "chrome/browser/printing/background_printing_manager.h" -@@ -96,6 +97,13 @@ const char16_t kBasicPrintShortcut[] = u"\u0028\u21e7\u2318\u0050\u0029"; +@@ -98,6 +99,13 @@ const char16_t kBasicPrintShortcut[] = u"\u0028\u21e7\u2318\u0050\u0029"; const char16_t kBasicPrintShortcut[] = u"(Ctrl+Shift+P)"; #endif @@ -337,7 +359,7 @@ index f98201bb37881..7e4d2f2ee19ff 100644 constexpr char kInvalidArgsForDidStartPreview[] = "Invalid arguments for DidStartPreview"; constexpr char kInvalidPageNumberForDidPreviewPage[] = -@@ -381,7 +389,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { +@@ -383,7 +391,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { chrome::kCloudPrintCertificateErrorLearnMoreURL); #if !defined(OS_CHROMEOS) diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index 012d19003..033800ba3 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index f2ba13cb21d66..6be5e94c01298 100644 +index 2824b97e715a4..7207b58654e49 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc -@@ -139,6 +139,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) +@@ -135,6 +135,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) PrintingContext::Create(printing_context_delegate_.get())), thread_("Printing_Worker") { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index 95cea5afb..c00a43899 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 542d78525863f..52b20fa87183d 100644 +index ce54ce5ee0d4f..43b9c048bb172 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -613,6 +613,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -625,6 +625,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index b6999d9cd..0c093fbed 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index 4c2658b79dc4e..a365b325210a8 100644 +index f61123b6cf989..b2d3b3619b93c 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc @@ -42,7 +42,8 @@ diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index a6f47c627..e4035b376 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,8 +1,8 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 65b1649050a15..a8f3df15f6602 100644 +index 2ecaac520bd2f..25cff6cf13cbd 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -841,6 +841,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) +@@ -838,6 +838,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) : delegate_(delegate), locale_resources_data_lock_(new base::Lock), max_scale_factor_(SCALE_FACTOR_100P) { @@ -15,7 +15,7 @@ index 65b1649050a15..a8f3df15f6602 100644 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -850,6 +856,11 @@ ResourceBundle::~ResourceBundle() { +@@ -847,6 +853,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } @@ -28,7 +28,7 @@ index 65b1649050a15..a8f3df15f6602 100644 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 c20987a4b16fa..dda56a25f777e 100644 +index 61f5b2a2972d1..6b683617a1e67 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h @@ -191,6 +191,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index fe44679fd..48810a544 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -26,7 +26,7 @@ index c1d2fa2ce0aa2..d1d215f35ac12 100644 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 c3b1182b75b4f..04a472b149d42 100755 +index ecf0971ab1349..bf90866524442 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -102,9 +102,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index fdee3306a..552c304df 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index b8ae3c5d06c09..f3a871dcc7e5d 100644 +index 2e653492a9093..05fb213ad423f 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -646,10 +646,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -645,10 +645,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,7 +19,7 @@ index b8ae3c5d06c09..f3a871dcc7e5d 100644 } absl::optional RenderWidgetHostViewAura::GetDisplayFeature() { -@@ -2074,6 +2076,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2087,6 +2089,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // This needs to happen only after |window_| has been initialized using // Init(), because it needs to have the layer. window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index 105839e92..6600201a4 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index 99455d0c26355..d64e53232822a 100644 +index bae294fef1f8b..06d2dfcecc956 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -21,6 +21,7 @@ @@ -42,10 +42,10 @@ index 99455d0c26355..d64e53232822a 100644 // change. network_context_params->http_server_properties_path = diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 4183288fd5da1..2ecb3ed351bba 100644 +index e2e1e9acb3605..f0b22ab2dce9d 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -515,6 +515,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -506,6 +506,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -72,7 +72,7 @@ index 4183288fd5da1..2ecb3ed351bba 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index ef391b3cb94f1..8962106d08688 100644 +index 4b24d429aabb4..fbfa765aba86a 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h @@ -182,6 +182,8 @@ class NET_EXPORT CookieMonster : public CookieStore { @@ -123,10 +123,10 @@ index a397306372054..8a1bacea8d70c 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index e606e81f99451..89c29adfb3a09 100644 +index a38eeaf6e58af..02ec2034afc8a 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2003,16 +2003,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2052,16 +2052,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -157,10 +157,10 @@ index e606e81f99451..89c29adfb3a09 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index e24ec4cb3c49a..b8d3aec99d8af 100644 +index 25d6c99d4f6be..2c6cf5a907d16 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -252,6 +252,9 @@ struct NetworkContextParams { +@@ -249,6 +249,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index dfa47086f..d2f2828c4 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,5 +1,5 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index 4bb577abb154e..c0b5aba74ab16 100644 +index a7584ed4201ec..7cf54d07d0954 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc @@ -494,10 +494,6 @@ class LoginHandlerDelegate { @@ -26,7 +26,7 @@ index 4bb577abb154e..c0b5aba74ab16 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2538,8 +2528,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2598,8 +2588,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index 4bb577abb154e..c0b5aba74ab16 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2552,6 +2546,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2612,6 +2606,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( browser_context_, is_in_memory_, relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index 3498af6fb..7366bb33c 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -12,10 +12,10 @@ index 1a85a7b4a8305..66817eaecd86b 100644 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { diff --git ui/views/controls/native/native_view_host.h ui/views/controls/native/native_view_host.h -index ab2371857a00a..8dccc190fa896 100644 +index 3ed75e4c9b11e..c4a7318de5dd7 100644 --- ui/views/controls/native/native_view_host.h +++ ui/views/controls/native/native_view_host.h -@@ -95,6 +95,12 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -94,6 +94,12 @@ class VIEWS_EXPORT NativeViewHost : public View { void set_fast_resize(bool fast_resize) { fast_resize_ = fast_resize; } bool fast_resize() const { return fast_resize_; } @@ -28,7 +28,7 @@ index ab2371857a00a..8dccc190fa896 100644 gfx::NativeView native_view() const { return native_view_; } void NativeViewDestroyed(); -@@ -141,6 +147,9 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -140,6 +146,9 @@ class VIEWS_EXPORT NativeViewHost : public View { // in the setter/accessor above. bool fast_resize_ = false; @@ -54,7 +54,7 @@ index 75c1f03c6efff..5ed55bb974958 100644 if (crashed_overlay_view_ == crashed_overlay_view) return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 1bb2399d0d139..5bb1fcde4e3bc 100644 +index 71883873f5028..def24d95736fb 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h @@ -78,6 +78,10 @@ class WEBVIEW_EXPORT WebView : public View, diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index a5e6a1b67..93475911f 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -13,10 +13,10 @@ index 4960b1067e1c4..2686fa5bc550b 100644 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index a7734981fc762..7137c46a38d5c 100644 +index 42f3b85ab0485..d8b50c18afd0e 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -141,7 +141,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -136,7 +136,7 @@ StoragePartition* BrowserContext::GetStoragePartition( StoragePartition* BrowserContext::GetStoragePartition( const StoragePartitionConfig& storage_partition_config, bool can_create) { @@ -25,7 +25,7 @@ index a7734981fc762..7137c46a38d5c 100644 // An off the record profile MUST only use in memory storage partitions. CHECK(storage_partition_config.in_memory()); } -@@ -385,7 +385,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { +@@ -386,7 +386,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { const bool kUseInMemoryDBDefault = false; bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, @@ -58,10 +58,10 @@ index 0095de1d05fd1..0e651cbcbe541 100644 // static diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index 2bdd932ceb3a0..5a35d16ccd5aa 100644 +index c96e3fad1a70f..302b2be31d8dc 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -495,7 +495,7 @@ bool DatabaseTracker::LazyInit() { +@@ -562,7 +562,7 @@ bool DatabaseTracker::LazyInit() { databases_table_ = std::make_unique(db_.get()); meta_table_ = std::make_unique(); diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index ab66183e1..a08c8cb88 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,5 +1,5 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index 563674ae96317..953c378ff7e57 100644 +index a9616406d4d37..178e4bdad971c 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -61,6 +61,8 @@ diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index b6894c123..029ecd21f 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,8 +1,8 @@ diff --git ui/base/x/x11_os_exchange_data_provider.cc ui/base/x/x11_os_exchange_data_provider.cc -index cbf6e7f50b83a..2786d99a8b936 100644 +index d3f24a6dce7ad..901198a562e44 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc -@@ -122,7 +122,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, +@@ -123,7 +123,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, format_map_.Insert(x11::GetAtom(kMimeTypeMozillaURL), mem); // Set a string fallback as well. diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 4d88757e0..0512fa4ec 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -43,10 +43,10 @@ index 279be87a33e9e..f295fdac67165 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index fbefbf0072674..159fad0893fdb 100644 +index 988159e708dcc..3d957f7ea966e 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -621,6 +621,14 @@ void RenderText::SetWhitespaceElision(absl::optional whitespace_elision) { +@@ -650,6 +650,14 @@ void RenderText::SetWhitespaceElision(absl::optional whitespace_elision) { } } @@ -61,7 +61,7 @@ index fbefbf0072674..159fad0893fdb 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -2007,6 +2015,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2036,6 +2044,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -106,7 +106,7 @@ index 36811695d23a5..db6b5f8bb08a4 100644 } // namespace gfx diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index ac018b1298052..090b4949625ae 100644 +index bd0975b485de4..6e853e7018e9b 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h @@ -184,6 +184,8 @@ class VIEWS_EXPORT InkDropHost { @@ -119,10 +119,10 @@ index ac018b1298052..090b4949625ae 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 86ddd3569f4eb..7a9dbe264225a 100644 +index 9d12e8a9f7487..442f45617e275 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -500,6 +500,12 @@ void LabelButton::OnThemeChanged() { +@@ -509,6 +509,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -136,10 +136,10 @@ index 86ddd3569f4eb..7a9dbe264225a 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index a3b83cbd72090..a1ff21bc5cc20 100644 +index 9b5389139c2fb..6111c18533564 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -133,6 +133,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -134,6 +134,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ui::NativeTheme::State GetForegroundThemeState( ui::NativeTheme::ExtraParams* params) const override; @@ -150,10 +150,10 @@ index a3b83cbd72090..a1ff21bc5cc20 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 70d319e79c6f7..1cd58d7bb0b13 100644 +index 79a26da93a4eb..e755a11efc658 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -51,12 +51,27 @@ enum LabelPropertyKey { +@@ -52,12 +52,27 @@ enum LabelPropertyKey { kLabelLineHeight, kLabelObscured, kLabelAllowCharacterBreak, @@ -181,7 +181,7 @@ index 70d319e79c6f7..1cd58d7bb0b13 100644 } // namespace namespace views { -@@ -413,6 +428,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -421,6 +436,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged); } @@ -197,7 +197,7 @@ index 70d319e79c6f7..1cd58d7bb0b13 100644 std::u16string Label::GetTooltipText() const { return tooltip_text_; } -@@ -709,6 +733,16 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -717,6 +741,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } @@ -215,10 +215,10 @@ index 70d319e79c6f7..1cd58d7bb0b13 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index 0e8b88dc404f0..2f50228d3b804 100644 +index 5bad0a8cd8cbc..da57021f0cefa 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -225,6 +225,10 @@ class VIEWS_EXPORT Label : public View, +@@ -230,6 +230,10 @@ class VIEWS_EXPORT Label : public View, gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); @@ -229,7 +229,7 @@ index 0e8b88dc404f0..2f50228d3b804 100644 // Gets/Sets the tooltip text. Default behavior for a label (single-line) is // to show the full text if it is wider than its bounds. Calling this // overrides the default behavior and lets you set a custom tooltip. To -@@ -471,6 +475,7 @@ class VIEWS_EXPORT Label : public View, +@@ -476,6 +480,7 @@ class VIEWS_EXPORT Label : public View, int max_width_ = 0; // This is used in single-line mode. int max_width_single_line_ = 0; @@ -238,10 +238,10 @@ index 0e8b88dc404f0..2f50228d3b804 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index e9edd19929aa2..5ffcbe7374ba9 100644 +index 8ba686c398002..7842a7c8936cb 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2760,8 +2760,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2795,8 +2795,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -256,7 +256,7 @@ index e9edd19929aa2..5ffcbe7374ba9 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2780,8 +2785,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2815,8 +2820,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -269,10 +269,10 @@ index e9edd19929aa2..5ffcbe7374ba9 100644 SetSelection(item, SELECTION_UPDATE_IMMEDIATELY); else if (item->GetParentMenuItem()->GetParentMenuItem()) diff --git ui/views/controls/menu/menu_delegate.h ui/views/controls/menu/menu_delegate.h -index a280e9d74016e..59a8eda9b1d84 100644 +index b47a61998daaa..e6f1b862838b9 100644 --- ui/views/controls/menu/menu_delegate.h +++ ui/views/controls/menu/menu_delegate.h -@@ -79,6 +79,22 @@ class VIEWS_EXPORT MenuDelegate { +@@ -80,6 +80,22 @@ class VIEWS_EXPORT MenuDelegate { // parts of |style| or leave it unmodified. virtual void GetLabelStyle(int id, LabelStyle* style) const; @@ -295,7 +295,7 @@ index a280e9d74016e..59a8eda9b1d84 100644 // The tooltip shown for the menu item. This is invoked when the user // hovers over the item, and no tooltip text has been set for that item. virtual std::u16string GetTooltipText(int id, -@@ -207,6 +223,11 @@ class VIEWS_EXPORT MenuDelegate { +@@ -218,6 +234,11 @@ class VIEWS_EXPORT MenuDelegate { bool* has_mnemonics, MenuButton** button); @@ -308,10 +308,10 @@ index a280e9d74016e..59a8eda9b1d84 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index 3232a9147d8da..b4431a6a0503e 100644 +index 039cbc90f0eed..09f16763f7581 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1071,6 +1071,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1080,6 +1080,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -327,7 +327,7 @@ index 3232a9147d8da..b4431a6a0503e 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1139,6 +1148,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1148,6 +1157,13 @@ void MenuItemView::PaintMinorIconAndText( } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -342,10 +342,10 @@ index 3232a9147d8da..b4431a6a0503e 100644 GetMenuController() && GetMenuController()->use_touchable_layout() ? style::CONTEXT_TOUCH_MENU diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index 6dcbba931eb9a..b5d21864b7384 100644 +index 895745cf0f7e5..28c24b1b007c9 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc -@@ -244,6 +244,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { +@@ -246,6 +246,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { return false; } @@ -424,7 +424,7 @@ index 6dcbba931eb9a..b5d21864b7384 100644 // Look up the menu model for this menu. const std::map::const_iterator map_iterator = diff --git ui/views/controls/menu/menu_model_adapter.h ui/views/controls/menu/menu_model_adapter.h -index c7aaf7286b74d..2ba3a9c10fe03 100644 +index 76a9001061649..c5026f9241334 100644 --- ui/views/controls/menu/menu_model_adapter.h +++ ui/views/controls/menu/menu_model_adapter.h @@ -84,6 +84,20 @@ class VIEWS_EXPORT MenuModelAdapter : public MenuDelegate, @@ -449,10 +449,10 @@ index c7aaf7286b74d..2ba3a9c10fe03 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 8522b0b4bb779..58f44f4f766c7 100644 +index 979682ad5d7aa..a819da9125eb7 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -234,6 +234,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -239,6 +239,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = AddChildView(std::make_unique(content_view, false)); @@ -480,7 +480,7 @@ index 64e09ff4359a8..714e8e9ff6610 100644 x11_ui_controls_test_helper_.ButtonDownMask() == 0) { // Move the cursor because EnterNotify/LeaveNotify are generated with the diff --git ui/views/view.h ui/views/view.h -index cd9069a34ec6a..317bca771298d 100644 +index 2c7cbb21185ab..304a1b0e5df97 100644 --- ui/views/view.h +++ ui/views/view.h @@ -20,6 +20,7 @@ diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index aaa694b74..858a8cc1c 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index ec0d6b0acbc89..13669d872d9b7 100644 +index c31a2b532540b..a27dfc0173d73 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -621,6 +621,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -622,6 +622,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,10 +18,10 @@ index ec0d6b0acbc89..13669d872d9b7 100644 if (!GetMouseWheelPhaseHandler()) return; diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index 8cc591cfc75a0..0df0e0334c551 100644 +index 17803f43ea181..15ce076ba78a6 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -66,6 +66,7 @@ class CursorManager; +@@ -67,6 +67,7 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index 8cc591cfc75a0..0df0e0334c551 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -136,6 +137,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -129,6 +130,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; float GetDeviceScaleFactor() final; @@ -38,7 +38,7 @@ index 8cc591cfc75a0..0df0e0334c551 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordContentToVisibleTimeRequest( -@@ -430,6 +433,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -424,6 +427,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds) = 0; @@ -51,7 +51,7 @@ index 8cc591cfc75a0..0df0e0334c551 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -608,6 +617,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -611,6 +620,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { TooltipObserver* tooltip_observer_for_testing_ = nullptr; @@ -63,21 +63,21 @@ index 8cc591cfc75a0..0df0e0334c551 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index f4dbe7b3e5165..07fbd12d0289e 100644 +index 9043a181d4c04..a72a96e015e9d 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc -@@ -38,6 +38,10 @@ - #include "ui/gfx/delegated_ink_point.h" - #include "ui/touch_selection/touch_selection_controller.h" +@@ -49,6 +49,10 @@ namespace { + // of the border area, in percentage of the corresponding dimension. + const int kMouseLockBorderPercentage = 15; +#if defined(OS_LINUX) +#include "ui/aura/window_tree_host.h" +#endif + #if defined(OS_WIN) - #include "content/browser/renderer_host/render_frame_host_impl.h" - #include "ui/aura/window_tree_host.h" -@@ -951,6 +955,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( + // A callback function for EnumThreadWindows to enumerate and dismiss + // any owned popup windows. +@@ -834,6 +838,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( } return; } @@ -92,7 +92,7 @@ index f4dbe7b3e5165..07fbd12d0289e 100644 #endif synthetic_move_position_ = center_in_screen; } -@@ -980,6 +992,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( +@@ -863,6 +875,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( } void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { @@ -111,7 +111,7 @@ index f4dbe7b3e5165..07fbd12d0289e 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 8c85abb161f5c..831113822daac 100644 +index 2486758e79114..3ef43f47b62e3 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h @@ -249,6 +249,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -130,10 +130,10 @@ index 8c85abb161f5c..831113822daac 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index ce480a898c75f..bc9d56403036a 100644 +index 21f7e7bfc0e75..11163b3ef0144 100644 --- ui/platform_window/x11/x11_window.cc +++ ui/platform_window/x11/x11_window.cc -@@ -1608,7 +1608,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1665,7 +1665,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(bounds); @@ -157,7 +157,7 @@ index 7c352dd0d992d..cf1a0c3e6db63 100644 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 7f7d82f518600..8e5386de9d9e2 100644 +index 3f3917338dbd8..ddedabd555a5a 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc @@ -215,6 +215,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( @@ -177,9 +177,9 @@ index 7f7d82f518600..8e5386de9d9e2 100644 +} + void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { - // The input can be disabled and the widget marked as non-active in case of - // opened file-dialogs. -@@ -350,6 +362,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( + // In Windows, the native events sent to chrome are separated into client + // and non-client versions of events, which we record on our LocatedEvent +@@ -345,6 +357,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( properties->wm_class_class = params.wm_class_class; properties->wm_role_name = params.wm_role_name; @@ -221,10 +221,10 @@ index 49c2776892f1f..02df1b4bafe17 100644 base::WeakPtrFactory weak_factory_{this}; 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 fb8bbb639f6b6..c887f2d34b6e7 100644 +index 4d986b929bd79..fe188b76db852 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -144,8 +144,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -170,8 +170,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_); HWND parent_hwnd = nullptr; @@ -238,7 +238,7 @@ index fb8bbb639f6b6..c887f2d34b6e7 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -930,11 +934,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -966,11 +970,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -257,10 +257,10 @@ index fb8bbb639f6b6..c887f2d34b6e7 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index 07078cbdf222e..25759541a3aaf 100644 +index 20bcac8ebadfa..f36e48dbf6549 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -292,6 +292,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -294,6 +294,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -272,10 +272,10 @@ index 07078cbdf222e..25759541a3aaf 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 0dcab77ec0d47..99f08c3361837 100644 +index a742d7d7f5d56..ac66f0cb18006 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -322,7 +322,8 @@ void Widget::Init(InitParams params) { +@@ -332,7 +332,8 @@ void Widget::Init(InitParams params) { parent_ = params.parent ? GetWidgetForNativeView(params.parent) : nullptr; params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -285,7 +285,7 @@ index 0dcab77ec0d47..99f08c3361837 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -404,7 +405,12 @@ void Widget::Init(InitParams params) { +@@ -414,7 +415,12 @@ void Widget::Init(InitParams params) { } } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); @@ -299,7 +299,7 @@ index 0dcab77ec0d47..99f08c3361837 100644 } native_theme_observation_.Observe(GetNativeTheme()); -@@ -1301,10 +1307,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1357,10 +1363,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -317,7 +317,7 @@ index 0dcab77ec0d47..99f08c3361837 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index ef3892d66fa00..7e0558362c662 100644 +index d6ce8c4934ed1..773125ba2dd5f 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h @@ -326,6 +326,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -330,10 +330,10 @@ index ef3892d66fa00..7e0558362c662 100644 // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index a53c810230112..a6e6f64049e5e 100644 +index 8accd587315a8..6836cbae3c520 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -385,6 +385,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -388,6 +388,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -345,7 +345,7 @@ index a53c810230112..a6e6f64049e5e 100644 bool enable_arrow_key_traversal() const { return params_.enable_arrow_key_traversal; diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc -index e07a12918596b..7c3a3dc669de6 100644 +index c23259757d984..450b2610e34d1 100644 --- ui/views/widget/widget_hwnd_utils.cc +++ ui/views/widget/widget_hwnd_utils.cc @@ -67,7 +67,7 @@ void CalculateWindowStylesFromInitParams( @@ -358,10 +358,10 @@ index e07a12918596b..7c3a3dc669de6 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index aabbdffa06268..23f08aeac911a 100644 +index a221915d4ca70..059aabf614696 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3123,10 +3123,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3121,10 +3121,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 3c81cc07a..f97f1ae1b 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,10 +80,10 @@ index 1026b739d283f..fe562ab60ce98 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 2ff8732060011..21c94aacc96ef 100644 +index 4e93b8609553e..97f52868bb68a 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -204,6 +204,8 @@ viz_component("service") { +@@ -206,6 +206,8 @@ viz_component("service") { "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", "viz_service_export.h", @@ -93,7 +93,7 @@ index 2ff8732060011..21c94aacc96ef 100644 defines = [ "VIZ_SERVICE_IMPLEMENTATION" ] diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc -index bd64ee19f7169..2f5bae8a7c1b4 100644 +index 827084542417d..73f44ba997497 100644 --- components/viz/service/display_embedder/output_surface_provider_impl.cc +++ components/viz/service/display_embedder/output_surface_provider_impl.cc @@ -16,6 +16,7 @@ @@ -104,7 +104,7 @@ index bd64ee19f7169..2f5bae8a7c1b4 100644 #include "components/viz/common/display/renderer_settings.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/service/display/display_compositor_memory_and_task_controller.h" -@@ -256,6 +257,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( +@@ -255,6 +256,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( if (headless_) return std::make_unique(); @@ -142,7 +142,7 @@ index 599b06c1765ef..e8ae98b0b1320 100644 TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceWinProxy::Draw", this); diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index 83a23404d1c02..7870327028592 100644 +index 50ff2c9facc2a..c34d1f28d2e90 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc @@ -395,8 +395,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( @@ -214,10 +214,10 @@ index 6b7fbb6cf13dc..e2af75168cb91 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index fe4e33a62087c..503965e575df3 100644 +index dfb0c89dc7bd8..4b54ea85c0298 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h -@@ -28,7 +28,9 @@ +@@ -29,7 +29,9 @@ #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/common/surfaces/subtree_capture_id.h" @@ -226,8 +226,8 @@ index fe4e33a62087c..503965e575df3 100644 +#include "components/viz/service/display/software_output_device.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h" - #include "third_party/skia/include/core/SkColor.h" -@@ -136,6 +138,14 @@ class COMPOSITOR_EXPORT ContextFactory { + #include "skia/ext/skia_matrix_44.h" +@@ -137,6 +139,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -242,7 +242,7 @@ index fe4e33a62087c..503965e575df3 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -171,6 +181,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -172,6 +182,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -252,7 +252,7 @@ index fe4e33a62087c..503965e575df3 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -442,6 +455,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -443,6 +456,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index b5fa226f2..c2623aab8 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 5dc3f95a5db5d..e47d915d0712c 100644 +index ce65fbf4c4e62..6b05415374c87 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2883,6 +2883,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2878,6 +2878,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, params.main_frame_name); @@ -15,7 +15,7 @@ index 5dc3f95a5db5d..e47d915d0712c 100644 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2893,6 +2899,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2888,6 +2894,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -23,7 +23,7 @@ index 5dc3f95a5db5d..e47d915d0712c 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3748,6 +3755,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3719,6 +3726,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -39,7 +39,7 @@ index 5dc3f95a5db5d..e47d915d0712c 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -7460,6 +7476,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -7468,6 +7484,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } @@ -62,7 +62,7 @@ index f1dcf53ea481b..192f7c0ddd04f 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 67006dfc4c4fa..125ee29267177 100644 +index 279d292d96507..496e48d666a36 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h @@ -85,10 +85,12 @@ class BrowserContext; @@ -90,7 +90,7 @@ index 67006dfc4c4fa..125ee29267177 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index b1cfa654259d4..84d678815994e 100644 +index 0574d390dc94a..7ad9c7bc6e456 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -59,10 +59,12 @@ class EyeDropperListener; @@ -106,7 +106,7 @@ index b1cfa654259d4..84d678815994e 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -340,6 +342,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -338,6 +340,14 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionId& partition_id, SessionStorageNamespace* session_storage_namespace); @@ -122,10 +122,10 @@ index b1cfa654259d4..84d678815994e 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index 6c2b6e48f769d..f6b17dbe493bf 100644 +index 264f4fa3ded25..d2e6e02f51727 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -666,6 +666,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -705,6 +705,10 @@ class CONTENT_EXPORT WebContentsObserver { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/web_url_loader_cancel_1617042.patch b/patch/patches/web_url_loader_cancel_1617042.patch index 5d008774f..d9481390a 100644 --- a/patch/patches/web_url_loader_cancel_1617042.patch +++ b/patch/patches/web_url_loader_cancel_1617042.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/platform/web_url_loader.h third_party/blink/public/platform/web_url_loader.h -index 042a383fe1771..310f25700ebfb 100644 +index 3894775930095..aef157bc50b79 100644 --- third_party/blink/public/platform/web_url_loader.h +++ third_party/blink/public/platform/web_url_loader.h -@@ -160,12 +160,14 @@ class BLINK_PLATFORM_EXPORT WebURLLoader { +@@ -152,12 +152,14 @@ class BLINK_PLATFORM_EXPORT WebURLLoader { void SetResourceRequestSenderForTesting( std::unique_ptr resource_request_sender); diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 420f5233d..e312c92bd 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,12 +10,12 @@ index ff7a8ed89e94a..77f44956ff22f 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index d0df35ea0be1f..895006a02a35d 100644 +index 9d96af5c4c9b5..fee49109c35d3 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -873,6 +873,11 @@ class BLINK_PLATFORM_EXPORT Platform { - return nullptr; - } +@@ -875,6 +875,11 @@ class BLINK_PLATFORM_EXPORT Platform { + const WebURL& url, + blink::WebVector* csp) {} + // DevTools ------------------------------------------------------------ + @@ -44,10 +44,10 @@ index 463e3e5e73419..97aaf0da2b9a5 100644 DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index fab2d2cbc446c..0292471023cdb 100644 +index c0f2ba8de2f77..745dfcb704ad2 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -2087,7 +2087,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1879,7 +1879,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins()) return nullptr; @@ -57,7 +57,7 @@ index fab2d2cbc446c..0292471023cdb 100644 } diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index 242653b4e7237..385e4b4d3f075 100644 +index 881b5a6234586..c28e864b98bc1 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -8,6 +8,7 @@ @@ -68,7 +68,7 @@ index 242653b4e7237..385e4b4d3f075 100644 #include "third_party/blink/renderer/bindings/core/v8/script_controller.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/inspector/devtools_agent.h" -@@ -144,6 +145,7 @@ DevToolsSession::DevToolsSession( +@@ -145,6 +146,7 @@ DevToolsSession::DevToolsSession( for (wtf_size_t i = 0; i < agents_.size(); i++) agents_[i]->Restore(); } @@ -76,7 +76,7 @@ index 242653b4e7237..385e4b4d3f075 100644 } DevToolsSession::~DevToolsSession() { -@@ -184,6 +186,7 @@ void DevToolsSession::Detach() { +@@ -185,6 +187,7 @@ void DevToolsSession::Detach() { agents_.clear(); v8_session_.reset(); agent_->client_->DebuggerTaskFinished(); @@ -85,7 +85,7 @@ index 242653b4e7237..385e4b4d3f075 100644 void DevToolsSession::DispatchProtocolCommand( diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index 4ae29426622ff..d8fe3d0720f9d 100644 +index 3afca2407df4b..6127652fb5f42 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc @@ -212,7 +212,8 @@ Page::Page(base::PassKey, @@ -160,10 +160,10 @@ index 4ae29426622ff..d8fe3d0720f9d 100644 visitor->Trace(plugins_changed_observers_); visitor->Trace(next_related_page_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index 9a219bef35564..e42009509bb12 100644 +index 72e214c315acf..c89b578f7d6d5 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h -@@ -147,7 +147,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -148,7 +148,8 @@ class CORE_EXPORT Page final : public GarbageCollected, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -173,7 +173,7 @@ index 9a219bef35564..e42009509bb12 100644 // Resets the plugin data for all pages in the renderer process and notifies // PluginsChangedObservers. -@@ -428,7 +429,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -433,7 +434,8 @@ class CORE_EXPORT Page final : public GarbageCollected, const Member link_highlight_; Member spatial_navigation_controller_; @@ -212,10 +212,10 @@ index 89beb74dae8a9..63bfa84b45b72 100644 auto* plugin_info = MakeGarbageCollected( plugin->name, FilePathToWebString(plugin->filename), diff --git third_party/blink/renderer/core/page/plugin_data.h third_party/blink/renderer/core/page/plugin_data.h -index 8dc24f5d25ace..7203ddcedf877 100644 +index 310319d4595be..491b7705a006c 100644 --- third_party/blink/renderer/core/page/plugin_data.h +++ third_party/blink/renderer/core/page/plugin_data.h -@@ -97,7 +97,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { +@@ -98,7 +98,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { const HeapVector>& Plugins() const { return plugins_; } const HeapVector>& Mimes() const { return mimes_; } const SecurityOrigin* Origin() const { return main_frame_origin_.get(); } diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch new file mode 100644 index 000000000..110c32354 --- /dev/null +++ b/patch/patches/webkit_popups.patch @@ -0,0 +1,76 @@ +diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h +index f54b993e9fb9f..ec081f68adddb 100644 +--- third_party/blink/public/web/web_view.h ++++ third_party/blink/public/web/web_view.h +@@ -338,6 +338,7 @@ class WebView { + + // Sets whether select popup menus should be rendered by the browser. + BLINK_EXPORT static void SetUseExternalPopupMenus(bool); ++ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0; + + // Cancels and hides the current popup (datetime, select...) if any. + virtual void CancelPagePopup() = 0; +diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc +index 2f9022d37ab98..5637137cafc50 100644 +--- third_party/blink/renderer/core/exported/web_view_impl.cc ++++ third_party/blink/renderer/core/exported/web_view_impl.cc +@@ -244,8 +244,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { + g_should_use_external_popup_menus = use_external_popup_menus; + } + +-bool WebViewImpl::UseExternalPopupMenus() { +- return g_should_use_external_popup_menus; ++void WebViewImpl::SetUseExternalPopupMenusThisInstance( ++ bool use_external_popup_menus) { ++ should_use_external_popup_menus_ = use_external_popup_menus; ++} ++ ++bool WebViewImpl::UseExternalPopupMenus() const { ++ return should_use_external_popup_menus_; + } + + namespace { +@@ -556,6 +561,7 @@ WebViewImpl::WebViewImpl( + chrome_client_(MakeGarbageCollected(this)), + minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), + maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), ++ should_use_external_popup_menus_(g_should_use_external_popup_menus), + does_composite_(does_composite), + fullscreen_controller_(std::make_unique(this)), + page_base_background_color_( +diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h +index 97e3d30f1427b..284bd30aa95e1 100644 +--- third_party/blink/renderer/core/exported/web_view_impl.h ++++ third_party/blink/renderer/core/exported/web_view_impl.h +@@ -131,7 +131,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, + static HashSet& AllInstances(); + // Returns true if popup menus should be rendered by the browser, false if + // they should be rendered by WebKit (which is the default). +- static bool UseExternalPopupMenus(); ++ void SetUseExternalPopupMenusThisInstance(bool) override; ++ bool UseExternalPopupMenus() const; + + // Returns whether frames under this WebView are backed by a compositor. + bool does_composite() const { return does_composite_; } +@@ -789,6 +790,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, + float fake_page_scale_animation_page_scale_factor_ = 0.f; + bool fake_page_scale_animation_use_anchor_ = false; + ++ bool should_use_external_popup_menus_; ++ + float compositor_device_scale_factor_override_ = 0.f; + TransformationMatrix device_emulation_transform_; + +diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc +index 7528cfa4793e9..35a37668930a7 100644 +--- third_party/blink/renderer/core/page/chrome_client_impl.cc ++++ third_party/blink/renderer/core/page/chrome_client_impl.cc +@@ -839,7 +839,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { + PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, + HTMLSelectElement& select) { + NotifyPopupOpeningObservers(); +- if (WebViewImpl::UseExternalPopupMenus()) ++ if (web_view_->UseExternalPopupMenus()) + return MakeGarbageCollected(frame, select); + + DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); diff --git a/patch/patches/webkit_popups_and_background.patch b/patch/patches/webkit_popups_and_background.patch deleted file mode 100644 index 77359ee78..000000000 --- a/patch/patches/webkit_popups_and_background.patch +++ /dev/null @@ -1,151 +0,0 @@ -diff --git third_party/blink/common/web_preferences/web_preferences.cc third_party/blink/common/web_preferences/web_preferences.cc -index 8a1315f7f8958..8101f4994a214 100644 ---- third_party/blink/common/web_preferences/web_preferences.cc -+++ third_party/blink/common/web_preferences/web_preferences.cc -@@ -153,6 +153,7 @@ WebPreferences::WebPreferences() - animation_policy( - blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAllowed), - user_gesture_required_for_presentation(true), -+ base_background_color(0xFFFFFFFF), // Color::kWhite - text_tracks_enabled(false), - text_track_margin_percentage(0.0f), - immersive_mode_enabled(false), -diff --git third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -index ab2d320a40733..f1f3066eabfaa 100644 ---- third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -+++ third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -@@ -159,6 +159,7 @@ bool StructTraitsuser_gesture_required_for_presentation = - data.user_gesture_required_for_presentation(); -+ out->base_background_color = data.base_background_color(); - out->text_tracks_enabled = data.text_tracks_enabled(); - out->text_track_margin_percentage = data.text_track_margin_percentage(); - out->immersive_mode_enabled = data.immersive_mode_enabled(); -diff --git third_party/blink/public/common/web_preferences/web_preferences.h third_party/blink/public/common/web_preferences/web_preferences.h -index 84736bea7ac7b..7cc68805d76c9 100644 ---- third_party/blink/public/common/web_preferences/web_preferences.h -+++ third_party/blink/public/common/web_preferences/web_preferences.h -@@ -176,6 +176,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { - - bool user_gesture_required_for_presentation; - -+ uint32_t base_background_color; -+ - bool text_tracks_enabled; - - // These fields specify the foreground and background color for WebVTT text -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 90a2bb1a13afd..72516aedeaa9a 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 -@@ -465,6 +465,11 @@ struct BLINK_COMMON_EXPORT StructTraits(this)), - minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), - maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), -+ should_use_external_popup_menus_(g_should_use_external_popup_menus), - does_composite_(does_composite), - fullscreen_controller_(std::make_unique(this)), - receiver_(this, -@@ -1788,6 +1794,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, - - RuntimeEnabledFeatures::SetTranslateServiceEnabled( - prefs.translate_service_available); -+ -+ web_view->SetBaseBackgroundColor(prefs.base_background_color); - } - - void WebViewImpl::ThemeChanged() { -diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index c2e704e745d38..fbee6b4cde1ca 100644 ---- third_party/blink/renderer/core/exported/web_view_impl.h -+++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -129,7 +129,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, - static HashSet& AllInstances(); - // Returns true if popup menus should be rendered by the browser, false if - // they should be rendered by WebKit (which is the default). -- static bool UseExternalPopupMenus(); -+ void SetUseExternalPopupMenusThisInstance(bool) override; -+ bool UseExternalPopupMenus() const; - - // Returns whether frames under this WebView are backed by a compositor. - bool does_composite() const { return does_composite_; } -@@ -777,6 +778,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, - float fake_page_scale_animation_page_scale_factor_ = 0.f; - bool fake_page_scale_animation_use_anchor_ = false; - -+ bool should_use_external_popup_menus_; -+ - float compositor_device_scale_factor_override_ = 0.f; - TransformationMatrix device_emulation_transform_; - -diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index 69a5ddb01d95c..c6a2afb0df1e1 100644 ---- third_party/blink/renderer/core/page/chrome_client_impl.cc -+++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -821,7 +821,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { - PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, - HTMLSelectElement& select) { - NotifyPopupOpeningObservers(); -- if (WebViewImpl::UseExternalPopupMenus()) -+ if (web_view_->UseExternalPopupMenus()) - return MakeGarbageCollected(frame, select); - - DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 46809dfbe..7d64a7b46 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index 70cf0998fc4af..cdf1421f33dd6 100644 +index 462eb546fbd94..f75ea77326f33 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -10,6 +10,7 @@ @@ -20,13 +20,13 @@ index 70cf0998fc4af..cdf1421f33dd6 100644 #include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings_factory.h" @@ -29,6 +31,7 @@ #include "chrome/browser/profiles/profile_manager.h" - #include "chrome/browser/sync/profile_sync_service_factory.h" + #include "chrome/browser/sync/sync_service_factory.h" #include "chrome/common/channel_info.h" +#include "chrome/common/chrome_switches.h" #include "components/prefs/pref_service.h" #include "components/sync/driver/sync_internals_util.h" #include "components/sync/driver/sync_service.h" -@@ -336,7 +339,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -334,7 +337,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -39,7 +39,7 @@ index 70cf0998fc4af..cdf1421f33dd6 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); PopulateDataReductionProxyLogs(response.get()); -@@ -410,6 +417,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -408,6 +415,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -52,7 +52,7 @@ index 70cf0998fc4af..cdf1421f33dd6 100644 extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry::Get(profile); std::string extensions_list; -@@ -517,6 +530,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -515,6 +528,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if defined(OS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { @@ -62,7 +62,7 @@ index 70cf0998fc4af..cdf1421f33dd6 100644 bool result = base::win::IsKeyboardPresentOnSlate(ui::GetHiddenWindow(), &reason); diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc -index 8e508bf8372ac..ef890e84ffe0f 100644 +index 77538809e177d..256ab01bf7704 100644 --- chrome/browser/memory_details.cc +++ chrome/browser/memory_details.cc @@ -17,6 +17,7 @@ diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index 9f213359b..6325e10e5 100644 --- a/patch/patches/webview_plugin_2020.patch +++ b/patch/patches/webview_plugin_2020.patch @@ -1,8 +1,8 @@ diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd -index 7b684738cd54d..ef0cd0a3f5bf6 100644 +index 381fd664557d6..a9171702c5683 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -5151,7 +5151,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -5279,7 +5279,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/tests/cefclient/browser/text_input_client_osr_mac.mm b/tests/cefclient/browser/text_input_client_osr_mac.mm index 3ced03292..0892a329c 100644 --- a/tests/cefclient/browser/text_input_client_osr_mac.mm +++ b/tests/cefclient/browser/text_input_client_osr_mac.mm @@ -45,8 +45,11 @@ void ExtractUnderlines(NSAttributedString* string, color = CefColorFromNSColor( [colorAttr colorUsingColorSpaceName:NSDeviceRGBColorSpace]); } - cef_composition_underline_t line = { - {range.location, NSMaxRange(range)}, color, 0, [style intValue] > 1}; + cef_composition_underline_t line = {{static_cast(range.location), + static_cast(NSMaxRange(range))}, + color, + 0, + [style intValue] > 1}; underlines->push_back(line); } i = range.location + range.length; @@ -105,8 +108,8 @@ extern NSString* NSTextInputReplacementRangeAttributeName; if (handlingKeyDown_) { textToBeInserted_.append([im_text UTF8String]); } else { - cef_range_t range = {replacementRange.location, - NSMaxRange(replacementRange)}; + cef_range_t range = {static_cast(replacementRange.location), + static_cast(NSMaxRange(replacementRange))}; browser_->GetHost()->ImeCommitText([im_text UTF8String], range, 0); } @@ -149,8 +152,9 @@ extern NSString* NSTextInputReplacementRangeAttributeName; // ongoing composition. Our input method backend will automatically cancel an // ongoing composition when we send empty text. if (handlingKeyDown_) { - setMarkedTextReplacementRange_ = {replacementRange.location, - NSMaxRange(replacementRange)}; + setMarkedTextReplacementRange_ = { + static_cast(replacementRange.location), + static_cast(NSMaxRange(replacementRange))}; } else if (!handlingKeyDown_) { CefRange replacement_range(replacementRange.location, NSMaxRange(replacementRange)); diff --git a/tests/ceftests/os_rendering_unittest.cc b/tests/ceftests/os_rendering_unittest.cc index 07e984e18..a767b8a24 100644 --- a/tests/ceftests/os_rendering_unittest.cc +++ b/tests/ceftests/os_rendering_unittest.cc @@ -483,8 +483,8 @@ class OSRTestHandler : public RoutingTestHandler, EXPECT_EQ(kExpandedSelectRect.width, rect.width); EXPECT_EQ(kExpandedSelectRect.height, rect.height); } else { - EXPECT_GT(rect.width, kExpandedSelectRect.width); - EXPECT_GT(rect.height, kExpandedSelectRect.height); + EXPECT_GE(rect.width, kExpandedSelectRect.width); + EXPECT_GE(rect.height, kExpandedSelectRect.height); } DestroySucceededTestSoon(); break; @@ -1385,18 +1385,14 @@ class OSRTestHandler : public RoutingTestHandler, } bool ExpectComputedPopupSize() const { -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) - // On Windows the device scale factor is ignored in Blink when computing + // The device scale factor is ignored in Blink when computing // the default form control font size (see https://crbug.com/674663#c11). // This results in better font size display but also means that we won't // get the expected (scaled) width/height value for non-1.0 scale factor // select popups. - // On both Windows and Linux the non-1.0 scale factor size is off by a few - // pixels so we can't perform an exact comparison. + // The non-1.0 scale factor size is off by a few pixels so we can't perform + // an exact comparison. return scale_factor_ == 1.0; -#else - return true; -#endif } void DestroySucceededTestSoon() {