Commit Graph

1647 Commits

Author SHA1 Message Date
Marshall Greenblatt 271c6f6446 Fix credentials mode for fetch request redirect (fixes #3675)
Also verified that https://browseraudit.com/ gives the same results
both with and without `--disable-request-handling-for-testing`.
2024-05-06 15:10:12 -04:00
Marshall Greenblatt 311eaf827e alloy: Add missing geolocation pref registration (fixes #3694) 2024-05-06 11:58:55 -04:00
Marshall Greenblatt ca636bb96e chrome: Support CefResourceBundleHandler (see #3685) 2024-05-03 12:51:09 -04:00
Marshall Greenblatt 4e3668f93a chrome: Support CefSettings logging config (see #3685)
Also enables logging by default for Release builds (previously
required the `--enable-logging` flag). Logging can still be
disabled by passing the `--disable-logging` flag.
2024-05-02 19:43:39 -04:00
Marshall Greenblatt 29381355ef chrome: Support CefSettings path config (see #3685) 2024-05-02 19:43:39 -04:00
Marshall Greenblatt 7328b9e40d views: Support themes for Alloy BrowserView in Chrome Window (see #3681)
To test:
- Run `cefclient --enable-chrome-runtime --use-alloy-style
                 --use-chrome-style-window [--background-color=green]`
- OS and Chrome theme changes behave as expected.
2024-05-02 11:21:49 -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 fe5b0dd668 chrome: osr: Fix performance manager init (see #3681) 2024-04-27 15:36:59 -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 708d90a6ff chrome: osr: Create CefWebContentsViewOSR for guest views (see #3681)
Match the logic in Alloy's CefMimeHandlerViewGuestDelegate.
2024-04-26 10:31:40 -04:00
Marshall Greenblatt 5065aba1b4 Remove explicit tracking of guest view frames
This is no longer required now that we have implicit exclusion
of certain frame types including guest view frames.

Rename GuestView to ExcludedView in the renderer process.
2024-04-26 10:31:40 -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
Marshall Greenblatt b67cbc47e3 Update to Chromium version 125.0.6422.0 (#1287751) 2024-04-25 18:43:05 -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
Marshall Greenblatt 62c93f01f4 Avoid possible reentrancy of ThemeChanged (see #3671)
The call to SelectNativeTheme from ChromeBrowserFrame::Initialized was
causing Widget::ThemeChanged reentrancy via OnColorProviderCacheResetMissed
when running with `--enable-chrome-runtime --use-native`. Make all calls to
ThemeChanged async to avoid this and possible future issues.
2024-04-14 21:43:44 -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 29c21f58e8 views: Generate cef_color_ids.h header (see #3671) 2024-04-03 12:09:22 -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 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 5e616b2df0 Improve crash reporting of frame connection retry failures (see #3664)
Introduce different call stacks for different types of disconnects,
and log additional state information in the FATAL message.
2024-03-08 14:24:32 -05: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
Nik Pavlov ffea0d9c4a chrome: Add SetAccessibilityState support (fixes #3649) 2024-02-20 16:27:48 +00:00
Marshall Greenblatt 706193f3d9 Reland "alloy: Allow --remote-debugging-port=0 (fixes #3619)"
This relands commit 70471059cf
with necessary changes.
2024-02-15 16:12:47 -05:00
Marshall Greenblatt bfed26c5fc alloy: Fix crash on JS dialog from PDF viewer (fixes #3644) 2024-02-15 15:35:11 -05:00
Marshall Greenblatt 90775f149f Revert "alloy: Allow --remote-debugging-port=0 (fixes #3619)"
Reason for the revert: Incorrectly enables DevTools remote debugging
by default.

This reverts commit 70471059cf.
2024-02-14 20:02:20 -05:00
Marshall Greenblatt f071a4a988 alloy: Fix crash when accessing FirstPartySets (fixes #3643)
Initialize FirstPartySets without PrivacySandbox or IdentityManager
dependencies.
2024-02-14 18:51:32 -05:00
Marshall Greenblatt cc3d77eec5 chrome: Enforce matching context for new user and incognito profiles
Selecting a new user or incognito profile via Chrome UI may result in
the creation of a new Profile object. If that occurs, we should find
or create a matching CefBrowserContext and CefRequestContext instead
of reusing an existing mismatched context (e.g. using the original
context for an incognito window would be a mismatch). If a new
CefRequestContext will be created the client can now implement
CefBrowserProcessHandler::GetDefaultRequestContextHandler() to
provide the handler for that context.

To test with a new user profile:
1. Click "Profile" icon, select "Add". Now you have 2+ profiles.
2. Click "Profile" icon, select the other user name to create a new
   window using the other user profile.
3. The new window should launch successfully.

To test with a new incognito profile:
1. Select "New Incognito window" from the 3-dot menu.
2. The new window should launch successfully.

To test DevTools window creation for the new profile:
1. Right-click in the new window, select Inspect.
2. The DevTools window should launch successfully.
2024-02-14 18:51:32 -05:00
Vladimir Kharitonov 70471059cf alloy: Allow --remote-debugging-port=0 (fixes #3619) 2024-02-07 18:42:06 +00:00
Marshall Greenblatt 5dc3cc13e7 chrome: win: Fix taskbar grouping of PiP and DevTools windows (fixes #3641) 2024-02-06 13:55:01 -05:00
Shezan Baig 69fd43f789 Always assign |is_guest_view| in CefBrowserInfo::GetFrameForGlobalToken 2024-02-05 16:31:04 +00: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 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 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 a0446a3c8a Fix clang-tidy warnings (see #3632) 2024-01-21 14:18:09 -05:00
Marshall Greenblatt a02d2ab3e6 libcef: Format with clang-tidy (see #3632) 2024-01-20 19:33:17 -05:00
Marshall Greenblatt 5af6227a6f chrome: Improve positioning of dialogs (fixes #3628)
Dialogs will be excluded from regions near the top of the window
that contain overlays, draggable regions or titlebar.
2024-01-12 18:13:36 -05:00
Marshall Greenblatt a097b62b6e alloy: Update extensions-related interface registration to match chrome 2024-01-08 14:20:45 -05:00
Marshall Greenblatt ffc703276a alloy: Fix print preview WebUI registration (fixes #3625) 2024-01-08 13:50:50 -05:00
Julien Bouix 3592d36808 osr: Fix potential null ptr dereference during DnD 2024-01-05 20:20:37 +00:00
Sergey Markelov 7c2bd75f7a docs: Fix typos "recieve" -> "receive" 2024-01-05 15:03:20 -05:00
Philipp Thiel 5a9b8e2bc4 views: Add can_activate parameter to AddOverlayView 2024-01-05 13:46:49 -05:00
Marshall Greenblatt 1f55d2e12f osr: Fix potential shared memory OOB access 2024-01-05 12:14:58 -05:00