Commit Graph

1075 Commits

Author SHA1 Message Date
Marshall Greenblatt b7543e4217 cefclient: Fix accidental usage of C++20 map::contains (see #3611) 2024-11-18 10:52:02 -05:00
Marshall Greenblatt e0817536a5 tests: Fix flaky FrameHandlerTest.Order* tests (fixes #3817)
The OnFrameAttached callback relies on a round-trip to the
renderer process and may not be synchronized with OnLoadStart/
OnLoadEnd/OnMainFrameChanged callbacks.
2024-11-13 16:25:07 -05:00
Marshall Greenblatt 1a99a3abc5 Add notification for aborted popups (fixes #3776)
Pass a new |popup_id| parameter to OnBeforePopup and call a new
OnBeforePopupAborted callback if the popup is aborted before
OnAfterCreated is called for the popup browser. Add new
CefBrowserHost::GetBrowserByIdentifier and GetOpenerIdentifier
methods to assist with retrieval of associated browsers.

In cefclient, clean up state when a popup is aborted and close
any associated popup browsers when the opener browser is closed.
This also works when running with `--use-default-popup`.
2024-11-13 16:24:44 -05:00
Marshall Greenblatt b91be9fcc9 views: Fix Chrome style browser RequestFocus behavior (fixes #3819)
Fix implementation of CefBrowserView::RequestFocus for Chrome style
browsers. Match Alloy style behavior of requesting browser focus
(calling OnSetFocus) after initial navigation. Add CefView::HasFocus
and CefWindow::GetFocusedView that can be used in combination with
CefWindow::IsActive to determine global keyboard focus.

Update sample applications for the new behavior.

In cefclient:
- Browser receives initial focus via ViewsWindow::RequestBrowserFocus.
- When running with `--show-overlay-browser` (see #3790):
  - Give initial focus to the overlay browser.
  - Change the overlay popout shortcut to CTRL+SHIFT+O to avoid
    assigning focus to the menu in the main window.
  - Switching from overlay in the main window to popout browser
    window will give focus to the popout browser.
  - Switching from popout browser to overlay will leave current focus
    unchanged (e.g. in the overlay browser, or somewhere else). User
    gesture to activate the main window may be required on Mac/Linux.
- When running with `--no-active` don't give initial focus to either
  browser.

In cefsimple:
- Browser receives initial focus via default handling.
2024-11-07 11:11:36 -05:00
Marshall Greenblatt e23264eedc 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:17:43 -05:00
Marshall Greenblatt 030272fe4c mac: cefclient: Fix window.close() with --hide-window-on-close (fixes #3660) 2024-10-22 16:17:54 -04:00
Marshall Greenblatt da7e19d0ea 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-17 12:21:07 -04:00
Marshall Greenblatt 6e05c14db2 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-17 11:06:08 -04:00
Marshall Greenblatt 6036df047f views: cefclient: Fix crash when ID_MENU_BUTTON doesn't exist 2024-10-15 17:53:39 -04:00
Marshall Greenblatt 884b582789 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-15 15:44:13 -04:00
Marshall Greenblatt 1bc1ca15d5 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-15 14:30:26 -04:00
Nik Pavlov 745a4d6e3b 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-15 18:01:11 +00:00
Marshall Greenblatt a231b7ead7 cefclient: Fix toolbar visibility with --hide-controls (fixes #3745) 2024-10-04 09:57:45 -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
Nik Pavlov 8c6f8dd404 Add missing <array> header to performance_test_tests.cc 2024-09-02 14:06:21 +00:00
Nik Pavlov af1f40a2d3 Update to Chromium version 129.0.6668.0
- Mac: Minimum system version is now 11.0.
- Win: Windows SDK version is now 10.0.22621.2428.
2024-08-26 12:44:25 +00:00
Nik Pavlov 2cd405baac Fix handler insertion in CefMessageRouterBrowserSideImpl (fixes #3586) 2024-08-13 18:30:35 +00:00
Marshall Greenblatt 64a2f681aa cefclient: mac: Fix "undefined symbol" link error (see #3499) 2024-08-07 11:34:05 -04:00
Marshall Greenblatt 166eec85e0 cefclient: Fix invalid cast to ClientHandlerStd (see #3499) 2024-08-05 18:48:30 -04:00
Pedro de Carvalho Gomes b61c106b6b linux: Add CefWindowDelegate::GetLinuxWindowProperties (fixes #3383) 2024-08-05 12:36:28 -04:00
Nik Pavlov 295ea1f715 Enable V8 sandbox by default (fixes #3332)
When the V8 sandbox is enabled, ArrayBuffer backing stores must be
allocated inside the sandbox address space. This change introduces a new
CefV8Value::CreateArrayBufferWithCopy method that copies the memory
contents into the sandbox address space.

Enabling the V8 sandbox can have a performance impact, especially when
passing large ArrayBuffers from C++ code to the JS side. We have therefore
retained the old CefV8Value::CreateArrayBuffer method that references
external memory. However, this method can only be used if the V8 sandbox is
disabled at CEF/Chromium build time.

To disable the V8 sandbox add `v8_enable_sandbox=false` to
`GN_DEFINES` when building CEF/Chromium.
2024-08-05 16:00:58 +00:00
Marshall Greenblatt 446b7d6535 Update to Chromium version 128.0.6613.0 (#1331488) 2024-07-30 11:10:09 -04:00
Marshall Greenblatt a6c00b2ff6 bazel: Add initial config for binary distribution (see #3757)
Add support for building the CEF binary distribution using Bazel
and the default platform toolchain. Tested to work for Windows
x64, MacOS ARM64 and x64 (cross-compile from ARM64), and
Linux x64. Windows x86 (cross-compile from x64) is known to
be broken, see https://github.com/bazelbuild/bazel/issues/22164.

Includes minor changes to tests directory structure to meet
Bazel build requirements.
2024-07-28 18:19:47 +00:00
Marshall Greenblatt 69b884d39c Add CefTaskManager::GetTaskIdForBrowserId
Update https://tests/task_manager to show the current browser's
renderer task in bold.


Approved-by: Nik Pavlov
2024-07-19 15:19:06 +00:00
Nik Pavlov d470cf8204 Add CefTaskManager API
See https://tests/task_manager example in cefclient.
2024-07-18 11:34:41 -04:00
Marshall Greenblatt cbbca050e0 cefclient: Allow download with --hide-controls (fixes #3742) 2024-07-17 15:06:23 -04:00
Marshall Greenblatt 8f4a47479c mac: cefclient: Fix zombie NSWindow object on exit (fixes #3602)
- Don't create a TempWindow when using Views.
- Don't call `close` on an NSWindow that is never opened.
2024-07-15 16:44:38 -04:00
Marshall Greenblatt 9b284ec8f7 Remove custom chrome scheme handling (see #3685)
- Add CEF info to existing chrome://version WebUI.
- Move chrome://license handling to WebUI.
- Remove chrome://webui-hosts; use chrome://chrome-urls instead.
- Remove chrome://extension-support; navigate to docs directly instead.
2024-07-05 11:58:08 -04:00
Nik Pavlov 231701d98b Expose DumpWithoutCrashing (fixes #3588) 2024-07-02 18:08:16 +00:00
Marshall Greenblatt a461a89728 Delete Alloy bootstrap (fixes #3685) 2024-07-01 12:32:14 -04:00
Marshall Greenblatt c44aa35bfc Update to Chromium version 127.0.6533.0 (#1313161) 2024-06-20 12:09:46 -04:00
Marshall Greenblatt c56ae7213e cefclient: linux: Fix gcc -Werror=parentheses (see #3314) 2024-06-04 11:19:50 -04:00
Marshall Greenblatt 39cafe3e6c tests: Fix URLRequestTest failure with ReduceAcceptLanguage trial 2024-05-31 22:53:09 -04:00
Marshall Greenblatt 15c7e80e3c cefclient: win: Fix MSVC compile error 2024-05-31 13:28:33 -04:00
Marshall Greenblatt 8e79307a62 Pass mime type values as file dialog accept filters (see #3314)
File dialogs that specify mime type (e.g. "image/*") accept filters will pass
those values unchanged to the OnFileDialog |accept_filters| parameter. The
default dialog implementation will show those filters in addition to a combined
"Custom Files" filter. This is a change from preexisting Google Chrome
behavior where only the combined "Custom Files" filter is displayed, and
restores CEF behavior that existed prior to 2ea7459a89.

Document the fact that OnFileDialog may be called twice, once before MIME type
expansion and once afterwards.

Add new OnFileDialog |accept_extensions| and |accept_descriptions| parameters
for MIME type extensions and descriptions.

Details: This change adds a SelectFileDialog::FileTypeInfo::extension_mimetypes
member and improves the logic in FileSelectHelper::GetFileTypesFromAcceptType
and file_dialog_manager.cc SelectFileToFileChooserParams to support recall of
the source mime type when populating the FileChooserParams structure.

To test:
- Run `ceftests --gtest_filter=DialogTest.*`
- Run `cefclient --url=https://tests/dialogs`
2024-05-30 15:38:36 -04:00
Marshall Greenblatt 5fe6382906 cefclient: win: Fix delayload of user32.dll
The WinSboxNoFakeGdiInit feature requires delayload of all DLLs that
might load user32.dll in the renderer process. It's enabled as a field
trial for all non-Official builds, but appears to only work with
non-component Release builds. See https://crbug.com/326277735
2024-05-26 13:45:30 -04:00
Marshall Greenblatt bd1e188c77 tests: Fix SchemeHandlerTest failure with ReduceAcceptLanguage trial 2024-05-26 13:45:29 -04:00
Marshall Greenblatt 701fc03f00 Update to Chromium version 126.0.6478.0 (#1300313) 2024-05-26 13:45:29 -04:00
pkv bc1b856b96 alloy: Fix audio capturer crash on exit (fixes #3689) 2024-05-21 17:58:13 +00:00
Marshall Greenblatt c7b30ee80f cefclient: win: Fix crash on close with --use-native (see #3239)
OnBeforeClose notification is delivered via TabModel destruction in
TabStripModel::SendDetachWebContentsNotifications. We need to let
that call stack unwind before triggering TabStripModel destruction
via closure of the native host window.
2024-05-21 12:58:28 -04:00
Marshall Greenblatt 48137b9538 cefclient: Use default window for DevTools non-Views popup (see #3681)
Chrome runtime only supports creation of a Views-hosted DevTools
popup in ChromeBrowserDelegate::CreateDevToolsBrowser if the parent
is also Views-hosted.

To test:
- Run `cefclient --use-native`
- Right click, select "Show DevTools"
- Close both windows and the app should exit
2024-05-21 12:56:48 -04:00
Marshall Greenblatt 6354d8daf1 Fix dangling raw_ptr errors and related issues (see #3239)
- Use raw_ptr in class container fields.
- Use defined lifespan for StreamReaderURLLoader.
- Fix lifespan assumptions for WebContents/RFH usage.
2024-05-21 12:56:47 -04:00
Marshall Greenblatt 00118ddcdb cefsimple: Enable Chrome runtime by default (see #3685)
Run with `--disable-chrome-runtime` to use the Alloy runtime.
2024-05-09 12:53:43 -04:00
Marshall Greenblatt e7626b2df6 cefclient: Enable Chrome runtime by default (see #3685)
Run with `--disable-chrome-runtime` to use the Alloy runtime.
2024-05-09 12:49:06 -04:00
Marshall Greenblatt 17a1fd62ec tests: Remove extension tests (see #3685)
The Alloy extension API is deprecated and these tests have not been
supported for some time.
2024-05-03 15:23:35 -04:00
Marshall Greenblatt 6b13b1c627 cefclient: Don't call GetExtension when NOTIMPLEMENTED (see #3681) 2024-05-02 19:43:39 -04:00
Marshall Greenblatt b92749a58a Add DISABLE_ALLOY_BOOTSTRAP to cef_config.h (see #3681, see #3685)
Include cef_config.h from base/cef_build.h and fix detection of
args.gn changes so that defines are available everywhere by default.

Fix include configuration for chrome_elf_set and sandbox targets.
2024-05-01 14:34:32 -04:00
Marshall Greenblatt 49a34d9160 Apply new Chromium style for #include sorting
Add "cef/" prefix for CEF #includes in libcef/ directory.

Sort #includes by following
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
2024-05-01 14:34:32 -04:00
Marshall Greenblatt b5d84c254d Add GN arg to disable Alloy bootstrap (see #3681, see #3685)
Set enable_alloy_bootstrap=false to build with Alloy bootstrap code
removed. Extension API is documented as deprecated in comments but
not compiled out with this arg.
2024-05-01 14:34:21 -04:00