Compare commits

..

39 Commits
6668 ... 6723

Author SHA1 Message Date
Marshall Greenblatt
5c0b03a4ba Pin depot_tools version for out-of-support branch 2024-11-19 13:37:48 -05:00
Marshall Greenblatt
5a7e5ed359 Update to Chromium version 130.0.6723.117 2024-11-06 14:20:43 +00:00
Marshall Greenblatt
34b05bb541 win: Reland screen_1443650 changes (fixes #3489)
Use ScaleToRoundedRect instead of ScaleToEnclosedRect.
2024-11-05 12:42:02 -05:00
Marshall Greenblatt
de32089516 cefclient: Add RootWindowManager tracking of other browsers (see #3790)
The message loop should not quit until all browsers have closed,
including browsers that are not directly associated with a RootWindow.
2024-11-04 17:16:27 -05:00
Marshall Greenblatt
16488e5564 Free CefMenuRunnerViews on BrowserView destruction (see #3790)
CefMenuRunnerViews holds a raw_ptr<CefBrowserViewImpl> that must be
cleared during CefBrowserViewImpl destruction.
2024-11-04 17:16:18 -05:00
Marshall Greenblatt
7bb6b2569c mac: Fix accelerators in overlay BrowserView (see #3188)
CefWindowImpl::CanHandleAccelerators was returning false for
accelerators triggered in the overlay BrowserView due to
IsWindowKey (called from NativeWidgetMac::IsActive) returning
false. View::CanHandleAccelerators, on the other hand, only
checks IsActive for Aura (non-MacOS) windows. We therefore
delegate to the View implementation for consistent handling.
2024-11-04 17:16:10 -05:00
Marshall Greenblatt
7a98b3fece Execute HandleExternalProtocolHelper on the UI thread (fixes #3821) 2024-11-04 12:01:19 -05:00
Marshall Greenblatt
3470f6ade4 Update to Chromium version 130.0.6723.92 2024-10-31 15:33:29 +00:00
Marshall Greenblatt
fc4256797d win: Revert screen_1443650 changes (fixes #3744)
This change broke tooltip display at 125% scale factor on Windows 10
with high-dpi display.

Reopening the original issue #3489.
2024-10-23 14:33:13 -04:00
Marshall Greenblatt
3dedcced94 Update to Chromium version 130.0.6723.70 2024-10-23 12:50:40 +00:00
Marshall Greenblatt
59f3b143ef mac: cefclient: Fix window.close() with --hide-window-on-close (fixes #3660) 2024-10-22 16:19:53 -04:00
Marshall Greenblatt
6514b929c4 Fix raw_ptr leak of main frame RFH during WebContents close (see #3660) 2024-10-22 16:19:45 -04:00
Mike Bragg
a747221b01 Implement PrintCrossProcessSubframe for AlloyBrowserHostImpl (fixes #3768) 2024-10-22 16:06:43 -04:00
Marshall Greenblatt
351ea86650 win: Add SHA256 impl for Sid::FromNamedCapability (fixes #3791)
The cef_sandbox build can't use the default BoringSSL implementation
so we add an alternative implementation using the Crypto API.
2024-10-22 13:12:13 -04:00
Marshall Greenblatt
06c1602d18 Update to Chromium version 130.0.6723.59 2024-10-21 15:25:21 +00:00
Marshall Greenblatt
48f3ef63e2 linux: Fix callbacks to CefPrintHandler (fixes #3729)
Out-of-process printing must also be disabled by passing
`--disable-features=EnableOopPrintDrivers`.
2024-10-18 15:04:17 -04:00
Marshall Greenblatt
7268dc8cd3 cefclient: views: Add ability to pop out the overlay Browser (see #3790)
When running with the overlay Browser enabled (`--show-overlay-browser`),
pressing Alt+O will move the overlay Browser to a new top-level Window.
Pressing Alt+O again or closing the new Window via the close button will
return the Browser to the overlay. Closing the Browser via `window.close()`
(in the new Window or overlay) will dismiss the overlay completely as
required to maintain consistent internal state. Detection of this state is
supported by the new CefBrowserHost::IsReadyToBeClosed method.

Draggable regions in the main Browser are updated to account for the
presence or absence of the overlay Browser. Support for draggable regions
in the overlay Browser in not implemented in cefclient.

Behavior with multiple overlays, `window.close()` and draggable regions
can be tested by adding `--hide-frame --hide-controls`.
2024-10-18 15:04:08 -04:00
Marshall Greenblatt
45861b1b08 chrome: Support unload handlers with TryCloseBrowser
TryCloseBrowser should potentially trigger JavaScript unload handlers
and return false. Add CefBrowserHost::IsReadyToBeClosed for detecting
mandatory close state. Enable, for Chrome style browsers, LifeSpanTest
that don't require DoClose(). Update related documentation.
2024-10-18 15:03:59 -04:00
Marshall Greenblatt
efe558cd28 views: Fix dangling raw_ptr on CefToolbarViewView destruction 2024-10-18 15:03:49 -04:00
Marshall Greenblatt
f1e634393f views: cefclient: Fix crash when ID_MENU_BUTTON doesn't exist 2024-10-18 15:03:40 -04:00
Marshall Greenblatt
0187046a2e views: Trigger CefBrowser destruction on CefBrowserView release (see #3790)
Avoid a circular ownership dependency between CefBrowserViewImpl and
CefBrowserPlatformDelegate[Chrome]Views (owned by CefBrowserHostBase).
Trigger CefBrowserHostBase destruction when the last CefBrowserViewImpl
reference is released.

This fixes a number of shutdown crashes related to overlay CefBrowsers
still existing at CefShutdown.
2024-10-18 15:03:29 -04:00
Marshall Greenblatt
6f4c2bf8df Fix DiscardableSharedMemoryManager destruction timing
Move DiscardableSharedMemoryManager destruction to the end of UI thread
shutdown, after Mojo messages have stopped arriving. See related comments
at https://chromium-review.googlesource.com/c/chromium/src/+/5925441
2024-10-18 15:03:19 -04:00
Marshall Greenblatt
de2da368c6 cefclient: views: Add overlay BrowserView demo (see #3790)
Adds new `--show-overlay-browser` command-line flag that creates an
overlay containing an Alloy-style BrowserView.  The main BrowserView
may be Chrome- (default) or Alloy-style (add `--use-alloy-style`).
This overlay will only be added to standalone (non-popup) windows.

Popups triggered via the overlay will receive standard Alloy-style
handling in cefclient (e.g. Views-hosted window). Add
`--use-default-popup` for default popup handling.
2024-10-18 15:03:08 -04:00
Marshall Greenblatt
4797681694 views: Fix style calculation for popup BrowserViews (fixes #3499)
Don't depend on a CefBrowserViewDelegate for popup BrowserView style.
Popup style must always match the opener style.
2024-10-18 15:02:57 -04:00
Nik Pavlov
ffbc53a9e6 views: Fix overlay bounds outside of window (fixes #3457) 2024-10-18 15:02:46 -04:00
Marshall Greenblatt
92f14410ae wrapper: Add missing algorithm include (fixes #3804) 2024-10-18 15:02:35 -04:00
Nik Pavlov
e68b0169a1 ceftests: Simplify ViewsWindowTest.WindowAccelerator test (see #3188)
Remove the CefWindowDelegate::OnKeyEvent check as that method
is not currently triggered with the Chrome runtime (see #3797).
2024-10-18 15:02:24 -04:00
Nik Pavlov
1fd6000c70 mac: views: Always initialize CommandDispatcher (see #3188)
ChromeCommandDispatcherDelegate forwards accelerator events to
the FocusManager through NativeWidgetMacNSWindowHost::
HandleAccelerator. Always initialize it so that accelerators also
work in a CefWindow without a BrowserView.
2024-10-18 15:02:14 -04:00
Marshall Greenblatt
5e348cb1fc cefclient: Fix toolbar visibility with --hide-controls (fixes #3745) 2024-10-18 15:02:01 -04:00
Marshall Greenblatt
02b371879b Update to Chromium version 130.0.6723.44 2024-10-11 16:27:48 +00:00
Marshall Greenblatt
3f4d8297f2 Update to Chromium version 130.0.6723.31 2024-10-09 16:36:31 +00:00
Marshall Greenblatt
057c1b1409 cmake: Fix set_property argument (fixes #3775) 2024-09-30 12:49:22 -04:00
Marshall Greenblatt
96ddcee086 Fix dangling ptr in RenderProcessHostTaskProvider (fixes #3758) 2024-09-30 12:19:33 -04:00
Marshall Greenblatt
625ea52a4b Update to Chromium version 130.0.6723.19 2024-09-27 15:50:51 -04:00
Marshall Greenblatt
cd052ec7c3 Update to Chromium version 130.0.6723.0 (#1356013) 2024-09-27 14:15:44 +00:00
Nik Pavlov
e44d33d5bf ceftests: mac: Wait for fullscreen window destruction (see #3188) 2024-09-26 17:52:28 +00:00
Jacobo Aragunde Pérez
6459917c0a Fix index out of bounds with dialog accept_types description (fixes #3779) 2024-09-16 09:08:22 +00:00
Nik Pavlov
b90f0048da Account for overlay host Widget in CefWidget::GetForWidget (fixes #3784) 2024-09-16 09:05:42 +00:00
Nik Pavlov
8c6f8dd404 Add missing <array> header to performance_test_tests.cc 2024-09-02 14:06:21 +00:00
132 changed files with 1918 additions and 950 deletions

View File

@@ -7,6 +7,6 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/129.0.6668.101',
'depot_tools_checkout': 'cc924d1ab6'
'chromium_checkout': 'refs/tags/130.0.6723.117',
'depot_tools_checkout': 'c22f4dc74f'
}

View File

@@ -288,6 +288,8 @@
'tests/cefclient/browser/urlrequest_test.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_overlay_browser.cc',
'tests/cefclient/browser/views_overlay_browser.h',
'tests/cefclient/browser/views_overlay_controls.cc',
'tests/cefclient/browser/views_overlay_controls.h',
'tests/cefclient/browser/views_style.cc',

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7c786570b1c7af912a31c6f0c3d742e8aeb38fd8$
// $hash=e9f34d90eb4af614e35cbb29da0639b62acec7fd$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -301,29 +301,62 @@ typedef struct _cef_browser_host_t {
struct _cef_browser_host_t* self);
///
/// Request that the browser close. The JavaScript 'onbeforeunload' event will
/// be fired. If |force_close| is false (0) the event handler, if any, will be
/// allowed to prompt the user and the user can optionally cancel the close.
/// If |force_close| is true (1) the prompt will not be displayed and the
/// close will proceed. Results in a call to
/// cef_life_span_handler_t::do_close() if the event handler allows the close
/// or if |force_close| is true (1). See cef_life_span_handler_t::do_close()
/// documentation for additional usage information.
/// Request that the browser close. Closing a browser is a multi-stage process
/// that may complete either synchronously or asynchronously, and involves
/// callbacks such as cef_life_span_handler_t::DoClose (Alloy style only),
/// cef_life_span_handler_t::OnBeforeClose, and a top-level window close
/// handler such as cef_window_delegate_t::CanClose (or platform-specific
/// equivalent). In some cases a close request may be delayed or canceled by
/// the user. Using try_close_browser() instead of close_browser() is
/// recommended for most use cases. See cef_life_span_handler_t::do_close()
/// documentation for detailed usage and examples.
///
/// If |force_close| is false (0) then JavaScript unload handlers, if any, may
/// be fired and the close may be delayed or canceled by the user. If
/// |force_close| is true (1) then the user will not be prompted and the close
/// will proceed immediately (possibly asynchronously). If browser close is
/// delayed and not canceled the default behavior is to call the top-level
/// window close handler once the browser is ready to be closed. This default
/// behavior can be changed for Alloy style browsers by implementing
/// cef_life_span_handler_t::do_close(). is_ready_to_be_closed() can be used
/// to detect mandatory browser close events when customizing close behavior
/// on the browser process UI thread.
///
void(CEF_CALLBACK* close_browser)(struct _cef_browser_host_t* self,
int force_close);
///
/// Helper for closing a browser. Call this function from the top-level window
/// close handler (if any). Internally this calls CloseBrowser(false (0)) if
/// the close has not yet been initiated. This function returns false (0)
/// while the close is pending and true (1) after the close has completed. See
/// close_browser() and cef_life_span_handler_t::do_close() documentation for
/// additional usage information. This function must be called on the browser
/// process UI thread.
/// Helper for closing a browser. This is similar in behavior to
/// CLoseBrowser(false (0)) but returns a boolean to reflect the immediate
/// close status. Call this function from a top-level window close handler
/// such as cef_window_delegate_t::CanClose (or platform-specific equivalent)
/// to request that the browser close, and return the result to indicate if
/// the window close should proceed. Returns false (0) if the close will be
/// delayed (JavaScript unload handlers triggered but still pending) or true
/// (1) if the close will proceed immediately (possibly asynchronously). See
/// close_browser() documentation for additional usage information. This
/// function must be called on the browser process UI thread.
///
int(CEF_CALLBACK* try_close_browser)(struct _cef_browser_host_t* self);
///
/// Returns true (1) if the browser is ready to be closed, meaning that the
/// close has already been initiated and that JavaScript unload handlers have
/// already executed or should be ignored. This can be used from a top-level
/// window close handler such as cef_window_delegate_t::CanClose (or platform-
/// specific equivalent) to distringuish between potentially cancelable
/// browser close events (like the user clicking the top-level window close
/// button before browser close has started) and mandatory browser close
/// events (like JavaScript `window.close()` or after browser close has
/// started in response to [Try]close_browser()). Not completing the browser
/// close for mandatory close events (when this function returns true (1))
/// will leave the browser in a partially closed state that interferes with
/// proper functioning. See close_browser() documentation for additional usage
/// information. This function must be called on the browser process UI
/// thread.
///
int(CEF_CALLBACK* is_ready_to_be_closed)(struct _cef_browser_host_t* self);
///
/// Set whether the browser is focused.
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=5232dd6bf16af9b6d195a47bb41de0dfb880a65e$
// $hash=6aad2ccf30a6c519bbeee64d83866e82a41a48d8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_
@@ -138,35 +138,44 @@ typedef struct _cef_life_span_handler_t {
struct _cef_browser_t* browser);
///
/// Called when a browser has received a request to close. This may result
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
/// if the browser is parented to a top-level window created by CEF and the
/// user attempts to close that window (by clicking the 'X', for example). The
/// do_close() function will be called after the JavaScript 'onunload' event
/// has been fired.
/// Called when an Alloy style browser is ready to be closed, meaning that the
/// close has already been initiated and that JavaScript unload handlers have
/// already executed or should be ignored. This may result directly from a
/// call to cef_browser_host_t::[Try]close_browser() or indirectly if the
/// browser's top-level parent window was created by CEF and the user attempts
/// to close that window (by clicking the 'X', for example). do_close() will
/// not be called if the browser's host window/view has already been destroyed
/// (via parent window/view hierarchy tear-down, for example), as it is no
/// longer possible to customize the close behavior at that point.
///
/// An application should handle top-level owner window close notifications by
/// calling cef_browser_host_t::try_close_browser() or
/// An application should handle top-level parent window close notifications
/// by calling cef_browser_host_t::try_close_browser() or
/// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
/// to close immediately (see the examples below). This gives CEF an
/// opportunity to process the 'onbeforeunload' event and optionally cancel
/// opportunity to process JavaScript unload handlers and optionally cancel
/// the close before do_close() is called.
///
/// When windowed rendering is enabled CEF will internally create a window or
/// view to host the browser. In that case returning false (0) from do_close()
/// will send the standard close notification to the browser's top-level owner
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
/// Linux or cef_window_delegate_t::can_close() callback from Views). If the
/// browser's host window/view has already been destroyed (via view hierarchy
/// tear-down, for example) then do_close() will not be called for that
/// browser since is no longer possible to cancel the close.
/// When windowed rendering is enabled CEF will create an internal child
/// window/view to host the browser. In that case returning false (0) from
/// do_close() will send the standard close notification to the browser's top-
/// level parent window (e.g. WM_CLOSE on Windows, performClose: on OS X,
/// "delete_event" on Linux or cef_window_delegate_t::can_close() callback
/// from Views).
///
/// When windowed rendering is disabled returning false (0) from do_close()
/// will cause the browser object to be destroyed immediately.
/// When windowed rendering is disabled there is no internal window/view and
/// returning false (0) from do_close() will cause the browser object to be
/// destroyed immediately.
///
/// If the browser's top-level owner window requires a non-standard close
/// If the browser's top-level parent window requires a non-standard close
/// notification then send that notification from do_close() and return true
/// (1).
/// (1). You are still required to complete the browser close as soon as
/// possible (either by calling [Try]close_browser() or by proceeding with
/// window/view hierarchy tear-down), otherwise the browser will be left in a
/// partially closed state that interferes with proper functioning. Top-level
/// windows created on the browser process UI thread can alternately call
/// cef_browser_host_t::is_ready_to_be_closed() in the close handler to check
/// close status instead of relying on custom do_close() handling. See
/// documentation on that function for additional details.
///
/// The cef_life_span_handler_t::on_before_close() function will be called
/// after do_close() (if do_close() is called) and immediately before the
@@ -182,22 +191,26 @@ typedef struct _cef_life_span_handler_t {
/// which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
/// calls TryCloseBrowser() (similar to calling CloseBrowser(false)).
/// TryCloseBrowser() returns false so the client cancels the window
/// close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false by default).
/// 7. Application's top-level window receives the close notification and
/// 6. Application's do_close() handler is called and returns false (0) by
/// default.
/// 7. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false).
/// 8. Application's top-level window receives the close notification and
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
/// allows the window close.
/// 8. Application's top-level window is destroyed. 9. Application's
/// on_before_close() handler is called and the browser object
/// 9. Application's top-level window is destroyed, triggering destruction
/// of the child browser window.
/// 10. Application's on_before_close() handler is called and the browser
/// object
/// is destroyed.
/// 10. Application exits by calling cef_quit_message_loop() if no other
/// 11. Application exits by calling cef_quit_message_loop() if no other
/// browsers
/// exist.
///
@@ -215,13 +228,17 @@ typedef struct _cef_life_span_handler_t {
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. Application's do_close() handler is called. Application will:
/// A. Set a flag to indicate that the next close attempt will be allowed.
/// A. Set a flag to indicate that the next top-level window close attempt
/// will be allowed.
/// B. Return false.
/// 7. CEF sends an close notification to the application's top-level window.
/// 7. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false).
/// 8. Application's top-level window receives the close notification and
/// allows the window to close based on the flag from #6B.
/// 9. Application's top-level window is destroyed. 10. Application's
/// on_before_close() handler is called and the browser object
/// allows the window to close based on the flag from #6A.
/// 9. Application's top-level window is destroyed, triggering destruction
/// of the child browser window.
/// 10. Application's on_before_close() handler is called and the browser
/// object
/// is destroyed.
/// 11. Application exits by calling cef_quit_message_loop() if no other
/// browsers

View File

@@ -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 "3c4bef13c1801f001305b1bc3af84039b2426943"
#define CEF_API_HASH_UNIVERSAL "676af077d6826353caf40425f5f2bae1262347ea"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "10e56374e7d422b45eec31ae5d2aa7ef5288621c"
#define CEF_API_HASH_PLATFORM "51848171cdea10858c4e0fca0f7099b0fdc759f9"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "ae9f14019f456db6ad8059f17d1dfd484d4a08d7"
#define CEF_API_HASH_PLATFORM "8cc826c5f5fe97c275dfa3b9c020470678a5d2fd"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "84dcdea90daf46d0ba611b1d0f3e42666fb3382d"
#define CEF_API_HASH_PLATFORM "0aec2348de1bf14fafa7a23baa0df942d342d409"
#endif
#ifdef __cplusplus

View File

@@ -331,30 +331,63 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
virtual CefRefPtr<CefBrowser> GetBrowser() = 0;
///
/// Request that the browser close. The JavaScript 'onbeforeunload' event will
/// be fired. If |force_close| is false the event handler, if any, will be
/// allowed to prompt the user and the user can optionally cancel the close.
/// If |force_close| is true the prompt will not be displayed and the close
/// will proceed. Results in a call to CefLifeSpanHandler::DoClose() if the
/// event handler allows the close or if |force_close| is true. See
/// CefLifeSpanHandler::DoClose() documentation for additional usage
/// information.
/// Request that the browser close. Closing a browser is a multi-stage process
/// that may complete either synchronously or asynchronously, and involves
/// callbacks such as CefLifeSpanHandler::DoClose (Alloy style only),
/// CefLifeSpanHandler::OnBeforeClose, and a top-level window close handler
/// such as CefWindowDelegate::CanClose (or platform-specific equivalent). In
/// some cases a close request may be delayed or canceled by the user. Using
/// TryCloseBrowser() instead of CloseBrowser() is recommended for most use
/// cases. See CefLifeSpanHandler::DoClose() documentation for detailed usage
/// and examples.
///
/// If |force_close| is false then JavaScript unload handlers, if any, may be
/// fired and the close may be delayed or canceled by the user. If
/// |force_close| is true then the user will not be prompted and the close
/// will proceed immediately (possibly asynchronously). If browser close is
/// delayed and not canceled the default behavior is to call the top-level
/// window close handler once the browser is ready to be closed. This default
/// behavior can be changed for Alloy style browsers by implementing
/// CefLifeSpanHandler::DoClose(). IsReadyToBeClosed() can be used to detect
/// mandatory browser close events when customizing close behavior on the
/// browser process UI thread.
///
/*--cef()--*/
virtual void CloseBrowser(bool force_close) = 0;
///
/// Helper for closing a browser. Call this method from the top-level window
/// close handler (if any). Internally this calls CloseBrowser(false) if the
/// close has not yet been initiated. This method returns false while the
/// close is pending and true after the close has completed. See
/// CloseBrowser() and CefLifeSpanHandler::DoClose() documentation for
/// additional usage information. This method must be called on the browser
/// process UI thread.
/// Helper for closing a browser. This is similar in behavior to
/// CLoseBrowser(false) but returns a boolean to reflect the immediate close
/// status. Call this method from a top-level window close handler such as
/// CefWindowDelegate::CanClose (or platform-specific equivalent) to request
/// that the browser close, and return the result to indicate if the window
/// close should proceed. Returns false if the close will be delayed
/// (JavaScript unload handlers triggered but still pending) or true if the
/// close will proceed immediately (possibly asynchronously). See
/// CloseBrowser() documentation for additional usage information. This method
/// must be called on the browser process UI thread.
///
/*--cef()--*/
virtual bool TryCloseBrowser() = 0;
///
/// Returns true if the browser is ready to be closed, meaning that the close
/// has already been initiated and that JavaScript unload handlers have
/// already executed or should be ignored. This can be used from a top-level
/// window close handler such as CefWindowDelegate::CanClose (or
/// platform-specific equivalent) to distringuish between potentially
/// cancelable browser close events (like the user clicking the top-level
/// window close button before browser close has started) and mandatory
/// browser close events (like JavaScript `window.close()` or after browser
/// close has started in response to [Try]CloseBrowser()). Not completing the
/// browser close for mandatory close events (when this method returns true)
/// will leave the browser in a partially closed state that interferes with
/// proper functioning. See CloseBrowser() documentation for additional usage
/// information. This method must be called on the browser process UI thread.
///
/*--cef()--*/
virtual bool IsReadyToBeClosed() = 0;
///
/// Set whether the browser is focused.
///

View File

@@ -131,34 +131,44 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) {}
///
/// Called when a browser has received a request to close. This may result
/// directly from a call to CefBrowserHost::*CloseBrowser() or indirectly if
/// the browser is parented to a top-level window created by CEF and the user
/// attempts to close that window (by clicking the 'X', for example). The
/// DoClose() method will be called after the JavaScript 'onunload' event has
/// been fired.
/// Called when an Alloy style browser is ready to be closed, meaning that the
/// close has already been initiated and that JavaScript unload handlers have
/// already executed or should be ignored. This may result directly from a
/// call to CefBrowserHost::[Try]CloseBrowser() or indirectly if the browser's
/// top-level parent window was created by CEF and the user attempts to
/// close that window (by clicking the 'X', for example). DoClose() will not
/// be called if the browser's host window/view has already been destroyed
/// (via parent window/view hierarchy tear-down, for example), as it is no
/// longer possible to customize the close behavior at that point.
///
/// An application should handle top-level owner window close notifications by
/// calling CefBrowserHost::TryCloseBrowser() or
/// An application should handle top-level parent window close notifications
/// by calling CefBrowserHost::TryCloseBrowser() or
/// CefBrowserHost::CloseBrowser(false) instead of allowing the window to
/// close immediately (see the examples below). This gives CEF an opportunity
/// to process the 'onbeforeunload' event and optionally cancel the close
/// to process JavaScript unload handlers and optionally cancel the close
/// before DoClose() is called.
///
/// When windowed rendering is enabled CEF will internally create a window or
/// view to host the browser. In that case returning false from DoClose() will
/// send the standard close notification to the browser's top-level owner
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
/// Linux or CefWindowDelegate::CanClose() callback from Views). If the
/// browser's host window/view has already been destroyed (via view hierarchy
/// tear-down, for example) then DoClose() will not be called for that browser
/// since is no longer possible to cancel the close.
/// When windowed rendering is enabled CEF will create an internal child
/// window/view to host the browser. In that case returning false from
/// DoClose() will send the standard close notification to the browser's
/// top-level parent window (e.g. WM_CLOSE on Windows, performClose: on OS X,
/// "delete_event" on Linux or CefWindowDelegate::CanClose() callback from
/// Views).
///
/// When windowed rendering is disabled returning false from DoClose() will
/// cause the browser object to be destroyed immediately.
/// When windowed rendering is disabled there is no internal window/view
/// and returning false from DoClose() will cause the browser object to be
/// destroyed immediately.
///
/// If the browser's top-level owner window requires a non-standard close
/// If the browser's top-level parent window requires a non-standard close
/// notification then send that notification from DoClose() and return true.
/// You are still required to complete the browser close as soon as possible
/// (either by calling [Try]CloseBrowser() or by proceeding with window/view
/// hierarchy tear-down), otherwise the browser will be left in a partially
/// closed state that interferes with proper functioning. Top-level windows
/// created on the browser process UI thread can alternately call
/// CefBrowserHost::IsReadyToBeClosed() in the close handler to check close
/// status instead of relying on custom DoClose() handling. See documentation
/// on that method for additional details.
///
/// The CefLifeSpanHandler::OnBeforeClose() method will be called after
/// DoClose() (if DoClose() is called) and immediately before the browser
@@ -174,7 +184,7 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
/// 1. User clicks the window close button which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
/// calls TryCloseBrowser() (similar to calling CloseBrowser(false)).
/// TryCloseBrowser() returns false so the client cancels the window
/// close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
@@ -182,15 +192,18 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close.
/// 5. JavaScript 'onunload' handler executes.
/// 6. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false by default).
/// 7. Application's top-level window receives the close notification and
/// 6. Application's DoClose() handler is called and returns false by
/// default.
/// 7. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false).
/// 8. Application's top-level window receives the close notification and
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
/// allows the window close.
/// 8. Application's top-level window is destroyed.
/// 9. Application's OnBeforeClose() handler is called and the browser object
/// 9. Application's top-level window is destroyed, triggering destruction
/// of the child browser window.
/// 10. Application's OnBeforeClose() handler is called and the browser object
/// is destroyed.
/// 10. Application exits by calling CefQuitMessageLoop() if no other browsers
/// 11. Application exits by calling CefQuitMessageLoop() if no other browsers
/// exist.
///
/// Example 2: Using CefBrowserHost::CloseBrowser(false) and implementing the
@@ -208,12 +221,15 @@ class CefLifeSpanHandler : public virtual CefBaseRefCounted {
/// 4. User approves the close.
/// 5. JavaScript 'onunload' handler executes.
/// 6. Application's DoClose() handler is called. Application will:
/// A. Set a flag to indicate that the next close attempt will be allowed.
/// A. Set a flag to indicate that the next top-level window close attempt
/// will be allowed.
/// B. Return false.
/// 7. CEF sends an close notification to the application's top-level window.
/// 7. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false).
/// 8. Application's top-level window receives the close notification and
/// allows the window to close based on the flag from #6B.
/// 9. Application's top-level window is destroyed.
/// allows the window to close based on the flag from #6A.
/// 9. Application's top-level window is destroyed, triggering destruction
/// of the child browser window.
/// 10. Application's OnBeforeClose() handler is called and the browser object
/// is destroyed.
/// 11. Application exits by calling CefQuitMessageLoop() if no other browsers

View File

@@ -3627,20 +3627,22 @@ 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_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,
CEF_PERMISSION_TYPE_KEYBOARD_LOCK = 1 << 16,
CEF_PERMISSION_TYPE_POINTER_LOCK = 1 << 17,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 18,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 19,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 20,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 21,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 22,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 23,
CEF_PERMISSION_TYPE_HAND_TRACKING = 1 << 10,
CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 << 11,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 12,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 13,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 14,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 15,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 16,
CEF_PERMISSION_TYPE_KEYBOARD_LOCK = 1 << 17,
CEF_PERMISSION_TYPE_POINTER_LOCK = 1 << 18,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 19,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 20,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 21,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 22,
CEF_PERMISSION_TYPE_WEB_APP_INSTALLATION = 1 << 23,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 24,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 25,
} cef_permission_request_types_t;
///

View File

@@ -445,28 +445,35 @@ typedef enum {
/// ALLOW: Protections disabled.
CEF_CONTENT_SETTING_TYPE_TRACKING_PROTECTION,
// With this permission, when the application calls `getDisplayMedia()`, a
// system audio track can be returned without showing the display media
// selection picker. The application can explicitly specify
// `systemAudio: 'exclude'` or `video: true` to still show the display media
// selection picker if needed. Please note that the setting only works for
// WebUI.
/// With this permission, when the application calls `getDisplayMedia()`, a
/// system audio track can be returned without showing the display media
/// selection picker. The application can explicitly specify
/// `systemAudio: 'exclude'` or `video: true` to still show the display media
/// selection picker if needed. Please note that the setting only works for
/// WebUI.
CEF_CONTENT_SETTING_TYPE_DISPLAY_MEDIA_SYSTEM_AUDIO,
// Whether to use the higher-tier v8 optimizers for running JavaScript on the
// page.
/// Whether to use the higher-tier v8 optimizers for running JavaScript on the
/// page.
CEF_CONTENT_SETTING_TYPE_JAVASCRIPT_OPTIMIZER,
// Content Setting for the Storage Access Headers persistent origin trial that
// allows origins to opt into the storage access header behavior. Should be
// scoped to `REQUESTING_ORIGIN_AND_TOP_SCHEMEFUL_SITE_SCOPE` in order to
// correspond to the design of persistent origin trials. See also:
// https://github.com/cfredric/storage-access-headers
// ALLOW: storage access request headers will be attached to cross-site
// requests, and url requests will look for response headers from
// origins to retry a request or load with storage access.
// BLOCK (default): no effect.
/// Content Setting for the Storage Access Headers persistent origin trial
/// that allows origins to opt into the storage access header behavior. Should
/// be scoped to `REQUESTING_ORIGIN_AND_TOP_SCHEMEFUL_SITE_SCOPE` in order to
/// correspond to the design of persistent origin trials. See also:
/// https://github.com/cfredric/storage-access-headers
/// ALLOW: storage access request headers will be attached to cross-site
/// requests, and url requests will look for response headers from
/// origins to retry a request or load with storage access.
/// BLOCK (default): no effect.
CEF_CONTENT_SETTING_TYPE_STORAGE_ACCESS_HEADER_ORIGIN_TRIAL,
/// Whether or not sites can request Hand Tracking data within WebXR Sessions.
CEF_CONTENT_SETTING_TYPE_HAND_TRACKING,
/// Website setting to indicate whether user has opted in to allow web apps to
/// install other web apps.
CEF_CONTENT_SETTING_TYPE_WEB_APP_INSTALLATION,
} cef_content_setting_types_t;
///

View File

@@ -35,6 +35,7 @@
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/common/webui_url_constants.h"
#include "components/input/native_web_keyboard_event.h"
#include "components/printing/browser/print_composite_client.h"
#include "components/zoom/page_zoom.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/public/browser/desktop_media_id.h"
@@ -550,6 +551,10 @@ void AlloyBrowserHostImpl::WindowDestroyed() {
CEF_REQUIRE_UIT();
DCHECK(!window_destroyed_);
window_destroyed_ = true;
// Destroy objects that may reference the window.
menu_manager_.reset(nullptr);
CloseBrowser(true);
}
@@ -922,6 +927,17 @@ bool AlloyBrowserHostImpl::IsAudioMuted() {
// content::WebContentsDelegate methods.
// -----------------------------------------------------------------------------
void AlloyBrowserHostImpl::PrintCrossProcessSubframe(
content::WebContents* web_contents,
const gfx::Rect& rect,
int document_cookie,
content::RenderFrameHost* subframe_host) const {
auto* client = printing::PrintCompositeClient::FromWebContents(web_contents);
if (client) {
client->PrintCrossProcessSubframe(rect, document_cookie, subframe_host);
}
}
content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
@@ -940,7 +956,7 @@ content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(
return nullptr;
}
void AlloyBrowserHostImpl::AddNewContents(
content::WebContents* AlloyBrowserHostImpl::AddNewContents(
content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,
@@ -948,9 +964,11 @@ void AlloyBrowserHostImpl::AddNewContents(
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) {
auto* new_contents_ptr = new_contents.get();
platform_delegate_->AddNewContents(source, std::move(new_contents),
target_url, disposition, window_features,
user_gesture, was_blocked);
return new_contents_ptr;
}
void AlloyBrowserHostImpl::LoadingStateChanged(content::WebContents* source,

View File

@@ -174,18 +174,23 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
DestructionState destruction_state() const { return destruction_state_; }
// content::WebContentsDelegate methods.
void PrintCrossProcessSubframe(content::WebContents* web_contents,
const gfx::Rect& rect,
int document_cookie,
content::RenderFrameHost* subframe_host) const override;
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) override;
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) override;
content::WebContents* AddNewContents(
content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
const GURL& target_url,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& window_features,
bool user_gesture,
bool* was_blocked) override;
void LoadingStateChanged(content::WebContents* source,
bool should_show_loading_ui) override;
void CloseContents(content::WebContents* source) override;

View File

@@ -452,6 +452,20 @@ bool CefBrowserHostBase::HasView() {
return is_views_hosted_;
}
bool CefBrowserHostBase::IsReadyToBeClosed() {
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
return false;
}
if (auto web_contents = GetWebContents()) {
return static_cast<content::RenderFrameHostImpl*>(
web_contents->GetPrimaryMainFrame())
->IsPageReadyToBeClosed();
}
return true;
}
void CefBrowserHostBase::SetFocus(bool focus) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT,

View File

@@ -218,6 +218,7 @@ class CefBrowserHostBase : public CefBrowserHost,
double GetZoomLevel() override;
void SetZoomLevel(double zoomLevel) override;
bool HasView() override;
bool IsReadyToBeClosed() override;
void SetFocus(bool focus) override;
void RunFileDialog(FileDialogMode mode,
const CefString& title,

View File

@@ -277,11 +277,14 @@ void CefBrowserInfo::RemoveFrame(content::RenderFrameHost* host) {
{
auto it2 = frame_info_set_.find(frame_info);
// Explicitly Detach everything but the current main frame.
// Explicitly Detach everything.
const auto& other_frame_info = *it2;
if (other_frame_info->frame_ && !other_frame_info->IsCurrentMainFrame()) {
if (other_frame_info->frame_) {
const bool is_current_main_frame = other_frame_info->IsCurrentMainFrame();
if (other_frame_info->frame_->Detach(
CefFrameHostImpl::DetachReason::RENDER_FRAME_DELETED)) {
CefFrameHostImpl::DetachReason::RENDER_FRAME_DELETED,
is_current_main_frame)) {
DCHECK(!is_current_main_frame);
MaybeNotifyFrameDetached(browser_, other_frame_info->frame_);
}
}
@@ -477,7 +480,8 @@ void CefBrowserInfo::SetMainFrame(CefRefPtr<CefBrowserHostBase> browser,
CefRefPtr<CefFrameHostImpl> old_frame;
if (main_frame_) {
old_frame = main_frame_;
if (old_frame->Detach(CefFrameHostImpl::DetachReason::NEW_MAIN_FRAME)) {
if (old_frame->Detach(CefFrameHostImpl::DetachReason::NEW_MAIN_FRAME,
/*is_current_main_frame=*/false)) {
MaybeNotifyFrameDetached(browser, old_frame);
}
}
@@ -556,11 +560,14 @@ void CefBrowserInfo::RemoveAllFrames(
frame_id_map_.clear();
frame_token_to_id_map_.clear();
// Explicitly Detach everything but the current main frame.
// Explicitly Detach everything.
for (auto& info : frame_info_set_) {
if (info->frame_ && !info->IsCurrentMainFrame()) {
if (info->frame_) {
const bool is_current_main_frame = info->IsCurrentMainFrame();
if (info->frame_->Detach(
CefFrameHostImpl::DetachReason::BROWSER_DESTROYED)) {
CefFrameHostImpl::DetachReason::BROWSER_DESTROYED,
is_current_main_frame)) {
DCHECK(!is_current_main_frame);
MaybeNotifyFrameDetached(old_browser, info->frame_);
}
}

View File

@@ -63,6 +63,10 @@ class PopupWindowDelegate : public CefWindowDelegate {
return true;
}
cef_runtime_style_t GetWindowRuntimeStyle() override {
return browser_view_->GetRuntimeStyle();
}
private:
CefRefPtr<CefBrowserView> browser_view_;
@@ -195,8 +199,9 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated(
}
CefRefPtr<CefBrowserViewDelegate> new_delegate;
CefRefPtr<CefBrowserViewDelegate> opener_delegate;
cef_runtime_style_t opener_runtime_style = CEF_RUNTIME_STYLE_DEFAULT;
auto browser_view = GetBrowserView();
if (browser_view) {
// When |this| (the popup opener) is Views-hosted use the current delegate.
@@ -212,12 +217,22 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated(
browser_view, settings, client, is_devtools);
}
if (browser_view) {
opener_runtime_style = browser_view->GetRuntimeStyle();
} else if (opener_delegate) {
opener_runtime_style = opener_delegate->GetBrowserRuntimeStyle();
}
// Create a new BrowserView for the popup.
CefRefPtr<CefBrowserViewImpl> new_browser_view =
CefBrowserViewImpl::CreateForPopup(settings, new_delegate, is_devtools);
CefBrowserViewImpl::CreateForPopup(settings, new_delegate, is_devtools,
opener_runtime_style);
// Associate the PlatformDelegate with the new BrowserView.
new_platform_delegate->SetBrowserView(new_browser_view);
// Keep the BrowserView alive until PopupBrowserCreated() is called.
new_browser_view->AddRef();
}
void CefBrowserPlatformDelegate::PopupBrowserCreated(
@@ -255,6 +270,9 @@ void CefBrowserPlatformDelegate::PopupBrowserCreated(
CefWindow::CreateTopLevelWindow(
new PopupWindowDelegate(new_browser_view.get()));
}
// Release the reference added in PopupWebContentsCreated().
new_browser_view->Release();
}
CefRefPtr<CefBrowserViewDelegate>

View File

@@ -165,14 +165,47 @@ void ChromeBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
}
void ChromeBrowserHostImpl::CloseBrowser(bool force_close) {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT, base::BindOnce(&ChromeBrowserHostImpl::CloseBrowser,
this, force_close));
return;
}
if (!force_close) {
TryCloseBrowser();
return;
}
// Always do this asynchronously because TabStripModel is not re-entrant.
CEF_POST_TASK(CEF_UIT, base::BindOnce(&ChromeBrowserHostImpl::DoCloseBrowser,
this, force_close));
CEF_POST_TASK(CEF_UIT,
base::BindOnce(&ChromeBrowserHostImpl::DoCloseBrowser, this));
}
bool ChromeBrowserHostImpl::TryCloseBrowser() {
// TODO(chrome): Handle the case where the browser may not close immediately.
CloseBrowser(true);
if (!CEF_CURRENTLY_ON_UIT()) {
DCHECK(false) << "called on invalid thread";
return false;
}
if (auto* web_contents = GetWebContents()) {
// This check works as follows:
// 1. Returns false if the main frame is ready to close
// (IsPageReadyToBeClosed returns true).
// 2. Otherwise returns true if any frame in the frame tree needs to run
// beforeunload or unload-time event handlers.
// 3. Otherwise returns false.
if (web_contents->NeedToFireBeforeUnloadOrUnloadEvents()) {
// Will result in a call to Browser::BeforeUnloadFired and, if the close
// isn't canceled, Browser::CloseContents which indirectly calls
// TabStripModel::CloseWebContentsAt (similar to DoCloseBrowser but
// without CLOSE_USER_GESTURE). Additional calls to DispatchBeforeUnload
// while the unload is pending will be ignored.
web_contents->DispatchBeforeUnload(/*auto_cancel=*/false);
return false;
}
}
CloseBrowser(/*force_close=*/true);
return true;
}
@@ -551,7 +584,7 @@ void ChromeBrowserHostImpl::DestroyBrowser() {
// WebContents first. See comments on CefBrowserHostBase::DestroyBrowser.
if (GetWebContents()) {
// Triggers a call to OnWebContentsDestroyed.
DoCloseBrowser(/*force_close=*/true);
DoCloseBrowser();
DCHECK(!GetWebContents());
}
@@ -565,15 +598,13 @@ void ChromeBrowserHostImpl::DestroyBrowser() {
CefBrowserHostBase::DestroyBrowser();
}
void ChromeBrowserHostImpl::DoCloseBrowser(bool force_close) {
void ChromeBrowserHostImpl::DoCloseBrowser() {
CEF_REQUIRE_UIT();
if (browser_) {
// Like chrome::CloseTab() but specifying the WebContents.
const int tab_index = GetCurrentTabIndex();
if (tab_index != TabStripModel::kNoTab) {
// This will trigger destruction of the Browser and WebContents.
// TODO(chrome): Handle the case where this method returns false,
// indicating that the contents were not closed immediately.
browser_->tab_strip_model()->CloseWebContentsAt(
tab_index, TabCloseTypes::CLOSE_CREATE_HISTORICAL_TAB |
TabCloseTypes::CLOSE_USER_GESTURE);

View File

@@ -169,7 +169,7 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
bool WillBeDestroyed() const override;
void DestroyBrowser() override;
void DoCloseBrowser(bool force_close);
void DoCloseBrowser();
// Returns the current tab index for the associated WebContents, or
// TabStripModel::kNoTab if not found.

View File

@@ -17,6 +17,7 @@
#if BUILDFLAG(IS_LINUX)
#include "base/linux_util.h"
#include "cef/libcef/browser/printing/print_dialog_linux.h"
#endif
#if BUILDFLAG(IS_WIN)
@@ -83,4 +84,11 @@ void ChromeBrowserMainExtraPartsCef::ToolkitInitialized() {
// Override the default Chrome client.
SetConstrainedWindowViewsClient(CreateAlloyConstrainedWindowViewsClient(
CreateChromeConstrainedWindowViewsClient()));
#if BUILDFLAG(IS_LINUX)
auto printing_delegate = new CefPrintingContextLinuxDelegate();
auto default_delegate =
ui::PrintingContextLinuxDelegate::SetInstance(printing_delegate);
printing_delegate->SetDefaultDelegate(default_delegate);
#endif // BUILDFLAG(IS_LINUX)
}

View File

@@ -51,7 +51,7 @@ namespace {
void HandleExternalProtocolHelper(
ChromeContentBrowserClientCef* self,
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
@@ -59,6 +59,8 @@ void HandleExternalProtocolHelper(
const network::ResourceRequest& resource_request,
const std::optional<url::Origin>& initiating_origin,
content::WeakDocumentPtr initiator_document) {
CEF_REQUIRE_UIT();
// May return nullptr if frame has been deleted or a cross-document navigation
// has committed in the same RenderFrameHost.
auto initiator_rfh = initiator_document.AsRenderFrameHostIfValid();
@@ -343,7 +345,7 @@ void ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
bool ChromeContentBrowserClientCef::HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
@@ -372,7 +374,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
bool ChromeContentBrowserClientCef::HandleExternalProtocol(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,

View File

@@ -78,7 +78,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
bool HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
@@ -91,7 +91,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
override;
bool HandleExternalProtocol(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
content::NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,

View File

@@ -24,7 +24,8 @@ void CefBrowserPlatformDelegateChromeViews::SetBrowserView(
CefRefPtr<CefBrowserView> browser_view) {
DCHECK(!browser_view_);
DCHECK(browser_view);
browser_view_ = static_cast<CefBrowserViewImpl*>(browser_view.get());
browser_view_ =
static_cast<CefBrowserViewImpl*>(browser_view.get())->GetWeakPtr();
}
void CefBrowserPlatformDelegateChromeViews::WebContentsCreated(
@@ -37,7 +38,10 @@ void CefBrowserPlatformDelegateChromeViews::WebContentsCreated(
void CefBrowserPlatformDelegateChromeViews::WebContentsDestroyed(
content::WebContents* web_contents) {
CefBrowserPlatformDelegateChrome::WebContentsDestroyed(web_contents);
browser_view_->WebContentsDestroyed(web_contents);
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_) {
browser_view_->WebContentsDestroyed(web_contents);
}
}
void CefBrowserPlatformDelegateChromeViews::BrowserCreated(
@@ -48,7 +52,7 @@ void CefBrowserPlatformDelegateChromeViews::BrowserCreated(
void CefBrowserPlatformDelegateChromeViews::NotifyBrowserCreated() {
if (auto delegate = browser_view_->delegate()) {
delegate->OnBrowserCreated(browser_view_, browser_.get());
delegate->OnBrowserCreated(browser_view_.get(), browser_.get());
// DevTools windows hide the notification bubble by default. However, we
// don't currently have the ability to intercept WebContents creation via
@@ -75,8 +79,9 @@ void CefBrowserPlatformDelegateChromeViews::NotifyBrowserCreated() {
}
void CefBrowserPlatformDelegateChromeViews::NotifyBrowserDestroyed() {
if (browser_view_->delegate()) {
browser_view_->delegate()->OnBrowserDestroyed(browser_view_,
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_ && browser_view_->delegate()) {
browser_view_->delegate()->OnBrowserDestroyed(browser_view_.get(),
browser_.get());
}
}
@@ -84,7 +89,11 @@ void CefBrowserPlatformDelegateChromeViews::NotifyBrowserDestroyed() {
void CefBrowserPlatformDelegateChromeViews::BrowserDestroyed(
CefBrowserHostBase* browser) {
CefBrowserPlatformDelegateChrome::BrowserDestroyed(browser);
browser_view_->BrowserDestroyed(browser);
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_) {
browser_view_->BrowserDestroyed(browser);
}
browser_view_ = nullptr;
}
void CefBrowserPlatformDelegateChromeViews::CloseHostWindow() {
@@ -100,7 +109,7 @@ CefWindowHandle CefBrowserPlatformDelegateChromeViews::GetHostWindowHandle()
}
views::Widget* CefBrowserPlatformDelegateChromeViews::GetWindowWidget() const {
if (browser_view_->root_view()) {
if (browser_view_ && browser_view_->root_view()) {
return browser_view_->root_view()->GetWidget();
}
return nullptr;

View File

@@ -5,6 +5,7 @@
#ifndef CEF_LIBCEF_BROWSER_CHROME_VIEWS_BROWSER_PLATFORM_DELEGATE_CHROME_VIEWS_H_
#define CEF_LIBCEF_BROWSER_CHROME_VIEWS_BROWSER_PLATFORM_DELEGATE_CHROME_VIEWS_H_
#include "base/memory/weak_ptr.h"
#include "cef/libcef/browser/chrome/browser_platform_delegate_chrome.h"
#include "cef/libcef/browser/views/browser_view_impl.h"
@@ -33,12 +34,17 @@ class CefBrowserPlatformDelegateChromeViews
void SetBrowserView(CefRefPtr<CefBrowserView> browser_view) override;
bool IsViewsHosted() const override;
CefRefPtr<CefBrowserViewImpl> browser_view() const { return browser_view_; }
CefBrowserViewImpl* browser_view() const { return browser_view_.get(); }
private:
CefWindowImpl* GetWindowImpl() const;
CefRefPtr<CefBrowserViewImpl> browser_view_;
// Holding a weak reference here because we want the CefBrowserViewImpl to be
// destroyed first if all references are released by the client.
// CefBrowserViewImpl destruction will then trigger destruction of any
// associated CefBrowserHostBase (which owns this CefBrowserPlatformDelegate
// object).
base::WeakPtr<CefBrowserViewImpl> browser_view_;
};
#endif // CEF_LIBCEF_BROWSER_CHROME_VIEWS_BROWSER_PLATFORM_DELEGATE_CHROME_VIEWS_H_

View File

@@ -11,6 +11,13 @@ ChromeBrowserView::ChromeBrowserView(CefBrowserViewImpl* cef_browser_view)
: ParentClass(cef_browser_view->delegate()),
cef_browser_view_(cef_browser_view) {}
ChromeBrowserView::~ChromeBrowserView() {
if (cef_toolbar_) {
WillDestroyToolbar();
cef_toolbar_ = nullptr;
}
}
void ChromeBrowserView::InitBrowser(std::unique_ptr<Browser> browser) {
DCHECK(!web_view_);

View File

@@ -30,6 +30,7 @@ class ChromeBrowserView
// |cef_browser_view| is non-nullptr and will outlive this object.
explicit ChromeBrowserView(CefBrowserViewImpl* cef_browser_view);
~ChromeBrowserView() override;
ChromeBrowserView(const ChromeBrowserView&) = delete;
ChromeBrowserView& operator=(const ChromeBrowserView&) = delete;

View File

@@ -469,8 +469,8 @@ void CefFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
content::RenderFrameHost* rfh = GetRenderFrameHost();
if (rfh) {
rfh->ExecuteJavaScriptWithUserGestureForTests(javascript,
base::NullCallback());
rfh->ExecuteJavaScriptWithUserGestureForTests(
javascript, base::NullCallback(), content::ISOLATED_WORLD_ID_GLOBAL);
}
}
@@ -495,7 +495,7 @@ bool CefFrameHostImpl::IsDetached() const {
return !GetRenderFrameHost();
}
bool CefFrameHostImpl::Detach(DetachReason reason) {
bool CefFrameHostImpl::Detach(DetachReason reason, bool is_current_main_frame) {
CEF_REQUIRE_UIT();
if (VLOG_IS_ON(1)) {
@@ -516,24 +516,29 @@ bool CefFrameHostImpl::Detach(DetachReason reason) {
<< ", is_connected=" << render_frame_.is_bound() << ")";
}
// May be called multiple times (e.g. from CefBrowserInfo SetMainFrame and
// RemoveFrame).
bool first_detach = false;
// This method may be called multiple times (e.g. from CefBrowserInfo
// SetMainFrame and RemoveFrame).
bool is_first_complete_detach = false;
// Should not be called for temporary frames.
CHECK(!is_temporary());
{
base::AutoLock lock_scope(state_lock_);
if (browser_info_) {
first_detach = true;
browser_info_ = nullptr;
}
}
// Must be a main frame if |is_current_main_frame| is true.
CHECK(!is_current_main_frame || is_main_frame_);
// In case we never attached, clean up.
while (!queued_renderer_actions_.empty()) {
queued_renderer_actions_.pop();
if (!is_current_main_frame) {
{
base::AutoLock lock_scope(state_lock_);
if (browser_info_) {
is_first_complete_detach = true;
browser_info_ = nullptr;
}
}
// In case we never attached, clean up.
while (!queued_renderer_actions_.empty()) {
queued_renderer_actions_.pop();
}
}
if (render_frame_.is_bound()) {
@@ -543,7 +548,7 @@ bool CefFrameHostImpl::Detach(DetachReason reason) {
render_frame_.reset();
render_frame_host_ = nullptr;
return first_detach;
return is_first_complete_detach;
}
void CefFrameHostImpl::MaybeReAttach(

View File

@@ -136,9 +136,11 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
// Owned frame objects will be detached explicitly when the associated
// RenderFrame is deleted. Temporary frame objects will be detached
// implicitly via CefBrowserInfo::browser() returning nullptr. Returns true
// if this was the first call to Detach() for the frame.
bool Detach(DetachReason reason);
// implicitly via CefBrowserInfo::browser() returning nullptr. If
// |is_current_main_frame| is true then only the RenderFrameHost references
// will be released as we want the frame object itself to remain valid.
// Returns true if the frame is completely detached for the first time.
bool Detach(DetachReason reason, bool is_current_main_frame);
// A frame has swapped to active status from prerendering or the back-forward
// cache. We may need to re-attach if the RFH has changed. See

View File

@@ -449,9 +449,6 @@ void CefMainRunner::StartShutdownOnUIThread(
content::BrowserTaskExecutor::RunAllPendingTasksOnThreadForTesting(
content::BrowserThread::IO);
static_cast<content::ContentMainRunnerImpl*>(main_runner_.get())
->ShutdownOnUIThread();
std::move(shutdown_on_ui_thread).Run();
BeforeUIThreadShutdown();
}
@@ -462,6 +459,9 @@ void CefMainRunner::FinishShutdownOnUIThread() {
// It is safe to call multiple times.
ChromeProcessSingleton::DeleteInstance();
}
static_cast<content::ContentMainRunnerImpl*>(main_runner_.get())
->ShutdownOnUIThread();
}
void CefMainRunner::BeforeUIThreadInitialize() {

View File

@@ -283,10 +283,7 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter,
// Match the logic in
// URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete.
base::Time response_date;
if (!headers->GetDateValue(&response_date)) {
response_date = base::Time();
}
const auto response_date = headers->GetDateValue();
const std::string_view name(net_service::kHTTPSetCookieHeaderName);
std::string cookie_string;
@@ -299,8 +296,7 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter,
net::CookieInclusionStatus returned_status;
std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create(
request.url, cookie_string, base::Time::Now(),
std::make_optional(response_date),
request.url, cookie_string, base::Time::Now(), response_date,
/*cookie_partition_key=*/std::nullopt, net::CookieSourceType::kHTTP,
&returned_status);
if (!returned_status.IsInclude()) {

View File

@@ -1116,7 +1116,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
init_state_->browser_, init_state_->frame_,
state->pending_request_.get(), allow_os_execution);
if (allow_os_execution && init_state_->unhandled_request_callback_) {
init_state_->unhandled_request_callback_.Run();
CEF_POST_TASK(TID_UI, init_state_->unhandled_request_callback_);
}
}
}
@@ -1360,7 +1360,7 @@ std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
const network::ResourceRequest& request,
const base::RepeatingClosure& unhandled_request_callback) {
CEF_REQUIRE_UIT();

View File

@@ -41,7 +41,7 @@ std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
// ProxyURLLoaderFactory::CreateProxy. Called on the UI thread only.
std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::FrameTreeNodeId frame_tree_node_id,
const network::ResourceRequest& request,
const base::RepeatingClosure& unhandled_request_callback);

View File

@@ -107,7 +107,7 @@ struct PopulateAxNodeAttributes {
case ax::mojom::IntAttribute::kActivedescendantId:
case ax::mojom::IntAttribute::kInPageLinkTargetId:
case ax::mojom::IntAttribute::kErrormessageIdDeprecated:
case ax::mojom::IntAttribute::kDOMNodeId:
case ax::mojom::IntAttribute::kDOMNodeIdDeprecated:
case ax::mojom::IntAttribute::kDropeffectDeprecated:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:

View File

@@ -208,6 +208,8 @@ cef_permission_request_types_t GetCefRequestType(
return CEF_PERMISSION_TYPE_LOCAL_FONTS;
case permissions::RequestType::kGeolocation:
return CEF_PERMISSION_TYPE_GEOLOCATION;
case permissions::RequestType::kHandTracking:
return CEF_PERMISSION_TYPE_HAND_TRACKING;
case permissions::RequestType::kIdentityProvider:
return CEF_PERMISSION_TYPE_IDENTITY_PROVIDER;
case permissions::RequestType::kIdleDetection:
@@ -236,6 +238,8 @@ cef_permission_request_types_t GetCefRequestType(
return CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS;
case permissions::RequestType::kVrSession:
return CEF_PERMISSION_TYPE_VR_SESSION;
case permissions::RequestType::kWebAppInstallation:
return CEF_PERMISSION_TYPE_WEB_APP_INSTALLATION;
case permissions::RequestType::kWindowManagement:
return CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT;
case permissions::RequestType::kFileSystemAccess:

View File

@@ -27,7 +27,8 @@ void CefBrowserPlatformDelegateViews::SetBrowserView(
CefRefPtr<CefBrowserView> browser_view) {
DCHECK(!browser_view_);
DCHECK(browser_view);
browser_view_ = static_cast<CefBrowserViewImpl*>(browser_view.get());
browser_view_ =
static_cast<CefBrowserViewImpl*>(browser_view.get())->GetWeakPtr();
}
void CefBrowserPlatformDelegateViews::WebContentsCreated(
@@ -41,7 +42,10 @@ void CefBrowserPlatformDelegateViews::WebContentsCreated(
void CefBrowserPlatformDelegateViews::WebContentsDestroyed(
content::WebContents* web_contents) {
CefBrowserPlatformDelegateAlloy::WebContentsDestroyed(web_contents);
browser_view_->WebContentsCreated(web_contents);
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_) {
browser_view_->WebContentsDestroyed(web_contents);
}
native_delegate_->WebContentsDestroyed(web_contents);
}
@@ -57,15 +61,16 @@ void CefBrowserPlatformDelegateViews::NotifyBrowserCreated() {
DCHECK(browser_view_);
DCHECK(browser_);
if (browser_view_->delegate()) {
browser_view_->delegate()->OnBrowserCreated(browser_view_, browser_.get());
browser_view_->delegate()->OnBrowserCreated(browser_view_.get(),
browser_.get());
}
}
void CefBrowserPlatformDelegateViews::NotifyBrowserDestroyed() {
DCHECK(browser_view_);
DCHECK(browser_);
if (browser_view_->delegate()) {
browser_view_->delegate()->OnBrowserDestroyed(browser_view_,
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_ && browser_view_->delegate()) {
browser_view_->delegate()->OnBrowserDestroyed(browser_view_.get(),
browser_.get());
}
}
@@ -74,7 +79,10 @@ void CefBrowserPlatformDelegateViews::BrowserDestroyed(
CefBrowserHostBase* browser) {
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);
browser_view_->BrowserDestroyed(browser);
// |browser_view_| may be destroyed before this callback arrives.
if (browser_view_) {
browser_view_->BrowserDestroyed(browser);
}
browser_view_ = nullptr;
native_delegate_->BrowserDestroyed(browser);
}

View File

@@ -5,6 +5,7 @@
#ifndef CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_
#define CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_
#include "base/memory/weak_ptr.h"
#include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h"
#include "cef/libcef/browser/native/browser_platform_delegate_native.h"
#include "cef/libcef/browser/views/browser_view_impl.h"
@@ -65,7 +66,13 @@ class CefBrowserPlatformDelegateViews
private:
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_;
CefRefPtr<CefBrowserViewImpl> browser_view_;
// Holding a weak reference here because we want the CefBrowserViewImpl to be
// destroyed first if all references are released by the client.
// CefBrowserViewImpl destruction will then trigger destruction of any
// associated CefBrowserHostBase (which owns this CefBrowserPlatformDelegate
// object).
base::WeakPtr<CefBrowserViewImpl> browser_view_;
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_

View File

@@ -35,30 +35,39 @@ std::optional<cef_gesture_command_t> GetGestureCommand(
return std::nullopt;
}
bool ComputeAlloyStyle(CefBrowserViewDelegate* cef_delegate,
bool is_devtools_popup) {
// Alloy style is not supported with Chrome DevTools popups.
const bool supports_alloy_style = !is_devtools_popup;
const auto default_style = CEF_RUNTIME_STYLE_CHROME;
auto result_style = default_style;
if (cef_delegate) {
auto requested_style = cef_delegate->GetBrowserRuntimeStyle();
if (requested_style == CEF_RUNTIME_STYLE_ALLOY) {
if (supports_alloy_style) {
result_style = requested_style;
} else {
LOG(ERROR) << "GetBrowserRuntimeStyle() requested Alloy style; only "
"Chrome style is supported";
}
} else if (requested_style == CEF_RUNTIME_STYLE_CHROME) {
// Chrome style is always supported.
result_style = requested_style;
bool ComputeAlloyStyle(
CefBrowserViewDelegate* cef_delegate,
bool is_devtools_popup,
std::optional<cef_runtime_style_t> opener_runtime_style) {
if (is_devtools_popup) {
// Alloy style is not supported with Chrome DevTools popups.
if (cef_delegate &&
cef_delegate->GetBrowserRuntimeStyle() == CEF_RUNTIME_STYLE_ALLOY) {
LOG(ERROR) << "GetBrowserRuntimeStyle() requested Alloy style; only "
"Chrome style is supported for DevTools popups";
}
return false;
}
return result_style == CEF_RUNTIME_STYLE_ALLOY;
if (opener_runtime_style) {
// Popup style must match the opener style.
const bool opener_alloy_style =
*opener_runtime_style == CEF_RUNTIME_STYLE_ALLOY;
if (cef_delegate) {
const auto requested_style = cef_delegate->GetBrowserRuntimeStyle();
if (requested_style != CEF_RUNTIME_STYLE_DEFAULT &&
requested_style != (opener_alloy_style ? CEF_RUNTIME_STYLE_ALLOY
: CEF_RUNTIME_STYLE_CHROME)) {
LOG(ERROR)
<< "GetBrowserRuntimeStyle() for popups must match opener style";
}
}
return opener_alloy_style;
}
// Chrome style is the default unless Alloy is specifically requested.
return cef_delegate &&
cef_delegate->GetBrowserRuntimeStyle() == CEF_RUNTIME_STYLE_ALLOY;
}
} // namespace
@@ -111,7 +120,8 @@ CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::Create(
}
CefRefPtr<CefBrowserViewImpl> browser_view =
new CefBrowserViewImpl(delegate, /*is_devtools_popup=*/false);
new CefBrowserViewImpl(delegate, /*is_devtools_popup=*/false,
/*opener_runtime_style=*/std::nullopt);
browser_view->SetPendingBrowserCreateParams(
window_info, client, url, settings, extra_info, request_context);
browser_view->Initialize();
@@ -123,16 +133,38 @@ CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::Create(
CefRefPtr<CefBrowserViewImpl> CefBrowserViewImpl::CreateForPopup(
const CefBrowserSettings& settings,
CefRefPtr<CefBrowserViewDelegate> delegate,
bool is_devtools) {
bool is_devtools,
cef_runtime_style_t opener_runtime_style) {
CEF_REQUIRE_UIT_RETURN(nullptr);
CefRefPtr<CefBrowserViewImpl> browser_view =
new CefBrowserViewImpl(delegate, is_devtools);
new CefBrowserViewImpl(delegate, is_devtools, opener_runtime_style);
browser_view->Initialize();
browser_view->SetDefaults(settings);
return browser_view;
}
CefBrowserViewImpl::~CefBrowserViewImpl() {
// We want no further callbacks to this object.
weak_ptr_factory_.InvalidateWeakPtrs();
// |browser_| may exist here if the BrowserView was removed from the Views
// hierarchy prior to tear-down and the last BrowserView reference was
// released. In that case DisassociateFromWidget() will be called when the
// BrowserView is removed from the Window but Detach() will not be called
// because the BrowserView was not destroyed via the Views hierarchy
// tear-down.
DCHECK(!cef_widget_);
if (browser_ && !browser_->WillBeDestroyed()) {
// With Alloy style |browser_| will disappear when WindowDestroyed()
// indirectly calls BrowserDestroyed() so keep a reference.
CefRefPtr<CefBrowserHostBase> browser = browser_;
// Force the browser to be destroyed.
browser->WindowDestroyed();
}
}
void CefBrowserViewImpl::WebContentsCreated(
content::WebContents* web_contents) {
if (web_view()) {
@@ -269,8 +301,8 @@ void CefBrowserViewImpl::AddedToWidget() {
CefWidget* cef_widget = CefWidget::GetForWidget(widget);
DCHECK(cef_widget);
if (!browser_) {
if (cef_widget->IsAlloyStyle() && !is_alloy_style_) {
if (!browser_ && !is_alloy_style_) {
if (cef_widget->IsAlloyStyle()) {
LOG(ERROR) << "Cannot add Chrome style BrowserView to Alloy style Window";
return;
}
@@ -337,9 +369,12 @@ bool CefBrowserViewImpl::OnGestureEvent(ui::GestureEvent* event) {
CefBrowserViewImpl::CefBrowserViewImpl(
CefRefPtr<CefBrowserViewDelegate> delegate,
bool is_devtools_popup)
bool is_devtools_popup,
std::optional<cef_runtime_style_t> opener_runtime_style)
: ParentClass(delegate),
is_alloy_style_(ComputeAlloyStyle(delegate.get(), is_devtools_popup)),
is_alloy_style_(ComputeAlloyStyle(delegate.get(),
is_devtools_popup,
opener_runtime_style)),
weak_ptr_factory_(this) {}
void CefBrowserViewImpl::SetPendingBrowserCreateParams(

View File

@@ -6,6 +6,8 @@
#define CEF_LIBCEF_BROWSER_VIEWS_BROWSER_VIEW_IMPL_H_
#pragma once
#include <optional>
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -33,6 +35,8 @@ class CefBrowserViewImpl
CefBrowserViewImpl(const CefBrowserViewImpl&) = delete;
CefBrowserViewImpl& operator=(const CefBrowserViewImpl&) = delete;
~CefBrowserViewImpl() override;
// Create a new CefBrowserView instance. |delegate| may be nullptr.
// |window_info| will only be used when creating a Chrome child window.
static CefRefPtr<CefBrowserViewImpl> Create(
@@ -49,7 +53,8 @@ class CefBrowserViewImpl
static CefRefPtr<CefBrowserViewImpl> CreateForPopup(
const CefBrowserSettings& settings,
CefRefPtr<CefBrowserViewDelegate> delegate,
bool is_devtools);
bool is_devtools,
cef_runtime_style_t opener_runtime_style);
// Called from CefBrowserPlatformDelegate[Chrome]Views.
void WebContentsCreated(content::WebContents* web_contents);
@@ -96,12 +101,17 @@ class CefBrowserViewImpl
bool IsAlloyStyle() const { return is_alloy_style_; }
bool IsChromeStyle() const { return !is_alloy_style_; }
base::WeakPtr<CefBrowserViewImpl> GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
private:
// Create a new implementation object.
// Always call Initialize() after creation.
// |delegate| may be nullptr.
CefBrowserViewImpl(CefRefPtr<CefBrowserViewDelegate> delegate,
bool is_devtools_popup);
bool is_devtools_popup,
std::optional<cef_runtime_style_t> opener_runtime_style);
void SetPendingBrowserCreateParams(
const CefWindowInfo& window_info,

View File

@@ -52,6 +52,7 @@ class CefNativeWidgetMac : public views::NativeWidgetMac {
bool IsCefWindowInitialized() const;
raw_ptr<BrowserView, AcrossTasksDanglingUntriaged> browser_view_ = nullptr;
bool initialized_ = false;
};
#endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_

View File

@@ -138,7 +138,12 @@ void CefNativeWidgetMac::OnWindowFullscreenTransitionComplete() {
}
void CefNativeWidgetMac::OnWindowInitialized() {
if (!browser_view_) {
// This connects the native widget with the command dispatcher so accelerators
// work even if a browser_view_ is not created later.
// The initialized_ check is necessary because the method can be called twice:
// 1. From NativeWidgetMac::InitNativeWidget
// 2. From ChromeBrowserFrame::Init
if (initialized_) {
return;
}
@@ -146,10 +151,12 @@ void CefNativeWidgetMac::OnWindowInitialized() {
if (auto* bridge = GetInProcessNSWindowBridge()) {
bridge->SetCommandDispatcher([[ChromeCommandDispatcherDelegate alloc] init],
[[BrowserWindowCommandHandler alloc] init]);
} else {
initialized_ = true;
} else if (browser_view_) {
if (auto* host = GetHostForBrowser(browser_view_->browser())) {
host->GetAppShim()->CreateCommandDispatcherForWidget(
GetNSWindowHost()->bridged_native_widget_id());
initialized_ = true;
}
}
}

View File

@@ -280,18 +280,17 @@ void CefOverlayViewHost::SetOverlayBounds(const gfx::Rect& bounds) {
return;
}
gfx::Rect new_bounds = bounds;
// Keep the result inside the widget.
new_bounds.Intersect(window_view_->bounds());
if (new_bounds == bounds_) {
// Empty bounds are not allowed.
if (bounds.IsEmpty()) {
return;
}
bounds_changing_ = true;
bounds_ = bounds;
// Keep the result inside the widget.
bounds_.Intersect(window_view_->bounds());
bounds_ = new_bounds;
if (view_->size() != bounds_.size()) {
view_->SetSize(bounds_.size());
}
@@ -313,6 +312,11 @@ void CefOverlayViewHost::OnViewBoundsChanged(views::View* observed_view) {
MoveIfNecessary();
}
void CefOverlayViewHost::OnViewIsDeleting(views::View* observed_view) {
view_ = nullptr;
Cleanup();
}
gfx::Rect CefOverlayViewHost::ComputeBounds() const {
// This method is only used with corner docking.
DCHECK_NE(docking_mode_, CEF_DOCKING_MODE_CUSTOM);

View File

@@ -44,6 +44,7 @@ class CefOverlayViewHost : public views::WidgetDelegate,
// views::ViewObserver methods:
void OnViewBoundsChanged(views::View* observed_view) override;
void OnViewIsDeleting(views::View* observed_view) override;
cef_docking_mode_t docking_mode() const { return docking_mode_; }
CefRefPtr<CefOverlayController> controller() const { return cef_controller_; }

View File

@@ -500,8 +500,8 @@ bool CefWindowImpl::AcceleratorPressed(const ui::Accelerator& accelerator) {
}
bool CefWindowImpl::CanHandleAccelerators() const {
if (delegate() && widget_) {
return widget_->IsActive();
if (delegate() && widget_ && root_view()) {
return root_view()->CanHandleAccelerators();
}
return false;
}

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=434a753c90262b051077f7a79f3106ac52ffbf75$
// $hash=8a2a8a4853c3869876ffad3e6c175945ac1c5021$
//
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
@@ -191,6 +191,24 @@ browser_host_try_close_browser(struct _cef_browser_host_t* self) {
return _retval;
}
int CEF_CALLBACK
browser_host_is_ready_to_be_closed(struct _cef_browser_host_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Execute
bool _retval = CefBrowserHostCppToC::Get(self)->IsReadyToBeClosed();
// Return type: bool
return _retval;
}
void CEF_CALLBACK browser_host_set_focus(struct _cef_browser_host_t* self,
int focus) {
shutdown_checker::AssertNotShutdown();
@@ -1514,6 +1532,7 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
GetStruct()->get_browser = browser_host_get_browser;
GetStruct()->close_browser = browser_host_close_browser;
GetStruct()->try_close_browser = browser_host_try_close_browser;
GetStruct()->is_ready_to_be_closed = browser_host_is_ready_to_be_closed;
GetStruct()->set_focus = browser_host_set_focus;
GetStruct()->get_window_handle = browser_host_get_window_handle;
GetStruct()->get_opener_window_handle = browser_host_get_opener_window_handle;

View File

@@ -13,6 +13,7 @@
//
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
#include "libcef_dll/ctocpp/views/view_ctocpp.h"
#include "libcef_dll/ctocpp/views/window_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=dac19ba091b3acf3e1587b176e28bc9f9c8c8dd0$
// $hash=2319d794dd3a38c448908114d1b4ea37b34f89dd$
//
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
@@ -131,6 +131,23 @@ NO_SANITIZE("cfi-icall") bool CefBrowserHostCToCpp::TryCloseBrowser() {
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall") bool CefBrowserHostCToCpp::IsReadyToBeClosed() {
shutdown_checker::AssertNotShutdown();
cef_browser_host_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_ready_to_be_closed)) {
return false;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_ready_to_be_closed(_struct);
// Return type: bool
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SetFocus(bool focus) {
shutdown_checker::AssertNotShutdown();
@@ -1111,8 +1128,8 @@ void CefBrowserHostCToCpp::DragSourceSystemDragEnded() {
}
NO_SANITIZE("cfi-icall")
CefRefPtr<
CefNavigationEntry> CefBrowserHostCToCpp::GetVisibleNavigationEntry() {
CefRefPtr<CefNavigationEntry>
CefBrowserHostCToCpp::GetVisibleNavigationEntry() {
shutdown_checker::AssertNotShutdown();
cef_browser_host_t* _struct = GetStruct();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9f40e4ce3e46a895b5bf644bebdc2d802c9b598b$
// $hash=73d8659f17a4ae3319b5bf20807d5c69a1759c04$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
@@ -41,6 +41,7 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
CefRefPtr<CefBrowser> GetBrowser() override;
void CloseBrowser(bool force_close) override;
bool TryCloseBrowser() override;
bool IsReadyToBeClosed() override;
void SetFocus(bool focus) override;
CefWindowHandle GetWindowHandle() override;
CefWindowHandle GetOpenerWindowHandle() override;

View File

@@ -13,6 +13,7 @@
//
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
#include "libcef_dll/cpptoc/views/view_cpptoc.h"
#include "libcef_dll/cpptoc/views/window_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"

View File

@@ -4,6 +4,7 @@
#include "include/wrapper/cef_message_router.h"
#include <algorithm>
#include <limits>
#include <map>
#include <set>

View File

@@ -184,6 +184,11 @@ patches = [
#
# Route |parent_widget| to MenuHost for OSR context menu Widget creation.
# https://github.com/chromiumembedded/cef/issues/3330
#
# Make views::View::GetHeightForWidth virtual so that it can be overridden
# by CefViewView. Alternately, we could implement the same functionality
# by removing CefViewDelegate::GetHeightForWidth and adding an optional
# |available_size| argument to CefViewDelegate::GetPreferredSize.
'name': 'views_1749_2102_3330',
},
{
@@ -230,6 +235,13 @@ patches = [
# Linux: Fix duplicate symbol error for tab_network_state.cc
# https://issuetracker.google.com/issues/353628440#comment8
#
# Linux: Fix duplicate symbol error for automation_manager_aura.cc
# https://chromium-review.googlesource.com/c/chromium/src/+/5893679
#
# Linux: Fix duplicate symbol error for
# chrome_bluetooth_chooser_controller.cc
# https://chromium-review.googlesource.com/c/chromium/src/+/5894080
#
# Avoid duplicate window from DevTools when CEF handles the open via
# OnOpenURLFromTab.
# https://github.com/chromiumembedded/cef/issues/3735
@@ -506,6 +518,10 @@ patches = [
# https://github.com/llvm/llvm-project/issues/57364
#
# Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h.
#
# win: Add SHA256 implementation for Sid::FromNamedCapability using the
# Crypto API.
# https://github.com/chromiumembedded/cef/issues/3791
'name': 'base_sandbox_2743',
},
{
@@ -741,9 +757,9 @@ patches = [
'name': 'third_party_sentencepiece_3616'
},
{
# Windows: Add missing check in base/profiler/stack_copier.cc to fix
# compilation error of cef_sandbox.
'name': 'win_sandbox_stack_copier'
# win: Add missing <limits> include for cef_sandbox build.
# https://chromium-review.googlesource.com/c/chromium/src/+/5891459
'name': 'win_base_pa_oom_5891459'
},
{
# Fix dangling RenderProcessHost ptr in RenderProcessHostTaskProvider.

View File

@@ -1,5 +1,5 @@
diff --git base/command_line.cc base/command_line.cc
index 853a7fa23c725..33654c0b63dc1 100644
index fd6792a0599e2..4cf7bb3ceb226 100644
--- base/command_line.cc
+++ base/command_line.cc
@@ -389,11 +389,10 @@ void CommandLine::AppendSwitchNative(std::string_view switch_string,

View File

@@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index 2561c2726d27e..f666f5b804c4c 100644
index 9247e9b3f4c92..290dae31b7b7c 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -41,6 +41,7 @@ import("//build/nocompile.gni")
@@ -10,7 +10,7 @@ index 2561c2726d27e..f666f5b804c4c 100644
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1519,7 +1520,11 @@ component("base") {
@@ -1507,7 +1508,11 @@ component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]
@@ -23,7 +23,7 @@ index 2561c2726d27e..f666f5b804c4c 100644
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1942,6 +1947,12 @@ component("base") {
@@ -1932,6 +1937,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}
@@ -207,18 +207,10 @@ index ea33ca66f384c..33f4cc76f76bd 100644
return lhs.token_ == rhs.token_;
#else
diff --git base/win/sid.cc base/win/sid.cc
index 2f250ba9bf79d..8a269af206051 100644
index 2f250ba9bf79d..0af427e779266 100644
--- base/win/sid.cc
+++ base/win/sid.cc
@@ -22,6 +22,7 @@
#include <utility>
#include "base/check.h"
+#include "base/notreached.h"
#include "base/no_destructor.h"
#include "base/rand_util.h"
#include "base/ranges/algorithm.h"
@@ -29,7 +30,11 @@
@@ -29,12 +29,56 @@
#include "base/win/scoped_handle.h"
#include "base/win/scoped_localalloc.h"
#include "base/win/windows_version.h"
@@ -226,25 +218,52 @@ index 2f250ba9bf79d..8a269af206051 100644
+
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
#include "third_party/boringssl/src/include/openssl/sha.h"
+#else
+#include <wincrypt.h>
+#endif
namespace base::win {
@@ -130,6 +135,7 @@ Sid Sid::FromNamedCapability(const std::wstring& capability_name) {
if (known_cap != known_capabilities->end()) {
return FromKnownCapability(known_cap->second);
}
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
static_assert((SHA256_DIGEST_LENGTH / sizeof(DWORD)) ==
SECURITY_APP_PACKAGE_RID_COUNT);
DWORD rids[(SHA256_DIGEST_LENGTH / sizeof(DWORD)) + 2];
@@ -141,6 +147,9 @@ Sid Sid::FromNamedCapability(const std::wstring& capability_name) {
reinterpret_cast<uint8_t*>(&rids[2]));
return FromSubAuthorities(SECURITY_APP_PACKAGE_AUTHORITY, std::size(rids),
rids);
+#else
+ NOTREACHED();
+#endif
}
namespace {
Sid Sid::FromKnownSid(WellKnownSid type) {
+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+
+#define SHA256_DIGEST_LENGTH 32
+
+bool SHA256(const uint8_t* InData, size_t InDataLen, uint8_t* OutHash) {
+ HCRYPTPROV hProv = 0;
+ HCRYPTHASH hHash = 0;
+
+ if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_AES,
+ CRYPT_VERIFYCONTEXT)) {
+ return false;
+ }
+
+ if (!CryptCreateHash(hProv, CALG_SHA_256, 0, 0, &hHash)) {
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ if (!CryptHashData(hHash, InData, static_cast<DWORD>(InDataLen), 0)) {
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ DWORD dwHashLen = SHA256_DIGEST_LENGTH;
+ if (!CryptGetHashParam(hHash, HP_HASHVAL, OutHash, &dwHashLen, 0)) {
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return false;
+ }
+
+ CryptDestroyHash(hHash);
+ CryptReleaseContext(hProv, 0);
+ return true;
+}
+
+#endif // BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+
template <typename Iterator>
Sid FromSubAuthorities(const SID_IDENTIFIER_AUTHORITY& identifier_authority,
size_t sub_authority_count,

View File

@@ -1,5 +1,5 @@
diff --git base/test/BUILD.gn base/test/BUILD.gn
index 911214ce799e0..82a59c4aa396d 100644
index d26f4d09dd3dd..155814bff8425 100644
--- base/test/BUILD.gn
+++ base/test/BUILD.gn
@@ -199,11 +199,6 @@ static_library("test_support") {
@@ -14,7 +14,7 @@ index 911214ce799e0..82a59c4aa396d 100644
deps += [
":amalgamated_perfetto_sql_stdlib",
":gen_cc_chrome_track_event_descriptor",
@@ -583,7 +578,7 @@ if (enable_base_tracing) {
@@ -596,7 +591,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 911214ce799e0..82a59c4aa396d 100644
if (is_ios) {
_target_type = "ios_framework_bundle"
}
@@ -592,6 +587,8 @@ if (enable_base_tracing) {
@@ -605,6 +600,8 @@ if (enable_base_tracing) {
defines = [ "TEST_TRACE_PROCESSOR_IMPL" ]
testonly = true
sources = [
@@ -32,7 +32,7 @@ index 911214ce799e0..82a59c4aa396d 100644
"test_trace_processor_export.h",
"test_trace_processor_impl.cc",
"test_trace_processor_impl.h",
@@ -609,33 +606,6 @@ if (enable_base_tracing) {
@@ -622,33 +619,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 9a7d9bf1ab786..e6dd973951c9b 100644
index ff1d38784abeb..2a29a80a19551 100644
--- content/shell/BUILD.gn
+++ content/shell/BUILD.gn
@@ -910,7 +910,6 @@ if (is_mac) {
@@ -911,7 +911,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" ]

View File

@@ -13,7 +13,7 @@ index 023ce7091b061..f175b3683f48f 100644
// Returns true if the element's computed writing suggestions value is true.
// https://html.spec.whatwg.org/#writing-suggestions:computed-writing-suggestions-value
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index da6ab6488ad80..7b23243e21a61 100644
index def4b446fcbbb..d48998241f604 100644
--- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc
@@ -119,6 +119,24 @@ void WebElement::SetAttribute(const WebString& attr_name,

View File

@@ -1,5 +1,5 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index e8283fc396ec7..527e81fac898a 100644
index 9572bef1de74f..8d67dc7ceca2e 100644
--- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc
@@ -209,7 +209,7 @@ BrowserTaskExecutor::OnUserInputStart() {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index a5166365d192e..6ba33fc49d1a5 100644
index 1bf903af89b3c..5471355376272 100644
--- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc
@@ -2083,6 +2083,17 @@ bool ChildProcessSecurityPolicyImpl::CanAccessMaybeOpaqueOrigin(
@@ -2084,6 +2084,17 @@ bool ChildProcessSecurityPolicyImpl::CanAccessMaybeOpaqueOrigin(
// DeclarativeApiTest.PersistRules.
if (actual_process_lock.matches_scheme(url::kDataScheme))
return true;
@@ -21,10 +21,10 @@ index a5166365d192e..6ba33fc49d1a5 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 877d0240bc916..f122939b9870f 100644
index 22bb23e6a84d3..512b8ac76cf77 100644
--- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc
@@ -8215,10 +8215,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
@@ -8214,10 +8214,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin;
@@ -48,7 +48,7 @@ index 877d0240bc916..f122939b9870f 100644
}
return origin_and_debug_info;
@@ -8326,6 +8338,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -8325,6 +8337,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
DetermineInitiatorRelationship(initiator_rfh,
frame_tree_node_->current_frame_host()));

View File

@@ -1,5 +1,5 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 45086d6838cac..58f4eb5278d99 100644
index 765345a16d112..69a961128115d 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -133,6 +133,9 @@ declare_args() {
@@ -12,7 +12,7 @@ index 45086d6838cac..58f4eb5278d99 100644
# Initialize all local variables with a pattern. This flag will fill
# uninitialized floating-point types (and 32-bit pointers) with 0xFF and the
# rest with 0xAA. This makes behavior of uninitialized memory bugs consistent,
@@ -2256,11 +2259,13 @@ config("export_dynamic") {
@@ -2266,11 +2269,13 @@ config("export_dynamic") {
config("thin_archive") {
# The macOS and iOS default linker ld64 does not support reading thin
# archives.

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 59773d1765744..fded83a261c4b 100644
index 7f1c26990d8d4..751f36b931f65 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -12,6 +12,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@@ -10,7 +10,7 @@ index 59773d1765744..fded83a261c4b 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/browser/request_header_integrity/buildflags.gni")
@@ -1899,6 +1900,7 @@ static_library("browser") {
@@ -1880,6 +1881,7 @@ static_library("browser") {
"//build/config/chromebox_for_meetings:buildflags",
"//build/config/compiler:compiler_buildflags",
"//cc",
@@ -18,7 +18,7 @@ index 59773d1765744..fded83a261c4b 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2514,6 +2516,10 @@ static_library("browser") {
@@ -2524,6 +2526,10 @@ static_library("browser") {
]
}

View File

@@ -14,10 +14,10 @@ index b7abca02f48f8..b595e9daa40eb 100644
std::unique_ptr<BackgroundModeManager> manager) = 0;
#endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 126516f5d5c28..ed8c126e78156 100644
index 4de58876a9947..d1b0319482293 100644
--- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc
@@ -1111,18 +1111,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
@@ -1141,18 +1141,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
return download_request_limiter_.get();
}
@@ -38,7 +38,7 @@ index 126516f5d5c28..ed8c126e78156 100644
std::unique_ptr<BackgroundModeManager> manager) {
background_mode_manager_ = std::move(manager);
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
index c73845ee5a52e..b60e60050666f 100644
index 9b6380d7fe36c..839558f24a06e 100644
--- chrome/browser/browser_process_impl.h
+++ chrome/browser/browser_process_impl.h
@@ -193,8 +193,8 @@ class BrowserProcessImpl : public BrowserProcess,
@@ -52,10 +52,10 @@ index c73845ee5a52e..b60e60050666f 100644
std::unique_ptr<BackgroundModeManager> manager) override;
#endif
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
index bfffa272e6458..460a35e0c708f 100644
index 173f85fa144a1..43b8f2e2a18db 100644
--- chrome/browser/lifetime/browser_close_manager.cc
+++ chrome/browser/lifetime/browser_close_manager.cc
@@ -158,12 +158,14 @@ void BrowserCloseManager::CloseBrowsers() {
@@ -158,6 +158,7 @@ void BrowserCloseManager::CloseBrowsers() {
// exit can restore all browsers open before exiting.
ProfileManager::ShutdownSessionServices();
#endif
@@ -63,8 +63,9 @@ index bfffa272e6458..460a35e0c708f 100644
if (!browser_shutdown::IsTryingToQuit()) {
BackgroundModeManager* background_mode_manager =
g_browser_process->background_mode_manager();
if (background_mode_manager)
@@ -165,6 +166,7 @@ void BrowserCloseManager::CloseBrowsers() {
background_mode_manager->SuspendBackgroundMode();
}
}
+#endif

View File

@@ -13,7 +13,7 @@ index 2480282a19d12..dbd1fbf8a15b5 100644
return false;
}
diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc
index 9b388234f3dfe..95faf0c837833 100644
index b4a11f0509df7..04f615abc4404 100644
--- chrome/browser/devtools/devtools_window.cc
+++ chrome/browser/devtools/devtools_window.cc
@@ -38,6 +38,7 @@
@@ -24,7 +24,7 @@ index 9b388234f3dfe..95faf0c837833 100644
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
@@ -1225,6 +1226,13 @@ DevToolsWindow* DevToolsWindow::Create(
@@ -1223,6 +1224,13 @@ DevToolsWindow* DevToolsWindow::Create(
!browser->is_type_normal()) {
can_dock = false;
}
@@ -38,7 +38,7 @@ index 9b388234f3dfe..95faf0c837833 100644
}
// Create WebContents with devtools.
@@ -1688,9 +1696,13 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) {
@@ -1687,9 +1695,13 @@ void DevToolsWindow::OpenInNewTab(const GURL& url) {
if (!inspected_web_contents ||
!inspected_web_contents->OpenURL(params,
/*navigation_handle_callback=*/{})) {
@@ -52,7 +52,7 @@ index 9b388234f3dfe..95faf0c837833 100644
}
}
@@ -1853,12 +1865,28 @@ void DevToolsWindow::CreateDevToolsBrowser() {
@@ -1852,12 +1864,28 @@ void DevToolsWindow::CreateDevToolsBrowser() {
Browser::CreationStatus::kOk) {
return;
}
@@ -88,7 +88,7 @@ index 9b388234f3dfe..95faf0c837833 100644
}
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 94bcf99cf9e89..3e71e3189c290 100644
index bc6e4008f2c5a..1b6b33e96b46c 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni")
@@ -99,7 +99,7 @@ index 94bcf99cf9e89..3e71e3189c290 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
@@ -409,6 +410,10 @@ static_library("ui") {
@@ -354,6 +355,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@@ -110,7 +110,7 @@ index 94bcf99cf9e89..3e71e3189c290 100644
public_deps = [
# WARNING WARNING WARNING
# New dependencies outside of //chrome/browser should be added to
@@ -434,6 +439,7 @@ static_library("ui") {
@@ -379,6 +384,7 @@ static_library("ui") {
"//build:chromeos_buildflags",
"//build/config/chromebox_for_meetings:buildflags",
"//cc/paint",
@@ -118,7 +118,7 @@ index 94bcf99cf9e89..3e71e3189c290 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/app:chrome_dll_resources",
@@ -744,6 +750,10 @@ static_library("ui") {
@@ -717,6 +723,10 @@ static_library("ui") {
deps += [ "//components/plus_addresses/resources:vector_icons" ]
}
@@ -129,7 +129,16 @@ index 94bcf99cf9e89..3e71e3189c290 100644
# TODO(crbug.com/41437292): Remove this circular dependency.
# Any circular includes must depend on the target "//chrome/browser:browser_public_dependencies".
# These are all-platform circular includes.
@@ -1528,7 +1538,6 @@ static_library("ui") {
@@ -1009,8 +1019,6 @@ static_library("ui") {
sources += [
"app_icon_loader.cc",
"app_icon_loader.h",
- "bluetooth/chrome_bluetooth_chooser_controller.cc",
- "bluetooth/chrome_bluetooth_chooser_controller.h",
"bookmarks/bookmark_bar.h",
"bookmarks/bookmark_context_menu_controller.cc",
"bookmarks/bookmark_context_menu_controller.h",
@@ -1466,7 +1474,6 @@ static_library("ui") {
"tabs/tab_menu_model_factory.h",
"tabs/tab_model.cc",
"tabs/tab_model.h",
@@ -137,16 +146,25 @@ index 94bcf99cf9e89..3e71e3189c290 100644
"tabs/tab_network_state.h",
"tabs/tab_renderer_data.cc",
"tabs/tab_renderer_data.h",
@@ -3236,8 +3245,6 @@ static_library("ui") {
"autofill/payments/webauthn_dialog_model.h",
"autofill/payments/webauthn_dialog_model_observer.h",
"autofill/payments/webauthn_dialog_state.h",
@@ -3208,8 +3215,6 @@ static_library("ui") {
if (is_win || is_mac || is_linux || is_chromeos) {
sources += [
- "frame/window_frame_util.cc",
- "frame/window_frame_util.h",
"incognito_clear_browsing_data_dialog_interface.h",
"passwords/password_cross_domain_confirmation_popup_controller_impl.cc",
"passwords/password_cross_domain_confirmation_popup_controller_impl.h",
@@ -5875,6 +5882,7 @@ static_library("ui") {
@@ -5535,8 +5540,6 @@ static_library("ui") {
if (use_aura) {
sources += [
- "aura/accessibility/automation_manager_aura.cc",
- "aura/accessibility/automation_manager_aura.h",
"overscroll_pref_manager.cc",
"overscroll_pref_manager.h",
"views/accelerator_utils_aura.cc",
@@ -5788,6 +5791,7 @@ static_library("ui") {
if (enable_printing) {
deps += [
"//components/printing/browser",
@@ -155,7 +173,7 @@ index 94bcf99cf9e89..3e71e3189c290 100644
]
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index dc07c5029aa49..57d979ff377d6 100644
index e1ebde9b491c3..ce2a8d8a79747 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -272,6 +272,25 @@
@@ -195,7 +213,7 @@ index dc07c5029aa49..57d979ff377d6 100644
tab_strip_model_delegate_(
std::make_unique<chrome::BrowserTabStripModelDelegate>(this)),
tab_strip_model_(std::make_unique<TabStripModel>(
@@ -775,6 +798,12 @@ Browser::~Browser() {
@@ -763,6 +786,12 @@ Browser::~Browser() {
// away so they don't try and call back to us.
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
@@ -208,7 +226,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
///////////////////////////////////////////////////////////////////////////////
@@ -1299,6 +1328,8 @@ void Browser::WindowFullscreenStateChanged() {
@@ -1305,6 +1334,8 @@ void Browser::WindowFullscreenStateChanged() {
->WindowFullscreenStateChanged();
command_controller_->FullscreenStateChanged();
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
@@ -217,7 +235,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
void Browser::FullscreenTopUIStateChanged() {
@@ -1672,6 +1703,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1635,6 +1666,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@@ -232,7 +250,7 @@ index dc07c5029aa49..57d979ff377d6 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1679,8 +1718,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1642,8 +1681,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@@ -253,9 +271,9 @@ index dc07c5029aa49..57d979ff377d6 100644
}
bool Browser::TabsNeedBeforeUnloadFired() const {
@@ -1842,6 +1891,14 @@ WebContents* Browser::OpenURLFromTab(
@@ -1798,6 +1847,14 @@ WebContents* Browser::OpenURLFromTab(
std::move(navigation_handle_callback));
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(ENABLE_CEF)
+ if (cef_browser_delegate_ &&
@@ -268,7 +286,7 @@ index dc07c5029aa49..57d979ff377d6 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -2005,6 +2062,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -1964,6 +2021,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@@ -277,7 +295,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -2033,6 +2092,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -1992,6 +2051,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -286,7 +304,7 @@ index dc07c5029aa49..57d979ff377d6 100644
if (!GetStatusBubble())
return;
@@ -2040,6 +2101,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -1999,6 +2060,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url);
}
@@ -304,7 +322,7 @@ index dc07c5029aa49..57d979ff377d6 100644
void Browser::ContentsMouseEvent(WebContents* source, const ui::Event& event) {
const ui::EventType type = event.type();
const bool exited = type == ui::EventType::kMouseExited;
@@ -2068,6 +2140,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
@@ -2027,6 +2099,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
return false;
}
@@ -324,7 +342,7 @@ index dc07c5029aa49..57d979ff377d6 100644
void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed,
bool* proceed_to_fire_unload) {
@@ -2167,12 +2252,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -2126,12 +2211,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents);
@@ -349,7 +367,7 @@ index dc07c5029aa49..57d979ff377d6 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();
@@ -2185,6 +2282,13 @@ void Browser::RendererUnresponsive(
@@ -2144,6 +2241,13 @@ void Browser::RendererUnresponsive(
void Browser::RendererResponsive(
WebContents* source,
content::RenderWidgetHost* render_widget_host) {
@@ -363,7 +381,7 @@ index dc07c5029aa49..57d979ff377d6 100644
RenderWidgetHostView* view = render_widget_host->GetView();
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
TabDialogs::FromWebContents(source)->HideHungRendererDialog(
@@ -2194,6 +2298,15 @@ void Browser::RendererResponsive(
@@ -2153,6 +2257,15 @@ void Browser::RendererResponsive(
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
WebContents* source) {
@@ -379,7 +397,7 @@ index dc07c5029aa49..57d979ff377d6 100644
return javascript_dialogs::TabModalDialogManager::FromWebContents(source);
}
@@ -2229,6 +2342,11 @@ void Browser::DraggableRegionsChanged(
@@ -2188,6 +2301,11 @@ void Browser::DraggableRegionsChanged(
if (app_controller_) {
app_controller_->DraggableRegionsChanged(regions, contents);
}
@@ -391,7 +409,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
void Browser::DidFinishNavigation(
@@ -2309,11 +2427,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -2268,11 +2386,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@@ -407,7 +425,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2513,6 +2635,15 @@ void Browser::RequestMediaAccessPermission(
@@ -2470,6 +2592,15 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) {
@@ -423,7 +441,7 @@ index dc07c5029aa49..57d979ff377d6 100644
const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -3069,9 +3200,10 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
@@ -3026,9 +3157,10 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private):
StatusBubble* Browser::GetStatusBubble() {
@@ -435,7 +453,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
// We hide the status bar for web apps windows as this matches native
@@ -3079,6 +3211,12 @@ StatusBubble* Browser::GetStatusBubble() {
@@ -3036,6 +3168,12 @@ StatusBubble* Browser::GetStatusBubble() {
// mode, as the minimal browser UI includes the status bar.
if (web_app::AppBrowserController::IsWebApp(this) &&
!app_controller()->HasMinimalUiButtons()) {
@@ -448,7 +466,7 @@ index dc07c5029aa49..57d979ff377d6 100644
return nullptr;
}
@@ -3228,6 +3366,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -3185,6 +3323,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents);
}
@@ -457,7 +475,7 @@ index dc07c5029aa49..57d979ff377d6 100644
}
void Browser::TabDetachedAtImpl(content::WebContents* contents,
@@ -3382,6 +3522,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
@@ -3339,6 +3479,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
bool check_can_support) const {
@@ -473,7 +491,7 @@ index dc07c5029aa49..57d979ff377d6 100644
case TYPE_NORMAL:
return NormalBrowserSupportsWindowFeature(feature, check_can_support);
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 9081a0ed32b64..5fc21fd1c33a4 100644
index 85b6845aa871c..b2975ce19ac95 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -24,6 +24,7 @@
@@ -495,7 +513,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
#if BUILDFLAG(IS_ANDROID)
#error This file should only be included on desktop.
#endif
@@ -335,6 +340,15 @@ class Browser : public TabStripModelObserver,
@@ -337,6 +342,15 @@ class Browser : public TabStripModelObserver,
// Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE.
std::optional<blink::mojom::PictureInPictureWindowOptions> pip_options;
@@ -511,7 +529,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
private:
friend class Browser;
friend class WindowSizerChromeOSTest;
@@ -416,6 +430,13 @@ class Browser : public TabStripModelObserver,
@@ -418,6 +432,13 @@ class Browser : public TabStripModelObserver,
update_ui_immediately_for_testing_ = true;
}
@@ -525,7 +543,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
// Accessors ////////////////////////////////////////////////////////////////
const CreateParams& create_params() const { return create_params_; }
@@ -511,6 +532,12 @@ class Browser : public TabStripModelObserver,
@@ -519,6 +540,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr();
base::WeakPtr<const Browser> AsWeakPtr() const;
@@ -538,7 +556,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
// Get the FindBarController for this browser, creating it if it does not
// yet exist.
FindBarController* GetFindBarController();
@@ -940,10 +967,18 @@ class Browser : public TabStripModelObserver,
@@ -947,10 +974,18 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@@ -557,7 +575,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
void BeforeUnloadFired(content::WebContents* source,
bool proceed,
bool* proceed_to_fire_unload) override;
@@ -1280,6 +1315,10 @@ class Browser : public TabStripModelObserver,
@@ -1285,6 +1320,10 @@ class Browser : public TabStripModelObserver,
// This Browser's window.
raw_ptr<BrowserWindow, DanglingUntriaged> window_;
@@ -568,7 +586,7 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
std::unique_ptr<TabStripModelDelegate> const tab_strip_model_delegate_;
std::unique_ptr<TabStripModel> const tab_strip_model_;
@@ -1346,6 +1385,8 @@ class Browser : public TabStripModelObserver,
@@ -1351,6 +1390,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_;
@@ -578,10 +596,10 @@ index 9081a0ed32b64..5fc21fd1c33a4 100644
UnloadController unload_controller_;
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index 41a7c90bc2754..8ccf0dd8b296c 100644
index 061432f5974e1..46de9334a4daa 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -263,6 +263,10 @@ std::pair<Browser*, int> GetBrowserAndTabForDisposition(
@@ -270,6 +270,10 @@ std::tuple<Browser*, int> GetBrowserAndTabForDisposition(
browser_params.pip_options = pip_options;
@@ -592,7 +610,7 @@ index 41a7c90bc2754..8ccf0dd8b296c 100644
const BrowserWindow* const browser_window = params.browser->window();
const gfx::NativeWindow native_window =
browser_window ? browser_window->GetNativeWindow()
@@ -553,6 +557,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
@@ -558,6 +562,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
std::unique_ptr<WebContents> target_contents =
WebContents::Create(create_params);
@@ -607,7 +625,7 @@ index 41a7c90bc2754..8ccf0dd8b296c 100644
// tab helpers, so the entire set of tab helpers needs to be set up
// immediately.
diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc
index e12f401ab7d11..59222cc9601ba 100644
index e4b6094c5197e..4d2d12ae5725e 100644
--- chrome/browser/ui/browser_tabstrip.cc
+++ chrome/browser/ui/browser_tabstrip.cc
@@ -33,9 +33,13 @@ content::WebContents* AddAndReturnTabAt(
@@ -625,7 +643,7 @@ index e12f401ab7d11..59222cc9601ba 100644
params.disposition = foreground ? WindowOpenDisposition::NEW_FOREGROUND_TAB
: WindowOpenDisposition::NEW_BACKGROUND_TAB;
params.tabstrip_index = idx;
@@ -81,6 +85,16 @@ void AddWebContents(Browser* browser,
@@ -82,6 +86,16 @@ content::WebContents* AddWebContents(
// Can't create a new contents for the current tab - invalid case.
DCHECK(disposition != WindowOpenDisposition::CURRENT_TAB);
@@ -634,7 +652,7 @@ index e12f401ab7d11..59222cc9601ba 100644
+ new_contents = browser->cef_delegate()->AddWebContents(
+ std::move(new_contents));
+ if (!new_contents) {
+ return;
+ return nullptr;
+ }
+ }
+#endif

View File

@@ -1,8 +1,8 @@
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index fdc02b8b65544..825dba69168e3 100644
index ba73101c05be3..f30ed2f3e9ab1 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc
+++ components/content_settings/renderer/content_settings_agent_impl.cc
@@ -148,7 +148,7 @@ ContentSetting GetContentSettingFromRules(
@@ -146,7 +146,7 @@ ContentSetting GetContentSettingFromRules(
return rule.GetContentSetting();
}
}

View File

@@ -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 aad2abb0c249a..09c7d5313dea0 100644
index aa0d1cc1d45fe..9329872580f9b 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -354,6 +354,18 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
@@ -360,6 +360,18 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get();
}
@@ -21,7 +21,7 @@ index aad2abb0c249a..09c7d5313dea0 100644
enum class UmaEnumIdLookupType {
GeneralEnumId,
ContextSpecificEnumId,
@@ -620,6 +632,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
@@ -626,6 +638,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
return 1;
}
@@ -32,7 +32,7 @@ index aad2abb0c249a..09c7d5313dea0 100644
id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id);
@@ -896,6 +912,14 @@ RenderViewContextMenu::RenderViewContextMenu(
@@ -907,6 +923,14 @@ RenderViewContextMenu::RenderViewContextMenu(
: nullptr;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -47,7 +47,7 @@ index aad2abb0c249a..09c7d5313dea0 100644
observers_.AddObserver(&autofill_context_menu_manager_);
}
@@ -1357,6 +1381,12 @@ void RenderViewContextMenu::InitMenu() {
@@ -1363,6 +1387,12 @@ void RenderViewContextMenu::InitMenu() {
autofill_client->HideAutofillSuggestions(
autofill::SuggestionHidingReason::kContextMenuOpened);
}
@@ -60,7 +60,7 @@ index aad2abb0c249a..09c7d5313dea0 100644
}
Profile* RenderViewContextMenu::GetProfile() const {
@@ -3639,6 +3669,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
@@ -3645,6 +3675,26 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
execute_plugin_action_callback_ = std::move(cb);
}
@@ -88,7 +88,7 @@ index aad2abb0c249a..09c7d5313dea0 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 f3abb9c4164f3..c4c14e820e566 100644
index 91de5780521af..571ad0260b4f7 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -153,7 +153,21 @@ class RenderViewContextMenu
@@ -113,7 +113,7 @@ index f3abb9c4164f3..c4c14e820e566 100644
Profile* GetProfile() const;
// This may return nullptr (e.g. for WebUI dialogs). Virtual to allow tests to
@@ -476,6 +490,9 @@ class RenderViewContextMenu
@@ -478,6 +492,9 @@ class RenderViewContextMenu
// built.
bool is_protocol_submenu_valid_ = false;

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/devtools/chrome_devtools_manager_delegate.cc chrome/browser/devtools/chrome_devtools_manager_delegate.cc
index c2850e124952c..0b5b32a70da71 100644
index 65041a6124766..06f1a300dbfde 100644
--- chrome/browser/devtools/chrome_devtools_manager_delegate.cc
+++ chrome/browser/devtools/chrome_devtools_manager_delegate.cc
@@ -14,6 +14,7 @@
@@ -15,6 +15,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -10,7 +10,7 @@ index c2850e124952c..0b5b32a70da71 100644
#include "chrome/browser/browser_features.h"
#include "chrome/browser/devtools/chrome_devtools_session.h"
#include "chrome/browser/devtools/device/android_device_manager.h"
@@ -68,6 +69,10 @@
@@ -69,6 +70,10 @@
#include "ash/constants/ash_switches.h"
#endif
@@ -21,7 +21,7 @@ index c2850e124952c..0b5b32a70da71 100644
using content::DevToolsAgentHost;
const char ChromeDevToolsManagerDelegate::kTypeApp[] = "app";
@@ -278,6 +283,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType(
@@ -284,6 +289,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetType(
return DevToolsAgentHost::kTypePage;
}

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index b35b0303e723d..97d43a18a9bed 100644
index 50fca3503b2a9..89a58b139af4a 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -245,6 +245,13 @@ void FileSelectHelper::OnListFile(
@@ -239,6 +239,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
@@ -16,7 +16,7 @@ index b35b0303e723d..97d43a18a9bed 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -472,31 +479,51 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -466,31 +473,51 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@@ -72,7 +72,7 @@ index b35b0303e723d..97d43a18a9bed 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -513,12 +540,28 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -507,12 +534,28 @@ FileSelectHelper::GetFileTypesFromAcceptType(
// dialog uses the first extension in the list to form the description,
// like "EHTML Files". This is not what we want.
if (valid_type_count > 1 ||
@@ -105,7 +105,7 @@ index b35b0303e723d..97d43a18a9bed 100644
}
return file_type;
@@ -528,7 +571,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -522,7 +565,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -115,7 +115,7 @@ index b35b0303e723d..97d43a18a9bed 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -536,6 +580,7 @@ void FileSelectHelper::RunFileChooser(
@@ -530,6 +574,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));
@@ -124,10 +124,10 @@ index b35b0303e723d..97d43a18a9bed 100644
params.Clone());
}
diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h
index a89c6ae3ea21a..0533cec2752bb 100644
index 138889a07790b..73d480d4f2525 100644
--- chrome/browser/file_select_helper.h
+++ chrome/browser/file_select_helper.h
@@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -63,7 +63,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
static void RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@@ -138,7 +138,7 @@ index a89c6ae3ea21a..0533cec2752bb 100644
// Enumerates all the files in directory.
static void EnumerateDirectory(
@@ -330,6 +331,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
bool has_notified_picture_in_picture_window_manager_of_open_dialog_ = false;
scoped_disallow_picture_in_picture_;
#endif // !BUILDFLAG(IS_ANDROID)
+ // Set to true if this dialog was triggered via CEF.

View File

@@ -12,10 +12,10 @@ index b169371e4d42f..509e4bda85b47 100644
// on the screen, we can't actually attach to it.
parent_window = nullptr;
diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc
index a1242433efd31..d649bebf32d2a 100644
index b82cb011d2359..e224eef611704 100644
--- components/constrained_window/constrained_window_views.cc
+++ components/constrained_window/constrained_window_views.cc
@@ -101,10 +101,17 @@ class ModalDialogHostObserverViews : public ModalDialogHostObserver {
@@ -102,10 +102,17 @@ class ModalDialogHostObserverViews : public ModalDialogHostObserver {
gfx::Rect GetModalDialogBounds(views::Widget* widget,
web_modal::ModalDialogHost* dialog_host,
const gfx::Size& size) {
@@ -36,7 +36,7 @@ index a1242433efd31..d649bebf32d2a 100644
}
gfx::Point position = dialog_host->GetDialogPosition(size);
@@ -113,43 +120,22 @@ gfx::Rect GetModalDialogBounds(views::Widget* widget,
@@ -114,43 +121,22 @@ gfx::Rect GetModalDialogBounds(views::Widget* widget,
position.set_y(position.y() -
widget->non_client_view()->frame_view()->GetInsets().top());
@@ -94,7 +94,7 @@ index a1242433efd31..d649bebf32d2a 100644
}
void UpdateModalDialogPosition(views::Widget* widget,
@@ -160,15 +146,24 @@ void UpdateModalDialogPosition(views::Widget* widget,
@@ -161,15 +147,24 @@ void UpdateModalDialogPosition(views::Widget* widget,
return;
}
@@ -121,7 +121,7 @@ index a1242433efd31..d649bebf32d2a 100644
return;
}
@@ -298,8 +293,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -299,8 +294,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeView parent_view =
parent ? CurrentBrowserModalClient()->GetDialogHostView(parent) : nullptr;
@@ -136,7 +136,7 @@ index a1242433efd31..d649bebf32d2a 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -316,8 +316,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -317,8 +317,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
return widget;
ModalDialogHost* host =
@@ -146,7 +146,7 @@ index a1242433efd31..d649bebf32d2a 100644
if (host) {
DCHECK_EQ(parent_view, host->GetHostView());
std::unique_ptr<ModalDialogHostObserver> observer =
@@ -334,11 +333,17 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -335,11 +334,17 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
views::Widget* ShowBrowserModal(std::unique_ptr<ui::DialogModel> dialog_model,
gfx::NativeWindow parent) {
@@ -210,10 +210,10 @@ index 51ed6bcf6b540..c6e1161140655 100644
virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
// Returns whether a dialog currently about to be shown should be activated.
diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc
index c10c91a0d18eb..e66e2bfcf4ef5 100644
index d5d9010ca00fe..3a0e50a1cb2f0 100644
--- ui/views/window/dialog_delegate.cc
+++ ui/views/window/dialog_delegate.cc
@@ -86,10 +86,12 @@ DialogDelegate::DialogDelegate() {
@@ -87,10 +87,12 @@ DialogDelegate::DialogDelegate() {
// static
Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
gfx::NativeWindow context,
@@ -228,7 +228,7 @@ index c10c91a0d18eb..e66e2bfcf4ef5 100644
widget->Init(std::move(params));
return widget;
}
@@ -98,16 +100,18 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
@@ -99,16 +101,18 @@ Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
Widget* DialogDelegate::CreateDialogWidget(
std::unique_ptr<WidgetDelegate> delegate,
gfx::NativeWindow context,
@@ -251,7 +251,7 @@ index c10c91a0d18eb..e66e2bfcf4ef5 100644
#else
return true;
#endif
@@ -118,7 +122,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -119,7 +123,8 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,
@@ -261,7 +261,7 @@ index c10c91a0d18eb..e66e2bfcf4ef5 100644
DialogDelegate* dialog = delegate->AsDialogDelegate();
views::Widget::InitParams params(
@@ -128,7 +133,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -129,7 +134,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
params.bounds = bounds;
if (dialog)
@@ -270,7 +270,7 @@ index c10c91a0d18eb..e66e2bfcf4ef5 100644
if (!dialog || dialog->use_custom_frame()) {
params.opacity = Widget::InitParams::WindowOpacity::kTranslucent;
@@ -141,6 +146,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
@@ -142,6 +147,7 @@ Widget::InitParams DialogDelegate::GetDialogWidgetInitParams(
}
params.context = context;
params.parent = parent;
@@ -279,10 +279,10 @@ index c10c91a0d18eb..e66e2bfcf4ef5 100644
// Web-modal (ui::mojom::ModalType::kChild) dialogs with parents are marked as
// child widgets to prevent top-level window behavior (independent movement,
diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h
index 2e18d38c8a71a..9d79b5bc53f78 100644
index d64117586a5c3..c37d7a59c134e 100644
--- ui/views/window/dialog_delegate.h
+++ ui/views/window/dialog_delegate.h
@@ -100,13 +100,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
@@ -106,13 +106,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
// your use case.
static Widget* CreateDialogWidget(std::unique_ptr<WidgetDelegate> delegate,
gfx::NativeWindow context,
@@ -304,7 +304,7 @@ index 2e18d38c8a71a..9d79b5bc53f78 100644
// Returns the dialog widget InitParams for a given |context| or |parent|.
// If |bounds| is not empty, used to initially place the dialog, otherwise
@@ -114,7 +119,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
@@ -120,7 +125,9 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
static Widget::InitParams GetDialogWidgetInitParams(WidgetDelegate* delegate,
gfx::NativeWindow context,
gfx::NativeView parent,

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/download/chrome_download_manager_delegate.cc chrome/browser/download/chrome_download_manager_delegate.cc
index e9f68185e59c8..24bd2abbde36b 100644
index f6cdc397b51cb..69847175527da 100644
--- chrome/browser/download/chrome_download_manager_delegate.cc
+++ chrome/browser/download/chrome_download_manager_delegate.cc
@@ -31,6 +31,7 @@
@@ -10,7 +10,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/download/download_core_service.h"
@@ -157,6 +158,10 @@
@@ -158,6 +159,10 @@
#include "chrome/browser/ash/policy/skyvault/skyvault_rename_handler.h"
#endif
@@ -21,7 +21,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
using content::BrowserThread;
using content::DownloadManager;
using download::DownloadItem;
@@ -518,6 +523,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
@@ -519,6 +524,11 @@ ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
download_dialog_bridge_ = std::make_unique<DownloadDialogBridge>();
download_message_bridge_ = std::make_unique<DownloadMessageBridge>();
#endif
@@ -33,7 +33,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
}
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
@@ -577,6 +587,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
@@ -578,6 +588,9 @@ void ChromeDownloadManagerDelegate::Shutdown() {
download_manager_->RemoveObserver(this);
download_manager_ = nullptr;
}
@@ -43,7 +43,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
}
void ChromeDownloadManagerDelegate::OnDownloadCanceledAtShutdown(
@@ -645,6 +658,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
@@ -646,6 +659,12 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload);
}
@@ -56,7 +56,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
DownloadTargetDeterminer::CompletionCallback target_determined_callback =
base::BindOnce(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
weak_ptr_factory_.GetWeakPtr(), download->GetId(),
@@ -1033,8 +1052,11 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
@@ -1067,8 +1086,11 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
Browser* browser =
web_contents ? chrome::FindBrowserWithTab(web_contents) : nullptr;
std::unique_ptr<chrome::ScopedTabbedBrowserDisplayer> browser_displayer;
@@ -71,7 +71,7 @@ index e9f68185e59c8..24bd2abbde36b 100644
std::make_unique<chrome::ScopedTabbedBrowserDisplayer>(profile_);
browser = browser_displayer->browser();
diff --git chrome/browser/download/chrome_download_manager_delegate.h chrome/browser/download/chrome_download_manager_delegate.h
index 2c99baa2c9fa8..b721db7058d8f 100644
index 32d23a0c98061..be6a99a33bdeb 100644
--- chrome/browser/download/chrome_download_manager_delegate.h
+++ chrome/browser/download/chrome_download_manager_delegate.h
@@ -19,6 +19,7 @@
@@ -95,7 +95,7 @@ index 2c99baa2c9fa8..b721db7058d8f 100644
// This is the Chrome side helper for the download system.
class ChromeDownloadManagerDelegate
: public content::DownloadManagerDelegate,
@@ -391,6 +398,10 @@ class ChromeDownloadManagerDelegate
@@ -393,6 +400,10 @@ class ChromeDownloadManagerDelegate
// Whether a file picker dialog is showing.
bool is_file_picker_showing_;

View File

@@ -34,19 +34,10 @@ index 4007e26f780c3..26d0d492cf176 100644
WebViewGuestDelegate* ChromeExtensionsAPIClient::CreateWebViewGuestDelegate(
diff --git chrome/browser/extensions/api/tabs/tabs_api.cc chrome/browser/extensions/api/tabs/tabs_api.cc
index cbfeb699bb92c..259c9b9d5938b 100644
index aa6acb2e58acc..8b27e0debf930 100644
--- chrome/browser/extensions/api/tabs/tabs_api.cc
+++ chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1552,7 +1552,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
if (DevToolsWindow::IsDevToolsWindow(contents))
return RespondNow(Error(tabs_constants::kNotAllowedForDevToolsError));
- if (!ExtensionTabUtil::BrowserSupportsTabs(browser))
+ if (browser && !ExtensionTabUtil::BrowserSupportsTabs(browser))
return RespondNow(Error(tabs_constants::kNoCurrentWindowError));
web_contents_ = contents;
@@ -1576,7 +1576,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1592,7 +1592,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
return RespondNow(Error(tabs_constants::kTabStripNotEditableError));
}
@@ -55,7 +46,7 @@ index cbfeb699bb92c..259c9b9d5938b 100644
tab_strip->ActivateTabAt(tab_index);
DCHECK_EQ(contents, tab_strip->GetActiveWebContents());
}
@@ -1590,7 +1590,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1606,7 +1606,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
}
bool highlighted = *params->update_properties.highlighted;
@@ -64,7 +55,7 @@ index cbfeb699bb92c..259c9b9d5938b 100644
tab_strip->ToggleSelectionAt(tab_index);
}
}
@@ -1603,7 +1603,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1619,7 +1619,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
base::NumberToString(tab_id))));
}
@@ -73,7 +64,7 @@ index cbfeb699bb92c..259c9b9d5938b 100644
int opener_id = *params->update_properties.opener_tab_id;
WebContents* opener_contents = nullptr;
if (opener_id == tab_id) {
@@ -1637,7 +1637,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1653,7 +1653,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
->SetAutoDiscardable(state);
}
@@ -82,7 +73,7 @@ index cbfeb699bb92c..259c9b9d5938b 100644
// Bug fix for crbug.com/1197888. Don't let the extension update the tab if
// the user is dragging tabs.
if (!ExtensionTabUtil::IsTabStripEditable()) {
@@ -1658,8 +1658,9 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1674,8 +1674,9 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
// Navigate the tab to a new location if the url is different.
if (params->update_properties.url) {
std::string updated_url = *params->update_properties.url;
@@ -94,7 +85,7 @@ index cbfeb699bb92c..259c9b9d5938b 100644
return RespondNow(Error(ErrorUtils::FormatErrorMessage(
tabs_constants::kURLsNotAllowedInIncognitoError, updated_url)));
}
@@ -1673,7 +1674,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
@@ -1689,7 +1690,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
return RespondNow(Error(std::move(error)));
}
@@ -104,18 +95,18 @@ index cbfeb699bb92c..259c9b9d5938b 100644
current_url, updated_url, js_callstack());
}
diff --git chrome/browser/extensions/extension_tab_util.cc chrome/browser/extensions/extension_tab_util.cc
index c630431022688..534c6f9e52726 100644
index 1687e36dd5966..929e1fdf78611 100644
--- chrome/browser/extensions/extension_tab_util.cc
+++ chrome/browser/extensions/extension_tab_util.cc
@@ -18,6 +18,7 @@
@@ -20,6 +20,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/expected_macros.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/tab_groups/tab_groups_util.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
@@ -72,6 +73,10 @@
#include "chrome/browser/extensions/browser_extension_window_controller.h"
@@ -75,6 +76,10 @@
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
@@ -126,7 +117,7 @@ index c630431022688..534c6f9e52726 100644
using content::NavigationEntry;
using content::WebContents;
using extensions::mojom::APIPermissionID;
@@ -748,6 +753,20 @@ bool ExtensionTabUtil::GetTabById(int tab_id,
@@ -698,6 +703,20 @@ bool ExtensionTabUtil::GetTabById(int tab_id,
}
}
@@ -148,7 +139,7 @@ index c630431022688..534c6f9e52726 100644
// Prerendering tab is not visible and it cannot be in `TabStripModel`, if
// the tab id exists as a prerendering tab, and the API will returns
diff --git chrome/browser/ui/tab_helpers.h chrome/browser/ui/tab_helpers.h
index 4ca4ecd147267..dc8a8d004a1d6 100644
index 63848c93738ce..0358e098c7339 100644
--- chrome/browser/ui/tab_helpers.h
+++ chrome/browser/ui/tab_helpers.h
@@ -6,6 +6,7 @@
@@ -159,9 +150,9 @@ index 4ca4ecd147267..dc8a8d004a1d6 100644
#if BUILDFLAG(IS_ANDROID)
@@ -37,6 +38,10 @@ namespace prerender {
class ChromeNoStatePrefetchContentsDelegate;
}
@@ -41,6 +42,10 @@ namespace tabs {
class TabModel;
} // namespace tabs
+#if BUILDFLAG(ENABLE_CEF)
+class CefBrowserPlatformDelegateAlloy;
@@ -170,7 +161,7 @@ index 4ca4ecd147267..dc8a8d004a1d6 100644
// A "tab contents" is a WebContents that is used as a tab in a browser window
// (or the equivalent on Android). The TabHelpers class allows specific classes
// to attach the set of tab helpers that is used for tab contents.
@@ -74,6 +79,10 @@ class TabHelpers {
@@ -79,6 +84,10 @@ class TabHelpers {
// Link Preview shows a preview of a page, then promote it as a new tab.
friend class PreviewTab;
@@ -182,10 +173,10 @@ index 4ca4ecd147267..dc8a8d004a1d6 100644
// ones that need to call AttachTabHelpers; if you think you do, re-read the
// design document linked above, especially the section "Reusing tab helpers".
diff --git chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc
index 427988cdc5b24..f448bb8dac9b4 100644
index 101afe2d08189..f4f4479f5ee54 100644
--- chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc
+++ chrome/browser/ui/views/download/bubble/download_toolbar_button_view.cc
@@ -831,6 +831,10 @@ void DownloadToolbarButtonView::ShowPendingDownloadStartedAnimation() {
@@ -835,6 +835,10 @@ void DownloadToolbarButtonView::ShowPendingDownloadStartedAnimation() {
if (!gfx::Animation::ShouldRenderRichAnimation()) {
return;
}

View File

@@ -14,10 +14,10 @@ index 7ae18c5a960b0..d48ba838efe6f 100644
? profile_metrics::BrowserProfileType::kRegular
: profile_metrics::BrowserProfileType::kIncognito;
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
index 826fa20afbb56..f08891c4aaa0d 100644
index 3ac5ebf1b49b5..d41cffecb5603 100644
--- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
+++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
@@ -31,7 +31,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog(
@@ -32,7 +32,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog(
dialog_type_(type),
incognito_profile_(incognito_profile) {
DCHECK(incognito_profile_);
@@ -25,7 +25,7 @@ index 826fa20afbb56..f08891c4aaa0d 100644
+ DCHECK(incognito_profile_->IsIncognitoProfile() ||
+ (incognito_profile_->IsOffTheRecord() &&
+ incognito_profile_->GetOTRProfileID().IsUniqueForCEF()));
SetButtons(ui::DIALOG_BUTTON_NONE);
SetButtons(static_cast<int>(ui::mojom::DialogButton::kNone));
SetShowCloseButton(true);
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc

View File

@@ -14,7 +14,7 @@ index 5420ca8496773..74bdd5aa84c31 100644
}
diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc
index e2db3688e3e0b..1772107cbdfc9 100644
index 76e435416e7ca..594ef7ae92fed 100644
--- chrome/browser/profiles/profile.cc
+++ chrome/browser/profiles/profile.cc
@@ -91,6 +91,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
@@ -52,7 +52,7 @@ index e2db3688e3e0b..1772107cbdfc9 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 02454f4e780b5..4641f33c26f5f 100644
index 0c961e399183b..70a02994bd478 100644
--- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h
@@ -94,6 +94,10 @@ class Profile : public content::BrowserContext {
@@ -85,10 +85,10 @@ index 02454f4e780b5..4641f33c26f5f 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 f64a27cfcb5c0..93d0670fa9455 100644
index 8eea00363de53..2167b1b8df4d2 100644
--- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc
@@ -1038,7 +1038,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);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 75934762c580c..8081201acf5a1 100644
index fd47cd395ad8e..b9c9f1c0d438b 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -36,6 +36,7 @@ static_library("safe_browsing") {
@@ -37,6 +37,7 @@ static_library("safe_browsing") {
"//components/enterprise:enterprise",
"//components/enterprise/buildflags",
"//components/enterprise/common:strings",

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc
index 5286333070206..a25b8fd2c61b1 100644
index c484e98959a22..db58381c66dc0 100644
--- chrome/browser/ui/startup/startup_browser_creator.cc
+++ chrome/browser/ui/startup/startup_browser_creator.cc
@@ -606,6 +606,13 @@ std::optional<ash::KioskAppId> GetAppId(const base::CommandLine& command_line,
@@ -604,6 +604,13 @@ std::optional<ash::KioskAppId> GetAppId(const base::CommandLine& command_line,
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -16,7 +16,7 @@ index 5286333070206..a25b8fd2c61b1 100644
} // namespace
StartupProfileMode StartupProfileModeFromReason(
@@ -1503,6 +1510,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile(
@@ -1492,6 +1499,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile(
{profile, mode}, last_opened_profiles);
}
@@ -29,7 +29,7 @@ index 5286333070206..a25b8fd2c61b1 100644
// static
void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
const base::CommandLine& command_line,
@@ -1512,6 +1525,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
@@ -1501,6 +1514,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
return;
}
@@ -42,7 +42,7 @@ index 5286333070206..a25b8fd2c61b1 100644
StartupProfileMode mode =
StartupProfileModeFromReason(profile_path_info.reason);
diff --git chrome/browser/ui/startup/startup_browser_creator.h chrome/browser/ui/startup/startup_browser_creator.h
index 11a33a0bdec02..5a8146c95f99d 100644
index 919bae5ccfeae..5c2dfbf955723 100644
--- chrome/browser/ui/startup/startup_browser_creator.h
+++ chrome/browser/ui/startup/startup_browser_creator.h
@@ -9,6 +9,7 @@
@@ -53,7 +53,7 @@ index 11a33a0bdec02..5a8146c95f99d 100644
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
@@ -136,6 +137,13 @@ class StartupBrowserCreator {
@@ -135,6 +136,13 @@ class StartupBrowserCreator {
StartupProfileInfo profile_info,
const Profiles& last_opened_profiles);

View File

@@ -69,7 +69,7 @@ index 6548d519c3da9..645163f69f822 100644
// chrome://terms
class TermsUIConfig : public AboutUIConfigBase {
diff --git chrome/browser/ui/webui/chrome_web_ui_configs.cc chrome/browser/ui/webui/chrome_web_ui_configs.cc
index 07e648356a5fb..b284630f01b3a 100644
index b56981733057e..20386be211feb 100644
--- chrome/browser/ui/webui/chrome_web_ui_configs.cc
+++ chrome/browser/ui/webui/chrome_web_ui_configs.cc
@@ -6,6 +6,7 @@
@@ -80,7 +80,7 @@ index 07e648356a5fb..b284630f01b3a 100644
#include "chrome/browser/ui/webui/about/about_ui.h"
#include "chrome/browser/ui/webui/accessibility/accessibility_ui.h"
#include "chrome/browser/ui/webui/autofill_and_password_manager_internals/autofill_internals_ui.h"
@@ -74,6 +75,9 @@ void RegisterChromeWebUIConfigs() {
@@ -97,6 +98,9 @@ void RegisterChromeWebUIConfigs() {
map.AddWebUIConfig(std::make_unique<AutofillInternalsUIConfig>());
map.AddWebUIConfig(std::make_unique<BrowsingTopicsInternalsUIConfig>());
map.AddWebUIConfig(std::make_unique<ChromeURLsUIConfig>());
@@ -91,7 +91,7 @@ index 07e648356a5fb..b284630f01b3a 100644
map.AddWebUIConfig(std::make_unique<CreditsUIConfig>());
map.AddWebUIConfig(std::make_unique<DataSharingInternalsUIConfig>());
diff --git chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index af6d877f601d2..03c53be62e560 100644
index 743fd86a35a10..48b0488d8f56a 100644
--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -18,6 +18,7 @@
@@ -102,7 +102,7 @@ index af6d877f601d2..03c53be62e560 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/commerce/shopping_service_factory.h"
@@ -980,6 +981,9 @@ ChromeWebUIControllerFactory::GetListOfAcceptableURLs() {
@@ -927,6 +928,9 @@ ChromeWebUIControllerFactory::GetListOfAcceptableURLs() {
GURL(chrome::kChromeUIGpuURL),
GURL(chrome::kChromeUIHistogramsURL),
GURL(chrome::kChromeUIInspectURL),
@@ -127,7 +127,7 @@ index 248b6795e8cbe..c957f9d55613d 100644
#if !BUILDFLAG(IS_ANDROID)
kChromeUIManagementHost,
diff --git chrome/common/webui_url_constants.h chrome/common/webui_url_constants.h
index 52672e0274345..cdcaf3deb3c32 100644
index d1a8dc8342177..8d3226adca3c4 100644
--- chrome/common/webui_url_constants.h
+++ chrome/common/webui_url_constants.h
@@ -18,6 +18,7 @@
@@ -137,8 +137,8 @@ index 52672e0274345..cdcaf3deb3c32 100644
+#include "cef/libcef/features/features.h"
#include "chrome/common/buildflags.h"
#include "components/lens/buildflags.h"
#include "content/public/common/url_constants.h"
@@ -155,6 +156,10 @@ inline constexpr char kChromeUILauncherInternalsURL[] =
#include "components/signin/public/base/signin_buildflags.h"
@@ -160,6 +161,10 @@ inline constexpr char kChromeUILauncherInternalsURL[] =
inline constexpr char kChromeUILensSearchBubbleHost[] = "lens-search-bubble";
inline constexpr char kChromeUILensSearchBubbleURL[] =
"chrome://lens-search-bubble/";

View File

@@ -1,5 +1,5 @@
diff --git chrome/common/features.gni chrome/common/features.gni
index a584f49ecfb1b..fdc7eceb76024 100644
index 276e7fbde552c..1fddfa229eeed 100644
--- chrome/common/features.gni
+++ chrome/common/features.gni
@@ -7,6 +7,7 @@ import("//build/config/chromeos/ui_mode.gni")

View File

@@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 3b8b9a9eb5cbf..0fcb797674fc4 100644
index 3a4b21b9b90ab..abeee8364b65d 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -5,6 +5,7 @@
@@ -10,15 +10,15 @@ index 3b8b9a9eb5cbf..0fcb797674fc4 100644
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -128,6 +129,7 @@ static_library("renderer") {
deps = [
@@ -137,6 +138,7 @@ static_library("renderer") {
":process_state",
"//base/allocator:buildflags",
"//build:chromeos_buildflags",
+ "//cef/libcef/features",
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -246,6 +248,10 @@ static_library("renderer") {
@@ -255,6 +257,10 @@ static_library("renderer") {
]
}

View File

@@ -1,5 +1,5 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index 67428f15a7c50..4e418019327e6 100644
index 9c1a840843c02..60c1643ec02b7 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -42,6 +42,7 @@
@@ -10,7 +10,7 @@ index 67428f15a7c50..4e418019327e6 100644
#include "chrome/browser/buildflags.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
@@ -611,6 +612,7 @@ struct MainFunction {
@@ -608,6 +609,7 @@ struct MainFunction {
int (*function)(content::MainFunctionParams);
};
@@ -18,7 +18,7 @@ index 67428f15a7c50..4e418019327e6 100644
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -694,6 +696,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
@@ -691,6 +693,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
#endif // BUILDFLAG(IS_WIN)
}
@@ -26,7 +26,7 @@ index 67428f15a7c50..4e418019327e6 100644
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// If Lacros was prelaunched at login screen, this method blocks waiting
@@ -855,6 +858,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
@@ -852,6 +855,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
ChromeMainDelegate::~ChromeMainDelegate() = default;
#endif // !BUILDFLAG(IS_ANDROID)
@@ -37,7 +37,7 @@ index 67428f15a7c50..4e418019327e6 100644
std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
InvokedIn invoked_in) {
DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get());
@@ -880,7 +887,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -877,7 +884,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// future session's metrics.
DeferBrowserMetrics(user_data_dir);
@@ -46,7 +46,7 @@ index 67428f15a7c50..4e418019327e6 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.
@@ -1040,7 +1047,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -1037,7 +1044,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// Initializes the resource bundle and determines the locale.
std::string actual_locale = LoadLocalState(
@@ -56,7 +56,7 @@ index 67428f15a7c50..4e418019327e6 100644
chrome_feature_list_creator->SetApplicationLocale(actual_locale);
chrome_feature_list_creator->OverrideCachedUIStrings();
@@ -1057,6 +1065,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -1054,6 +1062,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
new net::NetworkChangeNotifierFactoryAndroid());
#endif
@@ -65,7 +65,7 @@ index 67428f15a7c50..4e418019327e6 100644
if (base::FeatureList::IsEnabled(
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
bool record = true;
@@ -1067,6 +1077,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -1064,6 +1074,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
if (record)
chrome_content_browser_client_->startup_data()->RecordCoreSystemProfile();
}
@@ -73,9 +73,9 @@ index 67428f15a7c50..4e418019327e6 100644
#if BUILDFLAG(IS_ANDROID)
UmaSessionStats::OnStartup();
@@ -1104,8 +1115,8 @@ bool ChromeMainDelegate::ShouldInitializeMojo(InvokedIn invoked_in) {
void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
base::ThreadPoolInstance::Create(name);
@@ -1107,8 +1118,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
std::make_unique<ChromeThreadProfilerClient>());
// `ChromeMainDelegateAndroid::PreSandboxStartup` creates the profiler a little
-// later.
-#if !BUILDFLAG(IS_ANDROID)
@@ -84,7 +84,7 @@ index 67428f15a7c50..4e418019327e6 100644
// Start the sampling profiler as early as possible - namely, once the thread
// pool has been created.
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
@@ -1517,6 +1528,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1515,6 +1526,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@@ -92,15 +92,15 @@ index 67428f15a7c50..4e418019327e6 100644
crash_reporter::InitializeCrashKeys();
#if BUILDFLAG(IS_POSIX)
@@ -1527,6 +1539,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1525,6 +1537,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
InitMacCrashReporter(command_line, process_type);
SetUpInstallerPreferences(command_line);
#endif
+#endif // !BUILDFLAG(ENABLE_CEF)
#if BUILDFLAG(IS_WIN)
child_process_logging::Init();
@@ -1538,6 +1551,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
#if defined(ARCH_CPU_ARM_FAMILY) && \
(BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
@@ -1533,6 +1546,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
base::CPU cpu_info;
#endif
@@ -108,7 +108,7 @@ index 67428f15a7c50..4e418019327e6 100644
// Initialize the user data dir for any process type that needs it.
bool initialize_user_data_dir = chrome::ProcessNeedsProfileDir(process_type);
#if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -1549,6 +1563,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1544,6 +1558,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
if (initialize_user_data_dir) {
InitializeUserDataDir(base::CommandLine::ForCurrentProcess());
}
@@ -116,7 +116,7 @@ index 67428f15a7c50..4e418019327e6 100644
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// Generate shared resource file only on browser process. This is to avoid
@@ -1707,7 +1722,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1695,7 +1710,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
#else
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(
@@ -126,7 +126,7 @@ index 67428f15a7c50..4e418019327e6 100644
base::FilePath resources_pack_path;
base::PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
@@ -1737,6 +1753,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1725,6 +1741,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
}
@@ -134,7 +134,7 @@ index 67428f15a7c50..4e418019327e6 100644
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess &&
@@ -1773,6 +1790,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1761,6 +1778,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@@ -142,7 +142,7 @@ index 67428f15a7c50..4e418019327e6 100644
#if BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
@@ -1900,6 +1918,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1888,6 +1906,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@@ -150,7 +150,7 @@ index 67428f15a7c50..4e418019327e6 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 =
@@ -1912,6 +1931,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1900,6 +1919,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@@ -158,7 +158,7 @@ index 67428f15a7c50..4e418019327e6 100644
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -2020,6 +2040,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -2008,6 +2028,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
: memory_system::DispatcherParameters::
AllocationTraceRecorderInclusion::kIgnore;
@@ -166,7 +166,7 @@ index 67428f15a7c50..4e418019327e6 100644
memory_system::Initializer()
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
.SetProfilingClientParameters(chrome::GetChannel(),
@@ -2027,5 +2048,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -2015,5 +2036,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
.SetDispatcherParameters(memory_system::DispatcherParameters::
PoissonAllocationSamplerInclusion::kEnforce,
allocation_recorder_inclusion, process_type)
@@ -214,7 +214,7 @@ index 521d5710b6387..8a5f3e6a312d2 100644
#if BUILDFLAG(IS_CHROMEOS_LACROS)
std::unique_ptr<chromeos::LacrosService> lacros_service_;
diff --git chrome/app_shim/BUILD.gn chrome/app_shim/BUILD.gn
index 8bf88eee16370..4c4d31d6a5451 100644
index db17714f74137..23f9f2eb3eb8b 100644
--- chrome/app_shim/BUILD.gn
+++ chrome/app_shim/BUILD.gn
@@ -24,6 +24,7 @@ source_set("app_shim") {
@@ -248,7 +248,7 @@ index ac1361bd6bc2e..a303ca169c7f7 100644
base::PathService::OverrideAndCreateIfNeeded(
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index bf8c5df67c1e3..61bf28f46b423 100644
index dbce369a3e8bd..a7fbe297c56d1 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -53,6 +53,7 @@
@@ -259,7 +259,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -529,7 +530,7 @@ void ProcessSingletonNotificationCallbackImpl(
@@ -531,7 +532,7 @@ void ProcessSingletonNotificationCallbackImpl(
return;
}
@@ -268,7 +268,7 @@ index bf8c5df67c1e3..61bf28f46b423 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
@@ -833,7 +834,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() {
@@ -846,7 +847,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() {
return content::RESULT_CODE_NORMAL_EXIT;
}
@@ -277,7 +277,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
// If we are running stale binaries then relaunch and exit immediately.
if (upgrade_util::IsRunningOldChrome()) {
if (!upgrade_util::RelaunchChromeBrowser(
@@ -846,7 +847,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() {
@@ -859,7 +860,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() {
// result in browser startup bailing.
return chrome::RESULT_CODE_NORMAL_EXIT_UPGRADE_RELAUNCHED;
}
@@ -286,7 +286,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
return load_local_state_result;
}
@@ -956,7 +957,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
@@ -969,7 +970,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
browser_process_->local_state());
platform_management_service->RefreshCache(base::NullCallback());
@@ -295,7 +295,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
if (first_run::IsChromeFirstRun()) {
bool stats_default;
if (GoogleUpdateSettings::GetCollectStatsConsentDefault(&stats_default)) {
@@ -969,7 +970,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
@@ -982,7 +983,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded(
: metrics::EnableMetricsDefault::OPT_IN);
}
}
@@ -304,7 +304,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
std::string locale =
startup_data_->chrome_feature_list_creator()->actual_locale();
@@ -1002,6 +1003,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
@@ -1015,6 +1016,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
master_prefs_ = std::make_unique<first_run::MasterPrefs>();
@@ -312,7 +312,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
std::unique_ptr<installer::InitialPreferences> installer_initial_prefs =
startup_data_->chrome_feature_list_creator()->TakeInitialPrefs();
if (!installer_initial_prefs)
@@ -1035,6 +1037,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
@@ -1048,6 +1050,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() {
master_prefs_->confirm_to_quit);
}
#endif // BUILDFLAG(IS_MAC)
@@ -320,7 +320,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
return content::RESULT_CODE_NORMAL_EXIT;
}
@@ -1096,6 +1099,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
@@ -1109,6 +1112,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
browser_process_->browser_policy_connector()->OnResourceBundleCreated();
@@ -328,7 +328,7 @@ index bf8c5df67c1e3..61bf28f46b423 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)
@@ -1117,6 +1121,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
@@ -1130,6 +1134,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
}
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -336,7 +336,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
#if BUILDFLAG(IS_MAC)
#if defined(ARCH_CPU_X86_64)
@@ -1479,6 +1484,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1501,6 +1506,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
browser_process_->PreMainMessageLoopRun();
#if BUILDFLAG(IS_WIN)
@@ -344,7 +344,7 @@ index bf8c5df67c1e3..61bf28f46b423 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)) {
@@ -1490,6 +1496,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1512,6 +1518,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
return ChromeBrowserMainPartsWin::HandleIconsCommands(
*base::CommandLine::ForCurrentProcess());
}
@@ -352,7 +352,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
ui::SelectFileDialog::SetFactory(
std::make_unique<ChromeSelectFileDialogFactory>());
@@ -1515,6 +1522,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1537,6 +1544,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // BUILDFLAG(CHROME_FOR_TESTING)
@@ -360,7 +360,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMakeDefaultBrowser)) {
bool is_managed = g_browser_process->local_state()->IsManagedPreference(
@@ -1528,18 +1536,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1550,18 +1558,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
? static_cast<int>(content::RESULT_CODE_NORMAL_EXIT)
: static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED);
}
@@ -383,7 +383,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
// Begin relaunch processing immediately if User Data migration is required
@@ -1578,7 +1590,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1600,7 +1612,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
}
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
@@ -392,7 +392,7 @@ index bf8c5df67c1e3..61bf28f46b423 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
@@ -1587,7 +1599,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1609,7 +1621,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// obtained but before potentially creating the first run sentinel).
if (ChromeBrowserMainPartsWin::CheckMachineLevelInstall())
return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS;
@@ -401,7 +401,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
// Desktop construction occurs here, (required before profile creation).
PreProfileInit();
@@ -1660,6 +1672,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1682,6 +1694,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Call `PostProfileInit()`and set it up for profiles created later.
profile_init_manager_ = std::make_unique<ProfileInitManager>(this, profile);
@@ -409,7 +409,7 @@ index bf8c5df67c1e3..61bf28f46b423 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
@@ -1699,6 +1712,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1721,6 +1734,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
*base::CommandLine::ForCurrentProcess());
}
#endif // BUILDFLAG(IS_WIN)
@@ -417,7 +417,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
// Configure modules that need access to resources.
net::NetModule::SetResourceProvider(ChromeNetResourceProvider);
@@ -1790,6 +1804,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1812,6 +1826,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
g_browser_process->profile_manager()->GetLastOpenedProfiles();
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -429,7 +429,7 @@ index bf8c5df67c1e3..61bf28f46b423 100644
// This step is costly.
if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(),
base::FilePath(), profile_info,
@@ -1822,11 +1841,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1844,11 +1863,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Create the RunLoop for MainMessageLoopRun() to use and transfer
// ownership of the browser's lifetime to the BrowserProcess.
@@ -481,7 +481,7 @@ index e26e3625c99c8..c0d4a95607e37 100644
+#endif
}
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 4db37945148cb..56a31fecf00a2 100644
index e5ce608907f72..ce49d755ce623 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -48,6 +48,7 @@
@@ -492,7 +492,7 @@ index 4db37945148cb..56a31fecf00a2 100644
#include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/ai/ai_manager_keyed_service_factory.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
@@ -1543,6 +1544,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
@@ -1552,6 +1553,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
}
ChromeContentBrowserClient::ChromeContentBrowserClient() {
@@ -501,7 +501,7 @@ index 4db37945148cb..56a31fecf00a2 100644
#if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back(
std::make_unique<ChromeContentBrowserClientPluginsPart>());
@@ -1580,6 +1583,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
@@ -1589,6 +1592,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
}
}
@@ -513,7 +513,7 @@ index 4db37945148cb..56a31fecf00a2 100644
// static
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
@@ -3956,28 +3964,25 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
@@ -3986,28 +3994,25 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
web_prefs->preferred_color_scheme;
}
#else
@@ -559,7 +559,7 @@ index 4db37945148cb..56a31fecf00a2 100644
#endif // BUILDFLAG(IS_ANDROID)
// Reauth WebUI doesn't support dark mode yet because it shares the dialog
@@ -4748,9 +4753,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
@@ -4761,9 +4766,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID)
@@ -571,7 +571,7 @@ index 4db37945148cb..56a31fecf00a2 100644
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6877,7 +6884,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
@@ -6900,7 +6907,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
#endif
}
@@ -580,7 +580,7 @@ index 4db37945148cb..56a31fecf00a2 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -6895,6 +6902,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
@@ -6918,6 +6925,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale();
}
@@ -589,7 +589,7 @@ index 4db37945148cb..56a31fecf00a2 100644
}
std::vector<base::FilePath>
@@ -8047,11 +8056,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
@@ -8072,11 +8081,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@@ -603,7 +603,7 @@ index 4db37945148cb..56a31fecf00a2 100644
FROM_HERE, keepalive_deadline_ - now,
base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -8073,7 +8082,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
@@ -8098,7 +8107,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_;
if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer";
@@ -613,7 +613,7 @@ index 4db37945148cb..56a31fecf00a2 100644
// This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence.
}
@@ -8237,7 +8247,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
@@ -8262,7 +8272,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_;
if (now < then) {
@@ -623,10 +623,10 @@ index 4db37945148cb..56a31fecf00a2 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 355d347c1ae84..8b1eb079ab348 100644
index 8a96e0b26a27a..2442bf7e7f88c 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -151,6 +151,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -148,6 +148,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
~ChromeContentBrowserClient() override;
@@ -654,7 +654,7 @@ index 355d347c1ae84..8b1eb079ab348 100644
#endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index 812bb38a0c53e..5fc84ff4b855e 100644
index 921f99a4ee22d..8f059c28244cd 100644
--- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc
@@ -16,6 +16,7 @@
@@ -665,9 +665,9 @@ index 812bb38a0c53e..5fc84ff4b855e 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/invert_bubble_prefs.h"
@@ -205,6 +206,10 @@
#include "chrome/browser/background/background_mode_manager.h"
#endif
@@ -213,6 +214,10 @@
#include "extensions/browser/pref_names.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/browser/prefs/browser_prefs.h"
@@ -676,7 +676,7 @@ index 812bb38a0c53e..5fc84ff4b855e 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1731,7 +1736,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1813,7 +1818,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // BUILDFLAG(IS_WIN)
@@ -686,7 +686,7 @@ index 812bb38a0c53e..5fc84ff4b855e 100644
downgrade::RegisterPrefs(registry);
#endif
@@ -1784,6 +1790,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1866,6 +1872,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
@@ -698,7 +698,7 @@ index 812bb38a0c53e..5fc84ff4b855e 100644
}
// Register prefs applicable to all profiles.
@@ -2233,6 +2244,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
@@ -2317,6 +2328,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) {
RegisterProfilePrefs(registry, locale);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc
index 1ee39659a3658..e927aa831adbe 100644
index 86af74569f013..99870eb532f35 100644
--- chrome/browser/ui/browser_command_controller.cc
+++ chrome/browser/ui/browser_command_controller.cc
@@ -413,6 +413,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -416,6 +416,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
// choose to not implement CommandUpdaterDelegate inside this class and
// therefore command_updater_ doesn't have the delegate set).
if (!SupportsCommand(id) || !IsCommandEnabled(id)) {
@@ -10,7 +10,7 @@ index 1ee39659a3658..e927aa831adbe 100644
return false;
}
@@ -429,6 +430,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
@@ -432,6 +433,13 @@ bool BrowserCommandController::ExecuteCommandWithDisposition(
DCHECK(command_updater_.IsCommandEnabled(id))
<< "Invalid/disabled command " << id;
@@ -24,7 +24,7 @@ index 1ee39659a3658..e927aa831adbe 100644
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
@@ -1221,11 +1229,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
@@ -1206,11 +1214,13 @@ void BrowserCommandController::TabRestoreServiceLoaded(
// BrowserCommandController, private:
bool BrowserCommandController::IsShowingMainUI() {
@@ -41,10 +41,10 @@ index 1ee39659a3658..e927aa831adbe 100644
void BrowserCommandController::InitCommandState() {
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
index 54b5fca016876..60138e6a13473 100644
index 57fb7d50fafa5..bf43ebfba84b5 100644
--- chrome/browser/ui/toolbar/app_menu_model.cc
+++ chrome/browser/ui/toolbar/app_menu_model.cc
@@ -723,10 +723,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
@@ -716,10 +716,12 @@ FindAndEditSubMenuModel::FindAndEditSubMenuModel(
ui::SimpleMenuModel::Delegate* delegate)
: SimpleMenuModel(delegate) {
AddItemWithStringIdAndVectorIcon(this, IDC_FIND, IDS_FIND, kSearchMenuIcon);
@@ -57,7 +57,7 @@ index 54b5fca016876..60138e6a13473 100644
}
class SaveAndShareSubMenuModel : public ui::SimpleMenuModel {
@@ -791,6 +793,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
@@ -784,6 +786,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel(
}
}
@@ -115,7 +115,7 @@ index 54b5fca016876..60138e6a13473 100644
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -1687,7 +1740,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
@@ -1688,7 +1741,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
return false;
}
@@ -124,7 +124,7 @@ index 54b5fca016876..60138e6a13473 100644
GlobalError* error =
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
->GetGlobalErrorByMenuItemCommandID(command_id);
@@ -1703,6 +1756,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
@@ -1704,6 +1757,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
}
}
@@ -155,7 +155,7 @@ index 54b5fca016876..60138e6a13473 100644
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
if (command_id == IDC_VIEW_PASSWORDS ||
command_id == IDC_SHOW_PASSWORD_MANAGER) {
@@ -1865,8 +1942,10 @@ void AppMenuModel::Build() {
@@ -1860,8 +1937,10 @@ void AppMenuModel::Build() {
IDS_CLEAR_BROWSING_DATA,
kTrashCanRefreshIcon);
@@ -166,7 +166,7 @@ index 54b5fca016876..60138e6a13473 100644
AddSeparator(ui::NORMAL_SEPARATOR);
AddItemWithStringIdAndVectorIcon(this, IDC_PRINT, IDS_PRINT, kPrintMenuIcon);
@@ -1981,6 +2060,11 @@ void AppMenuModel::Build() {
@@ -1964,6 +2043,11 @@ void AppMenuModel::Build() {
}
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
@@ -397,7 +397,7 @@ index 14a8a70d853f6..bf81594947886 100644
// regenerated.
bool RegenerateFrameOnThemeChange(BrowserThemeChangeType theme_change_type);
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index d775394c47cf5..10f089b2389b3 100644
index c3241e411d46d..f3842551f3c75 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -366,10 +366,6 @@ constexpr base::FeatureParam<base::TimeDelta> kLoadingTabAnimationFrameDelay = {
@@ -411,7 +411,7 @@ index d775394c47cf5..10f089b2389b3 100644
#if BUILDFLAG(IS_CHROMEOS_ASH)
// UMA histograms that record animation smoothness for tab loading animation.
constexpr char kTabLoadingSmoothnessHistogramName[] =
@@ -750,6 +746,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
@@ -769,6 +765,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
return browser_view_->frame()->GetTopInset() - browser_view_->y();
}
@@ -426,7 +426,7 @@ index d775394c47cf5..10f089b2389b3 100644
bool IsToolbarVisible() const override {
return browser_view_->IsToolbarVisible();
}
@@ -901,11 +905,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
@@ -920,11 +924,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
@@ -449,7 +449,7 @@ index d775394c47cf5..10f089b2389b3 100644
SetShowIcon(
::ShouldShowWindowIcon(browser_.get(), AppUsesWindowControlsOverlay()));
@@ -995,8 +1009,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
@@ -1014,8 +1028,15 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
contents_container->SetLayoutManager(std::make_unique<ContentsLayoutManager>(
devtools_web_view_, contents_web_view_, watermark_view_));
@@ -467,7 +467,7 @@ index d775394c47cf5..10f089b2389b3 100644
contents_separator_ =
top_container_->AddChildView(std::make_unique<ContentsSeparator>());
@@ -1077,7 +1098,9 @@ void BrowserView::ToggleCompactModeUI() {
@@ -1096,7 +1117,9 @@ void BrowserView::ToggleCompactModeUI() {
}
BrowserView::~BrowserView() {
@@ -477,7 +477,7 @@ index d775394c47cf5..10f089b2389b3 100644
// Destroy the top controls slide controller first as it depends on the
// tabstrip model and the browser frame.
@@ -1085,7 +1108,9 @@ BrowserView::~BrowserView() {
@@ -1104,7 +1127,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.
@@ -487,7 +487,7 @@ index d775394c47cf5..10f089b2389b3 100644
// Stop the animation timer explicitly here to avoid running it in a nested
// message loop, which may run by Browser destructor.
@@ -1094,17 +1119,18 @@ BrowserView::~BrowserView() {
@@ -1113,17 +1138,18 @@ BrowserView::~BrowserView() {
// Immersive mode may need to reparent views before they are removed/deleted.
immersive_mode_controller_.reset();
@@ -510,7 +510,7 @@ index d775394c47cf5..10f089b2389b3 100644
// `watermark_view_` is a raw pointer to a child view, so it needs to be set
// to null before `RemoveAllChildViews()` is called to avoid dangling.
@@ -1664,6 +1690,13 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
@@ -1683,6 +1709,13 @@ gfx::Point BrowserView::GetThemeOffsetFromBrowserView() const {
ThemeProperties::kFrameHeightAboveTabs - browser_view_origin.y());
}
@@ -524,7 +524,7 @@ index d775394c47cf5..10f089b2389b3 100644
// static:
BrowserView::DevToolsDockedPlacement BrowserView::GetDevToolsDockedPlacement(
const gfx::Rect& contents_webview_bounds,
@@ -2078,9 +2111,14 @@ void BrowserView::OnExclusiveAccessUserInput() {
@@ -2097,9 +2130,14 @@ void BrowserView::OnExclusiveAccessUserInput() {
bool BrowserView::ShouldHideUIForFullscreen() const {
// Immersive mode needs UI for the slide-down top panel.
@@ -540,7 +540,7 @@ index d775394c47cf5..10f089b2389b3 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
}
@@ -3260,7 +3298,8 @@ views::View* BrowserView::GetTopContainer() {
@@ -3293,7 +3331,8 @@ views::View* BrowserView::GetTopContainer() {
}
DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() {
@@ -550,7 +550,7 @@ index d775394c47cf5..10f089b2389b3 100644
if (auto* download_button = toolbar_button_provider_->GetDownloadButton())
return download_button->bubble_controller();
return nullptr;
@@ -3815,7 +3854,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
@@ -3861,7 +3900,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() {
if (top_container()->parent() == this)
return;
@@ -560,7 +560,7 @@ index d775394c47cf5..10f089b2389b3 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -4302,11 +4342,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
@@ -4348,11 +4388,38 @@ void BrowserView::GetAccessiblePanes(std::vector<views::View*>* panes) {
bool BrowserView::ShouldDescendIntoChildForEventHandling(
gfx::NativeView child,
const gfx::Point& location) {
@@ -601,7 +601,7 @@ index d775394c47cf5..10f089b2389b3 100644
// Draggable regions are defined relative to the web contents.
gfx::Point point_in_contents_web_view_coords(location);
views::View::ConvertPointToTarget(GetWidget()->GetRootView(),
@@ -4315,7 +4382,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling(
@@ -4361,7 +4428,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.
@@ -610,7 +610,7 @@ index d775394c47cf5..10f089b2389b3 100644
point_in_contents_web_view_coords.x(),
point_in_contents_web_view_coords.y()) ||
WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords);
@@ -4426,8 +4493,10 @@ void BrowserView::Layout(PassKey) {
@@ -4472,8 +4539,10 @@ void BrowserView::Layout(PassKey) {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
@@ -623,7 +623,7 @@ index d775394c47cf5..10f089b2389b3 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -4493,6 +4562,11 @@ void BrowserView::AddedToWidget() {
@@ -4539,6 +4608,11 @@ void BrowserView::AddedToWidget() {
SetThemeProfileForWindow(GetNativeWindow(), browser_->profile());
#endif
@@ -635,7 +635,7 @@ index d775394c47cf5..10f089b2389b3 100644
toolbar_->Init();
// TODO(pbos): Investigate whether the side panels should be creatable when
@@ -4535,13 +4609,9 @@ void BrowserView::AddedToWidget() {
@@ -4581,13 +4655,9 @@ void BrowserView::AddedToWidget() {
EnsureFocusOrder();
@@ -651,7 +651,7 @@ index d775394c47cf5..10f089b2389b3 100644
using_native_frame_ = frame_->ShouldUseNativeFrame();
MaybeInitializeWebUITabStrip();
@@ -4905,7 +4975,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
@@ -4951,7 +5021,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, const int64_t display_id) {
// Undo our anti-jankiness hacks and force a re-layout.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
@@ -661,7 +661,7 @@ index d775394c47cf5..10f089b2389b3 100644
}
void BrowserView::RequestFullscreen(bool fullscreen, int64_t display_id) {
@@ -5409,6 +5480,8 @@ Profile* BrowserView::GetProfile() {
@@ -5443,6 +5514,8 @@ Profile* BrowserView::GetProfile() {
}
void BrowserView::UpdateUIForTabFullscreen() {
@@ -670,7 +670,7 @@ index d775394c47cf5..10f089b2389b3 100644
frame()->GetFrameView()->UpdateFullscreenTopUI();
}
@@ -5431,6 +5504,8 @@ void BrowserView::HideDownloadShelf() {
@@ -5465,6 +5538,8 @@ void BrowserView::HideDownloadShelf() {
}
bool BrowserView::CanUserExitFullscreen() const {
@@ -680,7 +680,7 @@ index d775394c47cf5..10f089b2389b3 100644
}
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index bff67fba31480..bf3c87a126457 100644
index 6fa57160f7193..4e10786e2c5a4 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -137,11 +137,16 @@ class BrowserView : public BrowserWindow,
@@ -700,9 +700,9 @@ index bff67fba31480..bf3c87a126457 100644
void set_frame(BrowserFrame* frame) {
frame_ = frame;
paint_as_active_subscription_ =
@@ -825,6 +830,10 @@ class BrowserView : public BrowserWindow,
void ApplyScreenshotSettings(bool allow);
#endif
@@ -831,6 +836,10 @@ class BrowserView : public BrowserWindow,
void Copy();
void Paste();
+ // Called during Toolbar destruction to remove dependent objects that have
+ // dangling references.
@@ -711,7 +711,7 @@ index bff67fba31480..bf3c87a126457 100644
protected:
// Enumerates where the devtools are docked relative to the browser's main
// web contents.
@@ -848,6 +857,8 @@ class BrowserView : public BrowserWindow,
@@ -854,6 +863,8 @@ class BrowserView : public BrowserWindow,
const gfx::Rect& contents_webview_bounds,
const gfx::Rect& local_webview_container_bounds);
@@ -839,7 +839,7 @@ index 71445bfab1824..c77750ea2a820 100644
ContentsWebView::~ContentsWebView() {
diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
index 9dddf71ef05bd..18c43631ea288 100644
index 04ad8415b5e95..eb5f7161d72e0 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
@@ -619,6 +619,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView(
@@ -915,7 +915,7 @@ index 9dddf71ef05bd..18c43631ea288 100644
top_bar_container_view_->SetBoundsRect(top_bar);
#if !BUILDFLAG(IS_ANDROID)
if (auto_pip_setting_overlay_) {
@@ -1371,7 +1401,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
@@ -1372,7 +1402,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
}
int PictureInPictureBrowserFrameView::GetTopAreaHeight() const {
@@ -957,10 +957,10 @@ index 0bd4cfc52548b..8515cec793563 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 f4c711f411689..be422635719db 100644
index 212b3047f107b..942ed77d0eb3f 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -600,29 +600,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -608,29 +608,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {

View File

@@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index c3fe3e246d225..df8676d7b5080 100644
index 6253416703b73..66a482b46795b 100644
--- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h
@@ -114,7 +114,7 @@ bool ApplyUserAgentMetadataOverrides(

View File

@@ -12,7 +12,7 @@ index 11c9cd82d0392..9c700bc625cd5 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 27b688244b3af..aa50f40557874 100644
index aea31f655d929..5a6633fd581e2 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -860,7 +860,7 @@ NavigationURLLoaderImpl::CreateNonNetworkLoaderFactory(
@@ -47,10 +47,10 @@ index 27b688244b3af..aa50f40557874 100644
return std::make_pair(
/*is_cacheable=*/false,
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 79c37e0aeb8aa..902133ac26661 100644
index 49ae7aa8bb754..b82b455749128 100644
--- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc
@@ -1128,7 +1128,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
@@ -1127,7 +1127,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
void ContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) {}
@@ -59,7 +59,7 @@ index 79c37e0aeb8aa..902133ac26661 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1137,6 +1137,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
@@ -1136,6 +1136,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams(
cert_verifier_creation_params) {
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = "en-us,en";
@@ -68,10 +68,10 @@ index 79c37e0aeb8aa..902133ac26661 100644
std::vector<base::FilePath>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index ddca696e47412..82352a0fb71c4 100644
index d99cccb1f99a8..fb11c0ee286bc 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -2144,7 +2144,7 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2164,7 +2164,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,14 +80,14 @@ index ddca696e47412..82352a0fb71c4 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -2363,6 +2363,21 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2383,6 +2383,21 @@ class CONTENT_EXPORT ContentBrowserClient {
RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
+ // Same as above, but exposing the whole ResourceRequest object.
+ virtual bool HandleExternalProtocol(
+ base::RepeatingCallback<WebContents*()> web_contents_getter,
+ int frame_tree_node_id,
+ FrameTreeNodeId frame_tree_node_id,
+ NavigationUIData* navigation_data,
+ bool is_primary_main_frame,
+ bool is_in_fenced_frame_tree,
@@ -102,7 +102,7 @@ index ddca696e47412..82352a0fb71c4 100644
// Creates an OverlayWindow to be used for video or Picture-in-Picture.
// This window will house the content shown when in Picture-in-Picture mode.
// This will return a new OverlayWindow.
@@ -2423,6 +2438,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -2443,6 +2458,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@@ -139,7 +139,7 @@ index 784e0a5166d6b..1fd1e9ee107f3 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index c8bdd54e22b9b..8a7d4a6acbb93 100644
index 8fbed3f73560e..909a4d3e1eae5 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -573,6 +573,8 @@ void RenderThreadImpl::Init() {
@@ -152,10 +152,10 @@ index c8bdd54e22b9b..8a7d4a6acbb93 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 8ad54eacf1ec5..6556b1c1d4734 100644
index da2515e0067a9..e792751f278b4 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -1058,6 +1058,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
@@ -1037,6 +1037,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() {
//------------------------------------------------------------------------------
@@ -172,10 +172,10 @@ index 8ad54eacf1ec5..6556b1c1d4734 100644
RendererBlinkPlatformImpl::CreateWebV8ValueConverter() {
return std::make_unique<V8ValueConverterImpl>();
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index b2eae6bcf84a6..adf37a038888f 100644
index 69c52cb8333fc..ac2bbc7459864 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -247,6 +247,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -245,6 +245,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
InertAndMinimumIntervalOfUserLevelMemoryPressureSignal() override;
#endif // BUILDFLAG(IS_ANDROID)
@@ -186,10 +186,10 @@ index b2eae6bcf84a6..adf37a038888f 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 9064deed51d23..bea9f5e400c5f 100644
index 1d4bd5b055c1d..83f19e3ab19d1 100644
--- content/shell/browser/shell_content_browser_client.cc
+++ content/shell/browser/shell_content_browser_client.cc
@@ -743,7 +743,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated(
@@ -742,7 +742,7 @@ void ShellContentBrowserClient::OnNetworkServiceCreated(
#endif
}
@@ -198,7 +198,7 @@ index 9064deed51d23..bea9f5e400c5f 100644
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -752,6 +752,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams(
@@ -751,6 +751,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams(
cert_verifier_creation_params) {
ConfigureNetworkContextParamsForShell(context, network_context_params,
cert_verifier_creation_params);
@@ -207,7 +207,7 @@ index 9064deed51d23..bea9f5e400c5f 100644
std::vector<base::FilePath>
diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h
index adda0a797eb58..a83a9e048000c 100644
index f41d94c62a1aa..5b1090046265e 100644
--- content/shell/browser/shell_content_browser_client.h
+++ content/shell/browser/shell_content_browser_client.h
@@ -149,7 +149,7 @@ class ShellContentBrowserClient : public ContentBrowserClient {
@@ -220,10 +220,10 @@ index adda0a797eb58..a83a9e048000c 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 4e4be62976342..d3d33a9910f8d 100644
index c877347bdde3a..ceca828f491b1 100644
--- headless/lib/browser/headless_content_browser_client.cc
+++ headless/lib/browser/headless_content_browser_client.cc
@@ -353,7 +353,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed(
@@ -358,7 +358,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed(
return true;
}
@@ -232,7 +232,7 @@ index 4e4be62976342..d3d33a9910f8d 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -363,6 +363,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
@@ -368,6 +368,7 @@ void HeadlessContentBrowserClient::ConfigureNetworkContextParams(
HeadlessBrowserContextImpl::From(context)->ConfigureNetworkContextParams(
in_memory, relative_partition_path, network_context_params,
cert_verifier_creation_params);
@@ -241,7 +241,7 @@ index 4e4be62976342..d3d33a9910f8d 100644
std::string HeadlessContentBrowserClient::GetProduct() {
diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h
index ab36d851474e3..fde125757d68f 100644
index f26634ec9ce1f..ba3bfcbe0c45e 100644
--- headless/lib/browser/headless_content_browser_client.h
+++ headless/lib/browser/headless_content_browser_client.h
@@ -102,7 +102,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient {

View File

@@ -12,24 +12,24 @@ index 79ba3ac1913f8..46bcb4366d2f8 100644
if (main_argv)
setproctitle_init(main_argv);
diff --git content/app/content_main.cc content/app/content_main.cc
index 92a5ef04a25bf..099c4e3772b87 100644
index c37f18d794ae2..6d64483992d0c 100644
--- content/app/content_main.cc
+++ content/app/content_main.cc
@@ -172,11 +172,8 @@ ContentMainParams::~ContentMainParams() = default;
@@ -194,11 +194,8 @@ ContentMainParams::~ContentMainParams() = default;
ContentMainParams::ContentMainParams(ContentMainParams&&) = default;
ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default;
-// This function must be marked with NO_STACK_PROTECTOR or it may crash on
-// return, see the --change-stack-guard-on-fork command line flag.
-int NO_STACK_PROTECTOR
-RunContentProcess(ContentMainParams params,
- ContentMainRunner* content_main_runner) {
-NO_STACK_PROTECTOR int RunContentProcess(
- ContentMainParams params,
- ContentMainRunner* content_main_runner) {
+int ContentMainInitialize(ContentMainParams params,
+ ContentMainRunner* content_main_runner) {
base::FeatureList::FailOnFeatureAccessWithoutFeatureList();
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// Lacros is launched with inherited priority. Revert to normal priority
@@ -184,9 +181,6 @@ RunContentProcess(ContentMainParams params,
@@ -206,9 +203,6 @@ NO_STACK_PROTECTOR int RunContentProcess(
base::PlatformThread::SetCurrentThreadType(base::ThreadType::kDefault);
#endif
int exit_code = -1;
@@ -39,7 +39,7 @@ index 92a5ef04a25bf..099c4e3772b87 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
@@ -265,7 +259,9 @@ RunContentProcess(ContentMainParams params,
@@ -287,7 +281,9 @@ NO_STACK_PROTECTOR int RunContentProcess(
// default, "C", locale.
setlocale(LC_NUMERIC, "C");
@@ -50,7 +50,7 @@ index 92a5ef04a25bf..099c4e3772b87 100644
#endif
#if BUILDFLAG(IS_WIN)
@@ -273,14 +269,6 @@ RunContentProcess(ContentMainParams params,
@@ -295,14 +291,6 @@ NO_STACK_PROTECTOR int RunContentProcess(
#endif
#if BUILDFLAG(IS_MAC)
@@ -65,7 +65,7 @@ index 92a5ef04a25bf..099c4e3772b87 100644
InitializeMac();
#endif
@@ -328,12 +316,46 @@ RunContentProcess(ContentMainParams params,
@@ -353,12 +341,46 @@ NO_STACK_PROTECTOR int RunContentProcess(
if (IsSubprocess())
CommonSubprocessInit();
@@ -114,7 +114,7 @@ index 92a5ef04a25bf..099c4e3772b87 100644
}
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index c0d3fc6c6ad03..7e64fd1346863 100644
index 8fdd8d02e6496..436fbbdc4e4eb 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -52,6 +52,7 @@
@@ -125,7 +125,7 @@ index c0d3fc6c6ad03..7e64fd1346863 100644
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -1346,6 +1347,11 @@ void ContentMainRunnerImpl::Shutdown() {
@@ -1351,6 +1352,11 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}

View File

@@ -147,10 +147,10 @@ index a274b3e364084..3d995cf643399 100644
// on the given `command_line`. For non-browser processes, allocates crash keys
// from the switch value set by AppendStringAnnotationsCommandLineSwitch().
diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc
index 3f3ed53d48fc4..05bbc81db0c6a 100644
index 0e9fe8892af82..7c1ce4b94fba5 100644
--- components/crash/core/app/crash_reporter_client.cc
+++ components/crash/core/app/crash_reporter_client.cc
@@ -89,7 +89,7 @@ bool CrashReporterClient::GetShouldDumpLargerDumps() {
@@ -93,7 +93,7 @@ bool CrashReporterClient::GetShouldDumpLargerDumps() {
}
#endif
@@ -159,7 +159,7 @@ index 3f3ed53d48fc4..05bbc81db0c6a 100644
void CrashReporterClient::GetProductNameAndVersion(const char** product_name,
const char** version) {
}
@@ -98,6 +98,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
@@ -102,6 +102,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
std::string* version,
std::string* channel) {}
@@ -167,7 +167,7 @@ index 3f3ed53d48fc4..05bbc81db0c6a 100644
base::FilePath CrashReporterClient::GetReporterLogFilename() {
return base::FilePath();
}
@@ -107,6 +108,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename,
@@ -111,6 +112,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename,
return false;
}
#endif
@@ -175,7 +175,7 @@ index 3f3ed53d48fc4..05bbc81db0c6a 100644
#if BUILDFLAG(IS_WIN)
bool CrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) {
@@ -141,6 +143,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
@@ -145,6 +147,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
return false;
}
@@ -204,7 +204,7 @@ index 3f3ed53d48fc4..05bbc81db0c6a 100644
#if BUILDFLAG(IS_ANDROID)
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
@@ -197,9 +221,4 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
@@ -205,9 +229,4 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
return false;
}

View File

@@ -146,7 +146,7 @@ index 39b2de869d225..5a4e621c650ee 100644
struct Data;
diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn
index a2d6f7fb482a7..a5b6ae04f897b 100644
index 104e8502908e2..45b0a92bb9d80 100644
--- third_party/crashpad/crashpad/handler/BUILD.gn
+++ third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,7 @@

View File

@@ -12,7 +12,7 @@ index 44a11ec90ec9b..4c35b35a97f28 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index cec2b9df48ca1..b8e250e7376a2 100644
index b1a8b7eaabaf4..89038f28c70c9 100644
--- BUILD.gn
+++ BUILD.gn
@@ -20,6 +20,7 @@ import("//build/config/sanitizers/sanitizers.gni")
@@ -23,7 +23,7 @@ index cec2b9df48ca1..b8e250e7376a2 100644
import("//chrome/enterprise_companion/buildflags.gni")
import("//components/enterprise/buildflags/buildflags.gni")
import("//components/nacl/features.gni")
@@ -279,6 +280,10 @@ group("gn_all") {
@@ -285,6 +286,10 @@ group("gn_all") {
deps += root_extra_deps
@@ -76,7 +76,7 @@ index 1da479dd5eebc..ff9c7e467997c 100644
- visual_studio_runtime_dirs = []
}
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index f98782561d861..6361483e28a18 100644
index 8e6a2401aab03..571951616dec1 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -6,6 +6,7 @@ import("//ash/ambient/resources/resources.gni")
@@ -87,17 +87,17 @@ index f98782561d861..6361483e28a18 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//components/compose/features.gni")
@@ -89,6 +90,10 @@ template("chrome_repack_percent") {
]
}
@@ -468,6 +469,10 @@ template("chrome_extra_paks") {
]
deps += [ "//extensions:extensions_resources" ]
}
+ if (enable_cef) {
+ sources += [ "$root_gen_dir/cef/cef_resources.pak" ]
+ deps += [ "//cef:cef_resources" ]
+ }
if (enable_extensions) {
sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
deps += [ "//extensions:extensions_browser_resources" ]
sources += [
"$root_gen_dir/chrome/extensions_resources.pak",
diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni
index e8f61e2fbf6f2..5de226ad5a8f2 100644
--- chrome/chrome_repack_locales.gni

View File

@@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec
index 307e222ab9ce9..5862a098c118c 100644
index ee2a113e2b778..f6f267829da4e 100644
--- tools/gritsettings/resource_ids.spec
+++ tools/gritsettings/resource_ids.spec
@@ -1350,6 +1350,15 @@
@@ -1358,6 +1358,15 @@
# END "everything else" section.
# Everything but chrome/, components/, content/, and ios/

View File

@@ -93,10 +93,10 @@ index 9d108fe375fa6..49f7694355c9a 100644
static bool kIsForcedHighContrast =
base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git ui/native_theme/native_theme.h ui/native_theme/native_theme.h
index 9caf18c2106c7..e3ede1b32a010 100644
index 0ba23d2d8ea58..2934cfd37db91 100644
--- ui/native_theme/native_theme.h
+++ ui/native_theme/native_theme.h
@@ -604,6 +604,9 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -608,6 +608,9 @@ class NATIVE_THEME_EXPORT NativeTheme {
// Whether dark mode is forced via command-line flag.
static bool IsForcedDarkMode();
@@ -107,7 +107,7 @@ index 9caf18c2106c7..e3ede1b32a010 100644
explicit NativeTheme(
bool should_only_use_dark_colors,
diff --git ui/native_theme/native_theme_mac.mm ui/native_theme/native_theme_mac.mm
index a2dbe84d61e09..aff4aad15e069 100644
index 23491b97bb068..4aa1ecef92f5f 100644
--- ui/native_theme/native_theme_mac.mm
+++ ui/native_theme/native_theme_mac.mm
@@ -586,11 +586,15 @@ void NativeThemeMac::PaintSelectedMenuItem(

View File

@@ -1,8 +1,8 @@
diff --git ui/accessibility/platform/BUILD.gn ui/accessibility/platform/BUILD.gn
index ad1807ebfa054..e52ed1d6e0ed9 100644
index 2e24201fcdc1e..e93e1ef6458e2 100644
--- ui/accessibility/platform/BUILD.gn
+++ ui/accessibility/platform/BUILD.gn
@@ -291,6 +291,10 @@ component("platform") {
@@ -341,6 +341,10 @@ component("platform") {
if (use_gio) {
configs += [ "//build/linux:gio_config" ]
}

View File

@@ -1,5 +1,5 @@
diff --git ui/gtk/gtk_ui.cc ui/gtk/gtk_ui.cc
index 3ad76e316d4dc..4719a64ded116 100644
index d215ab072131d..3405641a7f5b2 100644
--- ui/gtk/gtk_ui.cc
+++ ui/gtk/gtk_ui.cc
@@ -31,6 +31,7 @@

View File

@@ -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 cbc806f09f40c..b70fc0ec47dfb 100644
index 06d73cdced8d9..727424e433cf4 100644
--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc
+++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -1108,8 +1108,8 @@ int ProfileMenuViewBase::GetMaxHeight() const {
@@ -1088,8 +1088,8 @@ int ProfileMenuViewBase::GetMaxHeight() const {
->GetDisplayNearestPoint(anchor_rect.CenterPoint())
.work_area();
int available_space = screen_space.bottom() - anchor_rect.bottom();

View File

@@ -1,5 +1,5 @@
diff --git content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 4a476b69cf6b7..6f81f48aeb502 100644
index 89b5fb70f4efd..ac121fc96d136 100644
--- content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -171,6 +171,13 @@ void ExtractUnderlines(NSAttributedString* string,

View File

@@ -43,7 +43,7 @@ index c4f8862b21ccf..c8c80509abc91 100644
current_->RemoveDestructionObserver(destruction_observer);
}
diff --git base/task/current_thread.h base/task/current_thread.h
index 66382e91c78b2..5129e284acaa1 100644
index 0be6acd709e53..cdadebb201547 100644
--- base/task/current_thread.h
+++ base/task/current_thread.h
@@ -163,6 +163,12 @@ class BASE_EXPORT CurrentThread {
@@ -59,7 +59,7 @@ index 66382e91c78b2..5129e284acaa1 100644
// Enables nested task processing in scope of an upcoming native message loop.
// Some unwanted message loops may occur when using common controls or printer
// functions. Hence, nested task processing is disabled by default to avoid
@@ -232,6 +238,13 @@ class BASE_EXPORT CurrentThread {
@@ -231,6 +237,13 @@ class BASE_EXPORT CurrentThread {
friend class web::WebTaskEnvironment;
raw_ptr<sequence_manager::internal::SequenceManagerImpl> current_;

View File

@@ -1,8 +1,8 @@
diff --git base/message_loop/message_pump_apple.mm base/message_loop/message_pump_apple.mm
index 987a3ed711f33..95e058b0b8bbd 100644
index 52ed68ac3150b..28c1c75bd3ada 100644
--- base/message_loop/message_pump_apple.mm
+++ base/message_loop/message_pump_apple.mm
@@ -762,7 +762,8 @@ void MessagePumpUIApplication::Detach() {
@@ -761,7 +761,8 @@ void MessagePumpUIApplication::Detach() {
#else
ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@@ -12,7 +12,7 @@ index 987a3ed711f33..95e058b0b8bbd 100644
DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask());
// Pumping events in private runloop modes is known to interact badly with
// app modal windows like NSAlert.
@@ -773,7 +774,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@@ -772,7 +773,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
}
ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() {

View File

@@ -10,10 +10,10 @@ index aeb79b46f5d21..bd57e874c1240 100644
+// This load will not send any cookies. For CEF usage.
+LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 20)
diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc
index dc8999337c27b..13ea40deba44f 100644
index 60a3db0490f57..2183142341991 100644
--- net/url_request/url_request_http_job.cc
+++ net/url_request/url_request_http_job.cc
@@ -2056,7 +2056,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const {
@@ -2074,7 +2074,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const {
// Read cookies whenever allow_credentials() is true, even if the PrivacyMode
// is being overridden by NetworkDelegate and will eventually block them, as
// blocked cookies still need to be logged in that case.
@@ -24,10 +24,10 @@ index dc8999337c27b..13ea40deba44f 100644
bool URLRequestHttpJob::ShouldRecordPartitionedCookieUsage() const {
diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc
index b220ca953b1db..c9057833fe15b 100644
index 28bf295032c89..e625f00f49603 100644
--- services/network/public/cpp/resource_request.cc
+++ services/network/public/cpp/resource_request.cc
@@ -329,7 +329,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
@@ -324,7 +324,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
}
bool ResourceRequest::SendsCookies() const {

View File

@@ -1,8 +1,8 @@
diff --git net/test/embedded_test_server/embedded_test_server.cc net/test/embedded_test_server/embedded_test_server.cc
index fcd55c845d90f..9ba1f2bcdf850 100644
index 0126378a5c6b8..8c9f9ae6db4b7 100644
--- net/test/embedded_test_server/embedded_test_server.cc
+++ net/test/embedded_test_server/embedded_test_server.cc
@@ -1046,7 +1046,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) {
@@ -1088,7 +1088,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) {
if (!base::CurrentThread::Get())
temporary_loop = std::make_unique<base::SingleThreadTaskExecutor>();
@@ -11,7 +11,7 @@ index fcd55c845d90f..9ba1f2bcdf850 100644
if (!io_thread_->task_runner()->PostTaskAndReply(
FROM_HERE, std::move(closure), run_loop.QuitClosure())) {
return false;
@@ -1073,7 +1073,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult(
@@ -1115,7 +1115,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult(
if (!base::CurrentThread::Get())
temporary_loop = std::make_unique<base::SingleThreadTaskExecutor>();

View File

@@ -30,7 +30,7 @@ index 76057b3e50f78..d3b63a3b07805 100644
} // namespace input
diff --git components/input/render_input_router.h components/input/render_input_router.h
index 4234f63f5a717..ded170d0c5945 100644
index 82f462173913b..05b4824ec8329 100644
--- components/input/render_input_router.h
+++ components/input/render_input_router.h
@@ -66,6 +66,7 @@ class COMPONENT_EXPORT(INPUT) RenderInputRouter
@@ -56,10 +56,10 @@ index f1030a744809c..c222a209949e6 100644
return nullptr;
}
diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc
index 4b7a2ab4833ce..bc3b1745875fd 100644
index 5754c2bd33053..25688e64d712d 100644
--- content/browser/renderer_host/render_widget_host_impl.cc
+++ content/browser/renderer_host/render_widget_host_impl.cc
@@ -3191,6 +3191,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount(
@@ -3216,6 +3216,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount(
}
}
@@ -72,10 +72,10 @@ index 4b7a2ab4833ce..bc3b1745875fd 100644
const WebInputEvent& event) {
if ((base::FeatureList::IsEnabled(
diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
index 2852c10fc0de6..4a09b95e1309c 100644
index 3d03709303e22..1d162642a2f8a 100644
--- content/browser/renderer_host/render_widget_host_impl.h
+++ content/browser/renderer_host/render_widget_host_impl.h
@@ -834,6 +834,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -835,6 +835,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void ProgressFlingIfNeeded(base::TimeTicks current_time);
void StopFling();

View File

@@ -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 2dcb41397b68e..fe76d4e98c5f6 100644
index f130879c92319..cf26aa2184e7a 100644
--- content/browser/renderer_host/render_view_host_impl.cc
+++ content/browser/renderer_host/render_view_host_impl.cc
@@ -735,6 +735,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const {
@@ -750,6 +750,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const {
}
void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {

View File

@@ -1,8 +1,8 @@
diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc
index c63a9c42f686a..b10a1a0444267 100644
index fe923601f3eee..321a85b51d215 100644
--- ui/base/resource/resource_bundle.cc
+++ ui/base/resource/resource_bundle.cc
@@ -931,6 +931,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate)
@@ -932,6 +932,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate)
: delegate_(delegate),
locale_resources_data_lock_(new base::Lock),
max_scale_factor_(k100Percent) {
@@ -15,7 +15,7 @@ index c63a9c42f686a..b10a1a0444267 100644
mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMangleLocalizedStrings);
}
@@ -940,6 +946,11 @@ ResourceBundle::~ResourceBundle() {
@@ -941,6 +947,11 @@ ResourceBundle::~ResourceBundle() {
UnloadLocaleResources();
}

View File

@@ -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 9c63417070d5a..2b60f10691a14 100644
index a0d5a983bb46a..e1c7fd08bc104 100644
--- content/browser/renderer_host/render_frame_host_impl.cc
+++ content/browser/renderer_host/render_frame_host_impl.cc
@@ -11181,6 +11181,7 @@ void RenderFrameHostImpl::CommitNavigation(
@@ -11407,6 +11407,7 @@ void RenderFrameHostImpl::CommitNavigation(
auto browser_calc_origin_to_commit =
navigation_request->GetOriginToCommitWithDebugInfo();
if (!process_lock.is_error_page() && !is_mhtml_subframe &&

View File

@@ -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 9e1bc80a3f131..88fae6a5664ff 100644
index 8d972bcdd27ee..1bacc1e05afb3 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 @@
@@ -18,7 +18,7 @@ index 9e1bc80a3f131..88fae6a5664ff 100644
#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"
@@ -758,10 +760,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
@@ -759,10 +761,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
CHECK(GetBackgroundColor());
@@ -35,7 +35,7 @@ index 9e1bc80a3f131..88fae6a5664ff 100644
}
#if BUILDFLAG(IS_WIN)
@@ -2394,6 +2398,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
@@ -2460,6 +2464,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
window_->layer()->SetColor(GetBackgroundColor() ? *GetBackgroundColor()
: SK_ColorWHITE);
UpdateFrameSinkIdRegistration();

View File

@@ -1,5 +1,5 @@
diff --git ui/display/screen.cc ui/display/screen.cc
index 3090a05e91f31..7fac1b23ffb62 100644
index 3090a05e91f31..d9667f9526278 100644
--- ui/display/screen.cc
+++ ui/display/screen.cc
@@ -108,13 +108,13 @@ base::TimeDelta Screen::CalculateIdleTime() const {
@@ -7,19 +7,19 @@ index 3090a05e91f31..7fac1b23ffb62 100644
const gfx::Rect& screen_rect) const {
float scale = GetDisplayNearestWindow(window).device_scale_factor();
- return ScaleToEnclosingRect(screen_rect, 1.0f / scale);
+ return ScaleToEnclosedRect(screen_rect, 1.0f / scale);
+ return ScaleToRoundedRect(screen_rect, 1.0f / scale);
}
gfx::Rect Screen::DIPToScreenRectInWindow(gfx::NativeWindow window,
const gfx::Rect& dip_rect) const {
float scale = GetDisplayNearestWindow(window).device_scale_factor();
- return ScaleToEnclosingRect(dip_rect, scale);
+ return ScaleToEnclosedRect(dip_rect, scale);
+ return ScaleToRoundedRect(dip_rect, scale);
}
bool Screen::GetDisplayWithDisplayId(int64_t display_id,
diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc
index db01034339fda..84cd0ee222ef0 100644
index db01034339fda..59bfd0e2f75c4 100644
--- ui/display/win/screen_win.cc
+++ ui/display/win/screen_win.cc
@@ -619,7 +619,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) {
@@ -27,7 +27,7 @@ index db01034339fda..84cd0ee222ef0 100644
const float scale_factor =
1.0f / screen_win_display.display().device_scale_factor();
- return {origin, ScaleToEnclosingRect(pixel_bounds, scale_factor).size()};
+ return {origin, ScaleToEnclosedRect(pixel_bounds, scale_factor).size()};
+ return {origin, ScaleToRoundedRect(pixel_bounds, scale_factor).size()};
}
// static
@@ -36,7 +36,7 @@ index db01034339fda..84cd0ee222ef0 100644
display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display);
const float scale_factor = screen_win_display.display().device_scale_factor();
- return {origin, ScaleToEnclosingRect(dip_bounds, scale_factor).size()};
+ return {origin, ScaleToEnclosedRect(dip_bounds, scale_factor).size()};
+ return {origin, ScaleToRoundedRect(dip_bounds, scale_factor).size()};
}
// static

View File

@@ -1,5 +1,5 @@
diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc
index 98b23597fb61c..e476a9a86af35 100644
index 6b19478013bf5..acc6f2dcb4472 100644
--- net/cookies/cookie_monster.cc
+++ net/cookies/cookie_monster.cc
@@ -635,6 +635,25 @@ void CookieMonster::SetCookieableSchemes(
@@ -80,7 +80,7 @@ index f78c6a467befc..97f1d21218eed 100644
void CookieManager::SetForceKeepSessionState() {
diff --git services/network/network_context.cc services/network/network_context.cc
index ec0d2386913d0..ea4e0e8b697dd 100644
index 502cd4ac8b0e8..4532f67ceca70 100644
--- services/network/network_context.cc
+++ services/network/network_context.cc
@@ -2578,16 +2578,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -112,7 +112,7 @@ index ec0d2386913d0..ea4e0e8b697dd 100644
base::FeatureList::IsEnabled(features::kFledgePst)) {
trust_token_store_ = std::make_unique<PendingTrustTokenStore>();
diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom
index 0678afc12458f..fa7763534dd89 100644
index b3775284f55c7..66f1b5279c7b7 100644
--- services/network/public/mojom/network_context.mojom
+++ services/network/public/mojom/network_context.mojom
@@ -359,6 +359,9 @@ struct NetworkContextParams {

View File

@@ -1,8 +1,8 @@
diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc
index fce39a2f52ddb..d91e8abd393b8 100644
index edbdcac55702f..ff1bb519e834a 100644
--- content/browser/storage_partition_impl.cc
+++ content/browser/storage_partition_impl.cc
@@ -3316,9 +3316,12 @@ void StoragePartitionImpl::InitNetworkContext() {
@@ -3346,9 +3346,12 @@ void StoragePartitionImpl::InitNetworkContext() {
cert_verifier::mojom::CertVerifierCreationParamsPtr
cert_verifier_creation_params =
cert_verifier::mojom::CertVerifierCreationParams::New();

View File

@@ -1,8 +1,8 @@
diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc
index 06e6939826e5d..9cb98d3e6a991 100644
index 73fdf31c0d277..e9abc3d664ca5 100644
--- ui/views/controls/webview/webview.cc
+++ ui/views/controls/webview/webview.cc
@@ -163,6 +163,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size,
@@ -170,6 +170,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size,
}
}
@@ -14,10 +14,10 @@ index 06e6939826e5d..9cb98d3e6a991 100644
if (crashed_overlay_view_.view() == crashed_overlay_view) {
return;
diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h
index e5f3852898c46..47191c63a67bd 100644
index de6fe5c099273..c34a2555b023d 100644
--- ui/views/controls/webview/webview.h
+++ ui/views/controls/webview/webview.h
@@ -105,6 +105,10 @@ class WEBVIEW_EXPORT WebView : public View,
@@ -107,6 +107,10 @@ class WEBVIEW_EXPORT WebView : public View,
void EnableSizingFromWebContents(const gfx::Size& min_size,
const gfx::Size& max_size);

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/ui/views/toolbar/app_menu.cc chrome/browser/ui/views/toolbar/app_menu.cc
index eb308bd6fdc13..9a6cce98e8cb8 100644
index 477159889efb0..b984eee1ec4d8 100644
--- chrome/browser/ui/views/toolbar/app_menu.cc
+++ chrome/browser/ui/views/toolbar/app_menu.cc
@@ -1026,7 +1026,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) {
@@ -1015,7 +1015,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 393dc941d9543..75618d210585a 100644
virtual void MenuWillShow() {}
diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc
index 1f7d99933c10a..85934d5fa95f4 100644
index c7d34b8b4e3d7..ce7a5c37e7b8a 100644
--- ui/gfx/render_text.cc
+++ ui/gfx/render_text.cc
@@ -719,6 +719,14 @@ void RenderText::SetWhitespaceElision(std::optional<bool> whitespace_elision) {
@@ -707,6 +707,14 @@ void RenderText::SetWhitespaceElision(std::optional<bool> whitespace_elision) {
}
}
@@ -76,7 +76,7 @@ index 1f7d99933c10a..85934d5fa95f4 100644
void RenderText::SetDisplayRect(const Rect& r) {
if (r != display_rect_) {
display_rect_ = r;
@@ -2157,6 +2165,18 @@ void RenderText::OnTextAttributeChanged() {
@@ -2145,6 +2153,18 @@ void RenderText::OnTextAttributeChanged() {
text_elided_ = false;
layout_text_up_to_date_ = false;
@@ -96,10 +96,10 @@ index 1f7d99933c10a..85934d5fa95f4 100644
}
diff --git ui/gfx/render_text.h ui/gfx/render_text.h
index cde3a89d52319..8b5cf3bd8a535 100644
index ad2fb8c1a6078..d14890b136855 100644
--- ui/gfx/render_text.h
+++ ui/gfx/render_text.h
@@ -366,6 +366,10 @@ class GFX_EXPORT RenderText {
@@ -360,6 +360,10 @@ class GFX_EXPORT RenderText {
void SetWhitespaceElision(std::optional<bool> elide_whitespace);
std::optional<bool> whitespace_elision() const { return whitespace_elision_; }
@@ -110,7 +110,7 @@ index cde3a89d52319..8b5cf3bd8a535 100644
const Rect& display_rect() const { return display_rect_; }
void SetDisplayRect(const Rect& r);
@@ -1110,6 +1114,8 @@ class GFX_EXPORT RenderText {
@@ -1107,6 +1111,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;
@@ -164,7 +164,7 @@ index 414087e088a4e..0d757f5e7933e 100644
LabelButtonImageContainer* image_container() {
return image_container_.get();
diff --git ui/views/controls/label.cc ui/views/controls/label.cc
index 288c81c28e14a..b70645e978007 100644
index cd330fd0a56e1..f2a54c5c47068 100644
--- ui/views/controls/label.cc
+++ ui/views/controls/label.cc
@@ -51,12 +51,29 @@ enum LabelPropertyKey {
@@ -197,7 +197,7 @@ index 288c81c28e14a..b70645e978007 100644
} // namespace
namespace views {
@@ -493,6 +510,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
@@ -496,6 +513,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged);
}
@@ -213,7 +213,7 @@ index 288c81c28e14a..b70645e978007 100644
std::u16string Label::GetTooltipText() const {
return tooltip_text_;
}
@@ -803,6 +829,16 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText() const {
@@ -815,6 +841,16 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText() const {
render_text->SelectRange(stored_selection_range_);
}
@@ -231,7 +231,7 @@ index 288c81c28e14a..b70645e978007 100644
}
diff --git ui/views/controls/label.h ui/views/controls/label.h
index 6d416cb05c5b0..3c695c36f5027 100644
index bc315ed47b197..2c0f4deafb3c1 100644
--- ui/views/controls/label.h
+++ ui/views/controls/label.h
@@ -245,6 +245,10 @@ class VIEWS_EXPORT Label : public View,
@@ -245,7 +245,7 @@ index 6d416cb05c5b0..3c695c36f5027 100644
// Gets/Sets the tooltip text. Default behavior for a label (single-line) is
// to show the full text if it is wider than its bounds. Calling this
// overrides the default behavior and lets you set a custom tooltip. To
@@ -526,6 +530,7 @@ class VIEWS_EXPORT Label : public View,
@@ -530,6 +534,7 @@ class VIEWS_EXPORT Label : public View,
int max_width_ = 0;
// This is used in single-line mode.
int max_width_single_line_ = 0;
@@ -254,7 +254,7 @@ index 6d416cb05c5b0..3c695c36f5027 100644
std::unique_ptr<SelectionController> selection_controller_;
diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc
index 8e361bf829513..8f0e72c3e5559 100644
index 4b753ff618598..ddb2506be9695 100644
--- ui/views/controls/menu/menu_controller.cc
+++ ui/views/controls/menu/menu_controller.cc
@@ -578,7 +578,8 @@ void MenuController::Run(Widget* parent,
@@ -275,7 +275,7 @@ index 8e361bf829513..8f0e72c3e5559 100644
// Only create a MenuPreTargetHandler for non-nested menus. Nested menus
// will use the existing one.
@@ -2257,6 +2259,7 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
@@ -2263,6 +2265,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;
@@ -283,7 +283,7 @@ index 8e361bf829513..8f0e72c3e5559 100644
if (item->GetParentMenuItem()) {
params.context = item->GetWidget();
// (crbug.com/1414232) The item to be open is a submenu. Make sure
@@ -2948,8 +2951,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem(
@@ -2954,8 +2957,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem(
void MenuController::OpenSubmenuChangeSelectionIfCan() {
MenuItemView* item = pending_state_.item;
@@ -298,7 +298,7 @@ index 8e361bf829513..8f0e72c3e5559 100644
// Show the sub-menu.
SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
@@ -2969,8 +2977,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
@@ -2975,8 +2983,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() {
void MenuController::CloseSubmenu() {
MenuItemView* item = state_.item;
DCHECK(item);
@@ -410,10 +410,10 @@ index fc1d5fccc3845..c065cafcd537c 100644
explicit MenuHost(SubmenuView* submenu);
diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc
index ebbb2caaa89d9..1ac77741d6ebb 100644
index 81fabd16b2ce3..90f1ec4fcaaec 100644
--- ui/views/controls/menu/menu_item_view.cc
+++ ui/views/controls/menu/menu_item_view.cc
@@ -1114,6 +1114,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas,
@@ -1102,6 +1102,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);
@@ -429,7 +429,7 @@ index ebbb2caaa89d9..1ac77741d6ebb 100644
} else if (paint_as_selected) {
gfx::Rect item_bounds = GetLocalBounds();
if (type_ == Type::kActionableSubMenu) {
@@ -1178,6 +1187,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) {
@@ -1166,6 +1175,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) {
}
SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const {
@@ -749,10 +749,10 @@ index e171461e28836..e137275a22a12 100644
std::optional<std::string> 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 76f58311587d3..850a8d2c9197c 100644
index 37135f8ef2d73..459a3c2e60062 100644
--- ui/views/controls/menu/menu_scroll_view_container.cc
+++ ui/views/controls/menu/menu_scroll_view_container.cc
@@ -253,6 +253,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view)
@@ -254,6 +254,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view)
scroll_down_button_ = background_view_->AddChildView(
std::make_unique<MenuScrollButton>(content_view, false));
@@ -789,7 +789,7 @@ index dcf4b60ad92c2..64fa80edefc1b 100644
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
if (root_location != root_current_location &&
diff --git ui/views/view.h ui/views/view.h
index 3f138a3a7acc5..64efaf93a0cc2 100644
index 4ce922b20a9d1..2505558b6428c 100644
--- ui/views/view.h
+++ ui/views/view.h
@@ -25,6 +25,7 @@
@@ -810,3 +810,12 @@ index 3f138a3a7acc5..64efaf93a0cc2 100644
// Do not remove this macro!
// The macro is maintained by the memory safety team.
ADVANCED_MEMORY_SAFETY_CHECKS();
@@ -609,7 +611,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Return the preferred height for a specific width. It is a helper function
// of GetPreferredSize(SizeBounds(w, SizeBound())).height().
- int GetHeightForWidth(int w) const;
+ virtual int GetHeightForWidth(int w) const;
// Returns a bound on the available space for a child view, for example, in
// case the child view wants to play an animation that would cause it to

Some files were not shown because too many files have changed in this diff Show More