diff --git a/BUILD.gn b/BUILD.gn index 16b519064..d80fb6676 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -929,8 +929,8 @@ source_set("libcef_static") { "libcef/renderer/dom_document_impl.h", "libcef/renderer/dom_node_impl.cc", "libcef/renderer/dom_node_impl.h", - "libcef/renderer/extensions/extensions_dispatcher_delegate.cc", - "libcef/renderer/extensions/extensions_dispatcher_delegate.h", + "libcef/renderer/extensions/extensions_renderer_api_provider.cc", + "libcef/renderer/extensions/extensions_renderer_api_provider.h", "libcef/renderer/extensions/extensions_renderer_client.cc", "libcef/renderer/extensions/extensions_renderer_client.h", "libcef/renderer/extensions/print_render_frame_helper_delegate.cc", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index e5c4d4e04..5bc7158cd 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/123.0.6312.0' + 'chromium_checkout': 'refs/tags/124.0.6367.0' } diff --git a/CHROMIUM_UPDATE.txt b/CHROMIUM_UPDATE.txt index 85a89ab14..254ec0fcf 100644 --- a/CHROMIUM_UPDATE.txt +++ b/CHROMIUM_UPDATE.txt @@ -39,6 +39,7 @@ 'chrome/renderer/chrome_content_renderer_client.*', 'chrome/renderer/extensions/chrome_extensions_renderer_client.*', 'components/content_settings/core/common/content_settings_types.mojom', + 'components/permissions/request_type.h', 'content/browser/renderer_host/render_widget_host_view_base.*', 'content/public/browser/content_browser_client.*', 'content/public/browser/render_widget_host_view.h', diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 3eda5c90f..8cce853ba 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 "6c5009ba08bb760e60f7e17845c532b30f19fbae" +#define CEF_API_HASH_UNIVERSAL "a419379d63087c1c3fb8a8215c066882fd4fce03" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "09f5a8a3088d2a8384c648be2047e0cb25b1221e" +#define CEF_API_HASH_PLATFORM "04f4a1140954f4b11e6fef271d39908ecff07b86" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "ddee29d0c0de65874ff50f3ff7bc5de51089b9eb" +#define CEF_API_HASH_PLATFORM "d0143d677ea9945ed5e0c3624afdb444796661ee" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "a27764fa2599737204faad84b00c31bb32dba54f" +#define CEF_API_HASH_PLATFORM "cac5605286f35bf76576098a0da810a9a34b418a" #endif #ifdef __cplusplus diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 01c0123b6..44dfb5c6a 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2972,51 +2972,22 @@ typedef enum { } cef_text_style_t; /// -/// Specifies where along the main axis the CefBoxLayout child views should be -/// laid out. +/// Specifies where along the axis the CefBoxLayout child views should be laid +/// out. Should be kept in sync with Chromium's views::LayoutAlignment type. /// typedef enum { - /// - /// Child views will be left-aligned. - /// - CEF_MAIN_AXIS_ALIGNMENT_START, + /// Child views will be left/top-aligned. + CEF_AXIS_ALIGNMENT_START, - /// /// Child views will be center-aligned. - /// - CEF_MAIN_AXIS_ALIGNMENT_CENTER, + CEF_AXIS_ALIGNMENT_CENTER, - /// - /// Child views will be right-aligned. - /// - CEF_MAIN_AXIS_ALIGNMENT_END, -} cef_main_axis_alignment_t; + /// Child views will be right/bottom-aligned. + CEF_AXIS_ALIGNMENT_END, -/// -/// Specifies where along the cross axis the CefBoxLayout child views should be -/// laid out. -/// -typedef enum { - /// /// Child views will be stretched to fit. - /// - CEF_CROSS_AXIS_ALIGNMENT_STRETCH, - - /// - /// Child views will be left-aligned. - /// - CEF_CROSS_AXIS_ALIGNMENT_START, - - /// - /// Child views will be center-aligned. - /// - CEF_CROSS_AXIS_ALIGNMENT_CENTER, - - /// - /// Child views will be right-aligned. - /// - CEF_CROSS_AXIS_ALIGNMENT_END, -} cef_cross_axis_alignment_t; + CEF_AXIS_ALIGNMENT_STRETCH, +} cef_axis_alignment_t; /// /// Settings used when initializing a CefBoxLayout. @@ -3053,12 +3024,12 @@ typedef struct _cef_box_layout_settings_t { /// /// Specifies where along the main axis the child views should be laid out. /// - cef_main_axis_alignment_t main_axis_alignment; + cef_axis_alignment_t main_axis_alignment; /// /// Specifies where along the cross axis the child views should be laid out. /// - cef_cross_axis_alignment_t cross_axis_alignment; + cef_axis_alignment_t cross_axis_alignment; /// /// Minimum cross axis size. @@ -3327,64 +3298,65 @@ typedef enum { /// Front L, Front R, Front C, LFE, Back L, Back R CEF_CHANNEL_LAYOUT_5_1_BACK = 12, - /// Front L, Front R, Front C, Side L, Side R, Back L, Back R + /// Front L, Front R, Front C, Back L, Back R, Side L, Side R CEF_CHANNEL_LAYOUT_7_0 = 13, - /// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R + /// Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R CEF_CHANNEL_LAYOUT_7_1 = 14, - /// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC + /// Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R CEF_CHANNEL_LAYOUT_7_1_WIDE = 15, - /// Stereo L, Stereo R + /// Front L, Front R CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, - /// Stereo L, Stereo R, LFE + /// Front L, Front R, LFE CEF_CHANNEL_LAYOUT_2POINT1 = 17, - /// Stereo L, Stereo R, Front C, LFE + /// Front L, Front R, Front C, LFE CEF_CHANNEL_LAYOUT_3_1 = 18, - /// Stereo L, Stereo R, Front C, Rear C, LFE + /// Front L, Front R, Front C, LFE, Back C CEF_CHANNEL_LAYOUT_4_1 = 19, - /// Stereo L, Stereo R, Front C, Side L, Side R, Back C + /// Front L, Front R, Front C, Back C, Side L, Side R CEF_CHANNEL_LAYOUT_6_0 = 20, - /// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC + /// Front L, Front R, Front LofC, Front RofC, Side L, Side R CEF_CHANNEL_LAYOUT_6_0_FRONT = 21, - /// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C + /// Front L, Front R, Front C, Back L, Back R, Back C CEF_CHANNEL_LAYOUT_HEXAGONAL = 22, - /// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center + /// Front L, Front R, Front C, LFE, Back C, Side L, Side R CEF_CHANNEL_LAYOUT_6_1 = 23, - /// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center + /// Front L, Front R, Front C, LFE, Back L, Back R, Back C CEF_CHANNEL_LAYOUT_6_1_BACK = 24, - /// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE + /// Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R CEF_CHANNEL_LAYOUT_6_1_FRONT = 25, - /// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC + /// Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R CEF_CHANNEL_LAYOUT_7_0_FRONT = 26, /// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, - /// Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. + /// Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R CEF_CHANNEL_LAYOUT_OCTAGONAL = 28, /// Channels are not explicitly mapped to speakers. CEF_CHANNEL_LAYOUT_DISCRETE = 29, + /// Deprecated, but keeping the enum value for UMA consistency. /// Front L, Front R, Front C. Front C contains the keyboard mic audio. This /// layout is only intended for input for WebRTC. The Front C channel /// is stripped away in the WebRTC audio input pipeline and never seen outside /// of that. CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, - /// Front L, Front R, Side L, Side R, LFE + /// Front L, Front R, LFE, Side L, Side R CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, /// Actual channel layout is specified in the bitstream and the actual channel @@ -3398,8 +3370,14 @@ typedef enum { /// kMaxConcurrentChannels CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33, + /// Front C, LFE + CEF_CHANNEL_LAYOUT_1_1 = 34, + + /// Front L, Front R, LFE, Back C + CEF_CHANNEL_LAYOUT_3_1_BACK = 35, + /// Max value, must always equal the largest entry ever logged. - CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX + CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK } cef_channel_layout_t; /// @@ -3671,9 +3649,9 @@ typedef enum { CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7, CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8, CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9, - CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 10, - CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 11, - CEF_PERMISSION_TYPE_MIDI = 1 << 12, + CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 << 10, + CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 11, + CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 12, CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13, CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14, CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15, diff --git a/include/internal/cef_types_content_settings.h b/include/internal/cef_types_content_settings.h index 8ae77ae34..cb2528754 100644 --- a/include/internal/cef_types_content_settings.h +++ b/include/internal/cef_types_content_settings.h @@ -418,7 +418,16 @@ typedef enum { /// Whether an application can enumerate audio output device. CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION, - CEF_CONTENT_SETTING_TYPE_NUM_TYPES, + /// Content settings for access to the Direct Sockets API. + CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS, + + /// Keyboard Lock API allows a site to capture keyboard inputs that would + /// otherwise be handled by the OS or the browser. + CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK, + + /// Pointer Lock API allows a site to hide the cursor and have exclusive + /// access to mouse inputs. + CEF_CONTENT_SETTING_TYPE_POINTER_LOCK, } cef_content_setting_types_t; /// diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h index f3d2aeb23..a7343bbba 100644 --- a/include/internal/cef_types_wrappers.h +++ b/include/internal/cef_types_wrappers.h @@ -697,7 +697,9 @@ using CefPdfPrintSettings = CefStructBase; /// class CefBoxLayoutSettings : public cef_box_layout_settings_t { public: - CefBoxLayoutSettings() : cef_box_layout_settings_t{} {} + CefBoxLayoutSettings() : cef_box_layout_settings_t{} { + cross_axis_alignment = CEF_AXIS_ALIGNMENT_STRETCH; + } CefBoxLayoutSettings(const cef_box_layout_settings_t& r) : cef_box_layout_settings_t(r) {} }; diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index 67fc21caa..18b20dd91 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -145,7 +145,7 @@ ui::LinuxUi* GetLinuxUI() { #endif // BUILDFLAG(IS_LINUX) void ProcessSingletonNotificationCallbackImpl( - const base::CommandLine& command_line, + base::CommandLine command_line, const base::FilePath& current_directory) { // Drop the request if the browser process is already shutting down. if (!CONTEXT_STATE_VALID()) { @@ -172,7 +172,7 @@ void ProcessSingletonNotificationCallbackImpl( // Based on ChromeBrowserMainParts::ProcessSingletonNotificationCallback. bool ProcessSingletonNotificationCallback( - const base::CommandLine& command_line, + base::CommandLine command_line, const base::FilePath& current_directory) { // Drop the request if the browser process is already shutting down. // Note that we're going to post an async task below. Even if the browser @@ -191,7 +191,7 @@ bool ProcessSingletonNotificationCallback( // So, we post a task to asynchronously finish the command line processing. return base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( FROM_HERE, base::BindOnce(&ProcessSingletonNotificationCallbackImpl, - command_line, current_directory)); + std::move(command_line), current_directory)); } } // namespace diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index d8ac85695..48bd69521 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -980,11 +980,8 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation( throttles.push_back(std::move(pdf_iframe_throttle)); } - auto pdf_throttle = pdf::PdfNavigationThrottle::MaybeCreateThrottleFor( - navigation_handle, std::make_unique()); - if (pdf_throttle) { - throttles.push_back(std::move(pdf_throttle)); - } + throttles.push_back(std::make_unique( + navigation_handle, std::make_unique())); } throttle::CreateThrottlesForNavigation(navigation_handle, throttles); @@ -999,7 +996,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles( const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, int frame_tree_node_id, - absl::optional navigation_id) { + std::optional navigation_id) { std::vector> result; // Used to substitute View ID for PDF contents when using the PDF plugin. @@ -1100,20 +1097,27 @@ AlloyContentBrowserClient::CreateLoginDelegate( std::move(auth_required_callback)); } -void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( - int frame_tree_node_id, - NonNetworkURLLoaderFactoryMap* factories) { +mojo::PendingRemote +AlloyContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory( + const std::string& scheme, + int frame_tree_node_id) { if (!extensions::ExtensionsEnabled()) { - return; + return {}; } content::WebContents* web_contents = content::WebContents::FromFrameTreeNodeId(frame_tree_node_id); - factories->emplace( - extensions::kExtensionScheme, - extensions::CreateExtensionNavigationURLLoaderFactory( - web_contents->GetBrowserContext(), - !!extensions::WebViewGuest::FromWebContents(web_contents))); + content::BrowserContext* browser_context = web_contents->GetBrowserContext(); + + if (scheme == extensions::kExtensionScheme && + !extensions::ChromeContentBrowserClientExtensionsPart:: + AreExtensionsDisabledForProfile(browser_context)) { + return extensions::CreateExtensionNavigationURLLoaderFactory( + browser_context, + !!extensions::WebViewGuest::FromWebContents(web_contents)); + } + + return {}; } void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index e61894263..4974f3244 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -15,6 +15,7 @@ #include "base/memory/ref_counted.h" #include "build/build_config.h" #include "content/public/browser/content_browser_client.h" +#include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkColor.h" class AlloyBrowserMainParts; @@ -137,7 +138,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, int frame_tree_node_id, - absl::optional navigation_id) override; + std::optional navigation_id) override; std::vector> CreateURLLoaderThrottlesForKeepAlive( const network::ResourceRequest& request, @@ -171,9 +172,9 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { scoped_refptr response_headers, bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) override; - void RegisterNonNetworkNavigationURLLoaderFactories( - int frame_tree_node_id, - NonNetworkURLLoaderFactoryMap* factories) override; + mojo::PendingRemote + CreateNonNetworkNavigationURLLoaderFactory(const std::string& scheme, + int frame_tree_node_id) override; void RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, diff --git a/libcef/browser/audio_capturer.cc b/libcef/browser/audio_capturer.cc index ce7625083..c569b3621 100644 --- a/libcef/browser/audio_capturer.cc +++ b/libcef/browser/audio_capturer.cc @@ -98,6 +98,7 @@ void CefAudioCapturer::OnCaptureStarted() { void CefAudioCapturer::Capture(const media::AudioBus* source, base::TimeTicks audio_capture_time, + const media::AudioGlitchInfo& /*glitch_info*/, double /*volume*/, bool /*key_pressed*/) { const int channels = source->channels(); @@ -129,4 +130,4 @@ void CefAudioCapturer::StopStream() { audio_input_device_ = nullptr; capturing_ = false; -} \ No newline at end of file +} diff --git a/libcef/browser/audio_capturer.h b/libcef/browser/audio_capturer.h index c38e01ddd..cdd2911a8 100644 --- a/libcef/browser/audio_capturer.h +++ b/libcef/browser/audio_capturer.h @@ -31,6 +31,7 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback { void OnCaptureStarted() override; void Capture(const media::AudioBus* audio_source, base::TimeTicks audio_capture_time, + const media::AudioGlitchInfo& glitch_info, double volume, bool key_pressed) override; void OnCaptureError(media::AudioCapturerSource::ErrorCode code, @@ -48,4 +49,4 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback { int channels_ = 0; }; -#endif // CEF_LIBCEF_BROWSER_AUDIO_CAPTURER_H_ \ No newline at end of file +#endif // CEF_LIBCEF_BROWSER_AUDIO_CAPTURER_H_ diff --git a/libcef/browser/audio_loopback_stream_creator.cc b/libcef/browser/audio_loopback_stream_creator.cc index 7ad284d69..3668d690b 100644 --- a/libcef/browser/audio_loopback_stream_creator.cc +++ b/libcef/browser/audio_loopback_stream_creator.cc @@ -48,7 +48,7 @@ class StreamCreatedCallbackAdapter final client_receiver, media::mojom::ReadOnlyAudioDataPipePtr data_pipe, bool initially_muted, - const absl::optional& stream_id) override { + const std::optional& stream_id) override { DCHECK(!initially_muted); // Loopback streams shouldn't be started muted. callback_.Run(std::move(stream), std::move(client_receiver), std::move(data_pipe)); diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 654f8af2c..664447f6d 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -158,7 +158,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes( bool include_defaults) { if (schemes_list.empty() && include_defaults) { // No explicit registration of schemes. - return absl::nullopt; + return std::nullopt; } std::vector all_schemes; @@ -177,7 +177,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes( all_schemes.push_back("wss"); } - return absl::make_optional(all_schemes); + return std::make_optional(all_schemes); } template diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 7d02e17de..754392286 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_ #pragma once +#include #include #include @@ -19,7 +20,6 @@ #include "base/task/sequenced_task_runner_helpers.h" #include "chrome/common/plugin.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" -#include "third_party/abseil-cpp/absl/types/optional.h" #include "url/origin.h" /* @@ -187,7 +187,7 @@ class CefBrowserContext { CefRefPtr GetAnyRequestContext( bool prefer_no_handler) const; - using CookieableSchemes = absl::optional>; + using CookieableSchemes = std::optional>; // Returns the schemes associated with this context specifically, or the // global configuration if unset. diff --git a/libcef/browser/browser_frame.cc b/libcef/browser/browser_frame.cc index 9b354d615..daf03eadf 100644 --- a/libcef/browser/browser_frame.cc +++ b/libcef/browser/browser_frame.cc @@ -63,7 +63,7 @@ void CefBrowserFrame::FrameAttached( } void CefBrowserFrame::UpdateDraggableRegions( - absl::optional> regions) { + std::optional> regions) { if (auto host = GetFrameHost()) { host->UpdateDraggableRegions(std::move(regions)); } diff --git a/libcef/browser/browser_frame.h b/libcef/browser/browser_frame.h index a9bf83c99..72379860d 100644 --- a/libcef/browser/browser_frame.h +++ b/libcef/browser/browser_frame.h @@ -42,7 +42,7 @@ class CefBrowserFrame void FrameAttached(mojo::PendingRemote render_frame, bool reattached) override; void UpdateDraggableRegions( - absl::optional> regions) + std::optional> regions) override; // FrameServiceBase methods: diff --git a/libcef/browser/chrome/chrome_browser_context.cc b/libcef/browser/chrome/chrome_browser_context.cc index 5c4c138bc..21efc9b3e 100644 --- a/libcef/browser/chrome/chrome_browser_context.cc +++ b/libcef/browser/chrome/chrome_browser_context.cc @@ -55,8 +55,7 @@ ChromeBrowserContext* ChromeBrowserContext::GetOrCreateForProfile( auto* new_context = new ChromeBrowserContext(settings); new_context->Initialize(); - new_context->ProfileCreated(Profile::CreateStatus::CREATE_STATUS_INITIALIZED, - profile); + new_context->ProfileCreated(CreateStatus::kInitialized, profile); return new_context; } @@ -98,7 +97,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { if (cache_path_ == user_data_dir) { // Use the default disk-based profile. auto profile = GetPrimaryUserProfile(); - ProfileCreated(Profile::CreateStatus::CREATE_STATUS_INITIALIZED, profile); + ProfileCreated(CreateStatus::kInitialized, profile); return; } else if (cache_path_.DirName() == user_data_dir) { // Create or load a specific disk-based profile. May continue @@ -107,10 +106,10 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { cache_path_, base::BindOnce(&ChromeBrowserContext::ProfileCreated, weak_ptr_factory_.GetWeakPtr(), - Profile::CreateStatus::CREATE_STATUS_INITIALIZED), + CreateStatus::kInitialized), base::BindOnce(&ChromeBrowserContext::ProfileCreated, weak_ptr_factory_.GetWeakPtr(), - Profile::CreateStatus::CREATE_STATUS_CREATED)); + CreateStatus::kCreated)); return; } else { // All profile directories must be relative to |user_data_dir|. @@ -120,7 +119,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { } // Default to creating a new/unique OffTheRecord profile. - ProfileCreated(Profile::CreateStatus::CREATE_STATUS_LOCAL_FAIL, nullptr); + ProfileCreated(CreateStatus::kDefault, nullptr); } void ChromeBrowserContext::Shutdown() { @@ -140,13 +139,13 @@ void ChromeBrowserContext::Shutdown() { } } -void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status, +void ChromeBrowserContext::ProfileCreated(CreateStatus status, Profile* profile) { Profile* parent_profile = nullptr; OffTheRecordProfileImpl* otr_profile = nullptr; - if (status != Profile::CreateStatus::CREATE_STATUS_CREATED && - status != Profile::CreateStatus::CREATE_STATUS_INITIALIZED) { + if (status != CreateStatus::kCreated && + status != CreateStatus::kInitialized) { CHECK(!profile); CHECK(!profile_); @@ -160,7 +159,7 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status, profile_ = parent_profile->GetOffTheRecordProfile( profile_id, /*create_if_needed=*/true); otr_profile = static_cast(profile_); - status = Profile::CreateStatus::CREATE_STATUS_INITIALIZED; + status = CreateStatus::kInitialized; should_destroy_ = true; } else if (profile && !profile_) { // May be CREATE_STATUS_CREATED or CREATE_STATUS_INITIALIZED since @@ -174,7 +173,7 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status, } } - if (status == Profile::CreateStatus::CREATE_STATUS_INITIALIZED) { + if (status == CreateStatus::kInitialized) { CHECK(profile_); // Must set |profile_| before Init() calls diff --git a/libcef/browser/chrome/chrome_browser_context.h b/libcef/browser/chrome/chrome_browser_context.h index be893a9e4..9c4da9b6f 100644 --- a/libcef/browser/chrome/chrome_browser_context.h +++ b/libcef/browser/chrome/chrome_browser_context.h @@ -41,7 +41,16 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver { private: ~ChromeBrowserContext() override; - void ProfileCreated(Profile::CreateStatus status, Profile* profile); + enum class CreateStatus { + // Default to creating a new/unique OffTheRecord profile. + kDefault, + // Profile created but before initializing extensions and promo resources. + kCreated, + // Profile is created, extensions and promo resources are initialized. + kInitialized, + }; + + void ProfileCreated(CreateStatus status, Profile* profile); base::OnceClosure initialized_cb_; Profile* profile_ = nullptr; diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 5b7dad330..b3ce74ffd 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -7,13 +7,12 @@ #pragma once #include +#include #include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_info.h" #include "libcef/browser/chrome/browser_delegate.h" -#include "third_party/abseil-cpp/absl/types/optional.h" - class CefBrowserContentsDelegate; class CefRequestContextImpl; class CefWindowImpl; diff --git a/libcef/browser/chrome/chrome_context_menu_handler.cc b/libcef/browser/chrome/chrome_context_menu_handler.cc index c4d7b604c..a4cc83827 100644 --- a/libcef/browser/chrome/chrome_context_menu_handler.cc +++ b/libcef/browser/chrome/chrome_context_menu_handler.cc @@ -117,7 +117,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, } void SetAccelerator(int command_id, - absl::optional accel) override { + std::optional accel) override { // No-op if already at the default state. if (!accel && !GetItemInfo(command_id)) { return; @@ -135,7 +135,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, ItemInfo() = default; bool checked = false; - absl::optional accel; + std::optional accel; }; ItemInfo* GetItemInfo(int command_id) { diff --git a/libcef/browser/chrome/views/chrome_browser_view.cc b/libcef/browser/chrome/views/chrome_browser_view.cc index 59f7c0f54..b6c6cbc0b 100644 --- a/libcef/browser/chrome/views/chrome_browser_view.cc +++ b/libcef/browser/chrome/views/chrome_browser_view.cc @@ -71,7 +71,7 @@ void ChromeBrowserView::OnGestureEvent(ui::GestureEvent* event) { ToolbarView* ChromeBrowserView::OverrideCreateToolbar() { if (cef_delegate()) { auto toolbar_type = cef_delegate()->GetChromeToolbarType(cef_browser_view_); - absl::optional display_mode; + std::optional display_mode; switch (toolbar_type) { case CEF_CTT_NORMAL: display_mode = ToolbarView::DisplayMode::NORMAL; diff --git a/libcef/browser/chrome/views/toolbar_view_impl.cc b/libcef/browser/chrome/views/toolbar_view_impl.cc index fcc175523..e66797da2 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.cc +++ b/libcef/browser/chrome/views/toolbar_view_impl.cc @@ -9,7 +9,7 @@ CefRefPtr CefToolbarViewImpl::Create( CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode) { + std::optional display_mode) { CEF_REQUIRE_UIT_RETURN(nullptr); CefRefPtr view = new CefToolbarViewImpl(delegate, browser, browser_view, display_mode); @@ -24,7 +24,7 @@ CefToolbarViewImpl::CefToolbarViewImpl( CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode) + std::optional display_mode) : ParentClass(delegate), browser_(browser), browser_view_(browser_view), diff --git a/libcef/browser/chrome/views/toolbar_view_impl.h b/libcef/browser/chrome/views/toolbar_view_impl.h index 9248614de..63638c904 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.h +++ b/libcef/browser/chrome/views/toolbar_view_impl.h @@ -27,7 +27,7 @@ class CefToolbarViewImpl CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode); + std::optional display_mode); static const char* const kTypeString; @@ -41,7 +41,7 @@ class CefToolbarViewImpl CefToolbarViewImpl(CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode); + std::optional display_mode); // CefViewImpl methods: CefToolbarViewView* CreateRootView() override; @@ -49,7 +49,7 @@ class CefToolbarViewImpl Browser* const browser_; BrowserView* const browser_view_; - absl::optional const display_mode_; + std::optional const display_mode_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); }; diff --git a/libcef/browser/chrome/views/toolbar_view_view.cc b/libcef/browser/chrome/views/toolbar_view_view.cc index ad986bd5e..28bebb8d2 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.cc +++ b/libcef/browser/chrome/views/toolbar_view_view.cc @@ -7,5 +7,5 @@ CefToolbarViewView::CefToolbarViewView(CefViewDelegate* cef_delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode) + std::optional display_mode) : ParentClass(cef_delegate, browser, browser_view, display_mode) {} diff --git a/libcef/browser/chrome/views/toolbar_view_view.h b/libcef/browser/chrome/views/toolbar_view_view.h index 489200081..0fe8eca25 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.h +++ b/libcef/browser/chrome/views/toolbar_view_view.h @@ -18,7 +18,7 @@ class CefToolbarViewView : public CefViewView { explicit CefToolbarViewView(CefViewDelegate* cef_delegate, Browser* browser, BrowserView* browser_view, - absl::optional display_mode); + std::optional display_mode); CefToolbarViewView(const CefToolbarViewView&) = delete; CefToolbarViewView& operator=(const CefToolbarViewView&) = delete; diff --git a/libcef/browser/devtools/devtools_file_manager.cc b/libcef/browser/devtools/devtools_file_manager.cc index 1b0a0b18d..2865c3566 100644 --- a/libcef/browser/devtools/devtools_file_manager.cc +++ b/libcef/browser/devtools/devtools_file_manager.cc @@ -82,7 +82,7 @@ void CefDevToolsFileManager::Save(const std::string& url, base::FilePath initial_path; if (const base::Value* path_value = file_map.Find(base::MD5String(url))) { - absl::optional path = base::ValueToFilePath(*path_value); + std::optional path = base::ValueToFilePath(*path_value); if (path) { initial_path = std::move(*path); } diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index a4fbd59ec..8f7a476cc 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -414,7 +414,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( // TODO(pfeldman): handle some of the embedder messages in content. const std::string* url = params[0].GetIfString(); const std::string* headers = params[1].GetIfString(); - absl::optional stream_id = params[2].GetIfInt(); + std::optional stream_id = params[2].GetIfInt(); if (!url || !headers || !stream_id.has_value()) { return; } @@ -540,7 +540,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( } const std::string* url = params[0].GetIfString(); const std::string* content = params[1].GetIfString(); - absl::optional save_as = params[2].GetIfBool(); + std::optional save_as = params[2].GetIfBool(); if (!url || !content || !save_as.has_value()) { return; } diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index f0ef42e51..d350f9798 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -68,7 +68,7 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() { TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {} ExtensionFunction::ResponseAction TabsCreateFunction::Run() { - absl::optional params = + std::optional params = tabs::Create::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -108,7 +108,7 @@ content::WebContents* BaseAPIFunction::GetWebContents(int tab_id) { } ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { - absl::optional params = + std::optional params = tabs::Update::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -391,7 +391,7 @@ void ExecuteCodeInTabFunction::LoadFileComplete( const std::string& file, std::unique_ptr data) { std::vector> data_list; - absl::optional error; + std::optional error; const bool success = !!data.get(); if (success) { DCHECK(data); @@ -411,7 +411,7 @@ bool TabsRemoveCSSFunction::ShouldRemoveCSS() const { } ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { - absl::optional params = + std::optional params = tabs::SetZoom::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -443,7 +443,7 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { } ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { - absl::optional params = + std::optional params = tabs::GetZoom::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -463,7 +463,7 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { using tabs::ZoomSettings; - absl::optional params = + std::optional params = tabs::SetZoomSettings::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); @@ -514,7 +514,7 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { } ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() { - absl::optional params = + std::optional params = tabs::GetZoomSettings::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/libcef/browser/extensions/extension_function_details.h b/libcef/browser/extensions/extension_function_details.h index e47b3b48e..90d7f7800 100644 --- a/libcef/browser/extensions/extension_function_details.h +++ b/libcef/browser/extensions/extension_function_details.h @@ -99,13 +99,13 @@ class CefExtensionFunctionDetails { ~OpenTabParams(); bool create_browser_if_needed = false; - absl::optional window_id; - absl::optional opener_tab_id; - absl::optional url; - absl::optional active; - absl::optional pinned; - absl::optional index; - absl::optional bookmark_id; + std::optional window_id; + std::optional opener_tab_id; + std::optional url; + std::optional active; + std::optional pinned; + std::optional index; + std::optional bookmark_id; }; // Opens a new tab given creation parameters |params|. Returns a Tab object diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 80eb16ec0..2e8a9270a 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -58,7 +58,7 @@ namespace extensions { namespace { // Implementation based on ComponentLoader::ParseManifest. -absl::optional ParseManifest( +std::optional ParseManifest( base::StringPiece manifest_contents) { JSONStringValueDeserializer deserializer(manifest_contents); std::unique_ptr manifest = @@ -66,7 +66,7 @@ absl::optional ParseManifest( if (!manifest.get() || !manifest->is_dict()) { LOG(ERROR) << "Failed to parse extension manifest."; - return absl::nullopt; + return std::nullopt; } return std::move(*manifest).TakeDict(); diff --git a/libcef/browser/extensions/value_store/cef_value_store.cc b/libcef/browser/extensions/value_store/cef_value_store.cc index 0609d6166..45e5949d6 100644 --- a/libcef/browser/extensions/value_store/cef_value_store.cc +++ b/libcef/browser/extensions/value_store/cef_value_store.cc @@ -100,8 +100,8 @@ ValueStore::WriteResult CefValueStore::Set(WriteOptions options, if (!old_value || *old_value != value) { changes.emplace_back(key, old_value - ? absl::optional(old_value->Clone()) - : absl::nullopt, + ? std::optional(old_value->Clone()) + : std::nullopt, value.Clone()); storage_.Set(key, value.Clone()); } @@ -122,9 +122,9 @@ ValueStore::WriteResult CefValueStore::Remove( ValueStoreChangeList changes; for (auto const& key : keys) { - absl::optional old_value = storage_.Extract(key); + std::optional old_value = storage_.Extract(key); if (old_value.has_value()) { - changes.emplace_back(key, std::move(*old_value), absl::nullopt); + changes.emplace_back(key, std::move(*old_value), std::nullopt); } } return WriteResult(std::move(changes), CreateStatusCopy(status_)); diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index cf7756114..414d3cf20 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -118,7 +118,7 @@ FileChooserParams SelectFileToFileChooserParams( const ui::SelectFileDialog::FileTypeInfo* file_types) { FileChooserParams params; - absl::optional mode; + std::optional mode; switch (type) { case ui::SelectFileDialog::Type::SELECT_UPLOAD_FOLDER: mode = FileChooserParams::Mode::kUploadFolder; diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index 293c3d9b9..40e9c8363 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -692,7 +692,7 @@ void CefFrameHostImpl::FrameAttached( } void CefFrameHostImpl::UpdateDraggableRegions( - absl::optional> regions) { + std::optional> regions) { auto browser = GetBrowserHostBase(); if (!browser) { return; diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index 00035512b..2f8a9e844 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -154,7 +154,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { void FrameAttached(mojo::PendingRemote render_frame, bool reattached) override; void UpdateDraggableRegions( - absl::optional> regions) + std::optional> regions) override; bool is_temporary() const { return !frame_token_.has_value(); } diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index 329643921..ce05a7a59 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -45,9 +45,9 @@ CefMediaCaptureDevicesDispatcher::~CefMediaCaptureDevicesDispatcher() = default; void CefMediaCaptureDevicesDispatcher::RegisterPrefs( PrefRegistrySimple* registry) { - registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice, + registry->RegisterStringPref(prefs::kDefaultAudioCaptureDeviceDeprecated, std::string()); - registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice, + registry->RegisterStringPref(prefs::kDefaultVideoCaptureDeviceDeprecated, std::string()); } @@ -61,12 +61,14 @@ void CefMediaCaptureDevicesDispatcher::GetDefaultDevices( std::string default_device; if (audio) { - default_device = prefs->GetString(prefs::kDefaultAudioCaptureDevice); + default_device = + prefs->GetString(prefs::kDefaultAudioCaptureDeviceDeprecated); GetRequestedDevice(default_device, true, false, devices); } if (video) { - default_device = prefs->GetString(prefs::kDefaultVideoCaptureDevice); + default_device = + prefs->GetString(prefs::kDefaultVideoCaptureDeviceDeprecated); GetRequestedDevice(default_device, false, true, devices); } } diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 4905eaece..4a1f40d61 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -88,9 +88,9 @@ class RequestManager { map_.erase(it); } - absl::optional Get(int32_t request_id) { + std::optional Get(int32_t request_id) { if (request_id > kInitialRequestID) { - return absl::nullopt; + return std::nullopt; } base::AutoLock lock_scope(lock_); @@ -98,7 +98,7 @@ class RequestManager { if (it != map_.end()) { return it->second; } - return absl::nullopt; + return std::nullopt; } private: @@ -608,16 +608,16 @@ class CefBrowserURLRequest::Context // CefBrowserURLRequest ------------------------------------------------------- // static -absl::optional +std::optional CefBrowserURLRequest::FromRequestID(int32_t request_id) { if (IsValidRequestID(request_id)) { return g_manager.Get().Get(request_id); } - return absl::nullopt; + return std::nullopt; } // static -absl::optional +std::optional CefBrowserURLRequest::FromRequestID( const content::GlobalRequestID& request_id) { return FromRequestID(request_id.request_id); diff --git a/libcef/browser/net_service/browser_urlrequest_impl.h b/libcef/browser/net_service/browser_urlrequest_impl.h index 21843b9b5..f166a65b7 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.h +++ b/libcef/browser/net_service/browser_urlrequest_impl.h @@ -6,11 +6,10 @@ #define CEF_LIBCEF_BROWSER_NET_SERVICE_BROWSER_URLREQUEST_IMPL_H_ #include +#include #include "include/cef_urlrequest.h" -#include "third_party/abseil-cpp/absl/types/optional.h" - namespace content { struct GlobalRequestID; } @@ -27,8 +26,8 @@ class CefBrowserURLRequest : public CefURLRequest { CefRefPtr>; // Retrieve the request objects, if any, associated with |request_id|. - static absl::optional FromRequestID(int32_t request_id); - static absl::optional FromRequestID( + static std::optional FromRequestID(int32_t request_id); + static std::optional FromRequestID( const content::GlobalRequestID& request_id); // If |frame| is nullptr requests can still be intercepted but no diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index dd6cd2835..e16182473 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -212,7 +212,7 @@ void SaveCookiesOnUIThread( bool IsCookieableScheme( const GURL& url, - const absl::optional>& cookieable_schemes) { + const std::optional>& cookieable_schemes) { if (!url.has_scheme()) { return false; } @@ -298,8 +298,8 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter, net::CookieInclusionStatus returned_status; std::unique_ptr cookie = net::CanonicalCookie::Create( request.url, cookie_string, base::Time::Now(), - absl::make_optional(response_date), - /*cookie_partition_key=*/absl::nullopt, + std::make_optional(response_date), + /*cookie_partition_key=*/std::nullopt, /*block_truncated=*/true, &returned_status); if (!returned_status.IsInclude()) { continue; diff --git a/libcef/browser/net_service/cookie_helper.h b/libcef/browser/net_service/cookie_helper.h index 323644a89..14ab0cf79 100644 --- a/libcef/browser/net_service/cookie_helper.h +++ b/libcef/browser/net_service/cookie_helper.h @@ -25,7 +25,7 @@ namespace net_service::cookie_helper { // cookieable, which may intentionally exclude standard schemes. bool IsCookieableScheme( const GURL& url, - const absl::optional>& cookieable_schemes); + const std::optional>& cookieable_schemes); using AllowCookieCallback = base::RepeatingCallback browser, - absl::optional url_request_info, + std::optional url_request_info, const net::AuthChallengeInfo& auth_info, const GURL& origin_url, CefRefPtr callback_impl) { @@ -144,7 +144,7 @@ void LoginDelegate::Continue(const CefString& username, void LoginDelegate::Cancel() { CEF_REQUIRE_UIT(); if (!callback_.is_null()) { - std::move(callback_).Run(absl::nullopt); + std::move(callback_).Run(std::nullopt); } } @@ -171,4 +171,4 @@ void LoginDelegate::Start(CefRefPtr browser, } } -} // namespace net_service \ No newline at end of file +} // namespace net_service diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 3e4fe4a73..27d640eab 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -40,12 +40,12 @@ namespace { // User data key for ResourceContextData. const void* const kResourceContextUserDataKey = &kResourceContextUserDataKey; -absl::optional GetHeaderString( +std::optional GetHeaderString( const net::HttpResponseHeaders* headers, const std::string& header_name) { std::string header_value; if (!headers || !headers->GetNormalizedHeader(header_name, &header_value)) { - return absl::nullopt; + return std::nullopt; } return header_value; } @@ -247,7 +247,7 @@ class InterceptedRequest : public network::mojom::URLLoader, void OnReceiveResponse( network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle body, - absl::optional cached_metadata) override; + std::optional cached_metadata) override; void OnReceiveRedirect(const net::RedirectInfo& redirect_info, network::mojom::URLResponseHeadPtr head) override; void OnUploadProgress(int64_t current_position, @@ -261,7 +261,7 @@ class InterceptedRequest : public network::mojom::URLLoader, const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const absl::optional& new_url) override; + const std::optional& new_url) override; void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override; void PauseReadingBodyFromNet() override; @@ -282,7 +282,7 @@ class InterceptedRequest : public network::mojom::URLLoader, // Helpers for optionally overriding headers. void HandleResponseOrRedirectHeaders( - absl::optional redirect_info, + std::optional redirect_info, net::CompletionOnceCallback continuation); void ContinueResponseOrRedirect( net::CompletionOnceCallback continuation, @@ -352,7 +352,7 @@ class InterceptedRequest : public network::mojom::URLLoader, network::ResourceRequest request_; network::mojom::URLResponseHeadPtr current_response_; mojo::ScopedDataPipeConsumerHandle current_body_; - absl::optional current_cached_metadata_; + std::optional current_cached_metadata_; scoped_refptr current_headers_; scoped_refptr override_headers_; GURL original_url_; @@ -450,7 +450,7 @@ InterceptedRequest::~InterceptedRequest() { } if (on_headers_received_callback_) { std::move(on_headers_received_callback_) - .Run(net::ERR_ABORTED, absl::nullopt, GURL()); + .Run(net::ERR_ABORTED, std::nullopt, GURL()); } } @@ -579,12 +579,12 @@ void InterceptedRequest::OnBeforeSendHeaders( const net::HttpRequestHeaders& headers, OnBeforeSendHeadersCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, absl::nullopt); + std::move(callback).Run(net::OK, std::nullopt); return; } request_.headers = headers; - std::move(callback).Run(net::OK, absl::nullopt); + std::move(callback).Run(net::OK, std::nullopt); // Resume handling of client messages after continuing from an async callback. if (proxied_client_receiver_.is_bound()) { @@ -597,14 +597,14 @@ void InterceptedRequest::OnHeadersReceived( const net::IPEndPoint& remote_endpoint, OnHeadersReceivedCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, absl::nullopt, GURL()); + std::move(callback).Run(net::OK, std::nullopt, GURL()); return; } current_headers_ = base::MakeRefCounted(headers); on_headers_received_callback_ = std::move(callback); - absl::optional redirect_info; + std::optional redirect_info; std::string location; if (current_headers_->IsRedirect(&location)) { const GURL new_url = request_.url.Resolve(location); @@ -628,7 +628,7 @@ void InterceptedRequest::OnReceiveEarlyHints( void InterceptedRequest::OnReceiveResponse( network::mojom::URLResponseHeadPtr head, mojo::ScopedDataPipeConsumerHandle body, - absl::optional cached_metadata) { + std::optional cached_metadata) { current_response_ = std::move(head); current_body_ = std::move(body); current_cached_metadata_ = std::move(cached_metadata); @@ -643,7 +643,7 @@ void InterceptedRequest::OnReceiveResponse( ContinueToResponseStarted(net::OK); } else { HandleResponseOrRedirectHeaders( - absl::nullopt, + std::nullopt, base::BindOnce(&InterceptedRequest::ContinueToResponseStarted, weak_factory_.GetWeakPtr())); } @@ -743,7 +743,7 @@ void InterceptedRequest::FollowRedirect( const std::vector& removed_headers_ext, const net::HttpRequestHeaders& modified_headers_ext, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const absl::optional& new_url) { + const std::optional& new_url) { std::vector removed_headers = removed_headers_ext; net::HttpRequestHeaders modified_headers = modified_headers_ext; OnProcessRequestHeaders(new_url.value_or(GURL()), &modified_headers, @@ -894,7 +894,7 @@ void InterceptedRequest::ContinueAfterInterceptWithOverride( } void InterceptedRequest::HandleResponseOrRedirectHeaders( - absl::optional redirect_info, + std::optional redirect_info, net::CompletionOnceCallback continuation) { override_headers_ = nullptr; redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL(); @@ -957,7 +957,7 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) { } DCHECK(on_headers_received_callback_); - absl::optional headers; + std::optional headers; if (override_headers_) { headers = override_headers_->raw_headers(); } @@ -1056,8 +1056,8 @@ void InterceptedRequest::ContinueToBeforeRedirect( bool should_clear_upload; net::RedirectUtil::UpdateHttpRequest(original_url, original_method, new_redirect_info, - absl::make_optional(remove_headers), - /*modified_headers=*/absl::nullopt, + std::make_optional(remove_headers), + /*modified_headers=*/std::nullopt, &request_.headers, &should_clear_upload); if (should_clear_upload) { @@ -1275,7 +1275,7 @@ void InterceptedRequestHandler::OnRequestResponse( int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, - absl::optional redirect_info, + std::optional redirect_info, OnRequestResponseResultCallback callback) { std::move(callback).Run( ResponseMode::CONTINUE, nullptr, diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 499a06e1a..4f77e1925 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -8,6 +8,8 @@ #include "libcef/browser/net_service/stream_reader_url_loader.h" +#include + #include "base/containers/unique_ptr_adapters.h" #include "base/functional/callback.h" #include "base/hash/hash.h" @@ -19,7 +21,6 @@ #include "services/network/public/cpp/url_loader_factory_builder.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" -#include "third_party/abseil-cpp/absl/types/optional.h" namespace content { class ResourceContext; @@ -105,12 +106,11 @@ class InterceptedRequestHandler { ResponseMode /* response_mode */, scoped_refptr /* override_headers */, const GURL& /* redirect_url */)>; - virtual void OnRequestResponse( - int32_t request_id, - network::ResourceRequest* request, - net::HttpResponseHeaders* headers, - absl::optional redirect_info, - OnRequestResponseResultCallback callback); + virtual void OnRequestResponse(int32_t request_id, + network::ResourceRequest* request, + net::HttpResponseHeaders* headers, + std::optional redirect_info, + OnRequestResponseResultCallback callback); // Called to optionally filter the response body. virtual mojo::ScopedDataPipeConsumerHandle OnFilterResponseBody( diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index e643ffb4b..2eb5b3e55 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -841,7 +841,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { void OnRequestResponse(int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, - absl::optional redirect_info, + std::optional redirect_info, OnRequestResponseResultCallback callback) override { CEF_REQUIRE_IOT(); diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index 1372f1c08..353058008 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -475,7 +475,7 @@ StreamReaderURLLoader::StreamReaderURLLoader( mojo::PendingRemote client, mojo::PendingRemote header_client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, - absl::optional cached_metadata, + std::optional cached_metadata, std::unique_ptr response_delegate) : request_id_(request_id), request_(request), @@ -520,13 +520,13 @@ void StreamReaderURLLoader::Start() { base::BindOnce(&StreamReaderURLLoader::ContinueWithRequestHeaders, weak_factory_.GetWeakPtr())); } else { - ContinueWithRequestHeaders(net::OK, absl::nullopt); + ContinueWithRequestHeaders(net::OK, std::nullopt); } } void StreamReaderURLLoader::ContinueWithRequestHeaders( int32_t result, - const absl::optional& headers) { + const std::optional& headers) { if (result != net::OK) { RequestComplete(result); return; @@ -552,7 +552,7 @@ void StreamReaderURLLoader::FollowRedirect( const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const absl::optional& new_url) { + const std::optional& new_url) { DCHECK(false); } @@ -665,15 +665,15 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code, std::move(pending_response))); } else { ContinueWithResponseHeaders(std::move(pending_response), net::OK, - absl::nullopt, absl::nullopt); + std::nullopt, std::nullopt); } } void StreamReaderURLLoader::ContinueWithResponseHeaders( network::mojom::URLResponseHeadPtr pending_response, int32_t result, - const absl::optional& headers, - const absl::optional& redirect_url) { + const std::optional& headers, + const std::optional& redirect_url) { if (result != net::OK) { RequestComplete(result); return; diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 81b827650..5c1ac58fc 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -117,7 +117,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { mojo::PendingRemote client, mojo::PendingRemote header_client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, - absl::optional cached_metadata, + std::optional cached_metadata, std::unique_ptr response_delegate); StreamReaderURLLoader(const StreamReaderURLLoader&) = delete; @@ -132,7 +132,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const absl::optional& new_url) override; + const std::optional& new_url) override; void SetPriority(net::RequestPriority priority, int intra_priority_value) override; void PauseReadingBodyFromNet() override; @@ -141,7 +141,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { private: void ContinueWithRequestHeaders( int32_t result, - const absl::optional& headers); + const std::optional& headers); void OnInputStreamOpened(std::unique_ptr returned_delegate, std::unique_ptr input_stream); @@ -150,8 +150,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { void ContinueWithResponseHeaders( network::mojom::URLResponseHeadPtr pending_response, int32_t result, - const absl::optional& headers, - const absl::optional& redirect_url); + const std::optional& headers, + const std::optional& redirect_url); void ReadMore(); void OnDataPipeWritable(MojoResult result); @@ -173,7 +173,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { mojo::Remote client_; mojo::Remote header_client_; const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; - absl::optional cached_metadata_; + std::optional cached_metadata_; std::unique_ptr response_delegate_; scoped_refptr input_stream_reader_; diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index 5ea4e3cb3..adb48a75a 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -55,7 +55,7 @@ scoped_refptr URLLoaderFactoryGetter::Create( browser_client->WillCreateURLLoaderFactory( browser_context, render_frame_host, render_process_id, content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, - url::Origin(), absl::nullopt /* navigation_id */, ukm::SourceIdObj(), + url::Origin(), std::nullopt /* navigation_id */, ukm::SourceIdObj(), factory_builder, nullptr /* header_client */, nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, nullptr /* factory_override */, diff --git a/libcef/browser/origin_whitelist_impl.cc b/libcef/browser/origin_whitelist_impl.cc index b2ff3d606..a6738e66b 100644 --- a/libcef/browser/origin_whitelist_impl.cc +++ b/libcef/browser/origin_whitelist_impl.cc @@ -107,7 +107,7 @@ class CefOriginWhitelistManager { } void GetCrossOriginWhitelistEntries( - absl::optional* entries) const { + std::optional* entries) const { base::AutoLock lock_scope(lock_); if (!origin_list_.empty()) { @@ -289,7 +289,7 @@ bool CefClearCrossOriginWhitelist() { } void GetCrossOriginWhitelistEntries( - absl::optional* entries) { + std::optional* entries) { CefOriginWhitelistManager::GetInstance()->GetCrossOriginWhitelistEntries( entries); } diff --git a/libcef/browser/origin_whitelist_impl.h b/libcef/browser/origin_whitelist_impl.h index c5f8236dc..9b2d712e1 100644 --- a/libcef/browser/origin_whitelist_impl.h +++ b/libcef/browser/origin_whitelist_impl.h @@ -5,10 +5,9 @@ #ifndef CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_ #define CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_ +#include #include -#include "third_party/abseil-cpp/absl/types/optional.h" - #include "cef/libcef/common/mojom/cef.mojom-forward.h" namespace content { @@ -25,7 +24,7 @@ using CrossOriginWhiteList = // Called to retrieve the current list of cross-origin white list entries. This // method is thread safe. void GetCrossOriginWhitelistEntries( - absl::optional* entries); + std::optional* entries); // Returns true if |source| can access |target| based on the cross-origin white // list settings. diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index bff17184b..f023abc7c 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -184,6 +184,20 @@ struct PopulateAxNodeAttributes { attributes->SetString(ToString(attr.first), ToString(state)); } } break; + case ax::mojom::IntAttribute::kAriaNotificationInterruptDeprecated: { + auto state = + static_cast(attr.second); + if (ax::mojom::AriaNotificationInterrupt::kNone != state) { + attributes->SetString(ToString(attr.first), ToString(state)); + } + } break; + case ax::mojom::IntAttribute::kAriaNotificationPriorityDeprecated: { + auto state = + static_cast(attr.second); + if (ax::mojom::AriaNotificationPriority::kNone != state) { + attributes->SetString(ToString(attr.first), ToString(state)); + } + } break; case ax::mojom::IntAttribute::kTextDirection: { auto state = static_cast(attr.second); if (ax::mojom::WritingDirection::kNone != state) { diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 4f9c33755..70afb20d4 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -28,7 +28,6 @@ #include "content/browser/renderer_host/text_input_manager.h" #include "content/public/browser/render_frame_metadata_provider.h" #include "content/public/common/widget_type.h" -#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/widget/record_content_to_visible_time_request.mojom-forward.h" #include "ui/base/cursor/cursor.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" diff --git a/libcef/browser/osr/video_consumer_osr.cc b/libcef/browser/osr/video_consumer_osr.cc index 055cd6630..98c7b5276 100644 --- a/libcef/browser/osr/video_consumer_osr.cc +++ b/libcef/browser/osr/video_consumer_osr.cc @@ -67,7 +67,7 @@ void CefVideoConsumerOSR::SizeChanged(const gfx::Size& size_in_pixels) { } void CefVideoConsumerOSR::RequestRefreshFrame( - const absl::optional& bounds_in_pixels) { + const std::optional& bounds_in_pixels) { bounds_in_pixels_ = bounds_in_pixels; video_capturer_->RequestRefreshFrame(); } @@ -126,7 +126,7 @@ void CefVideoConsumerOSR::OnFrameCaptured( // Use the bounds passed to RequestRefreshFrame(). damage_rect = gfx::Rect(info->coded_size); damage_rect.Intersect(*bounds_in_pixels_); - bounds_in_pixels_ = absl::nullopt; + bounds_in_pixels_ = std::nullopt; } else { // Retrieve the rectangular region of the frame that has changed since the // frame with the directly preceding CAPTURE_COUNTER. If that frame was not diff --git a/libcef/browser/osr/video_consumer_osr.h b/libcef/browser/osr/video_consumer_osr.h index 48ff52715..1b66c8890 100644 --- a/libcef/browser/osr/video_consumer_osr.h +++ b/libcef/browser/osr/video_consumer_osr.h @@ -1,10 +1,11 @@ #ifndef LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ #define LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ +#include + #include "base/functional/callback.h" #include "components/viz/host/client_frame_sink_video_capturer.h" #include "media/capture/mojom/video_capture_types.mojom.h" -#include "third_party/abseil-cpp/absl/types/optional.h" class CefRenderWidgetHostViewOSR; @@ -20,7 +21,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { void SetActive(bool active); void SetFrameRate(base::TimeDelta frame_rate); void SizeChanged(const gfx::Size& size_in_pixels); - void RequestRefreshFrame(const absl::optional& bounds_in_pixels); + void RequestRefreshFrame(const std::optional& bounds_in_pixels); private: // viz::mojom::FrameSinkVideoConsumer implementation. @@ -40,7 +41,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { std::unique_ptr video_capturer_; gfx::Size size_in_pixels_; - absl::optional bounds_in_pixels_; + std::optional bounds_in_pixels_; }; #endif // LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ diff --git a/libcef/browser/permission_prompt.cc b/libcef/browser/permission_prompt.cc index 4ef5584f3..ec6594748 100644 --- a/libcef/browser/permission_prompt.cc +++ b/libcef/browser/permission_prompt.cc @@ -125,8 +125,8 @@ class CefPermissionPrompt : public permissions::PermissionPrompt { const override { return permissions::PermissionPromptDisposition::CUSTOM_MODAL_DIALOG; } - absl::optional GetViewBoundsInScreen() const override { - return absl::nullopt; + std::optional GetViewBoundsInScreen() const override { + return std::nullopt; } bool ShouldFinalizeRequestAfterDecided() const override { return true; } @@ -201,12 +201,12 @@ cef_permission_request_types_t GetCefRequestType( return CEF_PERMISSION_TYPE_LOCAL_FONTS; case permissions::RequestType::kGeolocation: return CEF_PERMISSION_TYPE_GEOLOCATION; + case permissions::RequestType::kIdentityProvider: + return CEF_PERMISSION_TYPE_IDENTITY_PROVIDER; case permissions::RequestType::kIdleDetection: return CEF_PERMISSION_TYPE_IDLE_DETECTION; case permissions::RequestType::kMicStream: return CEF_PERMISSION_TYPE_MIC_STREAM; - case permissions::RequestType::kMidi: - return CEF_PERMISSION_TYPE_MIDI; case permissions::RequestType::kMidiSysex: return CEF_PERMISSION_TYPE_MIDI_SYSEX; case permissions::RequestType::kMultipleDownloads: diff --git a/libcef/browser/printing/print_util.cc b/libcef/browser/printing/print_util.cc index 9c923e472..4f91db993 100644 --- a/libcef/browser/printing/print_util.cc +++ b/libcef/browser/printing/print_util.cc @@ -65,7 +65,7 @@ void PrintToPDF(content::WebContents* web_contents, const bool display_header_footer = !!settings.display_header_footer; // Defaults to no header/footer. - absl::optional header_template, footer_template; + std::optional header_template, footer_template; if (display_header_footer) { if (settings.header_template.length > 0) { header_template = CefString(&settings.header_template); @@ -76,20 +76,20 @@ void PrintToPDF(content::WebContents* web_contents, } // Defaults to 1.0. - absl::optional scale; + std::optional scale; if (settings.scale > 0) { scale = settings.scale; } // Defaults to letter size. - absl::optional paper_width, paper_height; + std::optional paper_width, paper_height; if (settings.paper_width > 0 && settings.paper_height > 0) { paper_width = settings.paper_width; paper_height = settings.paper_height; } // Defaults to kDefaultMarginInInches. - absl::optional margin_top, margin_bottom, margin_left, margin_right; + std::optional margin_top, margin_bottom, margin_left, margin_right; if (settings.margin_type == PDF_PRINT_MARGIN_NONE) { margin_top = 0; margin_bottom = 0; diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 930ed7017..c020f584d 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -50,7 +50,7 @@ class ResolveHostHelper : public network::ResolveHostClientBase { host_resolver_.set_disconnect_handler(base::BindOnce( &ResolveHostHelper::OnComplete, base::Unretained(this), net::ERR_FAILED, - net::ResolveErrorInfo(net::ERR_FAILED), absl::nullopt, absl::nullopt)); + net::ResolveErrorInfo(net::ERR_FAILED), std::nullopt, std::nullopt)); host_resolver_->ResolveHost( network::mojom::HostResolverHost::NewHostPortPair( @@ -62,8 +62,8 @@ class ResolveHostHelper : public network::ResolveHostClientBase { private: void OnComplete(int result, const net::ResolveErrorInfo& resolve_error_info, - const absl::optional& resolved_addresses, - const absl::optional& + const std::optional& resolved_addresses, + const std::optional& endpoint_results_with_metadat) override { CEF_REQUIRE_UIT(); @@ -586,9 +586,6 @@ cef_content_setting_values_t CefRequestContextImpl::GetContentSetting( const CefString& top_level_url, cef_content_setting_types_t content_type) { // Verify that our enums match Chromium's values. - static_assert(static_cast(CEF_CONTENT_SETTING_TYPE_NUM_TYPES) == - static_cast(ContentSettingsType::NUM_TYPES), - "Mismatched enum found for CEF_CONTENT_SETTING_TYPE_NUM_TYPES"); static_assert( static_cast(CEF_CONTENT_SETTING_VALUE_NUM_VALUES) == static_cast(CONTENT_SETTING_NUM_SETTINGS), diff --git a/libcef/browser/simple_menu_model_impl.cc b/libcef/browser/simple_menu_model_impl.cc index 47d6211dd..a75546de2 100644 --- a/libcef/browser/simple_menu_model_impl.cc +++ b/libcef/browser/simple_menu_model_impl.cc @@ -460,7 +460,7 @@ bool CefSimpleMenuModelImpl::RemoveAccelerator(int command_id) { if (!VerifyContext() || command_id == kInvalidIndex) { return false; } - state_delegate_->SetAccelerator(command_id, absl::nullopt); + state_delegate_->SetAccelerator(command_id, std::nullopt); return true; } diff --git a/libcef/browser/simple_menu_model_impl.h b/libcef/browser/simple_menu_model_impl.h index 3d1d15eca..4a9ec3c5a 100644 --- a/libcef/browser/simple_menu_model_impl.h +++ b/libcef/browser/simple_menu_model_impl.h @@ -7,12 +7,12 @@ #define CEF_LIBCEF_BROWSER_SIMPLE_MENU_MODEL_IMPL_H_ #pragma once +#include #include #include "include/cef_menu_model.h" #include "base/threading/platform_thread.h" -#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/models/simple_menu_model.h" // Implementation of CefMenuModel that wraps an existing ui::SimpleMenuModel. @@ -24,7 +24,7 @@ class CefSimpleMenuModelImpl : public CefMenuModel { public: virtual void SetChecked(int command_id, bool checked) = 0; virtual void SetAccelerator(int command_id, - absl::optional accel) = 0; + std::optional accel) = 0; protected: virtual ~StateDelegate() = default; diff --git a/libcef/browser/views/browser_view_impl.cc b/libcef/browser/views/browser_view_impl.cc index 7d15d05b9..42df08b46 100644 --- a/libcef/browser/views/browser_view_impl.cc +++ b/libcef/browser/views/browser_view_impl.cc @@ -5,6 +5,7 @@ #include "libcef/browser/views/browser_view_impl.h" #include +#include #include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_util.h" @@ -15,12 +16,11 @@ #include "libcef/browser/views/window_impl.h" #include "content/public/common/input/native_web_keyboard_event.h" -#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/content_accelerators/accelerator_util.h" namespace { -absl::optional GetGestureCommand( +std::optional GetGestureCommand( ui::GestureEvent* event) { #if BUILDFLAG(IS_MAC) if (event->details().type() == ui::ET_GESTURE_SWIPE) { @@ -31,7 +31,7 @@ absl::optional GetGestureCommand( } } #endif - return absl::nullopt; + return std::nullopt; } } // namespace diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index bdab512f1..e194b4fd1 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -67,6 +67,8 @@ #endif #if BUILDFLAG(IS_WIN) +#include "base/win/scoped_handle.h" +#include "base/win/win_util.h" #include "ui/base/resource/resource_bundle_win.h" #endif @@ -420,10 +422,60 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { // Initialize logging. logging::LoggingSettings log_settings; - const base::FilePath& log_file = - command_line->GetSwitchValuePath(switches::kLogFile); - DCHECK(!log_file.empty()); - log_settings.log_file_path = log_file.value().c_str(); + enum class LoggingDest { + kFile, + kStderr, +#if BUILDFLAG(IS_WIN) + kHandle, +#endif + }; + LoggingDest dest = LoggingDest::kFile; + + if (command_line->GetSwitchValueASCII(switches::kEnableLogging) == "stderr") { + dest = LoggingDest::kStderr; + } + +#if BUILDFLAG(IS_WIN) + // On Windows child process may be given a handle in the --log-file switch. + base::win::ScopedHandle log_handle; + if (command_line->GetSwitchValueASCII(switches::kEnableLogging) == "handle") { + auto handle_str = command_line->GetSwitchValueNative(switches::kLogFile); + uint32_t handle_value = 0; + if (base::StringToUint(handle_str, &handle_value)) { + // This handle is owned by the logging framework and is closed when the + // process exits. + HANDLE duplicate = nullptr; + if (::DuplicateHandle(GetCurrentProcess(), + base::win::Uint32ToHandle(handle_value), + GetCurrentProcess(), &duplicate, 0, FALSE, + DUPLICATE_SAME_ACCESS)) { + log_handle.Set(duplicate); + dest = LoggingDest::kHandle; + } + } + } +#endif // BUILDFLAG(IS_WIN) + + base::FilePath log_file; + if (dest == LoggingDest::kFile) { + log_file = command_line->GetSwitchValuePath(switches::kLogFile); + DCHECK(!log_file.empty()); + } + +#if BUILDFLAG(IS_WIN) + if (dest == LoggingDest::kHandle) { + // TODO(crbug.com/328285906) Use a ScopedHandle in logging settings. + log_settings.log_file = log_handle.release(); + } else { + log_settings.log_file = nullptr; + } +#endif // BUILDFLAG(IS_WIN) + + if (dest == LoggingDest::kFile) { + log_settings.log_file_path = log_file.value().c_str(); + } else { + log_settings.log_file_path = nullptr; + } log_settings.lock_log = logging::DONT_LOCK_LOG_FILE; log_settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE; @@ -458,7 +510,13 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { // level here so that only FATAL messages are output. logging::SetMinLogLevel(logging::LOGGING_FATAL); } else { - log_settings.logging_dest = logging::LOG_TO_ALL; + if (dest == LoggingDest::kStderr) { + log_settings.logging_dest = + logging::LOG_TO_STDERR | logging::LOG_TO_SYSTEM_DEBUG_LOG; + } else { + // Includes both handle or provided filename on Windows. + log_settings.logging_dest = logging::LOG_TO_ALL; + } logging::SetMinLogLevel(log_severity); } diff --git a/libcef/common/json_impl.cc b/libcef/common/json_impl.cc index 1b5dca73f..ae88b922e 100644 --- a/libcef/common/json_impl.cc +++ b/libcef/common/json_impl.cc @@ -47,7 +47,7 @@ CefRefPtr CefParseJSON(const void* json, if (!json || json_size == 0) { return nullptr; } - absl::optional parse_result = base::JSONReader::Read( + std::optional parse_result = base::JSONReader::Read( base::StringPiece(static_cast(json), json_size), GetJSONReaderOptions(options)); if (parse_result) { diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index bfa0da009..cc7d32c91 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -35,9 +35,9 @@ base::RefCountedMemory* CefResourceBundleDelegate::LoadDataResourceBytes( return nullptr; } -absl::optional CefResourceBundleDelegate::LoadDataResourceString( +std::optional CefResourceBundleDelegate::LoadDataResourceString( int resource_id) { - return absl::nullopt; + return std::nullopt; } bool CefResourceBundleDelegate::GetRawDataResource( diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index 1b91b5189..5d552da5f 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -32,7 +32,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { base::RefCountedMemory* LoadDataResourceBytes( int resource_id, ui::ResourceScaleFactor scale_factor) override; - absl::optional LoadDataResourceString(int resource_id) override; + std::optional LoadDataResourceString(int resource_id) override; bool GetRawDataResource(int resource_id, ui::ResourceScaleFactor scale_factor, base::StringPiece* value) const override; diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index 3efe8c97b..8bcbf5703 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -85,7 +85,7 @@ CefValueImpl::~CefValueImpl() = default; void CefValueImpl::SetValue(base::Value value) { base::AutoLock lock_scope(lock_); - SetValueInternal(absl::make_optional(std::move(value))); + SetValueInternal(std::make_optional(std::move(value))); } base::Value CefValueImpl::CopyValue() { @@ -386,26 +386,26 @@ bool CefValueImpl::SetString(const CefString& value) { bool CefValueImpl::SetBinary(CefRefPtr value) { base::AutoLock lock_scope(lock_); - SetValueInternal(absl::nullopt); + SetValueInternal(std::nullopt); binary_value_ = value; return true; } bool CefValueImpl::SetDictionary(CefRefPtr value) { base::AutoLock lock_scope(lock_); - SetValueInternal(absl::nullopt); + SetValueInternal(std::nullopt); dictionary_value_ = value; return true; } bool CefValueImpl::SetList(CefRefPtr value) { base::AutoLock lock_scope(lock_); - SetValueInternal(absl::nullopt); + SetValueInternal(std::nullopt); list_value_ = value; return true; } -void CefValueImpl::SetValueInternal(absl::optional value) { +void CefValueImpl::SetValueInternal(std::optional value) { lock_.AssertAcquired(); value_.reset(nullptr); @@ -1048,7 +1048,7 @@ bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) { } // |actual_value| is no longer valid after this call. - absl::optional out_value = + std::optional out_value = mutable_value()->GetDict().Extract(base::StringPiece(key.ToString())); if (!out_value.has_value()) { return false; diff --git a/libcef/common/values_impl.h b/libcef/common/values_impl.h index 17c91eb62..f5fb6afa9 100644 --- a/libcef/common/values_impl.h +++ b/libcef/common/values_impl.h @@ -106,7 +106,7 @@ class CefValueImpl : public CefValue { }; private: - void SetValueInternal(absl::optional value); + void SetValueInternal(std::optional value); // Returns the controller for the current value, if any. CefValueController* GetValueController() const; diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 1b568198d..2de1bc976 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -294,7 +294,7 @@ void AlloyContentRendererClient::RenderFrameCreated( } bool browser_created; - absl::optional is_windowless; + std::optional is_windowless; render_manager_->RenderFrameCreated(render_frame, render_frame_observer, browser_created, is_windowless); if (browser_created) { @@ -314,7 +314,7 @@ void AlloyContentRendererClient::WebViewCreated( bool was_created_by_renderer, const url::Origin* outermost_origin) { bool browser_created; - absl::optional is_windowless; + std::optional is_windowless; render_manager_->WebViewCreated(web_view, browser_created, is_windowless); if (browser_created) { OnBrowserCreated(web_view, is_windowless); @@ -427,9 +427,10 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin( return true; } -void AlloyContentRendererClient::GetSupportedKeySystems( +std::unique_ptr +AlloyContentRendererClient::GetSupportedKeySystems( media::GetSupportedKeySystemsCB cb) { - GetChromeKeySystems(std::move(cb)); + return GetChromeKeySystems(std::move(cb)); } void AlloyContentRendererClient::RunScriptsAtDocumentStart( @@ -542,7 +543,7 @@ void AlloyContentRendererClient::WillDestroyCurrentMessageLoop() { void AlloyContentRendererClient::OnBrowserCreated( blink::WebView* web_view, - absl::optional is_windowless) { + std::optional is_windowless) { #if BUILDFLAG(IS_MAC) const bool windowless = is_windowless.has_value() && *is_windowless; diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index fdfdd0b85..6a6db9e84 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -20,13 +20,13 @@ #include "chrome/common/plugin.mojom.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/render_thread.h" +#include "media/base/key_systems_support_observer.h" #include "mojo/public/cpp/bindings/generic_pending_receiver.h" #include "services/service_manager/public/cpp/local_interface_provider.h" namespace extensions { class CefExtensionsRendererClient; class Dispatcher; -class DispatcherDelegate; class ExtensionsClient; class ExtensionsRendererClient; class ResourceRequestPolicy; @@ -100,7 +100,8 @@ class AlloyContentRendererClient uint64_t VisitedLinkHash(std::string_view canonical_url) override; bool IsLinkVisited(uint64_t link_hash) override; bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; - void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override; + std::unique_ptr GetSupportedKeySystems( + media::GetSupportedKeySystemsCB cb) override; void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override; @@ -126,7 +127,7 @@ class AlloyContentRendererClient private: void OnBrowserCreated(blink::WebView* web_view, - absl::optional is_windowless); + std::optional is_windowless); // Perform cleanup work for single-process mode. void RunSingleProcessCleanupOnUIThread(); diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc index e3e9a86fa..c1b3472d7 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc @@ -24,23 +24,23 @@ CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl( AlloyContentRendererClient* alloy_content_renderer_client) : type_(type), alloy_content_renderer_client_(alloy_content_renderer_client) { - DETACH_FROM_THREAD(thread_checker_); + DETACH_FROM_SEQUENCE(sequence_checker_); } CefURLLoaderThrottleProviderImpl::~CefURLLoaderThrottleProviderImpl() { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl( const CefURLLoaderThrottleProviderImpl& other) : type_(other.type_), alloy_content_renderer_client_(other.alloy_content_renderer_client_) { - DETACH_FROM_THREAD(thread_checker_); + DETACH_FROM_SEQUENCE(sequence_checker_); } std::unique_ptr CefURLLoaderThrottleProviderImpl::Clone() { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return base::WrapUnique(new CefURLLoaderThrottleProviderImpl(*this)); } @@ -48,7 +48,7 @@ blink::WebVector> CefURLLoaderThrottleProviderImpl::CreateThrottles( base::optional_ref local_frame_token, const network::ResourceRequest& request) { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); blink::WebVector> throttles; diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h index 66b3fd63a..9d7b85c66 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h @@ -8,7 +8,7 @@ #include #include -#include "base/threading/thread_checker.h" +#include "base/sequence_checker.h" #include "third_party/blink/public/platform/url_loader_throttle_provider.h" class AlloyContentRendererClient; @@ -43,7 +43,7 @@ class CefURLLoaderThrottleProviderImpl blink::URLLoaderThrottleProviderType type_; AlloyContentRendererClient* const alloy_content_renderer_client_; - THREAD_CHECKER(thread_checker_); + SEQUENCE_CHECKER(sequence_checker_); }; #endif // CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_ diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index b56893ebc..68db7bdee 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -81,7 +81,7 @@ void GoBack(blink::WebView* view) { blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::To(core_frame) ->GetLocalFrameHostRemote() - .GoToEntryAtOffset(-1, /*has_user_gesture=*/true, absl::nullopt); + .GoToEntryAtOffset(-1, /*has_user_gesture=*/true, std::nullopt); } } } @@ -97,7 +97,7 @@ void GoForward(blink::WebView* view) { blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::To(core_frame) ->GetLocalFrameHostRemote() - .GoToEntryAtOffset(1, /*has_user_gesture=*/true, absl::nullopt); + .GoToEntryAtOffset(1, /*has_user_gesture=*/true, std::nullopt); } } } diff --git a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc index 5d2342674..9c3333755 100644 --- a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc +++ b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc @@ -46,7 +46,7 @@ void ChromeContentRendererClientCef::RenderFrameCreated( new CefRenderFrameObserver(render_frame); bool browser_created; - absl::optional is_windowless; + std::optional is_windowless; render_manager_->RenderFrameCreated(render_frame, render_frame_observer, browser_created, is_windowless); if (is_windowless.has_value() && *is_windowless) { @@ -62,7 +62,7 @@ void ChromeContentRendererClientCef::WebViewCreated( outermost_origin); bool browser_created; - absl::optional is_windowless; + std::optional 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"; @@ -100,4 +100,4 @@ void ChromeContentRendererClientCef::ExposeInterfacesToBrowser( ChromeContentRendererClient::ExposeInterfacesToBrowser(binders); render_manager_->ExposeInterfacesToBrowser(binders); -} \ No newline at end of file +} diff --git a/libcef/renderer/extensions/extensions_dispatcher_delegate.cc b/libcef/renderer/extensions/extensions_dispatcher_delegate.cc deleted file mode 100644 index e1e208a9f..000000000 --- a/libcef/renderer/extensions/extensions_dispatcher_delegate.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 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/renderer/extensions/extensions_dispatcher_delegate.h" - -#include "base/feature_list.h" -#include "chrome/grit/renderer_resources.h" -#include "extensions/common/extension_features.h" -#include "extensions/renderer/resource_bundle_source_map.h" - -namespace extensions { - -CefExtensionsDispatcherDelegate::CefExtensionsDispatcherDelegate() = default; - -CefExtensionsDispatcherDelegate::~CefExtensionsDispatcherDelegate() = default; - -void CefExtensionsDispatcherDelegate::PopulateSourceMap( - extensions::ResourceBundleSourceMap* source_map) {} - -} // namespace extensions diff --git a/libcef/renderer/extensions/extensions_dispatcher_delegate.h b/libcef/renderer/extensions/extensions_dispatcher_delegate.h deleted file mode 100644 index 5ccebb6d5..000000000 --- a/libcef/renderer/extensions/extensions_dispatcher_delegate.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 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_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_ -#define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_ - -#include "extensions/renderer/dispatcher_delegate.h" - -namespace extensions { - -class CefExtensionsDispatcherDelegate : public DispatcherDelegate { - public: - CefExtensionsDispatcherDelegate(); - - CefExtensionsDispatcherDelegate(const CefExtensionsDispatcherDelegate&) = - delete; - CefExtensionsDispatcherDelegate& operator=( - const CefExtensionsDispatcherDelegate&) = delete; - - ~CefExtensionsDispatcherDelegate() override; - - void PopulateSourceMap( - extensions::ResourceBundleSourceMap* source_map) override; -}; - -} // namespace extensions - -#endif // CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_ diff --git a/libcef/renderer/extensions/extensions_renderer_api_provider.cc b/libcef/renderer/extensions/extensions_renderer_api_provider.cc new file mode 100644 index 000000000..25bb3a9e0 --- /dev/null +++ b/libcef/renderer/extensions/extensions_renderer_api_provider.cc @@ -0,0 +1,32 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "libcef/renderer/extensions/extensions_renderer_api_provider.h" + +#include "extensions/renderer/module_system.h" +#include "extensions/renderer/script_context.h" + +namespace extensions { + +void CefExtensionsRendererAPIProvider::RegisterNativeHandlers( + ModuleSystem* module_system, + NativeExtensionBindingsSystem* bindings_system, + V8SchemaRegistry* v8_schema_registry, + ScriptContext* context) const {} + +void CefExtensionsRendererAPIProvider::AddBindingsSystemHooks( + Dispatcher* dispatcher, + NativeExtensionBindingsSystem* bindings_system) const {} + +void CefExtensionsRendererAPIProvider::PopulateSourceMap( + ResourceBundleSourceMap* source_map) const {} + +void CefExtensionsRendererAPIProvider::EnableCustomElementAllowlist() const {} + +void CefExtensionsRendererAPIProvider::RequireWebViewModules( + ScriptContext* context) const { + context->module_system()->Require("extensionsWebViewElement"); +} + +} // namespace extensions diff --git a/libcef/renderer/extensions/extensions_renderer_api_provider.h b/libcef/renderer/extensions/extensions_renderer_api_provider.h new file mode 100644 index 000000000..dd24871ca --- /dev/null +++ b/libcef/renderer/extensions/extensions_renderer_api_provider.h @@ -0,0 +1,38 @@ +// Copyright 2024 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_ +#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_ + +#include "extensions/renderer/extensions_renderer_api_provider.h" + +namespace extensions { + +// Provides capabilities for the set of extension APIs defined for the +// extensions shell. +class CefExtensionsRendererAPIProvider + : public ExtensionsRendererAPIProvider { + public: + CefExtensionsRendererAPIProvider() = default; + CefExtensionsRendererAPIProvider( + const CefExtensionsRendererAPIProvider&) = delete; + CefExtensionsRendererAPIProvider& operator=( + const CefExtensionsRendererAPIProvider&) = delete; + ~CefExtensionsRendererAPIProvider() override = default; + + void RegisterNativeHandlers(ModuleSystem* module_system, + NativeExtensionBindingsSystem* bindings_system, + V8SchemaRegistry* v8_schema_registry, + ScriptContext* context) const override; + void AddBindingsSystemHooks( + Dispatcher* dispatcher, + NativeExtensionBindingsSystem* bindings_system) const override; + void PopulateSourceMap(ResourceBundleSourceMap* source_map) const override; + void EnableCustomElementAllowlist() const override; + void RequireWebViewModules(ScriptContext* context) const override; +}; + +} // namespace extensions + +#endif // CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_ diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 2d3bb49fb..ca18cbd22 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -6,7 +6,7 @@ #include "libcef/renderer/alloy/alloy_content_renderer_client.h" #include "libcef/renderer/alloy/alloy_render_thread_observer.h" -#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h" +#include "libcef/renderer/extensions/extensions_renderer_api_provider.h" #include "base/stl_util.h" #include "chrome/common/url_constants.h" @@ -16,7 +16,9 @@ #include "content/public/renderer/render_thread.h" #include "extensions/common/constants.h" #include "extensions/common/permissions/permissions_data.h" +#include "extensions/renderer/api/core_extensions_renderer_api_provider.h" #include "extensions/renderer/dispatcher.h" +#include "extensions/renderer/dispatcher_delegate.h" #include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extensions_render_frame_observer.h" #include "extensions/renderer/extensions_renderer_api_provider.h" @@ -42,7 +44,10 @@ void IsGuestViewApiAvailableToScriptContext( CefExtensionsRendererClient::CefExtensionsRendererClient( AlloyContentRendererClient* alloy_content_renderer_client) - : alloy_content_renderer_client_(alloy_content_renderer_client) {} + : alloy_content_renderer_client_(alloy_content_renderer_client) { + AddAPIProvider(std::make_unique()); + AddAPIProvider(std::make_unique()); +} CefExtensionsRendererClient::~CefExtensionsRendererClient() = default; @@ -83,9 +88,8 @@ void CefExtensionsRendererClient::RenderThreadStarted() { content::RenderThread* thread = content::RenderThread::Get(); extension_dispatcher_ = std::make_unique( - std::make_unique(), - std::vector< - std::unique_ptr>()); + std::make_unique(), + std::move(api_providers_)); extension_dispatcher_->OnRenderThreadStarted(thread); resource_request_policy_ = std::make_unique( diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 9537652ba..f21e372e9 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -39,7 +39,6 @@ class Origin; namespace extensions { class Dispatcher; -class DispatcherDelegate; class ResourceRequestPolicy; class CefExtensionsRendererClient : public ExtensionsRendererClient { @@ -54,6 +53,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { ~CefExtensionsRendererClient() override; // ExtensionsRendererClient implementation. + void RenderThreadStarted() override; bool IsIncognitoProcess() const override; int GetLowestIsolatedWorldId() const override; extensions::Dispatcher* GetDispatcher() override; @@ -65,7 +65,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { const GURL& script_url) const override; // See AlloyContentRendererClient methods with the same names. - void RenderThreadStarted(); void RenderFrameCreated(content::RenderFrame* render_frame, service_manager::BinderRegistry* registry); bool OverrideCreatePlugin(content::RenderFrame* render_frame, diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 62cc592f6..79457ee05 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -381,9 +381,9 @@ void CefFrameImpl::OnDraggableRegionsChanged() { } using RegionsArg = - absl::optional>; + std::optional>; RegionsArg regions_arg = - regions.empty() ? absl::nullopt : absl::make_optional(std::move(regions)); + regions.empty() ? std::nullopt : std::make_optional(std::move(regions)); SendToBrowserFrame( __FUNCTION__, @@ -613,8 +613,8 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason, const auto connection_state = browser_connection_state_; const bool frame_is_valid = !!frame_; VLOG(1) << frame_debug_str_ << " disconnected " - << GetDisconnectDebugString(connection_state, frame_is_valid, - reason, description); + << GetDisconnectDebugString(connection_state, frame_is_valid, reason, + description); browser_frame_.reset(); receiver_.reset(); diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index 83e619e2f..929c2e5f3 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -105,7 +105,7 @@ void CefRenderManager::RenderFrameCreated( content::RenderFrame* render_frame, CefRenderFrameObserver* render_frame_observer, bool& browser_created, - absl::optional& is_windowless) { + std::optional& is_windowless) { auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame, &browser_created, &is_windowless); if (browser) { @@ -122,7 +122,7 @@ void CefRenderManager::RenderFrameCreated( void CefRenderManager::WebViewCreated(blink::WebView* web_view, bool& browser_created, - absl::optional& is_windowless) { + std::optional& is_windowless) { content::RenderFrame* render_frame = nullptr; if (web_view->MainFrame()->IsWebLocalFrame()) { render_frame = content::RenderFrame::FromWebFrame( @@ -291,7 +291,7 @@ CefRefPtr CefRenderManager::MaybeCreateBrowser( blink::WebView* web_view, content::RenderFrame* render_frame, bool* browser_created, - absl::optional* is_windowless) { + std::optional* is_windowless) { if (browser_created) { *browser_created = false; } diff --git a/libcef/renderer/render_manager.h b/libcef/renderer/render_manager.h index 83526f3ca..814e46f7b 100644 --- a/libcef/renderer/render_manager.h +++ b/libcef/renderer/render_manager.h @@ -8,6 +8,7 @@ #include #include +#include #include "include/internal/cef_ptr.h" @@ -15,7 +16,6 @@ #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" -#include "third_party/abseil-cpp/absl/types/optional.h" namespace blink { class WebFrame; @@ -53,10 +53,10 @@ class CefRenderManager : public cef::mojom::RenderManager { void RenderFrameCreated(content::RenderFrame* render_frame, CefRenderFrameObserver* render_frame_observer, bool& browser_created, - absl::optional& is_windowless); + std::optional& is_windowless); void WebViewCreated(blink::WebView* web_view, bool& browser_created, - absl::optional& is_windowless); + std::optional& is_windowless); void DevToolsAgentAttached(); void DevToolsAgentDetached(); void ExposeInterfacesToBrowser(mojo::BinderMap* binders); @@ -97,7 +97,7 @@ class CefRenderManager : public cef::mojom::RenderManager { blink::WebView* web_view, content::RenderFrame* render_frame, bool* browser_created, - absl::optional* is_windowless); + std::optional* is_windowless); // Called from CefBrowserImpl::OnDestruct(). void OnBrowserDestroyed(CefBrowserImpl* browser); diff --git a/patch/patch.cfg b/patch/patch.cfg index 5fa2a20ab..c32e26fb4 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -165,6 +165,9 @@ patches = [ # Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded # message loop. # https://github.com/chromiumembedded/cef/issues/2798 + # + # win: Don't create console window for `--enable-logging=handle` + # https://chromium-review.googlesource.com/c/chromium/src/+/5381045 'name': 'content_main_654986', }, { @@ -555,12 +558,6 @@ patches = [ # Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h. 'name': 'base_sandbox_2743', }, - { - # Windows: Fix MSVC compile errors using base::MakeFixedFlatMapSorted - # in registry.cc when building cef_sandbox. - # https://github.com/chromiumembedded/cef/issues/3519 - 'name': 'base_sandbox_3519', - }, { # Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling # scrolling in OSR mode. @@ -730,4 +727,10 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/3645 'name': 'win_taskbar_decorator_3645' }, + { + # chrome: Fix crash on static FontList destruction with + # multi-threaded-message-loop. + # https://chromium-review.googlesource.com/c/chromium/src/+/5388128 + 'name': 'chrome_watermark_5388128' + }, ] diff --git a/patch/patches/base_command_line_1872.patch b/patch/patches/base_command_line_1872.patch index 9cf76af1f..fc3d0dc86 100644 --- a/patch/patches/base_command_line_1872.patch +++ b/patch/patches/base_command_line_1872.patch @@ -1,8 +1,8 @@ diff --git base/command_line.cc base/command_line.cc -index 69e4303165259..682e8d2bfa6ce 100644 +index 15d57c1c78956..2241eb0c32572 100644 --- base/command_line.cc +++ base/command_line.cc -@@ -355,11 +355,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, +@@ -383,11 +383,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) sequence_checker_.Check(); #endif diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index d573ab1d1..1c009082e 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 a989a351a8765..3f7af447dd187 100644 +index 25356ec40cdbf..250bac82d893a 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -41,6 +41,7 @@ import("//build/nocompile.gni") @@ -10,7 +10,7 @@ index a989a351a8765..3f7af447dd187 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") -@@ -1507,7 +1508,11 @@ component("base") { +@@ -1515,7 +1516,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index a989a351a8765..3f7af447dd187 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1936,6 +1941,12 @@ component("base") { +@@ -1944,6 +1949,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -37,17 +37,17 @@ index a989a351a8765..3f7af447dd187 100644 "cfgmgr32.lib", "ntdll.lib", diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc -index 4595034abae30..da29453cf7d71 100644 +index 78f706cd6bef8..87eafa7a762f6 100644 --- base/allocator/dispatcher/dispatcher.cc +++ base/allocator/dispatcher/dispatcher.cc -@@ -10,6 +10,7 @@ +@@ -8,6 +8,7 @@ #include "base/check.h" #include "base/dcheck_is_on.h" #include "base/no_destructor.h" +#include "cef/libcef/features/features.h" + #include "partition_alloc/partition_alloc_buildflags.h" + #include "partition_alloc/shim/allocator_shim.h" - #if DCHECK_IS_ON() - #include @@ -33,7 +34,7 @@ struct Dispatcher::Impl { } @@ -58,7 +58,7 @@ index 4595034abae30..da29453cf7d71 100644 auto const was_set = is_initialized_check_flag_.test_and_set(); is_initialized_check_flag_.clear(); diff --git base/hash/md5.h base/hash/md5.h -index b49701893a182..acefcbc5bc439 100644 +index 215d636fec275..922e88f31b999 100644 --- base/hash/md5.h +++ base/hash/md5.h @@ -11,8 +11,9 @@ @@ -164,7 +164,7 @@ index 299e54300a09d..cdc43cc48dce6 100644 static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng(); BOOL success = diff --git base/unguessable_token.cc base/unguessable_token.cc -index da65502f75c3a..8b9d6eec4a1e2 100644 +index 1f91a938caf55..e7b383ebe3986 100644 --- base/unguessable_token.cc +++ base/unguessable_token.cc @@ -10,8 +10,9 @@ @@ -178,7 +178,7 @@ index da65502f75c3a..8b9d6eec4a1e2 100644 #include "third_party/boringssl/src/include/openssl/mem.h" #endif -@@ -57,7 +58,7 @@ absl::optional UnguessableToken::DeserializeFromString( +@@ -57,7 +58,7 @@ std::optional UnguessableToken::DeserializeFromString( } bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) { @@ -188,7 +188,7 @@ index da65502f75c3a..8b9d6eec4a1e2 100644 return lhs.token_ == rhs.token_; #else diff --git base/win/sid.cc base/win/sid.cc -index 3323cc7cbfee1..778b86dcd4154 100644 +index ccaf03323d60f..3d7a7513d1843 100644 --- base/win/sid.cc +++ base/win/sid.cc @@ -17,6 +17,7 @@ diff --git a/patch/patches/base_sandbox_3519.patch b/patch/patches/base_sandbox_3519.patch deleted file mode 100644 index df319d812..000000000 --- a/patch/patches/base_sandbox_3519.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git base/ranges/ranges.h base/ranges/ranges.h -index 27eac4f3a4c39..2cb63bec79e63 100644 ---- base/ranges/ranges.h -+++ base/ranges/ranges.h -@@ -30,12 +30,14 @@ constexpr T* begin(std::array& array, priority_tag<2> tag) { - return const_cast(begin(const_cast&>(array), tag)); - } - -+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS) - // Overload for const std::array. Required since std::array::begin is not - // constexpr prior to C++17. - template - constexpr const T* begin(const std::array& array, priority_tag<2>) { - return N != 0 ? &array[0] : nullptr; - } -+#endif - - // Generic container overload. - template -@@ -65,12 +67,14 @@ constexpr T* end(std::array& array, priority_tag<2> tag) { - return const_cast(end(const_cast&>(array), tag)); - } - -+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS) - // Overload for const std::array. Required since std::array::end is not - // constexpr prior to C++17. - template - constexpr const T* end(const std::array& array, priority_tag<2>) { - return N != 0 ? (&array[0]) + N : nullptr; - } -+#endif - - // Generic container overload. - template -diff --git base/win/registry.cc base/win/registry.cc -index 7b9dcb90e627e..275b60e6c2a28 100644 ---- base/win/registry.cc -+++ base/win/registry.cc -@@ -14,6 +14,14 @@ - #include - #include - -+#include "cef/libcef/features/features.h" -+ -+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD) -+// Avoid overloads for const std::array in base/ranges/ranges.h that don't -+// compile with MSVC. See issue #3519. -+#define CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS 1 -+#endif -+ - #include "base/check_op.h" - #include "base/functional/callback.h" - #include "base/notreached.h" diff --git a/patch/patches/base_test_4396276.patch b/patch/patches/base_test_4396276.patch index f0f3e4899..d45ddbff4 100644 --- a/patch/patches/base_test_4396276.patch +++ b/patch/patches/base_test_4396276.patch @@ -1,8 +1,8 @@ diff --git base/test/BUILD.gn base/test/BUILD.gn -index 9cd7f3eaa502f..ed34018fdba6a 100644 +index 4c0357370dffc..cdb90b96e1a4a 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn -@@ -191,11 +191,6 @@ static_library("test_support") { +@@ -190,11 +190,6 @@ static_library("test_support") { if (enable_base_tracing) { public_deps += [ "//third_party/perfetto:perfetto_test_support" ] @@ -14,7 +14,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644 deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", -@@ -562,7 +557,7 @@ if (enable_base_tracing) { +@@ -560,7 +555,7 @@ if (enable_base_tracing) { # processor depends on dev_sqlite. The two share the same symbols but have # different implementations, so we need to hide dev_sqlite in this shared # library even in non-component builds to prevent duplicate symbols. @@ -23,7 +23,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644 if (is_ios) { _target_type = "ios_framework_bundle" } -@@ -571,6 +566,8 @@ if (enable_base_tracing) { +@@ -569,6 +564,8 @@ if (enable_base_tracing) { defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] testonly = true sources = [ @@ -32,7 +32,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644 "test_trace_processor_export.h", "test_trace_processor_impl.cc", "test_trace_processor_impl.h", -@@ -588,33 +585,6 @@ if (enable_base_tracing) { +@@ -586,33 +583,6 @@ if (enable_base_tracing) { output_name = "TestTraceProcessor" bundle_deps_filter = [ "//third_party/icu:icudata" ] } @@ -88,10 +88,10 @@ index f5191b804bc07..aadb7d66ba4c3 100644 + #endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_ diff --git content/shell/BUILD.gn content/shell/BUILD.gn -index 7579ffdd7302e..0dc2e70f79284 100644 +index d04abf8d841cc..61caa4266685b 100644 --- content/shell/BUILD.gn +++ content/shell/BUILD.gn -@@ -841,7 +841,6 @@ if (is_mac) { +@@ -878,7 +878,6 @@ if (is_mac) { # Specify a sensible install_name for static builds. The library is # dlopen()ed so this is not used to resolve the module. ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ] diff --git a/patch/patches/blink_web_element_4200240.patch b/patch/patches/blink_web_element_4200240.patch index 8d761eb7f..f795c84d0 100644 --- a/patch/patches/blink_web_element_4200240.patch +++ b/patch/patches/blink_web_element_4200240.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h -index 9cd08e8b26410..d2dca33bdc62e 100644 +index 103cbab74b515..3b763e5100340 100644 --- third_party/blink/public/web/web_element.h +++ third_party/blink/public/web/web_element.h @@ -82,6 +82,9 @@ class BLINK_EXPORT WebElement : public WebNode { @@ -13,7 +13,7 @@ index 9cd08e8b26410..d2dca33bdc62e 100644 // Returns true if the element's contenteditable attribute is in the true // state or in the plaintext-only state: diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc -index 5cc36b7dccab4..05c9a46e3db69 100644 +index 3c71a93d1a6ea..df2c5cd35b846 100644 --- third_party/blink/renderer/core/exported/web_element.cc +++ third_party/blink/renderer/core/exported/web_element.cc @@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name, diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 4aca12c8a..c191d7a01 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 7517bd98e4f7c..6a49e25d63436 100644 +index 5daf5aba13046..f0922951ee2b3 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1900,6 +1900,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( +@@ -1904,6 +1904,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,10 +20,10 @@ index 7517bd98e4f7c..6a49e25d63436 100644 // Make an exception to allow most visited tiles to commit in diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index b303b8bd70624..d696b002f3179 100644 +index 52cdd617511bd..1d52c8473304c 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -7777,10 +7777,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( +@@ -7966,10 +7966,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -47,7 +47,7 @@ index b303b8bd70624..d696b002f3179 100644 } return origin_and_debug_info; -@@ -7888,6 +7900,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -8077,6 +8089,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { DetermineInitiatorRelationship(initiator_rfh, frame_tree_node_->current_frame_host())); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 83004a88a..afd0daf2f 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 3c7b4d82d0b46..7f890ab3aa546 100644 +index bd7dd25175f1e..34f5263fee4fa 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -2195,8 +2195,6 @@ config("thin_archive") { - # confuses lldb. - if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { +@@ -2182,8 +2182,6 @@ config("thin_archive") { + # archives. + if ((is_posix && !is_nacl && (!is_apple || use_lld)) || 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 51cff5e62..bbeb19a35 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 e9c28ab05bd01..9e10f7f5d0d0f 100644 +index 5d698b969a134..ffddbc4db780b 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,7 +10,7 @@ index e9c28ab05bd01..9e10f7f5d0d0f 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -2042,6 +2043,7 @@ static_library("browser") { +@@ -2050,6 +2051,7 @@ static_library("browser") { "//build/config/chromebox_for_meetings:buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index e9c28ab05bd01..9e10f7f5d0d0f 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2698,6 +2700,10 @@ static_library("browser") { +@@ -2707,6 +2709,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 cb3b630b1..9a2bc2e59 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -14,7 +14,7 @@ index 3e7de43022a41..21354d14d11c3 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 4645aebcfcb1e..3c07c056d7f1f 100644 +index 0290ba1dbcbba..d96217c2bb869 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc @@ -1093,18 +1093,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { @@ -38,7 +38,7 @@ index 4645aebcfcb1e..3c07c056d7f1f 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 e569e2d1a0dd0..fc5703af98b58 100644 +index b303ad32bec66..e85dd8134147e 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h @@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess, diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index 90f75c09e..aaa2fca65 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,18 +13,18 @@ index 2480282a19d12..dbd1fbf8a15b5 100644 return false; } diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc -index 8aa2877ee6352..2e015069f0083 100644 +index c5eea1036e1eb..d102fff3e9de8 100644 --- chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc -@@ -31,6 +31,7 @@ - #include "chrome/browser/profiles/profile.h" +@@ -35,6 +35,7 @@ + #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_window.h" -@@ -1193,6 +1194,13 @@ DevToolsWindow* DevToolsWindow::Create( +@@ -1223,6 +1224,13 @@ DevToolsWindow* DevToolsWindow::Create( !browser->is_type_normal()) { can_dock = false; } @@ -38,7 +38,7 @@ index 8aa2877ee6352..2e015069f0083 100644 } // Create WebContents with devtools. -@@ -1800,12 +1808,29 @@ void DevToolsWindow::CreateDevToolsBrowser() { +@@ -1845,12 +1853,29 @@ void DevToolsWindow::CreateDevToolsBrowser() { Browser::CreationStatus::kOk) { return; } @@ -75,7 +75,7 @@ index 8aa2877ee6352..2e015069f0083 100644 } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 768e11b9e5648..b4ba1800def14 100644 +index 3fe3d6eddbf01..b1549c86523be 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") @@ -86,7 +86,7 @@ index 768e11b9e5648..b4ba1800def14 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -@@ -386,6 +387,10 @@ static_library("ui") { +@@ -393,6 +394,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -97,7 +97,7 @@ index 768e11b9e5648..b4ba1800def14 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 -@@ -411,6 +416,7 @@ static_library("ui") { +@@ -418,6 +423,7 @@ static_library("ui") { "//build:chromeos_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", @@ -105,7 +105,7 @@ index 768e11b9e5648..b4ba1800def14 100644 "//chrome:resources", "//chrome:strings", "//chrome/app:chrome_dll_resources", -@@ -2901,6 +2907,8 @@ static_library("ui") { +@@ -2936,6 +2942,8 @@ static_library("ui") { "views/apps/app_dialog/app_block_dialog_view.h", "views/apps/app_dialog/app_pause_dialog_view.cc", "views/apps/app_dialog/app_pause_dialog_view.h", @@ -114,7 +114,7 @@ index 768e11b9e5648..b4ba1800def14 100644 "views/apps/app_info_dialog/arc_app_info_links_panel.cc", "views/apps/app_info_dialog/arc_app_info_links_panel.h", "views/apps/chrome_app_window_client_views_chromeos.cc", -@@ -4941,8 +4949,6 @@ static_library("ui") { +@@ -4996,8 +5004,6 @@ static_library("ui") { "views/accessibility/theme_tracking_non_accessible_image_view.h", "views/apps/app_dialog/app_dialog_view.cc", "views/apps/app_dialog/app_dialog_view.h", @@ -123,7 +123,7 @@ index 768e11b9e5648..b4ba1800def14 100644 "views/apps/app_info_dialog/app_info_dialog_container.cc", "views/apps/app_info_dialog/app_info_dialog_container.h", "views/apps/app_info_dialog/app_info_dialog_views.cc", -@@ -6740,6 +6746,7 @@ static_library("ui") { +@@ -6813,6 +6819,7 @@ static_library("ui") { if (enable_printing) { deps += [ "//components/printing/browser", @@ -132,7 +132,7 @@ index 768e11b9e5648..b4ba1800def14 100644 ] } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 0791cc8f55a92..df3fb31c5c787 100644 +index 3d985470f60d1..762f0e827d53e 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc @@ -264,6 +264,25 @@ @@ -194,7 +194,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } void Browser::FullscreenTopUIStateChanged() { -@@ -1449,6 +1480,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1451,6 +1482,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -209,7 +209,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1456,8 +1495,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1458,8 +1497,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -230,7 +230,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } bool Browser::TabsNeedBeforeUnloadFired() const { -@@ -1660,6 +1709,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1658,6 +1707,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -245,7 +245,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1817,6 +1874,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1815,6 +1872,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool should_show_loading_ui) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); @@ -254,7 +254,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1845,6 +1904,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1843,6 +1902,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -263,7 +263,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 if (!GetStatusBubble()) return; -@@ -1852,6 +1913,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1850,6 +1911,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -281,7 +281,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1876,6 +1948,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { +@@ -1874,6 +1946,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { return false; } @@ -301,7 +301,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 void Browser::BeforeUnloadFired(WebContents* web_contents, bool proceed, bool* proceed_to_fire_unload) { -@@ -1975,12 +2060,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1973,12 +2058,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -326,7 +326,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 // Don't show the page hung dialog when a HTML popup hangs because // the dialog will take the focus and immediately close the popup. RenderWidgetHostView* view = render_widget_host->GetView(); -@@ -1993,6 +2090,13 @@ void Browser::RendererUnresponsive( +@@ -1991,6 +2088,13 @@ void Browser::RendererUnresponsive( void Browser::RendererResponsive( WebContents* source, content::RenderWidgetHost* render_widget_host) { @@ -340,7 +340,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 RenderWidgetHostView* view = render_widget_host->GetView(); if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { TabDialogs::FromWebContents(source)->HideHungRendererDialog( -@@ -2119,11 +2223,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -2117,11 +2221,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -356,7 +356,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2322,6 +2430,15 @@ void Browser::RequestMediaAccessPermission( +@@ -2321,6 +2429,15 @@ void Browser::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) { @@ -372,7 +372,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 const extensions::Extension* extension = GetExtensionForOrigin(profile_, request.security_origin); MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -2858,9 +2975,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { +@@ -2864,9 +2981,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { // Browser, Getters for UI (private): StatusBubble* Browser::GetStatusBubble() { @@ -385,7 +385,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } // We hide the status bar for web apps windows as this matches native -@@ -2868,6 +2987,12 @@ StatusBubble* Browser::GetStatusBubble() { +@@ -2874,6 +2993,12 @@ StatusBubble* Browser::GetStatusBubble() { // mode, as the minimal browser UI includes the status bar. if (web_app::AppBrowserController::IsWebApp(this) && !app_controller()->HasMinimalUiButtons()) { @@ -398,7 +398,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 return nullptr; } -@@ -3004,6 +3129,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -3010,6 +3135,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); web_contents_collection_.StopObserving(web_contents); } @@ -407,7 +407,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 } void Browser::TabDetachedAtImpl(content::WebContents* contents, -@@ -3158,6 +3285,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( +@@ -3164,6 +3291,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, bool check_can_support) const { @@ -423,7 +423,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644 case TYPE_NORMAL: return NormalBrowserSupportsWindowFeature(feature, check_can_support); diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 36ae82017f790..b0a4be7c1ab32 100644 +index 4f393fa78e991..a486d6f7f1571 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -22,6 +22,7 @@ @@ -488,7 +488,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -909,11 +936,19 @@ class Browser : public TabStripModelObserver, +@@ -908,11 +935,19 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -508,7 +508,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644 void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; -@@ -1253,6 +1288,10 @@ class Browser : public TabStripModelObserver, +@@ -1252,6 +1287,10 @@ class Browser : public TabStripModelObserver, // This Browser's window. raw_ptr window_; @@ -519,7 +519,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644 std::unique_ptr const tab_strip_model_delegate_; std::unique_ptr const tab_strip_model_; -@@ -1319,6 +1358,8 @@ class Browser : public TabStripModelObserver, +@@ -1318,6 +1357,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index b9d95797b..39e98d382 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -56,10 +56,10 @@ index 36335ba63ee83..e14005d6a4e86 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) supervised_user::SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index 34871864cf8d7..8404bcc4e50dd 100644 +index 0ff900e700ba8..ca5b899bece6d 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc -@@ -143,7 +143,7 @@ ContentSetting GetContentSettingFromRules( +@@ -148,7 +148,7 @@ ContentSetting GetContentSettingFromRules( return rule.GetContentSetting(); } } diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index d5e5c5815..827dd29f3 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 25f2e8f6c4f09..25c21e4552f8a 100644 +index d182bc1b7bff2..e4f54b6d2be24 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -360,6 +360,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -361,6 +361,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -616,6 +623,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -618,6 +625,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -863,6 +874,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -867,6 +878,14 @@ RenderViewContextMenu::RenderViewContextMenu( pdf_ocr_submenu_model_ = std::make_unique(this); #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) @@ -42,7 +42,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644 observers_.AddObserver(&autofill_context_menu_manager_); } -@@ -1337,6 +1356,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1341,6 +1360,12 @@ void RenderViewContextMenu::InitMenu() { autofill::PopupHidingReason::kContextMenuOpened); } } @@ -55,7 +55,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -3556,6 +3581,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( +@@ -3564,6 +3589,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( execute_plugin_action_callback_ = std::move(cb); } @@ -69,10 +69,10 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index e4041eee0e29e..7d5e3aa1d8cfb 100644 +index 9634f1d7f3442..1187aec354b15 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -159,6 +159,12 @@ class RenderViewContextMenu +@@ -158,6 +158,12 @@ class RenderViewContextMenu } #endif @@ -85,7 +85,7 @@ index e4041eee0e29e..7d5e3aa1d8cfb 100644 protected: Profile* GetProfile() const; -@@ -471,6 +477,9 @@ class RenderViewContextMenu +@@ -470,6 +476,9 @@ class RenderViewContextMenu // built. bool is_protocol_submenu_valid_ = false; @@ -132,7 +132,7 @@ index c49b49d76d7cc..842a6fae5d8e4 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index 33de73c75ef8c..c0ef8b7f8ba07 100644 +index e3e8617aa03b6..9bb486d691582 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h @@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index de5c2d3bb..0a87e049a 100644 --- a/patch/patches/chrome_browser_dialogs_native.patch +++ b/patch/patches/chrome_browser_dialogs_native.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc -index 25ccc6c633df5..7d439c4d9cc3c 100644 +index 4d5299dc12b76..a74d0212d2eb1 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc @@ -20,6 +20,7 @@ @@ -10,7 +10,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/platform_util.h" -@@ -242,6 +243,13 @@ void FileSelectHelper::OnListFile( +@@ -246,6 +247,13 @@ void FileSelectHelper::OnListFile( void FileSelectHelper::LaunchConfirmationDialog( const base::FilePath& path, std::vector selected_files) { @@ -24,7 +24,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 ShowFolderUploadConfirmationDialog( path, base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this), -@@ -326,6 +334,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( +@@ -330,6 +338,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( if (AbortIfWebContentsDestroyed()) return; @@ -37,7 +37,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 #if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) enterprise_connectors::ContentAnalysisDelegate::Data data; if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled( -@@ -456,7 +470,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { +@@ -460,7 +474,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { std::unique_ptr FileSelectHelper::GetFileTypesFromAcceptType( @@ -47,7 +47,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 auto base_file_type = std::make_unique(); if (accept_types.empty()) return base_file_type; -@@ -469,17 +484,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -473,17 +488,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( std::vector* extensions = &file_type->extensions.back(); @@ -73,7 +73,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 } else { if (!base::IsStringASCII(accept_type)) continue; -@@ -490,10 +512,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -494,10 +516,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( description_id = IDS_AUDIO_FILES; else if (ascii_type == "video/*") description_id = IDS_VIDEO_FILES; @@ -94,7 +94,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 if (extensions->size() > old_extension_size) valid_type_count++; } -@@ -518,6 +548,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -522,6 +552,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( l10n_util::GetStringUTF16(description_id)); } @@ -110,7 +110,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 return file_type; } -@@ -525,7 +564,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -529,7 +568,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( void FileSelectHelper::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -120,7 +120,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 Profile* profile = Profile::FromBrowserContext( render_frame_host->GetProcess()->GetBrowserContext()); -@@ -544,6 +584,7 @@ void FileSelectHelper::RunFileChooser( +@@ -548,6 +588,7 @@ void FileSelectHelper::RunFileChooser( // message. scoped_refptr file_select_helper( new FileSelectHelper(profile)); @@ -128,7 +128,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 file_select_helper->RunFileChooser(render_frame_host, std::move(listener), params.Clone()); } -@@ -595,7 +636,8 @@ void FileSelectHelper::RunFileChooser( +@@ -599,7 +640,8 @@ void FileSelectHelper::RunFileChooser( } void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) { @@ -139,7 +139,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644 params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH : ui::SelectFileDialog::FileTypeInfo::ANY_PATH; diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h -index bd975f96585b8..abf0a24222ded 100644 +index 7194323c36956..903cdf0c294fc 100644 --- chrome/browser/file_select_helper.h +++ chrome/browser/file_select_helper.h @@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< @@ -152,7 +152,7 @@ index bd975f96585b8..abf0a24222ded 100644 // Enumerates all the files in directory. static void EnumerateDirectory( -@@ -262,7 +263,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -264,7 +265,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< // |accept_types| contains only valid lowercased MIME types or file extensions // beginning with a period (.). static std::unique_ptr @@ -162,7 +162,7 @@ index bd975f96585b8..abf0a24222ded 100644 // Check the accept type is valid. It is expected to be all lower case with // no whitespace. -@@ -323,6 +325,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -325,6 +327,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< // Set to false in unit tests since there is no WebContents. bool abort_on_missing_web_contents_in_tests_ = true; diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index b805a31e6..14716584e 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -247,7 +247,7 @@ index 992dbc606ab78..2361727757696 100644 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child // widgets to prevent top-level window behavior (independent movement, etc). diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index 6a2aace29d60d..d6d6292c10487 100644 +index bfeb88bc9b666..6dd74a72e20cc 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h @@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { diff --git a/patch/patches/chrome_browser_permission_prompt.patch b/patch/patches/chrome_browser_permission_prompt.patch index 26213e8f5..aaa214346 100644 --- a/patch/patches/chrome_browser_permission_prompt.patch +++ b/patch/patches/chrome_browser_permission_prompt.patch @@ -77,7 +77,7 @@ index b6afdced9d0af..e189d08ecdd46 100644 } diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc -index d6485540139e0..a77c888b2e147 100644 +index c75f396997e17..b219e122ffb5c 100644 --- chrome/browser/permissions/permission_manager_factory.cc +++ chrome/browser/permissions/permission_manager_factory.cc @@ -6,6 +6,7 @@ @@ -88,13 +88,14 @@ index d6485540139e0..a77c888b2e147 100644 #include "chrome/browser/background_fetch/background_fetch_permission_context.h" #include "chrome/browser/background_sync/periodic_background_sync_permission_context.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -62,8 +63,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( +@@ -62,9 +63,11 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( std::make_unique(profile); #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) + if (!cef::IsAlloyRuntimeEnabled()) { - delegates.geolocation_manager = device::GeolocationManager::GetInstance(); - DCHECK(delegates.geolocation_manager); + delegates.geolocation_system_permission_manager = + device::GeolocationSystemPermissionManager::GetInstance(); + DCHECK(delegates.geolocation_system_permission_manager); + } #endif delegates.media_stream_device_enumerator = @@ -175,7 +176,7 @@ index 07720bc3faccb..546325f2b5558 100644 if (!browser) { DLOG(WARNING) << "Permission prompt suppressed because the WebContents is " diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc -index 402fe1588c459..091625f54b340 100644 +index 9c0ec651d494f..e5c6126adeea7 100644 --- components/embedder_support/permission_context_utils.cc +++ components/embedder_support/permission_context_utils.cc @@ -5,6 +5,7 @@ @@ -186,7 +187,7 @@ index 402fe1588c459..091625f54b340 100644 #include "components/background_sync/background_sync_permission_context.h" #include "components/permissions/contexts/accessibility_permission_context.h" #include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h" -@@ -77,10 +78,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, +@@ -79,10 +80,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, std::move(delegates.geolocation_permission_context_delegate), is_regular_profile); #elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) diff --git a/patch/patches/chrome_browser_policy.patch b/patch/patches/chrome_browser_policy.patch index 378bd2d0e..36cab1b59 100644 --- a/patch/patches/chrome_browser_policy.patch +++ b/patch/patches/chrome_browser_policy.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/policy/browser_dm_token_storage_linux.cc chrome/browser/policy/browser_dm_token_storage_linux.cc -index 10085136f52ce..ec1be9babecc2 100644 +index 9fef3079833f4..43576d91d53f1 100644 --- chrome/browser/policy/browser_dm_token_storage_linux.cc +++ chrome/browser/policy/browser_dm_token_storage_linux.cc @@ -22,6 +22,7 @@ @@ -33,7 +33,7 @@ index 10085136f52ce..ec1be9babecc2 100644 } diff --git chrome/browser/policy/browser_dm_token_storage_mac.mm chrome/browser/policy/browser_dm_token_storage_mac.mm -index 27af6ec08f593..6dfab7c74e8da 100644 +index 27af6ec08f593..156689eec644d 100644 --- chrome/browser/policy/browser_dm_token_storage_mac.mm +++ chrome/browser/policy/browser_dm_token_storage_mac.mm @@ -27,6 +27,7 @@ @@ -44,7 +44,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644 #include "chrome/common/chrome_paths.h" namespace policy { -@@ -47,11 +48,6 @@ const char kEnrollmentOptionsFilePath[] = FILE_PATH_LITERAL( +@@ -47,11 +48,6 @@ "/Library/Google/Chrome/CloudManagementEnrollmentOptions"); const char kEnrollmentMandatoryOption[] = "Mandatory"; @@ -90,7 +90,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644 + ChromeBrowserPolicyConnector::GetBundleId()); + CFStringRef bundle_id = bundle_id_scoper.get(); + if (!bundle_id) { -+ return absl::nullopt; ++ return std::optional(); + } + base::apple::ScopedCFTypeRef value( @@ -105,7 +105,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644 } diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc -index 8824abb401188..687e667e4b942 100644 +index 50f1b5313ce45..687e667e4b942 100644 --- chrome/browser/policy/chrome_browser_policy_connector.cc +++ chrome/browser/policy/chrome_browser_policy_connector.cc @@ -13,11 +13,14 @@ @@ -209,7 +209,7 @@ index 8824abb401188..687e667e4b942 100644 base::flat_set ChromeBrowserPolicyConnector::device_affiliation_ids() const { #if BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -349,23 +424,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { +@@ -349,25 +424,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { std::unique_ptr ChromeBrowserPolicyConnector::CreatePlatformProvider() { #if BUILDFLAG(IS_WIN) @@ -230,6 +230,8 @@ index 8824abb401188..687e667e4b942 100644 - // app's bundle ID actually is. All channels of Chrome should obey the same - // policies. - CFStringRef bundle_id = CFSTR("com.google.Chrome"); +-#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING) +- CFStringRef bundle_id = CFSTR("com.google.ChromeForTesting"); -#else - base::apple::ScopedCFTypeRef bundle_id_scoper = - base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()); @@ -242,7 +244,7 @@ index 8824abb401188..687e667e4b942 100644 auto loader = std::make_unique( base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}), -@@ -375,7 +449,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { +@@ -377,7 +449,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { std::move(loader)); #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) base::FilePath config_dir_path; @@ -304,7 +306,7 @@ index 1a2e78c3472ec..5d1bd95a15113 100644 #include "components/policy/policy_constants.h" namespace policy::path_parser { -@@ -97,16 +98,12 @@ base::FilePath::StringType ExpandPathVariables( +@@ -97,16 +98,12 @@ void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { // Since the configuration management infrastructure is not initialized when // this code runs, read the policy preference directly. @@ -390,10 +392,10 @@ index 4cde94111918e..aaf8245abd9a6 100644 // policy files that allow sys-admins // to set policies for chrome. This directory diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py -index d225da88a04fb..191bb6b56df40 100755 +index e5efa52a8467f..37253ef517bfa 100755 --- components/policy/tools/generate_policy_source.py +++ components/policy/tools/generate_policy_source.py -@@ -448,6 +448,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, +@@ -449,6 +449,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, #include #include @@ -401,7 +403,7 @@ index d225da88a04fb..191bb6b56df40 100755 #include "components/policy/core/common/policy_details.h" #include "components/policy/core/common/policy_map.h" -@@ -470,9 +471,11 @@ struct SchemaData; +@@ -471,9 +472,11 @@ struct SchemaData; ''') if target_platform == 'win': @@ -415,7 +417,7 @@ index d225da88a04fb..191bb6b56df40 100755 f.write('''#if BUILDFLAG(IS_CHROMEOS) // Sets default profile policies values for enterprise users. -@@ -1115,12 +1118,14 @@ namespace policy { +@@ -1116,7 +1119,8 @@ namespace policy { f.write('} // namespace\n\n') if target_platform == 'win': @@ -424,6 +426,8 @@ index d225da88a04fb..191bb6b56df40 100755 + '#if BUILDFLAG(GOOGLE_CHROME_BRANDING)\n' 'const wchar_t kRegistryChromePolicyKey[] = ' 'L"' + CHROME_POLICY_KEY + '";\n' + '#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)\n' +@@ -1125,6 +1129,7 @@ namespace policy { '#else\n' 'const wchar_t kRegistryChromePolicyKey[] = ' 'L"' + CHROMIUM_POLICY_KEY + '";\n' diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index f7ba906ef..ca391e293 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -44,7 +44,7 @@ index caa20ec03434a..2a3ca921445c1 100644 avatar_toolbar_button, GetBrowser().profile(), type); DCHECK_EQ(nullptr, bubble_tracker_.view()); diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index e2dc163557bca..3c56bbc2881cc 100644 +index 791ab794c8750..ca9e0851e2689 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -36,7 +36,9 @@ @@ -55,9 +55,9 @@ index e2dc163557bca..3c56bbc2881cc 100644 + DCHECK(browser->profile()->IsIncognitoProfile() || + (browser->profile()->IsOffTheRecord() && + browser->profile()->GetOTRProfileID().IsUniqueForCEF())); - GetViewAccessibility().OverrideName(GetAccessibleWindowTitle()); + GetViewAccessibility().SetName(GetAccessibleWindowTitle(), + ax::mojom::NameFrom::kAttribute); - base::RecordAction(base::UserMetricsAction("IncognitoMenu_Show")); diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc index 38e38d6eabc85..0856ae8d5f5ff 100644 --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index b52506c99..7bf4442df 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -52,10 +52,10 @@ index 2ec2a791c4943..8573cac4111d6 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 4bf4b36f01890..b8a966db377db 100644 +index 3d5b457eeca11..c7d37503a0fef 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -103,6 +103,10 @@ class Profile : public content::BrowserContext { +@@ -94,6 +94,10 @@ class Profile : public content::BrowserContext { // be applicable to run. Please see crbug.com/1098697#c3 for more details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,7 +66,7 @@ index 4bf4b36f01890..b8a966db377db 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext { +@@ -511,6 +515,8 @@ class Profile : public content::BrowserContext { return instant_service_; } @@ -75,7 +75,7 @@ index 4bf4b36f01890..b8a966db377db 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -533,7 +539,6 @@ class Profile : public content::BrowserContext { +@@ -522,7 +528,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -84,10 +84,10 @@ index 4bf4b36f01890..b8a966db377db 100644 // Returns whether the user has signed in this profile to an account. diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 669c8ab31a549..eff71491eacfd 100644 +index 98bfbc0f96140..de7919947e356 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -1036,7 +1036,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1043,7 +1043,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -99,10 +99,10 @@ index 669c8ab31a549..eff71491eacfd 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index d6c0c3c9d5ad9..22bc9a7cf65f7 100644 +index 3db592470f262..75bfc32b6511b 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -438,7 +438,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -437,7 +437,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) profile_manager_android_ = std::make_unique(this); #endif @@ -134,7 +134,7 @@ index 3d5fd0d5ca858..965ab69b3fe8f 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 7b1fb9863deb6..d2821d03c4238 100644 +index 0d1d2e3661ff1..a97322b1d991d 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -9,6 +9,7 @@ @@ -145,7 +145,7 @@ index 7b1fb9863deb6..d2821d03c4238 100644 #include "chrome/browser/content_settings/content_settings_manager_delegate.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" -@@ -46,11 +47,14 @@ RendererUpdater::RendererUpdater(Profile* profile) +@@ -45,6 +46,7 @@ RendererUpdater::RendererUpdater(Profile* profile) #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) , bound_session_cookie_refresh_service_( @@ -153,13 +153,6 @@ index 7b1fb9863deb6..d2821d03c4238 100644 BoundSessionCookieRefreshServiceFactory::GetForProfile(profile)) #endif { -+ if (!cef::IsAlloyRuntimeEnabled()) { - identity_manager_observation_.Observe( - IdentityManagerFactory::GetForProfile(original_profile_)); -+ } - - #if BUILDFLAG(IS_CHROMEOS_ASH) - oauth2_login_manager_ = diff --git chrome/browser/profiles/renderer_updater_factory.cc chrome/browser/profiles/renderer_updater_factory.cc index ed5b366aa47ab..58ebe795e4636 100644 --- chrome/browser/profiles/renderer_updater_factory.cc diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 1e126dc6d..1812e4d56 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 df78bff8aeeb0..47d4f9ef83029 100644 +index 3c300d1896019..5ee89b96ce05e 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -32,6 +32,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_startup.patch b/patch/patches/chrome_browser_startup.patch index 3063b3f01..6a9b27c5a 100644 --- a/patch/patches/chrome_browser_startup.patch +++ b/patch/patches/chrome_browser_startup.patch @@ -1,12 +1,11 @@ diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc -index 3e2443d87a998..d751e0ad7c905 100644 +index a68953bd7f04a..9e25d6a3aede2 100644 --- chrome/browser/ui/startup/startup_browser_creator.cc +++ chrome/browser/ui/startup/startup_browser_creator.cc -@@ -581,6 +581,14 @@ void OpenNewWindowForFirstRun( - /*restore_tabbed_browser=*/true); +@@ -602,6 +602,13 @@ std::optional GetAppId(const base::CommandLine& command_line, } - #endif // BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(ENABLE_DICE_SUPPORT) -+ + #endif // BUILDFLAG(IS_CHROMEOS_ASH) + +StartupBrowserCreator::ProcessCommandLineCallback* +GetProcessCommandLineCallback() { + static base::NoDestructor @@ -17,7 +16,7 @@ index 3e2443d87a998..d751e0ad7c905 100644 } // namespace StartupProfileMode StartupProfileModeFromReason( -@@ -1457,6 +1465,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( +@@ -1470,6 +1477,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( {profile, mode}, last_opened_profiles); } @@ -30,7 +29,7 @@ index 3e2443d87a998..d751e0ad7c905 100644 // static void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( const base::CommandLine& command_line, -@@ -1466,6 +1480,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( +@@ -1479,6 +1492,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( return; } diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 5a0429d7d..0812e452f 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 a1d7adcdd27c4..d3dc736a04286 100644 +index 2bb525046619c..611fa1fb57369 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -140,6 +140,10 @@ bool IsPluginLoadingAccessibleResourceInWebView( @@ -42,10 +42,10 @@ index 438276b719c2f..69635e429be78 100644 const extensions::Extension* extension = registry->enabled_extensions().GetByID(extension_id); diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index 04a7dbd25904c..41103cee6e47f 100644 +index bf59360fb366d..df9547d986cf1 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -1002,6 +1002,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1011,6 +1011,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -53,7 +53,7 @@ index 04a7dbd25904c..41103cee6e47f 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1164,7 +1165,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1171,7 +1172,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -63,7 +63,7 @@ index 04a7dbd25904c..41103cee6e47f 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1173,7 +1175,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1180,7 +1182,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -73,7 +73,7 @@ index 04a7dbd25904c..41103cee6e47f 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1183,7 +1186,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1190,7 +1193,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 6f44237a8..169ff55fe 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 ddfdfd49ad2b2..1b53c56bb677f 100644 +index fd99154d7744e..ef2ba8773d116 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index ddfdfd49ad2b2..1b53c56bb677f 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -136,6 +137,7 @@ static_library("renderer") { +@@ -139,6 +140,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index ddfdfd49ad2b2..1b53c56bb677f 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -243,6 +245,10 @@ static_library("renderer") { +@@ -247,6 +249,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 32d99ed66..1396a5505 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 2b8628c707479..ffc5bfe8fd332 100644 +index 73b6ab0934b14..26f9334cdb668 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -41,6 +41,7 @@ @@ -10,7 +10,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #include "chrome/browser/buildflags.h" #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" -@@ -606,6 +607,9 @@ struct MainFunction { +@@ -613,6 +614,9 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -20,7 +20,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) // In debug builds of Lacros, we keep track of when the user data dir // is initialized, to ensure the cryptohome is not accessed before login -@@ -821,6 +825,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { +@@ -853,6 +857,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { ChromeMainDelegate::~ChromeMainDelegate() = default; #endif // !BUILDFLAG(IS_ANDROID) @@ -31,7 +31,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 std::optional ChromeMainDelegate::PostEarlyInitialization( InvokedIn invoked_in) { DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get()); -@@ -846,7 +854,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -878,7 +886,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( // future session's metrics. DeferBrowserMetrics(user_data_dir); @@ -40,7 +40,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 // In the case the process is not the singleton process, the uninstall tasks // need to be executed here. A window will be displayed asking to close all // running instances. -@@ -1013,7 +1021,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -1049,7 +1057,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( if (base::FeatureList::IsEnabled( features::kWriteBasicSystemProfileToPersistentHistogramsFile)) { @@ -50,7 +50,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #if BUILDFLAG(IS_ANDROID) record = base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions); -@@ -1473,6 +1482,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1520,6 +1529,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -58,7 +58,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 crash_reporter::InitializeCrashKeys(); #if BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -1491,6 +1501,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1538,6 +1548,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -66,7 +66,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #if BUILDFLAG(IS_WIN) child_process_logging::Init(); -@@ -1703,6 +1714,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1750,6 +1761,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } @@ -74,7 +74,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1738,6 +1750,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1785,6 +1797,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -82,7 +82,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 #if BUILDFLAG(ENABLE_PDF) MaybePatchGdiGetFontData(); -@@ -1863,6 +1876,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1910,6 +1923,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -90,7 +90,7 @@ index 2b8628c707479..ffc5bfe8fd332 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 = -@@ -1875,6 +1889,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1922,6 +1936,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -98,7 +98,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -1974,6 +1989,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -2021,6 +2036,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { channel == version_info::Channel::DEV); const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process; @@ -106,7 +106,7 @@ index 2b8628c707479..ffc5bfe8fd332 100644 memory_system::Initializer() .SetGwpAsanParameters(gwp_asan_boost_sampling, process_type) .SetProfilingClientParameters(channel, -@@ -1983,5 +1999,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -2030,5 +2046,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { memory_system::DispatcherParameters:: AllocationTraceRecorderInclusion::kDynamic, process_type) @@ -136,7 +136,7 @@ index 3553377e96017..5207128b768f2 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) std::unique_ptr lacros_service_; diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 250bfa002ee25..e03ef004592d1 100644 +index 1d9bfb1c1d651..6a016c5d55b1e 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -52,6 +52,7 @@ @@ -147,7 +147,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -504,7 +505,7 @@ void ProcessSingletonNotificationCallbackImpl( +@@ -513,7 +514,7 @@ void ProcessSingletonNotificationCallbackImpl( return; } @@ -156,7 +156,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // The uninstall command-line switch is handled by the origin process; see // ChromeMainDelegate::PostEarlyInitialization(...). The other process won't // be able to become the singleton process and will display a window asking -@@ -800,7 +801,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { +@@ -816,7 +817,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { return content::RESULT_CODE_NORMAL_EXIT; } @@ -165,7 +165,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // If we are running stale binaries then relaunch and exit immediately. if (upgrade_util::IsRunningOldChrome()) { if (!upgrade_util::RelaunchChromeBrowser( -@@ -813,7 +814,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { +@@ -829,7 +830,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { // result in browser startup bailing. return chrome::RESULT_CODE_NORMAL_EXIT_UPGRADE_RELAUNCHED; } @@ -174,7 +174,7 @@ index 250bfa002ee25..e03ef004592d1 100644 return load_local_state_result; } -@@ -919,7 +920,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( +@@ -935,7 +936,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( browser_process_->local_state()); platform_management_service->RefreshCache(base::NullCallback()); @@ -183,7 +183,7 @@ index 250bfa002ee25..e03ef004592d1 100644 if (first_run::IsChromeFirstRun()) { bool stats_default; if (GoogleUpdateSettings::GetCollectStatsConsentDefault(&stats_default)) { -@@ -932,7 +933,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( +@@ -948,7 +949,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( : metrics::EnableMetricsDefault::OPT_IN); } } @@ -192,7 +192,7 @@ index 250bfa002ee25..e03ef004592d1 100644 std::string locale = startup_data_->chrome_feature_list_creator()->actual_locale(); -@@ -965,6 +966,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -981,6 +982,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) master_prefs_ = std::make_unique(); @@ -200,7 +200,7 @@ index 250bfa002ee25..e03ef004592d1 100644 std::unique_ptr installer_initial_prefs = startup_data_->chrome_feature_list_creator()->TakeInitialPrefs(); if (!installer_initial_prefs) -@@ -998,6 +1000,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -1014,6 +1016,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { master_prefs_->confirm_to_quit); } #endif // BUILDFLAG(IS_MAC) @@ -208,7 +208,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) return content::RESULT_CODE_NORMAL_EXIT; } -@@ -1064,6 +1067,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1080,6 +1083,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { browser_process_->browser_policy_connector()->OnResourceBundleCreated(); @@ -216,7 +216,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // Android does first run in Java instead of native. // Chrome OS has its own out-of-box-experience code. #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -@@ -1085,6 +1089,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1101,6 +1105,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) @@ -224,7 +224,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #if BUILDFLAG(IS_MAC) #if defined(ARCH_CPU_X86_64) -@@ -1455,6 +1460,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1463,6 +1468,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->PreMainMessageLoopRun(); #if BUILDFLAG(IS_WIN) @@ -232,7 +232,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // If the command line specifies 'uninstall' then we need to work here // unless we detect another chrome browser running. if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUninstall)) { -@@ -1466,6 +1472,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1474,6 +1480,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { return ChromeBrowserMainPartsWin::HandleIconsCommands( *base::CommandLine::ForCurrentProcess()); } @@ -240,7 +240,7 @@ index 250bfa002ee25..e03ef004592d1 100644 ui::SelectFileDialog::SetFactory( std::make_unique()); -@@ -1491,6 +1498,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1499,6 +1506,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // BUILDFLAG(CHROME_FOR_TESTING) @@ -248,7 +248,7 @@ index 250bfa002ee25..e03ef004592d1 100644 if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMakeDefaultBrowser)) { bool is_managed = g_browser_process->local_state()->IsManagedPreference( -@@ -1504,18 +1512,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1512,18 +1520,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { ? static_cast(content::RESULT_CODE_NORMAL_EXIT) : static_cast(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); } @@ -271,7 +271,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING) // Begin relaunch processing immediately if User Data migration is required -@@ -1554,7 +1566,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1562,7 +1574,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) @@ -280,7 +280,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // Check if there is any machine level Chrome installed on the current // machine. If yes and the current Chrome process is user level, we do not // allow the user level Chrome to run. So we notify the user and uninstall -@@ -1563,7 +1575,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1571,7 +1583,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // obtained but before potentially creating the first run sentinel). if (ChromeBrowserMainPartsWin::CheckMachineLevelInstall()) return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; @@ -289,7 +289,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // Desktop construction occurs here, (required before profile creation). PreProfileInit(); -@@ -1606,12 +1618,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1614,12 +1626,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->local_state()); } @@ -304,7 +304,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #if BUILDFLAG(IS_ANDROID) page_info::SetPageInfoClient(new ChromePageInfoClient()); -@@ -1638,6 +1652,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1646,6 +1660,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Call `PostProfileInit()`and set it up for profiles created later. profile_init_manager_ = std::make_unique(this, profile); @@ -312,7 +312,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) // Execute first run specific code after the PrefService has been initialized // and preferences have been registered since some of the import code depends -@@ -1677,6 +1692,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1685,6 +1700,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { *base::CommandLine::ForCurrentProcess()); } #endif // BUILDFLAG(IS_WIN) @@ -320,7 +320,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // Configure modules that need access to resources. net::NetModule::SetResourceProvider(ChromeNetResourceProvider); -@@ -1756,6 +1772,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1770,6 +1786,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { g_browser_process->profile_manager()->GetLastOpenedProfiles(); } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -332,7 +332,7 @@ index 250bfa002ee25..e03ef004592d1 100644 // This step is costly. if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(), base::FilePath(), profile_info, -@@ -1788,11 +1809,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1802,11 +1823,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -348,7 +348,7 @@ index 250bfa002ee25..e03ef004592d1 100644 #endif // !BUILDFLAG(IS_ANDROID) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index d39c7d82a6bd8..f3a4072b53cb1 100644 +index 2f0fe9d22667c..f50fe7bf75df3 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm @@ -16,6 +16,7 @@ @@ -359,7 +359,7 @@ index d39c7d82a6bd8..f3a4072b53cb1 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -104,6 +105,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -105,6 +106,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { } #endif // !BUILDFLAG(CHROME_FOR_TESTING) @@ -367,7 +367,7 @@ index d39c7d82a6bd8..f3a4072b53cb1 100644 // Create the app delegate by requesting the shared AppController. CHECK_EQ(nil, NSApp.delegate); AppController* app_controller = AppController.sharedController; -@@ -112,6 +114,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -113,6 +115,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -375,7 +375,7 @@ index d39c7d82a6bd8..f3a4072b53cb1 100644 ui::WarmScreenCapture(); -@@ -149,5 +152,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, +@@ -152,5 +155,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, } void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { @@ -384,7 +384,7 @@ index d39c7d82a6bd8..f3a4072b53cb1 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 2edb319d98a50..79e89bbeb76d9 100644 +index 66b50cf0fd99b..f2e2cc47a513e 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -47,6 +47,7 @@ @@ -395,7 +395,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 #include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bluetooth/chrome_bluetooth_delegate_impl_client.h" -@@ -1419,6 +1420,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { +@@ -1423,6 +1424,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { } ChromeContentBrowserClient::ChromeContentBrowserClient() { @@ -404,7 +404,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 #if BUILDFLAG(ENABLE_PLUGINS) extra_parts_.push_back( std::make_unique()); -@@ -1451,6 +1454,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { +@@ -1460,6 +1463,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { } } @@ -416,7 +416,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 // static void ChromeContentBrowserClient::RegisterLocalStatePrefs( PrefRegistrySimple* registry) { -@@ -4327,9 +4335,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -4375,9 +4383,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // BUILDFLAG(IS_ANDROID) @@ -428,7 +428,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -@@ -6424,7 +6434,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( +@@ -6484,7 +6494,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -437,7 +437,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -6442,6 +6452,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( +@@ -6502,6 +6512,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = GetApplicationLocale(); } @@ -446,7 +446,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 } std::vector -@@ -7570,10 +7582,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( +@@ -7627,10 +7639,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( const auto now = base::TimeTicks::Now(); const auto timeout = GetKeepaliveTimerTimeout(context); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); @@ -459,7 +459,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 FROM_HERE, keepalive_deadline_ - now, base::BindOnce( &ChromeContentBrowserClient::OnKeepaliveTimerFired, -@@ -7592,7 +7604,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { +@@ -7649,7 +7661,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { --num_keepalive_requests_; if (num_keepalive_requests_ == 0) { DVLOG(1) << "Stopping the keepalive timer"; @@ -469,7 +469,7 @@ index 2edb319d98a50..79e89bbeb76d9 100644 // This deletes the keep alive handle attached to the timer function and // unblock the shutdown sequence. } -@@ -7734,7 +7747,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( +@@ -7789,7 +7802,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( const auto now = base::TimeTicks::Now(); const auto then = keepalive_deadline_; if (now < then) { @@ -479,10 +479,10 @@ index 2edb319d98a50..79e89bbeb76d9 100644 base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, weak_factory_.GetWeakPtr(), diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index 19679fa14ef4e..d925433c974f3 100644 +index d8f6e1ea5f843..27172c75e4c3a 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -143,6 +143,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -144,6 +144,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { ~ChromeContentBrowserClient() override; @@ -491,7 +491,7 @@ index 19679fa14ef4e..d925433c974f3 100644 // TODO(https://crbug.com/787567): This file is about calls from content/ out // to chrome/ to get values or notify about events, but both of these // functions are from chrome/ to chrome/ and don't involve content/ at all. -@@ -675,7 +677,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -681,7 +683,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; @@ -500,7 +500,7 @@ index 19679fa14ef4e..d925433c974f3 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1174,7 +1176,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -1184,7 +1186,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if !BUILDFLAG(IS_ANDROID) uint64_t num_keepalive_requests_ = 0; @@ -510,7 +510,7 @@ index 19679fa14ef4e..d925433c974f3 100644 #endif diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 2ab6e767c3741..feb206b86b0fa 100644 +index 5eef5cdedda4c..d0c16b6d70585 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -16,6 +16,7 @@ @@ -532,7 +532,7 @@ index 2ab6e767c3741..feb206b86b0fa 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1659,7 +1664,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1679,7 +1684,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) #endif // BUILDFLAG(IS_WIN) @@ -542,7 +542,7 @@ index 2ab6e767c3741..feb206b86b0fa 100644 downgrade::RegisterPrefs(registry); #endif -@@ -1691,6 +1697,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1711,6 +1717,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); @@ -554,7 +554,7 @@ index 2ab6e767c3741..feb206b86b0fa 100644 } // Register prefs applicable to all profiles. -@@ -2126,6 +2137,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -2145,6 +2156,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, const std::string& locale) { RegisterProfilePrefs(registry, locale); diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index 75f4eb113..5adc297c9 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 81a995b02dd7b..c539455c80ccc 100644 +index 3bf48f1897c93..a9b219500beac 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -400,6 +400,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -41,10 +41,10 @@ index 81a995b02dd7b..c539455c80ccc 100644 bool BrowserCommandController::IsWebAppOrCustomTab() const { diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc -index 23eef8b20393f..023f1286636a5 100644 +index 8cdbf6a389727..715078e9d0a2c 100644 --- chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc -@@ -603,6 +603,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( +@@ -709,6 +709,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( } } @@ -102,7 +102,7 @@ index 23eef8b20393f..023f1286636a5 100644 } // namespace //////////////////////////////////////////////////////////////////////////////// -@@ -1465,7 +1516,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { +@@ -1571,7 +1622,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { return false; } @@ -111,7 +111,7 @@ index 23eef8b20393f..023f1286636a5 100644 GlobalError* error = GlobalErrorServiceFactory::GetForProfile(browser_->profile()) ->GetGlobalErrorByMenuItemCommandID(command_id); -@@ -1480,6 +1531,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { +@@ -1586,6 +1637,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { } } @@ -142,7 +142,7 @@ index 23eef8b20393f..023f1286636a5 100644 bool AppMenuModel::IsCommandIdAlerted(int command_id) const { if (command_id == IDC_VIEW_PASSWORDS || command_id == IDC_SHOW_PASSWORD_MANAGER) { -@@ -1647,11 +1722,15 @@ void AppMenuModel::Build() { +@@ -1753,11 +1828,15 @@ void AppMenuModel::Build() { kDefaultIconSize)); } @@ -163,7 +163,7 @@ index 23eef8b20393f..023f1286636a5 100644 AddItemWithStringId(IDC_PRINT, IDS_PRINT); -@@ -1757,9 +1836,13 @@ void AppMenuModel::Build() { +@@ -1870,9 +1949,13 @@ void AppMenuModel::Build() { kMoreToolsMenuItem); if (!features::IsChromeRefresh2023()) { @@ -180,7 +180,7 @@ index 23eef8b20393f..023f1286636a5 100644 } if (!features::IsChromeRefresh2023()) { -@@ -1848,6 +1931,11 @@ void AppMenuModel::Build() { +@@ -1961,6 +2044,11 @@ void AppMenuModel::Build() { SetCommandIcon(this, IDC_EXIT, kExitMenuIcon); } @@ -193,10 +193,10 @@ index 23eef8b20393f..023f1286636a5 100644 } diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h -index d7c9df2e12df2..5dd6080454806 100644 +index e9d46ee3b2250..0b1b19140c42e 100644 --- chrome/browser/ui/toolbar/app_menu_model.h +++ chrome/browser/ui/toolbar/app_menu_model.h -@@ -215,6 +215,7 @@ class AppMenuModel : public ui::SimpleMenuModel, +@@ -218,6 +218,7 @@ class AppMenuModel : public ui::SimpleMenuModel, void ExecuteCommand(int command_id, int event_flags) override; bool IsCommandIdChecked(int command_id) const override; bool IsCommandIdEnabled(int command_id) const override; @@ -204,7 +204,7 @@ index d7c9df2e12df2..5dd6080454806 100644 bool IsCommandIdAlerted(int command_id) const override; bool IsElementIdAlerted(ui::ElementIdentifier element_id) const override; bool GetAcceleratorForCommandId(int command_id, -@@ -256,6 +257,8 @@ class AppMenuModel : public ui::SimpleMenuModel, +@@ -259,6 +260,8 @@ class AppMenuModel : public ui::SimpleMenuModel, safety_hub::SafetyHubModuleType sh_module, int event_flags); @@ -214,22 +214,24 @@ index d7c9df2e12df2..5dd6080454806 100644 // Adds actionable global error menu items to the menu. // Examples: Extension permissions and sign in errors. diff --git chrome/browser/ui/views/find_bar_host.cc chrome/browser/ui/views/find_bar_host.cc -index ec8ddcf73c5a4..f456d66886c0f 100644 +index 0ccfe39eb5696..c9424316b6d14 100644 --- chrome/browser/ui/views/find_bar_host.cc +++ chrome/browser/ui/views/find_bar_host.cc -@@ -412,6 +412,12 @@ void FindBarHost::GetWidgetBounds(gfx::Rect* bounds) { +@@ -581,6 +581,14 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { // The BrowserView does Layout for the components that we care about // positioning relative to, so we ask it to tell us where we should go. - *bounds = browser_view()->GetFindBarBoundingBox(); + gfx::Rect find_bar_bounds = browser_view_->GetFindBarBoundingBox(); + +#if BUILDFLAG(ENABLE_CEF) -+ if (browser_view()->browser() && browser_view()->browser()->cef_delegate()) { -+ browser_view()->browser()->cef_delegate()->UpdateFindBarBoundingBox(bounds); ++ if (browser_view_->browser() && browser_view_->browser()->cef_delegate()) { ++ browser_view_->browser()->cef_delegate()->UpdateFindBarBoundingBox( ++ &find_bar_bounds); + } +#endif - } - - void FindBarHost::RegisterAccelerators() { ++ + if (find_bar_bounds.IsEmpty()) { + return gfx::Rect(); + } diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc index cce1835d35be3..5ac27ca62876a 100644 --- chrome/browser/ui/views/frame/browser_frame.cc @@ -363,10 +365,10 @@ index 2e973c9e279b0..12b62efb8071f 100644 BrowserFrame(const BrowserFrame&) = delete; BrowserFrame& operator=(const BrowserFrame&) = delete; diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index 874b4502f94e2..8c15da46dad67 100644 +index f764d5edc704c..b7d5ee188736e 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -347,11 +347,10 @@ using content::NativeWebKeyboardEvent; +@@ -351,11 +351,10 @@ using content::NativeWebKeyboardEvent; using content::WebContents; using web_modal::WebContentsModalDialogHost; @@ -381,7 +383,7 @@ index 874b4502f94e2..8c15da46dad67 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) // UMA histograms that record animation smoothness for tab loading animation. -@@ -678,6 +677,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { +@@ -688,6 +687,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { return browser_view_->frame()->GetTopInset() - browser_view_->y(); } @@ -396,7 +398,7 @@ index 874b4502f94e2..8c15da46dad67 100644 bool IsToolbarVisible() const override { return browser_view_->IsToolbarVisible(); } -@@ -829,11 +836,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -839,11 +846,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -419,9 +421,9 @@ index 874b4502f94e2..8c15da46dad67 100644 // Store the actions so that the access is available for other classes. if (features::IsSidePanelPinningEnabled()) { browser_->SetUserData(BrowserActions::UserDataKey(), -@@ -938,8 +955,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -944,8 +961,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( - devtools_web_view_, contents_web_view_, watermark_view)); + devtools_web_view_, contents_web_view_, watermark_view_)); - toolbar_ = top_container_->AddChildView( - std::make_unique(browser_.get(), this)); @@ -437,7 +439,7 @@ index 874b4502f94e2..8c15da46dad67 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1013,7 +1037,9 @@ BrowserView::~BrowserView() { +@@ -1022,7 +1046,9 @@ BrowserView::~BrowserView() { // All the tabs should have been destroyed already. If we were closed by the // OS with some tabs than the NativeBrowserFrame should have destroyed them. @@ -447,7 +449,7 @@ index 874b4502f94e2..8c15da46dad67 100644 // Stop the animation timer explicitly here to avoid running it in a nested // message loop, which may run by Browser destructor. -@@ -1027,12 +1053,14 @@ BrowserView::~BrowserView() { +@@ -1036,12 +1062,14 @@ BrowserView::~BrowserView() { // child views and it is an observer for avatar toolbar button if any. autofill_bubble_handler_.reset(); @@ -462,7 +464,7 @@ index 874b4502f94e2..8c15da46dad67 100644 // The TabStrip attaches a listener to the model. Make sure we shut down the // TabStrip first so that it can cleanly remove the listener. -@@ -1050,7 +1078,9 @@ BrowserView::~BrowserView() { +@@ -1065,7 +1093,9 @@ BrowserView::~BrowserView() { // `SidePanelUI::RemoveSidePanelUIForBrowser()` deletes the // SidePanelCoordinator. @@ -472,7 +474,7 @@ index 874b4502f94e2..8c15da46dad67 100644 } // static -@@ -2003,9 +2033,14 @@ void BrowserView::OnExclusiveAccessUserInput() { +@@ -2039,9 +2069,14 @@ void BrowserView::OnExclusiveAccessUserInput() { bool BrowserView::ShouldHideUIForFullscreen() const { // Immersive mode needs UI for the slide-down top panel. @@ -488,7 +490,7 @@ index 874b4502f94e2..8c15da46dad67 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -3123,7 +3158,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { +@@ -3172,7 +3207,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { } DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() { @@ -498,7 +500,7 @@ index 874b4502f94e2..8c15da46dad67 100644 if (auto* download_button = toolbar_button_provider_->GetDownloadButton()) return download_button->bubble_controller(); return nullptr; -@@ -3678,7 +3714,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { +@@ -3727,7 +3763,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { if (top_container()->parent() == this) return; @@ -508,7 +510,7 @@ index 874b4502f94e2..8c15da46dad67 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -4159,11 +4196,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { +@@ -4209,11 +4246,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { bool BrowserView::ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) { @@ -549,7 +551,7 @@ index 874b4502f94e2..8c15da46dad67 100644 // Draggable regions are defined relative to the web contents. gfx::Point point_in_contents_web_view_coords(location); views::View::ConvertPointToTarget(GetWidget()->GetRootView(), -@@ -4172,7 +4236,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( +@@ -4222,7 +4286,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( // Draggable regions should be ignored for clicks into any browser view's // owned widgets, for example alerts, permission prompts or find bar. @@ -558,7 +560,7 @@ index 874b4502f94e2..8c15da46dad67 100644 point_in_contents_web_view_coords.x(), point_in_contents_web_view_coords.y()) || WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords); -@@ -4283,8 +4347,10 @@ void BrowserView::Layout(PassKey) { +@@ -4333,8 +4397,10 @@ void BrowserView::Layout(PassKey) { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -571,7 +573,7 @@ index 874b4502f94e2..8c15da46dad67 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -4350,6 +4416,11 @@ void BrowserView::AddedToWidget() { +@@ -4400,6 +4466,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -583,7 +585,7 @@ index 874b4502f94e2..8c15da46dad67 100644 toolbar_->Init(); // TODO(pbos): Investigate whether the side panels should be creatable when -@@ -4398,13 +4469,9 @@ void BrowserView::AddedToWidget() { +@@ -4448,13 +4519,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -599,7 +601,7 @@ index 874b4502f94e2..8c15da46dad67 100644 using_native_frame_ = frame_->ShouldUseNativeFrame(); MaybeInitializeWebUITabStrip(); -@@ -4830,7 +4897,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, +@@ -4885,7 +4952,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, // Undo our anti-jankiness hacks and force a re-layout. in_process_fullscreen_ = false; ToolbarSizeChanged(false); @@ -609,7 +611,7 @@ index 874b4502f94e2..8c15da46dad67 100644 } bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { -@@ -5241,6 +5309,8 @@ Profile* BrowserView::GetProfile() { +@@ -5307,6 +5375,8 @@ Profile* BrowserView::GetProfile() { } void BrowserView::UpdateUIForTabFullscreen() { @@ -618,7 +620,7 @@ index 874b4502f94e2..8c15da46dad67 100644 frame()->GetFrameView()->UpdateFullscreenTopUI(); } -@@ -5263,6 +5333,8 @@ void BrowserView::HideDownloadShelf() { +@@ -5329,6 +5399,8 @@ void BrowserView::HideDownloadShelf() { } bool BrowserView::CanUserExitFullscreen() const { @@ -628,10 +630,10 @@ index 874b4502f94e2..8c15da46dad67 100644 } diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 88686b784dac3..fc0e55b165626 100644 +index 836b5aa549183..a336aca64101d 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -132,11 +132,16 @@ class BrowserView : public BrowserWindow, +@@ -137,11 +137,16 @@ class BrowserView : public BrowserWindow, METADATA_HEADER(BrowserView, views::ClientView) public: @@ -648,7 +650,7 @@ index 88686b784dac3..fc0e55b165626 100644 void set_frame(BrowserFrame* frame) { frame_ = frame; paint_as_active_subscription_ = -@@ -847,6 +852,9 @@ class BrowserView : public BrowserWindow, +@@ -863,6 +868,9 @@ class BrowserView : public BrowserWindow, const gfx::Rect& contents_webview_bounds, const gfx::Rect& local_webview_container_bounds); @@ -777,10 +779,10 @@ index 71445bfab1824..c77750ea2a820 100644 ContentsWebView::~ContentsWebView() { diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc -index dfb8331c4126c..3f2bfe9354c4d 100644 +index ee9e4cf7d4d92..e6c53660a4407 100644 --- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc +++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc -@@ -580,6 +580,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( +@@ -610,6 +610,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( frame->GetNativeWindow()->SetEventTargeter( std::make_unique()); #endif @@ -792,7 +794,7 @@ index dfb8331c4126c..3f2bfe9354c4d 100644 } PictureInPictureBrowserFrameView::~PictureInPictureBrowserFrameView() { -@@ -707,18 +712,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( +@@ -737,18 +742,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( int PictureInPictureBrowserFrameView::NonClientHitTest( const gfx::Point& point) { @@ -843,7 +845,7 @@ index dfb8331c4126c..3f2bfe9354c4d 100644 // Allow dragging and resizing the window. int window_component = GetHTComponentForFrame( -@@ -787,7 +816,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) { +@@ -817,7 +846,8 @@ void PictureInPictureBrowserFrameView::Layout(PassKey) { gfx::Rect content_area = GetLocalBounds(); content_area.Inset(FrameBorderInsets()); gfx::Rect top_bar = content_area; @@ -853,7 +855,7 @@ index dfb8331c4126c..3f2bfe9354c4d 100644 top_bar_container_view_->SetBoundsRect(top_bar); #if !BUILDFLAG(IS_ANDROID) if (auto_pip_setting_overlay_) { -@@ -1259,7 +1289,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const { +@@ -1309,7 +1339,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const { } int PictureInPictureBrowserFrameView::GetTopAreaHeight() const { @@ -878,10 +880,10 @@ index b862ceac7225d..9575440a77d67 100644 LocationBarView* location_bar_view = browser_view_->GetLocationBarView(); CHECK(location_bar_view); diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc -index b6e4a01ae450d..14b7fd84ed7df 100644 +index 55d99c5f53e92..172ac465b6f21 100644 --- chrome/browser/ui/views/page_action/page_action_icon_controller.cc +++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc -@@ -98,6 +98,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, +@@ -97,6 +97,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, }; for (PageActionIconType type : params.types_enabled) { @@ -895,7 +897,7 @@ index b6e4a01ae450d..14b7fd84ed7df 100644 case PageActionIconType::kPaymentsOfferNotification: add_page_action_icon( diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index e864e22e920c8..0b82bf831be8f 100644 +index a8fc1df0e8fae..cc496ba91716e 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -554,29 +554,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -941,7 +943,7 @@ index e864e22e920c8..0b82bf831be8f 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 8ee63a3430928..5a296e7dfe09c 100644 +index d65dc839c20e7..9f75bbb517b69 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc @@ -191,7 +191,7 @@ class TabstripLikeBackground : public views::Background { @@ -1036,7 +1038,7 @@ index 8ee63a3430928..5a296e7dfe09c 100644 side_panel_container_ = container_view_->AddChildView( std::make_unique(browser_view_)); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 53f8ff18e0119..05d005f026d33 100644 +index 325b73a399d3f..9242aed24ef35 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h @@ -93,7 +93,8 @@ class ToolbarView : public views::AccessiblePaneView, diff --git a/patch/patches/chrome_sad_tab_error.patch b/patch/patches/chrome_sad_tab_error.patch index a5d7dbde6..3e9fef395 100644 --- a/patch/patches/chrome_sad_tab_error.patch +++ b/patch/patches/chrome_sad_tab_error.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/views/sad_tab_view.cc chrome/browser/ui/views/sad_tab_view.cc -index 26d1d804f74e7..87f411df5a49c 100644 +index 5a3aa5c05907e..3630c7496fb70 100644 --- chrome/browser/ui/views/sad_tab_view.cc +++ chrome/browser/ui/views/sad_tab_view.cc @@ -680,6 +680,11 @@ void SadTabView::OnBoundsChanged(const gfx::Rect& previous_bounds) { diff --git a/patch/patches/chrome_watermark_5388128.patch b/patch/patches/chrome_watermark_5388128.patch new file mode 100644 index 000000000..4f804a31b --- /dev/null +++ b/patch/patches/chrome_watermark_5388128.patch @@ -0,0 +1,42 @@ +diff --git chrome/browser/enterprise/watermark/watermark_view.cc chrome/browser/enterprise/watermark/watermark_view.cc +index f48b59cd4fe50..3ed5a896a142c 100644 +--- chrome/browser/enterprise/watermark/watermark_view.cc ++++ chrome/browser/enterprise/watermark/watermark_view.cc +@@ -8,6 +8,7 @@ + #include + #include + ++#include "base/no_destructor.h" + #include "cc/paint/paint_canvas.h" + #include "ui/base/metadata/metadata_impl_macros.h" + #include "ui/compositor/layer.h" +@@ -27,8 +28,8 @@ constexpr double kRotationAngle = 45; + constexpr SkColor kFillColor = SkColorSetARGB(0x12, 0x00, 0x00, 0x00); + constexpr SkColor kOutlineColor = SkColorSetARGB(0x27, 0xff, 0xff, 0xff); + +-const gfx::Font& WatermarkFont() { +- static gfx::Font font( ++gfx::Font WatermarkFont() { ++ return gfx::Font( + #if BUILDFLAG(IS_WIN) + "Segoe UI", + #elif BUILDFLAG(IS_MAC) +@@ -41,7 +42,6 @@ const gfx::Font& WatermarkFont() { + "sans-serif", + #endif + kTextSize); +- return font; + } + + gfx::Font::Weight WatermarkFontWeight() { +@@ -53,8 +53,8 @@ gfx::Font::Weight WatermarkFontWeight() { + } + + const gfx::FontList& WatermarkFontList() { +- static gfx::FontList font_list(WatermarkFont()); +- return font_list; ++ static base::NoDestructor font_list(WatermarkFont()); ++ return *font_list; + } + + std::unique_ptr CreateRenderText(const gfx::Rect& display_rect, diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index d9dbd20d6..2f9224c6c 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -68,10 +68,10 @@ index 6af484f35f576..2462700b6d1fb 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index ee83c6167eb18..44ed50b19bd70 100644 +index fcd7f310c8b3b..eaa5f17a011d5 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn -@@ -35,6 +35,7 @@ component("controller") { +@@ -38,6 +38,7 @@ component("controller") { } configs += [ @@ -79,7 +79,7 @@ index ee83c6167eb18..44ed50b19bd70 100644 "//third_party/blink/renderer:config", "//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:non_test_config", -@@ -60,6 +61,8 @@ component("controller") { +@@ -63,6 +64,8 @@ component("controller") { "performance_manager/v8_detailed_memory_reporter_impl.h", "performance_manager/v8_worker_memory_reporter.cc", "performance_manager/v8_worker_memory_reporter.h", diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index fe9f56f26..79612f6b8 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -12,37 +12,45 @@ index b7430b7d7027f..721144dde86d8 100644 version.Set("V8-Version", V8_VERSION_STRING); std::string host = info.GetHeaderValue("host"); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 6e7e22ee886fa..97d0184ceae99 100644 +index a6312cc67ff70..bcf78a6fbf59d 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -785,6 +785,22 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() { - : nullptr, - &loader_factory); - -+ if (!handled) { -+ handled = GetContentClient()->browser()->HandleExternalProtocol( -+ web_contents_getter_, frame_tree_node_id_, -+ navigation_ui_data_.get(), request_info_->is_primary_main_frame, -+ FrameTreeNode::GloballyFindByID(frame_tree_node_id_) -+ ->IsInFencedFrameTree(), -+ request_info_->sandbox_flags, -+ *resource_request_, initiating_origin, -+ request_info_->initiator_document_token -+ ? RenderFrameHostImpl::FromDocumentToken( -+ request_info_->initiator_process_id, -+ *request_info_->initiator_document_token) -+ : nullptr, -+ &loader_factory); -+ } +@@ -843,7 +843,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( + mojo::PendingRemote + terminal_external_protocol; + bool handled = GetContentClient()->browser()->HandleExternalProtocol( +- resource_request.url, std::move(web_contents_getter), ++ resource_request.url, web_contents_getter, + frame_tree_node->frame_tree_node_id(), navigation_ui_data, + request_info.is_primary_main_frame, + frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags, +@@ -855,6 +855,21 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory( + *request_info.initiator_document_token) + : nullptr, + &terminal_external_protocol); + - if (loader_factory) { - factory = std::move(factory_builder).Finish(std::move(loader_factory)); - } else { ++ if (!handled) { ++ handled = GetContentClient()->browser()->HandleExternalProtocol( ++ web_contents_getter, frame_tree_node->frame_tree_node_id(), ++ navigation_ui_data, request_info.is_primary_main_frame, ++ frame_tree_node->IsInFencedFrameTree(), request_info.sandbox_flags, ++ resource_request, initiating_origin, ++ request_info.initiator_document_token ++ ? RenderFrameHostImpl::FromDocumentToken( ++ request_info.initiator_process_id, ++ *request_info.initiator_document_token) ++ : nullptr, ++ &terminal_external_protocol); ++ } ++ + if (terminal_external_protocol) { + return std::make_pair( + /*is_cacheable=*/false, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 737dcbdee639d..1344e564a9d1f 100644 +index f697700af13bb..a4ff32f2357b6 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc -@@ -1071,7 +1071,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( +@@ -1087,7 +1087,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( void ContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) {} @@ -51,7 +59,7 @@ index 737dcbdee639d..1344e564a9d1f 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1080,6 +1080,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( +@@ -1096,6 +1096,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = "en-us,en"; @@ -60,18 +68,10 @@ index 737dcbdee639d..1344e564a9d1f 100644 std::vector diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 26999a1fa55c7..1c5fbd03212f1 100644 +index 6135759cb7f39..6c1a6fc6c5f76 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -43,6 +43,7 @@ - #include "content/public/browser/mojo_binder_policy_map.h" - #include "content/public/browser/privacy_sandbox_invoking_api.h" - #include "content/public/browser/storage_partition_config.h" -+#include "content/public/browser/web_contents.h" - #include "content/public/common/alternative_error_page_override_info.mojom-forward.h" - #include "content/public/common/page_visibility_state.h" - #include "content/public/common/window_container_type.mojom-forward.h" -@@ -2018,7 +2019,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2056,7 +2056,7 @@ class CONTENT_EXPORT ContentBrowserClient { // // If |relative_partition_path| is the empty string, it means this needs to // create the default NetworkContext for the BrowserContext. @@ -80,27 +80,29 @@ index 26999a1fa55c7..1c5fbd03212f1 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -2238,6 +2239,19 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2277,6 +2277,21 @@ class CONTENT_EXPORT ContentBrowserClient { RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory); + // Same as above, but exposing the whole ResourceRequest object. + virtual bool HandleExternalProtocol( -+ WebContents::Getter web_contents_getter, ++ base::RepeatingCallback web_contents_getter, + int frame_tree_node_id, + NavigationUIData* navigation_data, + bool is_primary_main_frame, + bool is_in_fenced_frame_tree, + network::mojom::WebSandboxFlags sandbox_flags, + const network::ResourceRequest& request, -+ const absl::optional& initiating_origin, ++ const std::optional& initiating_origin, + RenderFrameHost* initiator_document, -+ mojo::PendingRemote* out_factory) { return false; } ++ mojo::PendingRemote* out_factory) { ++ return false; ++ } + // Creates an OverlayWindow to be used for video or Picture-in-Picture. // This window will house the content shown when in Picture-in-Picture mode. // This will return a new OverlayWindow. -@@ -2295,6 +2309,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2334,6 +2349,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -112,10 +114,10 @@ index 26999a1fa55c7..1c5fbd03212f1 100644 // on blink::features::kUserAgentReduction. Content may cache this value. virtual std::string GetUserAgent(); diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index ff20508d76a60..03a83b28fd678 100644 +index 4399fe2564a03..27837055b2133 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -101,6 +101,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -103,6 +103,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -125,7 +127,7 @@ index ff20508d76a60..03a83b28fd678 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -324,6 +327,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -327,6 +330,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -137,7 +139,7 @@ index ff20508d76a60..03a83b28fd678 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index fef1829ebda85..23df06b6c60bb 100644 +index 3594bc7a25c95..198eed029d65d 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc @@ -545,6 +545,8 @@ void RenderThreadImpl::Init() { @@ -150,10 +152,10 @@ index fef1829ebda85..23df06b6c60bb 100644 base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 132aca6cb29e9..39374c08425b1 100644 +index 033169bbdd94d..f8bd867f76eba 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1011,6 +1011,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -1009,6 +1009,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -170,7 +172,7 @@ index 132aca6cb29e9..39374c08425b1 100644 RendererBlinkPlatformImpl::CreateWebV8ValueConverter() { return std::make_unique(); diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index c1b86ec95d41c..8dca87a7201a4 100644 +index 89fd49fe34afa..98f9b71b7c259 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h @@ -237,6 +237,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { @@ -184,10 +186,10 @@ index c1b86ec95d41c..8dca87a7201a4 100644 // plus eTLD+1, such as https://google.com), or to a more specific origin. void SetIsLockedToSite(); diff --git content/shell/browser/shell_content_browser_client.cc content/shell/browser/shell_content_browser_client.cc -index 194a43ae9f6ee..77d6b4bf2a810 100644 +index 74273b9ed981f..9baaec119d346 100644 --- content/shell/browser/shell_content_browser_client.cc +++ content/shell/browser/shell_content_browser_client.cc -@@ -728,7 +728,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( +@@ -732,7 +732,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -196,7 +198,7 @@ index 194a43ae9f6ee..77d6b4bf2a810 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -737,6 +737,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( +@@ -741,6 +741,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { ConfigureNetworkContextParamsForShell(context, network_context_params, cert_verifier_creation_params); @@ -205,11 +207,11 @@ index 194a43ae9f6ee..77d6b4bf2a810 100644 std::vector diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h -index 0fa1c7c38a387..5d878d3fda793 100644 +index f73d9b1264238..145052c3cadd4 100644 --- content/shell/browser/shell_content_browser_client.h +++ content/shell/browser/shell_content_browser_client.h -@@ -145,7 +145,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { - device::GeolocationManager* GetGeolocationManager() override; +@@ -146,7 +146,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { + GetGeolocationSystemPermissionManager() override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; - void ConfigureNetworkContextParams( @@ -218,7 +220,7 @@ index 0fa1c7c38a387..5d878d3fda793 100644 bool in_memory, const base::FilePath& relative_partition_path, diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc -index c9c460444236d..0fbdbed1da9d7 100644 +index fa3257b02184a..f770c7961f46d 100644 --- headless/lib/browser/headless_content_browser_client.cc +++ headless/lib/browser/headless_content_browser_client.cc @@ -299,7 +299,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed( @@ -239,7 +241,7 @@ index c9c460444236d..0fbdbed1da9d7 100644 std::string HeadlessContentBrowserClient::GetProduct() { diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h -index a460fe14c56e2..7c72cdec1193e 100644 +index c5413f8d2979f..f323ff7843dc4 100644 --- headless/lib/browser/headless_content_browser_client.h +++ headless/lib/browser/headless_content_browser_client.h @@ -83,7 +83,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient { diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index ac8239e76..6380e30e2 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,5 +1,18 @@ +diff --git base/process/set_process_title.cc base/process/set_process_title.cc +index 79ba3ac1913f8..46bcb4366d2f8 100644 +--- base/process/set_process_title.cc ++++ base/process/set_process_title.cc +@@ -54,7 +54,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { + bool have_argv0 = false; + + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); ++ // DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); + + if (main_argv) + setproctitle_init(main_argv); diff --git content/app/content_main.cc content/app/content_main.cc -index aebbccad2a503..2537281b0e872 100644 +index ffbb5986ca997..9f77c4603bf55 100644 --- content/app/content_main.cc +++ content/app/content_main.cc @@ -175,11 +175,8 @@ ContentMainParams::~ContentMainParams() = default; @@ -26,7 +39,7 @@ index aebbccad2a503..2537281b0e872 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -275,14 +269,6 @@ RunContentProcess(ContentMainParams params, +@@ -275,21 +269,14 @@ RunContentProcess(ContentMainParams params, #endif #if BUILDFLAG(IS_MAC) @@ -41,7 +54,44 @@ index aebbccad2a503..2537281b0e872 100644 InitializeMac(); #endif -@@ -332,12 +318,46 @@ RunContentProcess(ContentMainParams params, ++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); ++ + #if BUILDFLAG(IS_IOS) + // TODO(crbug.com/1412835): We support multiprocess launch of the content + // process, but for now networking and GPU are still in process. +- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(switches::kInProcessGPU); + command_line->AppendSwitch(switches::kEnableViewport); + command_line->AppendSwitch(switches::kUseMobileUserAgent); +@@ -308,19 +295,20 @@ RunContentProcess(ContentMainParams params, + + #if BUILDFLAG(IS_WIN) + // Route stdio to parent console (if any) or create one. +- if (base::CommandLine::ForCurrentProcess()->HasSwitch( +- switches::kEnableLogging)) { +- base::RouteStdioToConsole(/*create_console_if_not_found*/ true); +- } else if (base::CommandLine::ForCurrentProcess()->HasSwitch( +- switches::kHeadless)) { ++ if (command_line->HasSwitch(switches::kEnableLogging)) { ++ // Don't route to console for "handle" type in child processes. ++ if (command_line->GetSwitchValueASCII(switches::kEnableLogging) != ++ "handle") { ++ base::RouteStdioToConsole(/*create_console_if_not_found*/ true); ++ } ++ } else if (command_line->HasSwitch(switches::kHeadless)) { + // When running in headless mode we want stdio routed however if + // console does not exist we should not create one. + base::RouteStdioToConsole(/*create_console_if_not_found*/ false); + } + #endif + +- if (base::CommandLine::ForCurrentProcess()->HasSwitch( +- ::switches::kTraceToConsole)) { ++ if (command_line->HasSwitch(::switches::kTraceToConsole)) { + base::trace_event::TraceConfig trace_config = + tracing::GetConfigForTraceToConsole(); + base::trace_event::TraceLog::GetInstance()->SetEnabled( +@@ -330,12 +318,46 @@ RunContentProcess(ContentMainParams params, if (IsSubprocess()) CommonSubprocessInit(); @@ -90,7 +140,7 @@ index aebbccad2a503..2537281b0e872 100644 } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index f39a56eefbaa7..cb5f7370f1510 100644 +index 824026e6e2bd6..7de0c987dfd3d 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -46,6 +46,7 @@ @@ -135,19 +185,6 @@ index cbbc2f3ec12fa..f097b3cdded2f 100644 private: int RunBrowser(MainFunctionParams main_function_params, bool start_minimal_browser); -diff --git content/common/set_process_title.cc content/common/set_process_title.cc -index 283161145d792..9f3f635abdd1c 100644 ---- content/common/set_process_title.cc -+++ content/common/set_process_title.cc -@@ -54,7 +54,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { - bool have_argv0 = false; - - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); -+ // DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); - - if (main_argv) - setproctitle_init(main_argv); diff --git content/public/app/content_main.h content/public/app/content_main.h index 7f9b515297357..89b52e34fa31a 100644 --- content/public/app/content_main.h diff --git a/patch/patches/content_renderer_host_3617.patch b/patch/patches/content_renderer_host_3617.patch index cd88067f5..e36d3e12e 100644 --- a/patch/patches/content_renderer_host_3617.patch +++ b/patch/patches/content_renderer_host_3617.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index fd63bad192e9b..262a286478b67 100644 +index ddeef4098ed42..efffb37ee704a 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -1623,7 +1623,8 @@ bool RenderProcessHostImpl::Init() { +@@ -1624,7 +1624,8 @@ bool RenderProcessHostImpl::Init() { // initialized because in tests the factory may never have been initialized. if (!GetBrowserContext()->IsOffTheRecord() && !base::CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index f396ecbea..e408c39d1 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -276,7 +276,7 @@ index a18afed5b55c1..fabb36a299cd9 100644 ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled); } diff --git components/crash/core/app/crashpad_linux.cc components/crash/core/app/crashpad_linux.cc -index dbe46081ebf43..8182c133e2934 100644 +index 171095381e8ac..13407a7809844 100644 --- components/crash/core/app/crashpad_linux.cc +++ components/crash/core/app/crashpad_linux.cc @@ -23,6 +23,7 @@ diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index 37c50c094..0d00b6cad 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,5 +1,5 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index bcaff65ad5611..2512ab068034a 100644 +index 205d12a97caac..66044c559d0cc 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -18,6 +18,7 @@ @@ -21,7 +21,7 @@ index bcaff65ad5611..2512ab068034a 100644 namespace embedder_support { namespace { -@@ -253,6 +258,14 @@ std::vector GetFormFactorClientHints( +@@ -253,6 +258,14 @@ std::vector GetFormFactorsClientHint( std::string GetProductAndVersion( UserAgentReductionEnterprisePolicyState user_agent_reduction) { diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 132dead1a..0f6fa9895 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -199,7 +199,7 @@ index c3197eb4790fa..1e7ae767b0582 100644 } diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 1be758c66fe70..62f72c7c119d0 100644 +index 7e5c2918e273f..f00799f9e0dad 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h @@ -34,6 +34,7 @@ @@ -234,7 +234,7 @@ index 1be758c66fe70..62f72c7c119d0 100644 // once each time the extensions system is loaded per browser_context. The // implementation may wish to use the BrowserContext to record the current diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc -index 3363f44f7c4fc..3eec0356c0c58 100644 +index b86a71429eb33..9f7d190975605 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc @@ -353,9 +353,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index ab82e28b2..b3efe1e4f 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -12,7 +12,7 @@ index afe0b3e90fafb..daae3b0e0e8d3 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 20ee94216cab0..0b7c7bc8479a6 100644 +index 4b37258f1bbba..5106ced723dba 100644 --- BUILD.gn +++ BUILD.gn @@ -19,6 +19,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -76,7 +76,7 @@ index 1da479dd5eebc..ff9c7e467997c 100644 - visual_studio_runtime_dirs = [] } diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index a6c3ac1645b4a..27fa1add81082 100644 +index 74acbe3a64b73..b148042d9df1e 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -5,6 +5,7 @@ diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 915322b93..c11f964d7 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 5ee9c00afbdd7..d2a8050968468 100644 +index 3b6a1acc7deef..198419b310e1c 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -1277,6 +1277,15 @@ +@@ -1286,6 +1286,15 @@ # END "everything else" section. # Everything but chrome/, components/, content/, and ios/ diff --git a/patch/patches/light_mode_3534.patch b/patch/patches/light_mode_3534.patch index 487d0f806..ec0c1afe0 100644 --- a/patch/patches/light_mode_3534.patch +++ b/patch/patches/light_mode_3534.patch @@ -1,5 +1,5 @@ diff --git base/win/dark_mode_support.cc base/win/dark_mode_support.cc -index 6b9d2c180c904..3570ef071ba07 100644 +index 73d6ad5e9bb36..6c450e79c0f94 100644 --- base/win/dark_mode_support.cc +++ base/win/dark_mode_support.cc @@ -7,6 +7,7 @@ @@ -8,9 +8,9 @@ index 6b9d2c180c904..3570ef071ba07 100644 #include "base/check.h" +#include "base/command_line.h" #include "base/native_library.h" + #include "base/win/win_util.h" #include "base/win/windows_version.h" - -@@ -86,11 +87,20 @@ const DarkModeSupport& GetDarkModeSupport() { +@@ -89,11 +90,20 @@ const DarkModeSupport& GetDarkModeSupport() { return dark_mode_support; } @@ -32,10 +32,10 @@ index 6b9d2c180c904..3570ef071ba07 100644 return (dark_mode_support.allow_dark_mode_for_app || dark_mode_support.set_preferred_app_mode) && diff --git ui/native_theme/native_theme_mac.mm ui/native_theme/native_theme_mac.mm -index e06aa51a8ebc9..fd1aa8e472f1f 100644 +index d8ff86972911d..0fbafdef0fc26 100644 --- ui/native_theme/native_theme_mac.mm +++ ui/native_theme/native_theme_mac.mm -@@ -50,6 +50,13 @@ bool InvertedColors() { +@@ -51,6 +51,13 @@ bool InvertedColors() { return NSWorkspace.sharedWorkspace.accessibilityDisplayShouldInvertColors; } @@ -49,7 +49,7 @@ index e06aa51a8ebc9..fd1aa8e472f1f 100644 } // namespace // Helper object to respond to light mode/dark mode changeovers. -@@ -577,11 +584,15 @@ void NativeThemeMac::PaintSelectedMenuItem( +@@ -585,11 +592,15 @@ void NativeThemeMac::PaintSelectedMenuItem( void NativeThemeMac::InitializeDarkModeStateAndObserver() { __block auto theme = this; @@ -68,10 +68,10 @@ index e06aa51a8ebc9..fd1aa8e472f1f 100644 theme->NotifyOnNativeThemeUpdated(); }]; diff --git ui/native_theme/native_theme_win.cc ui/native_theme/native_theme_win.cc -index 9830931142e76..62b8e4972a6b5 100644 +index 566230f830ede..8767f6cf813e9 100644 --- ui/native_theme/native_theme_win.cc +++ ui/native_theme/native_theme_win.cc -@@ -659,14 +659,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -671,14 +671,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // Windows high contrast modes are entirely different themes, // so let them take priority over dark mode. // ...unless --force-dark-mode was specified in which case caveat emptor. @@ -91,7 +91,7 @@ index 9830931142e76..62b8e4972a6b5 100644 return NativeTheme::CalculatePreferredColorScheme(); // According to the spec, the preferred color scheme for web content is 'dark' -@@ -1657,8 +1660,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { +@@ -1669,8 +1672,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { } void NativeThemeWin::UpdateDarkModeStatus() { diff --git a/patch/patches/linux_bluetooth_1319006.patch b/patch/patches/linux_bluetooth_1319006.patch index e54846e56..b439cb842 100644 --- a/patch/patches/linux_bluetooth_1319006.patch +++ b/patch/patches/linux_bluetooth_1319006.patch @@ -1,8 +1,8 @@ diff --git device/bluetooth/BUILD.gn device/bluetooth/BUILD.gn -index e09b425de7f7c..d2f0993eac5cb 100644 +index 05cce11f233e0..91db8a1344d6a 100644 --- device/bluetooth/BUILD.gn +++ device/bluetooth/BUILD.gn -@@ -47,10 +47,12 @@ source_set("deprecated_experimental_mojo") { +@@ -50,10 +50,12 @@ source_set("deprecated_experimental_mojo") { ] if (is_chromeos || is_linux) { diff --git a/patch/patches/linux_chrome_widevine_3149.patch b/patch/patches/linux_chrome_widevine_3149.patch index 84183ba6a..3b4625142 100644 --- a/patch/patches/linux_chrome_widevine_3149.patch +++ b/patch/patches/linux_chrome_widevine_3149.patch @@ -1,18 +1,18 @@ diff --git chrome/common/media/component_widevine_cdm_hint_file_linux.cc chrome/common/media/component_widevine_cdm_hint_file_linux.cc -index 60033bb10af50..afb0d23c07a34 100644 +index d529ecfb270c4..2e922ef345f04 100644 --- chrome/common/media/component_widevine_cdm_hint_file_linux.cc +++ chrome/common/media/component_widevine_cdm_hint_file_linux.cc -@@ -18,6 +18,7 @@ +@@ -16,6 +16,7 @@ + #include "base/path_service.h" #include "base/values.h" - #include "base/version.h" #include "chrome/common/chrome_paths.h" +#include "third_party/widevine/cdm/widevine_cdm_common.h" namespace { -@@ -25,12 +26,31 @@ namespace { - const char kPath[] = "Path"; - const char kLastBundledVersion[] = "LastBundledVersion"; +@@ -35,14 +36,33 @@ base::FilePath GetPath(const base::Value::Dict& dict) { + return path; + } +// On Linux the Widevine CDM is loaded into the zygote at startup. When the +// component updater runs sometime later and finds a newer version of the @@ -34,17 +34,9 @@ index 60033bb10af50..afb0d23c07a34 100644 + return true; +} + - // Returns the hint file contents as a Value::Dict. Returned result may be an - // empty dictionary if the hint file does not exist or is formatted incorrectly. - base::Value::Dict GetHintFileContents() { - base::FilePath hint_file_path; -- CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT, -- &hint_file_path)); -+ CHECK(GetHintFilePath(&hint_file_path)); - DVLOG(1) << __func__ << " checking " << hint_file_path; + } // namespace - if (!base::PathExists(hint_file_path)) { -@@ -65,8 +85,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path, + bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path) { DCHECK(!cdm_base_path.empty()); base::FilePath hint_file_path; @@ -54,3 +46,13 @@ index 60033bb10af50..afb0d23c07a34 100644 base::Value::Dict dict; dict.Set(kPath, cdm_base_path.value()); +@@ -60,8 +80,7 @@ bool UpdateWidevineCdmHintFile(const base::FilePath& cdm_base_path) { + + base::FilePath GetLatestComponentUpdatedWidevineCdmDirectory() { + base::FilePath hint_file_path; +- CHECK(base::PathService::Get(chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT, +- &hint_file_path)); ++ CHECK(GetHintFilePath(&hint_file_path)); + + if (!base::PathExists(hint_file_path)) { + DVLOG(2) << "CDM hint file at " << hint_file_path << " does not exist."; diff --git a/patch/patches/mac_keyboard_conversion_1467329.patch b/patch/patches/mac_keyboard_conversion_1467329.patch index 5f767db5e..e6b954560 100644 --- a/patch/patches/mac_keyboard_conversion_1467329.patch +++ b/patch/patches/mac_keyboard_conversion_1467329.patch @@ -1,8 +1,8 @@ diff --git ui/events/keycodes/keyboard_code_conversion_mac.mm ui/events/keycodes/keyboard_code_conversion_mac.mm -index 790f11ca3d508..16e1ea2b303ef 100644 +index c66e866757cd1..3cd7a654f4883 100644 --- ui/events/keycodes/keyboard_code_conversion_mac.mm +++ ui/events/keycodes/keyboard_code_conversion_mac.mm -@@ -937,7 +937,7 @@ DomKey DomKeyFromNSEvent(NSEvent* event) { +@@ -930,7 +930,7 @@ DomKey DomKeyFromNSEvent(NSEvent* event) { return DomKeyFromKeyCode(event.keyCode); } default: diff --git a/patch/patches/mac_platform_style_bubble_893292.patch b/patch/patches/mac_platform_style_bubble_893292.patch index 4078d44f5..91a34bf3c 100644 --- a/patch/patches/mac_platform_style_bubble_893292.patch +++ b/patch/patches/mac_platform_style_bubble_893292.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index ba0ed16724051..3e8c2990afdac 100644 +index 855e1289e3d76..14d8e6d821f8f 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -1072,8 +1072,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { +@@ -1173,8 +1173,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { ->GetDisplayNearestPoint(anchor_rect.CenterPoint()) .work_area(); int available_space = screen_space.bottom() - anchor_rect.bottom(); diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 8a53eee67..13af2fea1 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -43,7 +43,7 @@ index 200d6692664e9..62dce72284b83 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/task/current_thread.h base/task/current_thread.h -index f572b46819262..06b0a15e359ae 100644 +index 22bf2c90f90a5..2b4b95c130745 100644 --- base/task/current_thread.h +++ base/task/current_thread.h @@ -163,6 +163,12 @@ class BASE_EXPORT CurrentThread { diff --git a/patch/patches/message_pump_mac_2495.patch b/patch/patches/message_pump_mac_2495.patch index b6b75fd2c..6e72c61ea 100644 --- a/patch/patches/message_pump_mac_2495.patch +++ b/patch/patches/message_pump_mac_2495.patch @@ -1,5 +1,5 @@ diff --git base/message_loop/message_pump_apple.mm base/message_loop/message_pump_apple.mm -index c5998758d33af..70277f63381a7 100644 +index 5e9d5f082e2c4..6cc3a5981d55c 100644 --- base/message_loop/message_pump_apple.mm +++ base/message_loop/message_pump_apple.mm @@ -759,7 +759,8 @@ void MessagePumpUIApplication::Detach() { diff --git a/patch/patches/metrics_system_profile.patch b/patch/patches/metrics_system_profile.patch index aa758a380..83b3b4828 100644 --- a/patch/patches/metrics_system_profile.patch +++ b/patch/patches/metrics_system_profile.patch @@ -1,5 +1,5 @@ diff --git components/metrics/persistent_system_profile.cc components/metrics/persistent_system_profile.cc -index cf7b47f868066..bc7c1adfea855 100644 +index 2aab2aefb3987..7922807fac0a2 100644 --- components/metrics/persistent_system_profile.cc +++ components/metrics/persistent_system_profile.cc @@ -393,6 +393,10 @@ bool PersistentSystemProfile::GetSystemProfile( diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 86409ae39..e141d3954 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -1,5 +1,5 @@ diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h -index e0887cdb49c7c..d2bf0571793cf 100644 +index 285dc38950991..326646bb585da 100644 --- content/browser/web_contents/web_contents_view.h +++ content/browser/web_contents/web_contents_view.h @@ -26,7 +26,7 @@ struct DropData; @@ -12,10 +12,10 @@ index e0887cdb49c7c..d2bf0571793cf 100644 virtual ~WebContentsView() = default; diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 39def4c0d8ad5..6e856ae9bcd96 100644 +index cb8f896ebe8a2..382394fb821a3 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 -@@ -203,6 +203,8 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -205,6 +205,8 @@ void MimeHandlerViewGuest::CreateWebContents( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; @@ -24,7 +24,7 @@ index 39def4c0d8ad5..6e856ae9bcd96 100644 std::move(callback).Run(std::move(owned_this), WebContents::CreateWithSessionStorage( params, owner_web_contents() -@@ -211,6 +213,10 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -213,6 +215,10 @@ void MimeHandlerViewGuest::CreateWebContents( } void MimeHandlerViewGuest::DidAttachToEmbedder() { @@ -35,7 +35,7 @@ index 39def4c0d8ad5..6e856ae9bcd96 100644 DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme)); GetController().LoadURL(stream_->handler_url(), content::Referrer(), ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); -@@ -481,6 +487,14 @@ void MimeHandlerViewGuest::DidFinishNavigation( +@@ -483,6 +489,14 @@ void MimeHandlerViewGuest::DidFinishNavigation( } } @@ -51,10 +51,10 @@ index 39def4c0d8ad5..6e856ae9bcd96 100644 mojo::PendingReceiver receiver) { if (!pending_before_unload_control_) diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index 5709e978f2d8e..c1f1720a31e1a 100644 +index 1cf22ee486d41..0d173bdb7af72 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 -@@ -195,10 +195,12 @@ class MimeHandlerViewGuest +@@ -196,10 +196,12 @@ class MimeHandlerViewGuest void ReadyToCommitNavigation( content::NavigationHandle* navigation_handle) final; void DidFinishNavigation(content::NavigationHandle* navigation_handle) final; diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 8faa63367..5a8d7e79c 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -24,10 +24,10 @@ index d007b8623e02c..258f077803edd 100644 bool URLRequestHttpJob::ShouldRecordPartitionedCookieUsage() const { diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index 435ded6852c97..9a430ec4c5695 100644 +index 5c9cb57298e29..8a526f8024913 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc -@@ -312,7 +312,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -316,7 +316,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 48e06fcbc..80051b43c 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -13,26 +13,26 @@ index 431df5d50debe..0fcc9ea8fbb1a 100644 return nullptr; } diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index d07266a32e786..5a0baf4aa9c6d 100644 +index 7f63e954dc68a..c916d68d3fbde 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3313,6 +3313,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3234,6 +3234,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } -+void RenderWidgetHostImpl::SetCompositorForFlingScheduler(ui::Compositor* compositor) -+{ -+ fling_scheduler_->SetCompositor(compositor); ++void RenderWidgetHostImpl::SetCompositorForFlingScheduler( ++ ui::Compositor* compositor) { ++ GetRenderInputRouter()->fling_scheduler()->SetCompositor(compositor); +} + void RenderWidgetHostImpl::AddPendingUserActivation( 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 8e48429dbce98..daf8386513031 100644 +index fb89c4500eeae..5e8f8d258dde2 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -811,6 +811,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -814,6 +814,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); @@ -68,3 +68,15 @@ index e8ee63f3abc2e..2d1717082759d 100644 }; } // namespace content +diff --git content/common/input/render_input_router.h content/common/input/render_input_router.h +index 9d664e43a3f94..584a4fa7d6d99 100644 +--- content/common/input/render_input_router.h ++++ content/common/input/render_input_router.h +@@ -56,6 +56,7 @@ class CONTENT_EXPORT RenderInputRouter : public InputRouterImplClient { + void RendererWidgetCreated(bool for_frame_widget); + + InputRouter* input_router() { return input_router_.get(); } ++ FlingSchedulerBase* fling_scheduler() { return fling_scheduler_.get(); } + + void SetForceEnableZoom(bool); + void SetDeviceScaleFactor(float device_scale_factor); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index bc0434811..0ab87b1f5 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 dc474d9ca5c3a..764ae7c3ddce2 100644 +index 773f72da82f90..6d0307988406f 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -23,6 +23,7 @@ @@ -10,7 +10,7 @@ index dc474d9ca5c3a..764ae7c3ddce2 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" -@@ -63,6 +64,10 @@ +@@ -64,6 +65,10 @@ #include "chrome/browser/flags/android/chrome_feature_list.h" #endif @@ -21,7 +21,7 @@ index dc474d9ca5c3a..764ae7c3ddce2 100644 using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; -@@ -354,6 +359,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( +@@ -355,6 +360,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( // static DownloadPrefs* DownloadPrefs::FromBrowserContext( content::BrowserContext* context) { @@ -84,7 +84,7 @@ index c85248ab0d0a0..05b3454c0356d 100644 } diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index b02c2e2e9b050..de501fd2a07f9 100644 +index e01439541b904..a369dcbb31c27 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -25,6 +25,7 @@ diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index 77a2270c0..afe7f3379 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 78beefbdd4df3..de940aca40020 100644 +index 57926e0d557fd..0004d03aad8f2 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -709,6 +709,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { +@@ -711,6 +711,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 436ec8b84..7ec234f88 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,5 +1,5 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 1b34e73d28726..0b9c4b8006355 100644 +index 630463d838984..720685dc47b0f 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc @@ -944,6 +944,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) @@ -28,10 +28,10 @@ index 1b34e73d28726..0b9c4b8006355 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 e5cd807134905..6d563565dca5e 100644 +index 607e19286e115..61f9569ec614a 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h -@@ -219,6 +219,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { +@@ -220,6 +220,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { ResourceBundle(const ResourceBundle&) = delete; ResourceBundle& operator=(const ResourceBundle&) = delete; diff --git a/patch/patches/rfh_navigation_4829483.patch b/patch/patches/rfh_navigation_4829483.patch index d405e6ce2..a9523678e 100644 --- a/patch/patches/rfh_navigation_4829483.patch +++ b/patch/patches/rfh_navigation_4829483.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index 04988fb23c26a..8d41d7b90f420 100644 +index 6066f87e7d50d..410f3a20f19f4 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10351,6 +10351,7 @@ void RenderFrameHostImpl::CommitNavigation( +@@ -10537,6 +10537,7 @@ void RenderFrameHostImpl::CommitNavigation( auto browser_calc_origin_to_commit = navigation_request->GetOriginToCommitWithDebugInfo(); if (!process_lock.is_error_page() && !is_mhtml_subframe && diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index 2605d51eb..7844091ac 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -26,7 +26,7 @@ index 521c24398ef9f..8392f18169a32 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 a9cd6f03d9214..7ae775d6aca6d 100755 +index cedeceefb5d65..ad0f1314e6a25 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -114,9 +114,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 9e6437576..c81b0320d 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index a1192dc007ae5..245b62a91f315 100644 +index e065ce0700764..9c68e224c050f 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -6,6 +6,7 @@ @@ -10,7 +10,15 @@ index a1192dc007ae5..245b62a91f315 100644 #include #include -@@ -718,10 +719,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -53,6 +54,7 @@ + #include "content/public/browser/content_browser_client.h" + #include "content/public/browser/device_service.h" + #include "content/public/browser/render_view_host.h" ++#include "content/public/browser/web_contents.h" + #include "content/public/common/page_visibility_state.h" + #include "services/service_manager/public/cpp/interface_provider.h" + #include "third_party/blink/public/common/input/web_input_event.h" +@@ -724,10 +726,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -27,15 +35,15 @@ index a1192dc007ae5..245b62a91f315 100644 } #if BUILDFLAG(IS_WIN) -@@ -2339,6 +2342,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2352,6 +2356,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { window_->layer()->SetColor(GetBackgroundColor() ? *GetBackgroundColor() : SK_ColorWHITE); UpdateFrameSinkIdRegistration(); + + // Do this after |window_| is created to avoid crashes on Win10. + // See https://crbug.com/761389. -+ auto web_contents = -+ WebContents::FromRenderViewHost(RenderViewHost::From(host_)); ++ auto* web_contents = ++ WebContents::FromRenderViewHost(RenderViewHost::From(host())); + if (web_contents) { + // TODO(mostynb): actually use prefs. Landing this as a separate CL + // first to rebaseline some unreliable layout tests. diff --git a/patch/patches/screen_1443650.patch b/patch/patches/screen_1443650.patch index a1ce614eb..0a576cfc0 100644 --- a/patch/patches/screen_1443650.patch +++ b/patch/patches/screen_1443650.patch @@ -19,10 +19,10 @@ index 22747ebcf31c0..8fba5da85a656 100644 bool Screen::GetDisplayWithDisplayId(int64_t display_id, diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc -index bbdd9a1151390..f9269a871d5e5 100644 +index 5cf436d483b9d..598435db13435 100644 --- ui/display/win/screen_win.cc +++ ui/display/win/screen_win.cc -@@ -534,7 +534,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { +@@ -540,7 +540,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { gfx::PointF(pixel_bounds.origin()), screen_win_display)); const float scale_factor = 1.0f / screen_win_display.display().device_scale_factor(); @@ -31,7 +31,7 @@ index bbdd9a1151390..f9269a871d5e5 100644 } // static -@@ -549,7 +549,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { +@@ -555,7 +555,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { const gfx::Point origin = display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display); const float scale_factor = screen_win_display.display().device_scale_factor(); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index edbaf781b..d6a434c58 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc -index 6c5a89d8bc1d4..8ddebf1d72f9b 100644 +index 3a8e63a3bcbdd..69954e151f04e 100644 --- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc @@ -23,6 +23,7 @@ @@ -10,7 +10,7 @@ index 6c5a89d8bc1d4..8ddebf1d72f9b 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/analysis/analysis_settings.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h" -@@ -317,6 +318,9 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile, +@@ -357,6 +358,9 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile, GURL url, Data* data, AnalysisConnector connector) { @@ -38,10 +38,10 @@ index 0509dabf8f421..35a0046a03c6c 100644 base::RepeatingCallback browser_context_getter = base::BindRepeating( diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index 0525b84f86b29..22d3108d5c7a9 100644 +index e50641649a959..afa518ed24ada 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc -@@ -23,6 +23,7 @@ +@@ -24,6 +24,7 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -49,7 +49,7 @@ index 0525b84f86b29..22d3108d5c7a9 100644 #include "chrome/browser/browser_features.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" -@@ -275,8 +276,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) +@@ -276,8 +277,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) base::Unretained(this))); cookie_settings_ = CookieSettingsFactory::GetForProfile(profile); cookie_settings_observation_.Observe(cookie_settings_.get()); @@ -62,7 +62,7 @@ index 0525b84f86b29..22d3108d5c7a9 100644 DisableQuicIfNotAllowed(); -@@ -913,9 +916,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1013,9 +1016,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->cookie_manager_params = CreateCookieManagerParams(profile_, *cookie_settings_); @@ -90,7 +90,7 @@ index 0525b84f86b29..22d3108d5c7a9 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -924,15 +944,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1024,15 +1044,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( local_state->GetFilePath(prefs::kDiskCacheDir); if (!disk_cache_dir.empty()) base_cache_path = disk_cache_dir.Append(base_cache_path.BaseName()); @@ -110,7 +110,7 @@ index 0525b84f86b29..22d3108d5c7a9 100644 network_context_params->file_paths->data_directory = path.Append(chrome::kNetworkDataDirname); network_context_params->file_paths->unsandboxed_data_path = path; -@@ -1107,6 +1126,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1207,6 +1226,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->first_party_sets_access_delegate_params = network::mojom::FirstPartySetsAccessDelegateParams::New(); network_context_params->first_party_sets_access_delegate_params->enabled = @@ -141,7 +141,7 @@ index 14ac2ce8b90c5..66431eface762 100644 first_party_sets::FirstPartySetsPolicyServiceFactory::GetInstance()); } diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc -index 77522f65b7b6e..51cc2d60d4b8d 100644 +index a635c32482ce0..77a3503cea229 100644 --- chrome/browser/signin/identity_manager_factory.cc +++ chrome/browser/signin/identity_manager_factory.cc @@ -11,6 +11,7 @@ @@ -152,7 +152,7 @@ index 77522f65b7b6e..51cc2d60d4b8d 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/image_fetcher/image_decoder_impl.h" #include "chrome/browser/profiles/profile.h" -@@ -96,6 +97,7 @@ IdentityManagerFactory::~IdentityManagerFactory() { +@@ -97,6 +98,7 @@ IdentityManagerFactory::~IdentityManagerFactory() { // static signin::IdentityManager* IdentityManagerFactory::GetForProfile( Profile* profile) { @@ -161,10 +161,10 @@ index 77522f65b7b6e..51cc2d60d4b8d 100644 GetInstance()->GetServiceForBrowserContext(profile, true)); } diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 545288009f1b0..988a882733c0d 100644 +index df553538286e1..b3fd2845b1147 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -554,6 +554,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -599,6 +599,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -191,10 +191,10 @@ index 545288009f1b0..988a882733c0d 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index e8202c955a8b3..9cef705807a1f 100644 +index 5e0aaf58d4bfe..f518abde87c8d 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h -@@ -208,6 +208,8 @@ class NET_EXPORT CookieMonster : public CookieStore { +@@ -209,6 +209,8 @@ class NET_EXPORT CookieMonster : public CookieStore { CookieChangeDispatcher& GetChangeDispatcher() override; void SetCookieableSchemes(const std::vector& schemes, SetCookieableSchemesCallback callback) override; @@ -242,10 +242,10 @@ index d0f230b581c8f..77b3551cc3fb5 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index c8fd97e2bb411..5682259085232 100644 +index 16e8cf435e4b0..8a88f3d841088 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2401,16 +2401,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2406,16 +2406,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -274,7 +274,7 @@ index c8fd97e2bb411..5682259085232 100644 base::FeatureList::IsEnabled(features::kFledgePst)) { trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 3240e5b9a1a61..27e086758b6e5 100644 +index c774dfca15ae1..9cb5fe6c5f20c 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom @@ -359,6 +359,9 @@ struct NetworkContextParams { diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index 12a8ae48c..bdc79552e 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index fe8318f3c4f6f..9c3a9cb356b0f 100644 +index 80d9b70bf76b3..d9b8d78f6aa01 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -3267,8 +3267,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -3282,8 +3282,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -16,7 +16,7 @@ index fe8318f3c4f6f..9c3a9cb356b0f 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -3278,9 +3282,12 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -3293,9 +3297,12 @@ void StoragePartitionImpl::InitNetworkContext() { cert_verifier::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New(); diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 4beb437fe..217d64a60 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -58,10 +58,10 @@ index e82cdd66a2d5c..1816b2fe54ff5 100644 // static diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index 348245d4da651..81bb4b0671f8c 100644 +index ad1fa4396cd65..1c5027cc0c922 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -568,7 +568,7 @@ bool DatabaseTracker::LazyInit() { +@@ -569,7 +569,7 @@ bool DatabaseTracker::LazyInit() { databases_table_ = std::make_unique(db_.get()); meta_table_ = std::make_unique(); diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index 3e599fc0d..0d17609d0 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 8f7e26c6bfcfa..daf9e5e003f6a 100644 +index fb847bc760cd0..3190300b7432a 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc -@@ -163,7 +163,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, +@@ -164,7 +164,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_3330.patch b/patch/patches/views_1749_2102_3330.patch index f55b715bf..72b360247 100644 --- a/patch/patches/views_1749_2102_3330.patch +++ b/patch/patches/views_1749_2102_3330.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/toolbar/app_menu.cc chrome/browser/ui/views/toolbar/app_menu.cc -index 0e771ce8b219c..d1826cc2366dd 100644 +index 13431b7ecbee5..f55bcc8538371 100644 --- chrome/browser/ui/views/toolbar/app_menu.cc +++ chrome/browser/ui/views/toolbar/app_menu.cc -@@ -1004,7 +1004,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { +@@ -1003,7 +1003,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { host->button()->GetWidget(), host, host->button()->GetAnchorBoundsInScreen(), views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE, @@ -58,10 +58,10 @@ index fb795f76d3616..6e36a4c1e29da 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 6f5682607d98f..88c4c445460a4 100644 +index 91fc5dc45e4be..a63f7daba9477 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -671,6 +671,14 @@ void RenderText::SetWhitespaceElision(std::optional whitespace_elision) { +@@ -696,6 +696,14 @@ void RenderText::SetWhitespaceElision(std::optional whitespace_elision) { } } @@ -76,7 +76,7 @@ index 6f5682607d98f..88c4c445460a4 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -2071,6 +2079,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2128,6 +2136,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -97,10 +97,10 @@ index 6f5682607d98f..88c4c445460a4 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 9bc3bd4e32283..0daf2c41cbb04 100644 +index fc7148fef2b34..3f19fbda8198b 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -345,6 +345,10 @@ class GFX_EXPORT RenderText { +@@ -356,6 +356,10 @@ class GFX_EXPORT RenderText { void SetWhitespaceElision(std::optional elide_whitespace); std::optional whitespace_elision() const { return whitespace_elision_; } @@ -111,7 +111,7 @@ index 9bc3bd4e32283..0daf2c41cbb04 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -1058,6 +1062,8 @@ class GFX_EXPORT RenderText { +@@ -1087,6 +1091,8 @@ class GFX_EXPORT RenderText { // Tell whether or not the |layout_text_| needs an update or is up to date. mutable bool layout_text_up_to_date_ = false; @@ -134,7 +134,7 @@ index cbc1a0e7833fe..da451800b1a56 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 30555a9c9c2a6..399eabb548184 100644 +index 1769fd6c47586..a30229e71e818 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc @@ -578,6 +578,12 @@ void LabelButton::OnThemeChanged() { @@ -165,7 +165,7 @@ index 305fdcb678cf8..ce70df19c5eac 100644 LabelButtonImageContainer* image_container() { return image_container_.get(); diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 7c65e26445a8d..0c6ca927d3899 100644 +index 6ce8aff89247b..8203c09be5d20 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc @@ -51,12 +51,29 @@ enum LabelPropertyKey { @@ -255,10 +255,10 @@ index 273805cdee382..d3cfd2d5fe3a9 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 8428a296547e0..040f74170d20c 100644 +index 6afaa5b9aaa68..6d4f40f2f4786 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -566,7 +566,8 @@ void MenuController::Run(Widget* parent, +@@ -578,7 +578,8 @@ void MenuController::Run(Widget* parent, MenuAnchorPosition position, bool context_menu, bool is_nested_drag, @@ -268,7 +268,7 @@ index 8428a296547e0..040f74170d20c 100644 exit_type_ = ExitType::kNone; possible_drag_ = false; drag_in_progress_ = false; -@@ -611,6 +612,7 @@ void MenuController::Run(Widget* parent, +@@ -623,6 +624,7 @@ void MenuController::Run(Widget* parent, owner_->AddObserver(this); native_view_for_gestures_ = native_view_for_gestures; @@ -276,7 +276,7 @@ index 8428a296547e0..040f74170d20c 100644 // Only create a MenuPreTargetHandler for non-nested menus. Nested menus // will use the existing one. -@@ -2234,6 +2236,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { +@@ -2246,6 +2248,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { params.do_capture = do_capture; params.native_view_for_gestures = native_view_for_gestures_; params.owned_window_anchor = anchor; @@ -284,7 +284,7 @@ index 8428a296547e0..040f74170d20c 100644 if (item->GetParentMenuItem()) { params.context = item->GetWidget(); // (crbug.com/1414232) The item to be open is a submenu. Make sure -@@ -2915,8 +2918,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( +@@ -2929,8 +2932,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -299,7 +299,7 @@ index 8428a296547e0..040f74170d20c 100644 // Show the sub-menu. SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); -@@ -2936,8 +2944,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2950,8 +2958,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -312,7 +312,7 @@ index 8428a296547e0..040f74170d20c 100644 SetSelection(item, SELECTION_UPDATE_IMMEDIATELY); else if (item->GetParentMenuItem()->GetParentMenuItem()) diff --git ui/views/controls/menu/menu_controller.h ui/views/controls/menu/menu_controller.h -index 43668ea5b4fcf..6e7d397a3b82f 100644 +index a051195134920..ef2a1dacb163c 100644 --- ui/views/controls/menu/menu_controller.h +++ ui/views/controls/menu/menu_controller.h @@ -139,7 +139,9 @@ class VIEWS_EXPORT MenuController @@ -326,7 +326,7 @@ index 43668ea5b4fcf..6e7d397a3b82f 100644 bool for_drop() const { return for_drop_; } -@@ -734,6 +736,8 @@ class VIEWS_EXPORT MenuController +@@ -736,6 +738,8 @@ class VIEWS_EXPORT MenuController // RunType::SEND_GESTURE_EVENTS_TO_OWNER is set. gfx::NativeView native_view_for_gestures_ = gfx::NativeView(); @@ -375,7 +375,7 @@ index 0623d151ddd3e..243e8c573e474 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_host.cc ui/views/controls/menu/menu_host.cc -index 305d9547abb5c..d9e0b6e698158 100644 +index fe055187219b1..9587b2321b502 100644 --- ui/views/controls/menu/menu_host.cc +++ ui/views/controls/menu/menu_host.cc @@ -146,6 +146,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { @@ -411,10 +411,10 @@ index 7e92e72c01d62..e3e1fe357a635 100644 explicit MenuHost(SubmenuView* submenu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index fea71cd9602a1..d5aaa97716310 100644 +index 74dc139b2be23..7f42a723c64ab 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1072,6 +1072,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1076,6 +1076,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -430,7 +430,7 @@ index fea71cd9602a1..d5aaa97716310 100644 } else if (paint_as_selected) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1136,6 +1145,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -1140,6 +1149,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const { @@ -670,7 +670,7 @@ diff --git ui/views/controls/menu/menu_runner_impl_cocoa.mm ui/views/controls/me index c585f056973e2..02af08d23a9b9 100644 --- ui/views/controls/menu/menu_runner_impl_cocoa.mm +++ ui/views/controls/menu/menu_runner_impl_cocoa.mm -@@ -70,6 +70,7 @@ +@@ -70,6 +70,7 @@ void MenuRunnerImplCocoa::RunMenuAt( MenuAnchorPosition anchor, int32_t run_types, gfx::NativeView native_view_for_gestures, @@ -692,7 +692,7 @@ index 972abab3bf46f..ce6b32b1524e8 100644 std::optional show_menu_host_duration_histogram = std::nullopt) = 0; diff --git ui/views/controls/menu/menu_runner_impl_mac.h ui/views/controls/menu/menu_runner_impl_mac.h -index 799e03fd15794..bf6b95fb5797b 100644 +index db81eab045142..ca439366e66ef 100644 --- ui/views/controls/menu/menu_runner_impl_mac.h +++ ui/views/controls/menu/menu_runner_impl_mac.h @@ -40,6 +40,7 @@ class VIEWS_EXPORT MenuRunnerImplMac : public MenuRunnerImplInterface { @@ -700,22 +700,22 @@ index 799e03fd15794..bf6b95fb5797b 100644 int32_t run_types, gfx::NativeView native_view_for_gestures, + gfx::AcceleratedWidget parent_widget, - absl::optional corners, - absl::optional show_menu_host_duration_histogram) override; + std::optional corners, + std::optional show_menu_host_duration_histogram) override; void Cancel() override; diff --git ui/views/controls/menu/menu_runner_impl_mac.mm ui/views/controls/menu/menu_runner_impl_mac.mm -index 0fb98f56e84c8..1e332dc57b62f 100644 +index 27f83d5eece36..27d07d70c912e 100644 --- ui/views/controls/menu/menu_runner_impl_mac.mm +++ ui/views/controls/menu/menu_runner_impl_mac.mm -@@ -47,6 +47,7 @@ +@@ -47,6 +47,7 @@ void MenuRunnerImplMac::RunMenuAt( MenuAnchorPosition anchor, int32_t run_types, gfx::NativeView native_view_for_gestures, + gfx::AcceleratedWidget parent_widget, - absl::optional corners, - absl::optional show_menu_host_duration_histogram) { + std::optional corners, + std::optional show_menu_host_duration_histogram) { if (!implementation_) { -@@ -59,8 +60,8 @@ +@@ -59,8 +60,8 @@ void MenuRunnerImplMac::RunMenuAt( } } implementation_->RunMenuAt(parent, button_controller, bounds, anchor, @@ -727,7 +727,7 @@ index 0fb98f56e84c8..1e332dc57b62f 100644 void MenuRunnerImplMac::Cancel() { diff --git ui/views/controls/menu/menu_runner_impl_remote_cocoa.h ui/views/controls/menu/menu_runner_impl_remote_cocoa.h -index fe26b1070d1fc..5907de1e710ea 100644 +index 7aaf6d82e09d4..c3af2bdf748fb 100644 --- ui/views/controls/menu/menu_runner_impl_remote_cocoa.h +++ ui/views/controls/menu/menu_runner_impl_remote_cocoa.h @@ -58,6 +58,7 @@ class VIEWS_EXPORT MenuRunnerImplRemoteCocoa @@ -735,20 +735,20 @@ index fe26b1070d1fc..5907de1e710ea 100644 int32_t run_types, gfx::NativeView native_view_for_gestures, + gfx::AcceleratedWidget parent_widget, - absl::optional corners, - absl::optional show_menu_host_duration_histogram) override; + std::optional corners, + std::optional show_menu_host_duration_histogram) override; void Cancel() override; diff --git ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm -index 92e105c78dec5..5a46ea93c5322 100644 +index e171461e28836..e137275a22a12 100644 --- ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm +++ ui/views/controls/menu/menu_runner_impl_remote_cocoa.mm -@@ -70,6 +70,7 @@ +@@ -70,6 +70,7 @@ void MenuRunnerImplRemoteCocoa::RunMenuAt( MenuAnchorPosition anchor, int32_t run_types, gfx::NativeView native_view_for_gestures, + gfx::AcceleratedWidget parent_widget, - absl::optional corners, - absl::optional show_menu_host_duration_histogram) { + std::optional corners, + std::optional show_menu_host_duration_histogram) { RunMenu(parent, bounds.CenterPoint()); diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc index 49ef1918236ec..f274df414558a 100644 @@ -791,7 +791,7 @@ index 9228af7f0b02e..a6957017fef5c 100644 #if !BUILDFLAG(IS_CHROMEOS_LACROS) if (root_location != root_current_location && diff --git ui/views/view.h ui/views/view.h -index 90905a70c39f1..59e1959efe352 100644 +index 6cca6e9e7627d..fe0ad100d10f5 100644 --- ui/views/view.h +++ ui/views/view.h @@ -25,6 +25,7 @@ @@ -802,7 +802,7 @@ index 90905a70c39f1..59e1959efe352 100644 #include "base/types/pass_key.h" #include "build/build_config.h" #include "third_party/skia/include/core/SkPath.h" -@@ -288,7 +289,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -289,7 +290,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index daae86744..30b1f5b9f 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -61,10 +61,10 @@ index e9ad2d5751f2d..e51381e8f2dbf 100644 case ui::SHOW_STATE_MAXIMIZED: return kSerializedShowStateMaximized; diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index a6f1863cc5c8a..7e169bc3462fd 100644 +index 6b6902c0cb0ee..d724e1dfe7d49 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -653,6 +653,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { +@@ -660,6 +660,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { return scale_override_for_capture_; } @@ -80,7 +80,7 @@ index a6f1863cc5c8a..7e169bc3462fd 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 03d6711927bd7..7c75fb30d66b8 100644 +index 116046b24a3e0..6b6ee45499639 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -72,6 +72,7 @@ class DevicePosturePlatformProvider; @@ -88,10 +88,10 @@ index 03d6711927bd7..7c75fb30d66b8 100644 class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; +class RenderWidgetHostViewGuest; + class ScopedViewTransitionResources; class SyntheticGestureTarget; class TextInputManager; - class TouchSelectionControllerClientManager; -@@ -152,6 +153,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -153,6 +154,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; float GetDeviceScaleFactor() const final; @@ -100,7 +100,7 @@ index 03d6711927bd7..7c75fb30d66b8 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; ui::mojom::VirtualKeyboardMode GetVirtualKeyboardMode() override; -@@ -191,6 +194,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -192,6 +195,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // Called when screen information or native widget bounds change. virtual void UpdateScreenInfo(); @@ -111,7 +111,7 @@ index 03d6711927bd7..7c75fb30d66b8 100644 // Called by the TextInputManager to notify the view about being removed from // the list of registered views, i.e., TextInputManager is no longer tracking // TextInputState from this view. The RWHV should reset |text_input_manager_| -@@ -452,6 +459,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -453,6 +460,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, const gfx::Rect& bounds, const gfx::Rect& anchor_rect) = 0; @@ -124,7 +124,7 @@ index 03d6711927bd7..7c75fb30d66b8 100644 // Sets the cursor for this view to the one specified. virtual void UpdateCursor(const ui::Cursor& cursor) = 0; -@@ -737,6 +750,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -746,6 +759,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // to all displays. gfx::Size system_cursor_size_; @@ -135,7 +135,7 @@ index 03d6711927bd7..7c75fb30d66b8 100644 private: FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, -@@ -758,10 +775,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -767,10 +784,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void SynchronizeVisualProperties(); @@ -214,10 +214,10 @@ index 8effe5b2244a3..c36a5d3a6f7b3 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/aura/native_window_occlusion_tracker_win.cc ui/aura/native_window_occlusion_tracker_win.cc -index 1a0b1ab293042..0a9e13d651ca5 100644 +index a4a87a8347680..71a1e0d76d35f 100644 --- ui/aura/native_window_occlusion_tracker_win.cc +++ ui/aura/native_window_occlusion_tracker_win.cc -@@ -102,6 +102,13 @@ void NativeWindowOcclusionTrackerWin::Enable(Window* window) { +@@ -101,6 +101,13 @@ void NativeWindowOcclusionTrackerWin::Enable(Window* window) { // when it's no longer true that all windows are minimized, and when the // window is destroyed. HWND root_window_hwnd = window->GetHost()->GetAcceleratedWidget(); @@ -258,10 +258,10 @@ index 6076597470af9..871147e3e3a84 100644 // Specifies which edges of the window are tiled. diff --git ui/ozone/platform/x11/x11_window.cc ui/ozone/platform/x11/x11_window.cc -index faa3c01acd505..0cad8751dbccc 100644 +index a5656cefbfc57..aeb062df96e39 100644 --- ui/ozone/platform/x11/x11_window.cc +++ ui/ozone/platform/x11/x11_window.cc -@@ -1870,7 +1870,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1863,7 +1863,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(bounds); @@ -349,7 +349,7 @@ index 3151a2c872f4e..e14caeb1e6645 100644 base::WeakPtrFactory weak_factory_{this}; }; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -index e1b6fbe325e76..cc45559423ce5 100644 +index c5379f421f5be..f49896ef092cf 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc @@ -293,8 +293,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { @@ -364,10 +364,10 @@ index e1b6fbe325e76..cc45559423ce5 100644 // Calculate initial bounds. diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 8a691273aa8af..ef43f5ee7ceca 100644 +index f63948de2c5bf..c445451bf3d98 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -21,6 +21,7 @@ +@@ -20,6 +20,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/focus_client.h" @@ -375,7 +375,7 @@ index 8a691273aa8af..ef43f5ee7ceca 100644 #include "ui/aura/window_event_dispatcher.h" #include "ui/base/class_property.h" #include "ui/base/cursor/cursor.h" -@@ -181,22 +182,42 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -178,22 +179,42 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_.get()); HWND parent_hwnd = nullptr; @@ -419,10 +419,10 @@ index 8a691273aa8af..ef43f5ee7ceca 100644 + initially_minimized_first_restore_pending_ = true; + } + - if (base::FeatureList::IsEnabled(views::features::kWidgetLayering)) { - // Stack immedately above its parent so that it does not cover other - // root-level windows. -@@ -1023,10 +1044,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { + // Stack immediately above its parent so that it does not cover other + // root-level windows, with the exception of menus, to allow them to be + // displayed on top of other windows. +@@ -1016,10 +1037,23 @@ void DesktopWindowTreeHostWin::HandleWindowMinimizedOrRestored(bool restored) { if (!native_widget_delegate_->IsNativeWidgetInitialized()) return; @@ -448,7 +448,7 @@ index 8a691273aa8af..ef43f5ee7ceca 100644 } void DesktopWindowTreeHostWin::HandleClientSizeChanged( -@@ -1043,11 +1077,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -1036,11 +1070,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -466,7 +466,7 @@ index 8a691273aa8af..ef43f5ee7ceca 100644 } bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { -@@ -1055,6 +1093,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { +@@ -1048,6 +1086,12 @@ bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { if (ui::PlatformEventSource::ShouldIgnoreNativePlatformEvents()) return true; @@ -479,7 +479,7 @@ index 8a691273aa8af..ef43f5ee7ceca 100644 SendEventToSink(event); return event->handled(); } -@@ -1233,8 +1277,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { +@@ -1226,8 +1270,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { // positions in variable-DPI situations. See https://crbug.com/1224715 for // details. aura::Window* root = nullptr; @@ -529,7 +529,7 @@ index cbe655d5879d6..a72c3450d1fa7 100644 break; case ui::SHOW_STATE_END: diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 257e4c1059db7..9a080524825c7 100644 +index 53c18070fb9e2..4e101a792ec6b 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc @@ -399,7 +399,8 @@ void Widget::Init(InitParams params) { @@ -542,7 +542,7 @@ index 257e4c1059db7..9a080524825c7 100644 is_headless_ = params.ShouldInitAsHeadless(); if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && -@@ -497,9 +498,14 @@ void Widget::Init(InitParams params) { +@@ -494,9 +495,14 @@ void Widget::Init(InitParams params) { if (show_state == ui::SHOW_STATE_MAXIMIZED) { Maximize(); @@ -557,7 +557,7 @@ index 257e4c1059db7..9a080524825c7 100644 } #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -513,7 +519,12 @@ void Widget::Init(InitParams params) { +@@ -510,7 +516,12 @@ void Widget::Init(InitParams params) { } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); if (should_set_initial_bounds) { @@ -599,10 +599,10 @@ index 257e4c1059db7..9a080524825c7 100644 // focus when the window is restored. if (v) diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 5d190896a1308..36322410b8373 100644 +index 5042a382cacfc..2582b75986ca5 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -356,6 +356,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -363,6 +363,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = gfx::NativeView(); @@ -611,7 +611,7 @@ index 5d190896a1308..36322410b8373 100644 // Specifies the initial bounds of the Widget. Default is empty, which means // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not -@@ -754,7 +756,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -762,7 +764,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, void ShowInactive(); // Activates the widget, assuming it already exists and is visible. @@ -650,10 +650,10 @@ index 3b9b00b7d79ae..e759e3c1a9f34 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 7516856fb9314..4e1fac6c686fe 100644 +index b1f7412f7a8e7..5f7187e98c3fa 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -770,7 +770,11 @@ bool HWNDMessageHandler::IsVisible() const { +@@ -771,7 +771,11 @@ bool HWNDMessageHandler::IsVisible() const { } bool HWNDMessageHandler::IsActive() const { @@ -666,7 +666,7 @@ index 7516856fb9314..4e1fac6c686fe 100644 } bool HWNDMessageHandler::IsMinimized() const { -@@ -3211,10 +3215,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3221,10 +3225,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 ccf0fbba1..3268bc14c 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,10 +80,10 @@ index 8af69cac78b74..9f74e511c263d 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 5756139efd53e..a80a1504fbbce 100644 +index 578b712f95474..1b7a392ae5736 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -247,6 +247,8 @@ viz_component("service") { +@@ -249,6 +249,8 @@ viz_component("service") { "transitions/surface_animation_manager.h", "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", @@ -150,10 +150,10 @@ index 796ae2688436e..37a3406790210 100644 TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceWinProxy::Draw", this); diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index 36a762f6a8054..0e5983a4f011d 100644 +index 65401cc364494..7a1c98588ac5c 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc -@@ -408,8 +408,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( +@@ -383,8 +383,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( mojo::AssociatedRemote display_private; root_params->display_private = display_private.BindNewEndpointAndPassReceiver(); @@ -223,7 +223,7 @@ index 2f462f0deb5fc..695869b83cefa 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 2b5ec776d7d90..ad2c8d8796a7e 100644 +index 5d3dbdb5016a2..e587af93929fc 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -33,7 +33,9 @@ @@ -236,7 +236,7 @@ index 2b5ec776d7d90..ad2c8d8796a7e 100644 #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/display_private.mojom.h" -@@ -146,6 +148,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -140,6 +142,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -251,7 +251,7 @@ index 2b5ec776d7d90..ad2c8d8796a7e 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 -@@ -189,6 +199,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -183,6 +193,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -261,7 +261,7 @@ index 2b5ec776d7d90..ad2c8d8796a7e 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 -@@ -539,6 +552,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -533,6 +546,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, 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 1ca85b6e4..b3e8b4bb5 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 aa108c2e0aab5..0d51494508d87 100644 +index bfb696d17099c..e1213ba481460 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -3459,6 +3459,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3521,6 +3521,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -15,7 +15,7 @@ index aa108c2e0aab5..0d51494508d87 100644 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3469,6 +3475,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3531,6 +3537,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -23,7 +23,7 @@ index aa108c2e0aab5..0d51494508d87 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3664,6 +3671,9 @@ void WebContentsImpl::RenderWidgetCreated( +@@ -3726,6 +3733,9 @@ void WebContentsImpl::RenderWidgetCreated( OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated", "render_widget_host", render_widget_host); created_widgets_.insert(render_widget_host); @@ -33,7 +33,7 @@ index aa108c2e0aab5..0d51494508d87 100644 } void WebContentsImpl::RenderWidgetDeleted( -@@ -4484,6 +4494,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4549,6 +4559,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( create_params.picture_in_picture_options = *(params.pip_options); } @@ -49,7 +49,7 @@ index aa108c2e0aab5..0d51494508d87 100644 // Check whether there is an available prerendered page for this navigation if // this is not for guest. If it exists, take WebContents pre-created for // hosting the prerendered page instead of creating new WebContents. -@@ -8703,6 +8722,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -8820,6 +8839,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, } CloseListenerManager::DidChangeFocusedFrame(this); @@ -60,10 +60,10 @@ index aa108c2e0aab5..0d51494508d87 100644 void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 2880552f5303c..5b034fbf8b036 100644 +index 663230421212b..0e5e7ee9951b7 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -101,10 +101,12 @@ class BrowserContext; +@@ -104,10 +104,12 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -76,7 +76,7 @@ index 2880552f5303c..5b034fbf8b036 100644 class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -251,6 +253,10 @@ class WebContents : public PageNavigator, +@@ -254,6 +256,10 @@ class WebContents : public PageNavigator, network::mojom::WebSandboxFlags starting_sandbox_flags = network::mojom::WebSandboxFlags::kNone; @@ -88,10 +88,10 @@ index 2880552f5303c..5b034fbf8b036 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 cce26ecaccbfd..08f7108f68890 100644 +index c44ef9991cbb0..316fe9f68a9d2 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -64,9 +64,11 @@ class EyeDropperListener; +@@ -62,9 +62,11 @@ class EyeDropperListener; class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; @@ -103,7 +103,7 @@ index cce26ecaccbfd..08f7108f68890 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -349,6 +351,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -347,6 +349,14 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionConfig& partition_config, SessionStorageNamespace* session_storage_namespace); @@ -119,7 +119,7 @@ index cce26ecaccbfd..08f7108f68890 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 67a814a07af1e..7b5e055d3c347 100644 +index ede7dc0581064..d434670d4cb4c 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h @@ -227,6 +227,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { @@ -132,7 +132,7 @@ index 67a814a07af1e..7b5e055d3c347 100644 // This method is invoked when the `blink::WebView` of the current // RenderViewHost is ready, e.g. because we recreated it after a crash. virtual void RenderViewReady() {} -@@ -848,6 +851,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -852,6 +855,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index f215df963..3a09b724d 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -11,7 +11,7 @@ index c4348be90db20..bf426c876b77a 100644 // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index e3d58bf5e51c9..2ba9f1be3d752 100644 +index fb042e637c831..e3cf96c7f9215 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -251,8 +251,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 53639eea5..fd6810fb1 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -51,7 +51,7 @@ index 95b2dd4972892..72e1b984ba689 100644 bool result = base::win::IsKeyboardPresentOnSlate(ui::GetHiddenWindow(), &reason); diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc -index 73f5816dd06ae..33255343d351e 100644 +index 58fe3bd8f62ae..41b5e35b09a80 100644 --- chrome/browser/memory_details.cc +++ chrome/browser/memory_details.cc @@ -298,9 +298,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() { diff --git a/patch/patches/win_sandbox_3210.patch b/patch/patches/win_sandbox_3210.patch index 584e0aeb9..97bcabe76 100644 --- a/patch/patches/win_sandbox_3210.patch +++ b/patch/patches/win_sandbox_3210.patch @@ -1,8 +1,8 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index 6bf94fa65c5b6..f0953baa972f5 100644 +index d7eed71feab0b..eea5f293c2ca0 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc -@@ -1015,6 +1015,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -1019,6 +1019,13 @@ ResultCode SandboxWin::StartSandboxedProcess( const base::HandlesToInheritVector& handles_to_inherit, SandboxDelegate* delegate, base::Process* process) { diff --git a/tests/ceftests/views/panel_unittest.cc b/tests/ceftests/views/panel_unittest.cc index 36140810f..2018c16a1 100644 --- a/tests/ceftests/views/panel_unittest.cc +++ b/tests/ceftests/views/panel_unittest.cc @@ -1123,7 +1123,7 @@ void BoxLayoutSizeHierarchyVerticalCenter(bool with_delegate) { // ----------- // CefBoxLayoutSettings settings; - settings.cross_axis_alignment = CEF_CROSS_AXIS_ALIGNMENT_CENTER; + settings.cross_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; int xoffset = (kBLParentSize - kBLChildSize) / 2; CefRect expected_child1_bounds(xoffset, 0, kBLChildSize, kBLChildSize); @@ -1155,7 +1155,7 @@ void BoxLayoutSizeHierarchyHorizontalCenter(bool with_delegate) { // CefBoxLayoutSettings settings; settings.horizontal = true; - settings.cross_axis_alignment = CEF_CROSS_AXIS_ALIGNMENT_CENTER; + settings.cross_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; int yoffset = (kBLParentSize - kBLChildSize) / 2; CefRect expected_child1_bounds(0, yoffset, kBLChildSize, kBLChildSize); @@ -1186,8 +1186,8 @@ void BoxLayoutSizeHierarchyVerticalCenterCenter(bool with_delegate) { // ----------- // CefBoxLayoutSettings settings; - settings.main_axis_alignment = CEF_MAIN_AXIS_ALIGNMENT_CENTER; - settings.cross_axis_alignment = CEF_CROSS_AXIS_ALIGNMENT_CENTER; + settings.main_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; + settings.cross_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; int xoffset = (kBLParentSize - kBLChildSize) / 2; int yoffset = (kBLParentSize - (kBLChildSize * 2)) / 2; @@ -1221,8 +1221,8 @@ void BoxLayoutSizeHierarchyHorizontalCenterCenter(bool with_delegate) { // CefBoxLayoutSettings settings; settings.horizontal = true; - settings.main_axis_alignment = CEF_MAIN_AXIS_ALIGNMENT_CENTER; - settings.cross_axis_alignment = CEF_CROSS_AXIS_ALIGNMENT_CENTER; + settings.main_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; + settings.cross_axis_alignment = CEF_AXIS_ALIGNMENT_CENTER; int xoffset = (kBLParentSize - (kBLChildSize * 2)) / 2; int yoffset = (kBLParentSize - kBLChildSize) / 2;