Commit Graph

1049 Commits

Author SHA1 Message Date
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
Marshall Greenblatt c0e7854782 cefclient: osr: Fix compile errors with binary distribution (see #2575) 2024-04-27 15:36:58 -04:00
Marshall Greenblatt be6642df3f chrome: Add CefDownloadHandler support (see #3681)
Behaves the same as Alloy runtime except that CanDownload is not
called for invalid protocol schemes.
2024-04-27 15:36:58 -04:00
Marshall Greenblatt ed079792b6 chrome: Add extension support for Alloy style browsers (see #3681)
This change adds minimal tabs API support for Alloy style browsers.
Clicking links in PDF documents now navigate as expected.
2024-04-27 15:36:58 -04:00
Marshall Greenblatt 65234a6830 Ignore load of excluded PDF renderer frames
Starting with M125 we get WebContentsObserver callbacks for speculative
PDF renderer frames. These callbacks should be ignored.
2024-04-26 10:31:40 -04:00
reito 260dd0ca24 osr: Implement shared texture support (fixes #1006, fixes #2575)
Adds support for the OnAcceleratedPaint callback. Verified to work
on macOS and Windows. Linux support is present but not implemented
for cefclient, so it is not verified to work.

To test:
Run `cefclient --off-screen-rendering-enabled --shared-texture-enabled`
2024-04-23 13:03:56 -04:00
Marshall Greenblatt dca0435d2f chrome: Add support for Alloy style browsers and windows (see #3681)
Split the Alloy runtime into bootstrap and style components. Support
creation of Alloy style browsers and windows with the Chrome runtime.
Chrome runtime (`--enable-chrome-runtime`) + Alloy style
(`--use-alloy-style`) supports Views (`--use-views`), native parent
(`--use-native`) and windowless rendering
(`--off-screen-rendering-enabled`).

Print preview is supported in all cases except with windowless rendering
on all platforms and native parent on MacOS. It is disabled by default
with Alloy style for legacy compatibility. Where supported it can be
enabled or disabled globally using `--[enable|disable]-print-preview` or
configured on a per-RequestContext basis using the
`printing.print_preview_disabled` preference. It also behaves as
expected when triggered via the PDF viewer print button.

Chrome runtime + Alloy style behavior differs from Alloy runtime in the
following significant ways:

- Supports Chrome error pages by default.
- DevTools popups are Chrome style only (cannot be windowless).
- The Alloy extension API will not supported.

Chrome runtime + Alloy style passes all expected Alloy ceftests except
the following:

- `DisplayTest.AutoResize` (Alloy extension API not supported)
- `DownloadTest.*` (Download API not yet supported)
- `ExtensionTest.*` (Alloy extension API not supported)

This change also adds Chrome runtime support for
CefContextMenuHandler::RunContextMenu (see #3293).

This change also explicitly blocks (and doesn't retry) FrameAttached
requests from PDF viewer and print preview excluded frames (see #3664).

Known issues specific to Chrome runtime + Alloy style:
- DevTools popup with windowless rendering doesn't load successfully.
  Use windowed rendering or remote debugging as a workaround.
- Chrome style Window with Alloy style BrowserView (`--use-alloy-style
  --use-chrome-style-window`) does not show Chrome theme changes.

To test:
- Run `ceftests --enable-chrome-runtime --use-alloy-style
       [--use-chrome-style-window] [--use-views|--use-native]
       --gtest_filter=...`
- Run `cefclient --enable-chrome-runtime --use-alloy-style
       [--use-chrome-style-window]
       [--use-views|--use-native|--off-screen-rendering-enabled]`
- Run `cefsimple --enable-chrome-runtime --use-alloy-style [--use-views]`
2024-04-22 14:57:37 -04:00
Nik Pavlov 744a194a6e mac: views: Add customization point for acceptsFirstMouse (fixes #3680) 2024-04-12 15:49:31 +00:00
Nik Pavlov 96dc172980 Fix how CefV8ValueImpl differentiates INT and UINT types (fixes #3657) 2024-04-12 15:37:33 +00:00
Marshall Greenblatt f1effba336 views: Fix destruction issues with CefOverlayViewHost 2024-04-11 15:51:42 -04:00
Marshall Greenblatt f60476b848 views: Add support for OS and Chrome themes (fixes #3610, fixes #3671)
Controls now respect OS and Chrome themes by default for both Alloy
and Chrome runtimes. Chrome themes (mode and colors) can be configured
using the new CefRequestContext::SetChromeColorScheme method. Individual
theme colors can be overridden using the new CefWindowDelegate::
OnThemeColorsChanged and CefWindow::SetThemeColor methods.

The `--force-light-mode` and `--force-dark-mode` command-line flags are
now respected on all platforms as an override for the OS theme.

The current Chrome theme, if any, will take precedence over the OS theme
when determining light/dark status. On Windows and MacOS the titlebar
color will also be updated to match the light/dark theme.

Testable as follows:
- Run: `cefclient --enable-chrome-runtime` OR
       `cefclient --use-views --persist-user-preferences --cache-path=...`
  - App launches with default OS light/dark theme colors.
  - Change OS dark/light theme under system settings. Notice that theme
    colors change as expected.
  - Right click, select items from the new Theme sub-menu. Notice that
    theme colors behave as expected.
  - Exit and relaunch the app. Notice that the last-used theme colors are
    applied on app restart.
- Add `--background-color=green` to above command-line.
  - Perform the same actions as above. Notice that all controls start
    and remain green throughout (except some icons with Chrome runtime).
- Add `--force-light-mode` or `--force-dark-mode` to above command-line.
  - Perform the same actions as above. Notice that OS dark/light theme
    changes are ignored, but Chrome theme changes work as expected.
2024-04-09 16:19:35 -04:00
Marshall Greenblatt 6253e69b70 views: cefclient: Fix initial toolbar button state 2024-03-28 11:35:37 -04:00
Marshall Greenblatt 19ba8b2b8d views: Use default theme background color for all controls (see #3671)
Add new CefViewDelegate::OnThemeChanged callback for optionally overriding
default theme colors when the current theme changes.
2024-03-28 11:35:37 -04:00
Marshall Greenblatt 52dac91167 Update to Chromium version 124.0.6367.0 (#1274542) 2024-03-22 13:46:28 -04:00
Marshall Greenblatt 526e934a12 ceftests: Check CefInitialize return value (see #3609) 2024-03-18 18:33:38 -04:00
Marshall Greenblatt b8f91c5431 Add callbacks for unresponsive render process (fixes #3661)
The client can optionally wait or terminate the render process.

Expose process exit codes via OnRenderProcessTerminated and
CefGetExitCode (fixes #2126).

cefclient: Add a new https://tests/hang page for testing hang behavior.

cefclient: Move message and resource handling to a new BaseClientHandler
class to support loading of test pages in default Chrome UI windows.
2024-03-18 17:45:31 -04:00
Marshall Greenblatt d4cf19db29 Update to Chromium version 123.0.6312.0 (#1262506)
- MacOS ARM64 Official builds are currently failing due to
  https://issues.chromium.org/issues/326898585
2024-02-26 12:08:55 -05:00
Marshall Greenblatt a79981bf7f chrome: cefclient: Add support for --request-context-per-browser
Wait for the OnRequestContextInitialized callback before using a
non-global CefRequestContext.

Use default handling of --load-extension for Chrome runtime (fixes #3529).
2024-02-14 18:51:32 -05:00
Marshall Greenblatt d3a483ef59 Fix singleton relaunch issues with multi-threaded-message-loop (fixes #3635)
- Fix UI thread shutdown issues on early app exit.
- views: cefclient: Fix threading requirements in RootWindowViews::Init when
  called on the UI thread via OnAlreadyRunningAppRelaunch.
2024-01-30 17:13:51 -05:00
Marshall Greenblatt bdb070c85c mac: Update target SDK to 10.15 for cmake and tests 2024-01-30 12:33:53 -05:00
Marshall Greenblatt 57bad703ee views: mac: Add CEF_SHOW_STATE_HIDDEN (fixes #3630)
- Adds `--initial-show-state=hidden` support for cefclient and cefsimple
  where the window launches as initially hidden (no dock thumbnail).
- Adds `--hide-window-on-close` support for cefclient where clicking the
  red traffic light button hides the window instead of closing it.
2024-01-30 12:16:03 -05:00
Marshall Greenblatt 47fe9f834a cefclient: linux: Add missing math.h include (see #3187) 2024-01-30 12:07:08 -05:00
Marshall Greenblatt 2f1e782f62 Update to Chromium version 122.0.6261.0 (#1250580)
Frame identifiers have changed from int64_t to string type. This is due
to https://crbug.com/1502660 which removes access to frame routing IDs
in the renderer process. New cross-process frame identifiers are 160-bit
values (32-bit child process ID + 128-bit local frame token) and most
easily represented as strings. All other frame-related expectations and
behaviors remain the same.
2024-01-30 12:07:08 -05:00
Marshall Greenblatt 2a86a02bdd ceftests: Avoid shutdown hang due to leaked TestHandlers 2024-01-26 14:12:11 -05:00
Marshall Greenblatt a0446a3c8a Fix clang-tidy warnings (see #3632) 2024-01-21 14:18:09 -05:00
Marshall Greenblatt befa827da1 ceftests: Format with clang-tidy (see #3632) 2024-01-20 12:06:28 -05:00
Marshall Greenblatt 0a64bb6f9b tests: Format with clang-tidy (see #3632) 2024-01-19 21:42:21 -05:00