Commit Graph

955 Commits

Author SHA1 Message Date
Nik Pavlov edef01f579 Fix devtools_util_unittest.cc failures 2022-04-19 16:17:16 +00:00
Marshall Greenblatt b1cd9d1598 win/linux: Use CursorLoader for loading cursor resources (see issue #3270)
Switch to using aura::CursorLoader which knows how to load system, non-system
and pak cursor resources.

On Windows, cursors will be loaded via LoadCursor first if available with a
fallback to pak file if necessary (like with component builds).

On Linux, all non-system cursor resources will be loaded from pak file. Cursors
may be loaded asynchronously resulting in the default (pointer) cursor being
returned on the first request.
2022-04-14 20:21:21 -04:00
Joshua Marler d6b2b4b144 views: Fix ConvertPointFromPixel for fractional scaling (fixes issue #3312) 2022-04-14 22:30:32 +00:00
Marshall Greenblatt cbf66a8077 views: Fix crash when clicking a draggable region (fixes issue #3311) 2022-04-14 15:12:23 -04:00
Marshall Greenblatt fc82de7aa7 alloy: win: Fix range check for system cursors (fixes issue #3270) 2022-04-14 14:06:58 -04:00
Marshall Greenblatt 111b6de46c Fix cursor change notification for OOP iframes (fixes issue #3308) 2022-04-13 20:31:27 -04:00
Marshall Greenblatt d8db6fa9da mac: cefclient: Use RootWindowManager to track key window status (fixes issue #3307)
This change provides a generic solution for active (key) window tracking that
works with both Views-hosted and native windows on MacOS. With this new approach
we can now successfully route top menu actions to the currently active window.

Prior to this change CEF's Views API was using focus notifications as a proxy
for window activation notifications. That doesn't work on MacOS where NSWindow
activation (key status) is independent of NSView focus (first responder) status,
and changes in activation don't necessarily generate focus notifications (see
NativeWidgetMac::OnWindowKeyStatusChanged). To make this work reliably on all
platforms we now expose a CefWindowDelegate::OnWindowActivationChanged callback.

This change also fixes an uninitialized variable
(RootWindowMacImpl::with_extension_) that was causing flaky behavior in
RootWindowManager::OnRootWindowActivated.

To test:
1. Run `cefclient [--use-views]`
2. Select Popup Window from the Tests menu. Do not explicitly activate the popup
   window (e.g. don't click on it).
3. Verify that further Tests menu actions go to the popup window.
4. Change activation to a first window by clicking on it. Verify that Test
   menu actions go to that window.
5. Close the currently active window. Do not explicitly activate the remaining
   window (e.g. don't click on it).
6. Verify that Test menu actions go to the only remaining window.
2022-04-12 16:37:01 -04:00
Nik Pavlov 493232ce5a alloy: mac: Fix default popup window positioning (see issue #3244)
Popup windows will be created on the display that best matches the requested
coordinates. The requested size will apply to the content area (as required by
JS documentation) and window size will be reduced if necessary to fit within the
target display. The requested origin will apply to the window (including frame)
and will be modified if necessary so that the window is fully visible on the
target display.
2022-04-12 17:12:16 +00:00
Marshall Greenblatt 17cb26b8b9 Remove compile-time checks for toolkit_views
The toolkit_views=true setting is supported (and now required) on all platforms.
2022-04-12 12:06:53 -04:00
Marshall Greenblatt a0a7a35fe2 chrome: Change popup default behavior with native parent (see issue #3294)
When using a Views-hosted browser window the client receives Views-related
callbacks for popups and can thereby customize the Views-hosted popup behavior.
When using an external parent window no Views-related callbacks are delivered
and customization options are restricted to providing a new parent handle via
OnBeforePopup. Consequently, we should default to a normal browser window in
the external parent case instead of the very minimial Views-hosted default.

To test (A):
1. Run `cefclient --use-default-popup --enable-chrome-runtime --use-native`
2. Select Tests > Popup Window
3. Get a normal Chrome browser window

To test (B):
1. Run `cefclient --use-default-popup [--enable-chrome-runtime] [--use-views]`
2. Select Tests > Popup Window
3. Get a native or Views-hosted browser window with title bar only
2022-04-12 12:06:52 -04:00
Marshall Greenblatt 75ca552a4e cefclient: Add option to create default popups (see issue #3165, see issue #3294)
This change adds a `--use-default-popup` command-line option to cefclient. When
specified, popup windows will be created with default styling (e.g. without an
application-provided native parent window).

This change also adds some reasonable default window bounds in cases where they
are not specified by the client.
2022-04-12 11:49:27 -04:00
Marshall Greenblatt 3000bc8748 chrome: win/linux: Add support for browser with native parent (see issue #3294)
This change adds Chrome runtime support on Windows and Linux for creating a
browser parented to a native window supplied by the client application.
Expected API usage and window behavior is similar to what already exists with
the Alloy runtime. The parent window handle should be specified by using
CefWindowInfo::SetAsChild in combination with the CefBrowserHost::CreateBrowser
and CefLifeSpanHandler::OnBeforePopup callbacks.

The previously existing behavior of creating a fully-featured Chrome browser
window when empty CefWindowInfo is used with CreateBrowser remains unchanged
and Views is still the preferred API for creating top-level Chrome windows
with custom styling (e.g. title bar only, frameless, etc).

The cefclient Popup Window test with a native parent window continues to crash
on Linux with both the Alloy and Chrome runtimes (see issue #3165).

Also adds Chrome runtime support for CefDisplayHandler::OnCursorChange.

To test:
- Run `cefclient --enable-chrome-runtime [--use-views]` for the default (and
  previously existing) Views-based behavior.
- Run `cefclient --enable-chrome-runtime --use-native` for the new native
  parent window behavior.
- Run `cefclient --enable-chrome-runtime --use-native --no-activate` and the
  window will not be activated (take input focus) on launch (Windows only).
- Run `cefclient --enable-chrome-runtime [--use-views|--use-native]
  --mouse-cursor-change-disabled` and the mouse cursor will not change on
  mouseover of DOM elements.
2022-04-12 11:49:26 -04:00
Marshall Greenblatt 5f4bccd672 Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
2022-04-11 13:11:08 -04:00
Marshall Greenblatt 21cf732e7f chrome: Update expectations with same-site BFCache enabled (fixes issue #3301)
With same-site BFCache enabled every navigation can now potentially be served
via the BFCache. To support this internally a new top-level RenderFrame object
may be created for each new navigation. As a result, OnBrowserCreated may now
be called multiple times with the same browser ID in a given renderer process
(a behavior previously only seen with cross-site navigations and different
renderer processes).

BFCache navigations do not trigger the same Chromium notifications as a normal
load. To avoid breaking CEF API usage expectations we now synthetically
generate the load-related callbacks that would otherwise be missing
(OnLoadingStateChange with isLoading=true, OnLoadStart, OnLoadEnd). The
|httpStatusCode| argument to OnLoadEnd will be 0 in this case.

To test:
- Run `FrameHandlerTest.*:MessageRouterTest.*:NavigationTest.*`
- Run `NavigationTest.LoadSameOriginLoadURL` for OnBrowserCreated behavior.
- Run `NavigationTest.History` for load-related callback behavior.
2022-04-05 15:30:30 -04:00
Marshall Greenblatt b524edc209 Update to Chromium version 101.0.4951.0 (#982481)
Known issues:
- chrome: Some ceftests are failing due to bfcache same-site enabled by default
  (see issue #3301)
2022-03-30 19:54:09 -04:00
Marshall Greenblatt 77466e7b6d alloy: Use chrome's value for ApplicationClientIdForFileScanning (fixes issue #3030)
This change removes CefSettings.application_client_id_for_file_scanning in
favor of always using the same hard-coded value as chrome.
2022-03-24 12:16:11 -04:00
Marshall Greenblatt e43d2054d1 Increase priority of the EndTracing task (fixes issue #3288)
Use a priority that is guaranteed to execute in a reasonable amount of time.
2022-03-23 17:31:09 -04:00
Marshall Greenblatt 9d52d72ae5 chrome: Add support for persist_session_cookies (fixes issue #3291)
This change configures session restore behavior for the NEXT application
restart by setting the "session.restore_on_startup" preference based on the
[CefSettings|CefRequestContextSettings].persist_session_cookies value.
2022-03-22 20:49:20 -04:00
Marshall Greenblatt 6d7a680187 Add permission callback for user-initated downloads (fixes issue #3183)
This change adds a CefDownloadHandler::CanDownload callback for optionally
blocking user-initiated downloads (e.g. alt + link click or link click that
returns a `Content-Disposition: attachment` response from the server).

To test:
- Run `ceftests --gtest_filter=DownloadTest.*`.
- Run `cefclient --hide-controls`. User-initiated downloads will be blocked.
2022-03-22 17:46:44 -04:00
Marshall Greenblatt 2f5838eaaa chrome: Add ability to handle chrome menu/keyboard commands (fixes issue #3280)
This change adds a CefCommandHandler::OnChromeCommand callback for optionally
handling Chrome commands triggered via menus or keyboard shortcuts. Supported
command IDs are listed in a new cef_command_ids.h header file.

To test: Run `cefclient --enable-chrome-runtime --hide-controls`. Most commands
will blocked and removed from context menus.
2022-03-22 15:11:47 -04:00
Marshall Greenblatt 4615fffafb chrome: Add setting for controlling the status bubble (fixes isse #3279)
This change adds `CefBrowserSettings.chrome_status_bubble` for controlling
whether the Chrome status bubble will be used.

Testable in cefclient by passing the `--hide-chrome-status-bubble`
command-line flag.
2022-03-21 17:25:40 -04:00
Marshall Greenblatt c38d62b233 Linux: Migrate from breakpad to crashpad (see issue #3249)
Renderer process crashes are currently only reported with `--no-sandbox`.
2022-03-17 15:34:49 -04:00
Marshall Greenblatt 8fc6aced6c Fix DevTools crash due to unknown .md mime type (fixes issue #3278) 2022-03-15 13:06:58 -04:00
Marshall Greenblatt a513e01b01 Fix shutdown crash in RenderProcessHostImpl::Cleanup (fixes issue #3276)
Execute all pending UI thread tasks at the beginning of the shutdown sequence.
2022-03-09 13:59:07 -05:00
Marshall Greenblatt 113a96be0d alloy: Fix PDF download 'With your changes' (fixes issue #3169) 2022-03-04 13:56:30 -05:00
Marshall Greenblatt 705b6ec15c alloy: Fix print preview Save as PDF (fixes issue #2867) 2022-03-04 13:15:20 -05:00
Cristian Amarie 7945baf640 alloy: Fix crash when downloading a modified PDF form (see issue #3169)
Create a CefFileSystemDelegate based on the ShellFileSystemDelegate placeholder
implementation. An actual implementation will still be required to properly
support this download functionality.
2022-03-02 15:16:09 -05:00
Marshall Greenblatt f97f0bbda6 Update to Chromium version 100.0.4896.0 (#972766) 2022-02-22 19:22:39 -05:00
Marshall Greenblatt 28c7f04001 Delete cef_web_plugin.h and plugin-related APIs (see issue #3047)
This functionality stopped being relevant after the removal of Flash support
in January 2021. The last remaining PPAPI plugin (PDF viewer) will switch to
a non-plugin implementation (PdfUnseasoned) in M100.
2022-02-18 16:23:11 -05:00
Marshall Greenblatt dc0a45d429 alloy: Fix printing of PDF viewer (see issue #3047)
Match the logic for printing::StartPrint() used by Chrome.
2022-02-18 11:37:27 -05:00
Marshall Greenblatt 171d525aa4 alloy: Implement Find() using find_in_page::FindTabHelper (fixes issue #3098, see issue #3047)
The find behavior should now match Chrome.
2022-02-17 13:59:25 -05:00
Marshall Greenblatt d43c3091b2 Revert "chrome: Simplify WebUIControllerFactory registration (see issue #3047)"
Still need to unregister the Content-level factory to stop Alloy loading
unsupported pages.

This reverts commit a21d0c41a4.
2022-02-16 18:28:08 -05:00
Marshall Greenblatt 32ebbd60f9 chrome: Simplify WebUIControllerFactory registration (see issue #3047)
Disable the initial Chrome factory registration in ChromeBrowserMainParts
instead of trying to unregister those factories at a later point.
2022-02-16 18:11:45 -05:00
Marshall Greenblatt efc0a67e00 alloy: Add support for chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:28 -05:00
Marshall Greenblatt 71727464b8 Add support for the chrome-untrusted scheme (see issue #3047)
Lack of this functionality was causing print preview to fail with
PdfUnseasoned enabled.
2022-02-16 17:48:20 -05:00
Marshall Greenblatt 3d1bbaf54f Support reconnect of the mojo frame channel (fixes issue #3260)
The mojo channel used for frame communication may disconnect for a variety of
reasons including frame navigation, frame destruction, or insertion into the
BackForwardCache (when the browser-side frame representation is destroyed and
closes the connection). When disconnect occurs we now evaluate the situation
and reconnect if appropriate.

Connections are now initiated solely from the renderer process and the
RenderFrame is passed as an argument to FrameAttached() instead of being
retrieved independently. Messages are queued while the frame is disconnected
and sent only after FrameAttachedAck() is received from the browser process.
The renderer process will be crashed intentionally with a "connection retry
failure" message if the reconnect fails 3 times in a row.
2022-02-14 20:31:04 -05:00
Marshall Greenblatt 4adc23a52a alloy: Fix extension function registration for print preview dialog (fixes issue #3167) 2022-02-02 15:24:14 -05:00
Marshall Greenblatt 9eb0954cde alloy: Move ExtensionsBrowserClient ownership to BrowserProcess (fixes issue #3247)
Fixes a shutdown crash due to `ExtensionsBrowserClient::Set(nullptr)` being
called too early. Some code that may occasionally be triggered via
`content::ContentMainShutdown()` is expecting the extensions objects to still
be valid.

This new ownership pattern matches the code in chrome/.
2022-02-02 12:40:31 -05:00
Marshall Greenblatt 303280dd71 alloy: Fix shutdown assert if OneShotTimer is deleted on the wrong thread 2022-01-26 21:10:29 -05:00
Marshall Greenblatt 1e1133ec66 Update to Chromium version 99.0.4844.0 (#961656) 2022-01-26 21:10:29 -05:00
Marshall Greenblatt c32f366dfa Migrate ignore_result to std::ignore (see issue #3234)
See https://crbug.com/1285085 for background.
2022-01-25 14:40:53 -05:00
Marshall Greenblatt ebde595370 Convert defined(OS_XXX) to BUILDFLAG(IS_XXX) in libcef
See https://crbug.com/1234043 for background.
2022-01-24 12:58:04 -05:00
Marshall Greenblatt 51e8bd9bd8 chrome: Fix crash when clicking Reading List sidebar link (fixes issue #3128) 2022-01-14 13:52:56 -05:00
Nick Mueller 029cc67915 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 12:04:38 -05:00
Marshall Greenblatt 17d51ceed0 Revert "Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240)"
This reverts commit 9e416a7921.

Reverted due to compile error.
2022-01-14 12:04:06 -05:00
Nick Mueller 9e416a7921 Fix OSR resize issue when multiple monitors have different scale factors (fixes issue #3240) 2022-01-14 16:50:23 +00:00
Marshall Greenblatt 2428b35f6c alloy: Disable bfcache (see issue #3237)
This will be reverted if the bfcache issue is fixed.
2022-01-10 17:32:22 -05:00
Marshall Greenblatt ff0e5c0348 Fix possible use after shutdown of BrowserContext (fixes issue #3193) 2022-01-10 17:21:07 -05:00
Marshall Greenblatt 839fdb211c Fix certificate errors with restarted/redirected requests (fixes issue #3200)
URLLoaderNetworkServiceObserver is used for routing certificate and
authentication callbacks from the NetworkService to the associated
StoragePartition instance. With request interception enabled this object was
previously only assigned for the initial request. This change adds assignment
for restarted/redirected requests as well.
2022-01-06 20:53:00 -05:00
Marshall Greenblatt dfc0131516 Update to Chromium version 98.0.4758.0 (#950365) 2021-12-18 15:57:34 -05:00