Commit Graph

541 Commits

Author SHA1 Message Date
Nik Pavlov 44323082b1 Add binary format support to CefMessageRouter (fixes #3502) 2023-10-25 18:20:55 +00:00
Marshall Greenblatt b2274f534d Update to Chromium version 119.0.6045.0 (#1204232)
Mac: 13.5+ build system w/ 14.0 base SDK (Xcode 15.0) is now required.
2023-10-24 10:56:39 -04:00
Nik Pavlov 15caa9858d Update ipc_performance_test to compare similar transfers (see #3502) 2023-10-18 19:41:33 +00:00
Nik Pavlov 8d7001adc3 Replace ReadOnlySharedMemoryRegion with WritableSharedMemoryRegion (see #3502)
Write access to the shared memory region is required because JavaScript lacks
the capability to create read-only ArrayBuffers. When a user attempts to modify
an ArrayBuffer that utilizes a ReadOnlySharedMemoryRegion as its BackingStore
it triggers an access violation.

Note that this pull request may be reverted in the future if JavaScript adds
read-only ArrayBuffer support.
2023-10-16 22:43:29 +00:00
Marshall Greenblatt 29938f9cb0 Add new CanZoom/Zoom API (fixes #3284)
Add a simpler CanZoom/Zoom API as an alternative to the more error-prone
SetZoomLevel/GetZoomLevel API. Both APIs are now implemented for both runtimes.
With the Chrome runtime a zoom notification bubble will be displayed unless
CefBrowserSettings.chrome_zoom_bubble is set to STATE_DISABLED.

To test:
- Run cefclient and select zoom entries from the Tests menu.
- chrome: Run cefclient with `--hide-chrome-bubbles` command-line flag to hide
  the zoom notification bubble.
2023-10-05 13:22:44 -04:00
Nik Pavlov f8dd0dbfb4 Avoid signed integer overflow UB in IdGenerator 2023-10-05 15:34:40 +00:00
Cristian Amarie bdec92caf8 Add CefDragData::GetFilePaths to return file paths (fixes #3568)
GetFileNames now returns just the display names with a fallback to
path.BaseName() if the display name is empty.
2023-10-04 12:25:52 -04:00
Marshall Greenblatt 39e64d8cc9 chrome: Standardize fullscreen transition behavor/callbacks (fixes #3571)
Use the same code path for all fullscreen transitions so that Chrome UI updates
correctly. All user-initiated fullscreen transitions now result in
CefWindowDelegate::OnWindowFullscreenTransition callbacks.
2023-09-28 17:44:35 -04:00
Marshall Greenblatt ef6ae3071d chrome: Support frameless document PiP window with draggable regions (fixes #3566) 2023-09-14 12:41:24 -04:00
Marshall Greenblatt 0b99f92e97 views: Add support for modal browser dialogs
A modal dialog is a child CefWindow that implements some special behaviors
relative to a parent CefWindow. Like any CefWindow it can be framed with
titlebar or frameless, and optionally contain draggable regions (subject to
platform limitations described below). Modal dialogs are shown centered on
the parent window (inside a single display) and always stay on top of the
parent window in z-order. Sizing behavior and available window buttons are
controlled via the usual CefWindowDelegate callbacks. For example, the dialog
can have a preferred size with resize, minimize and maximize disabled (via
GetPreferredSize, CanResize, CanMinimize and CanMaximize respectively).

This change adds support for two modality modes. With window modality all
controls in the parent window are disabled. With browser modality only the
browser view in the parent window is disabled.

Both modality modes require that a valid parent window be returned via
GetParentWindow. For window modality return true from IsWindowModalDialog
and call CefWindow::Show. For browser modality return false from
IsWindowModalDialog (the default value) and call
CefWindow::ShowAsBrowserModalDialog with a reference to the parent window's
browser view.

Window modal dialog behavior depends on the platform. On Windows and
Linux these dialogs have a titlebar and can be moved independent of the
parent window. On macOS these dialogs do not have a titlebar, move with
the parent window, and do not support draggable regions (because they are
implemented using sheets). On Linux disabling the parent window controls
requires a window manager the supports _NET_WM_STATE_MODAL.

Browser modal dialog behavior is similar on all platforms. The dialog will
be automatically sized and positioned relative to the parent window's
browser view. Closing the parent window or navigating the parent browser
view will dismiss the dialog. The dialog can also be moved independent of
the parent window though it will be recentered when the parent window
itself is resized or redisplayed. On MacOS the dialog will move along with
the parent window while on Windows and Linux the parent window can be moved
independently.

To test: Use the Tests > Dialog Window menu option in cefclient with Views
enabled (`--use-views` or `--enable-chrome-runtime` command-line flag).
Browser modal dialog is the default behavior. For window modal dialog add
the `--use-window-modal-dialog` command-line flag.
2023-06-21 11:18:24 +03:00
Marshall Greenblatt b854992ae6 Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
Marshall Greenblatt 5042d71408 Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
Marshall Greenblatt 695ee2a041 Update to Chromium version 115.0.5790.0 (#1148114)
- Mac: 13.3 SDK (Xcode 14.3) is now required
2023-06-01 13:44:39 +03:00
Nik Pavlov eb63f9e7ae alloy: views: mac: Add three-finger-swipe navigation gesture support
This adds support for the three-finger-swipe navigation gesture with
Alloy/Views. The default implementation matches the Chrome runtime
and navigates the browser back/forward. We also add an Alloy/Views-
specific client callback in CefBrowserViewDelegate for optional
custom handling of the gesture event.
2023-05-26 09:05:33 +00:00
Marshall Greenblatt 5707889555 Add methods for configuring website/content settings (fixes #3490)
This approach is now used to allow popups on a case-by-case basis in
tests instead of globally disabling the popup blocker with the Chrome
runtime.
2023-05-25 11:15:06 +00:00
Marshall Greenblatt e5c4b27366 tools: Fix incorrect SharedMemoryRegion translation (fixes #3498) 2023-05-09 12:37:42 +03:00
Marshall Greenblatt c18545a7f5 Replace NOTREACHED() with DCHECK(false) in generated files (see #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:00 +03:00
Marshall Greenblatt dc9e64308a Replace NOTREACHED() with DCHECK(false) (fixes #3500)
Restores the old behavior of assertion in Debug build only.
2023-05-08 18:36:00 +03:00
Marshall Greenblatt b8e1c6a59d Remove TRACE_EVENT_COPY_XXX overloads (fixes #3497)
This functionality is not compatible with Chromium's new tracing implementation
based on Perfetto.
2023-05-08 18:32:54 +03:00
Takashi Hashida cf14b2a972 Add CefDownloadItem IsInterrupted and GetInterruptReason methods (fixes #3486) 2023-05-06 16:11:16 +03:00
Nik Pavlov cad2498d87 mac: views: Add CefWindowDelegate::OnWindowFullscreenTransition 2023-04-20 14:59:15 +00:00
Marshall Greenblatt 14dd0c0d06 chrome: Add ability to hide toolbar and app menu contents (see issue #3280)
This change adds new CefCommandHandler callbacks for optionally hiding
specific Chrome toolbar icons, buttons and app menu items.

To test: Run `cefclient --enable-chrome-runtime --filter-chrome-commands`.
Most icons, buttons and app/context menu items will be hidden.
2023-03-08 12:02:49 -05:00
Marshall Greenblatt f3b570cf8e win: Remove CefEnableHighDPISupport function (fixes issue #3452)
High-DPI support is now enabled by default in Chromium.
2023-03-03 16:07:29 -05:00
Marshall Greenblatt 584b19967a Update to Chromium version 112.0.5615.0
- Windows: VS2022 and Win11 SDK 10.0.22621.0 are now required.
2023-03-03 09:59:30 -05:00
Nik Pavlov 276423dcfb views: mac: Fix frameless window behavior (fixes issue #3189)
Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
2023-02-28 18:34:12 +00:00
Marshall Greenblatt ff68c01543 chrome: Use default Browser creation for picture-in-picture popups (see issue #3448)
Note: In current master (based on M111), document PiP partially works when
run with the `--enable-features=DocumentPictureInPictureAPI` command-line
flag. However, the document PiP implementation at this Chromium version is
missing fixes that have already been cherry-picked to the 5563 release
branch. Those fixes will only be available in master after the next Chromium
update (to M112).
2023-02-10 15:42:37 -05:00
Marshall Greenblatt dc2231cdfb Update to Chromium version 111.0.5563.0 (#1097615) 2023-02-03 13:00:26 -05:00
Marshall Greenblatt 83cb82d50f Rename namespace to "cef_internal" for base types
This fixes duplicate symbol errors when building CEF sample applications as
part of the Chromium build. These applications pick up a link-time dependency
on base.lib via the //sandbox and/or //testing/gtest targets which then
conflict with the symbols provided by the libcef_dll_wrapper target.
2023-01-04 21:36:29 -05:00
Marshall Greenblatt 3af3eab3e4 Update source files for bracket style 2023-01-04 17:47:17 -05:00
Marshall Greenblatt d84b07a5cb Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
Marshall Greenblatt 47d69a842a Update to Chromium version 109.0.5414.0 (#1070088)
- mac: Xcode 14.0 with macOS SDK 13.0 is now required.
- Remove CefRequestHandler::OnQuotaRequest because persistent quota is no
  longer supported (see https://crbug.com/1208141)
2022-11-17 12:50:15 -05:00
Marshall Greenblatt e2a9236106 cefclient: win: Support window state restore (see issue #3359)
The cefclient sample app on Windows will persist window state across application
restart if run with cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
2022-11-07 15:21:46 -05:00
Marshall Greenblatt 882bc19fdd cefclient: views: Support window state restore (see issue #3359)
The cefclient sample app will persist window state across application restart
if run with views, cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --use-views --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
2022-10-28 14:28:53 -04:00
Marshall Greenblatt 09bb643ef6 Support registration of custom preferences.
Custom global and request context preferences can now be registered via
CefBrowserProcessHandler::OnRegisterCustomPreferences. CefRequestContext
now extends CefPreferenceManager and global preferences can be accessed
via CefPreferenceManager::GetGlobalPreferenceManager.
2022-10-26 16:54:33 -04:00
Marshall Greenblatt 07bf5dbacc windows: Configure stack size for executables (fixes issue #3250)
Change the default stack size to 8 MiB for 64-bit and 0.5 MiB for 32-bit.

CEF's main thread needs at least a 1.5 MiB stack size in order to avoid
stack overflow crashes. However, if this is set in the PE file then other
threads get this size as well, leading to address-space exhaustion in 32-bit
CEF. A new CefRunWinMainWithPreferredStackSize function uses fibers to switch
the main thread to a 4 MiB stack (roughly the same effective size as the
64-bit build's 8 MiB stack) before running any other code.

This change additionally moves the existing Windows-only functions
CefSetOSModalLoop and CefEnableHighDPISupport from cef_app.h to cef_win.h.
2022-10-21 14:52:50 -04:00
Marshall Greenblatt 8b45f32b33 Update to Chromium version 108.0.5359.0 (#1058933) 2022-10-18 17:58:41 -04:00
npavlov 485f0b9caf Add screen pixel to screen DIP conversion methods.
On Windows these new CefDisplay methods convert between screen pixel coordinates
and screen DIP coordinates. On macOS and Linux these methods just return a copy
of the input coordinates.
2022-10-14 13:55:07 -04:00
VodBox fa643b269e Add support for native creation and resolution of Promises (fixes issue #3305) 2022-10-11 14:55:12 -04:00
Jelle Bleyaert e0c878df5f Add CefResolveURL function (fixes issue #3402) 2022-10-03 17:46:50 +00:00
Marshall Greenblatt 5ea0c141b5 Convert base::size to std::size from C++17 (see issue #3362) 2022-09-05 16:31:47 -04:00
Marshall Greenblatt 18dac30874 Support configuration of the CefTestServer certificate type (see issue #3348) 2022-08-04 12:37:12 -04:00
Marshall Greenblatt dcd4a0077c Include net test data in the binary distribution (see issue #3348) 2022-08-03 16:28:52 -04:00
Marshall Greenblatt f24dd61329 Add CefTestServer that supports both HTTP and HTTPS (see issue #3348) 2022-08-01 16:20:03 -04:00
Marshall Greenblatt 9af494d36c Update to Chromium version 105.0.5195.0 (#1027018) 2022-07-25 23:47:56 -04:00
Dmitry Azaraev 27d3089804 Add CefBaseTime and use it instead of CefTime (see issue #2935) 2022-07-19 10:09:35 -04:00
Marshall Greenblatt dad9bf87ef Stop using CefStructBase for POD types (fixes issue #3357) 2022-07-14 08:13:29 +00:00
Marshall Greenblatt c49ffa9723 Update libcef_dll_dylib.cc for compiler deduce types 2022-07-08 14:37:58 +03:00
Marshall Greenblatt e4b9169221 Add CefPermissionHandler callbacks for permission prompts (see issue #3352) 2022-07-07 10:01:24 +00:00
Nik Pavlov 81e892d19e Add a shared memory variant of CefProcessMessage (fixes issue #3126)
CefSharedProcessMessageBuilder supports creation of a CefProcessMessage
backed by a CefSharedMemoryRegion.

Performance tests comparing the existing ArgumentList approach and the new
SharedMemoryRegion approach have been added to cefclient at
http://tests/ipc_performance.

CefMessageRouter has been updated to use SharedMemoryRegion as transport
for larger message payloads. The threshold is configurable via
|CefMessageRouterConfig.message_size_threshold|.

To test:
run `ceftests --gtest_filter=SendSharedProcessMessageTest.*:SharedProcessMessageTest.*:MessageRouterTest.Threshold*`
2022-07-04 09:49:15 +00:00
Marshall Greenblatt daa89115d5 Add OnMediaAccessChange notification (fixes issue #3310) 2022-06-30 12:22:28 +00:00